37 cout<<
"[DTTestPulseTask]: Constructor"<<endl;
38 dtDigisToken_ = consumes<DTDigiCollection>(
44 t0sPeakRange = make_pair( parameters.getUntrackedParameter<
int>(
"t0sRangeLowerBound", -100),
45 parameters.getUntrackedParameter<
int>(
"t0sRangeUpperBound", 100));
51 cout <<
"[DTTestPulsesTask]: analyzed " <<
nevents <<
" events" << endl;
57 cout<<
"[DTTestPulsesTask]: dqmBeginRun"<<endl;
65 bookHistos( ibooker,
string(
"TPOccupancy"),
string(
"TestPulses") );
66 bookHistos( ibooker,
string(
"TPProfile"),
string(
"TestPulses2D") );
67 bookHistos( ibooker,
string(
"TPTimeBox"),
string(
"TestPulsesTB") );
72 cout<<
"[DTTestPulseTask]: booking"<<endl;
77 vector<const DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
78 vector<const DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
80 for (; ch_it != ch_end; ++ch_it) {
83 vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
84 vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
86 for(; sl_it != sl_end; ++sl_it) {
88 stringstream superLayer; superLayer << sl.
superlayer();
91 vector<const DTLayer*>::const_iterator l_it = (*sl_it)->layers().begin();
92 vector<const DTLayer*>::const_iterator l_end = (*sl_it)->layers().end();
94 for(; l_it != l_end; ++l_it) {
96 stringstream layer; layer << layerId.
layer();
98 stringstream superLayer; superLayer << layerId.
superlayer();
104 if ( folder ==
"TPProfile" ) {
106 const int nWires = (*l_it)->specificTopology().channels();
109 "/Station" + station.str() +
110 "/Sector" + sector.str() +
111 "/SuperLayer" + superLayer.str() +
116 +
"_St" + station.str()
117 +
"_Sec" + sector.str()
118 +
"_SL" + superLayer.str()
119 +
"_L" + layer.str();
122 if (
parameters.getUntrackedParameter<
bool>(
"readDB",
false) ) {
123 t0RangeMap->slRangeT0( layerId.
superlayerId() , t0sPeakRange.first, t0sPeakRange.second);
127 cout<<
"t0sRangeLowerBound "<<t0sPeakRange.first<<
"; "
128 <<
"t0sRangeUpperBound "<<t0sPeakRange.second<<endl;
135 layerId.
layer()).rawId())] =
138 t0sPeakRange.first - t0sPeakRange.second, t0sPeakRange.first, t0sPeakRange.second);
142 else if ( folder ==
"TPOccupancy" ) {
145 "/Station" + station.str() +
146 "/Sector" + sector.str() +
147 "/SuperLayer" + superLayer.str() +
152 +
"_St" + station.str()
153 +
"_Sec" + sector.str()
154 +
"_SL" + superLayer.str()
155 +
"_L" + layer.str();
161 layerId.
layer()))->specificTopology().channels();
167 layerId.
layer()).rawId())] =
168 ibooker.
book1D(histoName, histoName, nWires, 0, nWires);
172 else if ( folder ==
"TPTimeBox" ) {
175 "/Station" + station.str() +
176 "/Sector" + sector.str() +
181 +
"_St" + station.str()
182 +
"_Sec" + sector.str();
188 layerId.
layer()).chamberId().rawId())] =
189 ibooker.
book1D(histoName, histoName, 10000, 0, 10000);
206 for (dtLayerId_It=dtdigis->begin(); dtLayerId_It!=dtdigis->end(); ++dtLayerId_It){
209 digiIt!=((*dtLayerId_It).second).
second; ++digiIt){
212 int layerIndex = ((*dtLayerId_It).first).rawId();
213 int chIndex = ((*dtLayerId_It).first).chamberId().rawId();
216 if ((
int)(*digiIt).countsTDC() > t0sPeakRange.first &&
217 (int)(*digiIt).countsTDC() < t0sPeakRange.second ) {
221 testPulsesOccupancies.find(layerIndex)->second->Fill((*digiIt).wire());
225 testPulsesProfiles.find(layerIndex)->second->Fill((*digiIt).wire(),(*digiIt).countsTDC());
230 testPulsesTimeBoxes.find(chIndex)->second->Fill((*digiIt).countsTDC());
T getUntrackedParameter(std::string const &, T const &) const
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
MonitorElement * bookProfile(Args &&...args)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
DTChamberId chamberId() const
Return the corresponding ChamberId.
int layer() const
Return the layer number.
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
U second(std::pair< T, U > const &p)
MonitorElement * book1D(Args &&...args)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
DTTestPulsesTask(const edm::ParameterSet &ps)
Constructor.
int superlayer() const
Return the superlayer number (deprecated method name)
void dqmBeginRun(const edm::Run &, const edm::EventSetup &)
BeginRun.
void setCurrentFolder(const std::string &fullpath)
std::vector< DTDigi >::const_iterator const_iterator
virtual ~DTTestPulsesTask()
Destructor.
int station() const
Return the station number.
int wheel() const
Return the wheel number.
void bookHistos(DQMStore::IBooker &ibooker, std::string folder, std::string histoTag)
Book the ME.