CMS 3D CMS Logo

GlobalHitsAnalyzer.cc
Go to the documentation of this file.
1 
8 
11 
17 
19  fName(""), verbosity(0), frequency(0), vtxunit(0), label(""),
20  getAllProvenances(false), printProvenanceInfo(false), testNumber(false),
21  G4VtxSrc_Token_( consumes<edm::SimVertexContainer>((iPSet.getParameter<edm::InputTag>("G4VtxSrc"))) ),
22  G4TrkSrc_Token_( consumes<edm::SimTrackContainer>(iPSet.getParameter<edm::InputTag>("G4TrkSrc")) ),
23  count(0)
24 {
25  consumesMany<edm::HepMCProduct>();
26  std::string MsgLoggerCat = "GlobalHitsAnalyzer_GlobalHitsAnalyzer";
27 
28  // get information from parameter set
29  fName = iPSet.getUntrackedParameter<std::string>("Name");
30  verbosity = iPSet.getUntrackedParameter<int>("Verbosity");
31  frequency = iPSet.getUntrackedParameter<int>("Frequency");
32  vtxunit = iPSet.getUntrackedParameter<int>("VtxUnit");
33  edm::ParameterSet m_Prov =
34  iPSet.getParameter<edm::ParameterSet>("ProvenanceLookup");
36  m_Prov.getUntrackedParameter<bool>("GetAllProvenances");
38  m_Prov.getUntrackedParameter<bool>("PrintProvenanceInfo");
39  testNumber = iPSet.getUntrackedParameter<bool>("testNumber");
40 
41  //get Labels to use to extract information
42  PxlBrlLowSrc_ = iPSet.getParameter<edm::InputTag>("PxlBrlLowSrc");
43  PxlBrlHighSrc_ = iPSet.getParameter<edm::InputTag>("PxlBrlHighSrc");
44  PxlFwdLowSrc_ = iPSet.getParameter<edm::InputTag>("PxlFwdLowSrc");
45  PxlFwdHighSrc_ = iPSet.getParameter<edm::InputTag>("PxlFwdHighSrc");
46 
47  SiTIBLowSrc_ = iPSet.getParameter<edm::InputTag>("SiTIBLowSrc");
48  SiTIBHighSrc_ = iPSet.getParameter<edm::InputTag>("SiTIBHighSrc");
49  SiTOBLowSrc_ = iPSet.getParameter<edm::InputTag>("SiTOBLowSrc");
50  SiTOBHighSrc_ = iPSet.getParameter<edm::InputTag>("SiTOBHighSrc");
51  SiTIDLowSrc_ = iPSet.getParameter<edm::InputTag>("SiTIDLowSrc");
52  SiTIDHighSrc_ = iPSet.getParameter<edm::InputTag>("SiTIDHighSrc");
53  SiTECLowSrc_ = iPSet.getParameter<edm::InputTag>("SiTECLowSrc");
54  SiTECHighSrc_ = iPSet.getParameter<edm::InputTag>("SiTECHighSrc");
55 
56  MuonCscSrc_ = iPSet.getParameter<edm::InputTag>("MuonCscSrc");
57  MuonDtSrc_ = iPSet.getParameter<edm::InputTag>("MuonDtSrc");
58  MuonRpcSrc_ = iPSet.getParameter<edm::InputTag>("MuonRpcSrc");
59 
60  ECalEBSrc_ = iPSet.getParameter<edm::InputTag>("ECalEBSrc");
61  ECalEESrc_ = iPSet.getParameter<edm::InputTag>("ECalEESrc");
62  ECalESSrc_ = iPSet.getParameter<edm::InputTag>("ECalESSrc");
63 
64  HCalSrc_ = iPSet.getParameter<edm::InputTag>("HCalSrc");
65 
66  // fix for consumes
67  PxlBrlLowSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("PxlBrlLowSrc"));
68  PxlBrlHighSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("PxlBrlHighSrc"));
69  PxlFwdLowSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("PxlFwdLowSrc"));
70  PxlFwdHighSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("PxlFwdHighSrc"));
71 
72  SiTIBLowSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("SiTIBLowSrc"));
73  SiTIBHighSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("SiTIBHighSrc"));
74  SiTOBLowSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("SiTOBLowSrc"));
75  SiTOBHighSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("SiTOBHighSrc"));
76  SiTIDLowSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("SiTIDLowSrc"));
77  SiTIDHighSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("SiTIDHighSrc"));
78  SiTECLowSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("SiTECLowSrc"));
79  SiTECHighSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("SiTECHighSrc"));
80 
81  MuonCscSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("MuonCscSrc"));
82  MuonDtSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("MuonDtSrc"));
83  MuonRpcSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("MuonRpcSrc"));
84 
85  ECalEBSrc_Token_ = consumes<edm::PCaloHitContainer>(iPSet.getParameter<edm::InputTag>("ECalEBSrc"));
86  ECalEESrc_Token_ = consumes<edm::PCaloHitContainer>(iPSet.getParameter<edm::InputTag>("ECalEESrc"));
87  ECalESSrc_Token_ = consumes<edm::PCaloHitContainer>(iPSet.getParameter<edm::InputTag>("ECalESSrc"));
88  HCalSrc_Token_ = consumes<edm::PCaloHitContainer>(iPSet.getParameter<edm::InputTag>("HCalSrc"));
89 
90  // determine whether to process subdetector or not
91  validHepMCevt = iPSet.getUntrackedParameter<bool>("validHepMCevt");
93  iPSet.getUntrackedParameter<bool>("validG4VtxContainer");
95  iPSet.getUntrackedParameter<bool>("validG4trkContainer");
96  validPxlBrlLow = iPSet.getUntrackedParameter<bool>("validPxlBrlLow",true);
97  validPxlBrlHigh = iPSet.getUntrackedParameter<bool>("validPxlBrlHigh",true);
98  validPxlFwdLow = iPSet.getUntrackedParameter<bool>("validPxlFwdLow",true);
99  validPxlFwdHigh = iPSet.getUntrackedParameter<bool>("validPxlFwdHigh",true);
100  validSiTIBLow = iPSet.getUntrackedParameter<bool>("validSiTIBLow",true);
101  validSiTIBHigh = iPSet.getUntrackedParameter<bool>("validSiTIBHigh",true);
102  validSiTOBLow = iPSet.getUntrackedParameter<bool>("validSiTOBLow",true);
103  validSiTOBHigh = iPSet.getUntrackedParameter<bool>("validSiTOBHigh",true);
104  validSiTIDLow = iPSet.getUntrackedParameter<bool>("validSiTIDLow",true);
105  validSiTIDHigh = iPSet.getUntrackedParameter<bool>("validSiTIDHigh",true);
106  validSiTECLow = iPSet.getUntrackedParameter<bool>("validSiTECLow",true);
107  validSiTECHigh = iPSet.getUntrackedParameter<bool>("validSiTECHigh",true);
108  validMuonCSC = iPSet.getUntrackedParameter<bool>("validMuonCSC",true);
109  validMuonDt = iPSet.getUntrackedParameter<bool>("validMuonDt",true);
110  validMuonRPC = iPSet.getUntrackedParameter<bool>("validMuonRPC",true);
111  validEB = iPSet.getUntrackedParameter<bool>("validEB",true);
112  validEE = iPSet.getUntrackedParameter<bool>("validEE",true);
113  validPresh = iPSet.getUntrackedParameter<bool>("validPresh",true);
114  validHcal = iPSet.getUntrackedParameter<bool>("validHcal",true);
115 
116  // use value of first digit to determine default output level (inclusive)
117  // 0 is none, 1 is basic, 2 is fill output, 3 is gather output
118  verbosity %= 10;
119 
120  // print out Parameter Set information being used
121  if (verbosity >= 0) {
122  edm::LogInfo(MsgLoggerCat)
123  << "\n===============================\n"
124  << "Initialized as EDAnalyzer with parameter values:\n"
125  << " Name = " << fName << "\n"
126  << " Verbosity = " << verbosity << "\n"
127  << " Frequency = " << frequency << "\n"
128  << " VtxUnit = " << vtxunit << "\n"
129  << " GetProv = " << getAllProvenances << "\n"
130  << " PrintProv = " << printProvenanceInfo << "\n"
131  << " PxlBrlLowSrc = " << PxlBrlLowSrc_.label()
132  << ":" << PxlBrlLowSrc_.instance() << "\n"
133  << " PxlBrlHighSrc = " << PxlBrlHighSrc_.label()
134  << ":" << PxlBrlHighSrc_.instance() << "\n"
135  << " PxlFwdLowSrc = " << PxlFwdLowSrc_.label()
136  << ":" << PxlBrlLowSrc_.instance() << "\n"
137  << " PxlFwdHighSrc = " << PxlFwdHighSrc_.label()
138  << ":" << PxlBrlHighSrc_.instance() << "\n"
139  << " SiTIBLowSrc = " << SiTIBLowSrc_.label()
140  << ":" << SiTIBLowSrc_.instance() << "\n"
141  << " SiTIBHighSrc = " << SiTIBHighSrc_.label()
142  << ":" << SiTIBHighSrc_.instance() << "\n"
143  << " SiTOBLowSrc = " << SiTOBLowSrc_.label()
144  << ":" << SiTOBLowSrc_.instance() << "\n"
145  << " SiTOBHighSrc = " << SiTOBHighSrc_.label()
146  << ":" << SiTOBHighSrc_.instance() << "\n"
147  << " SiTIDLowSrc = " << SiTIDLowSrc_.label()
148  << ":" << SiTIDLowSrc_.instance() << "\n"
149  << " SiTIDHighSrc = " << SiTIDHighSrc_.label()
150  << ":" << SiTIDHighSrc_.instance() << "\n"
151  << " SiTECLowSrc = " << SiTECLowSrc_.label()
152  << ":" << SiTECLowSrc_.instance() << "\n"
153  << " SiTECHighSrc = " << SiTECHighSrc_.label()
154  << ":" << SiTECHighSrc_.instance() << "\n"
155  << " MuonCscSrc = " << MuonCscSrc_.label()
156  << ":" << MuonCscSrc_.instance() << "\n"
157  << " MuonDtSrc = " << MuonDtSrc_.label()
158  << ":" << MuonDtSrc_.instance() << "\n"
159  << " MuonRpcSrc = " << MuonRpcSrc_.label()
160  << ":" << MuonRpcSrc_.instance() << "\n"
161  << " ECalEBSrc = " << ECalEBSrc_.label()
162  << ":" << ECalEBSrc_.instance() << "\n"
163  << " ECalEESrc = " << ECalEESrc_.label()
164  << ":" << ECalEESrc_.instance() << "\n"
165  << " ECalESSrc = " << ECalESSrc_.label()
166  << ":" << ECalESSrc_.instance() << "\n"
167  << " HCalSrc = " << HCalSrc_.label()
168  << ":" << HCalSrc_.instance() << "\n"
169  << "\n"
170  << " validHepMCevt = "
171  << ":" << validHepMCevt << "\n"
172  << " validG4VtxContainer = "
173  << ":" << validG4VtxContainer << "\n"
174  << " validG4trkContainer = "
175  << ":" << validG4trkContainer << "\n"
176  << " validPxlBrlLow = "
177  << ":" << validPxlBrlLow << "\n"
178  << " validPxlBrlHigh = "
179  << ":" << validPxlBrlHigh << "\n"
180  << " validPxlFwdLow = "
181  << ":" << validPxlFwdLow << "\n"
182  << " validPxlFwdHigh = "
183  << ":" << validPxlFwdHigh << "\n"
184  << " validSiTIBLow = "
185  << ":" << validSiTIBLow << "\n"
186  << " validSiTIBHigh = "
187  << ":" << validSiTIBHigh << "\n"
188  << " validSiTOBLow = "
189  << ":" << validSiTOBLow << "\n"
190  << " validSiTOBHigh = "
191  << ":" << validSiTOBHigh << "\n"
192  << " validSiTIDLow = "
193  << ":" << validSiTIDLow << "\n"
194  << " validSiTIDHigh = "
195  << ":" << validSiTIDHigh << "\n"
196  << " validSiTECLow = "
197  << ":" << validSiTECLow << "\n"
198  << " validSiTECHigh = "
199  << ":" << validSiTECHigh << "\n"
200  << " validMuonCSC = "
201  << ":" << validMuonCSC << "\n"
202  << " validMuonDt = "
203  << ":" << validMuonDt << "\n"
204  << " validMuonRPC = "
205  << ":" << validMuonRPC << "\n"
206  << " validEB = "
207  << ":" << validEB << "\n"
208  << " validEE = "
209  << ":" << validEE << "\n"
210  << " validPresh = "
211  << ":" << validPresh << "\n"
212  << " validHcal = "
213  << ":" << validHcal << "\n"
214  << "===============================\n";
215  }
216 
217  // initialize monitor elements
218  for (Int_t i = 0; i < 2; ++i) {
219  meMCRGP[i] = nullptr;
220  meMCG4Vtx[i] = nullptr;
221  meGeantVtxX[i] = nullptr;
222  meGeantVtxY[i] = nullptr;
223  meGeantVtxZ[i] = nullptr;
224  meMCG4Trk[i] = nullptr;
225  meCaloEcal[i] = nullptr;
226  meCaloEcalE[i] = nullptr;
227  meCaloEcalToF[i] = nullptr;
228  meCaloPreSh[i] = nullptr;
229  meCaloPreShE[i] = nullptr;
230  meCaloPreShToF[i]= nullptr;
231  meCaloHcal[i] = nullptr;
232  meCaloHcalE[i] = nullptr;
233  meCaloHcalToF[i] = nullptr;
234  meTrackerPx[i] = nullptr;
235  meTrackerSi[i] = nullptr;
236  meMuon[i] = nullptr;
237  meMuonDtToF[i] = nullptr;
238  meMuonCscToF[i] = nullptr;
239  meMuonRpcFToF[i] = nullptr;
240  meMuonRpcBToF[i] = nullptr;
241  meGeantVtxRad[i] = nullptr;
242  }
243  meGeantTrkPt = nullptr;
244  meGeantTrkE = nullptr;
245  meGeantVtxEta = nullptr;
246  meGeantVtxPhi = nullptr;
247  meGeantVtxMulti= nullptr;
248  meCaloEcalPhi = nullptr;
249  meCaloEcalEta = nullptr;
250  meCaloPreShPhi = nullptr;
251  meCaloPreShEta = nullptr;
252  meCaloHcalPhi = nullptr;
253  meCaloHcalEta = nullptr;
254  meTrackerPxPhi = nullptr;
255  meTrackerPxEta = nullptr;
256  meTrackerPxBToF= nullptr;
257  meTrackerPxBR = nullptr;
258  meTrackerPxFToF= nullptr;
259  meTrackerPxFZ = nullptr;
260  meTrackerSiPhi = nullptr;
261  meTrackerSiEta = nullptr;
262  meTrackerSiBToF= nullptr;
263  meTrackerSiBR = nullptr;
264  meTrackerSiFToF= nullptr;
265  meTrackerSiFZ = nullptr;
266  meMuonPhi = nullptr;
267  meMuonEta = nullptr;
268  meMuonDtR = nullptr;
269  meMuonCscZ = nullptr;
270  meMuonRpcBR = nullptr;
271  meMuonRpcFZ = nullptr;
272 
273 }
274 
276 
278  // book histograms
279  Char_t hname[200];
280  Char_t htitle[200];
281 
282  // MCGeant
283  iBooker.setCurrentFolder("GlobalHitsV/MCGeant");
284  sprintf(hname,"hMCRGP1");
285  sprintf(htitle,"RawGenParticles");
286  meMCRGP[0] = iBooker.book1D(hname,htitle,100,0.,5000.);
287  sprintf(hname,"hMCRGP2");
288  meMCRGP[1] = iBooker.book1D(hname,htitle,100,0.,500.);
289  for (Int_t i = 0; i < 2; ++i) {
290  meMCRGP[i]->setAxisTitle("Number of Raw Generated Particles",1);
291  meMCRGP[i]->setAxisTitle("Count",2);
292  }
293 
294  sprintf(hname,"hMCG4Vtx1");
295  sprintf(htitle,"G4 Vertices");
296  meMCG4Vtx[0] = iBooker.book1D(hname,htitle,150,0.,15000.);
297  sprintf(hname,"hMCG4Vtx2");
298  meMCG4Vtx[1] = iBooker.book1D(hname,htitle,100,-0.5,99.5);
299  for (Int_t i = 0; i < 2; ++i) {
300  meMCG4Vtx[i]->setAxisTitle("Number of Vertices",1);
301  meMCG4Vtx[i]->setAxisTitle("Count",2);
302  }
303 
304  sprintf(hname,"hMCG4Trk1");
305  sprintf(htitle,"G4 Tracks");
306  meMCG4Trk[0] = iBooker.book1D(hname,htitle,150,0.,15000.);
307  sprintf(hname,"hMCG4Trk2");
308  meMCG4Trk[1] = iBooker.book1D(hname,htitle,150,-0.5,99.5);
309  for (Int_t i = 0; i < 2; ++i) {
310  meMCG4Trk[i]->setAxisTitle("Number of Tracks",1);
311  meMCG4Trk[i]->setAxisTitle("Count",2);
312  }
313 
314  sprintf(hname,"hGeantVtxX1");
315  sprintf(htitle,"Geant vertex x/micrometer");
316  meGeantVtxX[0] = iBooker.book1D(hname,htitle,100,-8000000.,8000000.);
317  sprintf(hname,"hGeantVtxX2");
318  meGeantVtxX[1] = iBooker.book1D(hname,htitle,100,-50.,50.);
319  for (Int_t i = 0; i < 2; ++i) {
320  meGeantVtxX[i]->setAxisTitle("x of Vertex (um)",1);
321  meGeantVtxX[i]->setAxisTitle("Count",2);
322  }
323 
324  sprintf(hname,"hGeantVtxY1");
325  sprintf(htitle,"Geant vertex y/micrometer");
326  meGeantVtxY[0] = iBooker.book1D(hname,htitle,100,-8000000,8000000.);
327  sprintf(hname,"hGeantVtxY2");
328  meGeantVtxY[1] = iBooker.book1D(hname,htitle,100,-50.,50.);
329  for (Int_t i = 0; i < 2; ++i) {
330  meGeantVtxY[i]->setAxisTitle("y of Vertex (um)",1);
331  meGeantVtxY[i]->setAxisTitle("Count",2);
332  }
333 
334  sprintf(hname,"hGeantVtxZ1");
335  sprintf(htitle,"Geant vertex z/millimeter");
336  meGeantVtxZ[0] = iBooker.book1D(hname,htitle,100,-11000.,11000.);
337  sprintf(hname,"hGeantVtxZ2");
338  meGeantVtxZ[1] = iBooker.book1D(hname,htitle,200,-500.,500.);
339  //meGeantVtxZ[1] = iBooker.book1D(hname,htitle,100,-250.,250.);
340  for (Int_t i = 0; i < 2; ++i) {
341  meGeantVtxZ[i]->setAxisTitle("z of Vertex (mm)",1);
342  meGeantVtxZ[i]->setAxisTitle("Count",2);
343  }
344 
345  sprintf(hname,"hGeantTrkPt");
346  sprintf(htitle,"Log10 Geant track pt/GeV");
347  meGeantTrkPt = iBooker.book1D(hname,htitle,80,-4.,4.);
348  meGeantTrkPt->setAxisTitle("Log10 pT of Track (GeV)",1);
349  meGeantTrkPt->setAxisTitle("Count",2);
350 
351  sprintf(hname,"hGeantTrkE");
352  sprintf(htitle,"Log10 Geant track E/GeV");
353  meGeantTrkE = iBooker.book1D(hname,htitle,80,-4.,4.);
354  meGeantTrkE->setAxisTitle("Log10 E of Track (GeV)",1);
355  meGeantTrkE->setAxisTitle("Count",2);
356 
357  sprintf(hname,"hGeantVtxEta");
358  sprintf(htitle,"Geant vertices eta");
359  meGeantVtxEta = iBooker.book1D(hname,htitle,220,-5.5,5.5);
360  meGeantVtxEta->setAxisTitle("eta of SimVertex",1);
361  meGeantVtxEta->setAxisTitle("Count",2);
362 
363  sprintf(hname,"hGeantVtxPhi");
364  sprintf(htitle,"Geant vertices phi/rad");
365  meGeantVtxPhi = iBooker.book1D(hname,htitle,100,-3.2,3.2);
366  meGeantVtxPhi->setAxisTitle("phi of SimVertex (rad)",1);
367  meGeantVtxPhi->setAxisTitle("Count",2);
368 
369  sprintf(hname,"hGeantVtxRad1");
370  sprintf(htitle,"Geant vertices radius/cm");
371  meGeantVtxRad[0] = iBooker.book1D(hname,htitle,130,0.,130.);
372  sprintf(hname,"hGeantVtxRad2");
373  meGeantVtxRad[1] = iBooker.book1D(hname,htitle,100,0.,1000.);
374  for (Int_t i = 0; i < 2; ++i) {
375  meGeantVtxRad[i]->setAxisTitle("radius of SimVertex (cm)",1);
376  meGeantVtxRad[i]->setAxisTitle("Count",2);
377  }
378 
379  sprintf(hname,"hGeantVtxMulti");
380  sprintf(htitle,"Geant vertices outgoing multiplicity");
381  meGeantVtxMulti = iBooker.book1D(hname,htitle,20,0.,20);
382  meGeantVtxMulti->setAxisTitle("multiplicity of particles attached to a SimVertex",1);
383  meGeantVtxMulti->setAxisTitle("Count",2);
384 
385  // ECal
386  iBooker.setCurrentFolder("GlobalHitsV/ECals");
387  sprintf(hname,"hCaloEcal1");
388  sprintf(htitle,"Ecal hits");
389  meCaloEcal[0] = iBooker.book1D(hname,htitle,100,0.,10000.);
390  sprintf(hname,"hCaloEcal2");
391  meCaloEcal[1] = iBooker.book1D(hname,htitle,100,-0.5,99.5);
392 
393  sprintf(hname,"hCaloEcalE1");
394  sprintf(htitle,"Ecal hits, energy/GeV");
395  meCaloEcalE[0] = iBooker.book1D(hname,htitle,100,0.,10.);
396  sprintf(hname,"hCaloEcalE2");
397  meCaloEcalE[1] = iBooker.book1D(hname,htitle,100,0.,0.1);
398  sprintf(hname,"hCaloEcalToF1");
399  sprintf(htitle,"Ecal hits, ToF/ns");
400  meCaloEcalToF[0] = iBooker.book1D(hname,htitle,100,0.,1000.);
401  sprintf(hname,"hCaloEcalToF2");
402  meCaloEcalToF[1] = iBooker.book1D(hname,htitle,100,0.,100.);
403 
404  for (Int_t i = 0; i < 2; ++i) {
405  meCaloEcal[i]->setAxisTitle("Number of Hits",1);
406  meCaloEcal[i]->setAxisTitle("Count",2);
407  meCaloEcalE[i]->setAxisTitle("Energy of Hits (GeV)",1);
408  meCaloEcalE[i]->setAxisTitle("Count",2);
409  meCaloEcalToF[i]->setAxisTitle("Time of Flight of Hits (ns)",1);
410  meCaloEcalToF[i]->setAxisTitle("Count",2);
411  }
412 
413  sprintf(hname,"hCaloEcalPhi");
414  sprintf(htitle,"Ecal hits, phi/rad");
415  meCaloEcalPhi = iBooker.book1D(hname,htitle,100,-3.2,3.2);
416  meCaloEcalPhi->setAxisTitle("Phi of Hits (rad)",1);
417  meCaloEcalPhi->setAxisTitle("Count",2);
418 
419  sprintf(hname,"hCaloEcalEta");
420  sprintf(htitle,"Ecal hits, eta");
421  meCaloEcalEta = iBooker.book1D(hname,htitle,100,-5.5,5.5);
422  meCaloEcalEta->setAxisTitle("Eta of Hits",1);
423  meCaloEcalEta->setAxisTitle("Count",2);
424 
425  sprintf(hname,"hCaloPreSh1");
426  sprintf(htitle,"PreSh hits");
427  meCaloPreSh[0] = iBooker.book1D(hname,htitle,100,0.,10000.);
428  sprintf(hname,"hCaloPreSh2");
429  meCaloPreSh[1] = iBooker.book1D(hname,htitle,100,-0.5,99.5);
430 
431  sprintf(hname,"hCaloPreShE1");
432  sprintf(htitle,"PreSh hits, energy/GeV");
433  meCaloPreShE[0] = iBooker.book1D(hname,htitle,100,0.,10.);
434  sprintf(hname,"hCaloPreShE2");
435  meCaloPreShE[1] = iBooker.book1D(hname,htitle,100,0.,0.1);
436 
437  sprintf(hname,"hCaloPreShToF1");
438  sprintf(htitle,"PreSh hits, ToF/ns");
439  meCaloPreShToF[0] = iBooker.book1D(hname,htitle,100,0.,1000.);
440  sprintf(hname,"hCaloPreShToF2");
441  meCaloPreShToF[1] = iBooker.book1D(hname,htitle,100,0.,100.);
442 
443  for (Int_t i = 0; i < 2; ++i) {
444  meCaloPreSh[i]->setAxisTitle("Number of Hits",1);
445  meCaloPreSh[i]->setAxisTitle("Count",2);
446  meCaloPreShE[i]->setAxisTitle("Energy of Hits (GeV)",1);
447  meCaloPreShE[i]->setAxisTitle("Count",2);
448  meCaloPreShToF[i]->setAxisTitle("Time of Flight of Hits (ns)",1);
449  meCaloPreShToF[i]->setAxisTitle("Count",2);
450  }
451 
452  sprintf(hname,"hCaloPreShPhi");
453  sprintf(htitle,"PreSh hits, phi/rad");
454  meCaloPreShPhi = iBooker.book1D(hname,htitle,100,-3.2,3.2);
455  meCaloPreShPhi->setAxisTitle("Phi of Hits (rad)",1);
456  meCaloPreShPhi->setAxisTitle("Count",2);
457 
458  sprintf(hname,"hCaloPreShEta");
459  sprintf(htitle,"PreSh hits, eta");
460  meCaloPreShEta = iBooker.book1D(hname,htitle,100,-5.5,5.5);
461  meCaloPreShEta->setAxisTitle("Eta of Hits",1);
462  meCaloPreShEta->setAxisTitle("Count",2);
463 
464  // Hcal
465  iBooker.setCurrentFolder("GlobalHitsV/HCals");
466  sprintf(hname,"hCaloHcal1");
467  sprintf(htitle,"Hcal hits");
468  meCaloHcal[0] = iBooker.book1D(hname,htitle,100,0.,10000.);
469  sprintf(hname,"hCaloHcal2");
470  meCaloHcal[1] = iBooker.book1D(hname,htitle,100,-0.5,99.5);
471 
472  sprintf(hname,"hCaloHcalE1");
473  sprintf(htitle,"Hcal hits, energy/GeV");
474  meCaloHcalE[0] = iBooker.book1D(hname,htitle,100,0.,10.);
475  sprintf(hname,"hCaloHcalE2");
476  meCaloHcalE[1] = iBooker.book1D(hname,htitle,100,0.,0.1);
477 
478  sprintf(hname,"hCaloHcalToF1");
479  sprintf(htitle,"Hcal hits, ToF/ns");
480  meCaloHcalToF[0] = iBooker.book1D(hname,htitle,100,0.,1000.);
481  sprintf(hname,"hCaloHcalToF2");
482  meCaloHcalToF[1] = iBooker.book1D(hname,htitle,100,0.,100.);
483 
484  for (Int_t i = 0; i < 2; ++i) {
485  meCaloHcal[i]->setAxisTitle("Number of Hits",1);
486  meCaloHcal[i]->setAxisTitle("Count",2);
487  meCaloHcalE[i]->setAxisTitle("Energy of Hits (GeV)",1);
488  meCaloHcalE[i]->setAxisTitle("Count",2);
489  meCaloHcalToF[i]->setAxisTitle("Time of Flight of Hits (ns)",1);
490  meCaloHcalToF[i]->setAxisTitle("Count",2);
491  }
492 
493  sprintf(hname,"hCaloHcalPhi");
494  sprintf(htitle,"Hcal hits, phi/rad");
495  meCaloHcalPhi = iBooker.book1D(hname,htitle,100,-3.2,3.2);
496  meCaloHcalPhi->setAxisTitle("Phi of Hits (rad)",1);
497  meCaloHcalPhi->setAxisTitle("Count",2);
498 
499  sprintf(hname,"hCaloHcalEta");
500  sprintf(htitle,"Hcal hits, eta");
501  meCaloHcalEta = iBooker.book1D(hname,htitle,100,-5.5,5.5);
502  meCaloHcalEta->setAxisTitle("Eta of Hits",1);
503  meCaloHcalEta->setAxisTitle("Count",2);
504 
505  // SiPixels
506  iBooker.setCurrentFolder("GlobalHitsV/SiPixels");
507  sprintf(hname,"hTrackerPx1");
508  sprintf(htitle,"Pixel hits");
509  meTrackerPx[0] = iBooker.book1D(hname,htitle,100,0.,10000.);
510  sprintf(hname,"hTrackerPx2");
511  meTrackerPx[1] = iBooker.book1D(hname,htitle,100,-0.5,99.5);
512  for (Int_t i = 0; i < 2; ++i) {
513  meTrackerPx[i]->setAxisTitle("Number of Pixel Hits",1);
514  meTrackerPx[i]->setAxisTitle("Count",2);
515  }
516 
517  sprintf(hname,"hTrackerPxPhi");
518  sprintf(htitle,"Pixel hits phi/rad");
519  meTrackerPxPhi = iBooker.book1D(hname,htitle,100,-3.2,3.2);
520  meTrackerPxPhi->setAxisTitle("Phi of Hits (rad)",1);
521  meTrackerPxPhi->setAxisTitle("Count",2);
522 
523  sprintf(hname,"hTrackerPxEta");
524  sprintf(htitle,"Pixel hits eta");
525  meTrackerPxEta = iBooker.book1D(hname,htitle,100,-3.5,3.5);
526  meTrackerPxEta->setAxisTitle("Eta of Hits",1);
527  meTrackerPxEta->setAxisTitle("Count",2);
528 
529  sprintf(hname,"hTrackerPxBToF");
530  sprintf(htitle,"Pixel barrel hits, ToF/ns");
531  meTrackerPxBToF = iBooker.book1D(hname,htitle,100,0.,40.);
532  meTrackerPxBToF->setAxisTitle("Time of Flight of Hits (ns)",1);
533  meTrackerPxBToF->setAxisTitle("Count",2);
534 
535  sprintf(hname,"hTrackerPxBR");
536  sprintf(htitle,"Pixel barrel hits, R/cm");
537  meTrackerPxBR = iBooker.book1D(hname,htitle,100,0.,50.);
538  meTrackerPxBR->setAxisTitle("R of Hits (cm)",1);
539  meTrackerPxBR->setAxisTitle("Count",2);
540 
541  sprintf(hname,"hTrackerPxFToF");
542  sprintf(htitle,"Pixel forward hits, ToF/ns");
543  meTrackerPxFToF = iBooker.book1D(hname,htitle,100,0.,50.);
544  meTrackerPxFToF->setAxisTitle("Time of Flight of Hits (ns)",1);
545  meTrackerPxFToF->setAxisTitle("Count",2);
546 
547  sprintf(hname,"hTrackerPxFZ");
548  sprintf(htitle,"Pixel forward hits, Z/cm");
549  meTrackerPxFZ =
550  iBooker.book1D(hname,htitle,200,-100.,100.);
551  meTrackerPxFZ->setAxisTitle("Z of Hits (cm)",1);
552  meTrackerPxFZ->setAxisTitle("Count",2);
553 
554  // SiStrips
555  iBooker.setCurrentFolder("GlobalHitsV/SiStrips");
556  sprintf(hname,"hTrackerSi1");
557  sprintf(htitle,"Silicon hits");
558  meTrackerSi[0] = iBooker.book1D(hname,htitle,100,0.,10000.);
559  sprintf(hname,"hTrackerSi2");
560  meTrackerSi[1] = iBooker.book1D(hname,htitle,100,-0.5,99.5);
561  for (Int_t i = 0; i < 2; ++i) {
562  meTrackerSi[i]->setAxisTitle("Number of Silicon Hits",1);
563  meTrackerSi[i]->setAxisTitle("Count",2);
564  }
565 
566  sprintf(hname,"hTrackerSiPhi");
567  sprintf(htitle,"Silicon hits phi/rad");
568  meTrackerSiPhi = iBooker.book1D(hname,htitle,100,-3.2,3.2);
569  meTrackerSiPhi->setAxisTitle("Phi of Hits (rad)",1);
570  meTrackerSiPhi->setAxisTitle("Count",2);
571 
572  sprintf(hname,"hTrackerSiEta");
573  sprintf(htitle,"Silicon hits eta");
574  meTrackerSiEta = iBooker.book1D(hname,htitle,100,-3.5,3.5);
575  meTrackerSiEta->setAxisTitle("Eta of Hits",1);
576  meTrackerSiEta->setAxisTitle("Count",2);
577 
578  sprintf(hname,"hTrackerSiBToF");
579  sprintf(htitle,"Silicon barrel hits, ToF/ns");
580  meTrackerSiBToF = iBooker.book1D(hname,htitle,100,0.,50.);
581  meTrackerSiBToF->setAxisTitle("Time of Flight of Hits (ns)",1);
582  meTrackerSiBToF->setAxisTitle("Count",2);
583 
584  sprintf(hname,"hTrackerSiBR");
585  sprintf(htitle,"Silicon barrel hits, R/cm");
586  meTrackerSiBR = iBooker.book1D(hname,htitle,100,0.,200.);
587  meTrackerSiBR->setAxisTitle("R of Hits (cm)",1);
588  meTrackerSiBR->setAxisTitle("Count",2);
589 
590  sprintf(hname,"hTrackerSiFToF");
591  sprintf(htitle,"Silicon forward hits, ToF/ns");
592  meTrackerSiFToF = iBooker.book1D(hname,htitle,100,0.,75.);
593  meTrackerSiFToF->setAxisTitle("Time of Flight of Hits (ns)",1);
594  meTrackerSiFToF->setAxisTitle("Count",2);
595 
596  sprintf(hname,"hTrackerSiFZ");
597  sprintf(htitle,"Silicon forward hits, Z/cm");
598  meTrackerSiFZ = iBooker.book1D(hname,htitle,200,-300.,300.);
599  meTrackerSiFZ->setAxisTitle("Z of Hits (cm)",1);
600  meTrackerSiFZ->setAxisTitle("Count",2);
601 
602  // Muon
603  iBooker.setCurrentFolder("GlobalHitsV/Muons");
604  sprintf(hname,"hMuon1");
605  sprintf(htitle,"Muon hits");
606  meMuon[0] = iBooker.book1D(hname,htitle,100,0.,10000.);
607  sprintf(hname,"hMuon2");
608  meMuon[1] = iBooker.book1D(hname,htitle,100,-0.5,99.5);
609  for (Int_t i = 0; i < 2; ++i) {
610  meMuon[i]->setAxisTitle("Number of Muon Hits",1);
611  meMuon[i]->setAxisTitle("Count",2);
612  }
613 
614  sprintf(hname,"hMuonPhi");
615  sprintf(htitle,"Muon hits phi/rad");
616  meMuonPhi = iBooker.book1D(hname,htitle,100,-3.2,3.2);
617  meMuonPhi->setAxisTitle("Phi of Hits (rad)",1);
618  meMuonPhi->setAxisTitle("Count",2);
619 
620  sprintf(hname,"hMuonEta");
621  sprintf(htitle,"Muon hits eta");
622  meMuonEta = iBooker.book1D(hname,htitle,100,-3.5,3.5);
623  meMuonEta->setAxisTitle("Eta of Hits",1);
624  meMuonEta->setAxisTitle("Count",2);
625 
626  sprintf(hname,"hMuonCscToF1");
627  sprintf(htitle,"Muon CSC hits, ToF/ns");
628  meMuonCscToF[0] = iBooker.book1D(hname,htitle,100,0.,250.);
629  sprintf(hname,"hMuonCscToF2");
630  meMuonCscToF[1] = iBooker.book1D(hname,htitle,100,0.,50.);
631  for (Int_t i = 0; i < 2; ++i) {
632  meMuonCscToF[i]->setAxisTitle("Time of Flight of Hits (ns)",1);
633  meMuonCscToF[i]->setAxisTitle("Count",2);
634  }
635 
636  sprintf(hname,"hMuonCscZ");
637  sprintf(htitle,"Muon CSC hits, Z/cm");
638  meMuonCscZ = iBooker.book1D(hname,htitle,200,-1500.,1500.);
639  meMuonCscZ->setAxisTitle("Z of Hits (cm)",1);
640  meMuonCscZ->setAxisTitle("Count",2);
641 
642  sprintf(hname,"hMuonDtToF1");
643  sprintf(htitle,"Muon DT hits, ToF/ns");
644  meMuonDtToF[0] = iBooker.book1D(hname,htitle,100,0.,250.);
645  sprintf(hname,"hMuonDtToF2");
646  meMuonDtToF[1] = iBooker.book1D(hname,htitle,100,0.,50.);
647  for (Int_t i = 0; i < 2; ++i) {
648  meMuonDtToF[i]->setAxisTitle("Time of Flight of Hits (ns)",1);
649  meMuonDtToF[i]->setAxisTitle("Count",2);
650  }
651 
652  sprintf(hname,"hMuonDtR");
653  sprintf(htitle,"Muon DT hits, R/cm");
654  meMuonDtR = iBooker.book1D(hname,htitle,100,0.,1500.);
655  meMuonDtR->setAxisTitle("R of Hits (cm)",1);
656  meMuonDtR->setAxisTitle("Count",2);
657 
658  sprintf(hname,"hMuonRpcFToF1");
659  sprintf(htitle,"Muon RPC forward hits, ToF/ns");
660  meMuonRpcFToF[0] = iBooker.book1D(hname,htitle,100,0.,250.);
661  sprintf(hname,"hMuonRpcFToF2");
662  meMuonRpcFToF[1] = iBooker.book1D(hname,htitle,100,0.,50.);
663  for (Int_t i = 0; i < 2; ++i) {
664  meMuonRpcFToF[i]->setAxisTitle("Time of Flight of Hits (ns)",1);
665  meMuonRpcFToF[i]->setAxisTitle("Count",2);
666  }
667  sprintf(hname,"hMuonRpcFZ");
668  sprintf(htitle,"Muon RPC forward hits, Z/cm");
669  meMuonRpcFZ = iBooker.book1D(hname,htitle,201,-1500.,1500.);
670  meMuonRpcFZ->setAxisTitle("Z of Hits (cm)",1);
671  meMuonRpcFZ->setAxisTitle("Count",2);
672 
673  sprintf(hname,"hMuonRpcBToF1");
674  sprintf(htitle,"Muon RPC barrel hits, ToF/ns");
675  meMuonRpcBToF[0] = iBooker.book1D(hname,htitle,100,0.,250.);
676  sprintf(hname,"hMuonRpcBToF2");
677  meMuonRpcBToF[1] = iBooker.book1D(hname,htitle,100,0.,50.);
678  for (Int_t i = 0; i < 2; ++i) {
679  meMuonRpcBToF[i]->setAxisTitle("Time of Flight of Hits (ns)",1);
680  meMuonRpcBToF[i]->setAxisTitle("Count",2);
681  }
682 
683  sprintf(hname,"hMuonRpcBR");
684  sprintf(htitle,"Muon RPC barrel hits, R/cm");
685  meMuonRpcBR = iBooker.book1D(hname,htitle,100,0.,1500.);
686  meMuonRpcBR->setAxisTitle("R of Hits (cm)",1);
687  meMuonRpcBR->setAxisTitle("Count",2);
688 }
689 
691  const edm::EventSetup& iSetup)
692 {
693  std::string MsgLoggerCat = "GlobalHitsAnalyzer_analyze";
694 
695  // keep track of number of events processed
696  ++count;
697 
698  // get event id information
699  edm::RunNumber_t nrun = iEvent.id().run();
700  edm::EventNumber_t nevt = iEvent.id().event();
701 
702  if (verbosity > 0) {
703  edm::LogInfo(MsgLoggerCat)
704  << "Processing run " << nrun << ", event " << nevt
705  << " (" << count << " events total)";
706  } else if (verbosity == 0) {
707  if (nevt%frequency == 0 || nevt == 1) {
708  edm::LogInfo(MsgLoggerCat)
709  << "Processing run " << nrun << ", event " << nevt
710  << " (" << count << " events total)";
711  }
712  }
713 
714  // look at information available in the event
715  if (getAllProvenances) {
716 
717  std::vector<const edm::StableProvenance*> AllProv;
718  iEvent.getAllStableProvenance(AllProv);
719 
720  if (verbosity >= 0)
721  edm::LogInfo(MsgLoggerCat)
722  << "Number of Provenances = " << AllProv.size();
723 
724  if (printProvenanceInfo && (verbosity >= 0)) {
725  TString eventout("\nProvenance info:\n");
726 
727  for (unsigned int i = 0; i < AllProv.size(); ++i) {
728  eventout += "\n ******************************";
729  eventout += "\n Module : ";
730  eventout += AllProv[i]->moduleLabel();
731  eventout += "\n ProductID : ";
732  eventout += AllProv[i]->productID().id();
733  eventout += "\n ClassName : ";
734  eventout += AllProv[i]->className();
735  eventout += "\n InstanceName : ";
736  eventout += AllProv[i]->productInstanceName();
737  eventout += "\n BranchName : ";
738  eventout += AllProv[i]->branchName();
739  }
740  eventout += "\n ******************************\n";
741  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
742  printProvenanceInfo = false;
743  }
744  getAllProvenances = false;
745  }
746 
747  // call fill functions
748  //gather G4MC information from event
749  fillG4MC(iEvent);
750  // gather Tracker information from event
751  fillTrk(iEvent,iSetup);
752  // gather muon information from event
753  fillMuon(iEvent, iSetup);
754  // gather Ecal information from event
755  fillECal(iEvent, iSetup);
756  // gather Hcal information from event
757  fillHCal(iEvent, iSetup);
758 
759  if (verbosity > 0)
760  edm::LogInfo (MsgLoggerCat)
761  << "Done gathering data from event.";
762 
763  return;
764 }
765 
766 //==================fill and store functions================================
768 {
769 
770  std::string MsgLoggerCat = "GlobalHitsAnalyzer_fillG4MC";
771 
772  TString eventout;
773  if (verbosity > 0)
774  eventout = "\nGathering info:";
775 
777  // get MC information
780  std::vector<edm::Handle<edm::HepMCProduct> > AllHepMCEvt;
781  iEvent.getManyByType(AllHepMCEvt);
782 
783  // loop through products and extract VtxSmearing if available. Any of them
784  // should have the information needed
785  for (unsigned int i = 0; i < AllHepMCEvt.size(); ++i) {
786  HepMCEvt = AllHepMCEvt[i];
787  if ((HepMCEvt.provenance()->branchDescription()).moduleLabel() == "generatorSmeared")
788  break;
789  }
790 
791  if (!HepMCEvt.isValid()) {
792  LogDebug(MsgLoggerCat)
793  << "Unable to find HepMCProduct in event!";
794  validHepMCevt = false;
795  } else {
796  eventout += "\n Using HepMCProduct: ";
797  eventout += (HepMCEvt.provenance()->branchDescription()).moduleLabel();
798  }
799  if (validHepMCevt) {
800  const HepMC::GenEvent* MCEvt = HepMCEvt->GetEvent();
801  nRawGenPart = MCEvt->particles_size();
802 
803 
804  if (verbosity > 1) {
805  eventout += "\n Number of Raw Particles collected:......... ";
806  eventout += nRawGenPart;
807  }
808 
809  if (meMCRGP[0]) meMCRGP[0]->Fill((float)nRawGenPart);
810  if (meMCRGP[1]) meMCRGP[1]->Fill((float)nRawGenPart);
811  }
812 
813 
815  // get G4Vertex information
817  // convert unit stored in SimVertex to mm
818  float unit = 0.;
819  if (vtxunit == 0) unit = 1.; // already in mm
820  if (vtxunit == 1) unit = 10.; // stored in cm, convert to mm
821 
823  iEvent.getByToken(G4VtxSrc_Token_, G4VtxContainer);
824 
825  // needed here by vertex multiplicity
827  iEvent.getByToken(G4TrkSrc_Token_, G4TrkContainer);
828 
829  if (!G4VtxContainer.isValid()) {
830  LogDebug(MsgLoggerCat)
831  << "Unable to find SimVertex in event!";
832  validG4VtxContainer = false;
833  }
834  if (validG4VtxContainer) {
835  int i = 0;
836  edm::SimVertexContainer::const_iterator itVtx;
837  for (itVtx = G4VtxContainer->begin(); itVtx != G4VtxContainer->end();
838  ++itVtx) {
839 
840  ++i;
841 
842  const math::XYZTLorentzVector G4Vtx1(itVtx->position().x(),
843  itVtx->position().y(),
844  itVtx->position().z(),
845  itVtx->position().e());
846 
847  double G4Vtx[4];
848  G4Vtx1.GetCoordinates(G4Vtx);
849 
850  if (meGeantVtxX[0]) meGeantVtxX[0]->Fill((G4Vtx[0]*unit)/micrometer);
851  if (meGeantVtxX[1]) meGeantVtxX[1]->Fill((G4Vtx[0]*unit)/micrometer);
852 
853  if (meGeantVtxY[0]) meGeantVtxY[0]->Fill((G4Vtx[1]*unit)/micrometer);
854  if (meGeantVtxY[1]) meGeantVtxY[1]->Fill((G4Vtx[1]*unit)/micrometer);
855 
856  if (meGeantVtxZ[0]) meGeantVtxZ[0]->Fill((G4Vtx[2]*unit)/millimeter);
857  if (meGeantVtxZ[1]) meGeantVtxZ[1]->Fill((G4Vtx[2]*unit)/millimeter);
858 
859  if (meGeantVtxEta) meGeantVtxEta->Fill(G4Vtx1.eta());
860  if (meGeantVtxPhi) meGeantVtxPhi->Fill(G4Vtx1.phi());
861  if (meGeantVtxRad[0]) meGeantVtxRad[0]->Fill(G4Vtx1.rho());
862  if (meGeantVtxRad[1]) meGeantVtxRad[1]->Fill(G4Vtx1.rho());
863 
864  if (meGeantVtxMulti) {
865  int multi = 0;
866  if ( G4TrkContainer.isValid() ) {
867  edm::SimTrackContainer::const_iterator itTrk;
868  for (itTrk = G4TrkContainer->begin(); itTrk != G4TrkContainer->end();
869  ++itTrk) {
870  if ( (*itTrk).vertIndex() == i ) { multi++; }
871  }
872  }
873  meGeantVtxMulti->Fill(((double)multi+0.5));
874  }
875 
876  }
877 
878  if (verbosity > 1) {
879  eventout += "\n Number of G4Vertices collected:............ ";
880  eventout += i;
881  }
882 
883  if (meMCG4Vtx[0]) meMCG4Vtx[0]->Fill((float)i);
884  if (meMCG4Vtx[1]) meMCG4Vtx[1]->Fill((float)i);
885 
886  }
887 
889  // get G4Track information
891  if (!G4TrkContainer.isValid()) {
892  LogDebug(MsgLoggerCat)
893  << "Unable to find SimTrack in event!";
894  validG4trkContainer = false;
895  }
896  if (validG4trkContainer) {
897  int i = 0;
898  edm::SimTrackContainer::const_iterator itTrk;
899  for (itTrk = G4TrkContainer->begin(); itTrk != G4TrkContainer->end();
900  ++itTrk) {
901 
902  ++i;
903 
904  const math::XYZTLorentzVector G4Trk1(itTrk->momentum().x(),
905  itTrk->momentum().y(),
906  itTrk->momentum().z(),
907  itTrk->momentum().e());
908  double G4Trk[4];
909  G4Trk1.GetCoordinates(G4Trk);
910 
912  Fill(std::log10(std::max(sqrt(G4Trk[0]*G4Trk[0]+G4Trk[1]*G4Trk[1]),-9.)));
913  if (meGeantTrkE) meGeantTrkE->Fill(std::log10(std::max(G4Trk[3],-9.)));
914  }
915 
916  if (verbosity > 1) {
917  eventout += "\n Number of G4Tracks collected:.............. ";
918  eventout += i;
919  }
920 
921  if (meMCG4Trk[0]) meMCG4Trk[0]->Fill((float)i);
922  if (meMCG4Trk[1]) meMCG4Trk[1]->Fill((float)i);
923  }
924 
925  if (verbosity > 0)
926  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
927 
928  return;
929 }
930 
932  const edm::EventSetup& iSetup)
933 {
934 
935  nPxlHits = 0;
936  std::string MsgLoggerCat = "GlobalHitsAnalyzer_fillTrk";
937 
938  TString eventout;
939  if (verbosity > 0)
940  eventout = "\nGathering info:";
941 
942  // access the tracker geometry
943  edm::ESHandle<TrackerGeometry> theTrackerGeometry;
944  iSetup.get<TrackerDigiGeometryRecord>().get(theTrackerGeometry);
945  if (!theTrackerGeometry.isValid()) {
946  edm::LogWarning(MsgLoggerCat)
947  << "Unable to find TrackerDigiGeometryRecord in event!";
948  return;
949  }
950  const TrackerGeometry& theTracker(*theTrackerGeometry);
951 
952  // iterator to access containers
953  edm::PSimHitContainer::const_iterator itHit;
954 
956  // get Pixel Barrel information
958  edm::PSimHitContainer thePxlBrlHits;
959  // extract low container
960  edm::Handle<edm::PSimHitContainer> PxlBrlLowContainer;
961  iEvent.getByToken(PxlBrlLowSrc_Token_,PxlBrlLowContainer);
962  if (!PxlBrlLowContainer.isValid()) {
963  LogDebug(MsgLoggerCat)
964  << "Unable to find TrackerHitsPixelBarrelLowTof in event!";
965  validPxlBrlLow = false;
966  }
967  // extract high container
968  edm::Handle<edm::PSimHitContainer> PxlBrlHighContainer;
969  iEvent.getByToken(PxlBrlHighSrc_Token_,PxlBrlHighContainer);
970  if (!PxlBrlHighContainer.isValid()) {
971  LogDebug(MsgLoggerCat)
972  << "Unable to find TrackerHitsPixelBarrelHighTof in event!";
973  validPxlBrlHigh = false;
974  }
975  // place both containers into new container
976  if (validPxlBrlLow)
977  thePxlBrlHits.insert(thePxlBrlHits.end(),PxlBrlLowContainer->begin(),
978  PxlBrlLowContainer->end());
979  if(validPxlBrlHigh)
980  thePxlBrlHits.insert(thePxlBrlHits.end(),PxlBrlHighContainer->begin(),
981  PxlBrlHighContainer->end());
982 
983  // cycle through new container
984  int i = 0, j = 0;
985  for (itHit = thePxlBrlHits.begin(); itHit != thePxlBrlHits.end(); ++itHit) {
986 
987  ++i;
988 
989  // create a DetId from the detUnitId
990  DetId theDetUnitId(itHit->detUnitId());
991  int detector = theDetUnitId.det();
992  int subdetector = theDetUnitId.subdetId();
993 
994  // check that expected detector is returned
995  if ((detector == dTrk) && (subdetector == sdPxlBrl)) {
996 
997  // get the GeomDetUnit from the geometry using theDetUnitID
998  const GeomDetUnit *theDet = theTracker.idToDetUnit(theDetUnitId);
999 
1000  if (!theDet) {
1001  edm::LogWarning(MsgLoggerCat)
1002  << "Unable to get GeomDetUnit from PxlBrlHits for Hit " << i;
1003  continue;
1004  }
1005 
1006  ++j;
1007 
1008  // get the Surface of the hit (knows how to go from local <-> global)
1009  const BoundPlane& bSurface = theDet->surface();
1010 
1011  if(meTrackerPxBToF) meTrackerPxBToF->Fill(itHit->tof());
1012  if(meTrackerPxBR)
1013  meTrackerPxBR->Fill(bSurface.toGlobal(itHit->localPosition()).perp());
1014  if(meTrackerPxPhi)
1015  meTrackerPxPhi->Fill(bSurface.toGlobal(itHit->localPosition()).phi());
1016  if(meTrackerPxEta)
1017  meTrackerPxEta->Fill(bSurface.toGlobal(itHit->localPosition()).eta());
1018 
1019  } else {
1020  edm::LogWarning(MsgLoggerCat)
1021  << "PxlBrl PSimHit " << i
1022  << " is expected to be (det,subdet) = ("
1023  << dTrk << "," << sdPxlBrl
1024  << "); value returned is: ("
1025  << detector << "," << subdetector << ")";
1026  continue;
1027  } // end detector type check
1028  } // end loop through PxlBrl Hits
1029 
1030  if (verbosity > 1) {
1031  eventout += "\n Number of Pixel Barrel Hits collected:..... ";
1032  eventout += j;
1033  }
1034 
1035  nPxlHits += j;
1036 
1038  // get Pixel Forward information
1040  edm::PSimHitContainer thePxlFwdHits;
1041  // extract low container
1042  edm::Handle<edm::PSimHitContainer> PxlFwdLowContainer;
1043  iEvent.getByToken(PxlFwdLowSrc_Token_,PxlFwdLowContainer);
1044  if (!PxlFwdLowContainer.isValid()) {
1045  LogDebug(MsgLoggerCat)
1046  << "Unable to find TrackerHitsPixelEndcapLowTof in event!";
1047  validPxlFwdLow = false;
1048  }
1049  // extract high container
1050  edm::Handle<edm::PSimHitContainer> PxlFwdHighContainer;
1051  iEvent.getByToken(PxlFwdHighSrc_Token_,PxlFwdHighContainer);
1052  if (!PxlFwdHighContainer.isValid()) {
1053  LogDebug("GlobalHitsAnalyzer_fillTrk")
1054  << "Unable to find TrackerHitsPixelEndcapHighTof in event!";
1055  validPxlFwdHigh = false;
1056  }
1057  // place both containers into new container
1058  if (validPxlFwdLow)
1059  thePxlFwdHits.insert(thePxlFwdHits.end(),PxlFwdLowContainer->begin(),
1060  PxlFwdLowContainer->end());
1061  if (validPxlFwdHigh)
1062  thePxlFwdHits.insert(thePxlFwdHits.end(),PxlFwdHighContainer->begin(),
1063  PxlFwdHighContainer->end());
1064 
1065  // cycle through new container
1066  i = 0; j = 0;
1067  for (itHit = thePxlFwdHits.begin(); itHit != thePxlFwdHits.end(); ++itHit) {
1068 
1069  ++i;
1070 
1071  // create a DetId from the detUnitId
1072  DetId theDetUnitId(itHit->detUnitId());
1073  int detector = theDetUnitId.det();
1074  int subdetector = theDetUnitId.subdetId();
1075 
1076  // check that expected detector is returned
1077  if ((detector == dTrk) && (subdetector == sdPxlFwd)) {
1078 
1079  // get the GeomDetUnit from the geometry using theDetUnitID
1080  const GeomDetUnit *theDet = theTracker.idToDetUnit(theDetUnitId);
1081 
1082  if (!theDet) {
1083  edm::LogWarning(MsgLoggerCat)
1084  << "Unable to get GeomDetUnit from PxlFwdHits for Hit " << i;;
1085  continue;
1086  }
1087 
1088  ++j;
1089 
1090  // get the Surface of the hit (knows how to go from local <-> global)
1091  const BoundPlane& bSurface = theDet->surface();
1092 
1093  if(meTrackerPxFToF) meTrackerPxFToF->Fill(itHit->tof());
1094  if(meTrackerPxFZ)
1095  meTrackerPxFZ->Fill(bSurface.toGlobal(itHit->localPosition()).z());
1096  if(meTrackerPxPhi)
1097  meTrackerPxPhi->Fill(bSurface.toGlobal(itHit->localPosition()).phi());
1098  if(meTrackerPxEta)
1099  meTrackerPxEta->Fill(bSurface.toGlobal(itHit->localPosition()).eta());
1100 
1101  } else {
1102  edm::LogWarning(MsgLoggerCat)
1103  << "PxlFwd PSimHit " << i
1104  << " is expected to be (det,subdet) = ("
1105  << dTrk << "," << sdPxlFwd
1106  << "); value returned is: ("
1107  << detector << "," << subdetector << ")";
1108  continue;
1109  } // end detector type check
1110  } // end loop through PxlFwd Hits
1111 
1112  if (verbosity > 1) {
1113  eventout += "\n Number of Pixel Forward Hits collected:.... ";
1114  eventout += j;
1115  }
1116 
1117  nPxlHits += j;
1118 
1119  if (meTrackerPx[0]) meTrackerPx[0]->Fill((float)nPxlHits);
1120  if (meTrackerPx[1]) meTrackerPx[1]->Fill((float)nPxlHits);
1121 
1123  // get Silicon Barrel information
1125  nSiHits = 0;
1126  edm::PSimHitContainer theSiBrlHits;
1127  // extract TIB low container
1128  edm::Handle<edm::PSimHitContainer> SiTIBLowContainer;
1129  iEvent.getByToken(SiTIBLowSrc_Token_,SiTIBLowContainer);
1130  if (!SiTIBLowContainer.isValid()) {
1131  LogDebug(MsgLoggerCat)
1132  << "Unable to find TrackerHitsTIBLowTof in event!";
1133  validSiTIBLow = false;
1134  }
1135  // extract TIB high container
1136  edm::Handle<edm::PSimHitContainer> SiTIBHighContainer;
1137  iEvent.getByToken(SiTIBHighSrc_Token_,SiTIBHighContainer);
1138  if (!SiTIBHighContainer.isValid()) {
1139  LogDebug(MsgLoggerCat)
1140  << "Unable to find TrackerHitsTIBHighTof in event!";
1141  validSiTIBHigh = false;
1142  }
1143  // extract TOB low container
1144  edm::Handle<edm::PSimHitContainer> SiTOBLowContainer;
1145  iEvent.getByToken(SiTOBLowSrc_Token_,SiTOBLowContainer);
1146  if (!SiTOBLowContainer.isValid()) {
1147  LogDebug(MsgLoggerCat)
1148  << "Unable to find TrackerHitsTOBLowTof in event!";
1149  validSiTOBLow = false;
1150  }
1151  // extract TOB high container
1152  edm::Handle<edm::PSimHitContainer> SiTOBHighContainer;
1153  iEvent.getByToken(SiTOBHighSrc_Token_,SiTOBHighContainer);
1154  if (!SiTOBHighContainer.isValid()) {
1155  LogDebug(MsgLoggerCat)
1156  << "Unable to find TrackerHitsTOBHighTof in event!";
1157  validSiTOBHigh = false;
1158  }
1159  // place all containers into new container
1160  if (validSiTIBLow)
1161  theSiBrlHits.insert(theSiBrlHits.end(),SiTIBLowContainer->begin(),
1162  SiTIBLowContainer->end());
1163  if (validSiTIBHigh)
1164  theSiBrlHits.insert(theSiBrlHits.end(),SiTIBHighContainer->begin(),
1165  SiTIBHighContainer->end());
1166  if (validSiTOBLow)
1167  theSiBrlHits.insert(theSiBrlHits.end(),SiTOBLowContainer->begin(),
1168  SiTOBLowContainer->end());
1169  if (validSiTOBHigh)
1170  theSiBrlHits.insert(theSiBrlHits.end(),SiTOBHighContainer->begin(),
1171  SiTOBHighContainer->end());
1172 
1173  // cycle through new container
1174  i = 0; j = 0;
1175  for (itHit = theSiBrlHits.begin(); itHit != theSiBrlHits.end(); ++itHit) {
1176 
1177  ++i;
1178 
1179  // create a DetId from the detUnitId
1180  DetId theDetUnitId(itHit->detUnitId());
1181  int detector = theDetUnitId.det();
1182  int subdetector = theDetUnitId.subdetId();
1183 
1184  // check that expected detector is returned
1185  if ((detector == dTrk) &&
1186  ((subdetector == sdSiTIB) ||
1187  (subdetector == sdSiTOB))) {
1188 
1189  // get the GeomDetUnit from the geometry using theDetUnitID
1190  const GeomDetUnit *theDet = theTracker.idToDetUnit(theDetUnitId);
1191 
1192  if (!theDet) {
1193  edm::LogWarning(MsgLoggerCat)
1194  << "Unable to get GeomDetUnit from SiBrlHits for Hit " << i;
1195  continue;
1196  }
1197 
1198  ++j;
1199 
1200  // get the Surface of the hit (knows how to go from local <-> global)
1201  const BoundPlane& bSurface = theDet->surface();
1202 
1203  if(meTrackerSiBToF) meTrackerSiBToF->Fill(itHit->tof());
1204  if(meTrackerSiBR)
1205  meTrackerSiBR->Fill(bSurface.toGlobal(itHit->localPosition()).perp());
1206  if(meTrackerSiPhi)
1207  meTrackerSiPhi->Fill(bSurface.toGlobal(itHit->localPosition()).phi());
1208  if(meTrackerSiEta)
1209  meTrackerSiEta->Fill(bSurface.toGlobal(itHit->localPosition()).eta());
1210 
1211  } else {
1212  edm::LogWarning(MsgLoggerCat)
1213  << "SiBrl PSimHit " << i
1214  << " is expected to be (det,subdet) = ("
1215  << dTrk << "," << sdSiTIB
1216  << " || " << sdSiTOB << "); value returned is: ("
1217  << detector << "," << subdetector << ")";
1218  continue;
1219  } // end detector type check
1220  } // end loop through SiBrl Hits
1221 
1222  if (verbosity > 1) {
1223  eventout += "\n Number of Silicon Barrel Hits collected:... ";
1224  eventout += j;
1225  }
1226 
1227  nSiHits += j;
1228 
1230  // get Silicon Forward information
1232  edm::PSimHitContainer theSiFwdHits;
1233  // extract TID low container
1234  edm::Handle<edm::PSimHitContainer> SiTIDLowContainer;
1235  iEvent.getByToken(SiTIDLowSrc_Token_,SiTIDLowContainer);
1236  if (!SiTIDLowContainer.isValid()) {
1237  LogDebug(MsgLoggerCat)
1238  << "Unable to find TrackerHitsTIDLowTof in event!";
1239  validSiTIDLow = false;
1240  }
1241  // extract TID high container
1242  edm::Handle<edm::PSimHitContainer> SiTIDHighContainer;
1243  iEvent.getByToken(SiTIDHighSrc_Token_,SiTIDHighContainer);
1244  if (!SiTIDHighContainer.isValid()) {
1245  LogDebug("GlobalHitsAnalyzer_fillTrk")
1246  << "Unable to find TrackerHitsTIDHighTof in event!";
1247  validSiTIDHigh = false;
1248  }
1249  // extract TEC low container
1250  edm::Handle<edm::PSimHitContainer> SiTECLowContainer;
1251  iEvent.getByToken(SiTECLowSrc_Token_,SiTECLowContainer);
1252  if (!SiTECLowContainer.isValid()) {
1253  LogDebug(MsgLoggerCat)
1254  << "Unable to find TrackerHitsTECLowTof in event!";
1255  validSiTECLow = false;
1256  }
1257  // extract TEC high container
1258  edm::Handle<edm::PSimHitContainer> SiTECHighContainer;
1259  iEvent.getByToken(SiTECHighSrc_Token_,SiTECHighContainer);
1260  if (!SiTECHighContainer.isValid()) {
1261  LogDebug(MsgLoggerCat)
1262  << "Unable to find TrackerHitsTECHighTof in event!";
1263  validSiTECHigh = false;
1264  }
1265  // place all containers into new container
1266  if (validSiTIDLow)
1267  theSiFwdHits.insert(theSiFwdHits.end(),SiTIDLowContainer->begin(),
1268  SiTIDLowContainer->end());
1269  if (validSiTIDHigh)
1270  theSiFwdHits.insert(theSiFwdHits.end(),SiTIDHighContainer->begin(),
1271  SiTIDHighContainer->end());
1272  if (validSiTECLow)
1273  theSiFwdHits.insert(theSiFwdHits.end(),SiTECLowContainer->begin(),
1274  SiTECLowContainer->end());
1275  if (validSiTECHigh)
1276  theSiFwdHits.insert(theSiFwdHits.end(),SiTECHighContainer->begin(),
1277  SiTECHighContainer->end());
1278 
1279  // cycle through container
1280  i = 0; j = 0;
1281  for (itHit = theSiFwdHits.begin(); itHit != theSiFwdHits.end(); ++itHit) {
1282 
1283  ++i;
1284 
1285  // create a DetId from the detUnitId
1286  DetId theDetUnitId(itHit->detUnitId());
1287  int detector = theDetUnitId.det();
1288  int subdetector = theDetUnitId.subdetId();
1289 
1290  // check that expected detector is returned
1291  if ((detector == dTrk) &&
1292  ((subdetector == sdSiTID) ||
1293  (subdetector == sdSiTEC))) {
1294 
1295  // get the GeomDetUnit from the geometry using theDetUnitID
1296  const GeomDetUnit *theDet = theTracker.idToDetUnit(theDetUnitId);
1297 
1298  if (!theDet) {
1299  edm::LogWarning(MsgLoggerCat)
1300  << "Unable to get GeomDetUnit from SiFwdHits Hit " << i;
1301  return;
1302  }
1303 
1304  ++j;
1305 
1306  // get the Surface of the hit (knows how to go from local <-> global)
1307  const BoundPlane& bSurface = theDet->surface();
1308 
1309  if(meTrackerSiFToF) meTrackerSiFToF->Fill(itHit->tof());
1310  if(meTrackerSiFZ)
1311  meTrackerSiFZ->Fill(bSurface.toGlobal(itHit->localPosition()).z());
1312  if(meTrackerSiPhi)
1313  meTrackerSiPhi->Fill(bSurface.toGlobal(itHit->localPosition()).phi());
1314  if(meTrackerSiEta)
1315  meTrackerSiEta->Fill(bSurface.toGlobal(itHit->localPosition()).eta());
1316 
1317  } else {
1318  edm::LogWarning(MsgLoggerCat)
1319  << "SiFwd PSimHit " << i
1320  << " is expected to be (det,subdet) = ("
1321  << dTrk << "," << sdSiTOB
1322  << " || " << sdSiTEC << "); value returned is: ("
1323  << detector << "," << subdetector << ")";
1324  continue;
1325  } // end check detector type
1326  } // end loop through SiFwd Hits
1327 
1328  if (verbosity > 1) {
1329  eventout += "\n Number of Silicon Forward Hits collected:.. ";
1330  eventout += j;
1331  }
1332 
1333  nSiHits +=j;
1334 
1335  if (meTrackerSi[0]) meTrackerSi[0]->Fill((float)nSiHits);
1336  if (meTrackerSi[1]) meTrackerSi[1]->Fill((float)nSiHits);
1337 
1338  if (verbosity > 0)
1339  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1340 
1341  return;
1342 }
1343 
1345  const edm::EventSetup& iSetup)
1346 {
1347  nMuonHits = 0;
1348  std::string MsgLoggerCat = "GlobalHitsAnalyzer_fillMuon";
1349 
1350  TString eventout;
1351  if (verbosity > 0)
1352  eventout = "\nGathering info:";
1353 
1354  // iterator to access containers
1355  edm::PSimHitContainer::const_iterator itHit;
1356 
1358  // access the CSC Muon
1360  // access the CSC Muon geometry
1361  edm::ESHandle<CSCGeometry> theCSCGeometry;
1362  iSetup.get<MuonGeometryRecord>().get(theCSCGeometry);
1363  if (!theCSCGeometry.isValid()) {
1364  edm::LogWarning(MsgLoggerCat)
1365  << "Unable to find MuonGeometryRecord for the CSCGeometry in event!";
1366  return;
1367  }
1368  const CSCGeometry& theCSCMuon(*theCSCGeometry);
1369 
1370  // get Muon CSC information
1371  edm::Handle<edm::PSimHitContainer> MuonCSCContainer;
1372  iEvent.getByToken(MuonCscSrc_Token_,MuonCSCContainer);
1373  if (!MuonCSCContainer.isValid()) {
1374  LogDebug(MsgLoggerCat)
1375  << "Unable to find MuonCSCHits in event!";
1376  validMuonCSC = false;
1377  }
1378 
1379  if (validMuonCSC) {
1380  // cycle through container
1381  int i = 0, j = 0;
1382  for (itHit = MuonCSCContainer->begin(); itHit != MuonCSCContainer->end();
1383  ++itHit) {
1384 
1385  ++i;
1386 
1387  // create a DetId from the detUnitId
1388  DetId theDetUnitId(itHit->detUnitId());
1389  int detector = theDetUnitId.det();
1390  int subdetector = theDetUnitId.subdetId();
1391 
1392  // check that expected detector is returned
1393  if ((detector == dMuon) &&
1394  (subdetector == sdMuonCSC)) {
1395 
1396  // get the GeomDetUnit from the geometry using theDetUnitID
1397  const GeomDetUnit *theDet = theCSCMuon.idToDetUnit(theDetUnitId);
1398 
1399  if (!theDet) {
1400  edm::LogWarning(MsgLoggerCat)
1401  << "Unable to get GeomDetUnit from theCSCMuon for hit " << i;
1402  continue;
1403  }
1404 
1405  ++j;
1406 
1407  // get the Surface of the hit (knows how to go from local <-> global)
1408  const BoundPlane& bSurface = theDet->surface();
1409 
1410  if (meMuonCscToF[0]) meMuonCscToF[0]->Fill(itHit->tof());
1411  if (meMuonCscToF[1]) meMuonCscToF[1]->Fill(itHit->tof());
1412  if (meMuonCscZ)
1413  meMuonCscZ->Fill(bSurface.toGlobal(itHit->localPosition()).z());
1414  if (meMuonPhi)
1415  meMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).phi());
1416  if (meMuonEta)
1417  meMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).eta());
1418 
1419  } else {
1420  edm::LogWarning(MsgLoggerCat)
1421  << "MuonCsc PSimHit " << i
1422  << " is expected to be (det,subdet) = ("
1423  << dMuon << "," << sdMuonCSC
1424  << "); value returned is: ("
1425  << detector << "," << subdetector << ")";
1426  continue;
1427  } // end detector type check
1428  } // end loop through CSC Hits
1429 
1430  if (verbosity > 1) {
1431  eventout += "\n Number of CSC muon Hits collected:......... ";
1432  eventout += j;
1433  }
1434 
1435  nMuonHits += j;
1436  }
1437 
1439  // access the DT Muon
1441  // access the DT Muon geometry
1442  edm::ESHandle<DTGeometry> theDTGeometry;
1443  iSetup.get<MuonGeometryRecord>().get(theDTGeometry);
1444  if (!theDTGeometry.isValid()) {
1445  edm::LogWarning(MsgLoggerCat)
1446  << "Unable to find MuonGeometryRecord for the DTGeometry in event!";
1447  return;
1448  }
1449  const DTGeometry& theDTMuon(*theDTGeometry);
1450 
1451  // get Muon DT information
1452  edm::Handle<edm::PSimHitContainer> MuonDtContainer;
1453  iEvent.getByToken(MuonDtSrc_Token_,MuonDtContainer);
1454  if (!MuonDtContainer.isValid()) {
1455  LogDebug(MsgLoggerCat)
1456  << "Unable to find MuonDTHits in event!";
1457  validMuonDt = false;
1458  }
1459 
1460  if (validMuonDt) {
1461  // cycle through container
1462  int i = 0, j = 0;
1463  for (itHit = MuonDtContainer->begin(); itHit != MuonDtContainer->end();
1464  ++itHit) {
1465 
1466  ++i;
1467 
1468  // create a DetId from the detUnitId
1469  DetId theDetUnitId(itHit->detUnitId());
1470  int detector = theDetUnitId.det();
1471  int subdetector = theDetUnitId.subdetId();
1472 
1473  // check that expected detector is returned
1474  if ((detector == dMuon) &&
1475  (subdetector == sdMuonDT)) {
1476 
1477  // CSC uses wires and layers rather than the full detID
1478  // get the wireId
1479  DTWireId wireId(itHit->detUnitId());
1480 
1481  // get the DTLayer from the geometry using the wireID
1482  const DTLayer *theDet = theDTMuon.layer(wireId.layerId());
1483 
1484  if (!theDet) {
1485  edm::LogWarning(MsgLoggerCat)
1486  << "Unable to get GeomDetUnit from theDtMuon for hit " << i;
1487  continue;
1488  }
1489 
1490  ++j;
1491 
1492  // get the Surface of the hit (knows how to go from local <-> global)
1493  const BoundPlane& bSurface = theDet->surface();
1494 
1495  if (meMuonDtToF[0]) meMuonDtToF[0]->Fill(itHit->tof());
1496  if (meMuonDtToF[1]) meMuonDtToF[1]->Fill(itHit->tof());
1497  if (meMuonDtR)
1498  meMuonDtR->Fill(bSurface.toGlobal(itHit->localPosition()).perp());
1499  if (meMuonPhi)
1500  meMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).phi());
1501  if (meMuonEta)
1502  meMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).eta());
1503 
1504  } else {
1505  edm::LogWarning(MsgLoggerCat)
1506  << "MuonDt PSimHit " << i
1507  << " is expected to be (det,subdet) = ("
1508  << dMuon << "," << sdMuonDT
1509  << "); value returned is: ("
1510  << detector << "," << subdetector << ")";
1511  continue;
1512  } // end detector type check
1513  } // end loop through DT Hits
1514 
1515  if (verbosity > 1) {
1516  eventout += "\n Number of DT muon Hits collected:.......... ";
1517  eventout += j;
1518  }
1519 
1520  nMuonHits += j;
1521  }
1522 
1523  //int RPCBrl = 0, RPCFwd = 0;
1525  // access the RPC Muon
1527  // access the RPC Muon geometry
1528  edm::ESHandle<RPCGeometry> theRPCGeometry;
1529  iSetup.get<MuonGeometryRecord>().get(theRPCGeometry);
1530  if (!theRPCGeometry.isValid()) {
1531  edm::LogWarning(MsgLoggerCat)
1532  << "Unable to find MuonGeometryRecord for the RPCGeometry in event!";
1533  return;
1534  }
1535  const RPCGeometry& theRPCMuon(*theRPCGeometry);
1536 
1537  // get Muon RPC information
1538  edm::Handle<edm::PSimHitContainer> MuonRPCContainer;
1539  iEvent.getByToken(MuonRpcSrc_Token_,MuonRPCContainer);
1540  if (!MuonRPCContainer.isValid()) {
1541  LogDebug(MsgLoggerCat)
1542  << "Unable to find MuonRPCHits in event!";
1543  validMuonRPC = false;
1544  }
1545 
1546  if (validMuonRPC) {
1547  // cycle through container
1548  int i = 0, j = 0;
1549  int RPCBrl =0, RPCFwd = 0;
1550  for (itHit = MuonRPCContainer->begin(); itHit != MuonRPCContainer->end();
1551  ++itHit) {
1552 
1553  ++i;
1554 
1555  // create a DetID from the detUnitId
1556  DetId theDetUnitId(itHit->detUnitId());
1557  int detector = theDetUnitId.det();
1558  int subdetector = theDetUnitId.subdetId();
1559 
1560  // check that expected detector is returned
1561  if ((detector == dMuon) &&
1562  (subdetector == sdMuonRPC)) {
1563 
1564  // get an RPCDetID from the detUnitID
1565  RPCDetId RPCId(itHit->detUnitId());
1566 
1567  // find the region of the RPC hit
1568  int region = RPCId.region();
1569 
1570  // get the GeomDetUnit from the geometry using the RPCDetId
1571  const GeomDetUnit *theDet = theRPCMuon.idToDetUnit(theDetUnitId);
1572 
1573  if (!theDet) {
1574  edm::LogWarning(MsgLoggerCat)
1575  << "Unable to get GeomDetUnit from theRPCMuon for hit " << i;
1576  continue;
1577  }
1578 
1579  ++j;
1580 
1581  // get the Surface of the hit (knows how to go from local <-> global)
1582  const BoundPlane& bSurface = theDet->surface();
1583 
1584  // gather necessary information
1585  if ((region == sdMuonRPCRgnFwdp) || (region == sdMuonRPCRgnFwdn)) {
1586  ++RPCFwd;
1587 
1588  if (meMuonRpcFToF[0]) meMuonRpcFToF[0]->Fill(itHit->tof());
1589  if (meMuonRpcFToF[1]) meMuonRpcFToF[1]->Fill(itHit->tof());
1590  if (meMuonRpcFZ)
1591  meMuonRpcFZ->Fill(bSurface.toGlobal(itHit->localPosition()).z());
1592  if (meMuonPhi)
1593  meMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).phi());
1594  if (meMuonEta)
1595  meMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).eta());
1596 
1597  } else if (region == sdMuonRPCRgnBrl) {
1598  ++RPCBrl;
1599 
1600  if (meMuonRpcBToF[0]) meMuonRpcBToF[0]->Fill(itHit->tof());
1601  if (meMuonRpcBToF[1]) meMuonRpcBToF[1]->Fill(itHit->tof());
1602  if (meMuonRpcBR)
1603  meMuonRpcBR->Fill(bSurface.toGlobal(itHit->
1604  localPosition()).perp());
1605  if (meMuonPhi)
1606  meMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).phi());
1607  if (meMuonEta)
1608  meMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).eta());
1609 
1610  } else {
1611  edm::LogWarning(MsgLoggerCat)
1612  << "Invalid region for RPC Muon hit" << i;
1613  continue;
1614  } // end check of region
1615  } else {
1616  edm::LogWarning(MsgLoggerCat)
1617  << "MuonRpc PSimHit " << i
1618  << " is expected to be (det,subdet) = ("
1619  << dMuon << "," << sdMuonRPC
1620  << "); value returned is: ("
1621  << detector << "," << subdetector << ")";
1622  continue;
1623  } // end detector type check
1624  } // end loop through RPC Hits
1625 
1626  if (verbosity > 1) {
1627  eventout += "\n Number of RPC muon Hits collected:......... ";
1628  eventout += j;
1629  eventout += "\n RPC Barrel muon Hits:............ ";
1630  eventout += RPCBrl;
1631  eventout += "\n RPC Forward muon Hits:........... ";
1632  eventout += RPCFwd;
1633  }
1634 
1635  nMuonHits += j;
1636  }
1637 
1638  if (meMuon[0]) meMuon[0]->Fill((float)nMuonHits);
1639  if (meMuon[1]) meMuon[1]->Fill((float)nMuonHits);
1640 
1641  if (verbosity > 0)
1642  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1643 
1644  return;
1645 }
1646 
1648  const edm::EventSetup& iSetup)
1649 {
1650  std::string MsgLoggerCat = "GlobalHitsAnalyzer_fillECal";
1651 
1652  TString eventout;
1653  if (verbosity > 0)
1654  eventout = "\nGathering info:";
1655 
1656  // access the calorimeter geometry
1657  edm::ESHandle<CaloGeometry> theCaloGeometry;
1658  iSetup.get<CaloGeometryRecord>().get(theCaloGeometry);
1659  if (!theCaloGeometry.isValid()) {
1660  edm::LogWarning(MsgLoggerCat)
1661  << "Unable to find CaloGeometryRecord in event!";
1662  return;
1663  }
1664  const CaloGeometry& theCalo(*theCaloGeometry);
1665 
1666  // iterator to access containers
1667  edm::PCaloHitContainer::const_iterator itHit;
1668 
1670  // get ECal information
1672  edm::PCaloHitContainer theECalHits;
1673  // extract EB container
1675  iEvent.getByToken(ECalEBSrc_Token_,EBContainer);
1676  if (!EBContainer.isValid()) {
1677  LogDebug(MsgLoggerCat)
1678  << "Unable to find EcalHitsEB in event!";
1679  validEB = false;
1680  }
1681  // extract EE container
1683  iEvent.getByToken(ECalEESrc_Token_,EEContainer);
1684  if (!EEContainer.isValid()) {
1685  LogDebug(MsgLoggerCat)
1686  << "Unable to find EcalHitsEE in event!";
1687  validEE = false;
1688  }
1689  // place both containers into new container
1690  if (validEB)
1691  theECalHits.insert(theECalHits.end(),EBContainer->begin(),
1692  EBContainer->end());
1693  if (validEE)
1694  theECalHits.insert(theECalHits.end(),EEContainer->begin(),
1695  EEContainer->end());
1696 
1697  // cycle through new container
1698  int i = 0, j = 0;
1699  for (itHit = theECalHits.begin(); itHit != theECalHits.end(); ++itHit) {
1700 
1701  ++i;
1702 
1703  // create a DetId from the detUnitId
1704  DetId theDetUnitId(itHit->id());
1705  int detector = theDetUnitId.det();
1706  int subdetector = theDetUnitId.subdetId();
1707 
1708  // check that expected detector is returned
1709  if ((detector == dEcal) &&
1710  ((subdetector == sdEcalBrl) ||
1711  (subdetector == sdEcalFwd))) {
1712 
1713  // get the Cell geometry
1714  auto theDet = (theCalo.getSubdetectorGeometry(theDetUnitId))->getGeometry(theDetUnitId);
1715 
1716  if (!theDet) {
1717  edm::LogWarning(MsgLoggerCat)
1718  << "Unable to get CaloCellGeometry from ECalHits for Hit " << i;
1719  continue;
1720  }
1721 
1722  ++j;
1723 
1724  // get the global position of the cell
1725  const GlobalPoint& globalposition = theDet->getPosition();
1726 
1727  if (meCaloEcalE[0]) meCaloEcalE[0]->Fill(itHit->energy());
1728  if (meCaloEcalE[1]) meCaloEcalE[1]->Fill(itHit->energy());
1729  if (meCaloEcalToF[0]) meCaloEcalToF[0]->Fill(itHit->time());
1730  if (meCaloEcalToF[1]) meCaloEcalToF[1]->Fill(itHit->time());
1731  if (meCaloEcalPhi) meCaloEcalPhi->Fill(globalposition.phi());
1732  if (meCaloEcalEta) meCaloEcalEta->Fill(globalposition.eta());
1733 
1734  } else {
1735  edm::LogWarning(MsgLoggerCat)
1736  << "ECal PCaloHit " << i
1737  << " is expected to be (det,subdet) = ("
1738  << dEcal << "," << sdEcalBrl
1739  << " || " << sdEcalFwd << "); value returned is: ("
1740  << detector << "," << subdetector << ")";
1741  continue;
1742  } // end detector type check
1743  } // end loop through ECal Hits
1744 
1745  if (verbosity > 1) {
1746  eventout += "\n Number of ECal Hits collected:............. ";
1747  eventout += j;
1748  }
1749 
1750  if (meCaloEcal[0]) meCaloEcal[0]->Fill((float)j);
1751  if (meCaloEcal[1]) meCaloEcal[1]->Fill((float)j);
1752 
1754  // Get Preshower information
1756  // extract PreShower container
1757  edm::Handle<edm::PCaloHitContainer> PreShContainer;
1758  iEvent.getByToken(ECalESSrc_Token_,PreShContainer);
1759  if (!PreShContainer.isValid()) {
1760  LogDebug(MsgLoggerCat)
1761  << "Unable to find EcalHitsES in event!";
1762  validPresh = false;
1763  }
1764 
1765  if (validPresh) {
1766  // cycle through container
1767  int i = 0, j = 0;
1768  for (itHit = PreShContainer->begin();
1769  itHit != PreShContainer->end(); ++itHit) {
1770 
1771  ++i;
1772 
1773  // create a DetId from the detUnitId
1774  DetId theDetUnitId(itHit->id());
1775  int detector = theDetUnitId.det();
1776  int subdetector = theDetUnitId.subdetId();
1777 
1778  // check that expected detector is returned
1779  if ((detector == dEcal) &&
1780  (subdetector == sdEcalPS)) {
1781 
1782  // get the Cell geometry
1783  auto theDet = (theCalo.getSubdetectorGeometry(theDetUnitId))->getGeometry(theDetUnitId);
1784 
1785  if (!theDet) {
1786  edm::LogWarning(MsgLoggerCat)
1787  << "Unable to get CaloCellGeometry from PreShContainer for Hit "
1788  << i;
1789  continue;
1790  }
1791 
1792  ++j;
1793 
1794  // get the global position of the cell
1795  const GlobalPoint& globalposition = theDet->getPosition();
1796 
1797  if (meCaloPreShE[0]) meCaloPreShE[0]->Fill(itHit->energy());
1798  if (meCaloPreShE[1]) meCaloPreShE[1]->Fill(itHit->energy());
1799  if (meCaloPreShToF[0]) meCaloPreShToF[0]->Fill(itHit->time());
1800  if (meCaloPreShToF[1]) meCaloPreShToF[1]->Fill(itHit->time());
1801  if (meCaloPreShPhi) meCaloPreShPhi->Fill(globalposition.phi());
1802  if (meCaloPreShEta) meCaloPreShEta->Fill(globalposition.eta());
1803 
1804  } else {
1805  edm::LogWarning(MsgLoggerCat)
1806  << "PreSh PCaloHit " << i
1807  << " is expected to be (det,subdet) = ("
1808  << dEcal << "," << sdEcalPS
1809  << "); value returned is: ("
1810  << detector << "," << subdetector << ")";
1811  continue;
1812  } // end detector type check
1813  } // end loop through PreShower Hits
1814 
1815  if (verbosity > 1) {
1816  eventout += "\n Number of PreSh Hits collected:............ ";
1817  eventout += j;
1818  }
1819 
1820  if (meCaloPreSh[0]) meCaloPreSh[0]->Fill((float)j);
1821  if (meCaloPreSh[1]) meCaloPreSh[1]->Fill((float)j);
1822  }
1823 
1824  if (verbosity > 0)
1825  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1826 
1827  return;
1828 }
1829 
1831  const edm::EventSetup& iSetup)
1832 {
1833  std::string MsgLoggerCat = "GlobalHitsAnalyzer_fillHCal";
1834 
1835  TString eventout;
1836  if (verbosity > 0)
1837  eventout = "\nGathering info:";
1838 
1839  // access the calorimeter geometry
1840  edm::ESHandle<CaloGeometry> theCaloGeometry;
1841  iSetup.get<CaloGeometryRecord>().get(theCaloGeometry);
1842  if (!theCaloGeometry.isValid()) {
1843  edm::LogWarning(MsgLoggerCat)
1844  << "Unable to find CaloGeometryRecord in event!";
1845  return;
1846  }
1847  const CaloGeometry& theCalo(*theCaloGeometry);
1848 
1850  iSetup.get<HcalRecNumberingRecord>().get( pHRNDC );
1851  const HcalDDDRecConstants* hcons = &(*pHRNDC);
1852 
1853  // iterator to access containers
1854  edm::PCaloHitContainer::const_iterator itHit;
1855 
1857  // get HCal information
1859  // extract HCal container
1861  iEvent.getByToken(HCalSrc_Token_,HCalContainer);
1862  if (!HCalContainer.isValid()) {
1863  LogDebug(MsgLoggerCat)
1864  << "Unable to find HCalHits in event!";
1865  validHcal = false;
1866  }
1867 
1868  if (validHcal) {
1869  // cycle through container
1870  int i = 0, j = 0;
1871  for (itHit = HCalContainer->begin();
1872  itHit != HCalContainer->end(); ++itHit) {
1873 
1874  ++i;
1875 
1876  // create a DetId from the detUnitId
1877  DetId theDetUnitId;
1878  unsigned int id_ = itHit->id();
1879  if(testNumber) theDetUnitId = HcalHitRelabeller::relabel(id_,hcons);
1880  else theDetUnitId = id_;
1881 
1882  int detector = theDetUnitId.det();
1883  int subdetector = theDetUnitId.subdetId();
1884 
1885  // check that expected detector is returned
1886  if ((detector == dHcal) &&
1887  ((subdetector == sdHcalBrl) ||
1888  (subdetector == sdHcalEC) ||
1889  (subdetector == sdHcalOut) ||
1890  (subdetector == sdHcalFwd))) {
1891 
1892  // get the Cell geometry
1893  const HcalGeometry *theDet = dynamic_cast<const HcalGeometry*>
1894  (theCalo.getSubdetectorGeometry(theDetUnitId));
1895 
1896  if (!theDet) {
1897  edm::LogWarning(MsgLoggerCat)
1898  << "Unable to get HcalGeometry from HCalContainer for Hit "
1899  << i;
1900  continue;
1901  }
1902 
1903  ++j;
1904 
1905  // get the global position of the cell
1906  const GlobalPoint& globalposition = theDet->getPosition(theDetUnitId);
1907 
1908  if (meCaloHcalE[0]) meCaloHcalE[0]->Fill(itHit->energy());
1909  if (meCaloHcalE[1]) meCaloHcalE[1]->Fill(itHit->energy());
1910  if (meCaloHcalToF[0]) meCaloHcalToF[0]->Fill(itHit->time());
1911  if (meCaloHcalToF[1]) meCaloHcalToF[1]->Fill(itHit->time());
1912  if (meCaloHcalPhi) meCaloHcalPhi->Fill(globalposition.phi());
1913  if (meCaloHcalEta) meCaloHcalEta->Fill(globalposition.eta());
1914 
1915  } else {
1916  edm::LogWarning(MsgLoggerCat)
1917  << "HCal PCaloHit " << i
1918  << " is expected to be (det,subdet) = ("
1919  << dHcal << "," << sdHcalBrl
1920  << " || " << sdHcalEC << " || " << sdHcalOut << " || " << sdHcalFwd
1921  << "); value returned is: ("
1922  << detector << "," << subdetector << ")";
1923  continue;
1924  } // end detector type check
1925  } // end loop through HCal Hits
1926 
1927  if (verbosity > 1) {
1928  eventout += "\n Number of HCal Hits collected:............. ";
1929  eventout += j;
1930  }
1931 
1932  if (meCaloHcal[0]) meCaloHcal[0]->Fill((float)j);
1933  if (meCaloHcal[1]) meCaloHcal[1]->Fill((float)j);
1934  }
1935 
1936  if (verbosity > 0)
1937  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1938 
1939  return;
1940 }
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:39
MonitorElement * meTrackerSiPhi
void getManyByType(std::vector< Handle< PROD > > &results) const
Definition: Event.h:509
T getParameter(std::string const &) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:44
EventNumber_t event() const
Definition: EventID.h:41
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::PSimHitContainer > SiTIDLowSrc_Token_
void fillG4MC(const edm::Event &)
static const int dEcal
static const int dTrk
std::vector< PCaloHit > PCaloHitContainer
edm::InputTag SiTECLowSrc_
edm::EDGetTokenT< edm::PSimHitContainer > SiTECHighSrc_Token_
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: RPCGeometry.cc:48
edm::InputTag PxlBrlLowSrc_
edm::InputTag MuonDtSrc_
static const int sdMuonRPCRgnFwdn
static const int sdHcalOut
MonitorElement * meMuonDtToF[2]
static const int sdMuonDT
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
MonitorElement * meGeantVtxRad[2]
TString subdetector
MonitorElement * meCaloHcal[2]
MonitorElement * meMCG4Trk[2]
static const int sdSiTID
MonitorElement * meTrackerPxPhi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
MonitorElement * meCaloHcalToF[2]
edm::EDGetTokenT< edm::PSimHitContainer > SiTIDHighSrc_Token_
unsigned long long EventNumber_t
MonitorElement * meCaloPreSh[2]
static const int sdEcalPS
edm::EDGetTokenT< edm::PCaloHitContainer > ECalEESrc_Token_
MonitorElement * meTrackerSiEta
void fillHCal(const edm::Event &, const edm::EventSetup &)
MonitorElement * meTrackerSiBToF
static const int sdMuonRPC
MonitorElement * meTrackerSi[2]
edm::EDGetTokenT< edm::SimTrackContainer > G4TrkSrc_Token_
CaloGeometry const * getGeometry()
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
edm::EDGetTokenT< edm::PSimHitContainer > SiTIBHighSrc_Token_
MonitorElement * meMCG4Vtx[2]
edm::InputTag SiTIBHighSrc_
MonitorElement * meGeantVtxY[2]
MonitorElement * meGeantVtxMulti
void Fill(long long x)
MonitorElement * meTrackerPxFZ
edm::InputTag MuonCscSrc_
edm::InputTag PxlBrlHighSrc_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
int iEvent
Definition: GenABIO.cc:230
MonitorElement * meMuonCscToF[2]
MonitorElement * meCaloPreShPhi
MonitorElement * meGeantTrkE
static const int sdSiTIB
MonitorElement * meCaloEcalEta
static const int sdPxlBrl
MonitorElement * meTrackerPxBR
MonitorElement * meCaloPreShE[2]
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
edm::InputTag PxlFwdLowSrc_
T sqrt(T t)
Definition: SSEVec.h:18
static const int sdMuonCSC
MonitorElement * meTrackerPxBToF
static const int sdEcalFwd
MonitorElement * meGeantVtxPhi
edm::InputTag SiTIDLowSrc_
edm::InputTag ECalESSrc_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
MonitorElement * meCaloEcalPhi
edm::EDGetTokenT< edm::PSimHitContainer > SiTIBLowSrc_Token_
MonitorElement * meTrackerPx[2]
MonitorElement * meGeantTrkPt
MonitorElement * meGeantVtxEta
edm::InputTag PxlFwdHighSrc_
MonitorElement * meMuonRpcFZ
edm::EDGetTokenT< edm::PSimHitContainer > PxlBrlHighSrc_Token_
static const int sdSiTOB
static const int sdEcalBrl
edm::InputTag SiTECHighSrc_
static const int sdMuonRPCRgnFwdp
static const int sdMuonRPCRgnBrl
edm::EDGetTokenT< edm::PCaloHitContainer > ECalEBSrc_Token_
bool isValid() const
Definition: HandleBase.h:74
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:38
void fillTrk(const edm::Event &, const edm::EventSetup &)
MonitorElement * meMCRGP[2]
edm::EDGetTokenT< edm::PSimHitContainer > PxlBrlLowSrc_Token_
GlobalPoint getPosition(const DetId &id) const
MonitorElement * meMuonRpcBToF[2]
MonitorElement * meCaloHcalE[2]
MonitorElement * meMuonCscZ
MonitorElement * meGeantVtxX[2]
Definition: DetId.h:18
void fillMuon(const edm::Event &, const edm::EventSetup &)
static const int dHcal
edm::EDGetTokenT< edm::PSimHitContainer > SiTOBLowSrc_Token_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:38
BranchDescription const & branchDescription() const
Definition: Provenance.h:43
edm::EDGetTokenT< edm::PSimHitContainer > MuonRpcSrc_Token_
MonitorElement * meCaloEcal[2]
edm::EDGetTokenT< edm::PSimHitContainer > PxlFwdLowSrc_Token_
MonitorElement * meTrackerSiFZ
MonitorElement * meGeantVtxZ[2]
MonitorElement * meCaloEcalToF[2]
edm::EDGetTokenT< edm::PSimHitContainer > SiTOBHighSrc_Token_
const T & get() const
Definition: EventSetup.h:59
std::vector< SimVertex > SimVertexContainer
static const int sdHcalFwd
edm::EDGetTokenT< edm::PSimHitContainer > MuonCscSrc_Token_
void fillECal(const edm::Event &, const edm::EventSetup &)
edm::InputTag SiTIDHighSrc_
MonitorElement * meMuon[2]
static const int sdHcalBrl
MonitorElement * meMuonRpcFToF[2]
MonitorElement * meCaloPreShToF[2]
MonitorElement * meCaloPreShEta
std::string const & label() const
Definition: InputTag.h:36
MonitorElement * meTrackerSiFToF
T eta() const
Definition: PV3DBase.h:76
MonitorElement * meTrackerPxFToF
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: CSCGeometry.cc:93
edm::InputTag MuonRpcSrc_
edm::EDGetTokenT< edm::SimVertexContainer > G4VtxSrc_Token_
edm::EventID id() const
Definition: EventBase.h:60
static const int sdSiTEC
T perp() const
Magnitude of transverse component.
static const int dMuon
HLT enums.
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * meMuonEta
edm::InputTag SiTOBLowSrc_
edm::InputTag SiTOBHighSrc_
MonitorElement * meMuonDtR
edm::InputTag ECalEBSrc_
edm::EDGetTokenT< edm::PCaloHitContainer > HCalSrc_Token_
std::vector< PSimHit > PSimHitContainer
unsigned int RunNumber_t
edm::EDGetTokenT< edm::PSimHitContainer > PxlFwdHighSrc_Token_
static const int sdPxlFwd
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:109
DetId relabel(const uint32_t testId) const
edm::InputTag SiTIBLowSrc_
MonitorElement * meCaloHcalPhi
bool isValid() const
Definition: ESHandle.h:47
Detector det() const
get the detector field from this detid
Definition: DetId.h:36
MonitorElement * meMuonRpcBR
edm::InputTag ECalEESrc_
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * meTrackerPxEta
edm::EDGetTokenT< edm::PCaloHitContainer > ECalESSrc_Token_
std::vector< SimTrack > SimTrackContainer
MonitorElement * meCaloHcalEta
std::string const & instance() const
Definition: InputTag.h:37
static const int sdHcalEC
MonitorElement * meMuonPhi
Definition: Run.h:43
GlobalHitsAnalyzer(const edm::ParameterSet &)
edm::EDGetTokenT< edm::PSimHitContainer > MuonDtSrc_Token_
Provenance const * provenance() const
Definition: HandleBase.h:83
edm::EDGetTokenT< edm::PSimHitContainer > SiTECLowSrc_Token_
MonitorElement * meTrackerSiBR
void analyze(const edm::Event &, const edm::EventSetup &) override
void getAllStableProvenance(std::vector< StableProvenance const * > &provenances) const
Definition: Event.cc:144
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
MonitorElement * meCaloEcalE[2]