8 #include "GaudiKernel/MsgStream.h"
9 #include "GaudiKernel/IToolSvc.h"
16 #include "GaudiKernel/IChronoStatSvc.h"
29 inRange(
const double val,
const double lo,
const double hi){
30 return (
val>lo) and (
val<hi);
39 m_TRTStrawSummaryTool(
"TRT_StrawStatusSummaryTool",this)
41 declareInterface<ITRT_ToT_dEdx>(
this);
80 return StatusCode::FAILURE;
92 ATH_MSG_ERROR(
"Property TRT_dEdx_useTrackPartWithGasType has an invalid "
94 return StatusCode::FAILURE;
97 return StatusCode::SUCCESS;
127 if(trkP==
nullptr)
return false;
129 double Trt_Rtrack = std::abs(trkP->parameters()[
Trk::locR]);
143 if (TrtHl==1)
return false;
159 std::optional<float> localOccupancy)
const
173 double mu = eventInfoDecor(0);
175 nVtx = 1.3129 + 0.716194*
mu + (-0.00475074)*
mu*
mu;
178 nVtx = 1.0897 + 0.748287*
mu + (-0.00421788)*
mu*
mu;
192 size_t vtos_size = vtsos->
size();
193 double correctionFactor = 1.;
196 std::vector<double> vecToT;
197 vecToT.reserve(vtos_size);
200 for ( ; itr!=itre ; ++itr) {
206 ToT_correct*=correctionFactor;
208 vecToT.push_back(ToT_correct);
212 sort(vecToT.begin(), vecToT.end());
213 size_t nhits = vecToT.size();
220 if (nhits<1)
return 0.0;
228 ToTsum*=correctionFactor;
233 std::vector<double> vecToT_Xe;
234 vecToT_Xe.reserve(vtos_size/2);
235 std::vector<double> vecToT_Ar;
236 vecToT_Ar.reserve(vtos_size/2);
237 std::vector<double> vecToT_Kr;
241 "dEdX_Estimator():: Using m_toolScenario="
242 <<
m_toolScenario <<
" scenario m_useTrackPartWithGasType is set to"
244 <<
", but kUnset is requiered. Check you tool configuration.");
247 for ( ; itr!=itre ; ++itr) {
255 ToT_correct*=correctionFactor;
257 vecToT_Xe.push_back(ToT_correct);
258 }
else if (gasType==
kArgon) {
259 vecToT_Ar.push_back(ToT_correct);
261 vecToT_Kr.push_back(ToT_correct);
263 ATH_MSG_ERROR(
"dEdX_Estimator():: During scenario kAlgReweight variable gasTypeInStraw got value kUnset.");
268 sort(vecToT_Xe.begin(), vecToT_Xe.end());
269 sort(vecToT_Ar.begin(), vecToT_Ar.end());
270 sort(vecToT_Kr.begin(), vecToT_Kr.end());
272 size_t nhitsXe = vecToT_Xe.size();
273 size_t nhitsAr = vecToT_Ar.size();
274 size_t nhitsKr = vecToT_Kr.size();
284 if (nhitsXe>0 && vecToT_Xe.at(nhitsXe-1)>maxToT) {
286 maxToT = vecToT_Xe.at(nhitsXe-1);
288 if(nhitsAr>0 && vecToT_Ar.at(nhitsAr-1)>maxToT){
290 maxToT = vecToT_Ar.at(nhitsAr-1);
292 if (nhitsKr>0 && vecToT_Kr.at(nhitsKr-1)>maxToT) {
298 }
else if (trunkGas==
kArgon) {
306 size_t nhits = nhitsXe + nhitsAr + nhitsKr;
307 if(nhits<1)
return 0.0;
312 for (
size_t i = 0;
i < nhitsXe;
i++) {
313 ToTsumXe+=vecToT_Xe[
i];
315 for (
size_t i = 0;
i < nhitsAr;
i++) {
316 ToTsumAr+=vecToT_Ar[
i];
318 for (
size_t i = 0;
i < nhitsKr;
i++) {
319 ToTsumKr+=vecToT_Kr[
i];
322 ToTsumXe = (nhitsXe>0) ? ToTsumXe/nhitsXe : 0;
323 ToTsumAr = (nhitsAr>0) ? ToTsumAr/nhitsAr : 0;
324 ToTsumKr = (nhitsKr>0) ? ToTsumKr/nhitsKr : 0;
325 double ToTsum = ToTsumXe*nhitsXe + ToTsumAr*nhitsAr + ToTsumKr*nhitsKr;
333 ToTsum *= correctionFactor;
345 bool useHitsHT)
const
364 for ( ; itr!=itre ; ++itr) {
380 "usedHits_Estimator():: Using m_toolScenario="
381 <<
m_toolScenario <<
" scenario m_useTrackPartWithGasType is set to "
383 <<
", but kUnset is required. Check you tool configuration.");
386 for ( ; itr!=itre ; ++itr) {
392 }
else if (gasType==
kArgon) {
397 ATH_MSG_ERROR(
"usedHits_Estimator():: During scenario kAlgReweight variable gasTypeInStraw got value kUnset.");
408 if(nhitsXe>0 || nhitsAr>0 || nhitsKr>0)
413 nhits = nhitsXe + nhitsAr + nhitsKr;
424 const double dEdx_obs,
430 return getProb(ctx,gasType, dEdx_obs, pTrk, hypothesis, nUsedHits);
436 const double dEdx_obs,
445 if (dEdxCorrection==
nullptr) {
446 ATH_MSG_ERROR(
" getProb: Could not find any dEdxCorrection in CondStore. Return zero.");
451 ATH_MSG_DEBUG(
"getProb():: gasTypeInStraw set kUnset that is not allowed! Use gasTypeInStraw(*itr) to get gas type info for that hit first!");
452 ATH_MSG_DEBUG(
"getProb():: Now gasTypeInStraw sets to kXenon.");
456 double dEdx_pred =
predictdEdx(ctx,gasType, pTrk, hypothesis);
457 if (dEdx_pred==0)
return 0.0;
461 double correct = 1+factor*(0.045*log10(pTrk)+0.885-1);
462 dEdx_pred= dEdx_pred/correct;
466 dEdxCorrection->resolution[gasType][0] +
467 dEdxCorrection->resolution[gasType][1] * (nUsedHits + 0.5) +
468 dEdxCorrection->resolution[gasType][2] * (nUsedHits + 0.5) *
470 dEdxCorrection->resolution[gasType][3] * (nUsedHits + 0.5) *
471 (nUsedHits + 0.5) * (nUsedHits + 0.5);
474 dEdxCorrection->resolutionElectron[gasType][0] +
475 dEdxCorrection->resolutionElectron[gasType][1] * (nUsedHits + 0.5) +
476 dEdxCorrection->resolutionElectron[gasType][2] * (nUsedHits + 0.5) *
478 dEdxCorrection->resolutionElectron[gasType][3] * (nUsedHits + 0.5) *
479 (nUsedHits + 0.5) * (nUsedHits + 0.5);
482 double prob =
std::exp( -0.5 * ( ( ( dEdx_obs - dEdx_pred ) / (Resolution*dEdx_pred) ) *
483 ( ( dEdx_obs - dEdx_pred ) / (Resolution*dEdx_pred) ) )) ;
491 const double dEdx_obs,
500 if ( dEdx_obs<=0. || pTrk<=0. || nUsedHits<=0 )
return 0.5;
502 double Pone =
getProb(ctx,gasType, dEdx_obs,pTrk,hypothesis,nUsedHits);
503 double Ptwo =
getProb(ctx,gasType, dEdx_obs,pTrk,antihypothesis,nUsedHits);
504 if ((Pone+Ptwo) != 0) {
506 return Pone/(Pone+Ptwo);
528 ATH_MSG_DEBUG(
"predictdEdx(): gasTypeInStraw = " << gasType <<
"");
532 if (dEdxCorrection ==
nullptr) {
533 ATH_MSG_ERROR(
" predictdEdx: Could not find any dEdxCorrection in "
534 "CondStore. Return zero.");
540 "predictdEdx():: gasTypeInStraw set kUnset that is not allowed! Use "
541 "gasTypeInStraw(*itr) to get gas type info for that hit first!");
542 ATH_MSG_DEBUG(
"predictdEdx():: Now gasTypeInStraw sets to kXenon.");
548 double betaGamma = pTrk/
mass;
556 if (dEdxCorrection->paraDivideByLengthDedxP3[gasType] +
558 dEdxCorrection->paraDivideByLengthDedxP5[gasType])) <=
561 return dEdxCorrection->paraDivideByLengthDedxP1[gasType] /
562 std::pow(std::sqrt((betaGamma * betaGamma) /
563 (1. + (betaGamma * betaGamma))),
564 dEdxCorrection->paraDivideByLengthDedxP4[gasType]) *
565 (dEdxCorrection->paraDivideByLengthDedxP2[gasType] -
566 std::pow(std::sqrt((betaGamma * betaGamma) /
567 (1. + (betaGamma * betaGamma))),
568 dEdxCorrection->paraDivideByLengthDedxP4[gasType]) -
569 log(dEdxCorrection->paraDivideByLengthDedxP3[gasType] +
572 dEdxCorrection->paraDivideByLengthDedxP5[gasType]))));
574 if (dEdxCorrection->paraDedxP3[gasType] +
575 1. / (
std::pow(betaGamma, dEdxCorrection->paraDedxP5[gasType])) <=
578 return dEdxCorrection->paraDedxP1[gasType] /
580 std::sqrt((betaGamma * betaGamma) / (1. + (betaGamma * betaGamma))),
581 dEdxCorrection->paraDedxP4[gasType]) *
582 (dEdxCorrection->paraDedxP2[gasType] -
584 std::sqrt((betaGamma * betaGamma) / (1. + (betaGamma * betaGamma))),
585 dEdxCorrection->paraDedxP4[gasType]) -
586 log(dEdxCorrection->paraDedxP3[gasType] +
587 1. / (
std::pow(betaGamma, dEdxCorrection->paraDedxP5[gasType]))));
604 if(dEdxCorrection==
nullptr)
606 ATH_MSG_ERROR(
" mass: Could not find any dEdxCorrection in CondStore. Return zero.");
612 ATH_MSG_WARNING(
"mass():: gasTypeInStraw set kUnset that is not allowed! Use gasTypeInStraw(*itr) to get gas type info for that hit first!");
620 static const double bg_min = 0.001;
621 static const double bg_max = 3;
623 static const std::string blumRolandiFunction =
624 "( [0]/sqrt( (x*x/([5]*[5]))/(1.+(x*x/([5]*[5]))) )^[3] ) * ([1] - sqrt( "
625 "(x*x/([5]*[5]))/(1.+(x*x/([5]*[5]))) )^[3] - log([2]+1./((x/[5])^[4]) ) )";
627 TF1 blumRolandi(
"BR", blumRolandiFunction.c_str(), 0.7, 100000);
629 blumRolandi.SetParameters(dEdxCorrection->paraDedxP1[gasType],
630 dEdxCorrection->paraDedxP2[gasType],
631 dEdxCorrection->paraDedxP3[gasType],
632 dEdxCorrection->paraDedxP4[gasType],
633 dEdxCorrection->paraDedxP5[gasType],
636 double betaGamma = blumRolandi.GetX(
dEdx, bg_min, bg_max);
640 return pTrk/betaGamma;
673 const EventContext& ctx,
693 <<
", must be 'Good(2)||Xenon(3)' or 'Dead(1)||Argon(4)' or "
694 "'Krypton(5)' or 'EmulatedArgon(6)' or 'EmulatedKr(7)'!");
711 if(dEdxCorrection==
nullptr) {
712 ATH_MSG_ERROR(
" correctNormalization: Could not find any dEdxCorrection in CondStore. Return zero.");
718 if (nVtx<=0) nVtx=dEdxCorrection->normNzero[gasType];
719 double slope = dEdxCorrection->normSlopeTot[gasType];
720 double offset = dEdxCorrection->normOffsetTot[gasType];
722 slope = dEdxCorrection->normSlopeTotDivideByLength[gasType];
723 offset = dEdxCorrection->normOffsetTotDivideByLength[gasType];
725 double shift = dEdxCorrection->normOffsetData[gasType];
727 return (slope*dEdxCorrection->normNzero[gasType]+
offset)/(slope*nVtx+
offset+shift);
765 double hitRtrack = std::abs(trkP->parameters()[
Trk::locR]);
768 ATH_MSG_ERROR(
"correctToT_corrRZ(const Trk::TrackStateOnSurface *itr):: Gas type in straw is kUnset! Return ToT = 0");
779 double hitPosR = std::sqrt(trackx*trackx+tracky*tracky);
796 if (std::isinf(valToT))
return 0.;
807 int StrawLayer)
const
809 if (
Layer == 0 && StrawLayer < 9) {
819 double radialPosition,
828 return T0+
a*radialPosition;
837 int StrawLayer)
const
844 double z = std::abs(zPosition);
846 if(zPosition<0)
sign=-1;
854 const double expArg=(
z-
l)/
s;
855 if (not
inRange(expArg, -600.0,600.0)){
856 return expArg>0 ? std::numeric_limits<double>::infinity():0.;
866 int StrawLayer)
const
871 double z = std::abs(zPosition);
873 if(zPosition<0)
sign=-1;
891 if(dEdxCorrection==
nullptr)
893 ATH_MSG_ERROR(
" fitFuncPol_corrRZ: Could not find any dEdxCorrection in CondStore. Return zero.");
907 a = dEdxCorrection->paraLongCorrRZ[gasType][(6*parameter+0)*30*3+
Layer*30+Strawlayer+
offset];
908 b = dEdxCorrection->paraLongCorrRZ[gasType][(6*parameter+1)*30*3+
Layer*30+Strawlayer+
offset];
909 c = dEdxCorrection->paraLongCorrRZ[gasType][(6*parameter+2)*30*3+
Layer*30+Strawlayer+
offset];
910 d = dEdxCorrection->paraLongCorrRZ[gasType][(6*parameter+3)*30*3+
Layer*30+Strawlayer+
offset];
911 e = dEdxCorrection->paraLongCorrRZ[gasType][(6*parameter+4)*30*3+
Layer*30+Strawlayer+
offset];
912 f = dEdxCorrection->paraLongCorrRZ[gasType][(6*parameter+5)*30*3+
Layer*30+Strawlayer+
offset];
916 a = dEdxCorrection->paraShortCorrRZ[gasType][(6*parameter+0)*9+
Layer+
offset];
917 b = dEdxCorrection->paraShortCorrRZ[gasType][(6*parameter+1)*9+
Layer+
offset];
918 c = dEdxCorrection->paraShortCorrRZ[gasType][(6*parameter+2)*9+
Layer+
offset];
919 d = dEdxCorrection->paraShortCorrRZ[gasType][(6*parameter+3)*9+
Layer+
offset];
920 e = dEdxCorrection->paraShortCorrRZ[gasType][(6*parameter+4)*9+
Layer+
offset];
921 f = dEdxCorrection->paraShortCorrRZ[gasType][(6*parameter+5)*9+
Layer+
offset];
924 a = dEdxCorrection->paraEndCorrRZ[gasType][(6*parameter+0)*28+
Layer];
925 b = dEdxCorrection->paraEndCorrRZ[gasType][(6*parameter+1)*28+
Layer];
926 c = dEdxCorrection->paraEndCorrRZ[gasType][(6*parameter+2)*28+
Layer];
927 d = dEdxCorrection->paraEndCorrRZ[gasType][(6*parameter+3)*28+
Layer];
928 e = dEdxCorrection->paraEndCorrRZ[gasType][(6*parameter+4)*28+
Layer];
929 f = dEdxCorrection->paraEndCorrRZ[gasType][(6*parameter+5)*28+
Layer];
934 a = dEdxCorrection->paraLongCorrRZMC[gasType][(6*parameter+0)*30*3+
Layer*30+Strawlayer+
offset];
935 b = dEdxCorrection->paraLongCorrRZMC[gasType][(6*parameter+1)*30*3+
Layer*30+Strawlayer+
offset];
936 c = dEdxCorrection->paraLongCorrRZMC[gasType][(6*parameter+2)*30*3+
Layer*30+Strawlayer+
offset];
937 d = dEdxCorrection->paraLongCorrRZMC[gasType][(6*parameter+3)*30*3+
Layer*30+Strawlayer+
offset];
938 e = dEdxCorrection->paraLongCorrRZMC[gasType][(6*parameter+4)*30*3+
Layer*30+Strawlayer+
offset];
939 f = dEdxCorrection->paraLongCorrRZMC[gasType][(6*parameter+5)*30*3+
Layer*30+Strawlayer+
offset];
942 a = dEdxCorrection->paraShortCorrRZMC[gasType][(6*parameter+0)*9+
Layer+
offset];
943 b = dEdxCorrection->paraShortCorrRZMC[gasType][(6*parameter+1)*9+
Layer+
offset];
944 c = dEdxCorrection->paraShortCorrRZMC[gasType][(6*parameter+2)*9+
Layer+
offset];
945 d = dEdxCorrection->paraShortCorrRZMC[gasType][(6*parameter+3)*9+
Layer+
offset];
946 e = dEdxCorrection->paraShortCorrRZMC[gasType][(6*parameter+4)*9+
Layer+
offset];
947 f = dEdxCorrection->paraShortCorrRZMC[gasType][(6*parameter+5)*9+
Layer+
offset];
950 a = dEdxCorrection->paraEndCorrRZMC[gasType][(6*parameter+0)*28+
Layer];
951 b = dEdxCorrection->paraEndCorrRZMC[gasType][(6*parameter+1)*28+
Layer];
952 c = dEdxCorrection->paraEndCorrRZMC[gasType][(6*parameter+2)*28+
Layer];
953 d = dEdxCorrection->paraEndCorrRZMC[gasType][(6*parameter+3)*28+
Layer];
954 e = dEdxCorrection->paraEndCorrRZMC[gasType][(6*parameter+4)*28+
Layer];
955 f = dEdxCorrection->paraEndCorrRZMC[gasType][(6*parameter+5)*28+
Layer];
965 double radialPosition,
975 if(dEdxCorrection==
nullptr) {
976 ATH_MSG_ERROR(
" fitFuncEndcap_corrRZL: Could not find any dEdxCorrection in CondStore. Return zero.");
984 a = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(0)*28+
Layer];
985 b = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(1)*28+
Layer];
986 c = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(2)*28+
Layer];
987 d = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(3)*28+
Layer];
988 e = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(4)*28+
Layer];
989 f = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(5)*28+
Layer];
990 g = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(6)*28+
Layer];
991 h = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(7)*28+
Layer];
992 i = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(8)*28+
Layer];
994 a = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(0)*28+
Layer];
995 b = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(1)*28+
Layer];
996 c = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(2)*28+
Layer];
997 d = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(3)*28+
Layer];
998 e = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(4)*28+
Layer];
999 f = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(5)*28+
Layer];
1000 g = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(6)*28+
Layer];
1001 h = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(7)*28+
Layer];
1002 i = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(8)*28+
Layer];
1006 double slope =
g+
h*
r+
i*
r*
r;
1009 return T0+T1+slope*radialPosition;
1018 int Strawlayer)
const
1025 if(dEdxCorrection==
nullptr) {
1026 ATH_MSG_ERROR(
" fitFuncBarrel_corrRZL: Could not find any dEdxCorrection in CondStore. Return zero.");
1031 if (
Layer==0 && Strawlayer<9) {
1033 a = dEdxCorrection->paraShortCorrRZDivideByLengthDATA[gasType][(0)*9+Strawlayer];
1034 b = dEdxCorrection->paraShortCorrRZDivideByLengthDATA[gasType][(1)*9+Strawlayer];
1035 c = dEdxCorrection->paraShortCorrRZDivideByLengthDATA[gasType][(2)*9+Strawlayer];
1036 d = dEdxCorrection->paraShortCorrRZDivideByLengthDATA[gasType][(3)*9+Strawlayer];
1037 e = dEdxCorrection->paraShortCorrRZDivideByLengthDATA[gasType][(4)*9+Strawlayer];
1038 f = dEdxCorrection->paraShortCorrRZDivideByLengthDATA[gasType][(5)*9+Strawlayer];
1039 g = dEdxCorrection->paraShortCorrRZDivideByLengthDATA[gasType][(6)*9+Strawlayer];
1041 a = dEdxCorrection->paraShortCorrRZDivideByLengthMC[gasType][(0)*9+Strawlayer];
1042 b = dEdxCorrection->paraShortCorrRZDivideByLengthMC[gasType][(1)*9+Strawlayer];
1043 c = dEdxCorrection->paraShortCorrRZDivideByLengthMC[gasType][(2)*9+Strawlayer];
1044 d = dEdxCorrection->paraShortCorrRZDivideByLengthMC[gasType][(3)*9+Strawlayer];
1045 e = dEdxCorrection->paraShortCorrRZDivideByLengthMC[gasType][(4)*9+Strawlayer];
1046 f = dEdxCorrection->paraShortCorrRZDivideByLengthMC[gasType][(5)*9+Strawlayer];
1047 g = dEdxCorrection->paraShortCorrRZDivideByLengthMC[gasType][(6)*9+Strawlayer];
1051 a = dEdxCorrection->paraLongCorrRZDivideByLengthDATA[gasType][(0)*30*3+
Layer*30+Strawlayer];
1052 b = dEdxCorrection->paraLongCorrRZDivideByLengthDATA[gasType][(1)*30*3+
Layer*30+Strawlayer];
1053 c = dEdxCorrection->paraLongCorrRZDivideByLengthDATA[gasType][(2)*30*3+
Layer*30+Strawlayer];
1054 d = dEdxCorrection->paraLongCorrRZDivideByLengthDATA[gasType][(3)*30*3+
Layer*30+Strawlayer];
1055 e = dEdxCorrection->paraLongCorrRZDivideByLengthDATA[gasType][(4)*30*3+
Layer*30+Strawlayer];
1056 f = dEdxCorrection->paraLongCorrRZDivideByLengthDATA[gasType][(5)*30*3+
Layer*30+Strawlayer];
1057 g = dEdxCorrection->paraLongCorrRZDivideByLengthDATA[gasType][(6)*30*3+
Layer*30+Strawlayer];
1059 a = dEdxCorrection->paraLongCorrRZDivideByLengthMC[gasType][(0)*30*3+
Layer*30+Strawlayer];
1060 b = dEdxCorrection->paraLongCorrRZDivideByLengthMC[gasType][(1)*30*3+
Layer*30+Strawlayer];
1061 c = dEdxCorrection->paraLongCorrRZDivideByLengthMC[gasType][(2)*30*3+
Layer*30+Strawlayer];
1062 d = dEdxCorrection->paraLongCorrRZDivideByLengthMC[gasType][(3)*30*3+
Layer*30+Strawlayer];
1063 e = dEdxCorrection->paraLongCorrRZDivideByLengthMC[gasType][(4)*30*3+
Layer*30+Strawlayer];
1064 f = dEdxCorrection->paraLongCorrRZDivideByLengthMC[gasType][(5)*30*3+
Layer*30+Strawlayer];
1065 g = dEdxCorrection->paraLongCorrRZDivideByLengthMC[gasType][(6)*30*3+
Layer*30+Strawlayer];
1068 double z = std::abs(zPosition);
1076 if (zPosition>0)
result = T0pos+T1+slope*
z;
1121 double Trt_HitTheta = trkP->parameters()[
Trk::theta];
1128 double p0=0., p1=0., p2=0., p0_flat=0.;
1133 int nBarrelLayers = 3, nEndcapLayers = 14;
1135 int nParametersPerLayer = 3;
1137 int nHTConfigurations = 2;
1139 int nSharedConfigurations = 2;
1141 layer * nParametersPerLayer +
1142 isHT * ((abs(HitPart) - 1) * (nEndcapLayers - nBarrelLayers) *
1143 nParametersPerLayer +
1144 nBarrelLayers * nParametersPerLayer) +
1145 isShared * ((abs(HitPart) - 1) * (nEndcapLayers - nBarrelLayers) *
1146 nParametersPerLayer * nHTConfigurations +
1147 nBarrelLayers * nParametersPerLayer * nHTConfigurations) +
1148 (abs(HitPart) - 1) * nParametersPerLayer * nBarrelLayers *
1149 nHTConfigurations * nSharedConfigurations;
1151 int num_flat =
layer * 3 +
1152 isHT * ((abs(HitPart) - 1) * (nEndcapLayers - nBarrelLayers) *
1153 nParametersPerLayer +
1154 nBarrelLayers * nParametersPerLayer) +
1155 (abs(HitPart) - 1) * nParametersPerLayer * nBarrelLayers *
1156 nHTConfigurations * nSharedConfigurations;
1158 p0 = dEdxCorrection->hitOccPar[
num];
1159 p1 = dEdxCorrection->hitOccPar[
num+1];
1160 p2 = dEdxCorrection->hitOccPar[
num+2];
1161 p0_flat = dEdxCorrection->hitOccPar[num_flat];
1166 valToT = p0_flat/(p0+p1*localOccupancy+p2*localOccupancy*localOccupancy);
1168 return ToTmip*valToT;
1175 std::optional<float> localOccupancy)
const
1182 double trackOcc = localOccupancy != std::nullopt
1197 corr=dEdxCorrection->trackOccPar0[
index]+dEdxCorrection->trackOccPar1[
index]*trackOcc+dEdxCorrection->trackOccPar2[
index]*
pow(trackOcc,2);
1199 corr=dEdxCorrection->trackOccPar0NoHt[
index]+dEdxCorrection->trackOccPar1NoHt[
index]*trackOcc+dEdxCorrection->trackOccPar2NoHt[
index]*
pow(trackOcc,2);
1232 if(trkP==
nullptr)
return 0.;
1234 double Trt_Rtrack = std::abs(trkP->parameters()[
Trk::locR]);
1235 double Trt_HitTheta = trkP->parameters()[
Trk::theta];
1236 double Trt_HitPhi = trkP->parameters()[
Trk::phi];
1238 int HitPart = std::abs(
identifier->barrel_ec(DCId));
1240 double strawphi = element->
center(DCId).phi();
1243 if (Trt_Rtrack >= 2.0) {
1249 length = 2*std::sqrt(4-Trt_Rtrack*Trt_Rtrack)*1./std::abs(
std::sin(Trt_HitTheta));
1250 }
else if (HitPart == 2) {
1254 throw std::runtime_error(
"Unknown barrel/endcap identifier: " +
std::to_string(HitPart) +
". Must be 1(Barrel) or 2(Endcap)");