CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/SimMuon/MCTruth/src/CSCTruthTest.cc

Go to the documentation of this file.
00001 #include "SimMuon/MCTruth/src/CSCTruthTest.h"
00002 #include "FWCore/Framework/interface/EDAnalyzer.h"
00003 #include "FWCore/Framework/interface/Event.h"
00004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00005 #include "DataFormats/CSCRecHit/interface/CSCRecHit2DCollection.h"
00006 
00007 
00008 CSCTruthTest::CSCTruthTest(const edm::ParameterSet& iConfig):
00009   conf_(iConfig)
00010 {
00011 
00012 }
00013 
00014 
00015 CSCTruthTest::~CSCTruthTest()
00016 {
00017  
00018 }
00019 
00020 void
00021 CSCTruthTest::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
00022 {
00023   using namespace edm;
00024   
00025   Handle<CSCRecHit2DCollection> cscRecHits;
00026   iEvent.getByLabel("csc2DRecHits",cscRecHits);
00027 
00028   MuonTruth theTruth(iEvent,iSetup,conf_);
00029 
00030   for(CSCRecHit2DCollection::const_iterator recHitItr = cscRecHits->begin();
00031       recHitItr != cscRecHits->end(); recHitItr++)
00032   {
00033      theTruth.analyze(*recHitItr);
00034      std::cout << theTruth.muonFraction() << " " << recHitItr->cscDetId() << std::endl;
00035   }
00036 }
00037 
00038