@@ -36,14 +36,16 @@ class SimpleDQM : public art::EDAnalyzer
3636 Name (" address" ),
3737 Comment (" This paramter sets the IP address where the "
3838 " histogram will be sent" )};
39- fhicl::Atom<std::string> outputTag{Name (" outputTag" ), Comment (" Tag to use in output name" )};
40- fhicl::Atom<int > freqDQM{
41- Name (" freqDQM" ),
42- Comment (" Frequency for sending histograms to the data-receiver" )};
43- fhicl::Atom<int > diag{Name (" diagLevel" ), Comment (" Diagnostic level" ), 0 };
39+ fhicl::Atom<std::string> outputTag{Name (" outputTag" ),
40+ Comment (" Tag to use in output name" )};
41+ fhicl::Atom<int > freqDQM{
42+ Name (" freqDQM" ),
43+ Comment (" Frequency for sending histograms to the data-receiver" )};
44+ fhicl::Atom<int > diag{Name (" diagLevel" ), Comment (" Diagnostic level" ), 0 };
4445 fhicl::Atom<bool > sendHists{
4546 Name (" sendHists" ),
46- Comment (" Whether or not to send histograms to the receiver" ), true };
47+ Comment (" Whether or not to send histograms to the receiver" ),
48+ true };
4749 };
4850
4951 typedef art::EDAnalyzer::Table<Config> Parameters;
@@ -61,12 +63,12 @@ class SimpleDQM : public art::EDAnalyzer
6163 std::string address_;
6264 std::string outputTag_;
6365 int freqDQM_, diagLevel_, evtCounter_;
64- bool sendHists_;
66+ bool sendHists_;
6567 art::ServiceHandle<art::TFileService> tfs;
6668 HistoSender* histSender_;
6769
68- // Simple event counter
69- TH1* hist_;
70+ // Simple event counter
71+ TH1* hist_;
7072};
7173} // namespace ots
7274
@@ -81,47 +83,52 @@ ots::SimpleDQM::SimpleDQM(Parameters const& conf)
8183 , evtCounter_(0 )
8284 , sendHists_(conf().sendHists())
8385{
84- histSender_ = (sendHists_) ? new HistoSender (address_, port_) : nullptr ;
86+ histSender_ = (sendHists_) ? new HistoSender (address_, port_) : nullptr ;
8587
8688 __COUT__ << " [SimpleDQM::" << __func__ << " ] Constructor" << std::endl;
8789}
8890
8991void ots::SimpleDQM::beginJob ()
9092{
91- __COUT__ << " [SimpleDQM::" << __func__ << " ] Beginning job" << std::endl;
93+ __COUT__ << " [SimpleDQM::" << __func__ << " ] Beginning job" << std::endl;
9294
9395 // Create the histograms of interest
9496 art::TFileDirectory dir = tfs->mkdir (outputTag_);
9597 hist_ = dir.make <TH1F>(" event_count" , " Event counter;Bin;Events" , 1 , 0 , 1 );
9698 hist_->SetLineWidth (2 );
97- hist_->SetFillColor (kAzure - 9 );
98- hist_->SetLineColor (kAzure + 2 );
99+ hist_->SetFillColor (kAzure - 9 );
100+ hist_->SetLineColor (kAzure + 2 );
99101 hist_->SetFillStyle (3001 );
100102}
101103
102104void ots::SimpleDQM::analyze (art::Event const & event)
103105{
104- // fill the histograms of interest
106+ // fill the histograms of interest
105107 ++evtCounter_;
106108 hist_->Fill (1 );
107- TLOG (TLVL_DEBUG + 20 ) << " [SimpleDQM::" << __func__ << " ] Analyzing event " << evtCounter_ << std::endl;
109+ TLOG (TLVL_DEBUG + 20 ) << " [SimpleDQM::" << __func__ << " ] Analyzing event "
110+ << evtCounter_ << std::endl;
108111
109112 // Only send histograms at a given frequency
110- if (evtCounter_ % freqDQM_ != 0 || !sendHists_) return ;
113+ if (evtCounter_ % freqDQM_ != 0 || !sendHists_)
114+ return ;
111115
112116 // Add a clone of the histogram to a map of <path/in/output, <list of histograms>>
113117 std::map<std::string, std::vector<TH1*>> hists_to_send;
114- TLOG (TLVL_DEBUG + 5 ) << " [SimpleDQM::" << __func__ << " ] collecting summary histogram "
115- << hist_->GetName () << std::endl;
118+ TLOG (TLVL_DEBUG + 5 ) << " [SimpleDQM::" << __func__
119+ << " ] collecting summary histogram " << hist_->GetName ()
120+ << std::endl;
116121 // histograms can be replaced with ":replace" or added together with ":add" appended to the directory path
117- hists_to_send[outputTag_ + " _summary:replace" ].push_back ((TH1*) hist_->Clone ());
122+ hists_to_send[outputTag_ + " _summary:replace" ].push_back ((TH1*)hist_->Clone ());
118123
119124 // send the histograms to the receiver
120125 histSender_->sendHistograms (hists_to_send);
121126}
122127
123- void ots::SimpleDQM::endJob () {
124- __COUT__ << " [SimpleDQM::" << __func__ << " ] Ending job, saw " << evtCounter_ << " events\n " ;
128+ void ots::SimpleDQM::endJob ()
129+ {
130+ __COUT__ << " [SimpleDQM::" << __func__ << " ] Ending job, saw " << evtCounter_
131+ << " events\n " ;
125132}
126133
127134void ots::SimpleDQM::beginRun (const art::Run&) {}
0 commit comments