CMS 3D CMS Logo

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