@@ -34,19 +34,24 @@ namespace o2::aod
3434struct ITSResponse {
3535 static float averageClusterSize (uint32_t itsClusterSizes)
3636 {
37- float average = 0 ;
37+ float sum = 0 ;
3838 int nclusters = 0 ;
39-
39+ int max = 0 ;
4040 for (int layer = 0 ; layer < 7 ; layer++) {
41- if ((itsClusterSizes >> (layer * 4 )) & 0xf ) {
41+ int clsize = (itsClusterSizes >> (layer * 4 )) & 0xf ;
42+ if (clsize > 0 ) {
4243 nclusters++;
43- average += (itsClusterSizes >> (layer * 4 )) & 0xf ;
44+ sum += clsize;
45+ if (clsize > max) {
46+ max = clsize;
47+ }
4448 }
4549 }
4650 if (nclusters == 0 ) {
4751 return 0 ;
4852 }
49- return average / nclusters;
53+ // truncated mean
54+ return (sum - max) / (nclusters - 1 );
5055 };
5156
5257 template <o2::track::PID::ID id>
@@ -67,8 +72,10 @@ struct ITSResponse {
6772 static constexpr float inverseMass = 1 . / o2::track::pid_constants::sMasses [id];
6873 // static constexpr float charge = static_cast<float>(o2::track::pid_constants::sCharges[id]);
6974 const float bg = momentum * inverseMass;
70- float relRes = mResolutionParams [0 ] * std::erf ((bg - mResolutionParams [1 ]) / mResolutionParams [2 ]);
71- return relRes;
75+ if (id == o2::track::PID::Helium3 || id == o2::track::PID::Alpha) {
76+ return mResolutionParamsZ2 [0 ] * std::erf ((bg - mResolutionParamsZ2 [1 ]) / mResolutionParamsZ2 [2 ]);
77+ }
78+ return mResolutionParams [0 ] * std::erf ((bg - mResolutionParams [1 ]) / mResolutionParams [2 ]);
7279 }
7380
7481 template <o2::track::PID::ID id>
@@ -87,7 +94,10 @@ struct ITSResponse {
8794 return nSigmaITS<id>(track.itsClusterSizes (), track.p (), track.eta ());
8895 }
8996
90- static void setParameters (float p0, float p1, float p2, float p0_Z2, float p1_Z2, float p2_Z2, float p0_res, float p1_res, float p2_res)
97+ static void setParameters (float p0, float p1, float p2,
98+ float p0_Z2, float p1_Z2, float p2_Z2,
99+ float p0_res, float p1_res, float p2_res,
100+ float p0_res_Z2, float p1_res_Z2, float p2_res_Z2)
91101 {
92102 if (mIsInitialized ) {
93103 LOG (fatal) << " ITSResponse parameters already initialized" ;
@@ -102,19 +112,24 @@ struct ITSResponse {
102112 mResolutionParams [0 ] = p0_res;
103113 mResolutionParams [1 ] = p1_res;
104114 mResolutionParams [2 ] = p2_res;
115+ mResolutionParamsZ2 [0 ] = p0_res_Z2;
116+ mResolutionParamsZ2 [1 ] = p1_res_Z2;
117+ mResolutionParamsZ2 [2 ] = p2_res_Z2;
105118 }
106119
107120 private:
108121 static std::array<float , 3 > mITSRespParams ;
109122 static std::array<float , 3 > mITSRespParamsZ2 ;
110123 static std::array<float , 3 > mResolutionParams ;
124+ static std::array<float , 3 > mResolutionParamsZ2 ;
111125 static bool mIsInitialized ;
112126};
113127
114- std::array<float , 3 > ITSResponse::mITSRespParams = {1.1576 , 1.684 , 1.9453 };
115- std::array<float , 3 > ITSResponse::mITSRespParamsZ2 = {2.8752 , 1.1246 , 5.0259 };
128+ std::array<float , 3 > ITSResponse::mITSRespParams = {1.18941 , 1.53792 , 1.69961 };
129+ std::array<float , 3 > ITSResponse::mITSRespParamsZ2 = {2.35117 , 1.80347 , 5.14355 };
116130// relative resolution is modelled with an erf function: [0]*TMath::Erf((x-[1])/[2])
117- std::array<float , 3 > ITSResponse::mResolutionParams = {0.2431 , -0.3293 , 1.533 };
131+ std::array<float , 3 > ITSResponse::mResolutionParams = {1.94669e-01 , -2.08616e-01 , 1.30753 };
132+ std::array<float , 3 > ITSResponse::mResolutionParamsZ2 = {8.74371e-02 , -1.82804 , 5.06449e-01 };
118133bool ITSResponse::mIsInitialized = false ;
119134
120135namespace pidits
0 commit comments