40 LogVerbatim(
"DTNoiseTask") <<
"[DTNoiseTask]: Constructor" << endl;
69 std::map<DTChamberId, int> segmentsChId;
78 for (chamberId = all4DSegments->id_begin(); chamberId != all4DSegments->id_end(); ++chamberId) {
79 segmentsChId[*chamberId] = 1;
89 for (dtLayerId_It = dtdigis->begin(); dtLayerId_It != dtdigis->end(); ++dtLayerId_It) {
91 digiIt != ((*dtLayerId_It).second).
second;
94 int tdcTime = (*digiIt).countsTDC();
97 tbHistos[(*dtLayerId_It).first.superlayerId()]->Fill(tdcTime);
98 if (tdcTime > upperLimit)
102 if (
doSegmentVeto && segmentsChId.find((*dtLayerId_It).first.superlayerId().chamberId()) != segmentsChId.end())
107 TH2F* noise_root =
noiseHistos[(*dtLayerId_It).first.superlayerId().chamberId()]->getTH2F();
109 if (
mapEvt.find((*dtLayerId_It).first.superlayerId().chamberId()) !=
mapEvt.end()) {
110 LogVerbatim(
"DTNoiseTask") <<
" Last fill: # of events: "
111 <<
mapEvt[(*dtLayerId_It).first.superlayerId().chamberId()] << endl;
116 int yBin = (*dtLayerId_It).first.layer() + (4 * ((*dtLayerId_It).first.superlayerId().superlayer() - 1));
117 noise_root->Fill((*digiIt).wire(),
yBin);
120 LogVerbatim(
"DTNoiseTask") << (*dtLayerId_It).first <<
" wire: " << (*digiIt).wire()
121 <<
" # counts: " << noise_root->GetBinContent((*digiIt).wire(),
yBin)
122 <<
" Time interval: " << upperLimit <<
" # of events: " <<
evtNumber << endl;
124 normalization = double(1
e-9 * upperLimit *
mapEvt[(*dtLayerId_It).first.superlayerId().chamberId()]);
127 LogVerbatim(
"DTNoiseTask") <<
" noise rate: " << noise_root->GetBinContent((*digiIt).wire(),
yBin) << endl;
141 ibooker.setCurrentFolder(
"DT/05-Noise/Wheel" +
wheel.str() +
143 "/Sector" + sector.str());
148 LogVerbatim(
"DTNoiseTask") <<
"[DTNoiseTask]: booking chamber histo:" << endl;
150 <<
"DT/05-Noise/Wheel" +
wheel.str() +
152 "/Sector" + sector.str() +
"/"
159 const vector<const DTSuperLayer*>& superlayers = dtchamber->
superLayers();
162 for (vector<const DTSuperLayer*>::const_iterator sl = superlayers.begin(); sl != superlayers.end();
164 vector<const DTLayer*>
layers = (*sl)->layers();
165 for (vector<const DTLayer*>::const_iterator lay =
layers.begin(); lay !=
layers.end(); ++lay) {
166 int nWires = (*lay)->specificTopology().channels();
167 if (nWires > nWires_max)
173 ibooker.book2D(
histoName,
"Noise rate (Hz) per channel", nWires_max, 1, nWires_max + 1, 12, 1, 13);
197 stringstream superlayer;
200 ibooker.setCurrentFolder(
"DT/05-Noise/Wheel" +
wheel.str() +
"/Station" +
station.str() +
"/Sector" + sector.str());
204 string(
"TimeBox") +
"_W" +
wheel.str() +
"_St" +
station.str() +
"_Sec" + sector.str() +
"_SL" + superlayer.str();
206 LogVerbatim(
"DTNoiseTask") <<
"[DTNoiseTask]: booking SL histo:" << endl;
208 <<
"DT/05-Noise/Wheel" +
wheel.str() +
"/Station" +
station.str() +
"/Sector" +
213 tbHistos[slId] = ibooker.book1D(
histoName,
"Time Box (TDC counts)", 1000, 0, 6000);
217 LogVerbatim(
"DTNoiseTask") <<
"[DTNoiseTask]: Begin of run" << endl;
227 ibooker.setCurrentFolder(
"DT/EventInfo/Counters");
231 vector<const DTChamber*>::const_iterator ch_it =
dtGeom->
chambers().begin();
232 vector<const DTChamber*>::const_iterator ch_end =
dtGeom->
chambers().end();
233 for (; ch_it != ch_end; ++ch_it) {
237 vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
238 vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
240 for (; sl_it != sl_end; ++sl_it) {
256 LogVerbatim(
"DTNoiseTask") <<
"[DTNoiseTask]: End LS, update rates in all histos" << endl;
259 for (map<DTChamberId, MonitorElement*>::const_iterator meAndChamber =
noiseHistos.begin();
263 TH2F* noise_root = (*meAndChamber).second->getTH2F();
268 LogVerbatim(
"DTNoiseTask") <<
" Ch: " << chId <<
" Last fill: # of events: " <<
mapEvt[chId] << endl;