14 #include "SimMuon/DTDigitizer/test/Histograms.h"
34 if ( outputFile_.size() != 0 ) {
35 LogInfo(
"OutputInfo") <<
" DT Muon Digis Task histograms will be saved to '"
36 << outputFile_.c_str() <<
"'";
38 LogInfo(
"OutputInfo") <<
" DT Muon Digis Task histograms will NOT be saved";
43 if( loc != string::npos ) {
44 outputFile_more_plots_ = outputFile_.substr(0,loc)+
"_more_plots.root";
46 outputFile_more_plots_ =
" DTDigis_more_plots.root";
56 hDigis_global =
new hDigis(
"Global");
57 hDigis_W0 =
new hDigis(
"Wheel0");
58 hDigis_W1 =
new hDigis(
"Wheel1");
59 hDigis_W2 =
new hDigis(
"Wheel2");
60 hAllHits =
new hHits(
"AllHits");
84 meDigiTimeBox_wheel2m_ = 0;
85 meDigiTimeBox_wheel1m_ = 0;
86 meDigiTimeBox_wheel0_ = 0;
87 meDigiTimeBox_wheel1p_ = 0;
88 meDigiTimeBox_wheel2p_ = 0;
89 meDigiEfficiency_ = 0;
90 meDigiEfficiencyMu_ = 0;
93 meWire_DoubleDigi_ = 0;
96 meMB1_digi_occup_ = 0;
98 meMB2_digi_occup_ = 0;
100 meMB3_digi_occup_ = 0;
101 meMB4_sim_occup_ = 0;
102 meMB4_digi_occup_ = 0;
118 sprintf (histo_n,
"DigiTimeBox" );
119 sprintf (histo_t,
"Digi Time Box" );
120 meDigiTimeBox_ =
dbe_->
book1D(histo_n, histo_t, 1536,0,1200);
122 sprintf (histo_n,
"DigiTimeBox_wheel2m" );
123 sprintf (histo_t,
"Digi Time Box wheel -2" );
124 meDigiTimeBox_wheel2m_ =
dbe_->
book1D(histo_n, histo_t, 384,0,1200);
126 sprintf (histo_n,
"DigiTimeBox_wheel1m" );
127 sprintf (histo_t,
"Digi Time Box wheel -1" );
128 meDigiTimeBox_wheel1m_ =
dbe_->
book1D(histo_n, histo_t, 384,0,1200);
130 sprintf (histo_n,
"DigiTimeBox_wheel0" );
131 sprintf (histo_t,
"Digi Time Box wheel 0" );
132 meDigiTimeBox_wheel0_ =
dbe_->
book1D(histo_n, histo_t, 384,0,1200);
134 sprintf (histo_n,
"DigiTimeBox_wheel1p" );
135 sprintf (histo_t,
"Digi Time Box wheel 1" );
136 meDigiTimeBox_wheel1p_ =
dbe_->
book1D(histo_n, histo_t, 384,0,1200);
138 sprintf (histo_n,
"DigiTimeBox_wheel2p" );
139 sprintf (histo_t,
"Digi Time Box wheel 2" );
140 meDigiTimeBox_wheel2p_ =
dbe_->
book1D(histo_n, histo_t, 384,0,1200);
142 sprintf (histo_n,
"DigiEfficiencyMu" );
143 sprintf (histo_t,
"Ratio (#Digis Mu)/(#SimHits Mu)" );
144 meDigiEfficiencyMu_ =
dbe_->
book1D(histo_n, histo_t, 100, 0., 5.);
146 sprintf (histo_n,
"DigiEfficiency" );
147 sprintf (histo_t,
"Ratio (#Digis)/(#SimHits)" );
148 meDigiEfficiency_ =
dbe_->
book1D(histo_n, histo_t, 100, 0., 5.);
150 sprintf (histo_n,
"Number_Digi_per_layer" );
151 sprintf (histo_t,
"Number_Digi_per_layer" );
152 meDoubleDigi_ =
dbe_->
book1D(histo_n, histo_t, 10,0.,10.);
154 sprintf (histo_n,
"Number_simhit_vs_digi" );
155 sprintf (histo_t,
"Number_simhit_vs_digi" );
156 meSimvsDigi_ =
dbe_->
book2D(histo_n, histo_t, 100, 0., 140., 100, 0., 140.);
158 sprintf (histo_n,
"Wire_Number_with_double_Digi" );
159 sprintf (histo_t,
"Wire_Number_with_double_Digi" );
160 meWire_DoubleDigi_ =
dbe_->
book1D(histo_n, histo_t, 100,0.,100.);
162 sprintf (histo_n,
"Simhit_occupancy_MB1" );
163 sprintf (histo_t,
"Simhit_occupancy_MB1" );
164 meMB1_sim_occup_ =
dbe_->
book1D(histo_n, histo_t, 55, 0., 55. );
166 sprintf (histo_n,
"Digi_occupancy_MB1" );
167 sprintf (histo_t,
"Digi_occupancy_MB1" );
168 meMB1_digi_occup_ =
dbe_->
book1D(histo_n, histo_t, 55, 0., 55. );
170 sprintf (histo_n,
"Simhit_occupancy_MB2" );
171 sprintf (histo_t,
"Simhit_occupancy_MB2" );
172 meMB2_sim_occup_ =
dbe_->
book1D(histo_n, histo_t, 63, 0., 63. );
174 sprintf (histo_n,
"Digi_occupancy_MB2" );
175 sprintf (histo_t,
"Digi_occupancy_MB2" );
176 meMB2_digi_occup_ =
dbe_->
book1D(histo_n, histo_t, 63, 0., 63. );
178 sprintf (histo_n,
"Simhit_occupancy_MB3" );
179 sprintf (histo_t,
"Simhit_occupancy_MB3" );
180 meMB3_sim_occup_ =
dbe_->
book1D(histo_n, histo_t, 75, 0., 75. );
182 sprintf (histo_n,
"Digi_occupancy_MB3" );
183 sprintf (histo_t,
"Digi_occupancy_MB3" );
184 meMB3_digi_occup_ =
dbe_->
book1D(histo_n, histo_t, 75, 0., 75. );
186 sprintf (histo_n,
"Simhit_occupancy_MB4" );
187 sprintf (histo_t,
"Simhit_occupancy_MB4" );
188 meMB4_sim_occup_ =
dbe_->
book1D(histo_n, histo_t, 99, 0., 99. );
190 sprintf (histo_n,
"Digi_occupancy_MB4" );
191 sprintf (histo_t,
"Digi_occupancy_MB4" );
192 meMB4_digi_occup_ =
dbe_->
book1D(histo_n, histo_t, 99, 0., 99. );
214 for (
int slnum = 1; slnum < 62; ++slnum ) {
215 sprintf(stringcham,
"DigiTimeBox_slid_%d", slnum) ;
216 meDigiHisto_ =
dbe_->
book1D(stringcham, stringcham, 100,0,1200);
217 meDigiTimeBox_SL_.push_back(meDigiHisto_);
240 if ( outputFile_.size() != 0 &&
dbe_ )
dbe_->
save(outputFile_);
243 cout <<
"[MuonDTDigis] Destructor called" << endl;
254 cout <<
"--- [MuonDTDigis] Analysing Event: #Run: " <<
event.id().run()
255 <<
" #Event: " <<
event.id().event() << endl;
263 event.getByToken(DigiToken_, dtDigis);
267 event.getByToken(SimHitToken_, simHits);
281 for(vector<PSimHit>::const_iterator
hit = simHits->begin();
282 hit != simHits->end();
hit++){
288 wireMap[wireId].push_back(&(*
hit));
292 int partType =
hit->particleType();
293 if (
abs(partType) == 13 ) num_musimhits++;
295 if ( wireId.station() == 1 &&
abs(partType) == 13 ) meMB1_sim_occup_->Fill(wireId.wire());
296 if ( wireId.station() == 2 &&
abs(partType) == 13 ) meMB2_sim_occup_->Fill(wireId.wire());
297 if ( wireId.station() == 3 &&
abs(partType) == 13 ) meMB3_sim_occup_->Fill(wireId.wire());
298 if ( wireId.station() == 4 &&
abs(partType) == 13 ) meMB4_sim_occup_->Fill(wireId.wire());
301 float path = (exitP-entryP).
mag();
302 float path_x = fabs((exitP-entryP).
x());
304 hAllHits->Fill(entryP.
x(),exitP.
x(),
305 entryP.
y(),exitP.
y(),
306 entryP.
z(),exitP.
z(),
308 partType,
hit->processType(),
316 for (detUnitIt=dtDigis->begin();
317 detUnitIt!=dtDigis->end();
320 const DTLayerId&
id = (*detUnitIt).first;
323 num_digis_layer = 0 ;
329 digiIt!=range.second;
336 if (num_digis_layer > 1 )
338 if ( (*digiIt).wire() == wire_touched )
340 meWire_DoubleDigi_->Fill((*digiIt).wire());
344 wire_touched = (*digiIt).wire();
346 meDigiTimeBox_->Fill((*digiIt).time());
347 if (
id.wheel() == -2 ) meDigiTimeBox_wheel2m_->Fill((*digiIt).time());
348 if (
id.wheel() == -1 ) meDigiTimeBox_wheel1m_->Fill((*digiIt).time());
349 if (
id.wheel() == 0 ) meDigiTimeBox_wheel0_ ->
Fill((*digiIt).time());
350 if (
id.wheel() == 1 ) meDigiTimeBox_wheel1p_->Fill((*digiIt).time());
351 if (
id.wheel() == 2 ) meDigiTimeBox_wheel2p_->Fill((*digiIt).time());
355 cham_num = (
id.wheel() +2)*12 + (
id.
station() -1)*3 +
id.superlayer();
358 meDigiTimeBox_SL_[cham_num]->Fill((*digiIt).time());
362 DTWireId wireId(
id,(*digiIt).wire());
363 if (wireId.station() == 1 ) meMB1_digi_occup_->Fill((*digiIt).wire());
364 if (wireId.station() == 2 ) meMB2_digi_occup_->Fill((*digiIt).wire());
365 if (wireId.station() == 3 ) meMB3_digi_occup_->Fill((*digiIt).wire());
366 if (wireId.station() == 4 ) meMB4_digi_occup_->Fill((*digiIt).wire());
371 for(vector<const PSimHit*>::iterator
hit = wireMap[wireId].
begin();
372 hit != wireMap[wireId].end();
hit++)
373 if(
abs((*hit)->particleType()) == 13){
374 theta = atan( (*hit)->momentumAtEntry().x()/ (-(*hit)->momentumAtEntry().z()) )*180/
M_PI;
381 if( mu ) num_mudigis++;
384 hDigis_global->Fill((*digiIt).time(),
theta,
id.superlayer());
386 WheelHistos(
id.wheel())->Fill((*digiIt).time(),
theta,
id.superlayer());
391 meDoubleDigi_->Fill( (
float)num_digis_layer );
397 if (num_musimhits != 0) {
398 meDigiEfficiencyMu_->Fill( (
float)num_mudigis/(
float)num_musimhits );
399 meDigiEfficiency_->Fill( (
float)num_digis/(
float)num_musimhits );
402 meSimvsDigi_->Fill( (
float)num_musimhits, (
float)num_digis ) ;
410 case 0:
return hDigis_W0;
412 case 1:
return hDigis_W1;
414 case 2:
return hDigis_W2;
416 default:
return NULL;
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
std::map< DTWireId, std::vector< const PSimHit * > > DTWireIdMap
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
#define DEFINE_FWK_MODULE(type)
Geom::Theta< T > theta() const
tuple path
else: Piece not in the list, fine.
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Abs< T >::type abs(const T &t)
void setVerbose(unsigned level)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
hDigis * WheelHistos(int wheel)
std::vector< DTDigi >::const_iterator const_iterator
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
std::pair< const_iterator, const_iterator > Range
void showDirStructure(void) const
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
void setCurrentFolder(const std::string &fullpath)
MuonDTDigis(const edm::ParameterSet &pset)