ATLAS Offline Software
HIPileupTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef HIEVENTUTILS_HIPILEUPTOOL_H
6 #define HIEVENTUTILS_HIPILEUPTOOL_H
7 
8 // David Adams.
9 // January 2014
10 //
11 // This is a simple ASG dual-use tool intended as an
12 // example for tool developers.
13 
15 #include "AsgTools/AsgTool.h"
16 #include "AsgTools/ToolHandle.h"
19 
20 class TH1D;
21 class TH2D;
22 class TFile;
23 namespace HI
24 {
25 
26  class HIPileupTool :
27  public asg::AsgTool, virtual public HI::IHIPileupTool {
29 
30  public:
31 
32  HIPileupTool( const std::string& myname="HIPileupTool" );
33  ~HIPileupTool();
34 
35  virtual StatusCode initialize() override;
36 
37  virtual void print() const override;
38  void write(TFile* fOut);
39 
40  double get_efficiency(const xAOD::HIEventShapeContainer&, double ) const;
41  double get_purity(const xAOD::HIEventShapeContainer&, double& );
42  bool is_pileup(const xAOD::HIEventShapeContainer&, const xAOD::ZdcModuleContainer& ) const override;
43 
44  virtual const asg::AcceptInfo& getAcceptInfo(const xAOD::HIEventShapeContainer& evShCont, const xAOD::ZdcModuleContainer& ZdcCont) const override;
45 
46  private:
47 
48  double get_et(const xAOD::HIEventShapeContainer& evShCont) const;
49  double get_nNeutrons(const xAOD::ZdcModuleContainer& ZdcCont) const;
50 
51  //R.Longo - 12/10/2019 - Replacing PATCore/TAccept (inherited from 21.0 HI-equalization)
53 
54  std::vector<double> m_etCutAndPurity;
55  std::string m_fname;
56 
57  double m_etThreshold = 0.0;
58  double m_purityCut = 0.0;
59  bool m_setup;
60  //Average energy deposited in the ZDC by neutrons
61  const double m_npeak = 2510.;
62 
63  TH2D* m_hEvents = nullptr;
64  TH2D* m_hPileUp = nullptr;
65  TH1D* m_hCut = nullptr;
66  TH1D* m_hEff = nullptr;
67  TH1D* m_hPurity = nullptr;
68  };
69 }
70 #endif
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
HI::HIPileupTool::~HIPileupTool
~HIPileupTool()
Definition: HIPileupTool.cxx:37
HI::HIPileupTool::m_hPurity
TH1D * m_hPurity
Definition: HIPileupTool.h:67
HI::HIPileupTool::m_hPileUp
TH2D * m_hPileUp
Definition: HIPileupTool.h:64
HI::HIPileupTool::m_hEff
TH1D * m_hEff
Definition: HIPileupTool.h:66
HI::HIPileupTool
Definition: HIPileupTool.h:27
HI::HIPileupTool::print
virtual void print() const override
Print the state of the tool.
Definition: HIPileupTool.cxx:177
HI::HIPileupTool::m_hEvents
TH2D * m_hEvents
Definition: HIPileupTool.h:63
TH1D
Definition: rootspy.cxx:342
HI::HIPileupTool::write
void write(TFile *fOut)
Definition: HIPileupTool.cxx:189
HI::HIPileupTool::m_etCutAndPurity
std::vector< double > m_etCutAndPurity
Definition: HIPileupTool.h:54
HI::HIPileupTool::m_accept
asg::AcceptInfo m_accept
Definition: HIPileupTool.h:52
HI::HIPileupTool::m_etThreshold
double m_etThreshold
Definition: HIPileupTool.h:57
asg::AcceptInfo
Definition: AcceptInfo.h:28
HI::HIPileupTool::m_fname
std::string m_fname
Definition: HIPileupTool.h:55
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
HI::HIPileupTool::get_efficiency
double get_efficiency(const xAOD::HIEventShapeContainer &, double) const
Definition: HIPileupTool.cxx:141
HIEventShapeContainer.h
HI::HIPileupTool::HIPileupTool
HIPileupTool(const std::string &myname="HIPileupTool")
Definition: HIPileupTool.cxx:28
makeTOC.fOut
fOut
Definition: makeTOC.py:37
TH2D
Definition: rootspy.cxx:430
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
HI::HIPileupTool::m_purityCut
double m_purityCut
Definition: HIPileupTool.h:58
HI
Definition: HIEventDefs.h:14
HI::HIPileupTool::getAcceptInfo
virtual const asg::AcceptInfo & getAcceptInfo(const xAOD::HIEventShapeContainer &evShCont, const xAOD::ZdcModuleContainer &ZdcCont) const override
Definition: HIPileupTool.cxx:199
HI::IHIPileupTool
Definition: IHIPileupTool.h:21
HI::HIPileupTool::get_nNeutrons
double get_nNeutrons(const xAOD::ZdcModuleContainer &ZdcCont) const
Definition: HIPileupTool.cxx:160
HI::HIPileupTool::m_hCut
TH1D * m_hCut
Definition: HIPileupTool.h:65
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
HI::HIPileupTool::is_pileup
bool is_pileup(const xAOD::HIEventShapeContainer &, const xAOD::ZdcModuleContainer &) const override
Definition: HIPileupTool.cxx:130
HI::HIPileupTool::get_purity
double get_purity(const xAOD::HIEventShapeContainer &, double &)
Definition: HIPileupTool.cxx:147
IHIPileupTool.h
HI::HIPileupTool::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: HIPileupTool.cxx:45
ToolHandle.h
AsgTool.h
HI::HIPileupTool::m_npeak
const double m_npeak
Definition: HIPileupTool.h:61
HI::HIPileupTool::m_setup
bool m_setup
Definition: HIPileupTool.h:59
HI::HIPileupTool::get_et
double get_et(const xAOD::HIEventShapeContainer &evShCont) const
Definition: HIPileupTool.cxx:154
ZdcModuleContainer.h