|
ATLAS Offline Software
|
Implementation of the PileupReweighting tool.
More...
#include <PileupReweightingTool.h>
|
virtual UInt_t | GetRandomLumiBlockNumber (UInt_t runNumber) |
| Get a random lumiblock number for the given run number. More...
|
|
virtual Double_t | GetIntegratedLumi (UInt_t start, UInt_t end) |
| Get the integrated luminosity (in pb-1) between start and end run (inclusive) More...
|
|
virtual Double_t | GetIntegratedLumi (const TString &trigger) |
| Total lumi (in pb-1) for a given trigger combination .. leave blank for the unprescaled. More...
|
|
virtual Double_t | GetIntegratedLumi (Int_t periodNumber, UInt_t start, UInt_t end) |
| similar to above, but for only the given mcRunNumber/periodNumber More...
|
|
virtual Double_t | GetIntegratedLumiFraction (Int_t periodNumber, UInt_t start, UInt_t end) |
| return fraction of lumi assigned to periodNumber (or mcRunNumber) that is between start and end data run numbers More...
|
|
virtual Double_t | GetIntegratedLumiFraction (Int_t periodNumber, Double_t mu, UInt_t start, UInt_t end) |
| return fraction of lumi assigned to periodNumber (or mcRunNumber) with given mu, that is between start and end data run numbers More...
|
|
virtual Int_t | AddPeriod (Int_t periodNumber, UInt_t start, UInt_t end) |
| use these methods when generating config files More...
|
|
virtual Int_t | SetBinning (Int_t nbinsx, Double_t *xbins, Int_t nbinsy=0, Double_t *ybins=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) |
|
virtual Int_t | SetBinning (TH1 *hist) |
|
virtual Double_t | GetSumOfEventWeights (Int_t channel) |
| helpful alternative to using the EventBookkeepers info ... assuming you made your PRW Config file!! More...
|
|
virtual Double_t | GetNumberOfEvents (Int_t channel) |
|
| PileupReweightingTool (const std::string &name) |
| Constructor for standalone usage. More...
|
|
virtual StatusCode | initialize () |
| Function initialising the tool. More...
|
|
virtual StatusCode | finalize () |
| Finalize - can call the WriteToFile for us. More...
|
|
virtual StatusCode | apply (const xAOD::EventInfo &eventInfo, bool mu_dependent) |
| Decorates with: MC: PileupWeight (CombinedWeight[*UnrepresentedDataWeight if action=2]), RandomRunNumber, RandomLumiBlockNumber Data: corrected_averageInteractionsPerCrossing mu_dependent says if the mu_dependency should be used for random run numbers or the data weights. More...
|
|
virtual float | getCombinedWeight (const xAOD::EventInfo &eventInfo, bool correctUnrepresented) |
| Return combined pileup weight. More...
|
|
virtual float | getCombinedWeight (const xAOD::EventInfo &eventInfo, Double_t x, Double_t y, bool correctUnrepresented) |
| Same as above, but for a 'custom weight' variable. More...
|
|
virtual float | getCombinedWeight (const xAOD::EventInfo &eventInfo, const TString &trigger, bool mu_dependent, bool correctUnrepresented) |
| get combined weight (i.e. pileup weight) but with a 1./dataWeight factor applied, this if used for 'prescaling' MC More...
|
|
virtual ULong64_t | getPRWHash (const xAOD::EventInfo &eventInfo) |
| return the prw hash used for fast updates of weights at the post-processing level ... see the share/makeWeightTree.C script for usage More...
|
|
virtual float | getCorrectedAverageInteractionsPerCrossing (const xAOD::EventInfo &eventInfo, bool includeDataScaleFactor) |
| Get the mu of a lumiblock ... needed to 'correct' the number in datasets. More...
|
|
virtual float | getCorrectedActualInteractionsPerCrossing (const xAOD::EventInfo &eventInfo, bool includeDataScaleFactor) |
| Get the corrected 'actual' interactions per crossing. More...
|
|
virtual double | getLumiBlockIntegratedLumi (const xAOD::EventInfo &eventInfo) |
| Get the integrated lumi of a lumiblock (in pb-1) More...
|
|
virtual float | getUnrepresentedDataWeight (const xAOD::EventInfo &eventInfo) |
| When using UnrepresentedDataAction=2, you may want to apply this additional weight to ensure sum of weights are preserved. More...
|
|
virtual float | getDataWeight (const xAOD::EventInfo &eventInfo, const TString &trigger, bool mu_dependent) |
| Get the dataWeight used to 'unprescale' data collected from a given trigger combination. mu_dependency is recommended to be true. More...
|
|
virtual float | getPrescaleWeight (const xAOD::EventInfo &eventInfo, const TString &trigger, bool mu_dependent) |
| Get weight used to 'prescale' Monte Carlo for given trigger comibnation. More...
|
|
virtual int | getRandomRunNumber (const xAOD::EventInfo &eventInfo, bool mu_dependent) |
| Get a random run number for this MC event, using mu-dependent randomization by default ... jetetmiss seem to like it muchly. More...
|
|
virtual int | fill (const xAOD::EventInfo &eventInfo) |
| Call this method once per event when in config file generating mode and you want standard mu reweighting. More...
|
|
virtual int | fill (const xAOD::EventInfo &eventInfo, Double_t x, Double_t y) |
| Use this method if you want to do a generic reweighting instead. More...
|
|
virtual CP::TPileupReweighting * | expert () |
| Get pointer to the underlying tool - expert use only. Will require #include "PileupReweighting/TPileupReweighting.h". More...
|
|
bool | isAffectedBySystematic (const CP::SystematicVariation &systematic) const |
| The ISystematicsTool methods. More...
|
|
CP::SystematicSet | affectingSystematics () const |
| the list of all systematics this tool can be affected by More...
|
|
CP::SystematicSet | recommendedSystematics () const |
| the list of all systematics this tool recommends to use More...
|
|
StatusCode | applySystematicVariation (const CP::SystematicSet &systConfig) |
| effects: configure this tool for the given list of systematic variations. More...
|
|
void | updateHandler (Gaudi::Details::PropertyBase &) |
|
virtual void | print () const |
| Print the state of the tool. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
virtual float | getCorrectedMu (const xAOD::EventInfo &eventInfo, bool includedDataScaleFactor=false) |
| Get the corrected average mu of a lumiblock ... More...
|
|
|
virtual bool | runLbnOK (Int_t runNbr, Int_t lbn) |
|
virtual bool | passTriggerBeforePrescale (const TString &trigger) const |
|
void | renounceArray (SG::VarHandleKeyArray &handlesArray) |
| remove all handles from I/O resolution More...
|
|
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > | renounce (T &h) |
|
void | extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps) |
| Add StoreName to extra input/output deps as needed. More...
|
|
Int_t | UsePeriodConfig (const TString &configName) |
| use a hardcoded period configuration More...
|
|
void | SetDefaultChannel (Int_t channel, Int_t mcRunNumber=-1) |
| Set which channel should be used as a default when specific mc channel distributions cannot be found. More...
|
|
Int_t | GetDefaultChannel (Int_t mcRunNumber=-1) |
|
void | RemapPeriod (Int_t periodNumber1, Int_t periodNumber2) |
| Combine two period numbers. More...
|
|
Double_t | GetLumiBlockIntegratedLumi (Int_t runNumber, UInt_t lb) |
| get integrated lumi for specific run and lumiblock number . More...
|
|
Float_t | GetLumiBlockMu (Int_t runNumber, UInt_t lb) |
| get the lumiblock mu, useful for 'updating' the mu coming from data to account for new lumitags More...
|
|
void | DisableWarnings (Bool_t in) |
| Indicate if warnings should be suppressed. More...
|
|
void | EnableDebugging (Bool_t in) |
| Indicate if additional debugging information should be output. More...
|
|
void | PrintInfo (Bool_t in) |
| disable info More...
|
|
void | SetUnrepresentedDataAction (Int_t action, Double_t tolerance=0.05) |
| Set how to handle configurations where some of your data has no corresponding mc to describe it 0=Default (Throw exception), 1=Subtract lumi from normalizations (i.e. More...
|
|
Double_t | GetUnrepresentedDataFraction (Int_t periodNumber, Int_t channel) |
| return the unrepresented data fraction in a given channel . More...
|
|
Float_t | GetUnrepresentedDataWeight (Int_t periodNumber, Int_t channel) |
|
Bool_t | IsUnrepresentedData (Int_t runNumber, Float_t x, Float_t y=0.) |
|
void | IgnoreConfigFilePeriods (Bool_t in) |
| Should the tool ignore period assignments encoded in config file. More...
|
|
Int_t | GetFirstFoundPeriodNumber (UInt_t runNumber) |
| Get the first period number with the data run number contained - assume all periods are disconnected for this to be useful. More...
|
|
void | SetDataScaleFactors (Float_t x, Float_t y=1.) |
| Scale the LumiMetaData mu values by this factor. More...
|
|
void | SetMCScaleFactors (Float_t x, Float_t y=1.) |
|
Int_t | AddConfigFile (const TString &fileName) |
|
Int_t | AddLumiCalcFile (const TString &fileName, const TString &trigger="None") |
|
Int_t | AddMetaDataFile (const TString &fileName, const TString &channelBranchName="mc_channel_number") |
|
Bool_t | RemoveChannel (int chanNum) |
| Removes a channel from the inputs ... More...
|
|
Int_t | Initialize () |
| Initialize this class once before the event loop starts If distribution information is provided, it is assumed to be for the standard pileup reweighting. More...
|
|
Float_t | GetCombinedWeight (Int_t periodNumber, Int_t channelNumber, Float_t x, Float_t y=0.) |
|
Float_t | GetPeriodWeight (Int_t periodNumber, Int_t channelNumber) |
|
Float_t | GetPrimaryWeight (Int_t periodNumber, Int_t channelNumber, Float_t x) |
|
Float_t | GetSecondaryWeight (Int_t periodNumber, Int_t channelNumber, Float_t x, Float_t y) |
|
Double_t | GetMetaData (const TString &metadataName, Int_t channelNumber) |
|
TTree * | GetMetaDataTree () |
| combines loaded metadata with channel sumsofweights and entry counts More...
|
|
Int_t | GenerateMetaDataFile (const TString &fileName, const TString &channelBranchName="mc_channel_number") |
|
Int_t | Fill (Int_t runNumber, Int_t channelNumber, Float_t w, Float_t x, Float_t y=0.) |
|
Int_t | WriteToFile (const TString &filename="") |
|
Int_t | WriteToFile (TFile *outFile) |
|
ULong64_t | GetPRWHash (Int_t periodNumber, Int_t channelNumber, Float_t x, Float_t y=0.) |
|
Bool_t | MakeWeightTree (TString channelNumbers, TString outFile, TString hashBranch="PRWHash", TString weightBranch="PileupWeight") |
|
void | SetRandomSeed (int seed) |
|
int | GetRandomSeed () |
|
UInt_t | GetRandomRunNumber (Int_t mcRunNumber) |
| Gets a random data run number according to the integrated lumi distribution associated to this mcRunNumber. More...
|
|
UInt_t | GetRandomRunNumber (Int_t mcRunNumber, Double_t mu) |
| Get random run number according to integrated lumi distribution for the given mu value (uses the binning of the mu histogram) More...
|
|
Int_t | GetRandomPeriodNumber (Int_t mcRunNumber) |
| Get random period number from the sub-periods assigned to this run number. More...
|
|
Int_t | Merge (TCollection *coll) |
|
std::vector< int > | GetPeriodNumbers () const |
|
TH1 * | GetInputHistogram (Int_t channelNumber, Int_t periodNumber) |
|
TH1 * | GetPrimaryDistribution (Int_t channelNumber, Int_t periodNumber) |
|
TH1 * | GetPrimaryTriggerDistribution (const TString &trigger, Int_t periodNumber, long triggerBits) |
|
Double_t | GetDataWeight (Int_t runNumber, const TString &trigger, Double_t x, bool run_dependent=false) |
| Method for weighting data to account for prescales and mu bias. More...
|
|
Double_t | GetDataWeight (Int_t runNumber, const TString &trigger) |
|
Double_t | GetPrescaleWeight (Int_t runNumber, const TString &trigger, Double_t x, bool run_dependent=false) |
| Method for prescaling MC to account for prescales in data. More...
|
|
Double_t | GetPrescaleWeight (Int_t runNumber, const TString &trigger) |
|
Bool_t | IsInitialized () |
|
Int_t | AddDistribution (TH1 *hist, Int_t runNumber, Int_t channelNumber) |
|
void | ResetCountingMode () |
| This method is DEFINITELY EXPERT USE ONLY. More...
|
|
void | SetParentTool (TPileupReweighting *tool) |
|
Float_t | GetDataScaleFactor () const |
|
void | SetTriggerBit (const TString &trigger, bool in=true) |
|
void | ResetTriggerBits () |
|
double | GetRunAverageMu (int run) |
|
Int_t | GetNearestGoodBin (Int_t thisMCRunNumber, Int_t bin) |
|
Int_t | IsBadBin (Int_t thisMCRunNumber, Int_t bin) |
|
std::unique_ptr< TH1 > | CloneEmptyHistogram (Int_t runNumber, Int_t channelNumber) |
|
void | normalizeHistogram (TH1 *histo) |
| Normalize histograms. More...
|
|
void | AddDistributionTree (TTree *tree, TFile *file) |
|
void | CalculatePrescaledLuminosityHistograms (const TString &trigger, int run_dependent=0) |
|
std::unique_ptr< CompositeTrigger > | makeTrigger (const TString &s) |
|
void | calculateHistograms (CompositeTrigger *trigger, int run_dependent) |
|
void | PrintPeriods () |
|
std::map< UInt_t, Run > & | GetRunMap () |
|
void | CopyProperties (const TPileupReweighting *in) |
|
Implementation of the PileupReweighting tool.
- Author
- Will Buttinger
Definition at line 33 of file PileupReweightingTool.h.
◆ StoreGateSvc_t
◆ PileupReweightingTool()
CP::PileupReweightingTool::PileupReweightingTool |
( |
const std::string & |
name | ) |
|
Constructor for standalone usage.
Definition at line 34 of file PileupReweightingTool.cxx.
39 #ifdef XAOD_STANDALONE
41 #endif // XAOD_STANDALONE
47 #ifndef XAOD_STANDALONE
48 declareProperty(
"ConfigOutputStream",
m_configStream=
"",
"When creating PRW config files, this is the THistSvc stream it goes into. If blank, it wont write this way");
54 declareProperty(
"Prefix",
m_prefix=
"",
"Prefix to attach to all decorations ... only used in the 'apply' method");
57 declareProperty(
"UseMultiPeriods",
m_useMultiPeriods=
true,
"If true, will try to treat each mc runNumber in a single mc dataset (channel) as a modelling a distinct period of data taking");
62 declareProperty(
"DataScaleFactorUP",
m_upVariation=1./0.99,
"Set to a value representing the 'up' fluctuation - will report a PRW_DATASF uncertainty to Systematic Registry");
63 declareProperty(
"DataScaleFactorDOWN",
m_downVariation=1./1.07,
"Set to a value representing the 'down' fluctuation - will report a PRW_DATASF uncertainty to Systematic Registry");
64 declareProperty(
"VaryRandomRunNumber",
m_varyRunNumber=
false,
"If true, then when doing systematic variations, RandomRunNumber will fluctuate as well. Off by default as believed to lead to overestimated uncertainties");
65 declareProperty(
"PeriodAssignments",
m_customPeriods={284500,222222,324300,300000,324300,344495,310000,344496,367384,410000,422633,440613,450000,450360,461002,470000,472553,999999},
"Specify period number assignments to run numbers ranges - this is usually an expert option");
66 declareProperty(
"GRLTool",
m_grlTool,
"If you provide a GoodRunsListSelectionTool, any information from lumicalc files will be automatically filtered" );
67 declareProperty(
"TrigDecisionTool",
m_tdt,
"When using the getDataWeight method, the TDT will be used to check decisions before prescale. Alternatively do expert()->SetTriggerBit('trigger',0) to flag which triggers are not fired before prescale (assumed triggers are fired if not specified)");
69 #ifdef XAOD_STANDALONE
71 "The tool to compute the weight in the sumOfWeights" );
74 "The tool to compute the weight in the sumOfWeights" );
77 #ifndef XAOD_STANDALONE
79 auto props = getProperties();
80 for( Gaudi::Details::PropertyBase* prop : props ) {
81 if( prop->name() !=
"OutputLevel" ) {
◆ AddConfigFile()
Int_t TPileupReweighting::AddConfigFile |
( |
const TString & |
fileName | ) |
|
|
inherited |
Definition at line 936 of file TPileupReweighting.cxx.
942 Error(
"AddConfigFile",
"You cannot AddConfigFile after initializing the tool. Reorder your code!");
943 throw std::runtime_error(
"Throwing 5: You cannot AddConfigFile after initializing the tool. Reorder your code!");
950 Error(
"AddConfigFile",
"Could not open file: %s",
fileName.Data());
951 std::string toThrow =
"Throwing 6: Could not open file: "; toThrow +=
fileName.Data();
952 throw std::runtime_error(toThrow);
◆ AddDistribution()
Int_t TPileupReweighting::AddDistribution |
( |
TH1 * |
hist, |
|
|
Int_t |
runNumber, |
|
|
Int_t |
channelNumber |
|
) |
| |
|
inherited |
Definition at line 728 of file TPileupReweighting.cxx.
733 Error(
"AddDistribution",
"You cannot AddDistribution after initializing the tool. Reorder your code!");
734 throw std::runtime_error(
"Throwing 5: You cannot AddLumiCalcFile after initializing the tool. Reorder your code!");
738 Error(
"AddDistribution",
"Unrecognised periodNumber: %d .. please use AddPeriod to define a period",
runNumber);
739 throw std::runtime_error(
"Throwing 6: Unrecognised periodNumber. Please use AddPeriod to define a period");
746 if(
period.first<0)
continue;
748 if(
period.second->inputHists.find(channelNumber)!=
period.second->inputHists.end()) {
749 TString myMsg =
TString::Format(
"Attempt to add distribution for channel %d to period %d, but this channels already has period %d defined.\nThis is indicative of use of incompatible PRW config files, please check your config files for multiple periods/runNumbers for the same channel.",channelNumber,
runNumber,
period.first);
750 Error(
"AddDistribution",
"%s",myMsg.Data());
751 throw std::runtime_error(myMsg.Data());
763 if(strcmp(
hist->IsA()->GetName(),
"TH1D")==0 || strcmp(
hist->IsA()->GetName(),
"TH2D")==0) {
767 if(
hist->GetDimension()==1) {
768 std::vector<Double_t>
binsX;
769 for(
int i=0;
i<=
hist->GetNbinsX();
i++)
binsX.push_back(
hist->GetXaxis()->GetBinLowEdge(
i+1));
772 }
else if(
hist->GetDimension()==2) {
773 std::vector<Double_t>
binsX;std::vector<Double_t>
binsY;
774 for(
int i=0;
i<=
hist->GetNbinsX();
i++)
binsX.push_back(
hist->GetXaxis()->GetBinLowEdge(
i+1));
775 for(
int i=0;
i<=
hist->GetNbinsY();
i++)
binsY.push_back(
hist->GetYaxis()->GetBinLowEdge(
i+1));
779 Error(
"AddDistribution",
"Unknown input histogram dimensionality: %d",
hist->GetDimension());
780 throw std::runtime_error(
"Throwing 98");
794 Double_t numEntries = inputHist->GetEntries();
797 if(channelNumber<0) {
800 tmpHist.reset(
static_cast<TH1*
>(inputHist->Clone(
"tmpHist")) );
803 for(biny=1; biny<=
tmpHist->GetNbinsY(); biny++) {
804 for(binx=1; binx<=
tmpHist->GetNbinsX(); binx++) {
808 if(
tmpHist->GetDimension()==1){
821 for(biny=1; biny<=
hist->GetNbinsY(); biny++) {
822 for(binx=1; binx<=
hist->GetNbinsX(); binx++) {
825 Double_t
x =
hist->GetXaxis()->GetBinCenter(binx);
826 Double_t
y =
hist->GetYaxis()->GetBinCenter(biny);
830 Int_t inBin = inputHist->FindFixBin(
x,
y);
831 Double_t inValue = inputHist->GetBinContent(inBin);
832 inputHist->SetBinContent(inBin,inValue+
value);
838 inputHist->SetEntries(numEntries+
hist->GetEntries());
◆ AddDistributionTree()
void TPileupReweighting::AddDistributionTree |
( |
TTree * |
tree, |
|
|
TFile * |
file |
|
) |
| |
|
protectedinherited |
Definition at line 648 of file TPileupReweighting.cxx.
652 Int_t
channel = 0; UInt_t runNbr = 0;
653 auto pStarts = std::make_unique< std::vector< UInt_t > >();
654 auto pStartsPtr = pStarts.get();
655 auto pEnds = std::make_unique< std::vector< UInt_t > >();
656 auto pEndsPtr = pEnds.get();
658 Char_t customName[150];
659 Bool_t isDefaultForRunNumber(
false);
bool hasDefaultsBranch=
false;
660 if(strcmp(
tree->GetName(),
"MCPileupReweighting")==0) {strcpy(customName,
"pileup");
isMC=
true;}
662 if(
tree->SetBranchAddress(
"CustomName",&customName)!=0) {
663 Error(
"AddDistributionTree",
"Could not find CustomName branch in TTree");
throw std::runtime_error(
"Throwing 18");
666 if(strcmp(
tree->GetName(),
"DataCustomReweighting")==0) {
channel=-1;
isMC=
false;}
668 if(
tree->SetBranchAddress(
"Channel",&
channel)!=0) {
669 Error(
"AddDistributionTree",
"Could not find Channel branch in TTree");
throw std::runtime_error(
"Throwing 18");
672 if(
tree->SetBranchAddress(
"RunNumber",&runNbr)!=0) {
673 Error(
"AddDistributionTree",
"Could not find RunNumber branch in TTree");
throw std::runtime_error(
"Throwing 18");
676 if(
tree->SetBranchAddress(
"PeriodStarts",&pStartsPtr)!=0) {
677 Error(
"AddDistributionTree",
"Could not find PeriodStarts branch in TTree");
throw std::runtime_error(
"Throwing 18");
679 if(
tree->SetBranchAddress(
"PeriodEnds",&pEndsPtr)!=0) {
680 Error(
"AddDistributionTree",
"Could not find PeriodEnds branch in TTree");
throw std::runtime_error(
"Throwing 18");
682 if(
tree->FindBranch(
"IsDefaultForRunNumber")!=0) {
683 tree->SetBranchAddress(
"IsDefaultForRunNumber",&isDefaultForRunNumber);
684 hasDefaultsBranch=
true;
689 Error(
"AddDistributionTree",
"Could not find HistName branch in TTree");
throw std::runtime_error(
"Throwing 18");
691 long n =
tree->GetEntries();
692 std::map<TString,bool> loadedHistos;
693 for(
long i=0;
i<
n;
i++) {
696 TString weightName(customName);
697 const auto &[
ptr, inserted] = loadedHistos.try_emplace(sHistName,
true);
702 for(
unsigned int j=0;j<pStarts->size();j++) {
703 unsigned int start = pStarts->at(j);
704 unsigned int end = pEnds->at(j);
709 TH1 *
histo = (TH1*)
file->Get( sHistName );
712 Error(
"AddDistributionTree",
"Unable to find the histogram %s in the File %s",sHistName.Data(),
file->GetName());
713 throw std::runtime_error(
"Throwing 21");
720 if(hasDefaultsBranch) {
◆ AddLumiCalcFile()
Int_t TPileupReweighting::AddLumiCalcFile |
( |
const TString & |
fileName, |
|
|
const TString & |
trigger = "None" |
|
) |
| |
|
inherited |
Definition at line 847 of file TPileupReweighting.cxx.
850 Error(
"AddLumiCalcFile",
"You cannot AddLumiCalcFile after initializing the tool. Reorder your code!");
851 throw std::runtime_error(
"Throwing 5: You cannot AddLumiCalcFile after initializing the tool. Reorder your code!");
857 Error(
"AddConfigFile",
"Could not open file: %s",
fileName.Data());
858 std::string toThrow =
"Throwing 6: Could not open file: "; toThrow +=
fileName.Data();
859 throw std::runtime_error(toThrow);
862 TTree *
tmp = (TTree*)
rootFile->Get(
"LumiMetaData" );
865 if(trigger==
"None") {
871 UInt_t runNbr=0;Float_t intLumi=0;UInt_t lbn=0;TBranch *b_runNbr=0;TBranch *b_intLumi=0;TBranch *b_lbn=0;
872 Float_t
mu=0.; TBranch *b_mu=0;
873 if(
tmp->SetBranchAddress(
"RunNbr",&runNbr,&b_runNbr)!=0) {
874 Error(
"AddLumiCalcFile",
"Could not find RunNbr branch in Data TTree");
throw std::runtime_error(
"Could not find RunNbr branch in Data TTree");
876 if(
tmp->SetBranchAddress(
"AvergeInteractionPerXing",&
mu,&b_mu)!=0) {
877 Error(
"AddLumiCalcFile",
"Could not find AvergeInteractionPerXing branch in Data TTree");
throw std::runtime_error(
"Could not find AvergeInteractionPerXing branch in Data TTree");
879 if(
tmp->SetBranchAddress(
"IntLumi",&intLumi,&b_intLumi)!=0) {
880 Error(
"AddLumiCalcFile",
"Could not find IntLumi branch in Data TTree");
throw std::runtime_error(
"Could not find IntLumi branch in Data TTree");
882 if(
tmp->SetBranchAddress(
"LBStart",&lbn,&b_lbn)!=0) {
883 Error(
"AddLumiCalcFile",
"Could not find LBStart branch in Data TTree");
throw std::runtime_error(
"Could not find LBStart branch in Data TTree");
888 b_runNbr->GetEntry(
i);b_intLumi->GetEntry(
i);b_mu->GetEntry(
i);
897 if(trigger==
"None") {
898 r.lumiByLbn[lbn].first += intLumi;
899 r.lumiByLbn[lbn].second =
mu;
900 if(
r.nominalFromHists)
continue;
908 std::unique_ptr<TH1>& histptr =
r.inputHists[trigger];
912 histptr->Fill(
mu,intLumi);
918 Info(
"AddLumiCalcFile",
"Adding LumiMetaData for DataWeight (trigger=%s) (scale factor=%f)...",trigger.Data(),
m_dataScaleFactorX);
923 Error(
"AddLumiCalcFile",
"No LumiMetaData found in file %s. not a LumiCalcFile?",
fileName.Data());
924 throw std::runtime_error(
"No LumiMetaData found in file, not a LumiCalcFile?");
◆ AddMetaDataFile()
Int_t TPileupReweighting::AddMetaDataFile |
( |
const TString & |
fileName, |
|
|
const TString & |
channelBranchName = "mc_channel_number" |
|
) |
| |
|
inherited |
Definition at line 506 of file TPileupReweighting.cxx.
515 Error(
"AddMetaDataFile",
"Could not open file: %s",
fileName.Data());
516 throw std::runtime_error(
"Throwing 6");
521 Error(
"AddMetaDataFile",
"%s is not a valid metadata file. Should have a ChannelMetaData TTree",
fileName.Data());
522 throw std::runtime_error(
"Throwing 7");
529 tmp =
new TTree(
"ChannelMetaData",
"ChannelMetaData");
533 std::map<TString, Double_t>
data;
534 TObjArray *leaves =
tmp->GetListOfLeaves();
535 if(leaves==0) {
Error(
"AddMetaDataFile",
"No leaves");
return -1; }
536 for(Int_t
i=0;
i<leaves->GetEntries();++
i) {
537 TLeaf *leaf = (TLeaf *)leaves->At(
i);
539 TBranch *
branch = leaf->GetBranch();
540 if(strcmp(
branch->GetName(),channelBranchName)==0) {
542 if(strcmp(leaf->GetTypeName(),
"Int_t")!=0) {
543 Error(
"AddMetaDataFile",
"Channel Branch must be type Int_t");
544 throw std::runtime_error(
"Throwing 7");
547 }
else if(strcmp(leaf->GetTypeName(),
"Double_t")!=0) {
548 Warning(
"AddMetaDataFile",
"Cannot read non-double branch: %s",
branch->GetName());
555 for(Int_t
i=0;
i<
tmp->GetEntries();++
i) {
◆ AddPeriod()
virtual Int_t CP::PileupReweightingTool::AddPeriod |
( |
Int_t |
periodNumber, |
|
|
UInt_t |
start, |
|
|
UInt_t |
end |
|
) |
| |
|
inlinevirtual |
◆ affectingSystematics()
◆ apply()
StatusCode CP::PileupReweightingTool::apply |
( |
const xAOD::EventInfo & |
eventInfo, |
|
|
bool |
mu_dependent |
|
) |
| |
|
virtual |
Decorates with: MC: PileupWeight (CombinedWeight[*UnrepresentedDataWeight if action=2]), RandomRunNumber, RandomLumiBlockNumber Data: corrected_averageInteractionsPerCrossing mu_dependent says if the mu_dependency should be used for random run numbers or the data weights.
You will get random run numbers of 0 for events with zero pileup weight
Implements CP::IPileupReweightingTool.
Definition at line 451 of file PileupReweightingTool.cxx.
455 return StatusCode::SUCCESS;
460 if(!corrAvgIntPerXingDec.isAvailable(eventInfo))
462 return StatusCode::SUCCESS;
466 if(!corrAvgIntPerXingDec.isAvailable(eventInfo))
472 if(!rrnDec.isAvailable(eventInfo)){
478 if(!rlbnDec.isAvailable(eventInfo))
481 if(!prwHashDec.isAvailable(eventInfo))
482 prwHashDec(eventInfo) =
getPRWHash( eventInfo );
490 ATH_MSG_VERBOSE(
"PileupWeight = " << puWeightAcc(eventInfo) <<
" RandomRunNumber = " << rrnAcc(eventInfo) <<
" RandomLumiBlockNumber = " << rlbnAcc(eventInfo));
492 return StatusCode::SUCCESS;
◆ applySystematicVariation()
effects: configure this tool for the given list of systematic variations.
any requested systematics that are not affecting this tool will be silently ignored (unless they cause other errors). failures: systematic unknown failures: requesting multiple variations on the same systematic (e.g. up & down) failures: requesting an unsupported variation on an otherwise supported systematic (e.g. a 2 sigma variation and the tool only supports 1 sigma variations) failures: unsupported combination of supported systematic failures: other tool specific errors
Implements CP::ISystematicsTool.
Definition at line 130 of file PileupReweightingTool.cxx.
132 ATH_MSG_ERROR(
"Errr... what the!? You're trying to do both PRW_DATASF directions at the same time!!!??");
133 return StatusCode::FAILURE;
136 if(!
m_upTool) {
ATH_MSG_ERROR(
"Requested up variation of PRW_DATASF, but not configured to do this :-(");
return StatusCode::FAILURE; }
140 if(!
m_downTool) {
ATH_MSG_ERROR(
"Requested down variation of PRW_DATASF, but not configured to do this :-(");
return StatusCode::FAILURE; }
144 return StatusCode::SUCCESS;
◆ calculateHistograms()
void TPileupReweighting::calculateHistograms |
( |
CompositeTrigger * |
trigger, |
|
|
int |
run_dependent |
|
) |
| |
|
protectedinherited |
Definition at line 2109 of file TPileupReweighting.cxx.
2110 TH1* unprescaledLumi = 0;
2111 if(runDependentRun) {
2112 unprescaledLumi =
m_triggerObjs[
"None"]->triggerHists[-runDependentRun][0].get();
2114 bool fillUnprescaledLumi = (unprescaledLumi==0);
2117 long tbits =
t->getBits(
this);
2125 std::map<TString, std::map<Int_t, std::map<Int_t, Float_t> > > prescaleByRunAndLbn;
2137 Error(
"CalculatePrescaledLuminosityHistograms",
"Could not open file: %s",
fileName.Data());
2138 std::string toThrow =
"Throwing 6: Could not open file: "; toThrow +=
fileName.Data();
2139 throw std::runtime_error(toThrow);
2142 TTree *
tmp = (TTree*)
rootFile->Get(
"LumiMetaData" );
2146 UInt_t runNbr=0;Float_t
ps1=0;Float_t
ps2=0; Float_t ps3=0;UInt_t lbn=0;TBranch *b_runNbr=0;TBranch *b_L1Presc=0;TBranch *b_L2Presc=0;TBranch *b_L3Presc=0;TBranch *b_lbn=0;
2147 if(
tmp->SetBranchAddress(
"RunNbr",&runNbr,&b_runNbr)!=0) {
2148 Error(
"CalculatePrescaledLuminosityHistograms",
"Could not find RunNbr branch in Data TTree");
throw std::runtime_error(
"Could not find RunNbr branch in Data TTree");
2150 if(
tmp->SetBranchAddress(
"L1Presc",&
ps1,&b_L1Presc)!=0) {
2151 Error(
"CalculatePrescaledLuminosityHistograms",
"Could not find L1Presc branch in Data TTree");
throw std::runtime_error(
"Could not find L1Presc branch in Data TTree");
2153 if(
tmp->SetBranchAddress(
"L2Presc",&
ps2,&b_L2Presc)!=0) {
2154 Error(
"CalculatePrescaledLuminosityHistograms",
"Could not find L2Presc branch in Data TTree");
throw std::runtime_error(
"Could not find L2Presc branch in Data TTree");
2156 if(
tmp->SetBranchAddress(
"L3Presc",&ps3,&b_L3Presc)!=0) {
2157 Error(
"CalculatePrescaledLuminosityHistograms",
"Could not find L3Presc branch in Data TTree");
throw std::runtime_error(
"Could not find L3Presc branch in Data TTree");
2159 if(
tmp->SetBranchAddress(
"LBStart",&lbn,&b_lbn)!=0) {
2160 Error(
"CalculatePrescaledLuminosityHistograms",
"Could not find LBStart branch in Data TTree");
throw std::runtime_error(
"Could not find LBStart branch in Data TTree");
2164 b_runNbr->GetEntry(
i);b_L1Presc->GetEntry(
i);b_L2Presc->GetEntry(
i);b_L3Presc->GetEntry(
i);b_lbn->GetEntry(
i);
2166 if(runDependentRun &&
int(runNbr)!=runDependentRun)
continue;
2170 if(
ps1>0&&
ps2>0&&ps3>0) prescaleByRunAndLbn[*
it][runNbr][lbn] =
ps1*
ps2*ps3;
2171 else if(isUnprescaled) prescaleByRunAndLbn[*
it][runNbr][lbn] = 1;
2184 Error(
"CalculatePrescaledLuminosityHistograms",
"Could not open file: %s",
fileName.Data());
2185 std::string toThrow =
"Throwing 6: Could not open file: "; toThrow +=
fileName.Data();
2186 throw std::runtime_error(toThrow);
2189 TTree *
tmp = (TTree*)
rootFile->Get(
"LumiMetaData" );
2193 UInt_t runNbr=0;Float_t intLumi=0;UInt_t lbn=0;TBranch *b_runNbr=0;TBranch *b_intLumi=0;TBranch *b_lbn=0;
2194 Float_t
mu=0.; TBranch *b_mu=0;
2195 if(
tmp->SetBranchAddress(
"RunNbr",&runNbr,&b_runNbr)!=0) {
2196 Error(
"CalculatePrescaledLuminosityHistograms",
"Could not find RunNbr branch in Data TTree");
throw std::runtime_error(
"Could not find RunNbr branch in Data TTree");
2198 if(
tmp->SetBranchAddress(
"AvergeInteractionPerXing",&
mu,&b_mu)!=0) {
2199 Error(
"CalculatePrescaledLuminosityHistograms",
"Could not find AvergeInteractionPerXing branch in Data TTree");
throw std::runtime_error(
"Could not find AvergeInteractionPerXing branch in Data TTree");
2201 if(
tmp->SetBranchAddress(
"IntLumi",&intLumi,&b_intLumi)!=0) {
2202 Error(
"CalculatePrescaledLuminosityHistograms",
"Could not find IntLumi branch in Data TTree");
throw std::runtime_error(
"Could not find IntLumi branch in Data TTree");
2204 if(
tmp->SetBranchAddress(
"LBStart",&lbn,&b_lbn)!=0) {
2205 Error(
"CalculatePrescaledLuminosityHistograms",
"Could not find LBStart branch in Data TTree");
throw std::runtime_error(
"Could not find LBStart branch in Data TTree");
2210 b_runNbr->GetEntry(
i);b_intLumi->GetEntry(
i);b_mu->GetEntry(
i);
2214 if(runDependentRun &&
int(runNbr)!=runDependentRun)
continue;
2217 double pFactor =
t->eval(prescaleByRunAndLbn,runNbr,lbn,
this);
2224 bool firstFill=
false;
2226 if(
p.first !=
p.second->id)
continue;
2227 if(!
p.second->contains(runNbr))
continue;
2228 if(runDependentRun && firstFill)
continue;
2230 int idx = (runDependentRun) ? -runDependentRun :
p.second->id;
2233 auto& triggerHists =
t->triggerHists[
idx];
2234 std::unique_ptr<TH1>& histptr = triggerHists[tbits];
2237 if(
m_debugging &&
m_printInfo)
Info(
"CalculatePrescaledLuminosityHistograms",
"Created Data Weight Histogram for [%s,%d,%d,%ld]",
t->val.Data(),
p.first,
idx,tbits);
2241 else if(
m_unrepresentedDataAction==3 ) {histptr->Fill(triggerHists[tbits]->GetBinCenter(
p.second->inputBinRedirect[
bin]), intLumi*pFactor);}
2245 if(runDependentRun && fillUnprescaledLumi) {
2247 if(unprescaledLumi==0) {
2249 unprescaledLumi =
m_triggerObjs[
"None"]->triggerHists[-runDependentRun][0].get();
◆ CalculatePrescaledLuminosityHistograms()
void TPileupReweighting::CalculatePrescaledLuminosityHistograms |
( |
const TString & |
trigger, |
|
|
int |
run_dependent = 0 |
|
) |
| |
|
protectedinherited |
Definition at line 2086 of file TPileupReweighting.cxx.
2089 TString triggerCopy = trigger; triggerCopy.ReplaceAll(
" ",
""); triggerCopy.ReplaceAll(
"&&",
"&");triggerCopy.ReplaceAll(
"||",
"|");
2092 Error(
"GetDataWeight",
"Error parsing composite trigger set: %s",trigger.Data());
2093 throw std::runtime_error(
"Could not parse composite trigger");
2096 std::vector<TString> subTriggers;
2098 t->getTriggers(subTriggers);
2100 t->subTriggers = subTriggers;
◆ Class_Version()
static Version_t CP::PileupReweightingTool::Class_Version |
( |
| ) |
|
|
inlinestatic |
◆ CloneEmptyHistogram()
std::unique_ptr< TH1 > TPileupReweighting::CloneEmptyHistogram |
( |
Int_t |
runNumber, |
|
|
Int_t |
channelNumber |
|
) |
| |
|
protectedinherited |
Definition at line 435 of file TPileupReweighting.cxx.
438 if(channelNumber>=0) {
439 s +=
"_chan";
s += channelNumber;
446 Error(
"CloneEmptyHistogram",
"There is no binning info - use SetBinning/SetUniformBinning or load a prw config file (This usually means you need to call AddConfigFile BEFORE AddLumiCalcFile)");
447 throw std::runtime_error(
"Throwing 47: There is no binning info - use SetBinning/SetUniformBinning or load a prw config file (This usually means you need to call AddConfigFile BEFORE AddLumiCalcFile)");
453 out->SetDirectory(0);
◆ CopyProperties()
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ DisableWarnings()
void CP::TPileupReweighting::DisableWarnings |
( |
Bool_t |
in | ) |
|
|
inlineinherited |
◆ EnableDebugging()
void CP::TPileupReweighting::EnableDebugging |
( |
Bool_t |
in | ) |
|
|
inlineinherited |
Indicate if additional debugging information should be output.
Definition at line 118 of file TPileupReweighting.h.
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ expert()
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ fill() [1/2]
◆ fill() [2/2]
◆ Fill()
Int_t TPileupReweighting::Fill |
( |
Int_t |
runNumber, |
|
|
Int_t |
channelNumber, |
|
|
Float_t |
w, |
|
|
Float_t |
x, |
|
|
Float_t |
y = 0. |
|
) |
| |
|
inherited |
Definition at line 1837 of file TPileupReweighting.cxx.
1847 if(channelNumber>=0) {
1854 Error(
"Fill",
"Unrecognised runNumber: %d. Check your period configuration (AddPeriod or UsePeriodConfig)",
runNumber);
1855 throw std::runtime_error(
"Throwing 1: Unrecognised periodNumber");
1860 Error(
"Fill",
"Unrecognised runNumber: %d. Check your period configuration (AddPeriod or UsePeriodConfig) ... but should never have got here so please report this!",
runNumber);
1861 throw std::runtime_error(
"Throwing 1: Unrecognised periodNumber");
1863 std::unique_ptr<TH1>& histptr =
p->inputHists[channelNumber];
1868 hist = histptr.get();
1872 hist =
r.inputHists[
"None"].get();
1876 Error(
"Fill",
"Unknown [run,channel] = [%d,%d]",
runNumber,channelNumber);
1877 throw std::runtime_error(
"Throwing 45: Fill:: Unknown [run,channel] ");
1880 if(
hist->GetDimension()==1) {
1882 }
else if(
hist->GetDimension()==2) {
1883 return (
static_cast<TH2*
>(
hist))->Fill(
x,
y,
w);
◆ finalize()
StatusCode CP::PileupReweightingTool::finalize |
( |
| ) |
|
|
virtual |
Finalize - can call the WriteToFile for us.
Definition at line 299 of file PileupReweightingTool.cxx.
301 #ifndef XAOD_STANDALONE
304 std::string nameWithoutParent = this->
name().substr(this->
name().
find(
".")+1);
314 TTree *outTreeData=0;
316 std::vector<UInt_t> pStarts;
317 std::vector<UInt_t> pEnds;
318 std::vector<UInt_t>* pStartsPtr = &pStarts;
319 std::vector<UInt_t>* pEndsPtr = &pEnds;
325 if(!
period.second)
continue;
326 if(
period.first<0)
continue;
331 if(
period.second->subPeriods.size()==0) {
332 pStarts.push_back(
period.second->start); pEnds.push_back(
period.second->end);
335 for(
auto subp :
period.second->subPeriods) {
336 pStarts.push_back(subp->start); pEnds.push_back(subp->end);
339 for(
auto& inHist :
period.second->inputHists) {
341 TH1*
hist = inHist.second.release();
345 outTreeMC =
new TTree(
"MCPileupReweighting",
"MCPileupReweighting");
346 outTreeMC->Branch(
"Channel",&
channel);
347 outTreeMC->Branch(
"RunNumber",&
runNumber);
348 outTreeMC->Branch(
"PeriodStarts",&pStartsPtr);
349 outTreeMC->Branch(
"PeriodEnds",&pEndsPtr);
350 outTreeMC->Branch(
"HistName",&
histName,
"HistName/C");
360 if(
run.second.inputHists.find(
"None")==
run.second.inputHists.end())
continue;
362 TH1*
hist =
run.second.inputHists[
"None"].release();
366 outTreeData =
new TTree(
"DataPileupReweighting",
"DataPileupReweighting");
367 outTreeData->Branch(
"RunNumber",&
runNumber);
368 outTreeData->Branch(
"HistName",&
histName,
"HistName/C");
374 Info(
"WriteToFile",
"Successfully generated config file to stream: %s",
m_configStream.c_str());
375 Info(
"WriteToFile",
"Happy Reweighting :-)");
381 std::string nameWithoutParent = this->
name().substr(this->
name().
find(
".")+1);
389 return StatusCode::SUCCESS;
◆ GenerateMetaDataFile()
Int_t TPileupReweighting::GenerateMetaDataFile |
( |
const TString & |
fileName, |
|
|
const TString & |
channelBranchName = "mc_channel_number" |
|
) |
| |
|
inherited |
Definition at line 460 of file TPileupReweighting.cxx.
462 TTree inTree(
"in",
"in");
464 TTree outTree(
"ChannelMetaData",
"ChannelMetaData");
466 std::map<TString, Double_t>
data;
467 TObjArray *leaves = inTree.GetListOfLeaves();
468 if(leaves==0) {
Error(
"GenerateMetaDataFile",
"No leaves");
return -1; }
469 for(Int_t
i=0;
i<leaves->GetEntries();++
i) {
470 TLeaf *leaf = (TLeaf *)leaves->At(
i);
472 TBranch *
branch = leaf->GetBranch();
473 if(strcmp(
branch->GetName(),channelBranchName)==0) {
475 if(strcmp(leaf->GetTypeName(),
"Int_t")!=0) {
476 Error(
"GenerateMetaDataFile",
"Channel Branch must be type Int_t");
return -1;
479 outTree.Branch(channelBranchName,&
chanNum);
480 }
else if(strcmp(leaf->GetTypeName(),
"Double_t")!=0) {
481 Warning(
"GenerateMetaDataFile",
"Cannot read non-double branch: %s",
branch->GetName());
489 for(Int_t
i=0;
i<inTree.GetEntries();++
i) {
501 Info(
"GenerateMetaDataFile",
"Succesfully Generated File %s",
outName.Data());
◆ getCombinedWeight() [1/3]
float CP::PileupReweightingTool::getCombinedWeight |
( |
const xAOD::EventInfo & |
eventInfo, |
|
|
bool |
correctUnrepresented |
|
) |
| |
|
virtual |
◆ getCombinedWeight() [2/3]
float CP::PileupReweightingTool::getCombinedWeight |
( |
const xAOD::EventInfo & |
eventInfo, |
|
|
const TString & |
trigger, |
|
|
bool |
mu_dependent, |
|
|
bool |
correctUnrepresented |
|
) |
| |
|
virtual |
◆ getCombinedWeight() [3/3]
float CP::PileupReweightingTool::getCombinedWeight |
( |
const xAOD::EventInfo & |
eventInfo, |
|
|
Double_t |
x, |
|
|
Double_t |
y, |
|
|
bool |
correctUnrepresented |
|
) |
| |
|
virtual |
◆ GetCombinedWeight()
Float_t TPileupReweighting::GetCombinedWeight |
( |
Int_t |
periodNumber, |
|
|
Int_t |
channelNumber, |
|
|
Float_t |
x, |
|
|
Float_t |
y = 0. |
|
) |
| |
|
inherited |
Definition at line 1603 of file TPileupReweighting.cxx.
1605 if (
m_printInfo)
Info(
"GetCombinedWeight",
"Initializing the subtool..");
1613 Error(
"GetCombinedWeight",
"Tool not configured properly ... please report this!");
1614 throw std::runtime_error(
"Throwing 47: Tool not configured properly ... please report this!");
◆ getCorrectedActualInteractionsPerCrossing()
float CP::PileupReweightingTool::getCorrectedActualInteractionsPerCrossing |
( |
const xAOD::EventInfo & |
eventInfo, |
|
|
bool |
includeDataScaleFactor |
|
) |
| |
|
virtual |
◆ getCorrectedAverageInteractionsPerCrossing()
float CP::PileupReweightingTool::getCorrectedAverageInteractionsPerCrossing |
( |
const xAOD::EventInfo & |
eventInfo, |
|
|
bool |
includeDataScaleFactor |
|
) |
| |
|
virtual |
◆ getCorrectedMu()
virtual float CP::IPileupReweightingTool::getCorrectedMu |
( |
const xAOD::EventInfo & |
eventInfo, |
|
|
bool |
includedDataScaleFactor = false |
|
) |
| |
|
inlinevirtualinherited |
Get the corrected average mu of a lumiblock ...
(averaging is over all filled BCID in the fill) The additional flag indicates if the returned value should include the data scale factor or not. Note: if the lumiblock is not present in the input lumicalc file, then -1.0 will be returned This method will soon be deprecated in favour of the new naming: getCorrectedAverageInteractionsPerCrossing
Definition at line 61 of file IPileupReweightingTool.h.
◆ GetDataScaleFactor()
Float_t CP::TPileupReweighting::GetDataScaleFactor |
( |
| ) |
const |
|
inlineinherited |
◆ getDataWeight()
float CP::PileupReweightingTool::getDataWeight |
( |
const xAOD::EventInfo & |
eventInfo, |
|
|
const TString & |
trigger, |
|
|
bool |
mu_dependent |
|
) |
| |
|
virtual |
Get the dataWeight used to 'unprescale' data collected from a given trigger combination. mu_dependency is recommended to be true.
Implements CP::IPileupReweightingTool.
Definition at line 495 of file PileupReweightingTool.cxx.
498 ATH_MSG_WARNING(
"Requesting Data Weight is not intended for simulated events. Returning 1.");
506 ATH_MSG_ERROR(
"Unrecognised run+lumiblock number (" << eventInfo.
runNumber() <<
"," << eventInfo.
lumiBlock() <<
") ... please ensure your lumicalc files are complete! Returning 1.");
◆ GetDataWeight() [1/2]
Double_t TPileupReweighting::GetDataWeight |
( |
Int_t |
runNumber, |
|
|
const TString & |
trigger |
|
) |
| |
|
inherited |
◆ GetDataWeight() [2/2]
Double_t TPileupReweighting::GetDataWeight |
( |
Int_t |
runNumber, |
|
|
const TString & |
trigger, |
|
|
Double_t |
x, |
|
|
bool |
run_dependent = false |
|
) |
| |
|
inherited |
Method for weighting data to account for prescales and mu bias.
Use by giving the tool multiple lumicalc files, one for each trigger
Definition at line 1730 of file TPileupReweighting.cxx.
1743 Error(
"GetDataWeight",
"Unrecognised periodNumber: %d",periodNumber);
1744 throw std::runtime_error(
"Throwing 1: Unrecognised periodNumber");
1762 if(tobj->second->triggerHists.find(
p->id) == tobj->second->triggerHists.end()) {
1763 Error(
"GetDataWeight",
"Could not find trigger %s in period %d",trigger.Data(),
p->id);
1764 throw std::runtime_error(
"GetDataWeight: Could not find trigger 1");
1769 long tbits = tobj->second->getBits(
this);
1771 if(tbits==0)
return 1;
1776 auto dItr = tobj->second->triggerHists[
idx].find(tbits);
1779 if(dItr == tobj->second->triggerHists[
idx].end()) {
1783 denomHist = tobj->second->triggerHists[
idx][tbits].get();
1785 Error(
"GetDataWeight",
"Could not find trigger %s in period %d with bits %ld",trigger.Data(),
idx, tbits);
1786 throw std::runtime_error(
"GetDataWeight: Could not find trigger 2");
1789 denomHist = dItr->second.get();
1795 Error(
"GetDataWeight",
"Could not find unprescaled trigger in period %d",
idx);
1796 throw std::runtime_error(
"GetDataWeight: Could not find unprescaled trigger. Please AddLumiCalc with a 'None' trigger");
1799 if(
m_doGlobalDataWeight)
return numerHist->Integral(0,numerHist->GetNbinsX()+1)/denomHist->Integral(0,denomHist->GetNbinsX()+1);
1807 if(!denomHist->GetBinContent(
bin)) {
1809 Error(
"GetDataWeight",
"Unrecognised mu value %f ... are you sure you included all lumicalc files",
x);
1810 throw std::runtime_error(
"GetDataWeight: Unrecognised mu value. Please AddLumiCalc enough lumi with 'None' trigger");
1813 return numerHist->GetBinContent(
bin)/denomHist->GetBinContent(
bin);
◆ GetDefaultChannel()
Int_t TPileupReweighting::GetDefaultChannel |
( |
Int_t |
mcRunNumber = -1 | ) |
|
|
inherited |
◆ GetFirstFoundPeriodNumber()
Int_t TPileupReweighting::GetFirstFoundPeriodNumber |
( |
UInt_t |
runNumber | ) |
|
|
inherited |
Get the first period number with the data run number contained - assume all periods are disconnected for this to be useful.
Definition at line 422 of file TPileupReweighting.cxx.
426 if(
period.second->id==-1)
continue;
◆ GetInputHistogram()
TH1* CP::TPileupReweighting::GetInputHistogram |
( |
Int_t |
channelNumber, |
|
|
Int_t |
periodNumber |
|
) |
| |
|
inlineinherited |
◆ GetIntegratedLumi() [1/3]
virtual Double_t CP::PileupReweightingTool::GetIntegratedLumi |
( |
const TString & |
trigger | ) |
|
|
inlinevirtual |
◆ GetIntegratedLumi() [2/3]
virtual Double_t CP::PileupReweightingTool::GetIntegratedLumi |
( |
Int_t |
periodNumber, |
|
|
UInt_t |
start, |
|
|
UInt_t |
end |
|
) |
| |
|
inlinevirtual |
◆ GetIntegratedLumi() [3/3]
virtual Double_t CP::PileupReweightingTool::GetIntegratedLumi |
( |
UInt_t |
start, |
|
|
UInt_t |
end |
|
) |
| |
|
inlinevirtual |
◆ GetIntegratedLumiFraction() [1/2]
virtual Double_t CP::PileupReweightingTool::GetIntegratedLumiFraction |
( |
Int_t |
periodNumber, |
|
|
Double_t |
mu, |
|
|
UInt_t |
start, |
|
|
UInt_t |
end |
|
) |
| |
|
inlinevirtual |
◆ GetIntegratedLumiFraction() [2/2]
virtual Double_t CP::PileupReweightingTool::GetIntegratedLumiFraction |
( |
Int_t |
periodNumber, |
|
|
UInt_t |
start, |
|
|
UInt_t |
end |
|
) |
| |
|
inlinevirtual |
◆ getKey()
Get the (hashed) key of an object that is in the event store.
This is a bit of a special one. StoreGateSvc
and xAOD::TEvent
both provide ways for getting the SG::sgkey_t
key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.
In order to allow tools to efficiently perform this operation, they can use this helper function.
- See also
- asg::AsgTool::getName
- Parameters
-
ptr | The bare pointer to the object that the event store should know about |
- Returns
- The hashed key of the object in the store. If not found, an invalid (zero) key.
Definition at line 119 of file AsgTool.cxx.
121 #ifdef XAOD_STANDALONE
127 return (
proxy ==
nullptr ? 0 :
proxy->sgkey() );
128 #endif // XAOD_STANDALONE
◆ getLumiBlockIntegratedLumi()
◆ GetLumiBlockIntegratedLumi()
Double_t TPileupReweighting::GetLumiBlockIntegratedLumi |
( |
Int_t |
runNumber, |
|
|
UInt_t |
lb |
|
) |
| |
|
inherited |
get integrated lumi for specific run and lumiblock number .
. comes from the 'unprescaled lumi', and is in pb
Definition at line 154 of file TPileupReweighting.cxx.
157 Info(
"GetIntegratedLumi",
"Initializing the subtool..");
164 if(
run.lumiByLbn.find(
lb)==
run.lumiByLbn.end())
return 0.;
165 return run.lumiByLbn[
lb].first*1
E-6;
◆ GetLumiBlockMu()
Float_t TPileupReweighting::GetLumiBlockMu |
( |
Int_t |
runNumber, |
|
|
UInt_t |
lb |
|
) |
| |
|
inherited |
get the lumiblock mu, useful for 'updating' the mu coming from data to account for new lumitags
Definition at line 168 of file TPileupReweighting.cxx.
171 Info(
"GetLumiBlockMu",
"Initializing the subtool..");
178 if(
run.lumiByLbn.find(
lb)==
run.lumiByLbn.end())
return -1.0;
179 return run.lumiByLbn[
lb].second;
◆ GetMetaData()
Double_t CP::TPileupReweighting::GetMetaData |
( |
const TString & |
metadataName, |
|
|
Int_t |
channelNumber |
|
) |
| |
|
inlineinherited |
Definition at line 188 of file TPileupReweighting.h.
190 Error(
"GetMetaData",
"Metadata %s not known",metadataName.Data());
194 Error(
"GetMetaData",
"Metadata %s not known in channel %d",metadataName.Data(), channelNumber);
197 return m_metadata[metadataName][channelNumber];
◆ GetMetaDataTree()
TTree * TPileupReweighting::GetMetaDataTree |
( |
| ) |
|
|
inherited |
combines loaded metadata with channel sumsofweights and entry counts
Definition at line 574 of file TPileupReweighting.cxx.
576 m_metadatatree =
new TTree(TString(this->GetName())+
"MetaData",TString(this->GetName())+
"MetaData");
580 std::map<TString,Double_t>
data;
587 const auto &[
ptr, inserted ] =
data.try_emplace(
it->first, 0.);
593 data[
"NumberOfEvents"]=0.;
595 data[
"SumOfEventWeights"]=0.;
598 auto& myMap =
m_periods[-1]->sumOfWeights;
607 if(it2->first==
"NumberOfEvents") {
609 if(myMap.find(
channel)==myMap.end()) {
611 Warning(
"GetMetaDataTree",
"Channel %d does not have MetaData %s",
it->first,(it2->first).Data());
615 }
else if(it2->first==
"SumOfEventWeights") {
617 auto& myMap2 =
m_periods[-1]->sumOfWeights;
618 if(myMap2.find(
channel)==myMap2.end()) {
620 Warning(
"GetMetaDataTree",
"Channel %d does not have MetaData %s",
it->first,(it2->first).Data());
626 if(myMap2.find(
channel)==myMap2.end()) {
629 Warning(
"GetMetaDataTree",
"Channel %d does not have MetaData %s",
it->first,(it2->first).Data());
◆ getName()
const std::string & asg::AsgTool::getName |
( |
const void * |
ptr | ) |
const |
|
inherited |
Get the name of an object that is / should be in the event store.
This is a bit of a special one. StoreGateSvc
and xAOD::TEvent
both provide ways for getting the std::string
name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.
In order to allow tools to efficiently perform this operation, they can use this helper function.
- See also
- asg::AsgTool::getKey
- Parameters
-
ptr | The bare pointer to the object that the event store should know about |
- Returns
- The string name of the object in the store. If not found, an empty string.
Definition at line 106 of file AsgTool.cxx.
108 #ifdef XAOD_STANDALONE
114 static const std::string
dummy =
"";
116 #endif // XAOD_STANDALONE
◆ GetNearestGoodBin()
Int_t TPileupReweighting::GetNearestGoodBin |
( |
Int_t |
thisMCRunNumber, |
|
|
Int_t |
bin |
|
) |
| |
|
protectedinherited |
Definition at line 1367 of file TPileupReweighting.cxx.
1369 int binDistance = 1;
1371 int res1 =
IsBadBin(thisMCRunNumber,
bin+binDistance);
1372 if(!res1)
return bin+binDistance;
1373 int res2 =
IsBadBin(thisMCRunNumber,
bin-binDistance);
1374 if(!res2)
return bin-binDistance;
1375 if(res1==2 && res2==2) {
1376 Error(
"GetNearestGoodBin",
"None of the bins are good!!??");
◆ GetNumberOfEvents()
virtual Double_t CP::PileupReweightingTool::GetNumberOfEvents |
( |
Int_t |
channel | ) |
|
|
inlinevirtual |
◆ GetPeriodNumbers()
std::vector<int> CP::TPileupReweighting::GetPeriodNumbers |
( |
| ) |
const |
|
inlineinherited |
◆ GetPeriodWeight()
Float_t TPileupReweighting::GetPeriodWeight |
( |
Int_t |
periodNumber, |
|
|
Int_t |
channelNumber |
|
) |
| |
|
inherited |
Definition at line 1623 of file TPileupReweighting.cxx.
1626 if (
m_printInfo)
Info(
"GetPeriodWeight",
"Initializing the subtool..");
1633 Error(
"GetPeriodWeight",
"Unrecognised periodNumber: %d",periodNumber);
1634 throw std::runtime_error(
"Throwing 1: Unrecognised periodNumber");
1636 if(
p->sumOfWeights.find(channelNumber) ==
p->sumOfWeights.end()) {
1638 if(channelNumber!=0) {
1639 Warning(
"GetPeriodWeight",
"You're using a default config file ... you're gonna have a bad time!!");
1640 Warning(
"GetPeriodWeight",
"Please generate proper config files!");
1644 double n_a =
p->sumOfWeights[channelNumber];
1645 double n =
m_periods[-1]->sumOfWeights[channelNumber];
1647 double l_a =
p->sumOfWeights[-1];
1650 return (l_a/
l) / (n_a/
n);
◆ getPrescaleWeight()
float CP::PileupReweightingTool::getPrescaleWeight |
( |
const xAOD::EventInfo & |
eventInfo, |
|
|
const TString & |
trigger, |
|
|
bool |
mu_dependent |
|
) |
| |
|
virtual |
◆ GetPrescaleWeight() [1/2]
Double_t TPileupReweighting::GetPrescaleWeight |
( |
Int_t |
runNumber, |
|
|
const TString & |
trigger |
|
) |
| |
|
inherited |
◆ GetPrescaleWeight() [2/2]
Double_t TPileupReweighting::GetPrescaleWeight |
( |
Int_t |
runNumber, |
|
|
const TString & |
trigger, |
|
|
Double_t |
x, |
|
|
bool |
run_dependent = false |
|
) |
| |
|
inherited |
◆ GetPrimaryDistribution()
TH1* CP::TPileupReweighting::GetPrimaryDistribution |
( |
Int_t |
channelNumber, |
|
|
Int_t |
periodNumber |
|
) |
| |
|
inlineinherited |
◆ GetPrimaryTriggerDistribution()
TH1* CP::TPileupReweighting::GetPrimaryTriggerDistribution |
( |
const TString & |
trigger, |
|
|
Int_t |
periodNumber, |
|
|
long |
triggerBits |
|
) |
| |
|
inlineinherited |
◆ GetPrimaryWeight()
Float_t TPileupReweighting::GetPrimaryWeight |
( |
Int_t |
periodNumber, |
|
|
Int_t |
channelNumber, |
|
|
Float_t |
x |
|
) |
| |
|
inherited |
Definition at line 1653 of file TPileupReweighting.cxx.
1656 if (
m_printInfo)
Info(
"GetPrimaryWeight",
"Initializing the subtool..");
1663 Error(
"GetPrimaryWeight",
"Unrecognised periodNumber: %d",periodNumber);
1664 throw std::runtime_error(
"Throwing 1: Unrecognised periodNumber");
1666 int oChanNumber = channelNumber;
1667 if(
p->sumOfWeights.find(channelNumber) ==
p->sumOfWeights.end()) channelNumber =
GetDefaultChannel(periodNumber);
1669 if(!
p->primaryHists[channelNumber]) {
1670 Error(
"GetPrimaryWeight",
"Unrecognised channelNumber %d for periodNumber %d",oChanNumber,periodNumber);
1671 throw std::runtime_error(
"Throwing 2: Unrecognised channelNumber");
1674 int bin =
p->primaryHists[channelNumber]->FindFixBin(
x);
1676 double n =
p->primaryHists[channelNumber]->GetBinContent(
bin);
1682 Warning(
"GetPrimaryWeight",
"No events expected in channelNumber %d for periodNumber %d with x=%g. Incorrect PRW profile or are you very unlucky???",channelNumber,periodNumber,
x);
1686 if(!
p->primaryHists[-1]) {
1687 Error(
"GetPrimaryWeight",
"No data loaded for period %d. Did you forget to load a lumicalc file or data config file?",periodNumber);
1688 throw std::runtime_error(
"Throwing 3: No data loaded. Did you forget to load a lumicalc file or data config file?");
1691 double l =
p->primaryHists[-1]->GetBinContent(
bin);
1694 Error(
"GetPrimaryWeight",
"No events expected with this mu. Incorrect PRW profile? Throwing exception ...");
1695 throw std::runtime_error(Form(
"Incorrect PRW profile detected. x=%g is not in the config file profile for channel %d, period %d",
x, channelNumber, periodNumber ));
◆ getProperty()
template<class T >
const T* asg::AsgTool::getProperty |
( |
const std::string & |
name | ) |
const |
|
inherited |
Get one of the tool's properties.
◆ getPRWHash()
◆ GetPRWHash()
ULong64_t TPileupReweighting::GetPRWHash |
( |
Int_t |
periodNumber, |
|
|
Int_t |
channelNumber, |
|
|
Float_t |
x, |
|
|
Float_t |
y = 0. |
|
) |
| |
|
inherited |
Definition at line 1584 of file TPileupReweighting.cxx.
1591 Error(
"GetPRWHash",
"Tool not configured properly ... please report this!");
1592 throw std::runtime_error(
"Throwing 47: Tool not configured properly ... please report this!");
1596 out += (
unsigned long)(channelNumber)*10000000000;
1597 out += (
unsigned long)(periodNumber)*10000;
◆ GetRandomLumiBlockNumber()
virtual UInt_t CP::PileupReweightingTool::GetRandomLumiBlockNumber |
( |
UInt_t |
runNumber | ) |
|
|
inlinevirtual |
◆ GetRandomPeriodNumber()
Int_t TPileupReweighting::GetRandomPeriodNumber |
( |
Int_t |
mcRunNumber | ) |
|
|
inherited |
Get random period number from the sub-periods assigned to this run number.
Definition at line 1492 of file TPileupReweighting.cxx.
1494 if (
m_printInfo)
Info(
"GetRandomPeriodNumber",
"Initializing the subtool..");
1501 Error(
"GetRandomPeriodNumber",
"Unrecognised periodNumber: %d",periodNumber);
1502 throw std::runtime_error(
"Throwing 1: Unrecognised periodNumber");
1506 if(
p->subPeriods.size()==0)
return p->id;
1513 for(
auto subp :
p->subPeriods) {
1514 lumiSum += subp->sumOfWeights[-1];
1515 if(lumiSum >=
lumi)
return subp->id;
1518 Error(
"GetRandomPeriodNumber",
"overran integrated luminosity for periodNumber=%d",periodNumber);
1519 throw std::runtime_error(
"Throwing 46.1: overran integrated luminosity for GetRandomPeriodNumber");
◆ getRandomRunNumber()
int CP::PileupReweightingTool::getRandomRunNumber |
( |
const xAOD::EventInfo & |
eventInfo, |
|
|
bool |
mu_dependent |
|
) |
| |
|
virtual |
Get a random run number for this MC event, using mu-dependent randomization by default ... jetetmiss seem to like it muchly.
Get a random run number for this MC event, mu_dependency is not recommended for this.
Implements CP::IPileupReweightingTool.
Definition at line 418 of file PileupReweightingTool.cxx.
422 else return tool->GetRandomRunNumber( eventInfo.
runNumber() );
◆ GetRandomRunNumber() [1/2]
UInt_t TPileupReweighting::GetRandomRunNumber |
( |
Int_t |
mcRunNumber | ) |
|
|
inherited |
Gets a random data run number according to the integrated lumi distribution associated to this mcRunNumber.
allows use of custom reweighting config files
Definition at line 1412 of file TPileupReweighting.cxx.
1414 if (
m_printInfo)
Info(
"GetRandomRunNumber",
"Initializing the subtool..");
1420 if(!
p || !
p->primaryHists[-1]) {
1421 Error(
"GetRandomRunNumber",
"Unrecognised periodNumber or no data loaded for: %d",periodNumber);
1422 throw std::runtime_error(
"Throwing 1: Unrecognised periodNumber");
1429 for(
auto runNum :
p->runNumbers) {
1430 lumiSum +=
m_runs[
runNum].inputHists[
"None"]->GetSumOfWeights();
1433 Error(
"GetRandomRunNumber",
"overran integrated luminosity for periodNumber=%d (%f vs %f)",periodNumber,lumiSum,
lumi);
1434 throw std::runtime_error(
"Throwing 46.1: overran integrated luminosity for GetRandomRunNumber");
◆ GetRandomRunNumber() [2/2]
UInt_t TPileupReweighting::GetRandomRunNumber |
( |
Int_t |
mcRunNumber, |
|
|
Double_t |
mu |
|
) |
| |
|
inherited |
Get random run number according to integrated lumi distribution for the given mu value (uses the binning of the mu histogram)
Definition at line 1438 of file TPileupReweighting.cxx.
1440 if (
m_printInfo)
Info(
"GetRandomRunNumber",
"Initializing the subtool..");
1446 if(!
p || !
p->primaryHists[-1]) {
1447 Error(
"GetRandomRunNumber",
"Unrecognised periodNumber or no data loaded for: %d",periodNumber);
1448 throw std::runtime_error(
"Throwing 1: Unrecognised periodNumber");
1453 double lumi =
p->primaryHists[-1]->GetBinContent(
bin) *
p->sumOfWeights[-1] *
m_random3->Rndm();
1455 if(!
lumi) {
return 0; }
1460 for(
auto runNum :
p->runNumbers) {
1464 Error(
"GetRandomRunNumber",
"overran integrated luminosity for periodNumber=%d (%f vs %f)",periodNumber,lumiSum,
lumi);
1465 throw std::runtime_error(
"Throwing 46.1: overran integrated luminosity for GetRandomRunNumber");
◆ GetRandomSeed()
int CP::TPileupReweighting::GetRandomSeed |
( |
| ) |
|
|
inlineinherited |
◆ GetRunAverageMu()
double CP::TPileupReweighting::GetRunAverageMu |
( |
int |
run | ) |
|
|
inlineinherited |
◆ GetRunMap()
std::map<UInt_t, Run>& CP::TPileupReweighting::GetRunMap |
( |
| ) |
|
|
inlineinherited |
◆ GetSecondaryWeight()
Float_t TPileupReweighting::GetSecondaryWeight |
( |
Int_t |
periodNumber, |
|
|
Int_t |
channelNumber, |
|
|
Float_t |
x, |
|
|
Float_t |
y |
|
) |
| |
|
inherited |
Definition at line 1701 of file TPileupReweighting.cxx.
1704 if (
m_printInfo)
Info(
"GetSecondaryWeight",
"Initializing the subtool..");
1711 Error(
"GetSecondaryWeight",
"Unrecognised periodNumber: %d",periodNumber);
1712 throw std::runtime_error(
"Throwing 1: Unrecognised periodNumber");
1714 if(
p->sumOfWeights.find(channelNumber) ==
p->sumOfWeights.end()) channelNumber =
GetDefaultChannel(periodNumber);
1715 int bin =
p->secondaryHists[channelNumber]->FindFixBin(
x,
y);
1716 double n =
p->secondaryHists[channelNumber]->GetBinContent(
bin);
1717 double l =
p->secondaryHists[-1]->GetBinContent(
bin);
◆ GetSumOfEventWeights()
virtual Double_t CP::PileupReweightingTool::GetSumOfEventWeights |
( |
Int_t |
channel | ) |
|
|
inlinevirtual |
◆ GetUnrepresentedDataFraction()
Double_t TPileupReweighting::GetUnrepresentedDataFraction |
( |
Int_t |
periodNumber, |
|
|
Int_t |
channel |
|
) |
| |
|
inherited |
return the unrepresented data fraction in a given channel .
. when using action=2, you will want to scale up all MC events by 1/(1-unrepFraction) to account for missed data
Definition at line 1386 of file TPileupReweighting.cxx.
1393 Error(
"GetUnrepresentedDataFraction",
"Unrecognised periodNumber: %d",periodNumber);
1394 throw std::runtime_error(
"Throwing 1: Unrecognised periodNumber");
1401 if(
p->sumOfWeights.find(
channel) ==
p->sumOfWeights.end()) {
1402 Error(
"GetUnrepresentedDataFraction",
"Unrecognised channel: %d",
channel);
1403 throw std::runtime_error(
"GetUnrepresentedDataFraction: Unrecognised channel");
1406 return p->unrepData[
channel]/
p->sumOfWeights[-1];
◆ getUnrepresentedDataWeight()
◆ GetUnrepresentedDataWeight()
Float_t CP::TPileupReweighting::GetUnrepresentedDataWeight |
( |
Int_t |
periodNumber, |
|
|
Int_t |
channel |
|
) |
| |
|
inlineinherited |
Definition at line 134 of file TPileupReweighting.h.
136 Warning(
"GetUnrepresentedDataWeight",
"You should not be applying this weight unless the UnrepresentedDataAction=2");
◆ IgnoreConfigFilePeriods()
void CP::TPileupReweighting::IgnoreConfigFilePeriods |
( |
Bool_t |
in | ) |
|
|
inlineinherited |
Should the tool ignore period assignments encoded in config file.
Definition at line 146 of file TPileupReweighting.h.
◆ initialize()
StatusCode CP::PileupReweightingTool::initialize |
( |
| ) |
|
|
virtual |
Function initialising the tool.
Reimplemented from asg::AsgTool.
Definition at line 169 of file PileupReweightingTool.cxx.
176 std::vector<std::vector<int>> customPeriods;
178 if(customPeriods.size()==0 || customPeriods.back().size()==3) customPeriods.resize(customPeriods.size()+1);
179 customPeriods.back().push_back(
num);
182 for(
auto&
period : customPeriods) {
184 ATH_MSG_FATAL(
"Recevied period with " <<
period.size() <<
" numbers. Period configuration requires 3 numbers: periodNumber, startNumber, endNumber");
185 return StatusCode::FAILURE;
218 #ifndef XAOD_STANDALONE
235 for(
unsigned int j=0;j<
m_prwFiles.size();j++) {
248 ATH_MSG_INFO(
"Setting up without a PRW config file, but with period config " <<
m_usePeriodConfig <<
". You will only be able to use random run number and data weight functionality... no reweighting!");
280 if(
registry.registerSystematics( *
this ) != StatusCode::SUCCESS )
return StatusCode::FAILURE;
287 if (
sc != StatusCode::SUCCESS) {
296 return StatusCode::SUCCESS;
◆ Initialize()
Int_t TPileupReweighting::Initialize |
( |
| ) |
|
|
inherited |
Initialize this class once before the event loop starts If distribution information is provided, it is assumed to be for the standard pileup reweighting.
Definition at line 1021 of file TPileupReweighting.cxx.
1034 Info(
"Initialize",
"In Config File Generating mode. Remember to call WriteToFile!");
1038 if(
period.second->subPeriods.size()!=0) {
1039 Error(
"Initialize",
"You cannot have subperiods when in Config File Generating mode");
1040 throw std::runtime_error(
"Throwing 44: In Config File Generating mode, but detected subperiods in the period definition. This is not allowed.");
1051 std::map<int,std::map<int,bool>> trackWarnings;
1053 double totalData(0);
1056 if(
run.second.inputHists.find(
"None") ==
run.second.inputHists.end())
continue;
1057 TH1*
hist =
run.second.inputHists[
"None"].get();
1058 Int_t
bin,binx,biny;
1059 for(biny=1; biny<=
hist->GetNbinsY(); biny++) {
1060 for(binx=1; binx<=
hist->GetNbinsX(); binx++) {
1061 bin =
hist->GetBin(binx,biny);
1064 if(
value==0.)
continue;
1065 bool isUnrep(
false);
1066 std::map<Int_t, bool> doneChannels;
1069 if(
period.first == -1)
continue;
1070 if(!
period.second->contains(
run.first))
continue;
1071 for(
auto& inHist :
m_periods[-1]->inputHists) {
1072 if(inHist.first<0)
continue;
1073 if(doneChannels[inHist.first])
continue;
1074 if(
period.second->inputHists.find(inHist.first)==
period.second->inputHists.end()) {
1076 isUnrep=
true;doneChannels[inHist.first]=
true;
1078 if(!trackWarnings[inHist.first][
period.first]) {
1079 trackWarnings[inHist.first][
period.first]=
true;
1080 Warning(
"Initialize",
"Channel %d has no configuration for period %d -- this is symptomatic of you trying to reweight an MC campaign to data not intended for that campaign (e.g. MC16a with 2017 data)",inHist.first,
period.first);
1082 }
else if(
period.second->inputHists[inHist.first]->GetBinContent(
bin)==0) {
1084 isUnrep=
true;doneChannels[inHist.first]=
true;
1095 Warning(
"Initialize",
"There is %f%% unrepresented data and 'IgnoreBadChannels' property is set to true. Will start ignoring channels until this is below the tolerance (%f%%)", 100.*(
unrepDataByChannel[-1]/totalData),100.*
m_unrepDataTolerance);
1098 int worstChannel = -1;
1099 double worstFraction = 0;
1102 if(
channel.second/totalData > worstFraction) { worstChannel=
channel.first; worstFraction =
channel.second/totalData; }
1104 if(worstChannel==-1) {
1105 Error(
"Initialize",
"Run out of channels to remove. All your channels are bad ... oh dear oh dear oh dear. Please a better PRW config file");
1106 throw std::runtime_error(
"Throwing exception 333: Run out of channels to remove. All your channels are bad ... oh dear oh dear oh dear. Please a better PRW config file");
1117 if(
run.second.inputHists.find(
"None") ==
run.second.inputHists.end())
continue;
1118 TH1*
hist =
run.second.inputHists[
"None"].get();
1119 Int_t
bin,binx,biny;
1120 for(biny=1; biny<=
hist->GetNbinsY(); biny++) {
1121 for(binx=1; binx<=
hist->GetNbinsX(); binx++) {
1122 bin =
hist->GetBin(binx,biny);
1124 if(
value==0.)
continue;
1127 if(!
period.second->contains(
run.first))
continue;
1129 for(
auto& inHist :
period.second->inputHists) {
1130 if(inHist.first<0)
continue;
1131 if((inHist.second)->GetBinContent(
bin)==0) {
1145 m_triggerObjs[
"None"] = std::make_unique< CompositeTrigger >();
1150 for(
auto& inputHist :
period.second->inputHists) {
1151 int channel = inputHist.first;
1152 TH1*
hist = inputHist.second.get();
1155 if(
hist->GetDimension()==1) {
1162 if(!
period.second->contains(
run.first))
continue;
1163 if(
run.second.inputHists.find(
"None") ==
run.second.inputHists.end())
continue;
1165 period.second->runNumbers.push_back(
run.first);
1166 TH1*
hist =
run.second.inputHists[
"None"].get();
1169 Int_t
bin,binx,biny;
1170 for(biny=1; biny<=
hist->GetNbinsY(); biny++) {
1171 for(binx=1; binx<=
hist->GetNbinsX(); binx++) {
1172 bin =
hist->GetBin(binx,biny);
1174 if(
value==0.)
continue;
1176 if(
period.second->inputBinRedirect.find(
bin) ==
period.second->inputBinRedirect.end()) {
1177 for(
auto& inputHist :
period.second->inputHists) {
1178 if(inputHist.first<0)
continue;
1179 Double_t mcValue = (inputHist.second)->GetBinContent(
bin);
1182 Info(
"Initialize",
"Unrepresented data at coords [%f,%f] caused by periodNumber %d in channel %d",
hist->GetXaxis()->GetBinCenter(binx),
hist->GetYaxis()->GetBinCenter(biny),
period.first,inputHist.first);
1185 if(
m_unrepresentedDataAction==0) {
period.second->inputBinRedirect[
bin] =
bin-1;
Error(
"Initialize",
"Unrepresented data at coords [%f,%f] caused by periodNumber %d in channel %d",
hist->GetXaxis()->GetBinCenter(binx),
hist->GetYaxis()->GetBinCenter(biny),
period.first,inputHist.first);}
1191 if(
period.second->inputBinRedirect.find(
bin) ==
period.second->inputBinRedirect.end())
period.second->inputBinRedirect[
bin] =
bin;
1200 for(
auto& triggerDists :
run.second.inputHists) triggerDists.second->SetBinContent(
bin,0);
1206 for(
auto& triggerDists :
run.second.inputHists) {
1207 triggerDists.second->SetBinContent(
period.second->inputBinRedirect[
bin],triggerDists.second->GetBinContent(
period.second->inputBinRedirect[
bin])+triggerDists.second->GetBinContent(
bin));
1208 triggerDists.second->SetBinContent(
bin,0);
1216 if(
run.second.nominalFromHists) {
1219 for(
auto lb :
run.second.lumiByLbn) {
1220 totLumi +=
lb.second.first;
1230 if(
hist->GetDimension()==1 ) {
1231 if(!
period.second->primaryHists[-1] ) {
1239 else if(
hist->GetDimension()==2 ) {
1240 if(!
period.second->secondaryHists[-1] ) {
1242 period.second->secondaryHists[-1].reset(
dynamic_cast< TH2*
>(
h.release() ) );
1243 period.second->primaryHists[-1].reset(
1244 period.second->secondaryHists[-1]->ProjectionX() );
1245 period.second->primaryHists[-1]->SetDirectory(0);
1246 period.second->primaryHists[-1]->Reset();
1248 static_cast<TH1*
>(
period.second->primaryHists[-1]->Clone(
"triggerHist")) );
1262 double ignoredData(0);
1264 bool covered(
false);
1265 TH1*
hist =
run.second.inputHists[
"None"].get();
1267 if(!
period.second->contains(
run.first))
continue;
1268 if(
period.first!=-1) covered=
true;
1269 if(
hist->GetDimension()==1) {
1272 }
else if(
hist->GetDimension()==2) {
1273 period.second->secondaryHists[-1]->Add(
hist);
1274 TH1*
proj = ((TH2*)
hist)->ProjectionX();
1279 period.second->sumOfWeights[-1] +=
hist->GetSumOfWeights();
1280 period.second->numberOfEntries[-1] +=
hist->GetEntries();
1283 Warning(
"Initialize",
"loaded data in run %d that is not covered by period assignments",
run.first);
1284 ignoredData +=
hist->GetSumOfWeights();
1289 if(ignoredData>0.) Warning(
"Initialize",
"Period Assignments missed %f%% data",100.*ignoredData/totalData);
1296 Error(
"Initialize",
"%f%% unrepresented data, which suggests something is wrong with your prw config. Try EnableDebugging(true) to investigate",100.* (
unrepDataByChannel[-1]/totalData));
1299 Warning(
"Initialize",
"has %f%% unrepresented data. This was removed (UnrepresentedDataAction=1)",100.*
frac);
1301 Warning(
"Initialize",
"has %f%% unrepresented data. This was kept in (UnrepresentedDataAction=2)",100.*
frac);
1303 Warning(
"Initialize",
"has %f%% unrepresented data. This was reassigned (UnrepresentedDataAction=3)",100.*
frac);
1305 Error(
"Initialize",
"has %f%% unrepresented data:",100.*
frac);
1308 if(
it.first<0)
continue;
1311 Error(
"Initialize",
"Exiting. You must decide how to proceed...");
1312 Error(
"Initialize",
"1) use AddPeriod or RemapPeriod to redefine the mc periods to include this data. You should not need to regenerate your mc config file");
1313 Error(
"Initialize",
"2) use SetUnrepresentedDataAction(1) to remove this data from the weight calculations. You should also veto such data events (using IsUnrepresentedData(..,..) method)");
1314 Error(
"Initialize",
"3) use SetUnrepresentedDataAction(2) to leave this data in the calculation. I hope you know what you're doing!!");
1315 Error(
"Initialize",
"4) use SetUnrepresentedDataAction(3) to reassign the data to the nearest representable bin");
1316 throw std::runtime_error(
"Throwing exception 22: Unrepresented data exists. Make a choice how to handle this. See err log for details");
1320 throw std::runtime_error(
"Throwing exception 222: Some channel had too much unrepresented data. You should fix your prw file");
1329 for(
auto& pHist :
period.second->primaryHists) {
1332 for(
auto& pHist :
period.second->secondaryHists) {
1335 period.second->inputHists.clear();
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ isAffectedBySystematic()
◆ IsBadBin()
Int_t TPileupReweighting::IsBadBin |
( |
Int_t |
thisMCRunNumber, |
|
|
Int_t |
bin |
|
) |
| |
|
protectedinherited |
Definition at line 1351 of file TPileupReweighting.cxx.
1356 for(
auto& inHist :
p->inputHists) {
1357 int channelNumber = inHist.first;
1358 if(channelNumber<0)
continue;
1359 if(
bin > (inHist.second->GetNbinsX()+2)*(inHist.second->GetNbinsY()+2)*(inHist.second->GetNbinsZ()+2))
return 2;
1360 if(inHist.second->GetBinContent(
bin)==0)
return 1;
◆ IsInitialized()
Bool_t CP::TPileupReweighting::IsInitialized |
( |
| ) |
|
|
inlineinherited |
◆ IsUnrepresentedData()
Bool_t TPileupReweighting::IsUnrepresentedData |
( |
Int_t |
runNumber, |
|
|
Float_t |
x, |
|
|
Float_t |
y = 0. |
|
) |
| |
|
inherited |
◆ makeTrigger()
Definition at line 2278 of file TPileupReweighting.cxx.
2281 Info(
"makeTrigger",
"Doing %s",
s.Data() );
2286 std::unique_ptr< CompositeTrigger > cOper1;
2287 if(
s.BeginsWith(
"(" ) ) {
2289 int bCounter=1;
int i=1;
2290 while( ( bCounter != 0 ) && (
i <=
s.Length() ) ) {
2291 if(
s(
i ) ==
'(' ) {
2293 }
else if(
s(
i ) ==
')' ) {
2298 if( bCounter != 0 ) {
2299 Error(
"makeTrigger",
"Missing closing bracket" );
2300 return std::unique_ptr< CompositeTrigger >();
2302 oper1 =
s( 1,
i - 2 );
2303 if(
i ==
s.Length() + 1 ) {
2315 int i=0;
int bCounter=0;
int op=0;
2316 while(
i <=
s.Length() ) {
2317 if(
s(
i ) ==
'(' ) {
2319 }
else if(
s(
i ) ==
')' ) {
2321 }
else if( (
s(
i ) ==
'&' ) && ( bCounter == 0 ) ) {
2324 }
else if( (
s(
i ) ==
'|' ) && ( bCounter == 0 ) ) {
2334 Error(
"GetDataWeight",
"Could not find subTrigger %s",
s.Data() );
2335 return std::unique_ptr< CompositeTrigger >();
2340 auto out = std::make_unique< CompositeTrigger >();
2346 auto out = std::make_unique< CompositeTrigger >();
2351 out->trig1 = std::move( cOper1 );
2355 if( !
out->trig1 ) {
2356 return std::unique_ptr< CompositeTrigger >();
2359 TString oper2 =
s(
i + 1,
s.Length() );
2361 if( !
out->trig2 ) {
2362 return std::unique_ptr< CompositeTrigger >();
2371 while( j <=
s.Length() ) {
2372 if(
s( j ) ==
'(' ) {
2374 }
else if(
s( j )==
')' ) {
2376 }
else if( (
s( j ) ==
'|' ) && ( bCounter == 0 ) ) {
2382 if( ( j ==
s.Length() + 1 ) && ( op == 2 ) ) {
2384 out->trig1 = std::move( cOper1 );
2389 TString oper2 =
s(
i + 1,
s.Length() );
2391 Info(
"makeTrigger",
"Found & %s %s", oper1.Data(), oper2.Data() );
2394 if( !
out->trig2 ) {
2395 return std::unique_ptr< CompositeTrigger >();
2398 }
else if( op ==1 ) {
2401 TString oper2 =
s( j + 1,
s.Length() );
2403 Info(
"makeTrigger",
"Found & then | %s %s", oper1.Data(),
2408 if( !
out->trig1 ) {
2409 return std::unique_ptr< CompositeTrigger >();
2412 if( !
out->trig2 ) {
2413 return std::unique_ptr< CompositeTrigger >();
2417 Error(
"makeTrigger",
"Should never have got here!, but did with %s",
2419 return std::unique_ptr< CompositeTrigger >();
◆ MakeWeightTree()
Bool_t TPileupReweighting::MakeWeightTree |
( |
TString |
channelNumbers, |
|
|
TString |
outFile, |
|
|
TString |
hashBranch = "PRWHash" , |
|
|
TString |
weightBranch = "PileupWeight" |
|
) |
| |
|
inherited |
Definition at line 1530 of file TPileupReweighting.cxx.
1537 Error(
"MakeWeightTree",
"Tool not configured properly ... please report this!");
1538 throw std::runtime_error(
"Throwing 47: Tool not configured properly ... please report this!");
1544 TTree* outTree =
new TTree(
"prwTree",
"prwTree");
1545 ULong64_t prwHash(0);Float_t
weight(0.);
1546 outTree->Branch(hashBranch,&prwHash);
1547 outTree->Branch(weightBranch,&
weight);
1549 TObjArray *
tx = channelNumbers.Tokenize(
",");
1550 for (Int_t
i = 0;
i <
tx->GetEntries();
i++) {
1551 int channelNumber = ((TObjString *)(
tx->At(
i)))->String().Atoi();
1552 if(channelNumber>999999 || channelNumber<0) {
1553 Error(
"MakeWeightTree",
"ChannelNumber can not be bigger than 999999 or less than 0 ... got %d",channelNumber);
1558 if(
period.first==-1)
continue;
1559 int periodNumber =
period.first;
1560 for(
int i=1;
i<=
hist->GetNbinsX();
i++) {
1561 double x =
hist->GetXaxis()->GetBinCenter(
i);
1562 for(
int j=1;j<=
hist->GetNbinsY();j++) {
1563 double y =
hist->GetYaxis()->GetBinCenter(j);
1573 outTree->BuildIndex(hashBranch.Data());
1578 Info(
"MakeWeightTree",
"Successfully wrote prwTree to %s",
outFile.Data());
◆ Merge()
Int_t TPileupReweighting::Merge |
( |
TCollection * |
coll | ) |
|
|
inherited |
Definition at line 2039 of file TPileupReweighting.cxx.
2041 if(coll->IsEmpty())
return 0;
2051 Error(
"Merge",
"Unknown object type encountered: %s",
obj->ClassName() );
2058 for(
auto& iHist :
period.second->inputHists) {
2061 dynamic_cast<TH1*
>(iHist.second->Clone(iHist.second->GetName())) );
2070 for(
auto& iHist :
run.second.inputHists) {
2071 if( !
m_runs[
run.first].inputHists[iHist.first] ) {
2072 m_runs[
run.first].inputHists[iHist.first].reset(
2073 dynamic_cast<TH1*
>( iHist.second->Clone(iHist.second->GetName())) );
2074 m_runs[
run.first].inputHists[iHist.first]->SetDirectory(0);
2076 m_runs[
run.first].inputHists[iHist.first]->Add(iHist.second.get());
◆ msg() [1/2]
◆ msg() [2/2]
◆ msg_level_name()
const std::string & asg::AsgTool::msg_level_name |
( |
| ) |
const |
|
inherited |
A deprecated function for getting the message level's name.
Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:
MSG::name( msg().level() )
This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.
- Returns
- The string name of the current minimum message level that's printed
Definition at line 101 of file AsgTool.cxx.
◆ msgLvl()
◆ normalizeHistogram()
void TPileupReweighting::normalizeHistogram |
( |
TH1 * |
histo | ) |
|
|
protectedinherited |
Normalize histograms.
Definition at line 1996 of file TPileupReweighting.cxx.
1999 if(
hist->InheritsFrom(
"TH3")) {
2000 Error(
"normalizeHistogram",
"3D reweighting not supported yet");
2001 throw std::runtime_error(
"Throwing 3: 3D reweighting not supported yet");
2003 else if(
hist->InheritsFrom(
"TH2")) {
2004 bool skipNorm=
false;
2006 TH1D*
proj = ((TH2*)
hist)->ProjectionX();
2007 Int_t
bin,binx,biny,binz;
2008 for(binz=1; binz<=
hist->GetNbinsZ(); binz++) {
2009 for(biny=1; biny<=
hist->GetNbinsY(); biny++) {
2010 for(binx=1; binx<=
hist->GetNbinsX(); binx++) {
2011 bin =
hist->GetBin(binx,biny,binz);
2013 Double_t normalizer =
proj->GetBinContent(binx);
2014 if(normalizer!=0.0) {
2023 if(skipNorm &&
m_debugging) Warning(
"normalizeHistogram",
"Skipped normalization in hist %s",
hist->GetName());
2026 if(
hist->GetSumOfWeights()!=0.0) {
2027 hist->Scale(1.0/
hist->GetSumOfWeights());
2029 if (
m_debugging) Warning(
"normalizeHistogram",
"Skipping Normalizing histogram %s to ~zero: %f",
hist->GetName(),
hist->GetSumOfWeights());
2033 Error(
"normalizeHistogram",
"Non existent histogram for normalizing");
throw std::runtime_error(
"Throwing 56");
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ passTriggerBeforePrescale()
bool CP::PileupReweightingTool::passTriggerBeforePrescale |
( |
const TString & |
trigger | ) |
const |
|
protectedvirtual |
◆ print()
void asg::AsgTool::print |
( |
| ) |
const |
|
virtualinherited |
Print the state of the tool.
Implements asg::IAsgTool.
Reimplemented in JetRecTool, JetFinder, JetModifiedMassDrop, JetFromPseudojet, JetReclusterer, JetReclusteringTool, JetTruthLabelingTool, JetPileupLabelingTool, HI::HIPileupTool, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
Definition at line 131 of file AsgTool.cxx.
◆ PrintInfo()
void CP::TPileupReweighting::PrintInfo |
( |
Bool_t |
in | ) |
|
|
inlineinherited |
◆ PrintPeriods()
void CP::TPileupReweighting::PrintPeriods |
( |
| ) |
|
|
inlineinherited |
◆ recommendedSystematics()
◆ RemapPeriod()
void TPileupReweighting::RemapPeriod |
( |
Int_t |
periodNumber1, |
|
|
Int_t |
periodNumber2 |
|
) |
| |
|
inherited |
Combine two period numbers.
Histos are merged and the first number will be redirected to the second (the second is created if it doesn't exist)
Definition at line 63 of file TPileupReweighting.cxx.
◆ RemoveChannel()
Bool_t TPileupReweighting::RemoveChannel |
( |
int |
chanNum | ) |
|
|
inherited |
Removes a channel from the inputs ...
this is for experts only
Definition at line 1001 of file TPileupReweighting.cxx.
1003 Error(
"RemoveChannel",
"You cannot RemoveChannel after initializing the tool. Reorder your code!");
1004 throw std::runtime_error(
"Throwing 5: You cannot RemoveChannel after initializing the tool. Reorder your code!");
1009 auto itr =
period.second->inputHists.begin();
1010 while(itr !=
period.second->inputHists.end()) {
1011 if(itr->first!=
chanNum) ++itr;
1014 itr =
period.second->inputHists.erase(itr);
◆ renounce()
◆ renounceArray()
◆ ResetCountingMode()
void CP::TPileupReweighting::ResetCountingMode |
( |
| ) |
|
|
inlineinherited |
This method is DEFINITELY EXPERT USE ONLY.
Used in the checkPRWConfigFile utitlity
Definition at line 293 of file TPileupReweighting.h.
◆ ResetTriggerBits()
void CP::TPileupReweighting::ResetTriggerBits |
( |
| ) |
|
|
inlineinherited |
◆ runLbnOK()
bool CP::PileupReweightingTool::runLbnOK |
( |
Int_t |
runNbr, |
|
|
Int_t |
lbn |
|
) |
| |
|
protectedvirtual |
◆ SetBinning() [1/2]
virtual Int_t CP::PileupReweightingTool::SetBinning |
( |
Int_t |
nbinsx, |
|
|
Double_t * |
xbins, |
|
|
Int_t |
nbinsy = 0 , |
|
|
Double_t * |
ybins = 0 |
|
) |
| |
|
inlinevirtual |
◆ SetBinning() [2/2]
virtual Int_t CP::PileupReweightingTool::SetBinning |
( |
TH1 * |
hist | ) |
|
|
inlinevirtual |
◆ SetDataScaleFactors()
void CP::TPileupReweighting::SetDataScaleFactors |
( |
Float_t |
x, |
|
|
Float_t |
y = 1. |
|
) |
| |
|
inlineinherited |
◆ SetDefaultChannel()
void TPileupReweighting::SetDefaultChannel |
( |
Int_t |
channel, |
|
|
Int_t |
mcRunNumber = -1 |
|
) |
| |
|
inherited |
Set which channel should be used as a default when specific mc channel distributions cannot be found.
default channels can now be assigned for each mc run number .. mcRunNumber=-1 is the global default
Definition at line 72 of file TPileupReweighting.cxx.
◆ SetMCScaleFactors()
void CP::TPileupReweighting::SetMCScaleFactors |
( |
Float_t |
x, |
|
|
Float_t |
y = 1. |
|
) |
| |
|
inlineinherited |
◆ SetParentTool()
◆ SetRandomSeed()
void CP::TPileupReweighting::SetRandomSeed |
( |
int |
seed | ) |
|
|
inlineinherited |
◆ SetTriggerBit()
void CP::TPileupReweighting::SetTriggerBit |
( |
const TString & |
trigger, |
|
|
bool |
in = true |
|
) |
| |
|
inlineinherited |
◆ SetUniformBinning()
virtual Int_t CP::PileupReweightingTool::SetUniformBinning |
( |
Int_t |
nbinsx, |
|
|
Double_t |
xlow, |
|
|
Double_t |
xup, |
|
|
Int_t |
nbinsy = 0 , |
|
|
Double_t |
ylow = 0 , |
|
|
Double_t |
yup = 0 |
|
) |
| |
|
inlinevirtual |
◆ SetUnrepresentedDataAction()
void CP::TPileupReweighting::SetUnrepresentedDataAction |
( |
Int_t |
action, |
|
|
Double_t |
tolerance = 0.05 |
|
) |
| |
|
inlineinherited |
Set how to handle configurations where some of your data has no corresponding mc to describe it 0=Default (Throw exception), 1=Subtract lumi from normalizations (i.e.
discard data), 2=keep lumi and continue
Definition at line 124 of file TPileupReweighting.h.
125 if(action<0 || action>3) {
126 Fatal(
"SetUnrepresentedDataAction",
"Set action=%d - I'm afraid I can't let you do that, Dave",
action);
127 throw std::runtime_error(
"Throwing 2001");
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateHandler()
void CP::PileupReweightingTool::updateHandler |
( |
Gaudi::Details::PropertyBase & |
| ) |
|
◆ updateVHKA()
◆ UsePeriodConfig()
Int_t TPileupReweighting::UsePeriodConfig |
( |
const TString & |
configName | ) |
|
|
inherited |
use a hardcoded period configuration
Definition at line 234 of file TPileupReweighting.cxx.
235 if(configName==
"MC11a") {
242 Info(
"UsePeriodConfig",
"Using MC11a Period configuration");
245 }
else if(configName==
"MC11b" || configName==
"MC11c") {
252 Info(
"UsePeriodConfig",
"Using MC11b/c Period configuration");
255 }
else if(configName==
"MC12a") {
260 Error(
"UsePeriodConfig",
"Cannot use MC12a, an incompatible config has already been set up");
261 throw std::runtime_error(
"Throwing 13: Cannot use MC14, an incompatible config has already been set up");
267 Info(
"UsePeriodConfig",
"Using MC12a Period configuration");
270 }
else if(configName==
"MC12b") {
275 Error(
"UsePeriodConfig",
"Cannot use MC12b, an incompatible config has already been set up");
276 throw std::runtime_error(
"Throwing 13: Cannot use MC14, an incompatible config has already been set up");
282 Info(
"UsePeriodConfig",
"Using MC12b Period configuration");
285 }
else if(configName==
"MC12ab") {
290 Error(
"UsePeriodConfig",
"Cannot use MC12ab, an incompatible config has already been set up");
291 throw std::runtime_error(
"Throwing 13: Cannot use MC14, an incompatible config has already been set up");
298 Info(
"UsePeriodConfig",
"Using MC12ab Period configuration");
301 }
else if(configName==
"MC14_8TeV") {
304 Error(
"UsePeriodConfig",
"Cannot use MC14_8TeV, an incompatible config has already been set up");
305 throw std::runtime_error(
"Throwing 13: Cannot use MC14_8TeV, an incompatible config has already been set up");
310 Info(
"UsePeriodConfig",
"Using MC14_8TeV Period configuration");
313 }
else if(configName==
"MC14_13TeV") {
316 Error(
"UsePeriodConfig",
"Cannot use MC14_13TeV, an incompatible config has already been set up");
317 throw std::runtime_error(
"Throwing 13: Cannot use MC14_13TeV, an incompatible config has already been set up");
322 Info(
"UsePeriodConfig",
"Using MC14_13TeV Period configuration");
325 }
else if(configName==
"MC15") {
332 Error(
"UsePeriodConfig",
"Cannot use MC15, an incompatible config has already been set up");
333 throw std::runtime_error(
"Throwing 13: Cannot use MC15, an incompatible config has already been set up");
338 Info(
"UsePeriodConfig",
"Using MC15 Period configuration");
341 }
else if(configName==
"Run2") {
344 Error(
"UsePeriodConfig",
"Cannot use open Run2, an incompatible config has already been set up");
345 throw std::runtime_error(
"Throwing 13: Cannot use Run2 config, an incompatible config has already been set up");
350 Info(
"UsePeriodConfig",
"Using Run2 Period configuration, which assumes period assignment of 222222 to 999999");
353 }
else if(configName==
"MC16") {
358 Info(
"UsePeriodConfig",
"Using MC16 Period configuration");
362 Error(
"UsePeriodConfig",
"Unrecognized period config");
◆ WriteToFile() [1/2]
Int_t TPileupReweighting::WriteToFile |
( |
const TString & |
filename = "" | ) |
|
|
inherited |
◆ WriteToFile() [2/2]
Int_t TPileupReweighting::WriteToFile |
( |
TFile * |
outFile | ) |
|
|
inherited |
Definition at line 1907 of file TPileupReweighting.cxx.
1908 if(!
m_countingMode) {Warning(
"WriteToFile",
"Not in counting mode, so no file will be written");
return 0;}
1914 std::unique_ptr< TTree > outTreeMC;
1915 std::unique_ptr< TTree > outTreeData;
1917 auto pStarts = std::make_unique< std::vector< UInt_t > >();
1918 auto pStartsPtr = pStarts.get();
1919 auto pEnds = std::make_unique< std::vector< UInt_t > >();
1920 auto pEndsPtr = pEnds.get();
1927 if(
period.first<0)
continue;
1931 if(
period.second->subPeriods.size()==0) {
1932 pStarts->push_back(
period.second->start); pEnds->push_back(
period.second->end);
1935 for(
auto subp :
period.second->subPeriods) {
1936 pStarts->push_back(subp->start); pEnds->push_back(subp->end);
1939 for(
auto& inHist :
period.second->inputHists) {
1941 TH1*
hist = inHist.second.get();
1946 outTreeMC.reset(
new TTree(
"MCPileupReweighting",
"MCPileupReweighting") );
1947 outTreeMC->Branch(
"Channel",&
channel);
1948 outTreeMC->Branch(
"RunNumber",&
runNumber);
1949 outTreeMC->Branch(
"PeriodStarts",&pStartsPtr);
1950 outTreeMC->Branch(
"PeriodEnds",&pEndsPtr);
1951 outTreeMC->Branch(
"HistName",&
histName,
"HistName/C");
1960 if(
run.second.inputHists.find(
"None")==
run.second.inputHists.end())
continue;
1962 TH1*
hist =
run.second.inputHists[
"None"].get();
1966 outTreeData.reset(
new TTree(
"DataPileupReweighting",
"DataPileupReweighting") );
1967 outTreeData->Branch(
"RunNumber",&
runNumber);
1968 outTreeData->Branch(
"HistName",&
histName,
"HistName/C");
1970 outTreeData->Fill();
1979 outTreeData->Write();
1983 Info(
"WriteToFile",
"Successfully generated config file: %s",
outFile->GetName());
1984 Info(
"WriteToFile",
"Happy Reweighting :-)");
◆ m_activeTool
◆ m_autoRunEnd
int CP::TPileupReweighting::m_autoRunEnd = 0 |
|
protectedinherited |
◆ m_autoRunStart
int CP::TPileupReweighting::m_autoRunStart = 0 |
|
protectedinherited |
◆ m_configStream
std::string CP::PileupReweightingTool::m_configStream |
|
private |
◆ m_countingMode
Bool_t CP::TPileupReweighting::m_countingMode |
|
protectedinherited |
◆ m_customPeriods
std::vector<int> CP::PileupReweightingTool::m_customPeriods |
|
private |
◆ m_dataScaleFactorX
Float_t CP::TPileupReweighting::m_dataScaleFactorX |
|
protectedinherited |
◆ m_dataScaleFactorY
Float_t CP::TPileupReweighting::m_dataScaleFactorY |
|
protectedinherited |
◆ m_debugging
Bool_t CP::TPileupReweighting::m_debugging |
|
protectedinherited |
◆ m_defaultChannel
int CP::PileupReweightingTool::m_defaultChannel |
|
private |
◆ m_defaultWeightTool
std::unique_ptr< IWeightTool > CP::PileupReweightingTool::m_defaultWeightTool |
|
private |
◆ m_detStore
◆ m_doGlobalDataWeight
Bool_t CP::TPileupReweighting::m_doGlobalDataWeight |
|
protectedinherited |
◆ m_doneConfigs
std::map<int, bool> CP::PileupReweightingTool::m_doneConfigs |
|
private |
◆ m_doPrescaleWeight
Bool_t CP::TPileupReweighting::m_doPrescaleWeight = false |
|
protectedinherited |
◆ m_downTool
◆ m_downVariation
double CP::PileupReweightingTool::m_downVariation |
|
private |
◆ m_emptyHistogram
std::unique_ptr< TH1 > CP::TPileupReweighting::m_emptyHistogram |
|
protectedinherited |
the empty histogram used for this weight...
effectively holds the configuration of the binning
Definition at line 358 of file TPileupReweighting.h.
◆ m_evtStore
◆ m_grlTool
◆ m_ignoreBadChannels
Bool_t CP::TPileupReweighting::m_ignoreBadChannels |
|
protectedinherited |
◆ m_ignoreFilePeriods
Bool_t CP::TPileupReweighting::m_ignoreFilePeriods |
|
protectedinherited |
◆ m_inConfigMode
bool CP::PileupReweightingTool::m_inConfigMode |
|
private |
◆ m_isInitialized
Bool_t CP::TPileupReweighting::m_isInitialized |
|
protectedinherited |
◆ m_lumicalcFiles
std::map<TString,std::vector<TString> > CP::TPileupReweighting::m_lumicalcFiles |
|
protectedinherited |
map storing the lumicalc file locations - used when building DataPileupWeights
Definition at line 349 of file TPileupReweighting.h.
◆ m_lumicalcRunNumberOffset
Int_t CP::TPileupReweighting::m_lumicalcRunNumberOffset |
|
protectedinherited |
◆ m_lumiVectorIsLoaded
Bool_t CP::TPileupReweighting::m_lumiVectorIsLoaded |
|
protectedinherited |
◆ m_mcScaleFactorX
Float_t CP::TPileupReweighting::m_mcScaleFactorX |
|
protectedinherited |
◆ m_mcScaleFactorY
Float_t CP::TPileupReweighting::m_mcScaleFactorY |
|
protectedinherited |
◆ m_metadata
std::map<TString, std::map<Int_t, Double_t> > CP::TPileupReweighting::m_metadata |
|
protectedinherited |
◆ m_metadatatree
TTree* CP::TPileupReweighting::m_metadatatree |
|
protectedinherited |
◆ m_nextPeriodNumber
Int_t CP::TPileupReweighting::m_nextPeriodNumber |
|
protectedinherited |
◆ m_noWeightsMode
bool CP::PileupReweightingTool::m_noWeightsMode |
|
private |
◆ m_parentTool
◆ m_periodList
std::list< Period > CP::TPileupReweighting::m_periodList |
|
protectedinherited |
◆ m_periods
std::map<Int_t, Period*> CP::TPileupReweighting::m_periods |
|
protectedinherited |
◆ m_prefix
std::string CP::PileupReweightingTool::m_prefix |
|
private |
◆ m_printInfo
Bool_t CP::TPileupReweighting::m_printInfo |
|
protectedinherited |
◆ m_prwFiles
std::vector<std::string> CP::PileupReweightingTool::m_prwFiles |
|
private |
◆ m_prwFilesPathPrefix
std::string CP::TPileupReweighting::m_prwFilesPathPrefix |
|
protectedinherited |
◆ m_random3
std::unique_ptr< TRandom3 > CP::TPileupReweighting::m_random3 |
|
protectedinherited |
◆ m_runs
std::map<UInt_t, Run> CP::TPileupReweighting::m_runs |
|
protectedinherited |
◆ m_SetWarnings
Bool_t CP::TPileupReweighting::m_SetWarnings |
|
protectedinherited |
◆ m_systDown
◆ m_systUp
◆ m_tdt
◆ m_toolLumicalcFiles
std::vector<std::string> CP::PileupReweightingTool::m_toolLumicalcFiles |
|
private |
◆ m_triggerObjs
std::map<TString, std::unique_ptr<CompositeTrigger> > CP::TPileupReweighting::m_triggerObjs |
|
protectedinherited |
◆ m_triggerPassBits
std::map<TString, bool> CP::TPileupReweighting::m_triggerPassBits |
|
protectedinherited |
◆ m_unrepDataTolerance
Double_t CP::TPileupReweighting::m_unrepDataTolerance |
|
protectedinherited |
◆ m_unrepresentedDataAction
Int_t CP::TPileupReweighting::m_unrepresentedDataAction |
|
protectedinherited |
◆ m_upTool
◆ m_upVariation
double CP::PileupReweightingTool::m_upVariation |
|
private |
◆ m_useMultiPeriods
Bool_t CP::TPileupReweighting::m_useMultiPeriods = true |
|
protectedinherited |
◆ m_usePeriodConfig
std::string CP::PileupReweightingTool::m_usePeriodConfig |
|
private |
◆ m_useRunDependentPrescaleWeight
bool CP::PileupReweightingTool::m_useRunDependentPrescaleWeight |
|
private |
◆ m_varHandleArraysDeclared
◆ m_varyRunNumber
bool CP::PileupReweightingTool::m_varyRunNumber |
|
private |
◆ m_vhka
◆ m_weightTool
ToolHandle<IWeightTool> CP::PileupReweightingTool::m_weightTool |
|
private |
◆ unrepDataByChannel
std::map<Int_t, Double_t> CP::TPileupReweighting::unrepDataByChannel |
|
protectedinherited |
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
Int_t AddDistribution(TH1 *hist, Int_t runNumber, Int_t channelNumber)
char data[hepevt_bytes_allocation_ATLAS]
Int_t Fill(Int_t runNumber, Int_t channelNumber, Float_t w, Float_t x, Float_t y=0.)
void AddDistributionTree(TTree *tree, TFile *file)
Int_t IsBadBin(Int_t thisMCRunNumber, Int_t bin)
Int_t SetUniformBinning(Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy=0, Double_t ylow=0, Double_t yup=0)
constexpr double tolerance
Bool_t m_lumiVectorIsLoaded
Float_t GetPrimaryWeight(Int_t periodNumber, Int_t channelNumber, Float_t x)
Int_t AddLumiCalcFile(const TString &fileName, const TString &trigger="None")
Double_t GetUnrepresentedDataFraction(Int_t periodNumber, Int_t channel)
return the unrepresented data fraction in a given channel .
std::map< TString, bool > m_triggerPassBits
std::string find(const std::string &s)
return a remapped string
Float_t GetPeriodWeight(Int_t periodNumber, Int_t channelNumber)
uint64_t eventNumber() const
The current event's event number.
int Period
--> Execution phase:
Float_t GetDataScaleFactor() const
std::map< TString, std::vector< TString > > m_lumicalcFiles
map storing the lumicalc file locations - used when building DataPileupWeights
std::map< TString, std::map< Int_t, Double_t > > m_metadata
channel metadata map
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Int_t SetBinning(Int_t nbinsx, Double_t *xbins, Int_t nbinsy=0, Double_t *ybins=0)
Add a histogram binning config.
Double_t GetIntegratedLumi(const TString &trigger="")
total luminosity loaded and accepted by the tool (in inverse pb)
void SetDefaultChannel(Int_t channel, Int_t mcRunNumber=-1)
Set which channel should be used as a default when specific mc channel distributions cannot be found.
Int_t UsePeriodConfig(const TString &configName)
use a hardcoded period configuration
Class to wrap a set of SystematicVariations.
Bool_t m_ignoreFilePeriods
int run(int argc, char *argv[])
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
#define ATH_MSG_VERBOSE(x)
Double_t GetDataWeight(Int_t runNumber, const TString &trigger, Double_t x, bool run_dependent=false)
Method for weighting data to account for prescales and mu bias.
ps1
rename ourselfs to athena, both the prompt and the process (for top & ps)
Bool_t RemoveChannel(int chanNum)
Removes a channel from the inputs ...
@ IS_SIMULATION
true: simulation, false: data
uint32_t runNumber() const
The current event's run number.
virtual void setOwner(IDataHandleHolder *o)=0
virtual bool passTriggerBeforePrescale(const TString &trigger) const
std::map< TString, std::unique_ptr< CompositeTrigger > > m_triggerObjs
uint32_t mcChannelNumber() const
The MC generator's channel number.
UInt_t GetRandomLumiBlockNumber(UInt_t runNumber)
Get a random lumi block from the run number given.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Float_t m_dataScaleFactorY
Int_t AddPeriod(Int_t periodNumber, UInt_t start, UInt_t end)
Assign an mc RunNumber to a data period.
def tmpHist(what, wmin=-1e10, wmax=+1e10)
void EnableDebugging(Bool_t in)
Indicate if additional debugging information should be output.
void IgnoreConfigFilePeriods(Bool_t in)
Should the tool ignore period assignments encoded in config file.
void CalculatePrescaledLuminosityHistograms(const TString &trigger, int run_dependent=0)
::StatusCode StatusCode
StatusCode definition for legacy code.
Int_t m_lumicalcRunNumberOffset
std::list< Period > m_periodList
List physically holding (owning) period objects.
Float_t GetSecondaryWeight(Int_t periodNumber, Int_t channelNumber, Float_t x, Float_t y)
Float_t GetCombinedWeight(Int_t periodNumber, Int_t channelNumber, Float_t x, Float_t y=0.)
Int_t WriteToFile(const TString &filename="")
std::map< Int_t, Period * > m_periods
const_iterator end() const
description: const iterator to the end of the set
Double_t GetPrescaleWeight(Int_t runNumber, const TString &trigger, Double_t x, bool run_dependent=false)
Method for prescaling MC to account for prescales in data.
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
#define CHECK(...)
Evaluate an expression and check for errors.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Bool_t m_ignoreBadChannels
void calculateHistograms(CompositeTrigger *trigger, int run_dependent)
void normalizeHistogram(TH1 *histo)
Normalize histograms.
Int_t GetNearestGoodBin(Int_t thisMCRunNumber, Int_t bin)
uint32_t lumiBlock() const
The current event's luminosity block number.
std::map< UInt_t, Run > m_runs
std::unique_ptr< TRandom3 > m_random3
virtual void renounce()=0
outFile
Comment Out Those You do not wish to run.
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
void PrintInfo(Bool_t in)
disable info
float averageInteractionsPerCrossing() const
Average interactions per crossing for all BCIDs - for out-of-time pile-up.
TPileupReweighting * m_parentTool
Bool_t m_doPrescaleWeight
Int_t m_unrepresentedDataAction
Double_t GetNumberOfEvents(Int_t channel)
totalMC maps should also hold the total number of entries for each channel
std::unique_ptr< CompositeTrigger > makeTrigger(const TString &s)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Int_t AddConfigFile(const TString &fileName)
iterator find(const SystematicVariation &sys) const
description: find an element in the set
Double_t GetIntegratedLumiFraction(Int_t periodNumber, UInt_t start, UInt_t end)
return fraction of lumi assigned to periodNumber (or mcRunNumber) that is between start and end data ...
std::map< Int_t, Double_t > unrepDataByChannel
Int_t Initialize()
Initialize this class once before the event loop starts If distribution information is provided,...
ULong64_t GetPRWHash(Int_t periodNumber, Int_t channelNumber, Float_t x, Float_t y=0.)
#define ATH_MSG_WARNING(x)
This module implements the central registry for handling systematic uncertainties with CP tools.
Int_t GetDefaultChannel(Int_t mcRunNumber=-1)
Double_t m_unrepDataTolerance
std::unique_ptr< TH1 > CloneEmptyHistogram(Int_t runNumber, Int_t channelNumber)
Float_t m_dataScaleFactorX
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Int_t GetFirstFoundPeriodNumber(UInt_t runNumber)
Get the first period number with the data run number contained - assume all periods are disconnected ...
Float_t GetUnrepresentedDataWeight(Int_t periodNumber, Int_t channel)
Error
The different types of error that can be flagged in the L1TopoRDO.
virtual bool runLbnOK(Int_t, Int_t)
Float_t GetLumiBlockMu(Int_t runNumber, UInt_t lb)
get the lumiblock mu, useful for 'updating' the mu coming from data to account for new lumitags
Double_t GetLumiBlockIntegratedLumi(Int_t runNumber, UInt_t lb)
get integrated lumi for specific run and lumiblock number .
std::string m_prwFilesPathPrefix
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Bool_t m_doGlobalDataWeight
Double_t GetSumOfEventWeights(Int_t channel)
bool eventType(EventType type) const
Check for one particular bitmask value.
TH1 * GetInputHistogram(Int_t channelNumber, Int_t periodNumber)
TPileupReweighting(const char *name="TPileupReweighting")
Standard constructor.
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
float actualInteractionsPerCrossing() const
Average interactions per crossing for the current BCID - for in-time pile-up.
std::unique_ptr< TH1 > m_emptyHistogram
the empty histogram used for this weight...