Public Member Functions | |
virtual void | analyze (const Event &iEvent, const EventSetup &iSetup) |
virtual void | beginJob () |
virtual void | endJob () |
PFTauHLTTest (const ParameterSet &) | |
~PFTauHLTTest () | |
Private Attributes | |
TDirectory * | _dir |
TFile * | _file |
DQMStore * | dbeTau |
DeltaR< LorentzVector > | deltaRComputer_ |
MonitorElement * | h_MatchedPFTau_Eta_ |
MonitorElement * | h_MatchedPFTau_Pt_ |
MonitorElement * | h_NumberOfJets_ |
MonitorElement * | h_PFTau_Eta_ |
MonitorElement * | h_PFTau_LeadingTrackPt_ |
MonitorElement * | h_PFTau_Phi_ |
MonitorElement * | h_PFTau_Pt_ |
MonitorElement * | h_PFTau_SignalChargedHadron_ |
MonitorElement * | h_PFTau_SignalGammas_ |
MonitorElement * | h_PFTau_SignalNeutralHadron_ |
MonitorElement * | h_PFTau_SignalTracks_ |
MonitorElement * | h_PFTauEt_MCTauEt_ |
MonitorElement * | h_Tau_Pt_ |
string | MatchedPFTauProducer_ |
int | nElecElecPreID |
int | nElecMatchPFTau |
int | nElecNonElecPreID |
int | nEvent |
int | nTauElecPreID |
int | nTauMatchPFTau |
int | nTauNonElecPreID |
std::string | outPutFile_ |
string | PFJetProducer_ |
string | PFTauProducer_ |
Definition at line 50 of file PFTauTest.cc.
PFTauHLTTest::PFTauHLTTest | ( | const ParameterSet & | iConfig | ) | [explicit] |
Definition at line 94 of file PFTauTest.cc.
References edm::ParameterSet::getParameter(), and nEvent.
{ PFTauProducer_ = iConfig.getParameter<string>("PFTauProducer"); PFJetProducer_ = iConfig.getParameter<string>("PFJetProducer"); MatchedPFTauProducer_ = iConfig.getParameter<string>("MatchedPFTauProducer"); nEvent=0; nTauMatchPFTau=0; nElecMatchPFTau=0; nTauElecPreID=0; nElecElecPreID=0; nTauNonElecPreID=0; nElecNonElecPreID=0; outPutFile_ = "PFTauTest.root"; }
PFTauHLTTest::~PFTauHLTTest | ( | ) | [inline] |
Definition at line 53 of file PFTauTest.cc.
{}
void PFTauHLTTest::analyze | ( | const Event & | iEvent, |
const EventSetup & | iSetup | ||
) | [virtual] |
Implements edm::EDAnalyzer.
Definition at line 134 of file PFTauTest.cc.
References gather_cfg::cout, deltaR(), edm::Event::getByLabel(), reco::Candidate::p4(), and reco::Candidate::pt().
{ //cout<<"********"<<endl; //cout<<"Event number "<<nEvent++<<endl; Handle<PFTauCollection> thePFTauHandle; iEvent.getByLabel(PFTauProducer_,thePFTauHandle); Handle<PFTauCollection> thePFJetHandle; iEvent.getByLabel(PFJetProducer_,thePFJetHandle); double numberOfJets = thePFJetHandle->size()*1.; h_NumberOfJets_->Fill(numberOfJets); Handle<View<Candidate> > theMatchedPFTauHandle; iEvent.getByLabel(MatchedPFTauProducer_,theMatchedPFTauHandle); //int n = 0; // Tau Loop for (unsigned int iPFTau=0;iPFTau<thePFTauHandle->size();iPFTau++) { const PFTauRef thePFTau(thePFTauHandle, iPFTau); if(thePFTau->pt() > 0.){ h_PFTau_Eta_->Fill(fabs((*thePFTau).eta())); h_PFTau_Pt_->Fill((*thePFTau).pt()); h_PFTau_Phi_->Fill((*thePFTau).phi()); } bool matched = false; //loop over the matched jets for (View<Candidate>::size_type iMPFTau=0;iMPFTau<theMatchedPFTauHandle->size();iMPFTau++) { const Candidate *theMPFTau = &(*theMatchedPFTauHandle)[iMPFTau]; double deltaR = ROOT::Math::VectorUtil::DeltaR(thePFTau->p4().Vect(), (theMPFTau->p4()).Vect()); if(deltaR < 0.5) { matched = true; h_PFTauEt_MCTauEt_->Fill(theMPFTau->pt(),thePFTau->pt()); break; } } if(matched) { h_MatchedPFTau_Pt_->Fill((*thePFTau).pt()); h_MatchedPFTau_Eta_->Fill(fabs((*thePFTau).eta())); cout <<"Particle type "<<(*thePFTau).leadPFChargedHadrCand()->particleId()<<endl; if((*thePFTau).hasMuonReference()){ MuonRef muonref = (*thePFTau).leadPFChargedHadrCand()->muonRef(); cout <<"Muon segments " <<muonref->numberOfMatches()<<endl; } } if(!matched){ h_PFTau_SignalChargedHadron_->Fill((*thePFTau).signalPFChargedHadrCands().size()*1.); h_PFTau_SignalNeutralHadron_->Fill((*thePFTau).signalPFNeutrHadrCands().size()*1.); if((*thePFTau).leadPFChargedHadrCand().isNonnull()) h_PFTau_LeadingTrackPt_->Fill((*thePFTau).leadPFChargedHadrCand()->pt()); h_PFTau_SignalTracks_->Fill((*thePFTau).signalTracks().size()*1.); h_PFTau_SignalGammas_->Fill((*thePFTau).signalPFGammaCands().size()*1.); } } for (View<Candidate>::size_type iMPFTau=0;iMPFTau<theMatchedPFTauHandle->size();iMPFTau++) { const Candidate *theMPFTau = &(*theMatchedPFTauHandle)[iMPFTau]; h_Tau_Pt_->Fill(theMPFTau->pt()); } }
void PFTauHLTTest::beginJob | ( | void | ) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 110 of file PFTauTest.cc.
{ dbeTau = &*edm::Service<DQMStore>(); dbeTau->setCurrentFolder("RecoPFTau"); // Book histograms h_PFTau_Eta_ = dbeTau->book1D("PFTau_Eta","PFTau_Eta",50,0.,5.0); h_MatchedPFTau_Eta_ = dbeTau->book1D("MatchedPFTau_Eta","MatchedPFTau_Eta",50,0.,5.0); h_PFTau_Phi_ = dbeTau->book1D("PFTau_Phi","PFTau_Phi",50,-3.15,3.15); h_PFTau_Pt_ = dbeTau->book1D("PFTau_Pt","PFTau_Pt",50,0.,50.); h_Tau_Pt_ = dbeTau->book1D("Tau_Pt","Tau_Pt",50,0.,50.); h_MatchedPFTau_Pt_ = dbeTau->book1D("MatchedPFTau_Pt","MatchedPFTau_Pt",50,0.,50.); h_PFTau_SignalChargedHadron_ = dbeTau->book1D("PFTau_NumberChargedHadrons","PFTau_NumberChargedHadrons",10,0.,10.); h_PFTau_SignalNeutralHadron_ = dbeTau->book1D("PFTau_NumberNeutralHadrons","PFTau_NumberNeutralHadrons",10,0.,10.); h_PFTau_LeadingTrackPt_ = dbeTau->book1D("PFTau_LeadingTrackPt","PFTau_LeadingTrackPt",10,0.,10.); h_PFTau_SignalTracks_ = dbeTau->book1D("PFTau_NumberTracks","PFTau_NumberTracks",10,0.,10.); h_PFTau_SignalGammas_= dbeTau->book1D("PFTau_NumberPhotons","PFTau_NumberPhotons",10,0.,10.); h_PFTauEt_MCTauEt_ = dbeTau->book2D("PFTauEt_MCTauEt","PFTau_Et Vs MCTau_Et", 50,0.,50.,50,0.,50.); h_NumberOfJets_ = dbeTau->book1D("NumberOfJets","NumberOfJets",20,0.,20.); }
void PFTauHLTTest::endJob | ( | void | ) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 205 of file PFTauTest.cc.
{ if (!outPutFile_.empty() && &*edm::Service<DQMStore>()) dbeTau->save (outPutFile_); }
TDirectory* PFTauHLTTest::_dir [private] |
Definition at line 75 of file PFTauTest.cc.
TFile* PFTauHLTTest::_file [private] |
Definition at line 74 of file PFTauTest.cc.
DQMStore* PFTauHLTTest::dbeTau [private] |
Definition at line 91 of file PFTauTest.cc.
DeltaR<LorentzVector> PFTauHLTTest::deltaRComputer_ [private] |
Definition at line 59 of file PFTauTest.cc.
MonitorElement* PFTauHLTTest::h_MatchedPFTau_Eta_ [private] |
Definition at line 80 of file PFTauTest.cc.
MonitorElement* PFTauHLTTest::h_MatchedPFTau_Pt_ [private] |
Definition at line 84 of file PFTauTest.cc.
MonitorElement* PFTauHLTTest::h_NumberOfJets_ [private] |
Definition at line 79 of file PFTauTest.cc.
MonitorElement* PFTauHLTTest::h_PFTau_Eta_ [private] |
Definition at line 78 of file PFTauTest.cc.
Definition at line 87 of file PFTauTest.cc.
MonitorElement* PFTauHLTTest::h_PFTau_Phi_ [private] |
Definition at line 81 of file PFTauTest.cc.
MonitorElement* PFTauHLTTest::h_PFTau_Pt_ [private] |
Definition at line 82 of file PFTauTest.cc.
Definition at line 85 of file PFTauTest.cc.
Definition at line 89 of file PFTauTest.cc.
Definition at line 86 of file PFTauTest.cc.
Definition at line 88 of file PFTauTest.cc.
MonitorElement* PFTauHLTTest::h_PFTauEt_MCTauEt_ [private] |
Definition at line 90 of file PFTauTest.cc.
MonitorElement* PFTauHLTTest::h_Tau_Pt_ [private] |
Definition at line 83 of file PFTauTest.cc.
string PFTauHLTTest::MatchedPFTauProducer_ [private] |
Definition at line 61 of file PFTauTest.cc.
int PFTauHLTTest::nElecElecPreID [private] |
Definition at line 68 of file PFTauTest.cc.
int PFTauHLTTest::nElecMatchPFTau [private] |
Definition at line 66 of file PFTauTest.cc.
int PFTauHLTTest::nElecNonElecPreID [private] |
Definition at line 70 of file PFTauTest.cc.
int PFTauHLTTest::nEvent [private] |
Definition at line 64 of file PFTauTest.cc.
int PFTauHLTTest::nTauElecPreID [private] |
Definition at line 67 of file PFTauTest.cc.
int PFTauHLTTest::nTauMatchPFTau [private] |
Definition at line 65 of file PFTauTest.cc.
int PFTauHLTTest::nTauNonElecPreID [private] |
Definition at line 69 of file PFTauTest.cc.
std::string PFTauHLTTest::outPutFile_ [private] |
Definition at line 73 of file PFTauTest.cc.
string PFTauHLTTest::PFJetProducer_ [private] |
Definition at line 61 of file PFTauTest.cc.
string PFTauHLTTest::PFTauProducer_ [private] |
Definition at line 61 of file PFTauTest.cc.