ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/Morgan/interface/MCAssociator.h
Revision: 1.4
Committed: Wed Jun 10 11:17:05 2009 UTC (15 years, 10 months ago) by lethuill
Content type: text/plain
Branch: MAIN
CVS Tags: all_3_3_2_01, all_3_2_5_02, all_3_2_5_01, all_2_2_9_03, all_2_2_9_02, all_2_2_9_01, HEAD
Branch point for: CMSSW_2_2_X_br
Changes since 1.3: +20 -19 lines
Log Message:
Better protection against missing collection / Cleaning data format selection / Last iteration for migration to PAT of Photons

File Contents

# User Rev Content
1 lethuill 1.1 #ifndef MCAssociator_h
2     #define MCAssociator_h
3    
4     #include <memory>
5     #include <string>
6     #include <iostream>
7     #include <map>
8    
9 lethuill 1.2 #include "FWCore/Framework/interface/Event.h"
10     #include "FWCore/ParameterSet/interface/ParameterSet.h"
11     #include "DataFormats/Common/interface/Handle.h"
12     #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
13     #include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h"
14    
15 lethuill 1.1 #include "../interface/TRootParticle.h"
16     #include "../interface/TRootMCParticle.h"
17 lethuill 1.3 #include "../interface/TRootJet.h"
18 lethuill 1.1
19     #include "TClonesArray.h"
20    
21    
22 lethuill 1.4 class MCAssociator
23     {
24 lethuill 1.1
25 lethuill 1.4 public:
26     MCAssociator();
27     MCAssociator(const edm::ParameterSet& producersNames, int verbosity);
28     ~MCAssociator() {};
29     void setVerbosity(int verbosity) {verbosity_ = verbosity; };
30     void init(const edm::Event& iEvent, TClonesArray* mcParticles);
31     void matchGenParticlesTo(TClonesArray* recoParticles);
32     void printParticleAssociation(TClonesArray* recoParticles);
33     void processGenJets(TClonesArray* genJets, TClonesArray* recoJets);
34     void printJetAssociation(TClonesArray* recoJets);
35    
36     private:
37     int verbosity_;
38     int nMC_;
39     TClonesArray* mcParticles_;
40     edm::Handle <reco::GenParticleCollection> genParticles_;
41     std::map<int,int> mcParticlesMap_; // map between index in genParticle collection and index in mcParticles TClonesArray
42     edm::InputTag genParticlesProducer_;
43 lethuill 1.1
44     };
45    
46     #endif