From 0da2d75023bdae0068b74025a4feae30f849960a Mon Sep 17 00:00:00 2001 From: Junghwan John Goh Date: Fri, 17 Jan 2014 12:38:00 +0900 Subject: [PATCH] add jpsi daughters --- GenericNtuple/interface/GenericEvent.h | 2 ++ GenericNtuple/plugins/KGenericNtupleMaker.cc | 11 ++++++++-- GenericNtuple/src/GenericEvent.cc | 23 ++++++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/GenericNtuple/interface/GenericEvent.h b/GenericNtuple/interface/GenericEvent.h index 7c1387e9f1cdd..75d86b3683bf4 100644 --- a/GenericNtuple/interface/GenericEvent.h +++ b/GenericNtuple/interface/GenericEvent.h @@ -54,6 +54,8 @@ struct GenericEvent doublesP jpsis_pt_, jpsis_eta_, jpsis_phi_, jpsis_m_; doublesP jpsis_lxy_; + doublesP jpsis_pt1_, jpsis_eta1_, jpsis_phi1_; + doublesP jpsis_pt2_, jpsis_eta2_, jpsis_phi2_; // Generator level information bool isMC_; diff --git a/GenericNtuple/plugins/KGenericNtupleMaker.cc b/GenericNtuple/plugins/KGenericNtupleMaker.cc index 48229f0c28d2a..c6f812bf86544 100644 --- a/GenericNtuple/plugins/KGenericNtupleMaker.cc +++ b/GenericNtuple/plugins/KGenericNtupleMaker.cc @@ -393,13 +393,20 @@ void KGenericNtupleMaker::analyze(const edm::Event& event, const edm::EventSetup for ( int i=0, n=jpsiHandle->size(); iat(i); - const reco::Candidate* track1 = jpsiCand.daughter(0); - const reco::Candidate* track2 = jpsiCand.daughter(1); + const reco::Candidate* muon1 = jpsiCand.daughter(0); + const reco::Candidate* muon2 = jpsiCand.daughter(1); fevent_->jpsis_pt_ ->push_back(jpsiCand.pt() ); fevent_->jpsis_eta_->push_back(jpsiCand.eta() ); fevent_->jpsis_phi_->push_back(jpsiCand.phi() ); fevent_->jpsis_m_ ->push_back(jpsiCand.mass()); fevent_->jpsis_lxy_->push_back(jpsiLxyHandle->at(i)); + + fevent_->jpsis_pt1_- >push_back(muon1->pt() ); + fevent_->jpsis_eta1_->push_back(muon1->eta()); + fevent_->jpsis_phi1_->push_back(muon1->phi()); + fevent_->jpsis_pt2_ ->push_back(muon2->pt() ); + fevent_->jpsis_eta2_->push_back(muon2->eta()); + fevent_->jpsis_phi2_->push_back(muon2->phi()); } // Now put jets in current event to the event cache diff --git a/GenericNtuple/src/GenericEvent.cc b/GenericNtuple/src/GenericEvent.cc index 910bb674ab21c..c3928521f8413 100644 --- a/GenericNtuple/src/GenericEvent.cc +++ b/GenericNtuple/src/GenericEvent.cc @@ -23,6 +23,8 @@ GenericEvent::GenericEvent(bool isMC) jpsis_pt_ = new doubles; jpsis_eta_ = new doubles; jpsis_phi_ = new doubles; jpsis_m_ = new doubles; jpsis_lxy_ = new doubles; + jpsis_pt1_ = new doubles; jpsis_eta1_ = new doubles; jpsis_phi1_ = new doubles; + jpsis_pt2_ = new doubles; jpsis_eta2_ = new doubles; jpsis_phi2_ = new doubles; if ( isMC_ ) { @@ -100,6 +102,13 @@ void GenericEvent::book(TTree* tree) tree_->Branch("jpsis_m" , &jpsis_m_ ); tree_->Branch("jpsis_lxy", &jpsis_lxy_); + tree_->Branch("jpsis_pt1" , &jpsis_pt1_ ); + tree_->Branch("jpsis_eta1", &jpsis_eta1_); + tree_->Branch("jpsis_phi1", &jpsis_phi1_); + tree_->Branch("jpsis_pt2" , &jpsis_pt2_ ); + tree_->Branch("jpsis_eta2", &jpsis_eta2_); + tree_->Branch("jpsis_phi2", &jpsis_phi2_); + if ( isMC_ ) { tree_->Branch("jets_JER" , jets_JER_); @@ -173,6 +182,13 @@ void GenericEvent::clear() jpsis_m_->clear(); jpsis_lxy_->clear(); + jpsis_pt1_ ->clear(); + jpsis_eta1_->clear(); + jpsis_phi1_->clear(); + jpsis_pt2_ ->clear(); + jpsis_eta2_->clear(); + jpsis_phi2_->clear(); + if ( isMC_ ) { jets_JER_->clear(); @@ -248,6 +264,13 @@ void GenericEvent::setBranch(TTree* tree) tree_->SetBranchAddress("jpsis_m" , &jpsis_m_ ); tree_->SetBranchAddress("jpsis_lxy", &jpsis_lxy_); + tree_->SetBranchAddress("jpsis_pt1" , &jpsis_pt1_ ); + tree_->SetBranchAddress("jpsis_eta1", &jpsis_eta1_); + tree_->SetBranchAddress("jpsis_phi1", &jpsis_phi1_); + tree_->SetBranchAddress("jpsis_pt2" , &jpsis_pt2_ ); + tree_->SetBranchAddress("jpsis_eta2", &jpsis_eta2_); + tree_->SetBranchAddress("jpsis_phi2", &jpsis_phi2_); + if ( isMC_ ) { tree_->SetBranchAddress("jets_JER" , &jets_JER_ );