From 36b844db4d3b59fb146aeb5e11f1c0ff3f88e8af Mon Sep 17 00:00:00 2001 From: Salvatore Rappoccio Date: Mon, 23 Jun 2008 18:58:39 +0000 Subject: [PATCH] --- yaml --- r: 46392 b: "refs/heads/CMSSW_7_1_X" c: 8af9627908ff4ef05568ad44cfa1c97a6f09e2aa h: "refs/heads/CMSSW_7_1_X" v: v3 --- [refs] | 2 +- .../StarterKit/src/HistoElectron.cc | 4 +- trunk/PhysicsTools/StarterKit/src/HistoTau.cc | 121 ++++++++++-------- .../PhysicsTools/StarterKit/src/HistoTrack.cc | 25 ++-- 4 files changed, 88 insertions(+), 64 deletions(-) diff --git a/[refs] b/[refs] index 461bf986422f8..8e974563b4428 100644 --- a/[refs] +++ b/[refs] @@ -1,3 +1,3 @@ --- refs/heads/gh-pages: ac155dadd83efa75cad55c0508a57a2b9dd3d66c -"refs/heads/CMSSW_7_1_X": 47960c7b2a2714b726c89a8eb8a2a0444e2569c2 +"refs/heads/CMSSW_7_1_X": 8af9627908ff4ef05568ad44cfa1c97a6f09e2aa diff --git a/trunk/PhysicsTools/StarterKit/src/HistoElectron.cc b/trunk/PhysicsTools/StarterKit/src/HistoElectron.cc index e5a5278b79b19..52740ae66d1c3 100644 --- a/trunk/PhysicsTools/StarterKit/src/HistoElectron.cc +++ b/trunk/PhysicsTools/StarterKit/src/HistoElectron.cc @@ -37,7 +37,7 @@ void HistoElectron::fill( const Electron * electron, uint iE, double weight ) // fill relevant electron histograms h_trackIso_ ->fill( electron->trackIso(), iE, weight ); h_caloIso_ ->fill( electron->caloIso(), iE, weight ); - h_leptonID_ ->fill( electron->leptonID("default"), iE, weight ); + h_leptonID_ ->fill( electron->leptonID("robust"), iE, weight ); } @@ -60,7 +60,7 @@ void HistoElectron::fill( const reco::ShallowClonePtrCandidate * pshallow, uint // fill relevant electron histograms h_trackIso_ ->fill( electron->trackIso(), iE, weight ); h_caloIso_ ->fill( electron->caloIso(), iE, weight ); - h_leptonID_ ->fill( electron->leptonID("default"), iE, weight ); + h_leptonID_ ->fill( electron->leptonID("robust"), iE, weight ); } diff --git a/trunk/PhysicsTools/StarterKit/src/HistoTau.cc b/trunk/PhysicsTools/StarterKit/src/HistoTau.cc index 83d4c4841d5f9..246e60c356b29 100644 --- a/trunk/PhysicsTools/StarterKit/src/HistoTau.cc +++ b/trunk/PhysicsTools/StarterKit/src/HistoTau.cc @@ -36,38 +36,15 @@ HistoTau::HistoTau(std::string dir, std::string group,std::string pre, void HistoTau::fill( const Tau *tau, uint iTau, double weight ) { - - // First fill common 4-vector histograms from shallow clone HistoGroup::fill( tau, iTau, weight); // fill relevant tau histograms const double M_PION = 0.13957018; - - const reco::Track & trk = *( tau->leadTrack() ); - ROOT::Math::LorentzVector > p4; - p4.SetPt( trk.pt() ); - p4.SetEta( trk.eta() ); - p4.SetPhi( trk.phi() ); - p4.SetM( M_PION ); - reco::Particle::LorentzVector p4_2( p4.x(), p4.y(), p4.z(), p4.t() ); - reco::RecoChargedCandidate trk_p4( trk.charge(), p4_2 ); - histoLeadingTrack_->fill( &trk_p4, 1, weight ); - - for ( unsigned int isignal = 0; isignal < tau->signalTracks().size(); isignal++ ) { - const reco::Track & trk = *( tau->signalTracks().at(isignal) ); - ROOT::Math::LorentzVector > p4; - p4.SetPt( trk.pt() ); - p4.SetEta( trk.eta() ); - p4.SetPhi( trk.phi() ); - p4.SetM( M_PION ); - reco::Particle::LorentzVector p4_2( p4.x(), p4.y(), p4.z(), p4.t() ); - reco::RecoChargedCandidate trk_p4( trk.charge(), p4_2 ); - histoSignalTrack_->fill( &trk_p4, isignal, weight ); - } - for ( unsigned int iisolation = 0; iisolation < tau->isolationTracks().size(); iisolation++ ) { - const reco::Track & trk = *( tau->isolationTracks().at(iisolation) ); + + if ( tau->leadTrack().isNonnull() ) { + const reco::Track & trk = *( tau->leadTrack() ); ROOT::Math::LorentzVector > p4; p4.SetPt( trk.pt() ); p4.SetEta( trk.eta() ); @@ -75,8 +52,43 @@ void HistoTau::fill( const Tau *tau, uint iTau, double weight ) p4.SetM( M_PION ); reco::Particle::LorentzVector p4_2( p4.x(), p4.y(), p4.z(), p4.t() ); reco::RecoChargedCandidate trk_p4( trk.charge(), p4_2 ); - histoIsolationTrack_->fill( &trk_p4, iisolation, weight ); + trk_p4.setTrack( tau->leadTrack() ); + histoLeadingTrack_->fill( &trk_p4, 1, weight ); } + +// for ( unsigned int isignal = 0; isignal < tau->signalTracks().size(); isignal++ ) { +// cout << "1" << endl; +// if ( tau->signalTracks().at(isignal).isNonnull() ) { +// cout << "2" << endl; +// const reco::Track & trk = *( tau->signalTracks().at(isignal) ); +// ROOT::Math::LorentzVector > p4; +// p4.SetPt( trk.pt() ); +// p4.SetEta( trk.eta() ); +// p4.SetPhi( trk.phi() ); +// p4.SetM( M_PION ); +// cout << "3" << endl; +// reco::Particle::LorentzVector p4_2( p4.x(), p4.y(), p4.z(), p4.t() ); +// reco::RecoChargedCandidate trk_p4( trk.charge(), p4_2 ); +// cout << "4" << endl; +// trk_p4.setTrack( tau->signalTracks().at(isignal) ); +// cout << "5" << endl; +// histoSignalTrack_->fill( &trk_p4, isignal, weight ); +// } +// } +// for ( unsigned int iisolation = 0; iisolation < tau->isolationTracks().size(); iisolation++ ) { +// cout << "6" << endl; +// const reco::Track & trk = *( tau->isolationTracks().at(iisolation) ); +// ROOT::Math::LorentzVector > p4; +// p4.SetPt( trk.pt() ); +// p4.SetEta( trk.eta() ); +// p4.SetPhi( trk.phi() ); +// p4.SetM( M_PION ); +// reco::Particle::LorentzVector p4_2( p4.x(), p4.y(), p4.z(), p4.t() ); +// reco::RecoChargedCandidate trk_p4( trk.charge(), p4_2 ); +// trk_p4.setTrack( tau->isolationTracks().at(iisolation) ); +// histoIsolationTrack_->fill( &trk_p4, iisolation, weight ); +// } +// cout << "7" << endl; // h_emEnergyFraction_->fill( tau->emEnergyFraction(), iTau, weight ); // h_eOverP_ ->fill( tau->eOverP() , iTau, weight ); @@ -100,19 +112,11 @@ void HistoTau::fill( const reco::ShallowClonePtrCandidate * pshallow, uint iTau, // fill relevant tau histograms const double M_PION = 0.13957018; + + + if ( tau->leadTrack().isNonnull() ) { - const reco::Track & trk = *( tau->leadTrack() ); - ROOT::Math::LorentzVector > p4; - p4.SetPt( trk.pt() ); - p4.SetEta( trk.eta() ); - p4.SetPhi( trk.phi() ); - p4.SetM( M_PION ); - reco::Particle::LorentzVector p4_2( p4.x(), p4.y(), p4.z(), p4.t() ); - reco::RecoChargedCandidate trk_p4( trk.charge(), p4_2 ); - histoLeadingTrack_->fill( &trk_p4, 1, weight ); - - for ( unsigned int isignal = 0; isignal < tau->signalTracks().size(); isignal++ ) { - const reco::Track & trk = *( tau->signalTracks().at(isignal) ); + const reco::Track & trk = *( tau->leadTrack() ); ROOT::Math::LorentzVector > p4; p4.SetPt( trk.pt() ); p4.SetEta( trk.eta() ); @@ -120,19 +124,34 @@ void HistoTau::fill( const reco::ShallowClonePtrCandidate * pshallow, uint iTau, p4.SetM( M_PION ); reco::Particle::LorentzVector p4_2( p4.x(), p4.y(), p4.z(), p4.t() ); reco::RecoChargedCandidate trk_p4( trk.charge(), p4_2 ); - histoSignalTrack_->fill( &trk_p4, isignal, weight ); - } - for ( unsigned int iisolation = 0; iisolation < tau->isolationTracks().size(); iisolation++ ) { - const reco::Track & trk = *( tau->isolationTracks().at(iisolation) ); - ROOT::Math::LorentzVector > p4; - p4.SetPt( trk.pt() ); - p4.SetEta( trk.eta() ); - p4.SetPhi( trk.phi() ); - p4.SetM( M_PION ); - reco::Particle::LorentzVector p4_2( p4.x(), p4.y(), p4.z(), p4.t() ); - reco::RecoChargedCandidate trk_p4( trk.charge(), p4_2 ); - histoIsolationTrack_->fill( &trk_p4, iisolation , weight); + trk_p4.setTrack( tau->leadTrack() ); + histoLeadingTrack_->fill( &trk_p4, 1, weight ); } + +// for ( unsigned int isignal = 0; isignal < tau->signalTracks().size(); isignal++ ) { +// const reco::Track & trk = *( tau->signalTracks().at(isignal) ); +// ROOT::Math::LorentzVector > p4; +// p4.SetPt( trk.pt() ); +// p4.SetEta( trk.eta() ); +// p4.SetPhi( trk.phi() ); +// p4.SetM( M_PION ); +// reco::Particle::LorentzVector p4_2( p4.x(), p4.y(), p4.z(), p4.t() ); +// reco::RecoChargedCandidate trk_p4( trk.charge(), p4_2 ); +// trk_p4.setTrack( tau->leadTrack() ); +// histoSignalTrack_->fill( &trk_p4, isignal, weight ); +// } +// for ( unsigned int iisolation = 0; iisolation < tau->isolationTracks().size(); iisolation++ ) { +// const reco::Track & trk = *( tau->isolationTracks().at(iisolation) ); +// ROOT::Math::LorentzVector > p4; +// p4.SetPt( trk.pt() ); +// p4.SetEta( trk.eta() ); +// p4.SetPhi( trk.phi() ); +// p4.SetM( M_PION ); +// reco::Particle::LorentzVector p4_2( p4.x(), p4.y(), p4.z(), p4.t() ); +// reco::RecoChargedCandidate trk_p4( trk.charge(), p4_2 ); +// trk_p4.setTrack( tau->leadTrack() ); +// histoIsolationTrack_->fill( &trk_p4, iisolation , weight); +// } // h_emEnergyFraction_->fill( tau->emEnergyFraction(), iTau, weight ); // h_eOverP_ ->fill( tau->eOverP() , iTau, weight ); diff --git a/trunk/PhysicsTools/StarterKit/src/HistoTrack.cc b/trunk/PhysicsTools/StarterKit/src/HistoTrack.cc index f8a2299de67e1..dbfb03ec1e073 100644 --- a/trunk/PhysicsTools/StarterKit/src/HistoTrack.cc +++ b/trunk/PhysicsTools/StarterKit/src/HistoTrack.cc @@ -39,11 +39,14 @@ void HistoTrack::fill( const RecoChargedCandidate *track, uint iTrk, double weig HistoGroup::fill( track, iTrk, weight); - // fill relevant track histograms - h_dxy_->fill( track->track()->dxy(), iTrk , weight ); - h_dz_->fill( track->track()->dsz(), iTrk , weight ); - h_nValid_->fill( track->track()->numberOfValidHits(), iTrk, weight ); - h_nLost_->fill( track->track()->numberOfLostHits(), iTrk, weight ); + if ( track->track().isNonnull() ) { + + // fill relevant track histograms + h_dxy_->fill( track->track()->dxy(), iTrk , weight ); + h_dz_->fill( track->track()->dsz(), iTrk , weight ); + h_nValid_->fill( track->track()->numberOfValidHits(), iTrk, weight ); + h_nLost_->fill( track->track()->numberOfLostHits(), iTrk, weight ); + } } @@ -65,11 +68,13 @@ void HistoTrack::fill( const reco::ShallowClonePtrCandidate * pshallow, uint iTr HistoGroup::fill( pshallow, iTrk, weight ); - // fill relevant track histograms - h_dxy_->fill( track->track()->dxy(), iTrk, weight ); - h_dz_->fill( track->track()->dsz(), iTrk, weight ); - h_nValid_->fill( track->track()->numberOfValidHits(), iTrk, weight ); - h_nLost_->fill( track->track()->numberOfLostHits(), iTrk, weight ); + if ( track->track().isNonnull() ) { + // fill relevant track histograms + h_dxy_->fill( track->track()->dxy(), iTrk, weight ); + h_dz_->fill( track->track()->dsz(), iTrk, weight ); + h_nValid_->fill( track->track()->numberOfValidHits(), iTrk, weight ); + h_nLost_->fill( track->track()->numberOfLostHits(), iTrk, weight ); + } }