ATLAS Offline Software
HitInfo.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRT_CALIBDATA__HITINFO_H
6 #define TRT_CALIBDATA__HITINFO_H
7 /********************************************************************
8 
9 NAME: TRT::Hit
10 PACKAGE: TRT_AlignData
11 
12 AUTHORS: Jorgen Beck Hansen
13 CREATED: December 2005
14 
15 PURPOSE: "messenger"-class for hit information used inside
16  TRT Alignment
17 
18 ********************************************************************/
19 
20 // INCLUDES:
21 
22 #include <vector>
23 #include "InDetIdentifier/TRT_ID.h"
24 #include "CLHEP/Matrix/SymMatrix.h"
25 #include "CLHEP/Matrix/Vector.h"
26 #include <CLHEP/Matrix/Matrix.h>
27 
28 namespace InDet
29 {
30  class TRT_DriftCircleOnTrack ;
31 }
32 
33 namespace TRT{
34  namespace Hit {
35  // Declare indices
37  globalR = 0,
42  t0,
53  TNOFV // always leave as last enum and DON*T change
54  };
55  // Declare names
56  const std::string floatVariableName[TNOFV]={
57  "globalR",
58  "globalPhi",
59  "globalZ",
60  "signedDriftRadius",
61  "errorSignedDriftRadius",
62  "t0",
63  "driftTime",
64  "HTLevel",
65  "TimeoverThreshold",
66  "positionOnWire",
67  "errorPositionOnWire",
68  "trackDriftRadius",
69  "errorTrackDriftRadius",
70  "driftVelocity",
71  "trackDriftTime",
72  "trackT0"
73  };
74 
75  // Declare indices
77  ident = 0,
85  TNOIV // always leave as last enum and DON*T change
86  };
87  // Declare names
88  const std::string intVariableName[TNOIV]={
89  "ident",
90  "detector",
91  "layer",
92  "phiModule",
93  "strawLayer",
94  "straw",
95  "side",
96  "driftTimeStatus"
97  };
98  }
99 
100  class HitInfo {
101  public:
102  // Constructors
104  HitInfo(const HitInfo& orig)= default;
105  HitInfo(HitInfo&& orig) noexcept = default;
106  //assignment
107  HitInfo & operator=(const HitInfo & other)=default;
108  HitInfo & operator=(HitInfo && other) noexcept =default;
109  // Destructor
110  ~HitInfo()=default;
111  // Access
112  const int& operator[](const Hit::IntVariables& theIndex) const {return m_Ints[theIndex];}
113  const float& operator[](const Hit::FloatVariables& theIndex) const {return m_Floats[theIndex];}
114  // Set/modify
115  int& operator[](const Hit::IntVariables& theIndex) {return m_Ints[theIndex];}
116  float& operator[](const Hit::FloatVariables& theIndex) {return m_Floats[theIndex];}
117 
118  // methods
119  float driftTime() const { return operator[](Hit::driftTime) - operator[](Hit::t0); }
120 // float driftTime() const { return operator[](Hit::driftTime) - operator[](Hit::t0) - operator[](Hit::trackT0); }
121  float driftRadius() const { return operator[](Hit::signedDriftRadius) ; }
122  float rawTime() const { return operator[](Hit::driftTime) ;}
123  float timeResidual() const { return driftTime() - trkDriftTime() ; }
125  float trkVariance() const { float tmp = operator[](Hit::errorTrackDriftRadius) ; return tmp*tmp ; }
126  float trkDistance() const { return operator[](Hit::trackDriftRadius) ; }
127  float trkDriftTime() const { return operator[](Hit::trackDriftTime) ; }
128  float trkT0() const { return operator[](Hit::trackT0) ; }
129  float driftVelocity() const { return operator[](Hit::driftVelocity) ; }
130  float residualVariance() const {
132  float residualPull() const { return residual()/sqrt(residualVariance()) ; }
133  float chiSquare() const { double tmp = residual() ; return tmp*tmp/residualVariance() ; }
134  float phiResidual() const { return residual()/operator[](Hit::globalR) ; }
135  float t0() const { return operator[](Hit::t0) ; }
136 
137  Identifier strawId(const TRT_ID& trtid) const {
138  // this method should not be inligned because it introduces a dependency
139  return trtid.straw_id(operator[](TRT::Hit::detector), operator[](TRT::Hit::phiModule),
140  operator[](TRT::Hit::layer),operator[](TRT::Hit::strawLayer),operator[](TRT::Hit::straw)); }
141 
142  Identifier moduleId(const TRT_ID& trtid) const {
143  // this method should not be inligned because it introduces a dependency
144  return trtid.module_id(operator[](TRT::Hit::detector), operator[](TRT::Hit::phiModule),operator[](TRT::Hit::layer)) ; }
145 
146  Identifier ident() const { return Identifier(operator[](TRT::Hit::ident)) ; }
147 
149  float HighLevelThreshold() const { return operator[](Hit::HTLevel) ; }
151  private:
152  std::vector<int> m_Ints;
153  std::vector<float> m_Floats;
154  };
155 }
156 
157 #endif //TRT_CALIBDATA__HITINFO_H
TRT::HitInfo::operator=
HitInfo & operator=(const HitInfo &other)=default
TRT::Hit::straw
@ straw
Definition: HitInfo.h:82
TRT::HitInfo::m_Ints
std::vector< int > m_Ints
Definition: HitInfo.h:152
TRT::Hit::IntVariables
IntVariables
Definition: HitInfo.h:76
TRT::HitInfo::chiSquare
float chiSquare() const
Definition: HitInfo.h:133
TRT::Hit::trackT0
@ trackT0
Definition: HitInfo.h:52
TRT::Hit::positionOnWire
@ positionOnWire
Definition: HitInfo.h:46
TRT::HitInfo::phiResidual
float phiResidual() const
Definition: HitInfo.h:134
TRT::Hit::driftTimeStatus
@ driftTimeStatus
Definition: HitInfo.h:84
TRT::HitInfo::trkDriftTime
float trkDriftTime() const
Definition: HitInfo.h:127
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
TRT::Hit::intVariableName
const std::string intVariableName[TNOIV]
Definition: HitInfo.h:88
TRT::HitInfo::m_Floats
std::vector< float > m_Floats
Definition: HitInfo.h:153
TRT::Hit::strawLayer
@ strawLayer
Definition: HitInfo.h:81
TRT::Hit::signedDriftRadius
@ signedDriftRadius
Definition: HitInfo.h:40
TRT::HitInfo::t0
float t0() const
Definition: HitInfo.h:135
TRT_ID.h
This is an Identifier helper class for the TRT subdetector. This class is a factory for creating comp...
TRT::Hit::globalZ
@ globalZ
Definition: HitInfo.h:39
TRT::HitInfo::operator[]
const float & operator[](const Hit::FloatVariables &theIndex) const
Definition: HitInfo.h:113
TRT::HitInfo::ident
Identifier ident() const
Definition: HitInfo.h:146
TRT::HitInfo::operator[]
float & operator[](const Hit::FloatVariables &theIndex)
Definition: HitInfo.h:116
TRT::HitInfo::HitInfo
HitInfo()
Definition: HitInfo.h:103
TRT::HitInfo::residualPull
float residualPull() const
Definition: HitInfo.h:132
TRT::HitInfo::~HitInfo
~HitInfo()=default
TRT::HitInfo::rawTime
float rawTime() const
Definition: HitInfo.h:122
TRT::HitInfo::operator[]
const int & operator[](const Hit::IntVariables &theIndex) const
Definition: HitInfo.h:112
TRT::Hit::detector
@ detector
Definition: HitInfo.h:78
TRT::HitInfo::moduleId
Identifier moduleId(const TRT_ID &trtid) const
Definition: HitInfo.h:142
TRT::HitInfo::residual
float residual() const
Definition: HitInfo.h:124
TRT::Hit::side
@ side
Definition: HitInfo.h:83
TRT::HitInfo::operator[]
int & operator[](const Hit::IntVariables &theIndex)
Definition: HitInfo.h:115
TRT::Hit::TimeoverThreshold
@ TimeoverThreshold
Definition: HitInfo.h:44
Hit
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.h:16
TRT::Hit::driftVelocity
@ driftVelocity
Definition: HitInfo.h:50
TRT::Hit::driftTime
@ driftTime
Definition: HitInfo.h:43
TRT::HitInfo::driftTime
float driftTime() const
Definition: HitInfo.h:119
TRT
Definition: HitInfo.h:33
TRT::HitInfo::residualVariance
float residualVariance() const
Definition: HitInfo.h:130
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
TRT::HitInfo::operator=
HitInfo & operator=(HitInfo &&other) noexcept=default
TRT::Hit::HTLevel
@ HTLevel
Definition: HitInfo.h:45
TRT::Hit::trackDriftRadius
@ trackDriftRadius
Definition: HitInfo.h:48
TRT::Hit::TNOFV
@ TNOFV
Definition: HitInfo.h:53
TRT::HitInfo::HitInfo
HitInfo(const HitInfo &orig)=default
TRT::Hit::FloatVariables
FloatVariables
Definition: HitInfo.h:36
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
TRT::Hit::globalR
@ globalR
Definition: HitInfo.h:37
TRT::HitInfo::hasValidDriftTime
bool hasValidDriftTime() const
Definition: HitInfo.h:148
TRT::HitInfo::trkT0
float trkT0() const
Definition: HitInfo.h:128
TRT::Hit::globalPhi
@ globalPhi
Definition: HitInfo.h:38
TRT::HitInfo::timeOverThreshold
float timeOverThreshold() const
Definition: HitInfo.h:150
TRT::HitInfo::HitInfo
HitInfo(HitInfo &&orig) noexcept=default
TRT::HitInfo::trkDistance
float trkDistance() const
Definition: HitInfo.h:126
TRT::Hit::TNOIV
@ TNOIV
Definition: HitInfo.h:85
TRT::Hit::errorPositionOnWire
@ errorPositionOnWire
Definition: HitInfo.h:47
TRT::Hit::ident
@ ident
Definition: HitInfo.h:77
TRT::HitInfo
Definition: HitInfo.h:100
TRT::HitInfo::HighLevelThreshold
float HighLevelThreshold() const
Definition: HitInfo.h:149
TRT::Hit::floatVariableName
const std::string floatVariableName[TNOFV]
Definition: HitInfo.h:56
TRT::HitInfo::trkVariance
float trkVariance() const
Definition: HitInfo.h:125
TRT::Hit::errorTrackDriftRadius
@ errorTrackDriftRadius
Definition: HitInfo.h:49
TRT_ID
Definition: TRT_ID.h:84
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
TRT::HitInfo::driftRadius
float driftRadius() const
Definition: HitInfo.h:121
TRT::Hit::phiModule
@ phiModule
Definition: HitInfo.h:80
TRT::Hit::t0
@ t0
Definition: HitInfo.h:42
TRT::Hit::trackDriftTime
@ trackDriftTime
Definition: HitInfo.h:51
TRT::HitInfo::strawId
Identifier strawId(const TRT_ID &trtid) const
Definition: HitInfo.h:137
TRT::HitInfo::timeResidual
float timeResidual() const
Definition: HitInfo.h:123
TRT::Hit::errorSignedDriftRadius
@ errorSignedDriftRadius
Definition: HitInfo.h:41
TRT::HitInfo::driftVelocity
float driftVelocity() const
Definition: HitInfo.h:129
TRT_ID::module_id
Identifier module_id(int barrel_ec, int phi_module, int layer_or_wheel) const
For an individual module phi sector.
Definition: TRT_ID.h:448
TRT_ID::straw_id
Identifier straw_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer, int straw) const
Three ways of getting id for a single straw:
Definition: TRT_ID.h:581
Identifier
Definition: IdentifierFieldParser.cxx:14