ATLAS Offline Software
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 
22 namespace 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 
30  virtual ~NSWCalibSmearingTool() {};
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 
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
MuonCluster.h
Muon::NSWCalibSmearingTool::getPCBIdentifier
bool getPCBIdentifier(const Identifier id, Identifier &pcb_id) const
Definition: NSWCalibSmearingTool.cxx:318
Muon::NSWCalibSmearingTool::m_phiSectors
Gaudi::Property< std::vector< bool > > m_phiSectors
Definition: NSWCalibSmearingTool.h:65
dumpTgcDigiDeadChambers.gasGap
list gasGap
Definition: dumpTgcDigiDeadChambers.py:33
Muon::NSWCalibSmearingTool::m_readEfficiencyFromFile
Gaudi::Property< bool > m_readEfficiencyFromFile
Definition: NSWCalibSmearingTool.h:68
Muon::NSWCalibSmearingTool::m_gainFraction
Gaudi::Property< std::vector< double > > m_gainFraction
Definition: NSWCalibSmearingTool.h:63
Muon::NSWCalibSmearingTool::smearTimeAndCharge
StatusCode smearTimeAndCharge(const Identifier id, float &time, float &charge, bool &accepted, CLHEP::HepRandomEngine *rndmEngine) const override
Definition: NSWCalibSmearingTool.cxx:157
Muon::NSWCalibSmearingTool::readHighVoltagesStatus
StatusCode readHighVoltagesStatus()
Definition: NSWCalibSmearingTool.cxx:347
Muon::NSWCalibSmearingTool::m_fileName
Gaudi::Property< std::string > m_fileName
Definition: NSWCalibSmearingTool.h:70
Muon::INSWCalibSmearingTool
Definition: INSWCalibSmearingTool.h:15
Muon::NSWCalibSmearingTool::m_timeSmear
Gaudi::Property< std::vector< double > > m_timeSmear
Definition: NSWCalibSmearingTool.h:57
Muon::NSWCalibSmearingTool::initialize
virtual StatusCode initialize() override
Definition: NSWCalibSmearingTool.cxx:26
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:45
Muon::NSWCalibSmearingTool::getMMGainFractionFromHV
double getMMGainFractionFromHV(double hv) const
Definition: NSWCalibSmearingTool.cxx:305
Muon::NSWCalibSmearingTool::m_channelEfficiency
Gaudi::Property< std::vector< double > > m_channelEfficiency
Definition: NSWCalibSmearingTool.h:60
Muon::NSWCalibSmearingTool::isAccepted
virtual StatusCode isAccepted(const Identifier id, bool &accepted, CLHEP::HepRandomEngine *rndmEngine) const override
Definition: NSWCalibSmearingTool.cxx:47
Muon::NSWCalibSmearingTool
Definition: NSWCalibSmearingTool.h:24
Muon::NSWCalibSmearingTool::m_readGainFractionFromFile
Gaudi::Property< bool > m_readGainFractionFromFile
Definition: NSWCalibSmearingTool.h:69
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Muon::NSWCalibSmearingTool::~NSWCalibSmearingTool
virtual ~NSWCalibSmearingTool()
Definition: NSWCalibSmearingTool.h:30
AthAlgTool.h
Muon::NSWCalibSmearingTool::getHighVoltage
double getHighVoltage(Identifier id) const
Definition: NSWCalibSmearingTool.cxx:271
Muon::NSWCalibSmearingTool::m_clusterEfficiency
Gaudi::Property< std::vector< double > > m_clusterEfficiency
Definition: NSWCalibSmearingTool.h:61
charge
double charge(const T &p)
Definition: AtlasPID.h:538
Muon::NSWCalibSmearingTool::getGainFraction
virtual StatusCode getGainFraction(const Identifier id, float &charge) override
Definition: NSWCalibSmearingTool.cxx:196
Muon::NSWCalibSmearingTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: NSWCalibSmearingTool.h:55
Muon::NSWCalibSmearingTool::m_chargeSmear
Gaudi::Property< std::vector< double > > m_chargeSmear
Definition: NSWCalibSmearingTool.h:58
AthAlgTool
Definition: AthAlgTool.h:26
Muon::NSWCalibSmearingTool::smearCharge
StatusCode smearCharge(const Identifier id, float &charge, bool &accepted, CLHEP::HepRandomEngine *rndmEngine) const override
Definition: NSWCalibSmearingTool.cxx:99
Muon::NSWCalibSmearingTool::m_hvMap
std::map< Identifier, float > m_hvMap
Definition: NSWCalibSmearingTool.h:73
INSWCalibSmearingTool.h
Muon::NSWCalibSmearingTool::NSWCalibSmearingTool
NSWCalibSmearingTool(const std::string &, const std::string &, const IInterface *)
Definition: NSWCalibSmearingTool.cxx:18
Muon::NSWCalibSmearingTool::m_etaSectors
Gaudi::Property< std::vector< bool > > m_etaSectors
Definition: NSWCalibSmearingTool.h:66
Muon::NSWCalibSmearingTool::getMMEfficiencyFromHV
double getMMEfficiencyFromHV(double hv) const
Definition: NSWCalibSmearingTool.cxx:294
IMuonIdHelperSvc.h
ServiceHandle< Muon::IMuonIdHelperSvc >
Muon::NSWCalibSmearingTool::getIdFields
bool getIdFields(const Identifier id, int &etaSector, int &phiSector, int &gasGap) const
Definition: NSWCalibSmearingTool.cxx:234
Identifier
Definition: IdentifierFieldParser.cxx:14