37 cout<<
"[DTTestPulseTask]: Constructor"<<endl;
38 dtDigisToken_ = consumes<DTDigiCollection>(
44 t0sPeakRange = make_pair( parameters.getUntrackedParameter<
int>(
"t0sRangeLowerBound", -100),
45 parameters.getUntrackedParameter<
int>(
"t0sRangeUpperBound", 100));
54 cout <<
"[DTTestPulsesTask]: analyzed " <<
nevents <<
" events" << endl;
61 cout<<
"[DTTestPulsesTask]: BeginJob"<<endl;
80 stringstream wheel; wheel << dtLayer.
wheel();
82 stringstream sector; sector << dtLayer.
sector();
83 stringstream superLayer; superLayer << dtLayer.
superlayer();
84 stringstream layer; layer << dtLayer.
layer();
86 cout<<
"[DTTestPulseTask]: booking"<<endl;
89 if ( folder ==
"TPProfile" ) {
95 dtLayer.
layer()))->specificTopology().channels();
97 dbe->setCurrentFolder(
"DT/DTTestPulsesTask/Wheel" + wheel.str() +
98 "/Station" + station.str() +
99 "/Sector" + sector.str() +
100 "/SuperLayer" + superLayer.str() +
103 string histoName = histoTag
105 +
"_St" + station.str()
106 +
"_Sec" + sector.str()
107 +
"_SL" + superLayer.str()
108 +
"_L" + layer.str();
111 if (
parameters.getUntrackedParameter<
bool>(
"readDB",
false) ) {
112 t0RangeMap->slRangeT0( dtLayer.
superlayerId() , t0sPeakRange.first, t0sPeakRange.second);
116 cout<<
"t0sRangeLowerBound "<<t0sPeakRange.first<<
"; "
117 <<
"t0sRangeUpperBound "<<t0sPeakRange.second<<endl;
124 dtLayer.
layer()).rawId())] =
125 dbe->bookProfile(histoName,histoName,
127 t0sPeakRange.first - t0sPeakRange.second, t0sPeakRange.first, t0sPeakRange.second);
131 else if ( folder ==
"TPOccupancy" ) {
133 dbe->setCurrentFolder(
"DT/DTTestPulsesTask/Wheel" + wheel.str() +
134 "/Station" + station.str() +
135 "/Sector" + sector.str() +
136 "/SuperLayer" + superLayer.str() +
139 string histoName = histoTag
141 +
"_St" + station.str()
142 +
"_Sec" + sector.str()
143 +
"_SL" + superLayer.str()
144 +
"_L" + layer.str();
150 dtLayer.
layer()))->specificTopology().channels();
156 dtLayer.
layer()).rawId())] =
157 dbe->book1D(histoName, histoName, nWires, 0, nWires);
161 else if ( folder ==
"TPTimeBox" ) {
163 dbe->setCurrentFolder(
"DT/DTTestPulsesTask/Wheel" + wheel.str() +
164 "/Station" + station.str() +
165 "/Sector" + sector.str() +
168 string histoName = histoTag
170 +
"_St" + station.str()
171 +
"_Sec" + sector.str();
177 dtLayer.
layer()).chamberId().rawId())] =
178 dbe->book1D(histoName, histoName, 10000, 0, 10000);
192 for (dtLayerId_It=dtdigis->begin(); dtLayerId_It!=dtdigis->end(); ++dtLayerId_It){
195 digiIt!=((*dtLayerId_It).second).
second; ++digiIt){
198 int layerIndex = ((*dtLayerId_It).first).rawId();
199 int chIndex = ((*dtLayerId_It).first).chamberId().rawId();
202 if ((
int)(*digiIt).countsTDC() > t0sPeakRange.first &&
203 (int)(*digiIt).countsTDC() < t0sPeakRange.second ) {
206 if (testPulsesOccupancies.find(layerIndex) != testPulsesOccupancies.end())
207 testPulsesOccupancies.find(layerIndex)->second->Fill((*digiIt).wire());
209 bookHistos( (*dtLayerId_It).first ,
string(
"TPOccupancy"),
string(
"TestPulses") );
210 testPulsesOccupancies.find(layerIndex)->second->Fill((*digiIt).wire());
214 if (testPulsesProfiles.find(layerIndex) != testPulsesProfiles.end())
215 testPulsesProfiles.find(layerIndex)->second->Fill((*digiIt).wire(),(*digiIt).countsTDC());
217 bookHistos( (*dtLayerId_It).first ,
string(
"TPProfile"),
string(
"TestPulses2D") );
218 testPulsesProfiles.find(layerIndex)->second->Fill((*digiIt).wire(),(*digiIt).countsTDC());
223 if (testPulsesTimeBoxes.find(chIndex) != testPulsesTimeBoxes.end())
224 testPulsesTimeBoxes.find(chIndex)->second->Fill((*digiIt).countsTDC());
226 bookHistos( (*dtLayerId_It).first ,
string(
"TPTimeBox"),
string(
"TestPulsesTB") );
227 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.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
int layer() const
Return the layer number.
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
U second(std::pair< T, U > const &p)
void beginRun(const edm::Run &, const edm::EventSetup &)
BeginRun.
void bookHistos(const DTLayerId &dtLayer, std::string folder, std::string histoTag)
Book the ME.
DTTestPulsesTask(const edm::ParameterSet &ps)
Constructor.
int superlayer() const
Return the superlayer number (deprecated method name)
std::vector< DTDigi >::const_iterator const_iterator
virtual ~DTTestPulsesTask()
Destructor.
int station() const
Return the station number.
int wheel() const
Return the wheel number.