ATLAS Offline Software
Loading...
Searching...
No Matches
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
23class TH1;
24
25namespace CP {
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
#define ASG_TOOL_INTERFACE(CLASSNAME)
#define y
#define x
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.
virtual UInt_t GetRandomLumiBlockNumber(UInt_t runNumber)=0
Get a random lumiblock number for the given run number.
virtual float getCorrectedMu(const xAOD::EventInfo &eventInfo, bool includedDataScaleFactor=false)
Get the corrected average mu of a lumiblock ... (averaging is over all filled BCID in the fill) The a...
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.
virtual float getCorrectedAverageInteractionsPerCrossing(const xAOD::EventInfo &eventInfo, bool includedDataScaleFactor=false)=0
virtual Double_t GetSumOfEventWeights(Int_t channel)=0
possible alternative to using the EventBookkeepers info ... assuming you made your PRW Config file!...
virtual Int_t SetBinning(TH1 *hist)=0
virtual float getCorrectedActualInteractionsPerCrossing(const xAOD::EventInfo &eventInfo, bool includedDataScaleFactor=false)=0
Get the actual mu of a lumiblock ... (BCID-specific mu) The additional flag indicates if the returned...
virtual Int_t AddPeriod(Int_t periodNumber, UInt_t start, UInt_t end)=0
use these methods when generating config files
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 ...
virtual StatusCode apply(const xAOD::EventInfo &eventInfo, bool mu_dependent=true)=0
Decorates with: MC: PileupWeight (CombinedWeight[*UnrepresentedDataWeight if action=2]),...
virtual Double_t GetIntegratedLumi(const TString &trigger="")=0
Total lumi (in pb-1) for a given trigger combination .. leave blank for the unprescaled.
virtual CP::TPileupReweighting * expert()=0
Get pointer to the underlying tool - expert use only: Will require include "PileupReweighting/TPileup...
virtual ULong64_t getPRWHash(const xAOD::EventInfo &eventInfo)=0
return the prw hash used for fast updates of weights at the post-processing level ....
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...
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...
virtual float getCombinedWeight(const xAOD::EventInfo &eventInfo, bool correctUnrepresented=false)=0
Return combined pileup weight.
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...
virtual Double_t GetIntegratedLumi(UInt_t start, UInt_t end)=0
Get the integrated luminosity (in pb-1) between start and end run (inclusive)
virtual Double_t GetIntegratedLumi(Int_t periodNumber, UInt_t start, UInt_t end)=0
similar to above, but for only the given mcRunNumber/periodNumber
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.
virtual Double_t GetNumberOfEvents(Int_t channel)=0
virtual Int_t SetBinning(Int_t nbinsx, Double_t *xbins, Int_t nbinsy=0, Double_t *ybins=0)=0
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
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....
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...
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...
virtual double getLumiBlockIntegratedLumi(const xAOD::EventInfo &eventInfo)=0
Get the integrated lumi of a lumiblock (in pb-1)
Interface for all CP tools supporting systematic variations.
Select isolated Photons, Electrons and Muons.
EventInfo_v1 EventInfo
Definition of the latest event info version.