CMS 3D CMS Logo

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