16 #include "SimMuon/DTDigitizer/test/Histograms.h"
36 if ( outputFile_.size() != 0 ) {
37 LogInfo(
"OutputInfo") <<
" DT Muon Digis Task histograms will be saved to '" << outputFile_.c_str() <<
"'";
39 LogInfo(
"OutputInfo") <<
" DT Muon Digis Task histograms will NOT be saved";
43 std::string outputFile_more_plots_;
44 if( loc != string::npos ) {
45 outputFile_more_plots_ = outputFile_.substr(0,loc)+
"_more_plots.root";
47 outputFile_more_plots_ =
" DTDigis_more_plots.root";
57 hDigis_global =
new hDigis(
"Global");
58 hDigis_W0 =
new hDigis(
"Wheel0");
59 hDigis_W1 =
new hDigis(
"Wheel1");
60 hDigis_W2 =
new hDigis(
"Wheel2");
61 hAllHits =
new hHits(
"AllHits");
85 meDigiTimeBox_wheel2m_ = 0;
86 meDigiTimeBox_wheel1m_ = 0;
87 meDigiTimeBox_wheel0_ = 0;
88 meDigiTimeBox_wheel1p_ = 0;
89 meDigiTimeBox_wheel2p_ = 0;
90 meDigiEfficiency_ = 0;
91 meDigiEfficiencyMu_ = 0;
94 meWire_DoubleDigi_ = 0;
97 meMB1_digi_occup_ = 0;
99 meMB2_digi_occup_ = 0;
100 meMB3_sim_occup_ = 0;
101 meMB3_digi_occup_ = 0;
102 meMB4_sim_occup_ = 0;
103 meMB4_digi_occup_ = 0;
119 sprintf (histo_n,
"DigiTimeBox" );
120 sprintf (histo_t,
"Digi Time Box" );
121 meDigiTimeBox_ =
dbe_->
book1D(histo_n, histo_t, 1536,0,1200);
123 sprintf (histo_n,
"DigiTimeBox_wheel2m" );
124 sprintf (histo_t,
"Digi Time Box wheel -2" );
125 meDigiTimeBox_wheel2m_ =
dbe_->
book1D(histo_n, histo_t, 384,0,1200);
127 sprintf (histo_n,
"DigiTimeBox_wheel1m" );
128 sprintf (histo_t,
"Digi Time Box wheel -1" );
129 meDigiTimeBox_wheel1m_ =
dbe_->
book1D(histo_n, histo_t, 384,0,1200);
131 sprintf (histo_n,
"DigiTimeBox_wheel0" );
132 sprintf (histo_t,
"Digi Time Box wheel 0" );
133 meDigiTimeBox_wheel0_ =
dbe_->
book1D(histo_n, histo_t, 384,0,1200);
135 sprintf (histo_n,
"DigiTimeBox_wheel1p" );
136 sprintf (histo_t,
"Digi Time Box wheel 1" );
137 meDigiTimeBox_wheel1p_ =
dbe_->
book1D(histo_n, histo_t, 384,0,1200);
139 sprintf (histo_n,
"DigiTimeBox_wheel2p" );
140 sprintf (histo_t,
"Digi Time Box wheel 2" );
141 meDigiTimeBox_wheel2p_ =
dbe_->
book1D(histo_n, histo_t, 384,0,1200);
143 sprintf (histo_n,
"DigiEfficiencyMu" );
144 sprintf (histo_t,
"Ratio (#Digis Mu)/(#SimHits Mu)" );
145 meDigiEfficiencyMu_ =
dbe_->
book1D(histo_n, histo_t, 100, 0., 5.);
147 sprintf (histo_n,
"DigiEfficiency" );
148 sprintf (histo_t,
"Ratio (#Digis)/(#SimHits)" );
149 meDigiEfficiency_ =
dbe_->
book1D(histo_n, histo_t, 100, 0., 5.);
151 sprintf (histo_n,
"Number_Digi_per_layer" );
152 sprintf (histo_t,
"Number_Digi_per_layer" );
153 meDoubleDigi_ =
dbe_->
book1D(histo_n, histo_t, 10,0.,10.);
155 sprintf (histo_n,
"Number_simhit_vs_digi" );
156 sprintf (histo_t,
"Number_simhit_vs_digi" );
157 meSimvsDigi_ =
dbe_->
book2D(histo_n, histo_t, 100, 0., 140., 100, 0., 140.);
159 sprintf (histo_n,
"Wire_Number_with_double_Digi" );
160 sprintf (histo_t,
"Wire_Number_with_double_Digi" );
161 meWire_DoubleDigi_ =
dbe_->
book1D(histo_n, histo_t, 100,0.,100.);
163 sprintf (histo_n,
"Simhit_occupancy_MB1" );
164 sprintf (histo_t,
"Simhit_occupancy_MB1" );
165 meMB1_sim_occup_ =
dbe_->
book1D(histo_n, histo_t, 55, 0., 55. );
167 sprintf (histo_n,
"Digi_occupancy_MB1" );
168 sprintf (histo_t,
"Digi_occupancy_MB1" );
169 meMB1_digi_occup_ =
dbe_->
book1D(histo_n, histo_t, 55, 0., 55. );
171 sprintf (histo_n,
"Simhit_occupancy_MB2" );
172 sprintf (histo_t,
"Simhit_occupancy_MB2" );
173 meMB2_sim_occup_ =
dbe_->
book1D(histo_n, histo_t, 63, 0., 63. );
175 sprintf (histo_n,
"Digi_occupancy_MB2" );
176 sprintf (histo_t,
"Digi_occupancy_MB2" );
177 meMB2_digi_occup_ =
dbe_->
book1D(histo_n, histo_t, 63, 0., 63. );
179 sprintf (histo_n,
"Simhit_occupancy_MB3" );
180 sprintf (histo_t,
"Simhit_occupancy_MB3" );
181 meMB3_sim_occup_ =
dbe_->
book1D(histo_n, histo_t, 75, 0., 75. );
183 sprintf (histo_n,
"Digi_occupancy_MB3" );
184 sprintf (histo_t,
"Digi_occupancy_MB3" );
185 meMB3_digi_occup_ =
dbe_->
book1D(histo_n, histo_t, 75, 0., 75. );
187 sprintf (histo_n,
"Simhit_occupancy_MB4" );
188 sprintf (histo_t,
"Simhit_occupancy_MB4" );
189 meMB4_sim_occup_ =
dbe_->
book1D(histo_n, histo_t, 99, 0., 99. );
191 sprintf (histo_n,
"Digi_occupancy_MB4" );
192 sprintf (histo_t,
"Digi_occupancy_MB4" );
193 meMB4_digi_occup_ =
dbe_->
book1D(histo_n, histo_t, 99, 0., 99. );
215 for (
int slnum = 1; slnum < 62; ++slnum ) {
216 sprintf(stringcham,
"DigiTimeBox_slid_%d", slnum) ;
217 meDigiHisto_ =
dbe_->
book1D(stringcham, stringcham, 100,0,1200);
218 meDigiTimeBox_SL_.push_back(meDigiHisto_);
241 if ( outputFile_.size() != 0 &&
dbe_ )
dbe_->
save(outputFile_);
244 cout <<
"[MuonDTDigis] Destructor called" << endl;
255 cout <<
"--- [MuonDTDigis] Analysing Event: #Run: " <<
event.id().run()
256 <<
" #Event: " <<
event.id().event() << endl;
264 event.getByLabel(DigiLabel, dtDigis);
268 event.getByLabel(SimHitLabel,
"MuonDTHits",simHits);
285 for(vector<PSimHit>::const_iterator
hit = simHits->begin();
286 hit != simHits->end();
hit++){
292 wireMap[wireId].push_back(&(*
hit));
296 int partType =
hit->particleType();
297 if (
abs(partType) == 13 ) num_musimhits++;
299 if ( wireId.station() == 1 &&
abs(partType) == 13 ) meMB1_sim_occup_->Fill(wireId.wire());
300 if ( wireId.station() == 2 &&
abs(partType) == 13 ) meMB2_sim_occup_->Fill(wireId.wire());
301 if ( wireId.station() == 3 &&
abs(partType) == 13 ) meMB3_sim_occup_->Fill(wireId.wire());
302 if ( wireId.station() == 4 &&
abs(partType) == 13 ) meMB4_sim_occup_->Fill(wireId.wire());
305 float path = (exitP-entryP).
mag();
306 float path_x = fabs((exitP-entryP).
x());
308 hAllHits->Fill(entryP.
x(),exitP.
x(),
309 entryP.
y(),exitP.
y(),
310 entryP.
z(),exitP.
z(),
312 partType,
hit->processType(),
320 for (detUnitIt=dtDigis->begin();
321 detUnitIt!=dtDigis->end();
324 const DTLayerId&
id = (*detUnitIt).first;
327 num_digis_layer = 0 ;
333 digiIt!=range.second;
340 if (num_digis_layer > 1 )
342 if ( (*digiIt).wire() == wire_touched )
344 meWire_DoubleDigi_->Fill((*digiIt).wire());
348 wire_touched = (*digiIt).wire();
350 meDigiTimeBox_->Fill((*digiIt).time());
351 if (
id.wheel() == -2 ) meDigiTimeBox_wheel2m_->Fill((*digiIt).time());
352 if (
id.wheel() == -1 ) meDigiTimeBox_wheel1m_->Fill((*digiIt).time());
353 if (
id.wheel() == 0 ) meDigiTimeBox_wheel0_ ->
Fill((*digiIt).time());
354 if (
id.wheel() == 1 ) meDigiTimeBox_wheel1p_->Fill((*digiIt).time());
355 if (
id.wheel() == 2 ) meDigiTimeBox_wheel2p_->Fill((*digiIt).time());
359 cham_num = (
id.wheel() +2)*12 + (
id.
station() -1)*3 +
id.superlayer();
362 meDigiTimeBox_SL_[cham_num]->Fill((*digiIt).time());
366 DTWireId wireId(
id,(*digiIt).wire());
367 if (wireId.station() == 1 ) meMB1_digi_occup_->Fill((*digiIt).wire());
368 if (wireId.station() == 2 ) meMB2_digi_occup_->Fill((*digiIt).wire());
369 if (wireId.station() == 3 ) meMB3_digi_occup_->Fill((*digiIt).wire());
370 if (wireId.station() == 4 ) meMB4_digi_occup_->Fill((*digiIt).wire());
375 for(vector<const PSimHit*>::iterator
hit = wireMap[wireId].
begin();
376 hit != wireMap[wireId].end();
hit++)
377 if(
abs((*hit)->particleType()) == 13){
378 theta = atan( (*hit)->momentumAtEntry().x()/ (-(*hit)->momentumAtEntry().z()) )*180/
M_PI;
385 if( mu ) num_mudigis++;
388 hDigis_global->Fill((*digiIt).time(),
theta,
id.superlayer());
390 WheelHistos(
id.wheel())->Fill((*digiIt).time(),
theta,
id.superlayer());
395 meDoubleDigi_->Fill( (
float)num_digis_layer );
401 if (num_musimhits != 0) {
402 meDigiEfficiencyMu_->Fill( (
float)num_mudigis/(
float)num_musimhits );
403 meDigiEfficiency_->Fill( (
float)num_digis/(
float)num_musimhits );
406 meSimvsDigi_->Fill( (
float)num_musimhits, (
float)num_digis ) ;
414 case 0:
return hDigis_W0;
416 case 1:
return hDigis_W1;
418 case 2:
return hDigis_W2;
420 default:
return NULL;
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)
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Geom::Theta< T > theta() const
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
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< DigiType >::const_iterator const_iterator
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)