#include <Demo/TempAnaToolkit/test/TtSemiEvtKit.cc>
Public Member Functions | |
TtSemiEvtKit (const edm::ParameterSet &) | |
virtual | ~TtSemiEvtKit () |
Protected Member Functions | |
virtual void | beginJob (const edm::EventSetup &) |
virtual void | endJob () |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
Protected Attributes | |
edm::Handle< std::vector < pat::Electron > > | electronHandle_ |
edm::InputTag | evtsols |
pat::PhysVarHisto * | histoKinFitProbChi2_ |
pat::PhysVarHisto * | histoLRJetCombProb_ |
pat::PhysVarHisto * | histoLRSignalEvtProb_ |
pat::HistoComposite * | histoTtSemiEvt_ |
edm::Handle< std::vector < pat::Jet > > | jetHandle_ |
edm::Handle< std::vector < pat::MET > > | METHandle_ |
edm::Handle< std::vector < pat::Muon > > | muonHandle_ |
std::vector< pat::PhysVarHisto * > | ntvars_ |
edm::Handle< std::vector < pat::Photon > > | photonHandle_ |
edm::Handle< std::vector < pat::Tau > > | tauHandle_ |
int | verboseLevel_ |
This is an ED analyzer which creates and fills a bunch of histograms of various physics quantities. However, in order to make this also work in FWLite, most of the actual work is performed by another object called PhysicsHistograms, to which this ED analyzer delegates most of the work, except the interactions with EDM and Framework, like:
Definition at line 65 of file TtSemiEvtKit.h.
TtSemiEvtKit::TtSemiEvtKit | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 12 of file TtSemiEvtKit.cc.
00013 : 00014 verboseLevel_(0) 00015 // helper_(iConfig) 00016 { 00017 00018 // helper_.bookHistos(this); 00019 00020 // evtsols = iConfig.getParameter<edm::InputTag> ("EvtSolution"); 00021 00022 // cout << "About to book histoTtSemiEvtHypothesis" << endl; 00023 00024 00025 // PhysicsHistograms::KinAxisLimits compositeAxisLimits; 00026 00027 // compositeAxisLimits = helper_.getAxisLimits("topAxis"); 00028 00029 // double pt1 = compositeAxisLimits.pt1; 00030 // double pt2 = compositeAxisLimits.pt2; 00031 // double m1 = compositeAxisLimits.m1; 00032 // double m2 = compositeAxisLimits.m2; 00033 00034 // histoTtSemiEvt_ = new HistoComposite("ttSemiEvt", "ttSemiEvt", "ttSemiEvt", 00035 // pt1, pt2, m1, m2); 00036 00037 00038 // edm::Service<TFileService> fs; 00039 // TFileDirectory ttbar = TFileDirectory( fs->mkdir("ttbar") ); 00040 00041 // histoLRJetCombProb_ = new PhysVarHisto( "lrJetCombProb", "Jet Comb Probability", 00042 // 100, 0, 1, &ttbar, "", "vD" ); 00043 // histoLRSignalEvtProb_ = new PhysVarHisto( "lrSignalEvtProb", "Event Probability", 00044 // 100, 0, 1, &ttbar, "", "vD" ); 00045 // histoKinFitProbChi2_ = new PhysVarHisto( "kinFitProbChi2", "Kin Fitter Chi2 Prob", 00046 // 100, 0, 1, &ttbar, "", "vD" ); 00047 00048 00049 // histoLRJetCombProb_ ->makeTH1(); 00050 // histoLRSignalEvtProb_ ->makeTH1(); 00051 // histoKinFitProbChi2_ ->makeTH1(); 00052 00053 // helper_.physHistos_->addHisto( histoLRJetCombProb_ ); 00054 // helper_.physHistos_->addHisto( histoLRSignalEvtProb_ ); 00055 // helper_.physHistos_->addHisto( histoKinFitProbChi2_ ); 00056 00057 }
TtSemiEvtKit::~TtSemiEvtKit | ( | ) | [virtual] |
void TtSemiEvtKit::beginJob | ( | const edm::EventSetup & | iSetup | ) | [protected, virtual] |
void TtSemiEvtKit::produce | ( | edm::Event & | iEvent, | |
const edm::EventSetup & | iSetup | |||
) | [protected, virtual] |
Implements edm::EDProducer.
Definition at line 68 of file TtSemiEvtKit.cc.
00069 { 00070 // using namespace edm; 00071 00072 // // INSIDE OF LepJetMetKit::produce: 00073 00074 // // -------------------------------------------------- 00075 // // Step 1: Retrieve objects from data stream 00076 // // -------------------------------------------------- 00077 // helper_.getHandles( iEvent, 00078 // muonHandle_, 00079 // electronHandle_, 00080 // tauHandle_, 00081 // jetHandle_, 00082 // METHandle_, 00083 // photonHandle_); 00084 00085 // // -------------------------------------------------- 00086 // // Step 2: invoke PhysicsHistograms to deal with all this. 00087 // // 00088 // // Note that each handle will dereference into a vector<>, 00089 // // however the fillCollection() method takes a reference, 00090 // // so the collections are not copied... 00091 // // -------------------------------------------------- 00092 00093 // if ( verboseLevel_ > 10 ) 00094 // std::cout << "PatAnalyzerKit::analyze: calling fillCollection()." << std::endl; 00095 // helper_.fillHistograms( iEvent, 00096 // muonHandle_, 00097 // electronHandle_, 00098 // tauHandle_, 00099 // jetHandle_, 00100 // METHandle_, 00101 // photonHandle_); 00102 00103 // // -------------------------------------------------- 00104 // // Step 3: Plot LepJetMet data 00105 // // -------------------------------------------------- 00106 00107 00108 // // BEGIN TtSemiEvt analysis here: 00109 00110 // // get the event solution 00111 // edm::Handle< std::vector<TtSemiEvtSolution> > eSols; 00112 // iEvent.getByLabel(evtsols, eSols); 00113 00114 // // cout << "TtSemiEvtKit: About to do work on sols" << endl; 00115 // const std::vector<TtSemiEvtSolution> & sols = *eSols; 00116 // // cout << "Done getting vector ref to sols" << endl; 00117 00118 // if ( sols.size() > 0 ) { 00119 00120 // // cout << "Sols.size() > 0 " << endl; 00121 00122 // // cout << "TtSemiEvtKit: Getting best solution" << endl; 00123 // int bestSol = sols[0].getLRBestJetComb(); 00124 // if ( bestSol >= 0 ) { 00125 00126 00127 // // cout << "About to fill the ttSemiEvt solution : " << bestSol << endl; 00128 // histoTtSemiEvt_->fill( sols[bestSol].getRecoHyp() ); 00129 00130 00131 // histoLRJetCombProb_->fill( sols[bestSol].getLRJetCombProb()); 00132 // histoLRSignalEvtProb_->fill( sols[bestSol].getLRSignalEvtProb()); 00133 // histoKinFitProbChi2_->fill( sols[bestSol].getProbChi2()); 00134 // } 00135 // } 00136 00137 00138 // histoLRJetCombProb_->clearVec(); 00139 // histoLRSignalEvtProb_->clearVec(); 00140 // histoKinFitProbChi2_->clearVec(); 00141 00142 00143 // cout << "Done with produce" << endl; 00144 }
edm::Handle<std::vector<pat::Electron> > TtSemiEvtKit::electronHandle_ [protected] |
Definition at line 98 of file TtSemiEvtKit.h.
edm::InputTag TtSemiEvtKit::evtsols [protected] |
Definition at line 81 of file TtSemiEvtKit.h.
pat::PhysVarHisto* TtSemiEvtKit::histoKinFitProbChi2_ [protected] |
Definition at line 87 of file TtSemiEvtKit.h.
pat::PhysVarHisto* TtSemiEvtKit::histoLRJetCombProb_ [protected] |
Definition at line 85 of file TtSemiEvtKit.h.
pat::PhysVarHisto* TtSemiEvtKit::histoLRSignalEvtProb_ [protected] |
Definition at line 86 of file TtSemiEvtKit.h.
pat::HistoComposite* TtSemiEvtKit::histoTtSemiEvt_ [protected] |
Definition at line 83 of file TtSemiEvtKit.h.
edm::Handle<std::vector<pat::Jet> > TtSemiEvtKit::jetHandle_ [protected] |
Definition at line 100 of file TtSemiEvtKit.h.
edm::Handle<std::vector<pat::MET> > TtSemiEvtKit::METHandle_ [protected] |
Definition at line 101 of file TtSemiEvtKit.h.
edm::Handle<std::vector<pat::Muon> > TtSemiEvtKit::muonHandle_ [protected] |
Definition at line 97 of file TtSemiEvtKit.h.
std::vector<pat::PhysVarHisto *> TtSemiEvtKit::ntvars_ [protected] |
Definition at line 89 of file TtSemiEvtKit.h.
edm::Handle<std::vector<pat::Photon> > TtSemiEvtKit::photonHandle_ [protected] |
Definition at line 102 of file TtSemiEvtKit.h.
edm::Handle<std::vector<pat::Tau> > TtSemiEvtKit::tauHandle_ [protected] |
Definition at line 99 of file TtSemiEvtKit.h.
int TtSemiEvtKit::verboseLevel_ [protected] |
Definition at line 79 of file TtSemiEvtKit.h.