37 dtDigisToken_ = consumes<DTDigiCollection>(
41 cout<<
"[DTDigiForNoiseTask]: Constructor"<<endl;
52 cout <<
"DTDigiForNoiseTask: analyzed " <<
nevents <<
" events" << endl;
69 cout<<
"[DTDigiForNoiseTask]: boojHistograms"<<endl;
76 cout<<
"[DTDigiForNoiseTask]: Begin of LS transition"<<endl;
79 for(map< DTLayerId, MonitorElement* > ::const_iterator
histo = digiHistos.begin();
80 histo != digiHistos.end();
82 (*histo).second->Reset();
90 if (
debug)
cout<<
"[DTDigiForNoiseTask]: booking"<<endl;
94 stringstream layer; layer << lId.
layer();
95 stringstream superLayer; superLayer << dtSLId.
superlayer();
96 stringstream wheel; wheel << dtChId.
wheel();
98 stringstream sector; sector << dtChId.
sector();
101 "/Station" + station.str() +
102 "/Sector" + sector.str() +
"/DigiPerEvent");
105 cout<<
"[DTDigiForNoiseTask]: folder "<<
"DT/DTDigiTask/Wheel" + wheel.str() +
106 "/Station" + station.str() +
107 "/Sector" + sector.str() +
"/DigiPerEvent"<<endl;
111 "DigiPerEvent_W" + wheel.str()
112 +
"_St" + station.str()
113 +
"_Sec" + sector.str()
114 +
"_SL" + superLayer.str()
115 +
"_L" + layer.str();
117 if (
debug)
cout<<
"[DTDigiTask]: histoName "<<histoName<<endl;
119 const DTTopology& dtTopo = muonGeom->layer(lId)->specificTopology();
122 int nWires = lastWire-firstWire+1;
124 digiHistos[lId] = ibooker.
book2D(histoName,histoName,nWires,firstWire,lastWire,10,-0.5,9.5);
128 auto ch_it = muonGeom->chambers().begin();
129 auto ch_end = muonGeom->chambers().end();
131 for (; ch_it != ch_end; ++ch_it) {
132 vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
133 vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
135 for(; sl_it != sl_end; ++sl_it) {
136 vector<const DTLayer*>::const_iterator l_it = (*sl_it)->layers().begin();
137 vector<const DTLayer*>::const_iterator l_end = (*sl_it)->layers().end();
139 for(; l_it != l_end; ++l_it) {
158 std::map< int,int > DigiPerWirePerEvent;
161 auto ch_it = muonGeom->chambers().begin();
162 auto ch_end = muonGeom->chambers().end();
164 for (; ch_it != ch_end; ++ch_it) {
165 vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
166 vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
168 for(; sl_it != sl_end; ++sl_it) {
169 vector<const DTLayer*>::const_iterator l_it = (*sl_it)->layers().begin();
170 vector<const DTLayer*>::const_iterator l_end = (*sl_it)->layers().end();
172 for(; l_it != l_end; ++l_it) {
176 if(layerDigi.first != layerDigi.second){
178 const DTTopology& dtTopo = muonGeom->layer(layerId)->specificTopology();
182 if (digiHistos.find(layerId) != digiHistos.end()){
183 for (
int wire=firstWire; wire-lastWire <= 0; wire++) {
184 DigiPerWirePerEvent[wire]= 0;
188 digi!=layerDigi.second;
190 DigiPerWirePerEvent[(*digi).wire()]+=1;
193 for (
int wire=firstWire; wire-lastWire<=0; wire++) {
194 digiHistos.find(layerId)->second->Fill(wire,DigiPerWirePerEvent[wire]);
LuminosityBlockID id() const
T getUntrackedParameter(std::string const &, T const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
DTChamberId chamberId() const
Return the corresponding ChamberId.
void beginLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
To reset the MEs.
int layer() const
Return the layer number.
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
int firstChannel() const
Returns the wire number of the first wire.
int lastChannel() const
Returns the wire number of the last wire.
void dqmBeginRun(const edm::Run &, const edm::EventSetup &)
begin run
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
bookHistograms
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
virtual ~DTDigiForNoiseTask()
Destructor.
int superlayer() const
Return the superlayer number (deprecated method name)
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
LuminosityBlockNumber_t luminosityBlock() const
std::vector< DTDigi >::const_iterator const_iterator
std::pair< const_iterator, const_iterator > Range
DTDigiForNoiseTask(const edm::ParameterSet &ps)
Constructor.
void bookHistos(DQMStore::IBooker &, const DTLayerId &dtSL)
Book the ME.
int station() const
Return the station number.
int wheel() const
Return the wheel number.
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")