CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/QCDAnalysis/UEAnalysis/interface/AnalysisRootpleProducerOnlyMC.h

Go to the documentation of this file.
00001 #ifndef AnalysisRootpleProducerOnlyMC_H
00002 #define AnalysisRootpleProducerOnlyMC_H
00003 
00004 #include <iostream>
00005 
00006 #include <FWCore/Framework/interface/Event.h>
00007 #include <FWCore/Framework/interface/ESHandle.h>
00008 #include <FWCore/Framework/interface/MakerMacros.h>
00009 #include <FWCore/Framework/interface/Frameworkfwd.h>
00010 #include <FWCore/ParameterSet/interface/ParameterSet.h>
00011 #include <DataFormats/Common/interface/Handle.h>
00012 
00013 #include "FWCore/Framework/interface/EDAnalyzer.h"
00014 #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
00015 
00016 #include <FWCore/ServiceRegistry/interface/Service.h>
00017 #include <CommonTools/UtilAlgos/interface/TFileService.h>
00018 
00019 #include <TROOT.h>
00020 #include <TTree.h>
00021 #include <TFile.h>
00022 #include <TLorentzVector.h>
00023 #include <TClonesArray.h>
00024 
00025 #include "DataFormats/JetReco/interface/Jet.h"
00026 #include "DataFormats/JetReco/interface/GenJet.h"
00027 #include "DataFormats/JetReco/interface/GenJetCollection.h"
00028 #include "DataFormats/Candidate/interface/Candidate.h"
00029 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
00030 
00031 class AnalysisRootpleProducerOnlyMC : public edm::EDAnalyzer
00032 {
00033   
00034 public:
00035   
00036   explicit AnalysisRootpleProducerOnlyMC( const edm::ParameterSet& ) ;
00037   virtual ~AnalysisRootpleProducerOnlyMC() {} 
00038 
00039   virtual void analyze( const edm::Event&, const edm::EventSetup& ) ;
00040   virtual void beginJob() ;
00041   virtual void endJob() ;
00042   
00043   void fillEventInfo(int);
00044   void fillMCParticles(float, float, float, float);
00045   void fillInclusiveJet(float, float, float, float);
00046   void fillChargedJet(float, float, float, float);
00047   void store();
00048 
00049 private:
00050   
00051   edm::InputTag mcEvent; // label of MC event
00052   edm::InputTag genJetCollName; // label of Jet made with MC particles
00053   edm::InputTag chgJetCollName; // label of Jet made with only charged MC particles
00054   edm::InputTag chgGenPartCollName; // label of charged MC particles
00055 
00056   edm::Handle< edm::HepMCProduct         > EvtHandle        ;
00057   edm::Handle< std::vector<reco::GenParticle> > CandHandleMC     ;
00058   edm::Handle< reco::GenJetCollection    > GenJetsHandle    ;
00059   edm::Handle< reco::GenJetCollection    > ChgGenJetsHandle ;
00060 
00061   
00062   float piG;
00063 
00064   edm::Service<TFileService> fs;
00065 
00066   TTree* AnalysisTree;
00067 
00068   static const int NMCPMAX = 10000;   
00069   static const int NTKMAX = 10000;
00070   static const int NIJMAX = 10000;
00071   static const int NCJMAX = 10000;
00072   static const int NTJMAX = 10000;
00073   static const int NEHJMAX = 10000;
00074 
00075   int EventKind,NumberMCParticles,NumberTracks,NumberInclusiveJet,NumberChargedJet,NumberTracksJet,NumberCaloJet;
00076   
00077   float MomentumMC[NMCPMAX],TransverseMomentumMC[NMCPMAX],EtaMC[NMCPMAX],PhiMC[NMCPMAX];
00078   float MomentumTK[NTKMAX],TransverseMomentumTK[NTKMAX],EtaTK[NTKMAX],PhiTK[NTKMAX];
00079   float MomentumIJ[NIJMAX],TransverseMomentumIJ[NIJMAX],EtaIJ[NIJMAX],PhiIJ[NIJMAX];
00080   float MomentumCJ[NCJMAX],TransverseMomentumCJ[NCJMAX],EtaCJ[NCJMAX],PhiCJ[NCJMAX];
00081   float MomentumTJ[NTJMAX],TransverseMomentumTJ[NTJMAX],EtaTJ[NTJMAX],PhiTJ[NTJMAX];
00082   float MomentumEHJ[NEHJMAX],TransverseMomentumEHJ[NEHJMAX],EtaEHJ[NEHJMAX],PhiEHJ[NEHJMAX];
00083 
00084   TClonesArray* MonteCarlo;
00085   TClonesArray* InclusiveJet;
00086   TClonesArray* ChargedJet;
00087   
00088 };
00089 
00090 #endif