42 cout<<
"[DTDigiForNoiseTask]: Constructor"<<endl;
54 cout <<
"DTDigiForNoiseTask: analyzed " <<
nevents <<
" events" << endl;
62 cout<<
"[DTDigiForNoiseTask] endjob called!"<<endl;
64 dbe->rmdir(
"DT/DTDigiForNoiseTask");
72 cout<<
"[DTDigiForNoiseTask]: BeginJob"<<endl;
81 cout<<
"[DTDigiForNoiseTask]: BeginRun"<<endl;
91 cout<<
"[DTDigiForNoiseTask]: Begin of LS transition"<<endl;
94 for(map< DTLayerId, MonitorElement* > ::const_iterator
histo = digiHistos.begin();
95 histo != digiHistos.end();
97 (*histo).second->Reset();
106 if (
debug)
cout<<
"[DTDigiForNoiseTask]: booking"<<endl;
110 stringstream layer; layer << lId.
layer();
111 stringstream superLayer; superLayer << dtSLId.
superlayer();
112 stringstream wheel; wheel << dtChId.
wheel();
114 stringstream sector; sector << dtChId.
sector();
116 dbe->setCurrentFolder(
"DT/DTDigiForNoiseTask/Wheel" + wheel.str() +
117 "/Station" + station.str() +
118 "/Sector" + sector.str() +
"/DigiPerEvent");
121 cout<<
"[DTDigiForNoiseTask]: folder "<<
"DT/DTDigiTask/Wheel" + wheel.str() +
122 "/Station" + station.str() +
123 "/Sector" + sector.str() +
"/DigiPerEvent"<<endl;
127 "DigiPerEvent_W" + wheel.str()
128 +
"_St" + station.str()
129 +
"_Sec" + sector.str()
130 +
"_SL" + superLayer.str()
131 +
"_L" + layer.str();
133 if (
debug)
cout<<
"[DTDigiTask]: histoName "<<histoName<<endl;
135 const DTTopology& dtTopo = muonGeom->layer(lId)->specificTopology();
138 int nWires = lastWire-firstWire+1;
140 digiHistos[lId] = dbe->book2D(histoName,histoName,nWires,firstWire,lastWire,10,-0.5,9.5);
154 std::map< int,int > DigiPerWirePerEvent;
157 vector<DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
158 vector<DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
160 for (; ch_it != ch_end; ++ch_it) {
162 vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
163 vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
165 for(; sl_it != sl_end; ++sl_it) {
166 vector<const DTLayer*>::const_iterator l_it = (*sl_it)->layers().begin();
167 vector<const DTLayer*>::const_iterator l_end = (*sl_it)->layers().end();
169 for(; l_it != l_end; ++l_it) {
173 if(layerDigi.first != layerDigi.second){
175 const DTTopology& dtTopo = muonGeom->layer(layerId)->specificTopology();
179 if (digiHistos.find(layerId) == digiHistos.end())
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
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.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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< DigiType >::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.