ATLAS Offline Software
INSWCalibTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef INSWCalibTool_h
5 #define INSWCalibTool_h
6 
7 #include "GaudiKernel/IAlgTool.h"
8 #include "GaudiKernel/EventContext.h"
10 #include "Identifier/Identifier.h"
11 
12 #include <cmath>
13 #include <vector>
14 #include "float.h"
15 
16 
17 
18 namespace NSWCalib {
19 
20  struct CalibratedStrip {
21  double charge{0};
22  double time{0};
23  double resTime{0};
24  double distDrift{0};
25  double resTransDistDrift{0};
26  double resLongDistDrift{0};
27  double dx{0};
30  };
31 
32  struct MicroMegaGas{
34  float driftVelocity{0.};
40  using angleFunction = std::function<double(double)>;
43  return [](float){
44  throw std::runtime_error("Please do not use the dummy lorentz function");
45  return 0.;
46  };
47  }
49  };
50 
51 }
52 
53 namespace Muon {
54 
55  class MM_RawData;
56  class MMPrepData;
57  class STGC_RawData;
58 
59  class INSWCalibTool : virtual public IAlgTool {
60 
61  public: // static methods
62 
63  static const InterfaceID& interfaceID() {
64  static const InterfaceID IID_INSWCalibTool("Muon::INSWCalibTool",1,0);
65  return IID_INSWCalibTool;
66  }
67 
68  public: // interface methods
69 
70  virtual StatusCode calibrateClus(const EventContext& ctx, const Muon::MMPrepData* prepRawData, const Amg::Vector3D& globalPos, std::vector<NSWCalib::CalibratedStrip>& calibClus) const = 0;
71  virtual StatusCode calibrateStrip(const Identifier& id, const double time, const double charge, const double lorentzAngle, NSWCalib::CalibratedStrip&calibStrip) const = 0;
72  virtual StatusCode calibrateStrip(const EventContext& ctx, const Muon::MM_RawData* mmRawData, NSWCalib::CalibratedStrip& calibStrip) const = 0;
73  virtual StatusCode calibrateStrip(const EventContext& ctx, const Muon::STGC_RawData* sTGCRawData, NSWCalib::CalibratedStrip& calibStrip) const = 0;
74 
75  virtual bool tdoToTime (const EventContext& ctx, const bool inCounts, const int tdo, const Identifier& chnlId, float& time, const int relBCID) const = 0;
76  virtual bool timeToTdo (const EventContext& ctx, const float time, const Identifier& chnlId, int& tdo, int& relBCID) const = 0;
77  virtual bool chargeToPdo(const EventContext& ctx, const float charge, const Identifier& chnlId, int& pdo) const = 0;
78  virtual bool pdoToCharge(const EventContext& ctx, const bool inCounts, const int pdo, const Identifier& chnlId, float& charge) const = 0;
79 
80  virtual StatusCode distToTime(const EventContext& ctx, const Muon::MMPrepData* prepData, const Amg::Vector3D& globalPos,const std::vector<double>& driftDistances, std::vector<double>& driftTimes) const = 0;
81 
83  virtual float mmPeakTime() const = 0;
84  virtual float stgcPeakTime() const = 0;
85  };
86 
87 }
88 
89 
90 #endif
NSWCalib::MicroMegaGas::lorentzAngleFunction
angleFunction lorentzAngleFunction
Definition: INSWCalibTool.h:48
NSWCalib::MicroMegaGas::longitudinalDiffusionSigma
float longitudinalDiffusionSigma
// 0.350/10 diffusSigma=transverse diffusion (350 microm per 1cm ) for 93:7 @ 600 V/cm,...
Definition: INSWCalibTool.h:36
NSWCalib::CalibratedStrip::time
double time
Definition: INSWCalibTool.h:22
Muon::MMPrepData
Class to represent MM measurements.
Definition: MMPrepData.h:22
NSWCalib::CalibratedStrip::charge
double charge
Definition: INSWCalibTool.h:21
Muon::INSWCalibTool::calibrateClus
virtual StatusCode calibrateClus(const EventContext &ctx, const Muon::MMPrepData *prepRawData, const Amg::Vector3D &globalPos, std::vector< NSWCalib::CalibratedStrip > &calibClus) const =0
Muon::INSWCalibTool::tdoToTime
virtual bool tdoToTime(const EventContext &ctx, const bool inCounts, const int tdo, const Identifier &chnlId, float &time, const int relBCID) const =0
Trk::PrepRawDataType::MMPrepData
@ MMPrepData
Muon::INSWCalibTool::calibrateStrip
virtual StatusCode calibrateStrip(const EventContext &ctx, const Muon::MM_RawData *mmRawData, NSWCalib::CalibratedStrip &calibStrip) const =0
Muon::INSWCalibTool::calibrateStrip
virtual StatusCode calibrateStrip(const EventContext &ctx, const Muon::STGC_RawData *sTGCRawData, NSWCalib::CalibratedStrip &calibStrip) const =0
NSWCalib::MicroMegaGas::interactionDensityMean
float interactionDensityMean
Definition: INSWCalibTool.h:38
NSWCalib::CalibratedStrip::distDrift
double distDrift
Definition: INSWCalibTool.h:24
NSWCalib::CalibratedStrip::dx
double dx
Definition: INSWCalibTool.h:27
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
NSWCalib::CalibratedStrip::resTransDistDrift
double resTransDistDrift
Definition: INSWCalibTool.h:25
NSWCalib::MicroMegaGas::driftVelocity
float driftVelocity
//0.050 drift velocity in [mm/ns], driftGap=5 mm +0.128 mm (the amplification gap)
Definition: INSWCalibTool.h:34
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
NSWCalib::CalibratedStrip::resTime
double resTime
Definition: INSWCalibTool.h:23
NSWCalib::CalibratedStrip::resLongDistDrift
double resLongDistDrift
Definition: INSWCalibTool.h:26
Muon::INSWCalibTool::timeToTdo
virtual bool timeToTdo(const EventContext &ctx, const float time, const Identifier &chnlId, int &tdo, int &relBCID) const =0
Muon::INSWCalibTool::calibrateStrip
virtual StatusCode calibrateStrip(const Identifier &id, const double time, const double charge, const double lorentzAngle, NSWCalib::CalibratedStrip &calibStrip) const =0
GeoPrimitives.h
NSWCalib::MicroMegaGas::interactionDensitySigma
float interactionDensitySigma
Definition: INSWCalibTool.h:39
NSWCalib::MicroMegaGas::angleFunction
std::function< double(double)> angleFunction
Definition: INSWCalibTool.h:40
Muon::STGC_RawData
Definition: STGC_RawData.h:14
Muon::MM_RawData
Temporary class to hold the MM RDO.
Definition: MM_RawData.h:20
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
NSWCalib::CalibratedStrip::locPos
Amg::Vector2D locPos
Definition: INSWCalibTool.h:28
Muon::INSWCalibTool::mmPeakTime
virtual float mmPeakTime() const =0
NSWCalib
Definition: INSWCalibTool.h:18
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
NSWCalib::CalibratedStrip
Definition: INSWCalibTool.h:20
Muon::INSWCalibTool::distToTime
virtual StatusCode distToTime(const EventContext &ctx, const Muon::MMPrepData *prepData, const Amg::Vector3D &globalPos, const std::vector< double > &driftDistances, std::vector< double > &driftTimes) const =0
charge
double charge(const T &p)
Definition: AtlasPID.h:756
NSWCalib::MicroMegaGas::dummy_func
static angleFunction dummy_func()
Dummy function to be used for the initialization.
Definition: INSWCalibTool.h:42
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
NSWCalib::MicroMegaGas::transverseDiffusionSigma
float transverseDiffusionSigma
Definition: INSWCalibTool.h:37
Muon::INSWCalibTool::pdoToCharge
virtual bool pdoToCharge(const EventContext &ctx, const bool inCounts, const int pdo, const Identifier &chnlId, float &charge) const =0
Muon::INSWCalibTool::interfaceID
static const InterfaceID & interfaceID()
Definition: INSWCalibTool.h:63
Muon::INSWCalibTool::mmGasProperties
virtual NSWCalib::MicroMegaGas mmGasProperties() const =0
Muon::INSWCalibTool::stgcPeakTime
virtual float stgcPeakTime() const =0
Muon::INSWCalibTool
Definition: INSWCalibTool.h:59
Muon::INSWCalibTool::chargeToPdo
virtual bool chargeToPdo(const EventContext &ctx, const float charge, const Identifier &chnlId, int &pdo) const =0
readCCLHist.float
float
Definition: readCCLHist.py:83
NSWCalib::MicroMegaGas
Definition: INSWCalibTool.h:32
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32
NSWCalib::CalibratedStrip::identifier
Identifier identifier
Definition: INSWCalibTool.h:29
Identifier
Definition: IdentifierFieldParser.cxx:14