ATLAS Offline Software
Loading...
Searching...
No Matches
NSWCalibSmearingTool.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 NSWCalibSmearingTool_h
6#define NSWCalibSmearingTool_h
7
8
10#include "GaudiKernel/ServiceHandle.h"
13
14
15
17
18
19
20#include <map>
21
22namespace Muon {
23
24 class NSWCalibSmearingTool : virtual public INSWCalibSmearingTool, public AthAlgTool {
25
26 public:
27
28 NSWCalibSmearingTool(const std::string&, const std::string&, const IInterface*);
29
31
32 virtual StatusCode initialize() override;
33
34 virtual StatusCode isAccepted(const Identifier id, bool& accepted, CLHEP::HepRandomEngine* rndmEngine) const override;
35
36 double getHighVoltage(Identifier id) const;
37
38 StatusCode smearTimeAndCharge(const Identifier id, float& time, float& charge, bool& accepted, CLHEP::HepRandomEngine* rndmEngine) const override;
39 StatusCode smearCharge(const Identifier id, float& charge, bool& accepted, CLHEP::HepRandomEngine* rndmEngine) const override;
40
41 virtual StatusCode getGainFraction(const Identifier id, float& charge) override;
42
43 private:
44
45 bool getIdFields(const Identifier id, int& etaSector, int& phiSector,
46 int& gasGap) const;
47
48 bool getPCBIdentifier(const Identifier id, Identifier& pcb_id) const;
49
50 double getMMEfficiencyFromHV(double hv) const;
51 double getMMGainFractionFromHV(double hv) const;
52
53 StatusCode readHighVoltagesStatus();
54
55 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
56
57 Gaudi::Property<std::vector<double>> m_timeSmear {this, "TimeSmear" ,{8.,8.,8.,8.,8.,8.,8.,8.}};
58 Gaudi::Property<std::vector<double>> m_chargeSmear {this, "ChargeSmear" ,{0.,0.,0.,0.,0.,0.,0.,0.}};
59
60 Gaudi::Property<std::vector<double>> m_channelEfficiency {this, "ChannelEfficiency", {1.,1.,1.,1.,1.,1.,1.,1.}};
61 Gaudi::Property<std::vector<double>> m_clusterEfficiency {this, "ClusterEfficiency", {1.,1.,1.,1.,1.,1.,1.,1.}};
62
63 Gaudi::Property<std::vector<double>> m_gainFraction {this, "GainFraction", {1.,1.,1.,1.,1.,1.,1.,1.}};
64
65 Gaudi::Property<std::vector<bool>> m_phiSectors {this, "PhiSectors", {true,true,true,true,true,true,true,true}};
66 Gaudi::Property<std::vector<bool>> m_etaSectors {this, "EtaSectors", {}}; // needs to be set via config since it differs for MMs and sTGCs
67
68 Gaudi::Property<bool> m_readEfficiencyFromFile {this, "ReadEfficiencyFromFile", false};
69 Gaudi::Property<bool> m_readGainFractionFromFile {this, "ReadGainFractionFromFile", false};
70 Gaudi::Property<std::string> m_fileName{this, "FileName", ""};
71
72 // HV maps ( for MM efficiencies )
73 std::map<Identifier,float> m_hvMap;
74
75 };
76
77}
78
79#endif
double charge(const T &p)
Definition AtlasPID.h:997
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Gaudi::Property< std::vector< double > > m_chargeSmear
Gaudi::Property< std::vector< double > > m_channelEfficiency
virtual StatusCode initialize() override
bool getIdFields(const Identifier id, int &etaSector, int &phiSector, int &gasGap) const
Gaudi::Property< bool > m_readEfficiencyFromFile
Gaudi::Property< std::string > m_fileName
double getMMGainFractionFromHV(double hv) const
Gaudi::Property< std::vector< double > > m_gainFraction
double getMMEfficiencyFromHV(double hv) const
Gaudi::Property< std::vector< double > > m_timeSmear
double getHighVoltage(Identifier id) const
bool getPCBIdentifier(const Identifier id, Identifier &pcb_id) const
NSWCalibSmearingTool(const std::string &, const std::string &, const IInterface *)
StatusCode smearCharge(const Identifier id, float &charge, bool &accepted, CLHEP::HepRandomEngine *rndmEngine) const override
Gaudi::Property< std::vector< bool > > m_phiSectors
Gaudi::Property< std::vector< bool > > m_etaSectors
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
StatusCode smearTimeAndCharge(const Identifier id, float &time, float &charge, bool &accepted, CLHEP::HepRandomEngine *rndmEngine) const override
std::map< Identifier, float > m_hvMap
Gaudi::Property< bool > m_readGainFractionFromFile
virtual StatusCode isAccepted(const Identifier id, bool &accepted, CLHEP::HepRandomEngine *rndmEngine) const override
virtual StatusCode getGainFraction(const Identifier id, float &charge) override
Gaudi::Property< std::vector< double > > m_clusterEfficiency
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.