CMS 3D CMS Logo

HitParentTest.cc
Go to the documentation of this file.
1 #include <algorithm>
2 #include <fstream>
3 #include <iomanip>
4 #include <iostream>
5 #include <map>
6 #include <memory>
7 #include <string>
8 #include <vector>
9 
10 #include <TH1F.h>
11 
31 
32 class HitParentTest : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm::one::SharedResources> {
33 public:
35  ~HitParentTest() override {}
36  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
37 
38 protected:
39  void beginJob() override;
40  void beginRun(edm::Run const&, edm::EventSetup const&) override {}
41  void analyze(const edm::Event& e, const edm::EventSetup& c) override;
42  void endRun(edm::Run const&, edm::EventSetup const&) override {}
43  void endJob() override;
44 
45 private:
47  void analyzeHits(const std::vector<PCaloHit>&, int type);
48  void analyzeAPDHits(const std::vector<PCaloHit>&, int depth);
49 
50  bool simTrackPresent(int id);
51  math::XYZTLorentzVectorD getOldestParentVertex(edm::SimTrackContainer::const_iterator track);
52  edm::SimTrackContainer::const_iterator parentSimTrack(edm::SimTrackContainer::const_iterator thisTrkItr);
53  bool validSimTrack(unsigned int simTkId, edm::SimTrackContainer::const_iterator thisTrkItr);
54 
55 private:
63 
65  unsigned int total_num_apd_hits_seen[2];
66  unsigned int num_apd_hits_no_parent[2];
67 
70  unsigned int num_apd_hits_no_simtrack[2];
71 
74 
77 
80  std::map<int, unsigned> particle_type_count;
81 
83  bool histos;
84  unsigned int totalHits[7], noParent[7];
85  unsigned int noSimTrack[7], noGenParticle[7];
86  TH1F *hitType[7], *hitRho[7], *hitZ[7];
87 };
88 
90  usesResource(TFileService::kSharedResource);
91 
92  sourceLabel = ps.getUntrackedParameter<std::string>("SourceLabel", "VtxSmeared");
93  g4Label = ps.getUntrackedParameter<std::string>("ModuleLabel", "g4SimHits");
94  hitLabEB = ps.getUntrackedParameter<std::string>("EBCollection", "EcalHitsEB");
95  hitLabEE = ps.getUntrackedParameter<std::string>("EECollection", "EcalHitsEE");
96  hitLabES = ps.getUntrackedParameter<std::string>("ESCollection", "EcalHitsES");
97  hitLabHC = ps.getUntrackedParameter<std::string>("HCCollection", "HcalHits");
98  edm::LogVerbatim("HitParentTest") << "Module Label: " << g4Label << " Hits: " << hitLabEB << ", " << hitLabEE
99  << ", " << hitLabES << ", " << hitLabHC;
100 
101  tok_eb_ = consumes<edm::PCaloHitContainer>(edm::InputTag(g4Label, hitLabEB));
102  tok_ee_ = consumes<edm::PCaloHitContainer>(edm::InputTag(g4Label, hitLabEE));
103  tok_es_ = consumes<edm::PCaloHitContainer>(edm::InputTag(g4Label, hitLabES));
104  tok_hc_ = consumes<edm::PCaloHitContainer>(edm::InputTag(g4Label, hitLabHC));
105  tok_tk_ = consumes<edm::SimTrackContainer>(edm::InputTag(g4Label));
106  tok_vtx_ = consumes<edm::SimVertexContainer>(edm::InputTag(g4Label));
107 
108  for (unsigned int i = 0; i < 2; ++i) {
113  }
114  std::string dets[7] = {"EB", "EE", "ES", "HB", "HE", "HO", "HF"};
115  for (unsigned int i = 0; i < 7; ++i) {
116  detector[i] = dets[i];
117  totalHits[i] = 0;
118  noParent[i] = 0;
119  noSimTrack[i] = 0;
120  noGenParticle[i] = 0;
121  }
122 }
123 
126  desc.addUntracked<std::string>("SourceLabel", "generatorSmeared");
127  desc.addUntracked<std::string>("ModuleLabel", "g4SimHits");
128  desc.addUntracked<std::string>("EBCollection", "EcalHitsEB");
129  desc.addUntracked<std::string>("EECollection", "EcalHitsEE");
130  desc.addUntracked<std::string>("ESCollection", "EcalHitsES");
131  desc.addUntracked<std::string>("HCCollection", "HcalHits");
132  descriptions.add("HitParentTest", desc);
133 }
134 
137  if (!tfile.isAvailable()) {
138  edm::LogVerbatim("HitParentTest") << "TFileService unavailable: no histograms";
139  histos = false;
140  } else {
141  char name[20], title[100];
142  histos = true;
143  for (unsigned int i = 0; i < 7; ++i) {
144  sprintf(name, "HitType%d", i);
145  sprintf(title, "Hit types for %s", detector[i].c_str());
146  hitType[i] = tfile->make<TH1F>(name, title, 10, 0., 10.);
147  hitType[i]->GetXaxis()->SetTitle(title);
148  hitType[i]->GetYaxis()->SetTitle("Hits");
149  sprintf(name, "RhoVertex%d", i);
150  sprintf(title, "#rho of the vertex for %s Hits", detector[i].c_str());
151  hitRho[i] = tfile->make<TH1F>(name, title, 10000, 0., 100.);
152  hitRho[i]->GetXaxis()->SetTitle(title);
153  hitRho[i]->GetYaxis()->SetTitle("Hits");
154  sprintf(name, "ZVertex%d", i);
155  sprintf(title, "z of the vertex for %s Hits", detector[i].c_str());
156  hitZ[i] = tfile->make<TH1F>(name, title, 2000, -100., 100.);
157  hitZ[i]->GetXaxis()->SetTitle(title);
158  hitZ[i]->GetYaxis()->SetTitle("Hits");
159  }
160  }
161 }
162 
164  edm::LogVerbatim("HitParentTest") << "HitParentTes::Run = " << e.id().run() << " Event = " << e.id().event();
165 
166  // get PCaloHits for ecal barrel
168  e.getByToken(tok_eb_, caloHitEB);
169 
170  // get PCaloHits for ecal endcap
172  e.getByToken(tok_ee_, caloHitEE);
173 
174  // get PCaloHits for preshower
176  e.getByToken(tok_es_, caloHitES);
177 
178  // get PCaloHits for hcal
180  e.getByToken(tok_hc_, caloHitHC);
181 
182  // get sim tracks
183  e.getByToken(tok_tk_, SimTk);
184 
185  // get sim vertices
186  e.getByToken(tok_vtx_, SimVtx);
187 
188  edm::LogVerbatim("HitParentTest") << "HitParentTest: hits valid[EB]: " << caloHitEB.isValid()
189  << " valid[EE]: " << caloHitEE.isValid() << " valid[ES]: " << caloHitES.isValid()
190  << " valid[HC]: " << caloHitHC.isValid();
191 
192  if (caloHitEB.isValid()) {
193  for (int depth = 1; depth <= 2; ++depth)
194  analyzeAPDHits(*caloHitEB, depth);
195  analyzeHits(*caloHitEB, 0);
196  }
197  if (caloHitEE.isValid())
198  analyzeHits(*caloHitEE, 1);
199  if (caloHitES.isValid())
200  analyzeHits(*caloHitES, 2);
201  if (caloHitHC.isValid())
202  analyzeHits(*caloHitHC, 3);
203 }
204 
207 protected:
208  const std::map<int, unsigned>& particle_type_count;
209 
210 public:
211  HitParentTestComparison(const std::map<int, unsigned>& _particle_type_count)
212  : particle_type_count(_particle_type_count) {}
213 
214  bool operator()(int pid1, int pid2) const { return particle_type_count.at(pid1) > particle_type_count.at(pid2); }
215 };
216 
218  edm::LogVerbatim("HitParentTest") << "HitParentTest::Total number of APD hits seen: "
220  for (unsigned int depth = 0; depth < 2; ++depth) {
221  edm::LogVerbatim("HitParentTest") << "APD Hits in depth = " << depth + 1
222  << " Total = " << total_num_apd_hits_seen[depth];
223  edm::LogVerbatim("HitParentTest") << "summary of errors:\n"
224  << " number of APD hits with zero geant track id: "
225  << num_apd_hits_no_parent[depth] << "\n"
226  << "number of APD hits for which the parent simtrack was not found "
227  << "in the simtrack collection: " << num_apd_hits_no_simtrack[depth] << "\n"
228  << "number of APD hits for which no generator particle was "
229  << "found: " << num_apd_hits_no_gen_particle[depth] << "\n";
230  }
231 
232  for (unsigned int det = 0; det < 7; ++det) {
233  edm::LogVerbatim("HitParentTest") << "Total number of hits seen in " << detector[det] << ": " << totalHits[det];
234  edm::LogVerbatim("HitParentTest") << "summary of errors:\n"
235  << "number of hits with zero geant track id: " << noParent[det] << "\n"
236  << "number of hits for which the parent simtrack was not found in "
237  << "the simtrack collection: " << noSimTrack[det] << "\n"
238  << "number of hits for which no generator particle was found: "
239  << noGenParticle[det] << "\n";
240  }
241 
242  // sort in decreasing order of occurence
243  std::vector<int> sorted_pids;
244  for (std::map<int, unsigned>::const_iterator it = particle_type_count.begin(); it != particle_type_count.end(); ++it)
245  sorted_pids.push_back(it->first);
246 
247  // now sort the pids
248 
249  std::sort(sorted_pids.begin(), sorted_pids.end(), HitParentTestComparison(particle_type_count));
250 
251  edm::LogVerbatim("HitParentTest") << "HitParentTest::Frequency particle types through the APD "
252  << "(pid/frequency):";
253  for (unsigned i = 0; i < sorted_pids.size(); ++i) {
254  int pid = sorted_pids[i];
255  edm::LogVerbatim("HitParentTest") << " pid " << std::setw(6) << pid << ": count " << std::setw(6)
256  << particle_type_count[pid];
257  }
258 }
259 
260 void HitParentTest::analyzeHits(const std::vector<PCaloHit>& hits, int type) {
261  for (std::vector<PCaloHit>::const_iterator hit_it = hits.begin(); hit_it != hits.end(); ++hit_it) {
262  int id(type), flag(0);
263  if (type == 3) {
264  HcalDetId id_ = HcalDetId(hit_it->id());
265  int subdet = id_.subdet();
266  if (subdet == static_cast<int>(HcalEndcap))
267  id = type + 1;
268  else if (subdet == static_cast<int>(HcalOuter))
269  id = type + 2;
270  else if (subdet == static_cast<int>(HcalForward))
271  id = type + 3;
272  }
273  ++totalHits[id];
274 
275  // get the geant track id
276  int hit_geant_track_id = hit_it->geantTrackId();
277 
278  if (hit_geant_track_id <= 0) {
279  ++noParent[id];
280  flag = 1;
281  } else {
282  bool found = false;
283  flag = 2;
284  // check whether this id is actually there in the list of simtracks
285  for (edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin(); simTrkItr != SimTk->end() && !found;
286  ++simTrkItr) {
287  if (hit_geant_track_id == (int)(simTrkItr->trackId())) {
288  found = true;
289  flag = 3;
290  bool match = validSimTrack(hit_geant_track_id, simTrkItr);
291 
292  edm::LogVerbatim("HitParentTest")
293  << "[" << detector[type] << "] Match = " << match << " hit_geant_track_id=" << hit_geant_track_id
294  << " particle id=" << simTrkItr->type();
295 
296  if (!match) {
297  edm::LogVerbatim("HitParentTest") << "NO MATCH FOUND !";
298  ++noGenParticle[id];
299  }
300 
301  // beam pipe...
302  int pid = simTrkItr->type();
303  math::XYZTLorentzVectorD oldest_parent_vertex = getOldestParentVertex(simTrkItr);
304 
305  edm::SimTrackContainer::const_iterator oldest_parent_track = parentSimTrack(simTrkItr);
306 
307  edm::LogVerbatim("HitParentTest")
308  << "[" << detector[type] << "] Hit pid = " << pid << " hit track id = " << hit_geant_track_id
309  << " Oldest Parent's Vertex: " << oldest_parent_vertex << " rho = " << oldest_parent_vertex.Rho()
310  << " Oldest Parent's pid: " << oldest_parent_track->type()
311  << " Oldest Parent's track id: " << oldest_parent_track->trackId()
312  << "\nHit vertex index: " << simTrkItr->vertIndex() << " (tot #vertices: " << SimVtx->size() << ")"
313  << "\nHit vertex parent track: " << (*SimVtx)[simTrkItr->vertIndex()].parentIndex()
314  << " present=" << simTrackPresent((*SimVtx)[simTrkItr->vertIndex()].parentIndex());
315  if (histos) {
316  hitRho[id]->Fill(oldest_parent_vertex.Rho());
317  hitZ[id]->Fill(oldest_parent_vertex.Z());
318  }
319  } // a match was found
320  } // geant track id found in simtracks
321 
322  if (!found)
323  ++noSimTrack[id];
324  } // hits with a valid SimTrack Id
325  if (histos)
326  hitType[id]->Fill((double)(flag));
327  } // loop over all calohits (of the given depth)
328 }
329 
330 void HitParentTest::analyzeAPDHits(const std::vector<PCaloHit>& hits, int depth) {
331  for (std::vector<PCaloHit>::const_iterator hit_it = hits.begin(); hit_it != hits.end(); ++hit_it) {
332  if (hit_it->depth() == depth) {
334 
335  // get the geant track id
336  int hit_geant_track_id = hit_it->geantTrackId();
337 
338  if (hit_geant_track_id <= 0) {
340  } else {
341  bool found = false;
342  // check whether this id is actually there in the list of simtracks
343  for (edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin(); simTrkItr != SimTk->end() && !found;
344  ++simTrkItr) {
345  if (hit_geant_track_id == (int)(simTrkItr->trackId())) {
346  found = true;
347  bool match = validSimTrack(hit_geant_track_id, simTrkItr);
348 
349  edm::LogVerbatim("HitParentTest")
350  << "APDHIT Match = " << match << " hit_geant_track_id = " << hit_geant_track_id
351  << " particle id=" << simTrkItr->type();
352 
353  if (!match) {
354  edm::LogVerbatim("HitParentTest") << "NO MATCH FOUND !";
356  }
357 
358  int apd_pid = simTrkItr->type();
359  std::map<int, unsigned>::iterator count_it = particle_type_count.find(apd_pid);
360  if (count_it == particle_type_count.end())
361  // first occurence of this particle pid
362  particle_type_count[apd_pid] = 1;
363  else
364  ++count_it->second;
365 
366  //--------------------
367  // check where the oldest parent has its vertex. Should be close to the
368  // beam pipe...
369  math::XYZTLorentzVectorD oldest_parent_vertex = getOldestParentVertex(simTrkItr);
370 
371  edm::SimTrackContainer::const_iterator oldest_parent_track = parentSimTrack(simTrkItr);
372 
373  edm::LogVerbatim("HitParentTest")
374  << "APD hit pid = " << apd_pid << " APD hit track id = " << hit_geant_track_id
375  << " depth = " << hit_it->depth() << " OLDEST PARENT'S VERTEX: " << oldest_parent_vertex
376  << " rho = " << oldest_parent_vertex.Rho() << " OLDEST PARENT'S PID: " << oldest_parent_track->type()
377  << " OLDEST PARENT'S track id: " << oldest_parent_track->trackId() << "\n"
378  << "APD hit vertex index: " << simTrkItr->vertIndex() << " (tot #vertices: " << SimVtx->size() << ")"
379  << "\n"
380  << "APD hit vertex parent track: " << (*SimVtx)[simTrkItr->vertIndex()].parentIndex()
381  << " present=" << simTrackPresent((*SimVtx)[simTrkItr->vertIndex()].parentIndex());
382 
383  } // a match was found
384  } // geant track id found in simtracks
385 
386  if (!found)
388  } // hits with a valid SimTrack Id
389  } // right depth index
390  } // loop over all calohits (of the given depth)
391 }
392 
394  for (edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin(); simTrkItr != SimTk->end(); ++simTrkItr) {
395  if ((int)(simTrkItr->trackId()) == id)
396  return true;
397  }
398  return false;
399 }
400 
401 math::XYZTLorentzVectorD HitParentTest::getOldestParentVertex(edm::SimTrackContainer::const_iterator track) {
402  static const math::XYZTLorentzVectorD invalid_vertex(
403  10000, 10000, 10000, 10000); // default value if no valid vertex found
404 
405  edm::SimTrackContainer::const_iterator oldest_parent_track = parentSimTrack(track);
406 
407  int vertex_index = oldest_parent_track->vertIndex();
408 
409  // sanity checks
410  if (vertex_index < 0 || vertex_index >= (int)(SimVtx->size()))
411  return invalid_vertex;
412 
413  return (*SimVtx)[vertex_index].position();
414 }
415 
416 edm::SimTrackContainer::const_iterator HitParentTest::parentSimTrack(edm::SimTrackContainer::const_iterator thisTrkItr) {
417  edm::SimTrackContainer::const_iterator itr = SimTk->end();
418 
419  int vertIndex = thisTrkItr->vertIndex();
420  int type = thisTrkItr->type();
421  int charge = (int)thisTrkItr->charge();
422  edm::LogVerbatim("HitParentTest") << "SimTrackParent:: " << thisTrkItr->trackId() << " Vertex " << vertIndex
423  << " Type " << type << " Charge " << charge;
424 
425  if (vertIndex == -1)
426  return thisTrkItr;
427  else if (vertIndex >= (int)SimVtx->size())
428  return itr;
429 
430  edm::SimVertexContainer::const_iterator simVtxItr = SimVtx->begin();
431  for (int iv = 0; iv < vertIndex; iv++)
432  simVtxItr++;
433  int parent = simVtxItr->parentIndex();
434 
435  if (parent < 0 && simVtxItr != SimVtx->begin()) {
436  const math::XYZTLorentzVectorD pos1 = simVtxItr->position();
437  for (simVtxItr = SimVtx->begin(); simVtxItr != SimVtx->end(); ++simVtxItr) {
438  if (simVtxItr->parentIndex() > 0) {
439  const math::XYZTLorentzVectorD pos2 = pos1 - simVtxItr->position();
440  double dist = pos2.P();
441  if (dist < 0.001) {
442  parent = simVtxItr->parentIndex();
443  break;
444  }
445  }
446  }
447  }
448  for (edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin(); simTrkItr != SimTk->end(); simTrkItr++) {
449  if ((int)simTrkItr->trackId() == parent && simTrkItr != thisTrkItr)
450  return parentSimTrack(simTrkItr);
451  }
452 
453  return thisTrkItr;
454 }
455 
456 bool HitParentTest::validSimTrack(unsigned int simTkId, edm::SimTrackContainer::const_iterator thisTrkItr) {
457  edm::LogVerbatim("HitParentTest") << "Inside validSimTrack: trackId " << thisTrkItr->trackId() << " vtxIndex "
458  << thisTrkItr->vertIndex() << " to be matched to " << simTkId;
459 
460  //This track originates from simTkId
461  if (thisTrkItr->trackId() == simTkId)
462  return true;
463 
464  //Otherwise trace back the history using SimTracks and SimVertices
465  int vertIndex = thisTrkItr->vertIndex();
466  if (vertIndex == -1 || vertIndex >= (int)SimVtx->size())
467  return false;
468  edm::SimVertexContainer::const_iterator simVtxItr = SimVtx->begin();
469  for (int iv = 0; iv < vertIndex; iv++)
470  simVtxItr++;
471  int parent = simVtxItr->parentIndex();
472  edm::LogVerbatim("HitParentTest") << "validSimTrack:: parent index " << parent << " ";
473  if (parent < 0 && simVtxItr != SimVtx->begin()) {
474  const math::XYZTLorentzVectorD pos1 = simVtxItr->position();
475  for (simVtxItr = SimVtx->begin(); simVtxItr != SimVtx->end(); ++simVtxItr) {
476  if (simVtxItr->parentIndex() > 0) {
477  const math::XYZTLorentzVectorD pos2 = pos1 - simVtxItr->position();
478  double dist = pos2.P();
479  if (dist < 0.001) {
480  parent = simVtxItr->parentIndex();
481  break;
482  }
483  }
484  }
485  }
486  edm::LogVerbatim("HitParentTest") << "HitParentTes::final index " << parent;
487  for (edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin(); simTrkItr != SimTk->end(); simTrkItr++) {
488  if ((int)simTrkItr->trackId() == parent && simTrkItr != thisTrkItr)
489  return validSimTrack(simTkId, simTrkItr);
490  }
491 
492  return false;
493 }
494 
495 //define this as a plug-in
HitParentTest::detector
std::string detector[7]
Definition: HitParentTest.cc:82
HitParentTest::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: HitParentTest.cc:124
HitParentTest::analyzeHits
void analyzeHits(const std::vector< PCaloHit > &, int type)
Definition: HitParentTest.cc:260
HitParentTest::hitZ
TH1F * hitZ[7]
Definition: HitParentTest.cc:86
HitParentTest::simTrackPresent
bool simTrackPresent(int id)
Definition: HitParentTest.cc:393
HitParentTestComparison::operator()
bool operator()(int pid1, int pid2) const
Definition: HitParentTest.cc:214
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
EDAnalyzer.h
mps_fire.i
i
Definition: mps_fire.py:428
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11776
HitParentTest::SimVtx
edm::Handle< edm::SimVertexContainer > SimVtx
Definition: HitParentTest.cc:76
MessageLogger.h
HitParentTest::beginJob
void beginJob() override
Definition: HitParentTest.cc:135
HitParentTest::tok_tk_
edm::EDGetTokenT< edm::SimTrackContainer > tok_tk_
Definition: HitParentTest.cc:61
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
ESHandle.h
HitParentTest::num_apd_hits_no_parent
unsigned int num_apd_hits_no_parent[2]
Definition: HitParentTest.cc:66
edm::Run
Definition: Run.h:45
edm::EDGetTokenT< edm::PCaloHitContainer >
HitParentTest::endJob
void endJob() override
Definition: HitParentTest.cc:217
HitParentTest::beginRun
void beginRun(edm::Run const &, edm::EventSetup const &) override
Definition: HitParentTest.cc:40
math::XYZTLorentzVectorD
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
HitParentTest::parentSimTrack
edm::SimTrackContainer::const_iterator parentSimTrack(edm::SimTrackContainer::const_iterator thisTrkItr)
Definition: HitParentTest.cc:416
HitParentTest::noGenParticle
unsigned int noGenParticle[7]
Definition: HitParentTest.cc:85
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
HitParentTest::tok_hc_
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hc_
Definition: HitParentTest.cc:60
CaloHitID.h
HitParentTest::total_num_apd_hits_seen
unsigned int total_num_apd_hits_seen[2]
Definition: HitParentTest.cc:65
edm::one::EDAnalyzer
Definition: EDAnalyzer.h:30
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
edm::Handle< edm::SimTrackContainer >
HitParentTestComparison::particle_type_count
const std::map< int, unsigned > & particle_type_count
Definition: HitParentTest.cc:208
HitParentTest
Definition: HitParentTest.cc:32
HitParentTest::tok_vtx_
edm::EDGetTokenT< edm::SimVertexContainer > tok_vtx_
Definition: HitParentTest.cc:62
HitParentTest::HitParentTest
HitParentTest(const edm::ParameterSet &ps)
Definition: HitParentTest.cc:89
HitParentTest::hitLabEB
std::string hitLabEB
Definition: HitParentTest.cc:56
HitParentTest::getOldestParentVertex
math::XYZTLorentzVectorD getOldestParentVertex(edm::SimTrackContainer::const_iterator track)
Definition: HitParentTest.cc:401
HitParentTest::hitRho
TH1F * hitRho[7]
Definition: HitParentTest.cc:86
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
HitParentTest::hitType
TH1F * hitType[7]
Definition: HitParentTest.cc:86
HitParentTest::tok_ee_
edm::EDGetTokenT< edm::PCaloHitContainer > tok_ee_
Definition: HitParentTest.cc:58
Service.h
HitParentTest::hitLabEE
std::string hitLabEE
Definition: HitParentTest.cc:56
tfile
Definition: tfile.py:1
HitParentTest::~HitParentTest
~HitParentTest() override
Definition: HitParentTest.cc:35
HcalOuter
Definition: HcalAssistant.h:35
HitParentTest::num_apd_hits_no_gen_particle
unsigned int num_apd_hits_no_gen_particle[2]
Definition: HitParentTest.cc:73
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
HitParentTestComparison::HitParentTestComparison
HitParentTestComparison(const std::map< int, unsigned > &_particle_type_count)
Definition: HitParentTest.cc:211
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TFileService.h
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
HitParentTest::histos
bool histos
Definition: HitParentTest.cc:83
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
HitParentTest::particle_type_count
std::map< int, unsigned > particle_type_count
Definition: HitParentTest.cc:80
HcalDetId.h
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:39
HitParentTest::SimTk
edm::Handle< edm::SimTrackContainer > SimTk
Definition: HitParentTest.cc:75
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
PCaloHit.h
HcalDetId::subdet
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
HcalDetId
Definition: HcalDetId.h:12
edm::Service< TFileService >
createfilelist.int
int
Definition: createfilelist.py:10
HitParentTest::g4Label
std::string g4Label
Definition: HitParentTest.cc:56
HitParentTest::analyzeAPDHits
void analyzeAPDHits(const std::vector< PCaloHit > &, int depth)
Definition: HitParentTest.cc:330
HitParentTest::tok_es_
edm::EDGetTokenT< edm::PCaloHitContainer > tok_es_
Definition: HitParentTest.cc:59
HitParentTest::analyze
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: HitParentTest.cc:163
edm::EventSetup
Definition: EventSetup.h:57
HitParentTestComparison
Definition: HitParentTest.cc:206
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:29
HitParentTest::hitLabES
std::string hitLabES
Definition: HitParentTest.cc:56
HitParentTest::num_apd_hits_no_simtrack
unsigned int num_apd_hits_no_simtrack[2]
Definition: HitParentTest.cc:70
InputTag.h
compare.tfile
tfile
Definition: compare.py:325
HitParentTest::noSimTrack
unsigned int noSimTrack[7]
Definition: HitParentTest.cc:85
HcalForward
Definition: HcalAssistant.h:36
HitParentTest::totalHits
unsigned int totalHits[7]
Definition: HitParentTest.cc:84
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
HcalEndcap
Definition: HcalAssistant.h:34
Frameworkfwd.h
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
TFileService::kSharedResource
static const std::string kSharedResource
Definition: TFileService.h:76
HitParentTest::hitLabHC
std::string hitLabHC
Definition: HitParentTest.cc:56
HitParentTest::validSimTrack
bool validSimTrack(unsigned int simTkId, edm::SimTrackContainer::const_iterator thisTrkItr)
Definition: HitParentTest.cc:456
HitParentTest::endRun
void endRun(edm::Run const &, edm::EventSetup const &) override
Definition: HitParentTest.cc:42
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
EventSetup.h
Exception.h
PCaloHitContainer.h
HitParentTest::tok_eb_
edm::EDGetTokenT< edm::PCaloHitContainer > tok_eb_
Definition: HitParentTest.cc:57
ParameterSet.h
HepMCProduct.h
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
HitParentTest::sourceLabel
std::string sourceLabel
Definition: HitParentTest.cc:56
edm::Event
Definition: Event.h:73
HitParentTest::noParent
unsigned int noParent[7]
Definition: HitParentTest.cc:84
class-composition.parent
parent
Definition: class-composition.py:88
SimTrackContainer.h
edm::InputTag
Definition: InputTag.h:15
SimVertexContainer.h
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37