ATLAS Offline Software
Loading...
Searching...
No Matches
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
20class TH1D;
21class TH2D;
22class TFile;
23namespace HI
24{
25
27 public asg::AsgTool, virtual public HI::IHIPileupTool {
29
30 public:
31
32 HIPileupTool( const std::string& myname="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
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
double get_efficiency(const xAOD::HIEventShapeContainer &, double) const
virtual void print() const override
Print the state of the tool.
const double m_npeak
double get_nNeutrons(const xAOD::ZdcModuleContainer &ZdcCont) const
asg::AcceptInfo m_accept
double get_et(const xAOD::HIEventShapeContainer &evShCont) const
std::vector< double > m_etCutAndPurity
std::string m_fname
double get_purity(const xAOD::HIEventShapeContainer &, double &)
HIPileupTool(const std::string &myname="HIPileupTool")
void write(TFile *fOut)
virtual const asg::AcceptInfo & getAcceptInfo(const xAOD::HIEventShapeContainer &evShCont, const xAOD::ZdcModuleContainer &ZdcCont) const override
bool is_pileup(const xAOD::HIEventShapeContainer &, const xAOD::ZdcModuleContainer &) const override
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
ZdcModuleContainer_v1 ZdcModuleContainer
HIEventShapeContainer_v2 HIEventShapeContainer
Define the latest version of the container.