CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
muonAssociatorByHitsDiagnostics::InputDumper Class Reference

Public Member Functions

void dump (const TrackHitsCollection &, const TrackingParticleCollection &, const edm::Event &) const
 
 InputDumper (const edm::ParameterSet &conf)
 
 InputDumper (const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
 

Private Attributes

bool const crossingframe
 
edm::InputTag const simtracksTag
 
edm::InputTag const simtracksXFTag
 

Detailed Description

Definition at line 23 of file MuonAssociatorByHits.cc.

Constructor & Destructor Documentation

muonAssociatorByHitsDiagnostics::InputDumper::InputDumper ( const edm::ParameterSet conf)
inline

Definition at line 25 of file MuonAssociatorByHits.cc.

26  : simtracksTag(conf.getParameter<edm::InputTag>("simtracksTag")),
27  simtracksXFTag(conf.getParameter<edm::InputTag>("simtracksXFTag")),
28  crossingframe(conf.getParameter<bool>("crossingframe")) {}
T getParameter(std::string const &) const
muonAssociatorByHitsDiagnostics::InputDumper::InputDumper ( const edm::ParameterSet conf,
edm::ConsumesCollector &&  iC 
)
inline

Member Function Documentation

void muonAssociatorByHitsDiagnostics::InputDumper::dump ( const TrackHitsCollection tC,
const TrackingParticleCollection tPC,
const edm::Event event 
) const

Definition at line 48 of file MuonAssociatorByHits.cc.

References MuonAssociatorByHits_cfi::crossingframe, gen::k, edm::Handle< T >::product(), caloTruthProducer_cfi::simTrackCollection, MuonAssociatorByHits_cfi::simtracksTag, MuonAssociatorByHits_cfi::simtracksXFTag, and caloTruthProducer_cfi::simVertexCollection.

50  {
51  // reco::Track collection
52  edm::LogVerbatim("MuonAssociatorByHits") << "\n"
53  << "reco::Track collection --- size = " << tC.size();
54 
55  // TrackingParticle collection
56  edm::LogVerbatim("MuonAssociatorByHits") << "\n"
57  << "TrackingParticle collection --- size = " << tPC.size();
58  int j = 0;
59  for (TrackingParticleCollection::const_iterator ITER = tPC.begin(); ITER != tPC.end(); ITER++, j++) {
60  edm::LogVerbatim("MuonAssociatorByHits")
61  << "TrackingParticle " << j << ", q = " << ITER->charge() << ", p = " << ITER->p() << ", pT = " << ITER->pt()
62  << ", eta = " << ITER->eta() << ", phi = " << ITER->phi();
63 
64  edm::LogVerbatim("MuonAssociatorByHits")
65  << "\t pdg code = " << ITER->pdgId() << ", made of " << ITER->numberOfHits() << " PSimHit"
66  << " (in " << ITER->numberOfTrackerLayers() << " layers)"
67  << " from " << ITER->g4Tracks().size() << " SimTrack:";
68  for (TrackingParticle::g4t_iterator g4T = ITER->g4Track_begin(); g4T != ITER->g4Track_end(); g4T++) {
69  edm::LogVerbatim("MuonAssociatorByHits") << "\t\t Id:" << g4T->trackId() << "/Evt:(" << g4T->eventId().event()
70  << "," << g4T->eventId().bunchCrossing() << ")";
71  }
72  }
73 
74  // SimTrack collection
77 
78  // SimVertex collection
81 
82  if (crossingframe) {
83  event.getByLabel(simtracksXFTag, cf_simtracks);
84  unique_ptr<MixCollection<SimTrack>> SimTk(new MixCollection<SimTrack>(cf_simtracks.product()));
85  edm::LogVerbatim("MuonAssociatorByHits")
86  << "\n"
87  << "CrossingFrame<SimTrack> collection with InputTag = " << simtracksXFTag << " has size = " << SimTk->size();
88  int k = 0;
89  for (MixCollection<SimTrack>::MixItr ITER = SimTk->begin(); ITER != SimTk->end(); ITER++, k++) {
90  edm::LogVerbatim("MuonAssociatorByHits")
91  << "SimTrack " << k << " - Id:" << ITER->trackId() << "/Evt:(" << ITER->eventId().event() << ","
92  << ITER->eventId().bunchCrossing() << ")"
93  << " pdgId = " << ITER->type() << ", q = " << ITER->charge() << ", p = " << ITER->momentum().P()
94  << ", pT = " << ITER->momentum().Pt() << ", eta = " << ITER->momentum().Eta()
95  << ", phi = " << ITER->momentum().Phi() << "\n * " << *ITER << endl;
96  }
97  event.getByLabel(simtracksXFTag, cf_simvertices);
98  unique_ptr<MixCollection<SimVertex>> SimVtx(new MixCollection<SimVertex>(cf_simvertices.product()));
99  edm::LogVerbatim("MuonAssociatorByHits")
100  << "\n"
101  << "CrossingFrame<SimVertex> collection with InputTag = " << simtracksXFTag
102  << " has size = " << SimVtx->size();
103  int kv = 0;
104  for (MixCollection<SimVertex>::MixItr VITER = SimVtx->begin(); VITER != SimVtx->end(); VITER++, kv++) {
105  edm::LogVerbatim("MuonAssociatorByHits") << "SimVertex " << kv << " : " << *VITER << endl;
106  }
107  } else {
108  event.getByLabel(simtracksTag, simTrackCollection);
109  const edm::SimTrackContainer simTC = *(simTrackCollection.product());
110  edm::LogVerbatim("MuonAssociatorByHits")
111  << "\n"
112  << "SimTrack collection with InputTag = " << simtracksTag << " has size = " << simTC.size() << endl;
113  int k = 0;
114  for (edm::SimTrackContainer::const_iterator ITER = simTC.begin(); ITER != simTC.end(); ITER++, k++) {
115  edm::LogVerbatim("MuonAssociatorByHits")
116  << "SimTrack " << k << " - Id:" << ITER->trackId() << "/Evt:(" << ITER->eventId().event() << ","
117  << ITER->eventId().bunchCrossing() << ")"
118  << " pdgId = " << ITER->type() << ", q = " << ITER->charge() << ", p = " << ITER->momentum().P()
119  << ", pT = " << ITER->momentum().Pt() << ", eta = " << ITER->momentum().Eta()
120  << ", phi = " << ITER->momentum().Phi() << "\n * " << *ITER << endl;
121  }
122  event.getByLabel(simtracksTag, simVertexCollection);
123  const edm::SimVertexContainer simVC = *(simVertexCollection.product());
124  edm::LogVerbatim("MuonAssociatorByHits") << "\n"
125  << "SimVertex collection with InputTag = "
126  << "g4SimHits"
127  << " has size = " << simVC.size() << endl;
128  int kv = 0;
129  for (edm::SimVertexContainer::const_iterator VITER = simVC.begin(); VITER != simVC.end(); VITER++, kv++) {
130  edm::LogVerbatim("MuonAssociatorByHits") << "SimVertex " << kv << " : " << *VITER << endl;
131  }
132  }
133  }
int k[5][pyjets_maxn]
std::vector< SimTrack >::const_iterator g4t_iterator
T const * product() const
Definition: Handle.h:74
std::vector< SimVertex > SimVertexContainer
std::vector< SimTrack > SimTrackContainer

Member Data Documentation

bool const muonAssociatorByHitsDiagnostics::InputDumper::crossingframe
private

Definition at line 45 of file MuonAssociatorByHits.cc.

edm::InputTag const muonAssociatorByHitsDiagnostics::InputDumper::simtracksTag
private

Definition at line 43 of file MuonAssociatorByHits.cc.

edm::InputTag const muonAssociatorByHitsDiagnostics::InputDumper::simtracksXFTag
private

Definition at line 44 of file MuonAssociatorByHits.cc.