Skip to content

Commit

Permalink
changing PU weights from puWeight branch in trees to custom PU weight…
Browse files Browse the repository at this point in the history
…s in external root file.
  • Loading branch information
awhitbeck committed Feb 23, 2017
1 parent c0442c2 commit 6295d13
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/cutFlow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ int main(int argc, char** argv){
for( int iCut = 0 ; iCut < cutFlow.size() ; iCut++ ){
if( ! cutFlow[iCut](ntuple) ) break;
for( int iPlot = 0 ; iPlot < plots[iCut].size() ; iPlot++ ){
weight = ntuple->Weight*lumi*ntuple->puWeight;
weight = ntuple->Weight*lumi*customPUweights(ntuple);
if( sampleNames[iSample] == "GJets" ){
weight*=photonTriggerWeight(ntuple)*GJets0p4Weights(ntuple)*dRweights(ntuple);
plots[iCut][iPlot].fill(ntuple,weight);
Expand Down
8 changes: 4 additions & 4 deletions src/fragmentationFits.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ int main(int argc, char** argv){
if( ntuple->Photons->at(0).Pt() < 200. ) continue;
}

weight = lumi*ntuple->Weight*ntuple->puWeight;
weight = lumi*ntuple->Weight*customPUweights(ntuple);
if( reg == skimSamples::kPhoton || reg == skimSamples::kPhotonLDP )
weight*=photonTriggerWeight(ntuple);
if( skims.sampleName[iSample] == "GJets" )
weight*=GJets0p4Weights(ntuple)*dRweights(ntuple);

analysisBin = Bins46plot.fill(ntuple,lumi*ntuple->Weight*ntuple->puWeight);
nJetBin = NJetsplot.fill(ntuple,lumi*ntuple->Weight*ntuple->puWeight);
PhotonMinDeltaR_inc.fill(ntuple,lumi*ntuple->Weight*ntuple->puWeight);
analysisBin = Bins46plot.fill(ntuple,lumi*ntuple->Weight*customPUweights(ntuple));
nJetBin = NJetsplot.fill(ntuple,lumi*ntuple->Weight*customPUweights(ntuple));
PhotonMinDeltaR_inc.fill(ntuple,lumi*ntuple->Weight*customPUweights(ntuple));


if( analysisBin > 0 && analysisBin <= 46 ){
Expand Down
4 changes: 2 additions & 2 deletions src/plotObs_baseline.cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ int main(int argc, char** argv){

int numEvents = ntuple->fChain->GetEntries();
ntupleBranchStatus<RA2bTree>(ntuple);
double weight = 1.;
double weight = 1.0;
for( int iEvt = 0 ; iEvt < min(MAX_EVENTS,numEvents) ; iEvt++ ){

//cout << "sample: " << skims.sampleName[iSample] << endl;
Expand All @@ -189,7 +189,7 @@ int main(int argc, char** argv){
}

for( int iPlot = 0 ; iPlot < plotsAllEvents.size() ; iPlot++ ){
weight = lumi*ntuple->Weight*ntuple->puWeight;
weight = lumi*ntuple->Weight*customPUweights(ntuple);
if( reg == skimSamples::kPhoton || reg == skimSamples::kPhotonLDP )
weight *= photonTriggerWeight(ntuple);
if( skims.sampleName[iSample] == "GJets" ){
Expand Down
2 changes: 1 addition & 1 deletion src/plotRzGamma.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ int main(int argc, char** argv){
if( sampleNames[iSample] == "GJets" && ntuple->Photons->at(0).Pt() < 200. ) continue;
if( ( region == 0 && !RA2bBaselineCut(ntuple) ) || ( region == 1 && !RA2bLDPBaselineCut(ntuple) ) ) continue;

weight = lumi*ntuple->Weight*ntuple->puWeight;//*photonTriggerWeight(ntuple));
weight = lumi*ntuple->Weight*customPUweights(ntuple);//*photonTriggerWeight(ntuple));
if( sampleNames[iSample] == "GJets" && DR0p4 )
weight*=GJets0p4Weights(ntuple)*dRweights(ntuple);

Expand Down
6 changes: 3 additions & 3 deletions src/triggerUncertainties.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ int main(int argc, char** argv){
if( ( region == 0 && !RA2bBaselineCut(ntuple) ) || ( region == 1 && !RA2bLDPBaselineCut(ntuple) ) ) continue;

for( int i=0 ; i<100 ; i++ ){
MHTplot->Fill(ntuple->MHT,photonTriggerWeightRand(ntuple),ntuple->Weight*ntuple->puWeight);
Bins46plot->Fill(fillRA2b46Bins(ntuple),photonTriggerWeightRand(ntuple),ntuple->Weight*ntuple->puWeight);
Bins59plot->Fill(fillRA2b59Bins(ntuple),photonTriggerWeightRand(ntuple),ntuple->Weight*ntuple->puWeight);
MHTplot->Fill(ntuple->MHT,photonTriggerWeightRand(ntuple),ntuple->Weight*customPUweights(ntuple));
Bins46plot->Fill(fillRA2b46Bins(ntuple),photonTriggerWeightRand(ntuple),ntuple->Weight*customPUweights(ntuple));
Bins59plot->Fill(fillRA2b59Bins(ntuple),photonTriggerWeightRand(ntuple),ntuple->Weight*customPUweights(ntuple));
}

}
Expand Down

0 comments on commit 6295d13

Please sign in to comment.