CMS 3D CMS Logo

CSCTruthTest.cc
Go to the documentation of this file.
5 
7  : theTruth_(iConfig, consumesCollector()),
8  cscRecHitToken_(consumes<CSCRecHit2DCollection>(edm::InputTag("csc2DRecHits"))) {}
9 
11  const edm::Handle<CSCRecHit2DCollection> &cscRecHits = iEvent.getHandle(cscRecHitToken_);
12 
13  theTruth_.initEvent(iEvent, iSetup);
14 
15  for (CSCRecHit2DCollection::const_iterator recHitItr = cscRecHits->begin(); recHitItr != cscRecHits->end();
16  recHitItr++) {
17  theTruth_.analyze(*recHitItr);
18  edm::LogVerbatim("SimMuonCSCTruthTest") << theTruth_.muonFraction() << " " << recHitItr->cscDetId();
19  }
20 }
Log< level::Info, true > LogVerbatim
const edm::EDGetTokenT< CSCRecHit2DCollection > cscRecHitToken_
Definition: CSCTruthTest.h:19
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
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: CSCTruthTest.cc:10
void analyze(const CSCRecHit2D &recHit)
Definition: MuonTruth.cc:143
MuonTruth theTruth_
Definition: CSCTruthTest.h:18
HLT enums.
float muonFraction()
analyze() must be called before any of the following
Definition: MuonTruth.cc:76
void initEvent(const edm::Event &, const edm::EventSetup &)
Definition: MuonTruth.cc:31