43 LogVerbatim(
"DTNoiseTask") <<
"[DTNoiseTask]: Constructor"<<endl;
73 LogVerbatim(
"DTNoiseTask") <<
"[DTNoiseTask]: Begin of LS transition"<<endl;
89 std::map<DTChamberId, int> segmentsChId;
97 DTRecSegment4DCollection::id_iterator chamberId;
98 for (chamberId = all4DSegments->id_begin();
99 chamberId != all4DSegments->id_end();
101 segmentsChId[*chamberId]=1;
111 for (dtLayerId_It=dtdigis->begin(); dtLayerId_It!=dtdigis->end(); ++dtLayerId_It){
113 digiIt!=((*dtLayerId_It).second).
second; ++digiIt){
116 int tdcTime = (*digiIt).countsTDC();
119 tbHistos[(*dtLayerId_It).first.superlayerId()]->Fill(tdcTime);
120 if(tdcTime>upperLimit)
125 segmentsChId.find((*dtLayerId_It).first.superlayerId().chamberId())!=segmentsChId.end())
130 TH2F* noise_root =
noiseHistos[(*dtLayerId_It).first.superlayerId().chamberId()]->getTH2F();
131 double normalization=0;
132 if(
mapEvt.find((*dtLayerId_It).first.superlayerId().chamberId())!=
mapEvt.end()) {
133 LogVerbatim(
"DTNoiseTask") <<
" Last fill: # of events: "
134 <<
mapEvt[(*dtLayerId_It).first.superlayerId().chamberId()]
136 normalization = 1e-9*upperLimit*
mapEvt[(*dtLayerId_It).first.superlayerId().chamberId()];
138 noise_root->Scale(normalization);
140 int yBin=(*dtLayerId_It).first.layer()+(4*((*dtLayerId_It).first.superlayerId().superlayer()-1));
141 noise_root->Fill((*digiIt).wire(),
yBin);
144 LogVerbatim(
"DTNoiseTask") << (*dtLayerId_It).first <<
" wire: " << (*digiIt).wire()
145 <<
" # counts: " << noise_root->GetBinContent((*digiIt).wire(),
yBin)
146 <<
" Time interval: " << upperLimit
147 <<
" # of events: " <<
evtNumber << endl;;
148 normalization = double( 1e-9*upperLimit*
mapEvt[(*dtLayerId_It).first.superlayerId().chamberId()]);
150 noise_root->Scale(1./normalization);
152 << noise_root->GetBinContent((*digiIt).wire(),
yBin) << endl;
160 stringstream wheel; wheel << chId.
wheel();
162 stringstream sector; sector << chId.
sector();
166 "/Sector" + sector.str());
169 string histoName =
string(
"NoiseRate")
171 +
"_St" + station.str()
172 +
"_Sec" + sector.str() ;
174 LogVerbatim(
"DTNoiseTask") <<
"[DTNoiseTask]: booking chamber histo:"<<endl;
175 LogVerbatim(
"DTNoiseTask") <<
" folder "<<
"DT/05-Noise/Wheel" + wheel.str() +
177 "/Sector" + sector.str() +
"/"<<endl;
178 LogVerbatim(
"DTNoiseTask") <<
" histoName "<<histoName<<endl;
183 const vector<const DTSuperLayer*> superlayers = dtchamber->
superLayers();
186 for(vector<const DTSuperLayer*>::const_iterator sl = superlayers.begin();
187 sl != superlayers.end(); ++sl) {
188 vector<const DTLayer*>
layers = (*sl)->layers();
189 for(vector<const DTLayer*>::const_iterator lay = layers.begin();
190 lay != layers.end(); ++lay) {
191 int nWires = (*lay)->specificTopology().channels();
192 if(nWires > nWires_max) nWires_max = nWires;
196 noiseHistos[chId] = ibooker.
book2D(histoName,
"Noise rate (Hz) per channel", nWires_max,1, nWires_max+1,12,1,13);
220 stringstream superlayer; superlayer << slId.
superlayer();
223 "/Station" + station.str() +
224 "/Sector" + sector.str());
227 string histoName =
string(
"TimeBox")
229 +
"_St" + station.str()
230 +
"_Sec" + sector.str()
231 +
"_SL" + superlayer.str();
233 LogVerbatim(
"DTNoiseTask") <<
"[DTNoiseTask]: booking SL histo:"<<endl;
234 LogVerbatim(
"DTNoiseTask") <<
" folder "<<
"DT/05-Noise/Wheel" + wheel.str() +
235 "/Station" + station.str() +
236 "/Sector" + sector.str() +
"/" << endl;
237 LogVerbatim(
"DTNoiseTask") <<
" histoName "<<histoName<<endl;
239 tbHistos[slId] = ibooker.
book1D(histoName,
"Time Box (TDC counts)", 1000, 0, 6000);
245 LogVerbatim(
"DTNoiseTask") <<
"[DTNoiseTask]: Begin of run"<<endl;
266 vector<const DTChamber*>::const_iterator ch_it =
dtGeom->chambers().begin();
267 vector<const DTChamber*>::const_iterator ch_end =
dtGeom->chambers().end();
268 for (; ch_it != ch_end; ++ch_it) {
272 vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
273 vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
275 for(; sl_it != sl_end; ++sl_it) {
279 float tTrig, tTrigRMS, kFactor;
293 LogVerbatim(
"DTNoiseTask") <<
"[DTNoiseTask]: End LS, update rates in all histos" << endl;
296 for(map<DTChamberId, MonitorElement*>::const_iterator meAndChamber =
noiseHistos.begin();
297 meAndChamber !=
noiseHistos.end(); ++meAndChamber) {
299 TH2F* noise_root = (*meAndChamber).second->getTH2F();
302 double normalization=0;
304 LogVerbatim(
"DTNoiseTask") <<
" Ch: " << chId <<
" Last fill: # of events: " <<
mapEvt[chId] << endl;
305 normalization = 1
e-9*upperLimit*
mapEvt[chId];
307 noise_root->Scale(normalization);
315 normalization = double( 1
e-9*upperLimit*
evtNumber);
316 noise_root->Scale(1./normalization);
T getParameter(std::string const &) const
std::map< DTChamberId, int > mapEvt
T getUntrackedParameter(std::string const &, T const &) const
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
virtual ~DTNoiseTask()
Destructor.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
DTChamberId chamberId() const
Return the corresponding ChamberId.
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &setup)
MonitorElement * nEventMonitor
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
To reset the MEs.
U second(std::pair< T, U > const &p)
edm::ESHandle< DTGeometry > dtGeom
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
const std::vector< const DTSuperLayer * > & superLayers() const
Return the superlayers in the chamber.
edm::EDGetTokenT< DTRecSegment4DCollection > recHits4DToken_
edm::ESHandle< DTTtrig > tTrigMap
MonitorElement * book1D(Args &&...args)
edm::EDGetTokenT< DTDigiCollection > dtDigiToken_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::map< DTSuperLayerId, MonitorElement * > tbHistos
void bookHistos(DQMStore::IBooker &, DTChamberId chId)
int superlayer() const
Return the superlayer number (deprecated method name)
void setCurrentFolder(const std::string &fullpath)
void dqmBeginRun(const edm::Run &, const edm::EventSetup &)
MonitorElement * book2D(Args &&...args)
std::map< DTChamberId, double > tTrigStMap
std::vector< DTDigi >::const_iterator const_iterator
DTNoiseTask(const edm::ParameterSet &ps)
Constructor.
std::map< DTChamberId, MonitorElement * > noiseHistos
MonitorElement * bookFloat(Args &&...args)
int station() const
Return the station number.
int wheel() const
Return the wheel number.