CMS 3D CMS Logo

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