test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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.

25  :
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

Definition at line 30 of file MuonAssociatorByHits.cc.

30  :
31  InputDumper(conf)
32  {
33  if (crossingframe) {
36  }
37  else{
40  }
41  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::vector< SimVertex > SimVertexContainer
std::vector< SimTrack > SimTrackContainer

Member Function Documentation

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

Definition at line 52 of file MuonAssociatorByHits.cc.

References j, relval_2017::k, and edm::Handle< T >::product().

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

Member Data Documentation

bool const muonAssociatorByHitsDiagnostics::InputDumper::crossingframe
private

Definition at line 48 of file MuonAssociatorByHits.cc.

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

Definition at line 46 of file MuonAssociatorByHits.cc.

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

Definition at line 47 of file MuonAssociatorByHits.cc.