|
ATLAS Offline Software
|
#include <TRT_ToT_dEdx.h>
|
| TRT_ToT_dEdx (const std::string &, const std::string &, const IInterface *) |
| AlgTool like constructor. More...
|
|
virtual | ~TRT_ToT_dEdx () |
| Virtual destructor. More...
|
|
virtual StatusCode | initialize () override |
| AlgTool initailize method. More...
|
|
virtual double | dEdx (const EventContext &ctx, const Trk::Track *track, bool useHThits, std::optional< float > localOccupancy=std::nullopt) const override final |
| function to calculate sum ToT normalised to number of used hits More...
|
|
virtual double | usedHits (const EventContext &ctx, const Trk::Track *track, bool useHThits=true) const override final |
| function to calculate number of used hits More...
|
|
virtual double | getTest (const EventContext &ctx, const double dEdx_obs, const double pTrk, Trk::ParticleHypothesis hypothesis, Trk::ParticleHypothesis antihypothesis, int nUsedHits) const override final |
| function to calculate likelihood ratio test More...
|
|
void | setStatusCorrection (bool value) |
|
bool | getStatusCorrection () const |
|
void | setCorrectionType (EOccupancyCorrection value) |
|
bool | getCorrectionType () const |
|
void | setMinRtrack (float minRtrack) |
|
float | getMinRtrack () const |
|
void | setMaxRtrack (float maxRtrack) |
|
float | getMaxRtrack () const |
|
void | setStatusUseZeroRHitCut (bool value) |
|
bool | getStatusUseZeroRHitCut () const |
|
void | setGasTypeFordEdXCalculation (EGasType gasType) |
|
int | getGasTypeFordEdXCalculation () const |
|
void | setAlgorithm (EstCalc alg) |
|
int | getAlgorithm () const |
|
virtual double | dEdx (const EventContext &ctx, const Trk::Track *track, bool useHitsHT, std::optional< float > localOccupancy=std::nullopt) const=0 |
| function to calculate sum ToT normalised to number of used hits More...
|
|
virtual double | dEdx (const Trk::Track *track, bool useHitsHT, std::optional< float > localOccupancy=std::nullopt) const |
| function to calculate sum ToT normalised to number of used hits More...
|
|
virtual double | usedHits (const EventContext &ctx, const Trk::Track *track, bool useHitsHT=true) const=0 |
| function to calculate number of used hits More...
|
|
virtual double | usedHits (const Trk::Track *track, bool useHitsHT=true) const |
|
virtual double | getTest (const EventContext &ctx, const double dEdx_obs, const double pTrk, Trk::ParticleHypothesis hypothesis, Trk::ParticleHypothesis antihypothesis, int nUsedHits) const=0 |
| function to calculate likelihood ratio test More...
|
|
virtual double | getTest (const double dEdx_obs, const double pTrk, Trk::ParticleHypothesis hypothesis, Trk::ParticleHypothesis antihypothesis, int nUsedHits) const |
|
virtual double | dEdx (const Trk::Track *track, bool useHitsHT, std::optional< float > localOccupancy=std::nullopt) const |
|
virtual double | usedHits (const Trk::Track *track, bool useHitsHT=true) const |
|
virtual double | getTest (const double dEdx_obs, const double pTrk, Trk::ParticleHypothesis hypothesis, Trk::ParticleHypothesis antihypothesis, int nUsedHits) const |
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
bool | isGoodHit (const EventContext &ctx, const Trk::TrackStateOnSurface *trackState, bool useHitsHT, double &length) const |
| function to define what is a good hit to be used for dEdx calculation cuts on track level can be made latekAlgStandardr by the user. More...
|
|
double | correctNormalization (const EventContext &ctx, double nVtx=-1) const |
| correct overall dEdx normalization on track level More...
|
|
double | getProb (const EventContext &ctx, const Trk::TrackStateOnSurface *itr, const double dEdx_obs, const double pTrk, Trk::ParticleHypothesis hypothesis, int nUsedHits) const |
| function to calculate likelihood from prediction and resolution More...
|
|
double | getProb (const EventContext &ctx, EGasType gasType, const double dEdx_obs, const double pTrk, Trk::ParticleHypothesis hypothesis, int nUsedHits) const |
|
double | predictdEdx (const EventContext &ctx, const Trk::TrackStateOnSurface *itr, const double pTrk, Trk::ParticleHypothesis hypothesis) const |
| function to calculate expectation value for dEdx using BB fit More...
|
|
double | predictdEdx (const EventContext &ctx, EGasType gasType, const double pTrk, Trk::ParticleHypothesis hypothesis) const |
|
double | mass (const EventContext &ctx, const Trk::TrackStateOnSurface *itr, const double pTrk, double dEdx) const |
| function to extract most likely mass in bg [0,3] More...
|
|
double | correctToT_corrRZ (const EventContext &ctx, const Trk::TrackStateOnSurface *itr, double length) const |
| main function to correct ToT values on hit level as a function of track radius and z-position More...
|
|
EGasType | gasTypeInStraw (const EventContext &ctx, const Trk::TrackStateOnSurface *itr) const |
| return gas type for that hit More...
|
|
EGasType | gasTypeInStraw (const EventContext &ctx, const InDet::TRT_DriftCircleOnTrack *driftcircle) const |
|
void | renounceArray (SG::VarHandleKeyArray &handlesArray) |
| remove all handles from I/O resolution More...
|
|
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > | renounce (T &h) |
|
void | extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps) |
| Add StoreName to extra input/output deps as needed. More...
|
|
|
double | fitFuncEndcap_corrRZ (const EventContext &ctx, EGasType gas, double driftRadius, double rPosition, int Layer, int sign) const |
| function to compute correction factor in endcap region More...
|
|
double | fitFuncBarrel_corrRZ (const EventContext &ctx, EGasType gas, double driftRadius, double zPosition, int Layer, int StrawLayer) const |
| function to compute correction factor in barrel region More...
|
|
double | fitFuncBarrelLong_corrRZ (const EventContext &ctx, EGasType gasType, double driftRadius, double zPosition, int Layer, int StrawLayer) const |
| function called by fitFuncBarrel_corrRZ for long straws More...
|
|
double | fitFuncBarrelShort_corrRZ (const EventContext &ctx, EGasType gasType, double driftRadius, double zPosition, int StrawLayer) const |
| function called by fitFuncBarrel_corrRZ for short straws More...
|
|
double | fitFuncPol_corrRZ (const EventContext &ctx, EGasType gasType, int parameter, double driftRadius, int Layer, int Strawlayer, int sign, int set) const |
| function called by fitFuncBarrel_corrRZ and fitFuncEndcap_corrRZ More...
|
|
double | fitFuncEndcap_corrRZL (const EventContext &ctx, EGasType gasType, double driftRadius, double radialPosition, int Layer, int sign) const |
| function to compute correction factor in endcap region More...
|
|
double | fitFuncBarrel_corrRZL (const EventContext &ctx, EGasType gasType, double driftRadius, double zPosition, int Layer, int StrawLayer) const |
| function to compute correction factor in barrel region
More...
|
|
double | hitOccupancyCorrection (const EventContext &ctx, const Trk::TrackStateOnSurface *itr) const |
|
double | trackOccupancyCorrection (const EventContext &ctx, const Trk::Track *track, bool useHThits, std::optional< float > localOccupancy) const |
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
|
SG::ReadDecorHandleKey< xAOD::EventInfo > | m_rdhkEvtInfo |
|
const TRT_ID * | m_trtId {nullptr} |
|
ToolHandle< ITRT_StrawStatusSummaryTool > | m_TRTStrawSummaryTool {this, "TRTStrawSummaryTool", "TRT_StrawStatusSummaryTool"} |
|
ToolHandle< Trk::IPRD_AssociationTool > | m_assoTool {this, "AssociationTool","InDet::InDetPRD_AssociationToolGangedPixels","PRD_AssociationTool"} |
|
ToolHandle< InDet::ITRT_LocalOccupancy > | m_localOccTool {this, "TRT_LocalOccupancyTool","", "Local occupancy tool"} |
|
BooleanProperty | m_corrected |
|
BooleanProperty | m_divideByL |
|
IntegerProperty | m_useTrackPartWithGasType |
|
IntegerProperty | m_toolScenario |
|
IntegerProperty | m_correctionType {this, "TRT_dEdx_correctionType", kTrackBased, "Type of dEdx correction"} |
|
BooleanProperty | m_isData {this, "TRT_dEdx_isData", true} |
|
FloatProperty | m_trackConfig_maxRtrack {this, "TRT_dEdx_trackConfig_maxRtrack", 1.85, "maximum track radius"} |
|
FloatProperty | m_trackConfig_minRtrack {this, "TRT_dEdx_trackConfig_minRtrack", 0.15, "maximum track radius"} |
|
BooleanProperty | m_useZeroRHitCut |
|
unsigned int | m_nTrunkateHits = 1 |
|
SG::ReadCondHandleKey< TRTDedxcorrection > | m_ReadKey {this,"Dedxcorrection","Dedxcorrection","Dedx constants in-key"} |
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
Definition at line 48 of file TRT_ToT_dEdx.h.
◆ StoreGateSvc_t
◆ EDataBaseType
◆ EGasType
Enumerator |
---|
kXenon | |
kArgon | |
kKrypton | |
kUnset | |
Definition at line 57 of file TRT_ToT_dEdx.h.
◆ EOccupancyCorrection
Enumerator |
---|
kRSOnly | |
kHitBased | |
kTrackBased | |
kGlobal | |
Definition at line 56 of file TRT_ToT_dEdx.h.
◆ EstCalc
Enumerator |
---|
kAlgStandard | |
kAlgReweight | |
kAlgReweightTrunkOne | |
Definition at line 55 of file TRT_ToT_dEdx.h.
◆ TRT_ToT_dEdx()
TRT_ToT_dEdx::TRT_ToT_dEdx |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
AlgTool like constructor.
Definition at line 35 of file TRT_ToT_dEdx.cxx.
37 declareInterface<ITRT_ToT_dEdx>(
this);
◆ ~TRT_ToT_dEdx()
TRT_ToT_dEdx::~TRT_ToT_dEdx |
( |
| ) |
|
|
virtualdefault |
◆ calculateTrackLengthInStraw()
Definition at line 1185 of file TRT_ToT_dEdx.cxx.
1209 if(trkP==
nullptr)
return 0.;
1211 double Trt_Rtrack = std::abs(trkP->parameters()[
Trk::locR]);
1212 double Trt_HitTheta = trkP->parameters()[
Trk::theta];
1213 double Trt_HitPhi = trkP->parameters()[
Trk::phi];
1215 int HitPart = std::abs(
identifier->barrel_ec(DCId));
1217 double strawphi = element->
center(DCId).phi();
1220 if (Trt_Rtrack >= 2.0) {
1226 length = 2*std::sqrt(4-Trt_Rtrack*Trt_Rtrack)*1./std::abs(
std::sin(Trt_HitTheta));
1227 }
else if (HitPart == 2) {
1231 throw std::runtime_error(
"Unknown barrel/endcap identifier: " +
std::to_string(HitPart) +
". Must be 1(Barrel) or 2(Endcap)");
◆ correctNormalization()
double TRT_ToT_dEdx::correctNormalization |
( |
const EventContext & |
ctx, |
|
|
double |
nVtx = -1 |
|
) |
| const |
|
protected |
correct overall dEdx normalization on track level
- Parameters
-
number | of primary vertices per event |
- Returns
- scaling variable
Definition at line 684 of file TRT_ToT_dEdx.cxx.
688 if(dEdxCorrection==
nullptr) {
689 ATH_MSG_ERROR(
" correctNormalization: Could not find any dEdxCorrection in CondStore. Return zero.");
695 if (nVtx<=0) nVtx=dEdxCorrection->normNzero[gasType];
696 double slope = dEdxCorrection->normSlopeTot[gasType];
697 double offset = dEdxCorrection->normOffsetTot[gasType];
699 slope = dEdxCorrection->normSlopeTotDivideByLength[gasType];
700 offset = dEdxCorrection->normOffsetTotDivideByLength[gasType];
702 double shift = dEdxCorrection->normOffsetData[gasType];
704 return (slope*dEdxCorrection->normNzero[gasType]+
offset)/(slope*nVtx+
offset+shift);
◆ correctToT_corrRZ()
main function to correct ToT values on hit level as a function of track radius and z-position
- Parameters
-
track | on surface object |
bool | variable to specify whether ToT or ToT/L correction |
bool | variable to specify whether data or MC correction |
bool | variable whether correction should actually be applied |
bool | variable whether mimic ToT to other gas hits shoule be used |
- Returns
- corrected value for ToT
- Todo:
- implement possiblity to set the scaling factor run-by-run from database, should probably be done later on track- level
Definition at line 708 of file TRT_ToT_dEdx.cxx.
742 double hitRtrack = std::abs(trkP->parameters()[
Trk::locR]);
745 ATH_MSG_ERROR(
"correctToT_corrRZ(const Trk::TrackStateOnSurface *itr):: Gas type in straw is kUnset! Return ToT = 0");
756 double hitPosR = std::sqrt(trackx*trackx+tracky*tracky);
773 if (std::isinf(valToT))
return 0.;
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ dEdx() [1/4]
virtual double ITRT_ToT_dEdx::dEdx |
function to calculate sum ToT normalised to number of used hits
- Parameters
-
track | pointer to track |
useHitsHT | decide if HT hits should be used in the estimate |
- Returns
- dEdx value
◆ dEdx() [2/4]
double TRT_ToT_dEdx::dEdx |
( |
const EventContext & |
ctx, |
|
|
const Trk::Track * |
track, |
|
|
bool |
useHitsHT, |
|
|
std::optional< float > |
localOccupancy = std::nullopt |
|
) |
| const |
|
finaloverridevirtual |
function to calculate sum ToT normalised to number of used hits
- Parameters
-
Event | context ctx |
track | pointer to track |
useHitsHT | decide if HT hits should be used in the estimate |
- Returns
- dEdx value
Implements ITRT_ToT_dEdx.
Definition at line 133 of file TRT_ToT_dEdx.cxx.
143 if(!eventInfoDecor.isPresent()) {
150 double mu = eventInfoDecor(0);
152 nVtx = 1.3129 + 0.716194*
mu + (-0.00475074)*
mu*
mu;
155 nVtx = 1.0897 + 0.748287*
mu + (-0.00421788)*
mu*
mu;
169 size_t vtos_size = vtsos->
size();
170 double correctionFactor = 1.;
173 std::vector<double> vecToT;
174 vecToT.reserve(vtos_size);
177 for ( ; itr!=itre ; ++itr) {
183 ToT_correct*=correctionFactor;
185 vecToT.push_back(ToT_correct);
189 sort(vecToT.begin(), vecToT.end());
190 size_t nhits = vecToT.size();
197 if (nhits<1)
return 0.0;
205 ToTsum*=correctionFactor;
210 std::vector<double> vecToT_Xe;
211 vecToT_Xe.reserve(vtos_size/2);
212 std::vector<double> vecToT_Ar;
213 vecToT_Ar.reserve(vtos_size/2);
214 std::vector<double> vecToT_Kr;
218 "dEdX_Estimator():: Using m_toolScenario="
219 <<
m_toolScenario <<
" scenario m_useTrackPartWithGasType is set to"
221 <<
", but kUnset is requiered. Check you tool configuration.");
224 for ( ; itr!=itre ; ++itr) {
232 ToT_correct*=correctionFactor;
234 vecToT_Xe.push_back(ToT_correct);
235 }
else if (gasType==
kArgon) {
236 vecToT_Ar.push_back(ToT_correct);
238 vecToT_Kr.push_back(ToT_correct);
240 ATH_MSG_ERROR(
"dEdX_Estimator():: During scenario kAlgReweight variable gasTypeInStraw got value kUnset.");
245 sort(vecToT_Xe.begin(), vecToT_Xe.end());
246 sort(vecToT_Ar.begin(), vecToT_Ar.end());
247 sort(vecToT_Kr.begin(), vecToT_Kr.end());
249 size_t nhitsXe = vecToT_Xe.size();
250 size_t nhitsAr = vecToT_Ar.size();
251 size_t nhitsKr = vecToT_Kr.size();
261 if (nhitsXe>0 && vecToT_Xe.at(nhitsXe-1)>maxToT) {
263 maxToT = vecToT_Xe.at(nhitsXe-1);
265 if(nhitsAr>0 && vecToT_Ar.at(nhitsAr-1)>maxToT){
267 maxToT = vecToT_Ar.at(nhitsAr-1);
269 if (nhitsKr>0 && vecToT_Kr.at(nhitsKr-1)>maxToT) {
275 }
else if (trunkGas==
kArgon) {
283 size_t nhits = nhitsXe + nhitsAr + nhitsKr;
284 if(nhits<1)
return 0.0;
289 for (
size_t i = 0;
i < nhitsXe;
i++) {
290 ToTsumXe+=vecToT_Xe[
i];
292 for (
size_t i = 0;
i < nhitsAr;
i++) {
293 ToTsumAr+=vecToT_Ar[
i];
295 for (
size_t i = 0;
i < nhitsKr;
i++) {
296 ToTsumKr+=vecToT_Kr[
i];
299 ToTsumXe = (nhitsXe>0) ? ToTsumXe/nhitsXe : 0;
300 ToTsumAr = (nhitsAr>0) ? ToTsumAr/nhitsAr : 0;
301 ToTsumKr = (nhitsKr>0) ? ToTsumKr/nhitsKr : 0;
302 double ToTsum = ToTsumXe*nhitsXe + ToTsumAr*nhitsAr + ToTsumKr*nhitsKr;
310 ToTsum *= correctionFactor;
◆ dEdx() [3/4]
double ITRT_ToT_dEdx::dEdx |
( |
const Trk::Track * |
track, |
|
|
bool |
useHitsHT, |
|
|
std::optional< float > |
localOccupancy = std::nullopt |
|
) |
| const |
|
inlinevirtualinherited |
◆ dEdx() [4/4]
double ITRT_ToT_dEdx::dEdx |
|
inline |
function to calculate sum ToT normalised to number of used hits
- Parameters
-
track | pointer to track |
useHitsHT | decide if HT hits should be used in the estimate |
- Returns
- dEdx value
Definition at line 45 of file ITRT_ToT_dEdx.h.
95 return dEdx(Gaudi::Hive::currentContext(),
track, useHitsHT, localOccupancy);
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ fitFuncBarrel_corrRZ()
double TRT_ToT_dEdx::fitFuncBarrel_corrRZ |
( |
const EventContext & |
ctx, |
|
|
EGasType |
gas, |
|
|
double |
driftRadius, |
|
|
double |
zPosition, |
|
|
int |
Layer, |
|
|
int |
StrawLayer |
|
) |
| const |
|
private |
function to compute correction factor in barrel region
- Parameters
-
driftradius | |
z | position |
layer | index |
straw | layer index |
bool | variable to specify whether data or MC correction |
- Returns
- correction
Definition at line 779 of file TRT_ToT_dEdx.cxx.
786 if (
Layer == 0 && StrawLayer < 9) {
◆ fitFuncBarrel_corrRZL()
double TRT_ToT_dEdx::fitFuncBarrel_corrRZL |
( |
const EventContext & |
ctx, |
|
|
EGasType |
gasType, |
|
|
double |
driftRadius, |
|
|
double |
zPosition, |
|
|
int |
Layer, |
|
|
int |
StrawLayer |
|
) |
| const |
|
private |
function to compute correction factor in barrel region
- Parameters
-
driftradius | |
z | position |
layer | index
|
straw | layer index
|
desired | version of ToT definition |
bool | variable to specify whether data or MC correction
|
- Returns
- correction
Definition at line 990 of file TRT_ToT_dEdx.cxx.
1002 if(dEdxCorrection==
nullptr) {
1003 ATH_MSG_ERROR(
" fitFuncBarrel_corrRZL: Could not find any dEdxCorrection in CondStore. Return zero.");
1008 if (
Layer==0 && Strawlayer<9) {
1010 a = dEdxCorrection->paraShortCorrRZDivideByLengthDATA[gasType][(0)*9+Strawlayer];
1011 b = dEdxCorrection->paraShortCorrRZDivideByLengthDATA[gasType][(1)*9+Strawlayer];
1012 c = dEdxCorrection->paraShortCorrRZDivideByLengthDATA[gasType][(2)*9+Strawlayer];
1013 d = dEdxCorrection->paraShortCorrRZDivideByLengthDATA[gasType][(3)*9+Strawlayer];
1014 e = dEdxCorrection->paraShortCorrRZDivideByLengthDATA[gasType][(4)*9+Strawlayer];
1015 f = dEdxCorrection->paraShortCorrRZDivideByLengthDATA[gasType][(5)*9+Strawlayer];
1016 g = dEdxCorrection->paraShortCorrRZDivideByLengthDATA[gasType][(6)*9+Strawlayer];
1018 a = dEdxCorrection->paraShortCorrRZDivideByLengthMC[gasType][(0)*9+Strawlayer];
1019 b = dEdxCorrection->paraShortCorrRZDivideByLengthMC[gasType][(1)*9+Strawlayer];
1020 c = dEdxCorrection->paraShortCorrRZDivideByLengthMC[gasType][(2)*9+Strawlayer];
1021 d = dEdxCorrection->paraShortCorrRZDivideByLengthMC[gasType][(3)*9+Strawlayer];
1022 e = dEdxCorrection->paraShortCorrRZDivideByLengthMC[gasType][(4)*9+Strawlayer];
1023 f = dEdxCorrection->paraShortCorrRZDivideByLengthMC[gasType][(5)*9+Strawlayer];
1024 g = dEdxCorrection->paraShortCorrRZDivideByLengthMC[gasType][(6)*9+Strawlayer];
1028 a = dEdxCorrection->paraLongCorrRZDivideByLengthDATA[gasType][(0)*30*3+
Layer*30+Strawlayer];
1029 b = dEdxCorrection->paraLongCorrRZDivideByLengthDATA[gasType][(1)*30*3+
Layer*30+Strawlayer];
1030 c = dEdxCorrection->paraLongCorrRZDivideByLengthDATA[gasType][(2)*30*3+
Layer*30+Strawlayer];
1031 d = dEdxCorrection->paraLongCorrRZDivideByLengthDATA[gasType][(3)*30*3+
Layer*30+Strawlayer];
1032 e = dEdxCorrection->paraLongCorrRZDivideByLengthDATA[gasType][(4)*30*3+
Layer*30+Strawlayer];
1033 f = dEdxCorrection->paraLongCorrRZDivideByLengthDATA[gasType][(5)*30*3+
Layer*30+Strawlayer];
1034 g = dEdxCorrection->paraLongCorrRZDivideByLengthDATA[gasType][(6)*30*3+
Layer*30+Strawlayer];
1036 a = dEdxCorrection->paraLongCorrRZDivideByLengthMC[gasType][(0)*30*3+
Layer*30+Strawlayer];
1037 b = dEdxCorrection->paraLongCorrRZDivideByLengthMC[gasType][(1)*30*3+
Layer*30+Strawlayer];
1038 c = dEdxCorrection->paraLongCorrRZDivideByLengthMC[gasType][(2)*30*3+
Layer*30+Strawlayer];
1039 d = dEdxCorrection->paraLongCorrRZDivideByLengthMC[gasType][(3)*30*3+
Layer*30+Strawlayer];
1040 e = dEdxCorrection->paraLongCorrRZDivideByLengthMC[gasType][(4)*30*3+
Layer*30+Strawlayer];
1041 f = dEdxCorrection->paraLongCorrRZDivideByLengthMC[gasType][(5)*30*3+
Layer*30+Strawlayer];
1042 g = dEdxCorrection->paraLongCorrRZDivideByLengthMC[gasType][(6)*30*3+
Layer*30+Strawlayer];
1045 double z = std::abs(zPosition);
1053 if (zPosition>0)
result = T0pos+T1+slope*
z;
◆ fitFuncBarrelLong_corrRZ()
double TRT_ToT_dEdx::fitFuncBarrelLong_corrRZ |
( |
const EventContext & |
ctx, |
|
|
EGasType |
gasType, |
|
|
double |
driftRadius, |
|
|
double |
zPosition, |
|
|
int |
Layer, |
|
|
int |
StrawLayer |
|
) |
| const |
|
private |
function called by fitFuncBarrel_corrRZ for long straws
|z| /|z| - l \
T(r,z) = T0(r) + — exp|-------—| v(r) \ s(r) /
Definition at line 809 of file TRT_ToT_dEdx.cxx.
821 double z = std::abs(zPosition);
823 if(zPosition<0)
sign=-1;
831 const double expArg=(
z-
l)/
s;
832 if (not
inRange(expArg, -600.0,600.0)){
833 return expArg>0 ? std::numeric_limits<double>::infinity():0.;
◆ fitFuncBarrelShort_corrRZ()
double TRT_ToT_dEdx::fitFuncBarrelShort_corrRZ |
( |
const EventContext & |
ctx, |
|
|
EGasType |
gasType, |
|
|
double |
driftRadius, |
|
|
double |
zPosition, |
|
|
int |
StrawLayer |
|
) |
| const |
|
private |
function called by fitFuncBarrel_corrRZ for short straws
T(r,z) = T0(r)+ b(r)*|z|
Definition at line 839 of file TRT_ToT_dEdx.cxx.
848 double z = std::abs(zPosition);
850 if(zPosition<0)
sign=-1;
◆ fitFuncEndcap_corrRZ()
double TRT_ToT_dEdx::fitFuncEndcap_corrRZ |
( |
const EventContext & |
ctx, |
|
|
EGasType |
gas, |
|
|
double |
driftRadius, |
|
|
double |
rPosition, |
|
|
int |
Layer, |
|
|
int |
sign |
|
) |
| const |
|
private |
function to compute correction factor in endcap region
- Parameters
-
driftradius | |
radial | position |
straw | layer index |
sign | for positive or negative side |
bool | variable to specify whether data or MC correction |
- Returns
- correction
T(r,R) = T0(r)+ a(r)*R
Definition at line 793 of file TRT_ToT_dEdx.cxx.
805 return T0+
a*radialPosition;
◆ fitFuncEndcap_corrRZL()
double TRT_ToT_dEdx::fitFuncEndcap_corrRZL |
( |
const EventContext & |
ctx, |
|
|
EGasType |
gasType, |
|
|
double |
driftRadius, |
|
|
double |
radialPosition, |
|
|
int |
Layer, |
|
|
int |
sign |
|
) |
| const |
|
private |
function to compute correction factor in endcap region
- Parameters
-
driftradius | |
radial | position |
straw | layer index |
sign | for positive or negative side |
bool | variable to specify whether data or MC correction |
- Returns
- correction
Definition at line 939 of file TRT_ToT_dEdx.cxx.
952 if(dEdxCorrection==
nullptr) {
953 ATH_MSG_ERROR(
" fitFuncEndcap_corrRZL: Could not find any dEdxCorrection in CondStore. Return zero.");
961 a = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(0)*28+
Layer];
962 b = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(1)*28+
Layer];
963 c = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(2)*28+
Layer];
964 d = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(3)*28+
Layer];
965 e = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(4)*28+
Layer];
966 f = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(5)*28+
Layer];
967 g = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(6)*28+
Layer];
968 h = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(7)*28+
Layer];
969 i = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(8)*28+
Layer];
971 a = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(0)*28+
Layer];
972 b = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(1)*28+
Layer];
973 c = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(2)*28+
Layer];
974 d = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(3)*28+
Layer];
975 e = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(4)*28+
Layer];
976 f = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(5)*28+
Layer];
977 g = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(6)*28+
Layer];
978 h = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(7)*28+
Layer];
979 i = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(8)*28+
Layer];
983 double slope =
g+
h*
r+
i*
r*
r;
986 return T0+T1+slope*radialPosition;
◆ fitFuncPol_corrRZ()
double TRT_ToT_dEdx::fitFuncPol_corrRZ |
( |
const EventContext & |
ctx, |
|
|
EGasType |
gasType, |
|
|
int |
parameter, |
|
|
double |
driftRadius, |
|
|
int |
Layer, |
|
|
int |
Strawlayer, |
|
|
int |
sign, |
|
|
int |
set |
|
) |
| const |
|
private |
function called by fitFuncBarrel_corrRZ and fitFuncEndcap_corrRZ
Definition at line 857 of file TRT_ToT_dEdx.cxx.
868 if(dEdxCorrection==
nullptr)
870 ATH_MSG_ERROR(
" fitFuncPol_corrRZ: Could not find any dEdxCorrection in CondStore. Return zero.");
884 a = dEdxCorrection->paraLongCorrRZ[gasType][(6*parameter+0)*30*3+
Layer*30+Strawlayer+
offset];
885 b = dEdxCorrection->paraLongCorrRZ[gasType][(6*parameter+1)*30*3+
Layer*30+Strawlayer+
offset];
886 c = dEdxCorrection->paraLongCorrRZ[gasType][(6*parameter+2)*30*3+
Layer*30+Strawlayer+
offset];
887 d = dEdxCorrection->paraLongCorrRZ[gasType][(6*parameter+3)*30*3+
Layer*30+Strawlayer+
offset];
888 e = dEdxCorrection->paraLongCorrRZ[gasType][(6*parameter+4)*30*3+
Layer*30+Strawlayer+
offset];
889 f = dEdxCorrection->paraLongCorrRZ[gasType][(6*parameter+5)*30*3+
Layer*30+Strawlayer+
offset];
893 a = dEdxCorrection->paraShortCorrRZ[gasType][(6*parameter+0)*9+
Layer+
offset];
894 b = dEdxCorrection->paraShortCorrRZ[gasType][(6*parameter+1)*9+
Layer+
offset];
895 c = dEdxCorrection->paraShortCorrRZ[gasType][(6*parameter+2)*9+
Layer+
offset];
896 d = dEdxCorrection->paraShortCorrRZ[gasType][(6*parameter+3)*9+
Layer+
offset];
897 e = dEdxCorrection->paraShortCorrRZ[gasType][(6*parameter+4)*9+
Layer+
offset];
898 f = dEdxCorrection->paraShortCorrRZ[gasType][(6*parameter+5)*9+
Layer+
offset];
901 a = dEdxCorrection->paraEndCorrRZ[gasType][(6*parameter+0)*28+
Layer];
902 b = dEdxCorrection->paraEndCorrRZ[gasType][(6*parameter+1)*28+
Layer];
903 c = dEdxCorrection->paraEndCorrRZ[gasType][(6*parameter+2)*28+
Layer];
904 d = dEdxCorrection->paraEndCorrRZ[gasType][(6*parameter+3)*28+
Layer];
905 e = dEdxCorrection->paraEndCorrRZ[gasType][(6*parameter+4)*28+
Layer];
906 f = dEdxCorrection->paraEndCorrRZ[gasType][(6*parameter+5)*28+
Layer];
911 a = dEdxCorrection->paraLongCorrRZMC[gasType][(6*parameter+0)*30*3+
Layer*30+Strawlayer+
offset];
912 b = dEdxCorrection->paraLongCorrRZMC[gasType][(6*parameter+1)*30*3+
Layer*30+Strawlayer+
offset];
913 c = dEdxCorrection->paraLongCorrRZMC[gasType][(6*parameter+2)*30*3+
Layer*30+Strawlayer+
offset];
914 d = dEdxCorrection->paraLongCorrRZMC[gasType][(6*parameter+3)*30*3+
Layer*30+Strawlayer+
offset];
915 e = dEdxCorrection->paraLongCorrRZMC[gasType][(6*parameter+4)*30*3+
Layer*30+Strawlayer+
offset];
916 f = dEdxCorrection->paraLongCorrRZMC[gasType][(6*parameter+5)*30*3+
Layer*30+Strawlayer+
offset];
919 a = dEdxCorrection->paraShortCorrRZMC[gasType][(6*parameter+0)*9+
Layer+
offset];
920 b = dEdxCorrection->paraShortCorrRZMC[gasType][(6*parameter+1)*9+
Layer+
offset];
921 c = dEdxCorrection->paraShortCorrRZMC[gasType][(6*parameter+2)*9+
Layer+
offset];
922 d = dEdxCorrection->paraShortCorrRZMC[gasType][(6*parameter+3)*9+
Layer+
offset];
923 e = dEdxCorrection->paraShortCorrRZMC[gasType][(6*parameter+4)*9+
Layer+
offset];
924 f = dEdxCorrection->paraShortCorrRZMC[gasType][(6*parameter+5)*9+
Layer+
offset];
927 a = dEdxCorrection->paraEndCorrRZMC[gasType][(6*parameter+0)*28+
Layer];
928 b = dEdxCorrection->paraEndCorrRZMC[gasType][(6*parameter+1)*28+
Layer];
929 c = dEdxCorrection->paraEndCorrRZMC[gasType][(6*parameter+2)*28+
Layer];
930 d = dEdxCorrection->paraEndCorrRZMC[gasType][(6*parameter+3)*28+
Layer];
931 e = dEdxCorrection->paraEndCorrRZMC[gasType][(6*parameter+4)*28+
Layer];
932 f = dEdxCorrection->paraEndCorrRZMC[gasType][(6*parameter+5)*28+
Layer];
◆ gasTypeInStraw() [1/2]
Definition at line 649 of file TRT_ToT_dEdx.cxx.
670 <<
", must be 'Good(2)||Xenon(3)' or 'Dead(1)||Argon(4)' or "
671 "'Krypton(5)' or 'EmulatedArgon(6)' or 'EmulatedKr(7)'!");
◆ gasTypeInStraw() [2/2]
return gas type for that hit
- Parameters
-
- Returns
- gasType
Definition at line 622 of file TRT_ToT_dEdx.cxx.
◆ getAlgorithm()
int TRT_ToT_dEdx::getAlgorithm |
( |
| ) |
const |
|
inline |
◆ getCorrectionType()
bool TRT_ToT_dEdx::getCorrectionType |
( |
| ) |
const |
|
inline |
◆ getGasTypeFordEdXCalculation()
int TRT_ToT_dEdx::getGasTypeFordEdXCalculation |
( |
| ) |
const |
|
inline |
◆ getMaxRtrack()
float TRT_ToT_dEdx::getMaxRtrack |
( |
| ) |
const |
|
inline |
◆ getMinRtrack()
float TRT_ToT_dEdx::getMinRtrack |
( |
| ) |
const |
|
inline |
◆ getProb() [1/2]
function to calculate likelihood from prediction and resolution
- Parameters
-
observed | dEdx |
track | parameter |
particle | hypothesis |
number | of used hits |
- Returns
- brobability value between 0 and 1
Definition at line 399 of file TRT_ToT_dEdx.cxx.
407 return getProb(ctx,gasType, dEdx_obs, pTrk, hypothesis, nUsedHits);
◆ getProb() [2/2]
Definition at line 411 of file TRT_ToT_dEdx.cxx.
422 if (dEdxCorrection==
nullptr) {
423 ATH_MSG_ERROR(
" getProb: Could not find any dEdxCorrection in CondStore. Return zero.");
428 ATH_MSG_DEBUG(
"getProb():: gasTypeInStraw set kUnset that is not allowed! Use gasTypeInStraw(*itr) to get gas type info for that hit first!");
429 ATH_MSG_DEBUG(
"getProb():: Now gasTypeInStraw sets to kXenon.");
433 double dEdx_pred =
predictdEdx(ctx,gasType, pTrk, hypothesis);
434 if (dEdx_pred==0)
return 0.0;
438 double correct = 1+factor*(0.045*log10(pTrk)+0.885-1);
439 dEdx_pred= dEdx_pred/correct;
443 dEdxCorrection->resolution[gasType][0] +
444 dEdxCorrection->resolution[gasType][1] * (nUsedHits + 0.5) +
445 dEdxCorrection->resolution[gasType][2] * (nUsedHits + 0.5) *
447 dEdxCorrection->resolution[gasType][3] * (nUsedHits + 0.5) *
448 (nUsedHits + 0.5) * (nUsedHits + 0.5);
451 dEdxCorrection->resolutionElectron[gasType][0] +
452 dEdxCorrection->resolutionElectron[gasType][1] * (nUsedHits + 0.5) +
453 dEdxCorrection->resolutionElectron[gasType][2] * (nUsedHits + 0.5) *
455 dEdxCorrection->resolutionElectron[gasType][3] * (nUsedHits + 0.5) *
456 (nUsedHits + 0.5) * (nUsedHits + 0.5);
459 double prob =
std::exp( -0.5 * ( ( ( dEdx_obs - dEdx_pred ) / (Resolution*dEdx_pred) ) *
460 ( ( dEdx_obs - dEdx_pred ) / (Resolution*dEdx_pred) ) )) ;
◆ getStatusCorrection()
bool TRT_ToT_dEdx::getStatusCorrection |
( |
| ) |
const |
|
inline |
◆ getStatusUseZeroRHitCut()
bool TRT_ToT_dEdx::getStatusUseZeroRHitCut |
( |
| ) |
const |
|
inline |
◆ getTest() [1/4]
◆ getTest() [2/4]
double ITRT_ToT_dEdx::getTest |
|
inline |
◆ getTest() [3/4]
function to calculate likelihood ratio test
- Parameters
-
observed | dEdx |
track | parameter |
particle | hypothesis |
antihypothesis | |
number | of used hits |
- Returns
- test value between 0 and 1
Implements ITRT_ToT_dEdx.
Definition at line 467 of file TRT_ToT_dEdx.cxx.
477 if ( dEdx_obs<=0. || pTrk<=0. || nUsedHits<=0 )
return 0.5;
479 double Pone =
getProb(ctx,gasType, dEdx_obs,pTrk,hypothesis,nUsedHits);
480 double Ptwo =
getProb(ctx,gasType, dEdx_obs,pTrk,antihypothesis,nUsedHits);
481 if ((Pone+Ptwo) != 0) {
483 return Pone/(Pone+Ptwo);
◆ getTest() [4/4]
virtual double ITRT_ToT_dEdx::getTest |
function to calculate likelihood ratio test
- Parameters
-
Event | context ctx |
observed | dEdx |
track | parameter |
particle | hypothesis |
antihypothesis | |
number | of used hits |
- Returns
- test value between 0 and 1
◆ hitOccupancyCorrection()
Definition at line 1059 of file TRT_ToT_dEdx.cxx.
1098 double Trt_HitTheta = trkP->parameters()[
Trk::theta];
1105 double p0=0.,
p1=0.,
p2=0., p0_flat=0.;
1110 int nBarrelLayers = 3, nEndcapLayers = 14;
1112 int nParametersPerLayer = 3;
1114 int nHTConfigurations = 2;
1116 int nSharedConfigurations = 2;
1118 layer * nParametersPerLayer +
1119 isHT * ((abs(HitPart) - 1) * (nEndcapLayers - nBarrelLayers) *
1120 nParametersPerLayer +
1121 nBarrelLayers * nParametersPerLayer) +
1122 isShared * ((abs(HitPart) - 1) * (nEndcapLayers - nBarrelLayers) *
1123 nParametersPerLayer * nHTConfigurations +
1124 nBarrelLayers * nParametersPerLayer * nHTConfigurations) +
1125 (abs(HitPart) - 1) * nParametersPerLayer * nBarrelLayers *
1126 nHTConfigurations * nSharedConfigurations;
1128 int num_flat =
layer * 3 +
1129 isHT * ((abs(HitPart) - 1) * (nEndcapLayers - nBarrelLayers) *
1130 nParametersPerLayer +
1131 nBarrelLayers * nParametersPerLayer) +
1132 (abs(HitPart) - 1) * nParametersPerLayer * nBarrelLayers *
1133 nHTConfigurations * nSharedConfigurations;
1135 p0 = dEdxCorrection->hitOccPar[
num];
1136 p1 = dEdxCorrection->hitOccPar[
num+1];
1137 p2 = dEdxCorrection->hitOccPar[
num+2];
1138 p0_flat = dEdxCorrection->hitOccPar[num_flat];
1143 valToT = p0_flat/(
p0+
p1*localOccupancy+
p2*localOccupancy*localOccupancy);
1145 return ToTmip*valToT;
◆ initialize()
StatusCode TRT_ToT_dEdx::initialize |
( |
| ) |
|
|
overridevirtual |
AlgTool initailize method.
Definition at line 47 of file TRT_ToT_dEdx.cxx.
57 return StatusCode::FAILURE;
69 ATH_MSG_ERROR(
"Property TRT_dEdx_useTrackPartWithGasType has an invalid "
71 return StatusCode::FAILURE;
74 return StatusCode::SUCCESS;
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ interfaceID()
static const InterfaceID& ITRT_ToT_dEdx::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
AlgTool interface methods.
Definition at line 30 of file ITRT_ToT_dEdx.h.
30 {
return IID_ITRT_ToT_dEdx; };
◆ isGoodHit()
function to define what is a good hit to be used for dEdx calculation cuts on track level can be made latekAlgStandardr by the user.
Also returns the length in the straw.
- Parameters
-
trackState | measurement on track |
useHitsHT | decide if HT hits should be used in the estimate |
length | length in straw |
- Returns
- decision
Definition at line 78 of file TRT_ToT_dEdx.cxx.
104 if(trkP==
nullptr)
return false;
106 double Trt_Rtrack = std::abs(trkP->parameters()[
Trk::locR]);
120 if (TrtHl==1)
return false;
◆ mass()
function to extract most likely mass in bg [0,3]
- Parameters
-
track | momentum |
measured | dEdx |
- Returns
- mass
- Todo:
- make failsafe
Definition at line 570 of file TRT_ToT_dEdx.cxx.
581 if(dEdxCorrection==
nullptr)
583 ATH_MSG_ERROR(
" mass: Could not find any dEdxCorrection in CondStore. Return zero.");
589 ATH_MSG_WARNING(
"mass():: gasTypeInStraw set kUnset that is not allowed! Use gasTypeInStraw(*itr) to get gas type info for that hit first!");
597 static const double bg_min = 0.001;
598 static const double bg_max = 3;
600 static const std::string blumRolandiFunction =
601 "( [0]/sqrt( (x*x/([5]*[5]))/(1.+(x*x/([5]*[5]))) )^[3] ) * ([1] - sqrt( "
602 "(x*x/([5]*[5]))/(1.+(x*x/([5]*[5]))) )^[3] - log([2]+1./((x/[5])^[4]) ) )";
604 TF1 blumRolandi(
"BR", blumRolandiFunction.c_str(), 0.7, 100000);
606 blumRolandi.SetParameters(dEdxCorrection->paraDedxP1[gasType],
607 dEdxCorrection->paraDedxP2[gasType],
608 dEdxCorrection->paraDedxP3[gasType],
609 dEdxCorrection->paraDedxP4[gasType],
610 dEdxCorrection->paraDedxP5[gasType],
613 double betaGamma = blumRolandi.GetX(
dEdx, bg_min, bg_max);
617 return pTrk/betaGamma;
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ predictdEdx() [1/2]
function to calculate expectation value for dEdx using BB fit
- Parameters
-
- Returns
- dEdx_pred
Definition at line 490 of file TRT_ToT_dEdx.cxx.
◆ predictdEdx() [2/2]
- Todo:
- why is it possible that a 20 MeV particle reaches this point? (see Savannah bug 94644)
Definition at line 500 of file TRT_ToT_dEdx.cxx.
505 ATH_MSG_DEBUG(
"predictdEdx(): gasTypeInStraw = " << gasType <<
"");
509 if (dEdxCorrection ==
nullptr) {
510 ATH_MSG_ERROR(
" predictdEdx: Could not find any dEdxCorrection in "
511 "CondStore. Return zero.");
517 "predictdEdx():: gasTypeInStraw set kUnset that is not allowed! Use "
518 "gasTypeInStraw(*itr) to get gas type info for that hit first!");
519 ATH_MSG_DEBUG(
"predictdEdx():: Now gasTypeInStraw sets to kXenon.");
525 double betaGamma = pTrk/
mass;
533 if (dEdxCorrection->paraDivideByLengthDedxP3[gasType] +
535 dEdxCorrection->paraDivideByLengthDedxP5[gasType])) <=
538 return dEdxCorrection->paraDivideByLengthDedxP1[gasType] /
539 std::pow(std::sqrt((betaGamma * betaGamma) /
540 (1. + (betaGamma * betaGamma))),
541 dEdxCorrection->paraDivideByLengthDedxP4[gasType]) *
542 (dEdxCorrection->paraDivideByLengthDedxP2[gasType] -
543 std::pow(std::sqrt((betaGamma * betaGamma) /
544 (1. + (betaGamma * betaGamma))),
545 dEdxCorrection->paraDivideByLengthDedxP4[gasType]) -
546 log(dEdxCorrection->paraDivideByLengthDedxP3[gasType] +
549 dEdxCorrection->paraDivideByLengthDedxP5[gasType]))));
551 if (dEdxCorrection->paraDedxP3[gasType] +
552 1. / (
std::pow(betaGamma, dEdxCorrection->paraDedxP5[gasType])) <=
555 return dEdxCorrection->paraDedxP1[gasType] /
557 std::sqrt((betaGamma * betaGamma) / (1. + (betaGamma * betaGamma))),
558 dEdxCorrection->paraDedxP4[gasType]) *
559 (dEdxCorrection->paraDedxP2[gasType] -
561 std::sqrt((betaGamma * betaGamma) / (1. + (betaGamma * betaGamma))),
562 dEdxCorrection->paraDedxP4[gasType]) -
563 log(dEdxCorrection->paraDedxP3[gasType] +
564 1. / (
std::pow(betaGamma, dEdxCorrection->paraDedxP5[gasType]))));
◆ renounce()
◆ renounceArray()
◆ setAlgorithm()
void TRT_ToT_dEdx::setAlgorithm |
( |
EstCalc |
alg | ) |
|
|
inline |
◆ setCorrectionType()
◆ setGasTypeFordEdXCalculation()
void TRT_ToT_dEdx::setGasTypeFordEdXCalculation |
( |
EGasType |
gasType | ) |
|
|
inline |
◆ setMaxRtrack()
void TRT_ToT_dEdx::setMaxRtrack |
( |
float |
maxRtrack | ) |
|
|
inline |
◆ setMinRtrack()
void TRT_ToT_dEdx::setMinRtrack |
( |
float |
minRtrack | ) |
|
|
inline |
◆ setStatusCorrection()
void TRT_ToT_dEdx::setStatusCorrection |
( |
bool |
value | ) |
|
|
inline |
◆ setStatusUseZeroRHitCut()
void TRT_ToT_dEdx::setStatusUseZeroRHitCut |
( |
bool |
value | ) |
|
|
inline |
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ trackOccupancyCorrection()
double TRT_ToT_dEdx::trackOccupancyCorrection |
( |
const EventContext & |
ctx, |
|
|
const Trk::Track * |
track, |
|
|
bool |
useHThits, |
|
|
std::optional< float > |
localOccupancy |
|
) |
| const |
|
private |
Definition at line 1149 of file TRT_ToT_dEdx.cxx.
1159 double trackOcc = localOccupancy != std::nullopt
1174 corr=dEdxCorrection->trackOccPar0[
index]+dEdxCorrection->trackOccPar1[
index]*trackOcc+dEdxCorrection->trackOccPar2[
index]*
pow(trackOcc,2);
1176 corr=dEdxCorrection->trackOccPar0NoHt[
index]+dEdxCorrection->trackOccPar1NoHt[
index]*trackOcc+dEdxCorrection->trackOccPar2NoHt[
index]*
pow(trackOcc,2);
◆ updateVHKA()
◆ usedHits() [1/4]
virtual double ITRT_ToT_dEdx::usedHits |
function to calculate number of used hits
- Parameters
-
Event | context ctx |
track | pointer |
useHitsHT | decide if HT hits should be used in the estimate |
- Returns
- nHits
◆ usedHits() [2/4]
double TRT_ToT_dEdx::usedHits |
( |
const EventContext & |
ctx, |
|
|
const Trk::Track * |
track, |
|
|
bool |
useHThits = true |
|
) |
| const |
|
finaloverridevirtual |
function to calculate number of used hits
- Parameters
-
track | pointer |
useHitsHT | decide if HT hits should be used in the estimate |
- Returns
- nHits
Implements ITRT_ToT_dEdx.
Definition at line 320 of file TRT_ToT_dEdx.cxx.
341 for ( ; itr!=itre ; ++itr) {
357 "usedHits_Estimator():: Using m_toolScenario="
358 <<
m_toolScenario <<
" scenario m_useTrackPartWithGasType is set to "
360 <<
", but kUnset is required. Check you tool configuration.");
363 for ( ; itr!=itre ; ++itr) {
369 }
else if (gasType==
kArgon) {
374 ATH_MSG_ERROR(
"usedHits_Estimator():: During scenario kAlgReweight variable gasTypeInStraw got value kUnset.");
385 if(nhitsXe>0 || nhitsAr>0 || nhitsKr>0)
390 nhits = nhitsXe + nhitsAr + nhitsKr;
◆ usedHits() [3/4]
double ITRT_ToT_dEdx::usedHits |
( |
const Trk::Track * |
track, |
|
|
bool |
useHitsHT = true |
|
) |
| const |
|
inlinevirtualinherited |
◆ usedHits() [4/4]
double ITRT_ToT_dEdx::usedHits |
|
inline |
◆ m_assoTool
◆ m_corrected
BooleanProperty TRT_ToT_dEdx::m_corrected |
|
private |
Initial value:{this, "TRT_dEdx_corrected", true,
"If true - make correction using rs-distributions"}
Definition at line 75 of file TRT_ToT_dEdx.h.
◆ m_correctionType
IntegerProperty TRT_ToT_dEdx::m_correctionType {this, "TRT_dEdx_correctionType", kTrackBased, "Type of dEdx correction"} |
|
private |
◆ m_detStore
◆ m_divideByL
BooleanProperty TRT_ToT_dEdx::m_divideByL |
|
private |
Initial value:{this, "TRT_dEdx_divideByL", true,
"If true - divide ToT to the L of track in straw"}
Definition at line 77 of file TRT_ToT_dEdx.h.
◆ m_evtStore
◆ m_isData
BooleanProperty TRT_ToT_dEdx::m_isData {this, "TRT_dEdx_isData", true} |
|
private |
◆ m_localOccTool
◆ m_nTrunkateHits
unsigned int TRT_ToT_dEdx::m_nTrunkateHits = 1 |
|
private |
◆ m_rdhkEvtInfo
Initial value:{this
, "averageInteractionsPerCrossingKey"
, "EventInfo.averageInteractionsPerCrossing"
, "Decoration for Average Interaction Per Crossing"}
Definition at line 61 of file TRT_ToT_dEdx.h.
◆ m_ReadKey
◆ m_toolScenario
IntegerProperty TRT_ToT_dEdx::m_toolScenario |
|
private |
Initial value:
"Algorithm type for dEdX estimator calculation"}
Definition at line 83 of file TRT_ToT_dEdx.h.
◆ m_trackConfig_maxRtrack
FloatProperty TRT_ToT_dEdx::m_trackConfig_maxRtrack {this, "TRT_dEdx_trackConfig_maxRtrack", 1.85, "maximum track radius"} |
|
private |
◆ m_trackConfig_minRtrack
FloatProperty TRT_ToT_dEdx::m_trackConfig_minRtrack {this, "TRT_dEdx_trackConfig_minRtrack", 0.15, "maximum track radius"} |
|
private |
◆ m_trtId
◆ m_TRTStrawSummaryTool
◆ m_useTrackPartWithGasType
IntegerProperty TRT_ToT_dEdx::m_useTrackPartWithGasType |
|
private |
Initial value:{
this,
"TRT_dEdx_useTrackPartWithGasType",
kUnset,
"If kUnset - use any gas for dEdX calculation"}
Definition at line 80 of file TRT_ToT_dEdx.h.
◆ m_useZeroRHitCut
BooleanProperty TRT_ToT_dEdx::m_useZeroRHitCut |
|
private |
Initial value:{this, "TRT_dEdx_useZeroRHitCut", true,
"skip tracks with where RHit=0"}
Definition at line 107 of file TRT_ToT_dEdx.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
ToolHandle< ITRT_StrawStatusSummaryTool > m_TRTStrawSummaryTool
const TrackParameters * trackParameters() const
return ptr to trackparameters const overload
virtual double usedHits(const EventContext &ctx, const Trk::Track *track, bool useHThits=true) const override final
function to calculate number of used hits
bool isGoodHit(const EventContext &ctx, const Trk::TrackStateOnSurface *trackState, bool useHitsHT, double &length) const
function to define what is a good hit to be used for dEdx calculation cuts on track level can be made...
Const iterator class for DataVector/DataList.
virtual const TRT_DriftCircle * prepRawData() const override final
returns the PrepRawData - is a TRT_DriftCircle in this scope
double getProb(const EventContext &ctx, const Trk::TrackStateOnSurface *itr, const double dEdx_obs, const double pTrk, Trk::ParticleHypothesis hypothesis, int nUsedHits) const
function to calculate likelihood from prediction and resolution
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
double fitFuncBarrelShort_corrRZ(const EventContext &ctx, EGasType gasType, double driftRadius, double zPosition, int StrawLayer) const
function called by fitFuncBarrel_corrRZ for short straws
double timeOverThreshold() const
returns Time over threshold in ns
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
Scalar theta() const
theta method
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
virtual double getTest(const EventContext &ctx, const double dEdx_obs, const double pTrk, Trk::ParticleHypothesis hypothesis, Trk::ParticleHypothesis antihypothesis, int nUsedHits) const override final
function to calculate likelihood ratio test
virtual double dEdx(const EventContext &ctx, const Trk::Track *track, bool useHThits, std::optional< float > localOccupancy=std::nullopt) const override final
function to calculate sum ToT normalised to number of used hits
const MeasurementBase * measurementOnTrack() const
returns MeasurementBase const overload
virtual bool rioType(RIO_OnTrackType::Type type) const =0
Method checking the Rio On Track type.
virtual double usedHits(const EventContext &ctx, const Trk::Track *track, bool useHitsHT=true) const =0
function to calculate number of used hits
bool highLevel() const
returns true if the high level threshold was passed
virtual double dEdx(const EventContext &ctx, const Trk::Track *track, bool useHitsHT, std::optional< float > localOccupancy=std::nullopt) const =0
function to calculate sum ToT normalised to number of used hits
double trackOccupancyCorrection(const EventContext &ctx, const Trk::Track *track, bool useHThits, std::optional< float > localOccupancy) const
virtual const InDetDD::TRT_BaseElement * detectorElement() const override final
returns the detector element, assoicated with the PRD of this class
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
double fitFuncBarrelLong_corrRZ(const EventContext &ctx, EGasType gasType, double driftRadius, double zPosition, int Layer, int StrawLayer) const
function called by fitFuncBarrel_corrRZ for long straws
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
double correctToT_corrRZ(const EventContext &ctx, const Trk::TrackStateOnSurface *itr, double length) const
main function to correct ToT values on hit level as a function of track radius and z-position
double fitFuncBarrel_corrRZL(const EventContext &ctx, EGasType gasType, double driftRadius, double zPosition, int Layer, int StrawLayer) const
function to compute correction factor in barrel region
bool type(const TrackStateOnSurfaceType type) const
Use this method to find out if the TSoS is of a certain type: i.e.
double fitFuncBarrel_corrRZ(const EventContext &ctx, EGasType gas, double driftRadius, double zPosition, int Layer, int StrawLayer) const
function to compute correction factor in barrel region
Handle class for reading a decoration on an object.
ToolHandle< Trk::IPRD_AssociationTool > m_assoTool
msgSvc
Provide convenience handles for various services.
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual double getTest(const EventContext &ctx, const double dEdx_obs, const double pTrk, Trk::ParticleHypothesis hypothesis, Trk::ParticleHypothesis antihypothesis, int nUsedHits) const =0
function to calculate likelihood ratio test
virtual bool type(MeasurementBaseType::Type type) const =0
Interface method checking the type.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
double mass(const EventContext &ctx, const Trk::TrackStateOnSurface *itr, const double pTrk, double dEdx) const
function to extract most likely mass in bg [0,3]
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
int straw_layer(const Identifier &id) const
BooleanProperty m_useZeroRHitCut
int layer_or_wheel(const Identifier &id) const
SG::ReadDecorHandleKey< xAOD::EventInfo > m_rdhkEvtInfo
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
bool inRange(const double *boundaries, const double value, const double tolerance=0.02)
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
constexpr double mass[PARTICLEHYPOTHESES]
the array of masses
SG::ReadCondHandleKey< TRTDedxcorrection > m_ReadKey
double fitFuncEndcap_corrRZ(const EventContext &ctx, EGasType gas, double driftRadius, double rPosition, int Layer, int sign) const
function to compute correction factor in endcap region
double predictdEdx(const EventContext &ctx, const Trk::TrackStateOnSurface *itr, const double pTrk, Trk::ParticleHypothesis hypothesis) const
function to calculate expectation value for dEdx using BB fit
double correctNormalization(const EventContext &ctx, double nVtx=-1) const
correct overall dEdx normalization on track level
std::string to_string(const DetectorType &type)
StatusCode initialize(bool used=true)
int phi_module(const Identifier &id) const
static double calculateTrackLengthInStraw(const Trk::TrackStateOnSurface *trackState, const TRT_ID *identifier)
virtual const Trk::PrepRawData * prepRawData() const =0
returns the PrepRawData (also known as RIO) object to which this RIO_OnTrack is associated.
IntegerProperty m_correctionType
ToolHandle< InDet::ITRT_LocalOccupancy > m_localOccTool
#define REPORT_MESSAGE(LVL)
Report a message.
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
double fitFuncPol_corrRZ(const EventContext &ctx, EGasType gasType, int parameter, double driftRadius, int Layer, int Strawlayer, int sign, int set) const
function called by fitFuncBarrel_corrRZ and fitFuncEndcap_corrRZ
double fitFuncEndcap_corrRZL(const EventContext &ctx, EGasType gasType, double driftRadius, double radialPosition, int Layer, int sign) const
function to compute correction factor in endcap region
#define ATH_MSG_WARNING(x)
double hitOccupancyCorrection(const EventContext &ctx, const Trk::TrackStateOnSurface *itr) const
Identifier identify() const
return the identifier -extends MeasurementBase
virtual const Amg::Vector3D & center() const override final
Element Surface: center of a straw layer.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
double timeOverThreshold(unsigned int m_word)
IntegerProperty m_useTrackPartWithGasType
virtual const Amg::Vector3D & globalPosition() const override final
return the global position of this RIO_OnTrack
BooleanProperty m_corrected
IntegerProperty m_toolScenario
size_type size() const noexcept
Returns the number of elements in the collection.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
EGasType gasTypeInStraw(const EventContext &ctx, const Trk::TrackStateOnSurface *itr) const
return gas type for that hit
BooleanProperty m_divideByL
FloatProperty m_trackConfig_minRtrack
bool trackEta(const xAOD::TauJet &, const xAOD::TauTrack &track, double &out)
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
unsigned int m_nTrunkateHits
FloatProperty m_trackConfig_maxRtrack