37 dtDigisToken_ = consumes<DTDigiCollection>(
41 cout<<
"[DTDigiForNoiseTask]: Constructor"<<endl;
53 cout <<
"DTDigiForNoiseTask: analyzed " <<
nevents <<
" events" << endl;
61 cout<<
"[DTDigiForNoiseTask] endjob called!"<<endl;
63 dbe->rmdir(
"DT/DTDigiForNoiseTask");
71 cout<<
"[DTDigiForNoiseTask]: BeginJob"<<endl;
80 cout<<
"[DTDigiForNoiseTask]: BeginRun"<<endl;
90 cout<<
"[DTDigiForNoiseTask]: Begin of LS transition"<<endl;
93 for(map< DTLayerId, MonitorElement* > ::const_iterator
histo = digiHistos.begin();
94 histo != digiHistos.end();
96 (*histo).second->Reset();
105 if (
debug)
cout<<
"[DTDigiForNoiseTask]: booking"<<endl;
109 stringstream layer; layer << lId.
layer();
110 stringstream superLayer; superLayer << dtSLId.
superlayer();
111 stringstream wheel; wheel << dtChId.
wheel();
113 stringstream sector; sector << dtChId.
sector();
115 dbe->setCurrentFolder(
"DT/DTDigiForNoiseTask/Wheel" + wheel.str() +
116 "/Station" + station.str() +
117 "/Sector" + sector.str() +
"/DigiPerEvent");
120 cout<<
"[DTDigiForNoiseTask]: folder "<<
"DT/DTDigiTask/Wheel" + wheel.str() +
121 "/Station" + station.str() +
122 "/Sector" + sector.str() +
"/DigiPerEvent"<<endl;
126 "DigiPerEvent_W" + wheel.str()
127 +
"_St" + station.str()
128 +
"_Sec" + sector.str()
129 +
"_SL" + superLayer.str()
130 +
"_L" + layer.str();
132 if (
debug)
cout<<
"[DTDigiTask]: histoName "<<histoName<<endl;
134 const DTTopology& dtTopo = muonGeom->layer(lId)->specificTopology();
137 int nWires = lastWire-firstWire+1;
139 digiHistos[lId] = dbe->book2D(histoName,histoName,nWires,firstWire,lastWire,10,-0.5,9.5);
153 std::map< int,int > DigiPerWirePerEvent;
156 auto ch_it = muonGeom->chambers().begin();
157 auto ch_end = muonGeom->chambers().end();
159 for (; ch_it != ch_end; ++ch_it) {
161 vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
162 vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
164 for(; sl_it != sl_end; ++sl_it) {
165 vector<const DTLayer*>::const_iterator l_it = (*sl_it)->layers().begin();
166 vector<const DTLayer*>::const_iterator l_end = (*sl_it)->layers().end();
168 for(; l_it != l_end; ++l_it) {
172 if(layerDigi.first != layerDigi.second){
174 const DTTopology& dtTopo = muonGeom->layer(layerId)->specificTopology();
178 if (digiHistos.find(layerId) == digiHistos.end())
181 if (digiHistos.find(layerId) != digiHistos.end()){
182 for (
int wire=firstWire; wire-lastWire <= 0; wire++) {
183 DigiPerWirePerEvent[wire]= 0;
187 digi!=layerDigi.second;
189 DigiPerWirePerEvent[(*digi).wire()]+=1;
192 for (
int wire=firstWire; wire-lastWire<=0; wire++) {
193 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 bookHistos(const DTLayerId &dtSL)
Book the ME.
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
virtual ~DTDigiForNoiseTask()
Destructor.
int superlayer() const
Return the superlayer number (deprecated method name)
LuminosityBlockNumber_t luminosityBlock() const
std::vector< DTDigi >::const_iterator const_iterator
void beginRun(const edm::Run &, const edm::EventSetup &)
BeginRun.
std::pair< const_iterator, const_iterator > Range
DTDigiForNoiseTask(const edm::ParameterSet &ps)
Constructor.
int station() const
Return the station number.
int wheel() const
Return the wheel number.