ATLAS Offline Software
BaseLinearFakeBkgTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef BASE_LINEAR_FAKE_BKG_TOOL_H
6 #define BASE_LINEAR_FAKE_BKG_TOOL_H
7 
10 
11 #ifdef FAKEBKGTOOLS_ATLAS_ENVIRONMENT
12  #include "AsgTools/AsgTool.h"
13  #include "xAODBase/IParticle.h"
14 #endif
15 
16 #include <string>
17 #include <map>
18 #include <set>
19 #include <vector>
20 
21 namespace FakeBkgTools
22 {
24  struct ParticleData;
25  class FinalState;
26  class Database;
27  struct Weight;
28  struct Yield;
29  enum class Client;
30 }
31 
32 namespace CP
33 {
34 
35 /*
36  * Base class of concrete tools implementations, providing common helper methods
37  */
39 {
40  public:
41 
42  BaseLinearFakeBkgTool(const std::string& toolname);
43  virtual ~BaseLinearFakeBkgTool();
44 
45  virtual StatusCode initialize() override;
46 
47  virtual StatusCode getEventWeight(float& weight, const std::string& selection, const std::string& process) override final;
48 
49  virtual StatusCode getTotalYield(float& yield, float& statErrorUp, float& statErrorDown) override final;
50 
51  virtual StatusCode register1DHistogram(TH1* h1, const float *val) override;
52  virtual StatusCode register2DHistogram(TH2* h2, const float *xval, const float *yval) override;
53  virtual StatusCode register3DHistogram(TH3* h3, const float *xval, const float *yval, const float *zval) override;
54 
55  StatusCode assignYieldRange(TH1* h);
56 
57  virtual StatusCode saveProgress(TDirectory* dir) override;
58 
59  protected:
60 
61  #ifndef __CLING__
62  std::vector<FakeBkgTools::Yield> m_yields;
64 
67  std::map<FakeBkgTools::FinalState, FakeBkgTools::Weight> m_cachedWeights;
68  #else
69  std::vector<int> m_yields;
70  std::map<int,int> m_cachedWeights;
71  #endif
72 
73  std::map<TH1*, std::pair<uint32_t, uint32_t>> m_histogramYieldsRange;
74 
76  StatusCode incrementTotalYield();
77 
79 
80  private:
81 
82  StatusCode getEventWeightCommon(FakeBkgTools::Weight& weight, const std::string& selection, const std::string& process);
83 
84  StatusCode mergeSubjobs();
85 
86 };
87 
88 }
89 
90 #endif
CP::BaseFakeBkgTool
Definition: BaseFakeBkgTool.h:41
python.exampleDriverScript.Database
Database
Definition: exampleDriverScript.py:28
IParticle.h
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition: checker_macros.h:212
initialize
void initialize()
Definition: run_EoverP.cxx:894
FakeBkgTools::Client
Client
Definition: FakeBkgInternals.h:141
read_hist_ntuple.h1
h1
Definition: read_hist_ntuple.py:21
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:49
CP::BaseLinearFakeBkgTool::m_histogramYieldsRange
std::map< TH1 *, std::pair< uint32_t, uint32_t > > m_histogramYieldsRange
Definition: BaseLinearFakeBkgTool.h:73
SUSY_SimplifiedModel_PostInclude.process
string process
Definition: SUSY_SimplifiedModel_PostInclude.py:43
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:190
plotting.yearwise_efficiency_vs_mu.xval
float xval
Definition: yearwise_efficiency_vs_mu.py:35
FakeBkgTools
Definition: BaseFakeBkgTool.h:23
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ILinearFakeBkgTool.h
BaseFakeBkgTool.h
CP::BaseLinearFakeBkgTool
Definition: BaseLinearFakeBkgTool.h:39
beamspotman.dir
string dir
Definition: beamspotman.py:619
selection
const std::string selection
Definition: fbtTestBasics.cxx:75
python.hypoToolDisplay.toolname
def toolname(tool)
Definition: hypoToolDisplay.py:13
FakeBkgTools::Weight
a structure to hold a weight together with a variable number of systematic uncertainties
Definition: FakeBkgInternals.h:62
plotting.yearwise_efficiency_vs_mu.yval
float yval
Definition: yearwise_efficiency_vs_mu.py:36
CP::ILinearFakeBkgTool
Interface for the tools providing an estimate of the fake lepton background, which are able to provid...
Definition: ILinearFakeBkgTool.h:17
FakeBkgTools::FinalState
Definition: FakeBkgInternals.h:98
h
CP::BaseLinearFakeBkgTool::getEventWeightCustom
virtual StatusCode getEventWeightCustom(FakeBkgTools::Weight &weight, const FakeBkgTools::FinalState &fs)=0
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
Herwig7_QED_EvtGen_ll.fs
dictionary fs
Definition: Herwig7_QED_EvtGen_ll.py:17
AsgTool.h
CP::BaseLinearFakeBkgTool::m_cachedWeights
std::map< FakeBkgTools::FinalState, FakeBkgTools::Weight > m_cachedWeights
cached weight+uncertainties for a single event Each tool derived from this base class MUST clear the ...
Definition: BaseLinearFakeBkgTool.h:67