Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 46392
b: "refs/heads/CMSSW_7_1_X"
c: 8af9627
h: "refs/heads/CMSSW_7_1_X"
v: v3
  • Loading branch information
Salvatore Rappoccio committed Jun 23, 2008
1 parent 7983f8e commit 36b844d
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 64 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
refs/heads/gh-pages: ac155dadd83efa75cad55c0508a57a2b9dd3d66c
"refs/heads/CMSSW_7_1_X": 47960c7b2a2714b726c89a8eb8a2a0444e2569c2
"refs/heads/CMSSW_7_1_X": 8af9627908ff4ef05568ad44cfa1c97a6f09e2aa
4 changes: 2 additions & 2 deletions trunk/PhysicsTools/StarterKit/src/HistoElectron.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

}

Expand All @@ -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 );

}

Expand Down
121 changes: 70 additions & 51 deletions trunk/PhysicsTools/StarterKit/src/HistoTau.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,47 +36,59 @@ 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<Tau>::fill( tau, iTau, weight);

// fill relevant tau histograms

const double M_PION = 0.13957018;

const reco::Track & trk = *( tau->leadTrack() );
ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<double> > 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<ROOT::Math::PtEtaPhiM4D<double> > 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<ROOT::Math::PtEtaPhiM4D<double> > 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++ ) {
// cout << "1" << endl;
// if ( tau->signalTracks().at(isignal).isNonnull() ) {
// cout << "2" << endl;
// const reco::Track & trk = *( tau->signalTracks().at(isignal) );
// ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<double> > 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<ROOT::Math::PtEtaPhiM4D<double> > 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 );
Expand All @@ -100,39 +112,46 @@ 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<ROOT::Math::PtEtaPhiM4D<double> > 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<ROOT::Math::PtEtaPhiM4D<double> > 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) );
ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<double> > 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<ROOT::Math::PtEtaPhiM4D<double> > 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<ROOT::Math::PtEtaPhiM4D<double> > 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 );
Expand Down
25 changes: 15 additions & 10 deletions trunk/PhysicsTools/StarterKit/src/HistoTrack.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,14 @@ void HistoTrack::fill( const RecoChargedCandidate *track, uint iTrk, double weig

HistoGroup<RecoChargedCandidate>::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 );
}
}


Expand All @@ -65,11 +68,13 @@ void HistoTrack::fill( const reco::ShallowClonePtrCandidate * pshallow, uint iTr

HistoGroup<reco::RecoChargedCandidate>::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 );
}
}


Expand Down

0 comments on commit 36b844d

Please sign in to comment.