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/HepMCProduct/interface/HepMCProduct.h"
00015
00016 #include <FWCore/ServiceRegistry/interface/Service.h>
00017 #include <PhysicsTools/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 using namespace edm;
00032 using namespace reco;
00033 using std::vector;
00034
00035 class AnalysisRootpleProducerOnlyMC : public edm::EDAnalyzer
00036 {
00037
00038 public:
00039
00040 explicit AnalysisRootpleProducerOnlyMC( const edm::ParameterSet& ) ;
00041 virtual ~AnalysisRootpleProducerOnlyMC() {}
00042
00043 virtual void analyze( const edm::Event&, const edm::EventSetup& ) ;
00044 virtual void beginJob( const edm::EventSetup& ) ;
00045 virtual void endJob() ;
00046
00047 void fillEventInfo(int);
00048 void fillMCParticles(float, float, float, float);
00049 void fillInclusiveJet(float, float, float, float);
00050 void fillChargedJet(float, float, float, float);
00051 void store();
00052
00053 private:
00054
00055 InputTag mcEvent;
00056 InputTag genJetCollName;
00057 InputTag chgJetCollName;
00058 InputTag chgGenPartCollName;
00059
00060 Handle< HepMCProduct > EvtHandle ;
00061 Handle< vector<GenParticle> > CandHandleMC ;
00062 Handle< GenJetCollection > GenJetsHandle ;
00063 Handle< GenJetCollection > ChgGenJetsHandle ;
00064
00065
00066 float piG;
00067
00068 edm::Service<TFileService> fs;
00069
00070 TTree* AnalysisTree;
00071
00072 static const int NMCPMAX = 10000;
00073 static const int NTKMAX = 10000;
00074 static const int NIJMAX = 10000;
00075 static const int NCJMAX = 10000;
00076 static const int NTJMAX = 10000;
00077 static const int NEHJMAX = 10000;
00078
00079 int EventKind,NumberMCParticles,NumberTracks,NumberInclusiveJet,NumberChargedJet,NumberTracksJet,NumberCaloJet;
00080
00081 float MomentumMC[NMCPMAX],TransverseMomentumMC[NMCPMAX],EtaMC[NMCPMAX],PhiMC[NMCPMAX];
00082 float MomentumTK[NTKMAX],TransverseMomentumTK[NTKMAX],EtaTK[NTKMAX],PhiTK[NTKMAX];
00083 float MomentumIJ[NIJMAX],TransverseMomentumIJ[NIJMAX],EtaIJ[NIJMAX],PhiIJ[NIJMAX];
00084 float MomentumCJ[NCJMAX],TransverseMomentumCJ[NCJMAX],EtaCJ[NCJMAX],PhiCJ[NCJMAX];
00085 float MomentumTJ[NTJMAX],TransverseMomentumTJ[NTJMAX],EtaTJ[NTJMAX],PhiTJ[NTJMAX];
00086 float MomentumEHJ[NEHJMAX],TransverseMomentumEHJ[NEHJMAX],EtaEHJ[NEHJMAX],PhiEHJ[NEHJMAX];
00087
00088 TClonesArray* MonteCarlo;
00089 TClonesArray* InclusiveJet;
00090 TClonesArray* ChargedJet;
00091
00092 };
00093
00094 #endif