00001 #ifndef PhysicsTools_StarterKit_interface_PatKitHelper_h
00002 #define PhysicsTools_StarterKit_interface_PatKitHelper_h
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "PhysicsTools/StarterKit/interface/PhysicsHistograms.h"
00021
00022 #include "PhysicsTools/UtilAlgos/interface/TFileService.h"
00023 #include "PhysicsTools/UtilAlgos/interface/TFileDirectory.h"
00024 #include "FWCore/Framework/interface/Event.h"
00025 #include "FWCore/Framework/interface/MakerMacros.h"
00026 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00027 #include "FWCore/ServiceRegistry/interface/Service.h"
00028 #include "FWCore/Framework/interface/EDProducer.h"
00029
00030
00031 namespace pat {
00032
00033 class PatKitHelper {
00034 public:
00035
00036 PatKitHelper(edm::ParameterSet const & parameters);
00037 ~PatKitHelper();
00038
00039
00040 PhysicsHistograms::KinAxisLimits getAxisLimits( std::string name );
00041
00042
00043
00044 void bookHistos( edm::EDProducer * producer );
00045
00046
00047 void getHandles( edm::Event & event,
00048 edm::Handle<std::vector<pat::Muon> > & muonHandle,
00049 edm::Handle<std::vector<pat::Electron> > & electronHandle,
00050 edm::Handle<std::vector<pat::Tau> > & tauHandle,
00051 edm::Handle<std::vector<pat::Jet> > & jetHandle,
00052 edm::Handle<std::vector<pat::MET> > & METHandle,
00053 edm::Handle<std::vector<pat::Photon> > & photonHandle
00054 );
00055
00056
00057
00058 void fillHistograms( edm::Event & event,
00059 edm::Handle<std::vector<pat::Muon> > & muonHandle,
00060 edm::Handle<std::vector<pat::Electron> > & electronHandle,
00061 edm::Handle<std::vector<pat::Tau> > & tauHandle,
00062 edm::Handle<std::vector<pat::Jet> > & jetHandle,
00063 edm::Handle<std::vector<pat::MET> > & METHandle,
00064 edm::Handle<std::vector<pat::Photon> > & photonHandle
00065 );
00066
00067
00068
00069 void addNtupleVar ( edm::EDProducer * prod, std::string name, std::string type );
00070
00071
00072 void saveNtuple ( edm::Event & event,
00073 const std::vector<pat::PhysVarHisto*> & ntvars);
00074
00075
00076 template <class T>
00077 void saveNtupleVar( edm::Event & event,
00078 std::string name, T value);
00079
00080
00081 template <class T>
00082 void saveNtupleVec( edm::Event & event,
00083 std::string name, const std::vector<T> & invec);
00084
00085
00086
00087 int verboseLevel_;
00088
00089
00090 edm::ParameterSet parameters_;
00091
00092
00093 PhysicsHistograms * physHistos_;
00094
00095
00096 edm::Service<TFileService> fs_;
00097
00098
00099 std::vector< pat::PhysVarHisto* > ntVars_ ;
00100
00101
00102
00103
00104 pat::PhysVarHisto * h_runNumber_;
00105 pat::PhysVarHisto * h_eventNumber_;
00106
00107 };
00108
00109 }
00110
00111
00112 #endif