Skip to content

Commit

Permalink
Merge pull request #9 from Mu2e/rrivera/simpliefiedCOUT
Browse files Browse the repository at this point in the history
Simplified COUT macros
  • Loading branch information
rrivera747 authored Dec 12, 2024
2 parents aa5ec49 + b15cefd commit bc5c616
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 38 deletions.
10 changes: 5 additions & 5 deletions otsdaq-mu2e-dqm/ArtModules/CaloDQM_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ ots::CaloDQM::CaloDQM(Parameters const& conf)
histSender_ = new HistoSender(address_, port_);

if (diagLevel_>0){
__MOUT__ << "[CaloDQM::analyze] DQM for "<< histType_[0] << std::endl;
__COUT__ << "[CaloDQM::analyze] DQM for "<< histType_[0] << std::endl;
}

for (std::string name : histType_) {
Expand All @@ -89,7 +89,7 @@ ots::CaloDQM::CaloDQM(Parameters const& conf)
}

void ots::CaloDQM::beginJob() {
__MOUT__ << "[CaloDQM::beginJob] Beginning job" << std::endl;
__COUT__ << "[CaloDQM::beginJob] Beginning job" << std::endl;
summary_histos->BookSummaryHistos(tfs,
"Calo hits, nHits; nCaloHits; Events/60" ,
200, 0, 12e3);
Expand Down Expand Up @@ -122,7 +122,7 @@ void ots::CaloDQM::analyze(art::Event const& event) {

//send the summary hists
for (size_t i = 0; i < summary_histos->histograms.size(); i++) {
__MOUT__ << "[CaloDQM::analyze] collecting summary histogram "<< summary_histos->histograms[i]._Hist << std::endl;
__COUT__ << "[CaloDQM::analyze] collecting summary histogram "<< summary_histos->histograms[i]._Hist << std::endl;
hists_to_send[moduleTag_+"_summary"].push_back((TH1*)summary_histos->histograms[i]._Hist->Clone());
summary_histos->histograms[i]._Hist->Reset();
}
Expand All @@ -135,10 +135,10 @@ void ots::CaloDQM::analyze(art::Event const& event) {
void ots::CaloDQM::summary_fill(CaloDQMHistoContainer *histos,
const mu2e::CaloHitCollection *CaloHits,
const mu2e::CaloClusterCollection *Clusters) {
// __MOUT__ << "filling Summary histograms..."<< std::endl;
// __COUT__ << "filling Summary histograms..."<< std::endl;

if (histos->histograms.size() == 0) {
__MOUT__ << "No histograms booked. Should they have been created elsewhere?"
__COUT__ << "No histograms booked. Should they have been created elsewhere?"
<< std::endl;
} else {

Expand Down
10 changes: 5 additions & 5 deletions otsdaq-mu2e-dqm/ArtModules/IntensityInfoDQM_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ ots::IntensityInfoDQM::IntensityInfoDQM(Parameters const& conf)
histSender_ = new HistoSender(address_, port_);

if (diagLevel_>0){
__MOUT__ << "[IntensityInfoDQM::analyze] DQM for "<< histType_[0] << std::endl;
__COUT__ << "[IntensityInfoDQM::analyze] DQM for "<< histType_[0] << std::endl;
}

for (std::string name : histType_) {
Expand All @@ -91,7 +91,7 @@ ots::IntensityInfoDQM::IntensityInfoDQM(Parameters const& conf)
}

void ots::IntensityInfoDQM::beginJob() {
__MOUT__ << "[IntensityInfoDQM::beginJob] Beginning job" << std::endl;
__COUT__ << "[IntensityInfoDQM::beginJob] Beginning job" << std::endl;
summary_histos->BookSummaryHistos(tfs,
"CAPHRI hits; nCAPHRIHits; Events",
100, 0, 100);
Expand Down Expand Up @@ -131,7 +131,7 @@ void ots::IntensityInfoDQM::analyze(art::Event const& event) {

//send the summary hists
for (size_t i = 0; i < summary_histos->histograms.size(); i++) {
__MOUT__ << "[IntensityInfoDQM::analyze] collecting summary histogram "<< summary_histos->histograms[i]._Hist << std::endl;
__COUT__ << "[IntensityInfoDQM::analyze] collecting summary histogram "<< summary_histos->histograms[i]._Hist << std::endl;
hists_to_send[moduleTag_+"_summary"].push_back((TH1*)summary_histos->histograms[i]._Hist->Clone());
summary_histos->histograms[i]._Hist->Reset();
}
Expand All @@ -145,10 +145,10 @@ void ots::IntensityInfoDQM::summary_fill(IntensityInfoDQMHistoContainer *h
const mu2e::CaloHitCollection *CAPHRIHits,
const mu2e::IntensityInfoCalo *CaloInfos,
const mu2e::IntensityInfoTrackerHits *TrkInfos) {
// __MOUT__ << "filling Summary histograms..."<< std::endl;
// __COUT__ << "filling Summary histograms..."<< std::endl;

if (histos->histograms.size() == 0) {
__MOUT__ << "No histograms booked. Should they have been created elsewhere?"
__COUT__ << "No histograms booked. Should they have been created elsewhere?"
<< std::endl;
} else {

Expand Down
10 changes: 5 additions & 5 deletions otsdaq-mu2e-dqm/ArtModules/SimpleDQM_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ ots::SimpleDQM::SimpleDQM(Parameters const& conf)
histSender_ = new HistoSender(address_, port_);

if (diagLevel_>0){
__MOUT__ << "[SimpleDQM::analyze] DQM for "<< histType_[0] << std::endl;
__COUT__ << "[SimpleDQM::analyze] DQM for "<< histType_[0] << std::endl;
}

for (std::string name : histType_) {
Expand All @@ -86,7 +86,7 @@ ots::SimpleDQM::SimpleDQM(Parameters const& conf)
}

void ots::SimpleDQM::beginJob() {
__MOUT__ << "[SimpleDQM::beginJob] Beginning job" << std::endl;
__COUT__ << "[SimpleDQM::beginJob] Beginning job" << std::endl;
summary_histos->BookSummaryHistos(tfs,
"Trigger counts", 1, 0, 1);
}
Expand All @@ -104,7 +104,7 @@ void ots::SimpleDQM::analyze(art::Event const& event) {

//send the summary hists
for (size_t i = 0; i < summary_histos->histograms.size(); i++) {
__MOUT__ << "[SimpleDQM::analyze] collecting summary histogram "<< summary_histos->histograms[i]._Hist << std::endl;
__COUT__ << "[SimpleDQM::analyze] collecting summary histogram "<< summary_histos->histograms[i]._Hist << std::endl;
hists_to_send[moduleTag_+"_summary"].push_back((TH1*)summary_histos->histograms[i]._Hist->Clone());
summary_histos->histograms[i]._Hist->Reset();
}
Expand All @@ -115,10 +115,10 @@ void ots::SimpleDQM::analyze(art::Event const& event) {


void ots::SimpleDQM::summary_trigger_fill(SimpleDQMHistoContainer *histos) {
// __MOUT__ << "filling Summary histograms..."<< std::endl;
// __COUT__ << "filling Summary histograms..."<< std::endl;

if (histos->histograms.size() == 0) {
__MOUT__ << "No histograms booked. Should they have been created elsewhere?"
__COUT__ << "No histograms booked. Should they have been created elsewhere?"
<< std::endl;
} else {
histos->histograms[1]._Hist->Fill(0);
Expand Down
20 changes: 10 additions & 10 deletions otsdaq-mu2e-dqm/ArtModules/TrackerDQM.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ unsigned short max_adc(const mu2e::TrkTypes::ADCWaveform &adcs) {


void summary_fill(TrackerDQMHistoContainer *histos, const mu2e::StrawId& sid) {
// __MOUT__ << "filling Summary histograms..."<< std::endl;
// __COUT__ << "filling Summary histograms..."<< std::endl;

if (histos->histograms.size() == 0) {
__MOUT__ << "No histograms booked. Should they have been created elsewhere?"
__COUT__ << "No histograms booked. Should they have been created elsewhere?"
<< std::endl;
} else {

Expand All @@ -53,27 +53,27 @@ void summary_fill(TrackerDQMHistoContainer *histos, const mu2e::StrawId& sid) {

void pedestal_fill(TrackerDQMHistoContainer *histos, int data, std::string title,
const mu2e::StrawId& sid) {
// __MOUT__ << title.c_str() + "_"+std::to_string(sid.plane()) + " "
// __COUT__ << title.c_str() + "_"+std::to_string(sid.plane()) + " "
// + std::to_string(sid.panel()) + " "
// + std::to_string(sid.straw())
// << std::endl;

if (histos->histograms.size() == 0) {
__MOUT__ << "No histograms booked. Should they have been created elsewhere?"
__COUT__ << "No histograms booked. Should they have been created elsewhere?"
<< std::endl;
} else {
for (int histIdx = 0; histIdx < int(histos->histograms.size()); ++histIdx) {
if ((sid.straw() == histos->histograms[histIdx].straw) &&
(sid.panel() == histos->histograms[histIdx].panel) &&
(sid.plane() == histos->histograms[histIdx].plane) ) { // if the histogram does exist, fill it
histos->histograms[histIdx]._Hist->Fill(data);
// __MOUT__ << "number of histos: " << histos->histograms.size()
// __COUT__ << "number of histos: " << histos->histograms.size()
// << std::endl;
break;
}

if (histIdx == int(histos->histograms.size() - 1)) {
__MOUT__ << "Cannot find histogram: "
__COUT__ << "Cannot find histogram: "
<< title + std::to_string(sid.plane()) + " " +
std::to_string(sid.panel()) + " " +
std::to_string(sid.straw())
Expand All @@ -86,24 +86,24 @@ void pedestal_fill(TrackerDQMHistoContainer *histos, int data, std::string title
void panel_fill(TrackerDQMHistoContainer *histos, std::string title,
const mu2e::StrawId& sid) {
if (histos->histograms.size() == 0) {
__MOUT__ << "No histograms booked. Should they have been created elsewhere?"
__COUT__ << "No histograms booked. Should they have been created elsewhere?"
<< std::endl;
} else {
bool foundHist(false);
for (int histIdx = 0; histIdx < int(histos->histograms.size()); ++histIdx) {
//__MOUT__ << "[TrackerDWM::panel_fill] hist block: "<<histos->histograms[histIdx].plane <<", "<< histos->histograms[histIdx].panel<< std::endl;
//__COUT__ << "[TrackerDWM::panel_fill] hist block: "<<histos->histograms[histIdx].plane <<", "<< histos->histograms[histIdx].panel<< std::endl;

if ((sid.panel() == histos->histograms[histIdx].panel) &&
(sid.plane() == histos->histograms[histIdx].plane) ) {
histos->histograms[histIdx]._Hist->Fill(sid.straw());
// __MOUT__ << "[TrackerDWM::panel_fill] filled hist "<<sid.plane() <<", "<< sid.panel()<< std::endl;
// __COUT__ << "[TrackerDWM::panel_fill] filled hist "<<sid.plane() <<", "<< sid.panel()<< std::endl;
foundHist = true;
break;
}

}
if (!foundHist){
__MOUT__ << "Cannot find histogram: "
__COUT__ << "Cannot find histogram: "
<< title + "_"+std::to_string(sid.plane()) + "_" +
std::to_string(sid.panel())
<< std::endl;
Expand Down
16 changes: 8 additions & 8 deletions otsdaq-mu2e-dqm/ArtModules/TrackerDQM_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ ots::TrackerDQM::TrackerDQM(Parameters const& conf)
histSender_ = new HistoSender(address_, port_);

if (diagLevel_ > 0) {
__MOUT__ << "[TrackerDQM::analyze] DQM for " << histType_[0] << std::endl;
__COUT__ << "[TrackerDQM::analyze] DQM for " << histType_[0] << std::endl;
}

for (std::string name : histType_) {
Expand All @@ -116,7 +116,7 @@ ots::TrackerDQM::TrackerDQM(Parameters const& conf)
}

void ots::TrackerDQM::beginJob() {
__MOUT__ << "[TrackerDQM::beginJob] Beginning job" << std::endl;
__COUT__ << "[TrackerDQM::beginJob] Beginning job" << std::endl;
summary_histos->BookSummaryHistos(tfs, "PanelOccupancy", 220, 0, 220);
summary_histos->BookSummaryHistos(tfs, "PlaneOccupancy", 40, 0, 40);

Expand Down Expand Up @@ -197,7 +197,7 @@ void ots::TrackerDQM::analyze_tracker_(const mu2e::TrackerDataDecoder& cc) {
} else if (name == "panels") {
panel_fill(panel_histos, "Panel", sid);
} else {
__MOUT_ERR__ << "Unrecognized histogram type" << std::endl;
__COUT_ERR__ << "Unrecognized histogram type" << std::endl;
}
}
}
Expand All @@ -207,15 +207,15 @@ void ots::TrackerDQM::analyze_tracker_(const mu2e::TrackerDataDecoder& cc) {
if (evtCounter_ % freqDQM_ != 0) return;

if (diagLevel_ > 0) {
__MOUT__ << "[TrackerDQM::analyze] preparing the BUFFER..." << std::endl;
__COUT__ << "[TrackerDQM::analyze] preparing the BUFFER..." << std::endl;
}

// send a packet AND reset the histograms
std::map<std::string, std::vector<TH1*>> hists_to_send;

// send the summary hists
for (size_t i = 0; i < summary_histos->histograms.size(); i++) {
__MOUT__ << "[TrackerDQM::analyze] collecting summary histogram "
__COUT__ << "[TrackerDQM::analyze] collecting summary histogram "
<< summary_histos->histograms[i]._Hist << std::endl;
hists_to_send[moduleTag_ + "_summary"].push_back(
(TH1*)summary_histos->histograms[i]._Hist->Clone());
Expand All @@ -224,7 +224,7 @@ void ots::TrackerDQM::analyze_tracker_(const mu2e::TrackerDataDecoder& cc) {

for (std::string name : histType_) {
if (diagLevel_ > 0) {
__MOUT__ << "[TrackerDQM::analyze] collecting histograms from the block: "
__COUT__ << "[TrackerDQM::analyze] collecting histograms from the block: "
<< name << std::endl;
}
if (name == "pedestals") {
Expand All @@ -239,13 +239,13 @@ void ots::TrackerDQM::analyze_tracker_(const mu2e::TrackerDataDecoder& cc) {
}
} else if (name == "panels") {
if (diagLevel_ > 0) {
__MOUT__ << Form(
__COUT__ << Form(
"[%s::analyze] preparing the collection of hists for ",
moduleTag_.data())
<< name << " histograms" << std::endl;
}
// prepare the vector of histograms
__MOUT__ << Form("[%sDQM::analyze] N hists = ", moduleTag_.data())
__COUT__ << Form("[%sDQM::analyze] N hists = ", moduleTag_.data())
<< panel_histos->histograms.size() << std::endl;
for (size_t i = 0; i < panel_histos->histograms.size(); i++) {
std::string refName = moduleTag_ + "_" + name + "/plane_" +
Expand Down
10 changes: 5 additions & 5 deletions otsdaq-mu2e-dqm/ArtModules/TriggerDQM_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ ots::TriggerDQM::TriggerDQM(Parameters const& conf)
histSender_ = new HistoSender(address_, port_);

if (diagLevel_>0){
__MOUT__ << "[TriggerDQM::analyze] DQM for "<< histType_[0] << std::endl;
__COUT__ << "[TriggerDQM::analyze] DQM for "<< histType_[0] << std::endl;
}

for (std::string name : histType_) {
Expand All @@ -86,7 +86,7 @@ ots::TriggerDQM::TriggerDQM(Parameters const& conf)
}

void ots::TriggerDQM::beginJob() {
__MOUT__ << "[TriggerDQM::beginJob] Beginning job" << std::endl;
__COUT__ << "[TriggerDQM::beginJob] Beginning job" << std::endl;
summary_histos->BookSummaryHistos(tfs,
"Trigger paths", 101, 99.5, 200.5);
summary_histos->BookSummaryHistos(tfs,
Expand All @@ -110,7 +110,7 @@ void ots::TriggerDQM::analyze(art::Event const& event) {

//send the summary hists
for (size_t i = 0; i < summary_histos->histograms.size(); i++) {
__MOUT__ << "[TriggerDQM::analyze] collecting summary histogram "<< summary_histos->histograms[i]._Hist << std::endl;
__COUT__ << "[TriggerDQM::analyze] collecting summary histogram "<< summary_histos->histograms[i]._Hist << std::endl;
hists_to_send[moduleTag_+"_summary"].push_back((TH1*)summary_histos->histograms[i]._Hist->Clone());
summary_histos->histograms[i]._Hist->Reset();
}
Expand All @@ -121,10 +121,10 @@ void ots::TriggerDQM::analyze(art::Event const& event) {


void ots::TriggerDQM::summary_trigger_fill(TriggerDQMHistoContainer *histos, mu2e::TriggerResultsNavigator& trigNavig) {
// __MOUT__ << "filling Summary histograms..."<< std::endl;
// __COUT__ << "filling Summary histograms..."<< std::endl;

if (histos->histograms.size() == 0) {
__MOUT__ << "No histograms booked. Should they have been created elsewhere?"
__COUT__ << "No histograms booked. Should they have been created elsewhere?"
<< std::endl;
} else {

Expand Down

0 comments on commit bc5c616

Please sign in to comment.