Skip to content

Commit

Permalink
Merge pull request #7 from cms-kr/JpsiAnalysis
Browse files Browse the repository at this point in the history
add jpsi daughters
  • Loading branch information
jhgoh committed Jan 17, 2014
2 parents c64df90 + 0da2d75 commit 62c4b0a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
2 changes: 2 additions & 0 deletions GenericNtuple/interface/GenericEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand Down
11 changes: 9 additions & 2 deletions GenericNtuple/plugins/KGenericNtupleMaker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -393,13 +393,20 @@ void KGenericNtupleMaker::analyze(const edm::Event& event, const edm::EventSetup
for ( int i=0, n=jpsiHandle->size(); i<n; ++i )
{
const reco::VertexCompositeCandidate& jpsiCand = jpsiHandle->at(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
Expand Down
23 changes: 23 additions & 0 deletions GenericNtuple/src/GenericEvent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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_ )
{
Expand Down Expand Up @@ -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_);
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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_ );
Expand Down

0 comments on commit 62c4b0a

Please sign in to comment.