ATLAS Offline Software
TRT_ElectronPidTool_ToTcalculation.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // TRT_ElectronPidTool_ToTcalculation.h, (c) ATLAS Detector software
8 
9 /****************************************************************************************\
10 
11  This class is only instantiated once in the constuctor of the Pid Tool.
12  It was created in order to encapsulate the code that is used for
13  the Time over Threshold calulation that forms part of the Pid Tool.
14  It is not true singleton as this was deemed unnecessary.
15 
16  Original creator: Simon Heisterkamp (simon.heisterkamp@cern.ch)
17 
18 \****************************************************************************************/
20 
22  public AthMessaging {
23  public:
24 
25  static const int my_CurrentVersion = 4;
26 
28  virtual ~ToTcalculator();
29 
30  // set constants to hard coded defaults
32 
33  // get the ToT from the bitpattern and correct for local variations
34  double GetToT(unsigned int bitpattern, double HitZ, double HitR, int BEC, int Layer, int Strawlayer);
35 
36  // get the distance used to normalize the ToT
37  double GetD(double R_track);
38 
39  // get the likelyhood based on the sumToT/sumD we found for all hits on this track
40  double GetElProb(double ToTbyD);
41  //float Limit(float prob);
42 
43  //void PrintBlob();
44  // bool FillBlob(const unsigned char*);
45 
46  private:
47  // as long has reading from database does not work well yet, do this check:
48  // bool HasDataBeenInitialized;
49  //void checkIntialization();
50 
51  // primary extraction of ToT from Bitpattern
52  double ExtractToT(unsigned int bitpattern);
53 
54  // apply local corrections to the ToT
55  double correctToT(double ToT, double HitZ, double HitR, int BEC, int Layer, int Strawlayer);
56 
57  // the following functions correct the ToT in various parts of the detector.
58  // the right one is selected by correctToT
59  double BarrelLongToTCorrection(double, double, const float*);
60  double BarrelShortToTCorrection(double, double, const float*);
61  double EndcapToTCorrection(double, double, const float*);
62 
63  // to linearize the indices of all calibration constants
64  int resolveIndex(int BEC, int Layer, int Strawlayer);
65 
66  // /------------------------------------------------------------------------
67  // | The following code describes the internal structure of the blob
68  // |
69  // | Sizes:
70  static const int NparsBarrel = 3;
71  static const int NparsEndcap = 4;
72 
73  static const int NparametrizedSectionsBarrel = 73;
74  static const int NparametrizedSectionsEndcap = 14;
75 
76  static const int SIZE_OF_HEADER = 16;
77  static const int SIZE_GAUS_PARS = 9 * sizeof(float);
80  static const int SIZE_TOT_CONSTANTS = N_TOT_CONSTANTS * sizeof(float);
81 
82  static const int SIZE_PAR_VAL = 4 * sizeof(float);
83 
84  static const int OFF_GAUS_PARS_ELE = SIZE_OF_HEADER;
88 
89  // parameter offsets
90  static const int PAR0 = 0;
91  static const int PAR1 = 1;
92  static const int PAR2 = 2;
93  static const int PAR3 = 3;
94  //static const int PARVAL = 0;
95 
96  // |
97  // | End of Blob structure
98  // \------------------------------------------------------------------------
99 
100  // unsigned char ToTBlob[ BLOB_SIZE ];
101 
102  // the following are handles on the various sections of the ToTBlob
104 
107 
108  //The following look like detector specific offsets,
109  // but in reality the first one is a global offset and the others are not used
114 
115  // float & UpperLimit;
116  // float & LowerLimit;
117 };
InDet::TRT_ElectronPidTool::ToTcalculator::SIZE_TOT_CONSTANTS
static const int SIZE_TOT_CONSTANTS
Definition: TRT_ElectronPidTool_ToTcalculation.h:80
InDet::TRT_ElectronPidTool::ToTcalculator::NparsBarrel
static const int NparsBarrel
Definition: TRT_ElectronPidTool_ToTcalculation.h:70
InDet::TRT_ElectronPidTool::ToTcalculator::ToTcalculator
ToTcalculator(AthAlgTool &)
InDet::TRT_ElectronPidTool::ToTcalculator::SIZE_GAUS_PARS
static const int SIZE_GAUS_PARS
Definition: TRT_ElectronPidTool_ToTcalculation.h:77
LArNewCalib_Delay_OFC_Cali.BEC
BEC
Definition: LArNewCalib_Delay_OFC_Cali.py:119
InDet::TRT_ElectronPidTool::ToTcalculator::GetElProb
double GetElProb(double ToTbyD)
InDet::TRT_ElectronPidTool::ToTcalculator::NparsEndcap
static const int NparsEndcap
Definition: TRT_ElectronPidTool_ToTcalculation.h:71
InDet::TRT_ElectronPidTool::ToTcalculator::parValBarrelLongNeg
float & parValBarrelLongNeg
Definition: TRT_ElectronPidTool_ToTcalculation.h:110
InDet::TRT_ElectronPidTool::ToTcalculator::correctToT
double correctToT(double ToT, double HitZ, double HitR, int BEC, int Layer, int Strawlayer)
InDet::TRT_ElectronPidTool::ToTcalculator::NparametrizedSectionsEndcap
static const int NparametrizedSectionsEndcap
Definition: TRT_ElectronPidTool_ToTcalculation.h:74
InDet::TRT_ElectronPidTool::ToTcalculator::setDefaultCalibrationConstants
void setDefaultCalibrationConstants()
InDet::TRT_ElectronPidTool::ToTcalculator::OFF_TOT_CONSTANTS
static const int OFF_TOT_CONSTANTS
Definition: TRT_ElectronPidTool_ToTcalculation.h:86
InDet::TRT_ElectronPidTool::ToTcalculator::parValBarrelShortNeg
float & parValBarrelShortNeg
Definition: TRT_ElectronPidTool_ToTcalculation.h:112
InDet::TRT_ElectronPidTool::ToTcalculator::resolveIndex
int resolveIndex(int BEC, int Layer, int Strawlayer)
InDet::TRT_ElectronPidTool::ToTcalculator::PAR2
static const int PAR2
Definition: TRT_ElectronPidTool_ToTcalculation.h:92
InDet::TRT_ElectronPidTool::ToTcalculator::gausParametersElectron
float * gausParametersElectron
Definition: TRT_ElectronPidTool_ToTcalculation.h:105
python.RingerConstants.Layer
Layer
Definition: RingerConstants.py:42
InDet::TRT_ElectronPidTool::ToTcalculator::SIZE_PAR_VAL
static const int SIZE_PAR_VAL
Definition: TRT_ElectronPidTool_ToTcalculation.h:82
InDet::TRT_ElectronPidTool::ToTcalculator::N_TOT_CONSTANTS
static const int N_TOT_CONSTANTS
Definition: TRT_ElectronPidTool_ToTcalculation.h:78
InDet::TRT_ElectronPidTool::ToTcalculator::my_CurrentVersion
static const int my_CurrentVersion
Definition: TRT_ElectronPidTool_ToTcalculation.h:25
InDet::TRT_ElectronPidTool::ToTcalculator
Definition: TRT_ElectronPidTool_ToTcalculation.h:22
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
InDet::TRT_ElectronPidTool::ToTcalculator::BarrelLongToTCorrection
double BarrelLongToTCorrection(double, double, const float *)
InDet::BaseTRTPIDCalculator
Definition: BaseTRTPIDCalculator.h:19
InDet::TRT_ElectronPidTool::ToTcalculator::OFF_GAUS_PARS_ELE
static const int OFF_GAUS_PARS_ELE
Definition: TRT_ElectronPidTool_ToTcalculation.h:84
InDet::TRT_ElectronPidTool::ToTcalculator::GetD
double GetD(double R_track)
InDet::TRT_ElectronPidTool::ToTcalculator::gausParametersPion
float * gausParametersPion
Definition: TRT_ElectronPidTool_ToTcalculation.h:106
InDet::TRT_ElectronPidTool::ToTcalculator::PAR3
static const int PAR3
Definition: TRT_ElectronPidTool_ToTcalculation.h:93
InDet::TRT_ElectronPidTool::ToTcalculator::SIZE_OF_HEADER
static const int SIZE_OF_HEADER
Definition: TRT_ElectronPidTool_ToTcalculation.h:76
InDet::TRT_ElectronPidTool::ToTcalculator::ExtractToT
double ExtractToT(unsigned int bitpattern)
InDet::TRT_ElectronPidTool::ToTcalculator::parValBarrelLongPos
float & parValBarrelLongPos
Definition: TRT_ElectronPidTool_ToTcalculation.h:111
InDet::TRT_ElectronPidTool::ToTcalculator::GetToT
double GetToT(unsigned int bitpattern, double HitZ, double HitR, int BEC, int Layer, int Strawlayer)
InDet::TRT_ElectronPidTool::ToTcalculator::parValBarrelShortPos
float & parValBarrelShortPos
Definition: TRT_ElectronPidTool_ToTcalculation.h:113
InDet::TRT_ElectronPidTool::ToTcalculator::NparametrizedSectionsBarrel
static const int NparametrizedSectionsBarrel
Definition: TRT_ElectronPidTool_ToTcalculation.h:73
InDet::TRT_ElectronPidTool::ToTcalculator::EndcapToTCorrection
double EndcapToTCorrection(double, double, const float *)
InDet::TRT_ElectronPidTool::ToTcalculator::~ToTcalculator
virtual ~ToTcalculator()
InDet::TRT_ElectronPidTool::ToTcalculator::PAR0
static const int PAR0
Definition: TRT_ElectronPidTool_ToTcalculation.h:90
AthMessaging.h
InDet::TRT_ElectronPidTool::ToTcalculator::OFF_PAR_VALS
static const int OFF_PAR_VALS
Definition: TRT_ElectronPidTool_ToTcalculation.h:87
InDet::TRT_ElectronPidTool::ToTcalculator::PAR1
static const int PAR1
Definition: TRT_ElectronPidTool_ToTcalculation.h:91
InDet::TRT_ElectronPidTool::ToTcalculator::ToTCorrectionConstants
float * ToTCorrectionConstants
Definition: TRT_ElectronPidTool_ToTcalculation.h:103
AthAlgTool
Definition: AthAlgTool.h:26
InDet::TRT_ElectronPidTool::ToTcalculator::OFF_GAUS_PARS_PIO
static const int OFF_GAUS_PARS_PIO
Definition: TRT_ElectronPidTool_ToTcalculation.h:85
readCCLHist.float
float
Definition: readCCLHist.py:83
InDet::TRT_ElectronPidTool::ToTcalculator::BarrelShortToTCorrection
double BarrelShortToTCorrection(double, double, const float *)