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

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

Detailed Description

Definition at line 25 of file MuonAssociatorByHits.cc.

Constructor & Destructor Documentation

◆ InputDumper() [1/2]

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

Definition at line 27 of file MuonAssociatorByHits.cc.

28  : simtracksTag(conf.getParameter<edm::InputTag>("simtracksTag")),
29  simtracksXFTag(conf.getParameter<edm::InputTag>("simtracksXFTag")),
30  crossingframe(conf.getParameter<bool>("crossingframe")) {}

◆ InputDumper() [2/2]

muonAssociatorByHitsDiagnostics::InputDumper::InputDumper ( const edm::ParameterSet conf,
edm::ConsumesCollector &&  iC 
)
inline

Member Function Documentation

◆ dump()

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

Definition at line 50 of file MuonAssociatorByHits.cc.

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

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

Member Data Documentation

◆ crossingframe

const bool muonAssociatorByHitsDiagnostics::InputDumper::crossingframe
private

Definition at line 47 of file MuonAssociatorByHits.cc.

◆ simtracksTag

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

Definition at line 45 of file MuonAssociatorByHits.cc.

◆ simtracksXFTag

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

Definition at line 46 of file MuonAssociatorByHits.cc.

edm::Handle::product
T const * product() const
Definition: Handle.h:70
TrackingParticle::g4t_iterator
std::vector< SimTrack >::const_iterator g4t_iterator
Definition: TrackingParticle.h:41
caloTruthProducer_cfi.simVertexCollection
simVertexCollection
Definition: caloTruthProducer_cfi.py:29
edm::Handle
Definition: AssociativeIterator.h:50
MixCollection::MixItr
Definition: MixCollection.h:62
muonAssociatorByHitsDiagnostics::InputDumper::simtracksXFTag
const edm::InputTag simtracksXFTag
Definition: MuonAssociatorByHits.cc:46
caloTruthProducer_cfi.simTrackCollection
simTrackCollection
Definition: caloTruthProducer_cfi.py:28
CrossingFrame
Definition: CrossingFrame.h:38
MixCollection
Definition: MixCollection.h:11
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
dqmdumpme.k
k
Definition: dqmdumpme.py:60
muonAssociatorByHitsDiagnostics::InputDumper::InputDumper
InputDumper(const edm::ParameterSet &conf)
Definition: MuonAssociatorByHits.cc:27
muonAssociatorByHitsDiagnostics::InputDumper::crossingframe
const bool crossingframe
Definition: MuonAssociatorByHits.cc:47
edm::SimTrackContainer
std::vector< SimTrack > SimTrackContainer
Definition: SimTrackContainer.h:12
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::SimVertexContainer
std::vector< SimVertex > SimVertexContainer
Definition: SimVertexContainer.h:12
edm::InputTag
Definition: InputTag.h:15
muonAssociatorByHitsDiagnostics::InputDumper::simtracksTag
const edm::InputTag simtracksTag
Definition: MuonAssociatorByHits.cc:45