ATLAS Offline Software
IPileupReweightingTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
8 #ifndef PILEUPREWEIGHTING_IPILEUPREWEIGHTINGTOOL_H
9 #define PILEUPREWEIGHTING_IPILEUPREWEIGHTINGTOOL_H
10 
11 #include "AsgTools/IAsgTool.h"
12 #include "TString.h"
14 
17 
20 
21 
22 
23 class TH1;
24 
25 namespace CP {
26 class TPileupReweighting;
27 
29 {
30 
32 
33  public:
34 
35 
37  virtual float getCombinedWeight( const xAOD::EventInfo& eventInfo, bool correctUnrepresented=false ) = 0;
38 
40  virtual float getCombinedWeight( const xAOD::EventInfo& eventInfo,Double_t x, Double_t y=0., bool correctUnrepresented=false ) = 0;
41 
43  virtual float getCombinedWeight( const xAOD::EventInfo& eventInfo , const TString& trigger, bool mu_dependent=true, bool correctUnrepresented=false ) = 0;
44 
46  virtual float getUnrepresentedDataWeight( const xAOD::EventInfo& eventInfo ) = 0;
47 
49  virtual float getDataWeight( const xAOD::EventInfo& eventInfo, const TString& trigger, bool mu_dependent=true ) = 0;
50 
52  virtual float getPrescaleWeight( const xAOD::EventInfo& eventInfo , const TString& trigger, bool mu_dependent=true ) = 0;
53 
55  virtual int getRandomRunNumber( const xAOD::EventInfo& eventInfo , bool mu_dependent=true) = 0;
56 
61  virtual float getCorrectedMu( const xAOD::EventInfo& eventInfo, bool includedDataScaleFactor=false ) {
62  return getCorrectedAverageInteractionsPerCrossing( eventInfo, includedDataScaleFactor );
63  }
64  virtual float getCorrectedAverageInteractionsPerCrossing( const xAOD::EventInfo& eventInfo, bool includedDataScaleFactor=false ) = 0;
65 
69  virtual float getCorrectedActualInteractionsPerCrossing( const xAOD::EventInfo& eventInfo, bool includedDataScaleFactor=false ) = 0;
70 
72  virtual double getLumiBlockIntegratedLumi( const xAOD::EventInfo& eventInfo ) = 0;
73 
78  virtual StatusCode apply ( const xAOD::EventInfo& eventInfo, bool mu_dependent=true ) = 0;
79 
80 
82  virtual ULong64_t getPRWHash( const xAOD::EventInfo& eventInfo ) = 0;
83 
84  // methods that go straight to the underlying pileup tool
85 
87  virtual UInt_t GetRandomLumiBlockNumber(UInt_t runNumber) = 0;
88 
90  virtual Double_t GetSumOfEventWeights(Int_t channel) = 0;
91  virtual Double_t GetNumberOfEvents(Int_t channel) = 0;
92 
94  virtual Double_t GetIntegratedLumi(UInt_t start, UInt_t end) = 0;
96  virtual Double_t GetIntegratedLumi(const TString& trigger="") = 0;
98  virtual Double_t GetIntegratedLumi(Int_t periodNumber, UInt_t start, UInt_t end) = 0;
100  virtual Double_t GetIntegratedLumiFraction(Int_t periodNumber, UInt_t start, UInt_t end) = 0;
102  virtual Double_t GetIntegratedLumiFraction(Int_t periodNumber, Double_t mu, UInt_t start, UInt_t end) = 0;
103 
104 
106  virtual Int_t AddPeriod(Int_t periodNumber, UInt_t start, UInt_t end) = 0;
107  virtual Int_t SetBinning(Int_t nbinsx, Double_t* xbins, Int_t nbinsy=0, Double_t* ybins=0) = 0;
108  virtual Int_t SetUniformBinning(Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy=0, Double_t ylow=0, Double_t yup=0) = 0;
109  virtual Int_t SetBinning(TH1* hist) = 0;
110 
112  virtual int fill( const xAOD::EventInfo& eventInfo ) = 0;
113 
115  virtual int fill( const xAOD::EventInfo& eventInfo, Double_t x, Double_t y=0.) = 0;
116 
117 
120 
121 
122  };
123 
124 }
125 
126 
127 
128 #endif
CP::IPileupReweightingTool::getPrescaleWeight
virtual float getPrescaleWeight(const xAOD::EventInfo &eventInfo, const TString &trigger, bool mu_dependent=true)=0
Get weight used to 'prescale' Monte Carlo for given trigger comibnation.
IGoodRunsListSelectionTool.h
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
CP::IPileupReweightingTool::SetUniformBinning
virtual Int_t SetUniformBinning(Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy=0, Double_t ylow=0, Double_t yup=0)=0
CP::IPileupReweightingTool::GetIntegratedLumi
virtual Double_t GetIntegratedLumi(Int_t periodNumber, UInt_t start, UInt_t end)=0
similar to above, but for only the given mcRunNumber/periodNumber
CP::TPileupReweighting
Definition: TPileupReweighting.h:50
plotmaker.hist
hist
Definition: plotmaker.py:148
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
CP::IPileupReweightingTool::getUnrepresentedDataWeight
virtual float getUnrepresentedDataWeight(const xAOD::EventInfo &eventInfo)=0
When using UnrepresentedDataAction=2, you may want to apply this additional weight to ensure sum of w...
CP::IPileupReweightingTool::GetSumOfEventWeights
virtual Double_t GetSumOfEventWeights(Int_t channel)=0
possible alternative to using the EventBookkeepers info ... assuming you made your PRW Config file!...
PixelAthClusterMonAlgCfg.ybins
ybins
Definition: PixelAthClusterMonAlgCfg.py:169
CP::IPileupReweightingTool::getCombinedWeight
virtual float getCombinedWeight(const xAOD::EventInfo &eventInfo, Double_t x, Double_t y=0., bool correctUnrepresented=false)=0
Same as above, but for a 'custom weight' variable.
CP::IPileupReweightingTool::apply
virtual StatusCode apply(const xAOD::EventInfo &eventInfo, bool mu_dependent=true)=0
Decorates with: MC: PileupWeight (CombinedWeight[*UnrepresentedDataWeight if action=2]),...
CP::IPileupReweightingTool::GetRandomLumiBlockNumber
virtual UInt_t GetRandomLumiBlockNumber(UInt_t runNumber)=0
Get a random lumiblock number for the given run number.
x
#define x
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
ISystematicsTool.h
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
CP::IPileupReweightingTool::GetIntegratedLumiFraction
virtual Double_t GetIntegratedLumiFraction(Int_t periodNumber, Double_t mu, UInt_t start, UInt_t end)=0
return fraction of lumi assigned to periodNumber (or mcRunNumber) with given mu, that is between star...
CP::IPileupReweightingTool::GetIntegratedLumi
virtual Double_t GetIntegratedLumi(const TString &trigger="")=0
Total lumi (in pb-1) for a given trigger combination .. leave blank for the unprescaled.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CP::IPileupReweightingTool::GetNumberOfEvents
virtual Double_t GetNumberOfEvents(Int_t channel)=0
CP::IPileupReweightingTool::getCorrectedAverageInteractionsPerCrossing
virtual float getCorrectedAverageInteractionsPerCrossing(const xAOD::EventInfo &eventInfo, bool includedDataScaleFactor=false)=0
CP::IPileupReweightingTool::fill
virtual int fill(const xAOD::EventInfo &eventInfo)=0
Call this method once per event when in config file generating mode and you want standard mu reweight...
ASG_TOOL_INTERFACE
#define ASG_TOOL_INTERFACE(CLASSNAME)
Definition: AsgToolMacros.h:40
IAsgTool.h
CP::IPileupReweightingTool::GetIntegratedLumiFraction
virtual Double_t GetIntegratedLumiFraction(Int_t periodNumber, UInt_t start, UInt_t end)=0
return fraction of lumi assigned to periodNumber (or mcRunNumber) that is between start and end data ...
CP::IPileupReweightingTool::GetIntegratedLumi
virtual Double_t GetIntegratedLumi(UInt_t start, UInt_t end)=0
Get the integrated luminosity (in pb-1) between start and end run (inclusive)
CP::IPileupReweightingTool::getRandomRunNumber
virtual int getRandomRunNumber(const xAOD::EventInfo &eventInfo, bool mu_dependent=true)=0
Get a random run number for this MC event, mu_dependency is recommended ... jetetmiss seem to like it...
CP::IPileupReweightingTool::getDataWeight
virtual float getDataWeight(const xAOD::EventInfo &eventInfo, const TString &trigger, bool mu_dependent=true)=0
Get the dataWeight used to 'unprescale' data collected from a given trigger combination....
CP::IPileupReweightingTool::getCorrectedActualInteractionsPerCrossing
virtual float getCorrectedActualInteractionsPerCrossing(const xAOD::EventInfo &eventInfo, bool includedDataScaleFactor=false)=0
Get the actual mu of a lumiblock ...
CP::IPileupReweightingTool::getLumiBlockIntegratedLumi
virtual double getLumiBlockIntegratedLumi(const xAOD::EventInfo &eventInfo)=0
Get the integrated lumi of a lumiblock (in pb-1)
CP::IPileupReweightingTool::AddPeriod
virtual Int_t AddPeriod(Int_t periodNumber, UInt_t start, UInt_t end)=0
use these methods when generating config files
EventInfo.h
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
LArCellBinning.xbins
int xbins
Definition: LArCellBinning.py:163
CP::ISystematicsTool
Interface for all CP tools supporting systematic variations.
Definition: ISystematicsTool.h:32
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
y
#define y
CP::IPileupReweightingTool::SetBinning
virtual Int_t SetBinning(TH1 *hist)=0
CP::IPileupReweightingTool::getCombinedWeight
virtual float getCombinedWeight(const xAOD::EventInfo &eventInfo, bool correctUnrepresented=false)=0
Return combined pileup weight.
CP::IPileupReweightingTool::fill
virtual int fill(const xAOD::EventInfo &eventInfo, Double_t x, Double_t y=0.)=0
Use this method if you want to do a generic reweighting instead.
CP::IPileupReweightingTool::getPRWHash
virtual ULong64_t getPRWHash(const xAOD::EventInfo &eventInfo)=0
return the prw hash used for fast updates of weights at the post-processing level ....
TPileupReweighting
Tool to get the calculated MC pileup weight. Also does custom weights and other useful stuff.
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
CP::IPileupReweightingTool::SetBinning
virtual Int_t SetBinning(Int_t nbinsx, Double_t *xbins, Int_t nbinsy=0, Double_t *ybins=0)=0
CP::IPileupReweightingTool::getCombinedWeight
virtual float getCombinedWeight(const xAOD::EventInfo &eventInfo, const TString &trigger, bool mu_dependent=true, bool correctUnrepresented=false)=0
get combined weight (i.e. pileup weight) but with a 1./dataWeight factor applied, this if used for 'p...
CP::IPileupReweightingTool::getCorrectedMu
virtual float getCorrectedMu(const xAOD::EventInfo &eventInfo, bool includedDataScaleFactor=false)
Get the corrected average mu of a lumiblock ...
Definition: IPileupReweightingTool.h:61
CP::IPileupReweightingTool
Definition: IPileupReweightingTool.h:29
CP::IPileupReweightingTool::expert
virtual CP::TPileupReweighting * expert()=0
Get pointer to the underlying tool - expert use only: Will require #include "PileupReweighting/TPileu...