41 cout<<
"[DTTestPulseTask]: Constructor"<<endl;
46 t0sPeakRange = make_pair(
parameters.getUntrackedParameter<
int>(
"t0sRangeLowerBound", -100),
47 parameters.getUntrackedParameter<
int>(
"t0sRangeUpperBound", 100));
56 cout <<
"[DTTestPulsesTask]: analyzed " <<
nevents <<
" events" << endl;
63 cout<<
"[DTTestPulsesTask]: BeginJob"<<endl;
82 stringstream wheel; wheel << dtLayer.
wheel();
84 stringstream sector; sector << dtLayer.
sector();
85 stringstream superLayer; superLayer << dtLayer.
superlayer();
86 stringstream layer; layer << dtLayer.
layer();
88 cout<<
"[DTTestPulseTask]: booking"<<endl;
91 if ( folder ==
"TPProfile" ) {
97 dtLayer.
layer()))->specificTopology().channels();
99 dbe->setCurrentFolder(
"DT/DTTestPulsesTask/Wheel" + wheel.str() +
100 "/Station" + station.str() +
101 "/Sector" + sector.str() +
102 "/SuperLayer" + superLayer.str() +
105 string histoName = histoTag
107 +
"_St" + station.str()
108 +
"_Sec" + sector.str()
109 +
"_SL" + superLayer.str()
110 +
"_L" + layer.str();
113 if (
parameters.getUntrackedParameter<
bool>(
"readDB",
false) ) {
114 t0RangeMap->slRangeT0( dtLayer.
superlayerId() , t0sPeakRange.first, t0sPeakRange.second);
118 cout<<
"t0sRangeLowerBound "<<t0sPeakRange.first<<
"; "
119 <<
"t0sRangeUpperBound "<<t0sPeakRange.second<<endl;
126 dtLayer.
layer()).rawId())] =
127 dbe->bookProfile(histoName,histoName,
129 t0sPeakRange.first - t0sPeakRange.second, t0sPeakRange.first, t0sPeakRange.second);
133 else if ( folder ==
"TPOccupancy" ) {
135 dbe->setCurrentFolder(
"DT/DTTestPulsesTask/Wheel" + wheel.str() +
136 "/Station" + station.str() +
137 "/Sector" + sector.str() +
138 "/SuperLayer" + superLayer.str() +
141 string histoName = histoTag
143 +
"_St" + station.str()
144 +
"_Sec" + sector.str()
145 +
"_SL" + superLayer.str()
146 +
"_L" + layer.str();
152 dtLayer.
layer()))->specificTopology().channels();
158 dtLayer.
layer()).rawId())] =
159 dbe->book1D(histoName, histoName, nWires, 0, nWires);
163 else if ( folder ==
"TPTimeBox" ) {
165 dbe->setCurrentFolder(
"DT/DTTestPulsesTask/Wheel" + wheel.str() +
166 "/Station" + station.str() +
167 "/Sector" + sector.str() +
170 string histoName = histoTag
172 +
"_St" + station.str()
173 +
"_Sec" + sector.str();
179 dtLayer.
layer()).chamberId().rawId())] =
180 dbe->book1D(histoName, histoName, 10000, 0, 10000);
194 for (dtLayerId_It=dtdigis->begin(); dtLayerId_It!=dtdigis->end(); ++dtLayerId_It){
197 digiIt!=((*dtLayerId_It).second).
second; ++digiIt){
200 int layerIndex = ((*dtLayerId_It).first).rawId();
201 int chIndex = ((*dtLayerId_It).first).chamberId().rawId();
204 if ((
int)(*digiIt).countsTDC() > t0sPeakRange.first &&
205 (int)(*digiIt).countsTDC() < t0sPeakRange.second ) {
208 if (testPulsesOccupancies.find(layerIndex) != testPulsesOccupancies.end())
209 testPulsesOccupancies.find(layerIndex)->second->Fill((*digiIt).wire());
211 bookHistos( (*dtLayerId_It).first ,
string(
"TPOccupancy"),
string(
"TestPulses") );
212 testPulsesOccupancies.find(layerIndex)->second->Fill((*digiIt).wire());
216 if (testPulsesProfiles.find(layerIndex) != testPulsesProfiles.end())
217 testPulsesProfiles.find(layerIndex)->second->Fill((*digiIt).wire(),(*digiIt).countsTDC());
219 bookHistos( (*dtLayerId_It).first ,
string(
"TPProfile"),
string(
"TestPulses2D") );
220 testPulsesProfiles.find(layerIndex)->second->Fill((*digiIt).wire(),(*digiIt).countsTDC());
225 if (testPulsesTimeBoxes.find(chIndex) != testPulsesTimeBoxes.end())
226 testPulsesTimeBoxes.find(chIndex)->second->Fill((*digiIt).countsTDC());
228 bookHistos( (*dtLayerId_It).first ,
string(
"TPTimeBox"),
string(
"TestPulsesTB") );
229 testPulsesTimeBoxes.find(chIndex)->second->Fill((*digiIt).countsTDC());
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
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.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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< DigiType >::const_iterator const_iterator
virtual ~DTTestPulsesTask()
Destructor.
int station() const
Return the station number.
int wheel() const
Return the wheel number.