Skip to content

Commit

Permalink
Merge pull request cms-sw#118 from cfmcginn/fixForPuWithNtuple758p3
Browse files Browse the repository at this point in the history
Fix for pu with ntuple758p3
  • Loading branch information
kurtejung committed May 1, 2017
2 parents a5f653d + 2d4965a commit b84bd67
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions RecoHI/HiJetAlgos/interface/PuWithNtuple.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class PuWithNtuple : public PileUpSubtractor {

bool sumRecHits_;
bool dropZeroTowers_;
bool isOrphanInputRun_;

double minimumTowersFraction_;

Expand Down
2 changes: 2 additions & 0 deletions RecoHI/HiJetAlgos/plugins/plugins.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "RecoHI/HiJetAlgos/interface/ParametrizedSubtractor.h"
#include "RecoHI/HiJetAlgos/interface/ReflectedIterator.h"
#include "RecoHI/HiJetAlgos/interface/VoronoiSubtractor.h"
#include "RecoHI/HiJetAlgos/interface/PuWithNtuple.h"

#include "FWCore/PluginManager/interface/ModuleDef.h"
#include "FWCore/Framework/interface/MakerMacros.h"
Expand All @@ -14,6 +15,7 @@ DEFINE_EDM_PLUGIN(PileUpSubtractorFactory,MultipleAlgoIterator,"MultipleAlgoIter
DEFINE_EDM_PLUGIN(PileUpSubtractorFactory,ParametrizedSubtractor,"ParametrizedSubtractor");
DEFINE_EDM_PLUGIN(PileUpSubtractorFactory,ReflectedIterator,"ReflectedIterator");
DEFINE_EDM_PLUGIN(PileUpSubtractorFactory,VoronoiSubtractor,"VoronoiSubtractor");
DEFINE_EDM_PLUGIN(PileUpSubtractorFactory,PuWithNtuple,"PuWithNtuple");



Expand Down
12 changes: 9 additions & 3 deletions RecoHI/HiJetAlgos/src/PuWithNtuple.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ PuWithNtuple::PuWithNtuple(const edm::ParameterSet& iConfig, edm::ConsumesCollec

Neta_ = 82;

isOrphanInputRun_ = false;
tree_ = fs_->make<TTree>("puTree","");

tree_->Branch("nref",&nref,"nref/I");
Expand Down Expand Up @@ -270,6 +271,13 @@ void PuWithNtuple::calculatePedestal( vector<fastjet::PseudoJet> const & coll )
}
LogDebug("PileUpSubtractor")<<" ieta : "<<it<<" Pedestals : "<<emean_[it]<<" "<<esigma_[it]<<"\n";
}


if(isOrphanInputRun_){
tree_->Fill();
isOrphanInputRun_ = false;
}

}


Expand All @@ -278,6 +286,7 @@ void PuWithNtuple::calculateOrphanInput(vector<fastjet::PseudoJet> & orphanInput

LogDebug("PileUpSubtractor")<<"The subtractor calculating orphan input...\n";

isOrphanInputRun_ = true;
(*fjInputs_) = fjOriginalInputs_;

vector<int> jettowers; // vector of towers indexed by "user_index"
Expand Down Expand Up @@ -380,9 +389,6 @@ void PuWithNtuple::calculateOrphanInput(vector<fastjet::PseudoJet> & orphanInput
}

// cout<<"Number of jets : "<<nref<<endl;

tree_->Fill();

}


Expand Down

0 comments on commit b84bd67

Please sign in to comment.