8 #include "Identifier/Identifier.h"
26 #include "CLHEP/Matrix/Vector.h"
37 m_IBLParameterSvc(
"IBLParameterSvc",
n),
40 declareInterface<IPixelToTPIDTool>(
this);
42 float energyPair = 3.68e-6;
43 float sidensity = 2.329;
62 return StatusCode::FAILURE;
69 return StatusCode::SUCCESS;
87 int& nUsedIBLOverflowHits)
const
90 unsigned int pixelhits = 0;
92 nUsedIBLOverflowHits=0;
93 float Pixel_sensorthickness=.025;
94 float IBL_3D_sensorthickness=.023;
95 float IBL_PLANAR_sensorthickness=.020;
100 std::multimap<float,int> dEdxMap;
104 if (recoTrackStates) {
109 for (; tsosIter != tsosIterEnd; ++tsosIter) {
112 if (!(*tsosIter)->trackParameters()) {
113 msg(MSG::WARNING) <<
"No track parameters available for a state of type measurement, returning -1" <<
endmsg;
114 msg(MSG::WARNING) <<
"Don't run this tool on slimmed tracks!" <<
endmsg;
133 float dotProd = (*tsosIter)->trackParameters()->momentum().dot(
134 (*tsosIter)->trackParameters()->associatedSurface().normal());
136 fabs(dotProd / (*tsosIter)->trackParameters()->momentum().mag());
138 if (std::abs(cosalpha)<0.16) {
continue; }
149 ->getFEI4OverflowToT();
152 for (
int pixToT : ToTs) {
153 if (pixToT >= overflowIBLToT) {
162 if (((eta_module >= -10 && eta_module <= -7) ||
163 (eta_module >= 6 && eta_module <= 9)) &&
168 dEdxMap.insert(std::pair<float, int>(dEdxValue, iblOverflow));
170 if (iblOverflow == 1) {
171 nUsedIBLOverflowHits++;
173 }
else if ((eta_module >= -6 && eta_module <= 5) &&
180 dEdxMap.insert(std::pair<float, int>(dEdxValue, iblOverflow));
182 if (iblOverflow == 1) {
183 nUsedIBLOverflowHits++;
191 else if(
bec==0 && fabs(locy)<30. && ((locx>-8.20 && locx<-0.60) || (locx>0.50 && locx<8.10))) {
193 dEdxMap.insert(std::pair<float,int>(dEdxValue, iblOverflow));
196 else if (std::abs(
bec)==2 && fabs(locy)<30. && ((locx>-8.15 && locx<-0.55) || (locx>0.55 && locx<8.15))) {
198 dEdxMap.insert(std::pair<float,int>(dEdxValue, iblOverflow));
207 float averagedEdx=0.;
211 for (std::pair<float,int> itdEdx : dEdxMap) {
212 if (itdEdx.second==0) {
213 averagedEdx += itdEdx.first;
216 if (itdEdx.second>0) { IBLOverflow++; }
219 if (((
int)pixelhits>=5) and ((
int)nUsedHits>=(
int)pixelhits-2)) {
break; }
222 if ((
int)IBLOverflow>0 and ((
int)pixelhits==3) and (
int)nUsedHits==1) {
break; }
223 if ((
int)IBLOverflow>0 and ((
int)pixelhits==4) and (
int)nUsedHits==2) {
break; }
225 if (((
int)pixelhits > 1) and ((
int)nUsedHits >=(
int)pixelhits-1)) {
break; }
227 if ((
int)IBLOverflow>0 and (
int)pixelhits==1) {
228 averagedEdx=itdEdx.first;
233 if (nUsedHits>0 or (nUsedHits==0 and(
int)IBLOverflow>0 and (
int)pixelhits==1)) {
234 if (nUsedHits>0) { averagedEdx=averagedEdx/nUsedHits; }
237 ATH_MSG_DEBUG(
"Used hits: " << nUsedHits <<
", IBL overflows: " << IBLOverflow );
238 ATH_MSG_DEBUG(
"Original number of measurements = " << pixelhits <<
"( map size = " << dEdxMap.size() <<
")");
248 int nGoodPixels)
const
251 ->getLikelihoods(dedx2,
p2, nGoodPixels);
258 int nGoodPixels)
const
261 ->getMass(dedx,
p / 1000, nGoodPixels);