#include <TopQuarkAnalysis/Examples/plugins/HypothesisAnalyzer.h>
Public Member Functions | |
HypothesisAnalyzer (const edm::ParameterSet &) | |
~HypothesisAnalyzer () | |
Private Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
virtual void | beginJob (const edm::EventSetup &) |
virtual void | endJob () |
Private Attributes | |
TH1F * | hadTopMass_ |
TH1F * | hadTopPt_ |
TH1F * | hadWMass_ |
TH1F * | hadWPt_ |
edm::InputTag | hypoClassKey_ |
TH1F * | lepTopMass_ |
TH1F * | lepTopPt_ |
TH1F * | lepWMass_ |
TH1F * | lepWPt_ |
edm::InputTag | semiLepEvt_ |
Definition at line 14 of file HypothesisAnalyzer.h.
HypothesisAnalyzer::HypothesisAnalyzer | ( | const edm::ParameterSet & | cfg | ) | [explicit] |
Definition at line 8 of file HypothesisAnalyzer.cc.
00008 : 00009 semiLepEvt_ (cfg.getParameter<edm::InputTag>("semiLepEvent")), 00010 hypoClassKey_(cfg.getParameter<edm::InputTag>("hypoClassKey")) 00011 { 00012 }
HypothesisAnalyzer::~HypothesisAnalyzer | ( | ) | [inline] |
void HypothesisAnalyzer::analyze | ( | const edm::Event & | evt, | |
const edm::EventSetup & | setup | |||
) | [private, virtual] |
Implements edm::EDAnalyzer.
Definition at line 15 of file HypothesisAnalyzer.cc.
References edm::Event::getByLabel(), hadTopMass_, hadTopPt_, hadWMass_, hadWPt_, hypoClassKey_, lepTopMass_, lepTopPt_, lepWMass_, lepWPt_, reco::Particle::mass(), reco::Particle::pt(), and semiLepEvt_.
00016 { 00017 edm::Handle<TtSemiLeptonicEvent> semiLepEvt; 00018 evt.getByLabel(semiLepEvt_, semiLepEvt); 00019 00020 edm::Handle<int> hypoClassKeyHandle; 00021 evt.getByLabel(hypoClassKey_, hypoClassKeyHandle); 00022 TtSemiLeptonicEvent::HypoClassKey& hypoClassKey = (TtSemiLeptonicEvent::HypoClassKey&) *hypoClassKeyHandle; 00023 00024 if( !semiLepEvt->isHypoAvailable(hypoClassKey) ){ 00025 edm::LogInfo ( "NonValidHyp" ) << "Hypothesis not available for this event"; 00026 return; 00027 } 00028 if( !semiLepEvt->isHypoValid(hypoClassKey) ){ 00029 edm::LogInfo ( "NonValidHyp" ) << "Hypothesis not valid for this event"; 00030 return; 00031 } 00032 00033 const reco::Candidate* hadTop = semiLepEvt->hadronicTop(hypoClassKey); 00034 const reco::Candidate* hadW = semiLepEvt->hadronicW (hypoClassKey); 00035 const reco::Candidate* lepTop = semiLepEvt->leptonicTop(hypoClassKey); 00036 const reco::Candidate* lepW = semiLepEvt->leptonicW (hypoClassKey); 00037 00038 if(hadTop && hadW && lepTop && lepW){ 00039 hadWPt_ ->Fill( hadW->pt() ); 00040 hadWMass_ ->Fill( hadW->mass() ); 00041 hadTopPt_ ->Fill( hadTop->pt() ); 00042 hadTopMass_->Fill( hadTop->mass()); 00043 00044 lepWPt_ ->Fill( lepW->pt() ); 00045 lepWMass_ ->Fill( lepW->mass() ); 00046 lepTopPt_ ->Fill( lepTop->pt() ); 00047 lepTopMass_->Fill( lepTop->mass()); 00048 } 00049 }
void HypothesisAnalyzer::beginJob | ( | const edm::EventSetup & | ) | [private, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 52 of file HypothesisAnalyzer.cc.
References edm::errors::Configuration, hadTopMass_, hadTopPt_, hadWMass_, hadWPt_, lepTopMass_, lepTopPt_, lepWMass_, and lepWPt_.
00053 { 00054 edm::Service<TFileService> fs; 00055 if( !fs ) throw edm::Exception( edm::errors::Configuration, "TFile Service is not registered in cfg file" ); 00056 00057 hadWPt_ = fs->make<TH1F>("hadWPt", "p_{t} (W_{had}) [GeV]", 100, 0., 500.); 00058 hadWMass_ = fs->make<TH1F>("hadWMass", "M (W_{had}) [GeV]" , 50, 0. , 150.); 00059 hadTopPt_ = fs->make<TH1F>("hadTopPt", "p_{t} (t_{had}) [GeV]", 100, 0. , 500.); 00060 hadTopMass_ = fs->make<TH1F>("hadTopMass", "M (t_{had}) [GeV]", 50, 50. , 250.); 00061 00062 lepWPt_ = fs->make<TH1F>("lepWPt", "p_{t} (W_{lep}) [GeV]", 100, 0., 500.); 00063 lepWMass_ = fs->make<TH1F>("lepWMass", "M (W_{lep}) [GeV]" , 50, 0. , 150.); 00064 lepTopPt_ = fs->make<TH1F>("lepTopPt", "p_{t} (t_{lep}) [GeV]", 100, 0. , 500.); 00065 lepTopMass_ = fs->make<TH1F>("lepTopMass", "M (t_{lep}) [GeV]", 50, 50. , 250.); 00066 }
TH1F* HypothesisAnalyzer::hadTopMass_ [private] |
TH1F* HypothesisAnalyzer::hadTopPt_ [private] |
TH1F* HypothesisAnalyzer::hadWMass_ [private] |
TH1F* HypothesisAnalyzer::hadWPt_ [private] |
TH1F* HypothesisAnalyzer::lepTopMass_ [private] |
TH1F* HypothesisAnalyzer::lepTopPt_ [private] |
TH1F* HypothesisAnalyzer::lepWMass_ [private] |
TH1F* HypothesisAnalyzer::lepWPt_ [private] |
edm::InputTag HypothesisAnalyzer::semiLepEvt_ [private] |