Skip to content

Commit

Permalink
Store histograms as global only, rather than per jet.
Browse files Browse the repository at this point in the history
  • Loading branch information
EmyrClement committed Dec 4, 2014
1 parent fbfd1de commit 4b83a74
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 25 deletions.
4 changes: 0 additions & 4 deletions interface/RecoObjects/Jet.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,6 @@ class Jet: public Particle {
ParticlePointer matchedGeneratedJet;
ParticlePointer unsmearedJet;
ParticlePointer smearedJet;

boost::shared_ptr<TEfficiency> hadronTriggerLegEfficiencyHistogram_nonIsoJets;
boost::shared_ptr<TEfficiency> hadronTriggerLegEfficiencyHistogram_isoJets;
boost::shared_ptr<TEfficiency> hadronTriggerLegEfficiencyHistogram_isoPFJets;
};

typedef boost::shared_ptr<Jet> JetPointer;
Expand Down
33 changes: 12 additions & 21 deletions src/RecoObjects/Jet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,7 @@ Jet::Jet() :
//
matchedGeneratedJet(), //
unsmearedJet(), //
smearedJet(), //

hadronTriggerLegEfficiencyHistogram_nonIsoJets( Globals::hadronTriggerLegEfficiencyHistogram_nonIsoJets ), //
hadronTriggerLegEfficiencyHistogram_isoJets( Globals::hadronTriggerLegEfficiencyHistogram_isoJets ), //
hadronTriggerLegEfficiencyHistogram_isoPFJets( Globals::hadronTriggerLegEfficiencyHistogram_isoPFJets ) //

smearedJet() //
{
for (unsigned int btag = 0; btag < btag_discriminators.size(); ++btag) {
btag_discriminators[btag] = -9999;
Expand Down Expand Up @@ -105,11 +100,7 @@ Jet::Jet(double energy, double px, double py, double pz) :
//
matchedGeneratedJet(), //
unsmearedJet(), //
smearedJet(), //

hadronTriggerLegEfficiencyHistogram_nonIsoJets( Globals::hadronTriggerLegEfficiencyHistogram_nonIsoJets ), //
hadronTriggerLegEfficiencyHistogram_isoJets( Globals::hadronTriggerLegEfficiencyHistogram_isoJets ), //
hadronTriggerLegEfficiencyHistogram_isoPFJets( Globals::hadronTriggerLegEfficiencyHistogram_isoPFJets ) //
smearedJet() //
{
for (unsigned int btag = 0; btag < btag_discriminators.size(); ++btag) {
btag_discriminators[btag] = -9999;
Expand Down Expand Up @@ -542,7 +533,7 @@ double Jet::getEfficiencyCorrection( int scale_factor_systematic ) const {

if ( jetPt >= 100 ) return 1.0;

unsigned int binNumber = hadronTriggerLegEfficiencyHistogram_nonIsoJets->FindFixBin( jetPt );
unsigned int binNumber = Globals::hadronTriggerLegEfficiencyHistogram_nonIsoJets->FindFixBin( jetPt );

double correction_nonIsoJets = 1.;
double lumi_nonIsoJets = Globals::luminosity * 0.076;
Expand All @@ -554,19 +545,19 @@ double Jet::getEfficiencyCorrection( int scale_factor_systematic ) const {

switch (scale_factor_systematic) {
case -1:
correction_nonIsoJets = hadronTriggerLegEfficiencyHistogram_nonIsoJets->GetEfficiency( binNumber ) - hadronTriggerLegEfficiencyHistogram_nonIsoJets->GetEfficiencyErrorLow( binNumber );
correction_isoJets = hadronTriggerLegEfficiencyHistogram_isoJets->GetEfficiency( binNumber ) - hadronTriggerLegEfficiencyHistogram_isoJets->GetEfficiencyErrorLow( binNumber );
correction_isoPFJets = hadronTriggerLegEfficiencyHistogram_isoPFJets->GetEfficiency( binNumber ) - hadronTriggerLegEfficiencyHistogram_isoPFJets->GetEfficiencyErrorLow( binNumber );
correction_nonIsoJets = Globals::hadronTriggerLegEfficiencyHistogram_nonIsoJets->GetEfficiency( binNumber ) - Globals::hadronTriggerLegEfficiencyHistogram_nonIsoJets->GetEfficiencyErrorLow( binNumber );
correction_isoJets = Globals::hadronTriggerLegEfficiencyHistogram_isoJets->GetEfficiency( binNumber ) - Globals::hadronTriggerLegEfficiencyHistogram_isoJets->GetEfficiencyErrorLow( binNumber );
correction_isoPFJets = Globals::hadronTriggerLegEfficiencyHistogram_isoPFJets->GetEfficiency( binNumber ) - Globals::hadronTriggerLegEfficiencyHistogram_isoPFJets->GetEfficiencyErrorLow( binNumber );
break;
case 1:
correction_nonIsoJets = hadronTriggerLegEfficiencyHistogram_nonIsoJets->GetEfficiency( binNumber ) + hadronTriggerLegEfficiencyHistogram_nonIsoJets->GetEfficiencyErrorUp( binNumber );
correction_isoJets = hadronTriggerLegEfficiencyHistogram_isoJets->GetEfficiency( binNumber ) + hadronTriggerLegEfficiencyHistogram_isoJets->GetEfficiencyErrorUp( binNumber );
correction_isoPFJets = hadronTriggerLegEfficiencyHistogram_isoPFJets->GetEfficiency( binNumber ) + hadronTriggerLegEfficiencyHistogram_isoPFJets->GetEfficiencyErrorUp( binNumber );
correction_nonIsoJets = Globals::hadronTriggerLegEfficiencyHistogram_nonIsoJets->GetEfficiency( binNumber ) + Globals::hadronTriggerLegEfficiencyHistogram_nonIsoJets->GetEfficiencyErrorUp( binNumber );
correction_isoJets = Globals::hadronTriggerLegEfficiencyHistogram_isoJets->GetEfficiency( binNumber ) + Globals::hadronTriggerLegEfficiencyHistogram_isoJets->GetEfficiencyErrorUp( binNumber );
correction_isoPFJets = Globals::hadronTriggerLegEfficiencyHistogram_isoPFJets->GetEfficiency( binNumber ) + Globals::hadronTriggerLegEfficiencyHistogram_isoPFJets->GetEfficiencyErrorUp( binNumber );
break;
default:
correction_nonIsoJets = hadronTriggerLegEfficiencyHistogram_nonIsoJets->GetEfficiency( binNumber );
correction_isoJets = hadronTriggerLegEfficiencyHistogram_isoJets->GetEfficiency( binNumber );
correction_isoPFJets = hadronTriggerLegEfficiencyHistogram_isoPFJets->GetEfficiency( binNumber );
correction_nonIsoJets = Globals::hadronTriggerLegEfficiencyHistogram_nonIsoJets->GetEfficiency( binNumber );
correction_isoJets = Globals::hadronTriggerLegEfficiencyHistogram_isoJets->GetEfficiency( binNumber );
correction_isoPFJets = Globals::hadronTriggerLegEfficiencyHistogram_isoPFJets->GetEfficiency( binNumber );
}

correction = ((correction_nonIsoJets * lumi_nonIsoJets) + (correction_isoJets * lumi_isoJets) + (correction_isoPFJets * lumi_isoPFJets)) / (Globals::luminosity);
Expand Down

0 comments on commit 4b83a74

Please sign in to comment.