CMS 3D CMS Logo

CSCTruthTest.cc
Go to the documentation of this file.
5 
7  : conf_(iConfig),
8  consumeCollector_(consumesCollector()),
9  cscRecHitToken_(consumes<CSCRecHit2DCollection>(edm::InputTag("csc2DRecHits"))) {}
10 
12  const edm::Handle<CSCRecHit2DCollection> &cscRecHits = iEvent.getHandle(cscRecHitToken_);
13 
14  MuonTruth theTruth(iEvent, iSetup, conf_, consumeCollector_);
15 
16  for (CSCRecHit2DCollection::const_iterator recHitItr = cscRecHits->begin(); recHitItr != cscRecHits->end();
17  recHitItr++) {
18  theTruth.analyze(*recHitItr);
19  edm::LogVerbatim("SimMuonCSCTruthTest") << theTruth.muonFraction() << " " << recHitItr->cscDetId();
20  }
21 }
Log< level::Info, true > LogVerbatim
const edm::EDGetTokenT< CSCRecHit2DCollection > cscRecHitToken_
Definition: CSCTruthTest.h:19
const edm::ParameterSet & conf_
Definition: CSCTruthTest.h:17
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
CSCTruthTest(const edm::ParameterSet &)
Definition: CSCTruthTest.cc:6
int iEvent
Definition: GenABIO.cc:224
edm::ConsumesCollector consumeCollector_
Definition: CSCTruthTest.h:18
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: CSCTruthTest.cc:11
void analyze(const CSCRecHit2D &recHit)
Definition: MuonTruth.cc:152
HLT enums.
float muonFraction()
analyze() must be called before any of the following
Definition: MuonTruth.cc:85