ATLAS Offline Software
IMdtCalibrationTool.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 MDTCALIBSVC_IMDTCALIBRATIONTOOL_H
6 #define MDTCALIBSVC_IMDTCALIBRATIONTOOL_H
7 
8 #include <bitset>
9 #include <GaudiKernel/IAlgTool.h>
10 #include <GaudiKernel/EventContext.h>
14 
15 
16 namespace MuonCalib{
17  struct MdtFullCalibData;
18 }
19 
27 class IMdtCalibrationTool : virtual public IAlgTool {
28 public:
29 
32  Default = 1,
36  };
38  static constexpr double tdcBinSize = 0.78125; //25/32; exact number: (1000.0/40.079)/32.0
39 
41  virtual ~IMdtCalibrationTool() = default;
42 
45 
73  virtual MdtCalibOutput calibrate(const EventContext& ctx,
74  const MdtCalibInput& hit,
75  bool resolFromRtrack=false) const = 0;
76 
79  virtual MdtCalibTwinOutput calibrateTwinTubes(const EventContext& ctx,
80  MdtCalibInput&& primHit,
81  MdtCalibInput&& twinHit) const = 0;
82 
83 
84  virtual const MuonCalib::MdtFullCalibData* getCalibConstants(const EventContext& ctx,
85  const Identifier& channelId) const = 0;
86  virtual double getResolutionFromRt(const EventContext& ctx,
87  const Identifier& module,
88  const double time) const = 0;
89 
90  struct ToolSettings {
91  enum class Property: int {
92  TofCorrection = 0,
93  PropCorrection,
94  TempCorrection,
95  MagFieldCorrection,
96  SlewCorrection,
97  BackgroundCorrection,
98  NumSettings
99  };
100 
101  void setBit(const Property prop, const bool value){
102  m_mask.set(static_cast<unsigned int>(prop), value);
103  }
104  bool isActive(const Property prop) const {
105  return m_mask.test(static_cast<unsigned int>(prop));
106  }
107  timeWindowMode window{timeWindowMode::UserDefined};
108  private:
109  using bitmask = std::bitset<static_cast<unsigned>(Property::NumSettings)>;
111 
112  };
113  virtual ToolSettings getSettings() const = 0;
114 
115 };
116 
117 #endif
MdtCalibInput.h
MdtCalibInput
Definition: MdtCalibInput.h:35
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
IMdtCalibrationTool
Definition: IMdtCalibrationTool.h:27
MdtCalibTwinOutput.h
IMdtCalibrationTool::DeclareInterfaceID
DeclareInterfaceID(IMdtCalibrationTool, 1, 0)
implements IInterface
athena.value
value
Definition: athena.py:124
Property
Support class for PropertyMgr.
Definition: Property.h:23
MuonCalib::MdtFullCalibData
class which holds the full set of calibration constants for a given tube
Definition: MdtFullCalibData.h:15
IMdtCalibrationTool::ToolSettings::window
timeWindowMode window
Definition: IMdtCalibrationTool.h:107
IMdtCalibrationTool::ToolSettings::setBit
void setBit(const Property prop, const bool value)
Definition: IMdtCalibrationTool.h:101
python.PyAthena.module
module
Definition: PyAthena.py:131
IMdtCalibrationTool::~IMdtCalibrationTool
virtual ~IMdtCalibrationTool()=default
destructor
MdtCalibOutput.h
IMdtCalibrationTool::UserDefined
@ UserDefined
Definition: IMdtCalibrationTool.h:31
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition: CscCalcPed.cxx:22
IMdtCalibrationTool::ToolSettings::bitmask
std::bitset< static_cast< unsigned >(Property::NumSettings)> bitmask
Definition: IMdtCalibrationTool.h:109
IMdtCalibrationTool::timeWindowMode
timeWindowMode
Definition: IMdtCalibrationTool.h:30
MdtCalibOutput
Definition: MdtCalibOutput.h:10
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
IMdtCalibrationTool::ToolSettings::m_mask
bitmask m_mask
Definition: IMdtCalibrationTool.h:110
IMdtCalibrationTool::calibrateTwinTubes
virtual MdtCalibTwinOutput calibrateTwinTubes(const EventContext &ctx, MdtCalibInput &&primHit, MdtCalibInput &&twinHit) const =0
Convert the raw MDT times of two twin hits into a Twin position (coordinate along tube) It returns wh...
IMdtCalibrationTool::calibrate
virtual MdtCalibOutput calibrate(const EventContext &ctx, const MdtCalibInput &hit, bool resolFromRtrack=false) const =0
Convert the raw MDT time (+charge) into a drift radius + error.
IMdtCalibrationTool::ToolSettings::isActive
bool isActive(const Property prop) const
Definition: IMdtCalibrationTool.h:104
IMdtCalibrationTool::getCalibConstants
virtual const MuonCalib::MdtFullCalibData * getCalibConstants(const EventContext &ctx, const Identifier &channelId) const =0
MdtCalibTwinOutput
Definition: MdtCalibTwinOutput.h:11
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
IMdtCalibrationTool::CollisionFitT0
@ CollisionFitT0
10, 30
Definition: IMdtCalibrationTool.h:35
IMdtCalibrationTool::CollisionData
@ CollisionData
20, 30
Definition: IMdtCalibrationTool.h:34
IMdtCalibrationTool::CollisionG4
@ CollisionG4
1000, 2000
Definition: IMdtCalibrationTool.h:33
Default
IMdtCalibrationTool::tdcBinSize
static constexpr double tdcBinSize
Conversion to go from tdc counts -> drift Time.
Definition: IMdtCalibrationTool.h:38
IMdtCalibrationTool::getResolutionFromRt
virtual double getResolutionFromRt(const EventContext &ctx, const Identifier &module, const double time) const =0
IMdtCalibrationTool::ToolSettings
Definition: IMdtCalibrationTool.h:90
IMdtCalibrationTool::getSettings
virtual ToolSettings getSettings() const =0
Identifier
Definition: IdentifierFieldParser.cxx:14