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 Member Functions | Private Attributes
PatMCMatching Class Reference
Inheritance diagram for PatMCMatching:
edm::EDAnalyzer

Public Member Functions

 PatMCMatching (const edm::ParameterSet &)
 default constructor More...
 
 ~PatMCMatching ()
 default destructor More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void endJob ()
 

Private Attributes

std::map< std::string, TH1F * > histContainer_
 
edm::InputTag muonSrc_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 15 of file PatMCMatching.cc.

Constructor & Destructor Documentation

PatMCMatching::PatMCMatching ( const edm::ParameterSet iConfig)
explicit

default constructor

Definition at line 42 of file PatMCMatching.cc.

42  :
44  muonSrc_(iConfig.getUntrackedParameter<edm::InputTag>("muonSrc"))
45 {
46 }
T getUntrackedParameter(std::string const &, T const &) const
std::map< std::string, TH1F * > histContainer_
edm::InputTag muonSrc_
PatMCMatching::~PatMCMatching ( )

default destructor

Definition at line 48 of file PatMCMatching.cc.

49 {
50 }

Member Function Documentation

void PatMCMatching::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 53 of file PatMCMatching.cc.

References edm::Event::getByLabel(), histContainer_, i, metsig::muon, patZpeak::muons, and muonSrc_.

54 {
55 
56  // get muon collection
58  iEvent.getByLabel(muonSrc_,muons);
59 
60  for(edm::View<pat::Muon>::const_iterator muon=muons->begin(); muon!=muons->end(); ++muon){
61 
62  for(unsigned int i = 0 ; i < muon->genParticleRefs().size() ; ++i ){
63 
64  switch( muon->genParticle(i)->status() ){
65  case 1:
66  histContainer_["DR_status1Match"]->Fill( ROOT::Math::VectorUtil::DeltaR(muon->p4() , muon->genParticle(i)->p4() ) );
67  break;
68  case 3:
69  histContainer_["DR_status3Match"]->Fill( ROOT::Math::VectorUtil::DeltaR(muon->p4() , muon->genParticle(i)->p4() ) );
70  break;
71  default:
72  histContainer_["DR_defaultMatch"]->Fill( ROOT::Math::VectorUtil::DeltaR(muon->p4() , muon->genParticle(i)->p4() ) );
73  break;
74  }
75  }
76  }
77 
78 }
int i
Definition: DBlmapReader.cc:9
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
std::map< std::string, TH1F * > histContainer_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
tuple muons
Definition: patZpeak.py:38
edm::InputTag muonSrc_
void PatMCMatching::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 81 of file PatMCMatching.cc.

References histContainer_, and TFileDirectory::make().

82 {
83  // register to the TFileService
85 
86  // book histograms:
87  histContainer_["DR_defaultMatch" ]=fs->make<TH1F>("DR_defaultMatch", "DR_defaultMatch", 100, 0., 0.02);
88  histContainer_["DR_status1Match" ]=fs->make<TH1F>("DR_status1Match", "DR_status1Match", 100, 0., 0.02);
89  histContainer_["DR_status3Match" ]=fs->make<TH1F>("DR_status3Match", "DR_status3Match", 100, 0., 0.02);
90 
91 }
std::map< std::string, TH1F * > histContainer_
T * make() const
make new ROOT object
void PatMCMatching::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 94 of file PatMCMatching.cc.

95 {
96 }

Member Data Documentation

std::map<std::string,TH1F*> PatMCMatching::histContainer_
private

Definition at line 32 of file PatMCMatching.cc.

Referenced by analyze(), and beginJob().

edm::InputTag PatMCMatching::muonSrc_
private

Definition at line 35 of file PatMCMatching.cc.

Referenced by analyze().