@@ -31,6 +31,45 @@ Clusterizer::Clusterizer(bool applyCorrectionZ, bool applyCorrectionE)
3131 mDigitIndices .resize (geo.getNrows (), std::vector<int >(geo.getNcols (), -1 ));
3232 mApplyCorrectionZ = applyCorrectionZ;
3333 mApplyCorrectionE = applyCorrectionE;
34+
35+ mCrystalEnergyCorrectionPars .reserve (6 );
36+ mCrystalEnergyCorrectionPars [0 ] = 0.00444 ;
37+ mCrystalEnergyCorrectionPars [1 ] = -1.322 ;
38+ mCrystalEnergyCorrectionPars [2 ] = 1.021 ;
39+ mCrystalEnergyCorrectionPars [3 ] = 0.0018 ;
40+ mCrystalEnergyCorrectionPars [4 ] = 0 .;
41+ mCrystalEnergyCorrectionPars [5 ] = 0 .;
42+
43+ mSamplingEnergyCorrectionPars .reserve (6 );
44+ mSamplingEnergyCorrectionPars [0 ] = 0.0033 ;
45+ mSamplingEnergyCorrectionPars [1 ] = -2.09 ;
46+ mSamplingEnergyCorrectionPars [2 ] = 1.007 ;
47+ mSamplingEnergyCorrectionPars [3 ] = 0.0667 ;
48+ mSamplingEnergyCorrectionPars [4 ] = -0.108 ;
49+ mSamplingEnergyCorrectionPars [5 ] = 0.0566 ;
50+
51+ mCrystalZCorrectionPars .reserve (9 );
52+ mCrystalZCorrectionPars [0 ] = -0.005187 ;
53+ mCrystalZCorrectionPars [1 ] = 0.7301 ;
54+ mCrystalZCorrectionPars [2 ] = -0.7382 ;
55+ mCrystalZCorrectionPars [3 ] = 0 .;
56+ mCrystalZCorrectionPars [4 ] = 0 .;
57+ mCrystalZCorrectionPars [5 ] = 0 .;
58+ mCrystalZCorrectionPars [6 ] = 0 .;
59+ mCrystalZCorrectionPars [7 ] = 0 .;
60+ mCrystalZCorrectionPars [8 ] = 0 .;
61+
62+ mSamplingZCorrectionPars .reserve (9 );
63+ mSamplingZCorrectionPars [0 ] = -2.137 ;
64+ mSamplingZCorrectionPars [1 ] = 6.400 ;
65+ mSamplingZCorrectionPars [2 ] = -3.342 ;
66+ mSamplingZCorrectionPars [3 ] = -0.1364 ;
67+ mSamplingZCorrectionPars [4 ] = 0.4019 ;
68+ mSamplingZCorrectionPars [5 ] = -0.1969 ;
69+ mSamplingZCorrectionPars [6 ] = 0.008223 ;
70+ mSamplingZCorrectionPars [7 ] = -0.02425 ;
71+ mSamplingZCorrectionPars [8 ] = 0.01190 ;
72+
3473 fCrystalShowerShape = new TF1 (" fCrystal" , " x<[1] ? [0]*exp([3]*x+[4]*x*x+[5]*x*x*x) : (x<[2] ? [0]*[6]*exp([7]*x+[8]*x*x) : [0]*[9]*exp([10]*x+[11]*x*x))" , 0 , 15 );
3574 double pc[12 ];
3675 pc[0 ] = 1 . / 13.15 ;
@@ -354,25 +393,17 @@ void Clusterizer::evalClusters(std::vector<Cluster>& clusters)
354393
355394 // correct cluster energy and z position
356395 float eta = std::abs (cluster.getEta ());
357- float eCor = 1 ;
358- float zCor = 0 ;
359396 bool isCrystal = geo.isCrystal (cluster.getDigitTowerId (0 ));
360- if (isCrystal) {
361- eCor = 0.00444 * std::pow (ee, -1.322 ) + (1.021 + 0.0018 * eta);
362- if (mApplyCorrectionE )
363- ee *= eCor;
364- if (mApplyCorrectionZ )
365- zCor = (-0.00518682 + 0.730052 * eta - 0.73817 * eta * eta);
366- } else {
367- eCor = 0.0033 * std::pow (ee, -2.09 ) + (1.007 + 0.0667 * eta - 0.108 * eta * eta + 0.0566 * eta * eta * eta);
368- if (mApplyCorrectionE )
369- ee *= eCor;
370- if (mApplyCorrectionZ )
371- zCor = (-2.13679 + 6.40009 * eta - 3.34233 * eta * eta) + (-0.136425 + 0.401887 * eta - 0.196851 * eta * eta) * ee + (0.00822276 - 0.0242512 * eta + 0.0118986 * eta * eta) * ee * ee;
397+ if (mApplyCorrectionE ) {
398+ std::vector<double >& pe = isCrystal ? mCrystalEnergyCorrectionPars : mSamplingEnergyCorrectionPars ;
399+ ee *= pe[0 ] * std::pow (ee, pe[1 ]) + pe[2 ] + pe[3 ] * eta + pe[4 ] * eta * eta + pe[5 ] * eta * eta * eta;
400+ cluster.setE (ee);
401+ }
402+ if (mApplyCorrectionZ ) {
403+ std::vector<double >& pz = isCrystal ? mCrystalZCorrectionPars : mSamplingZCorrectionPars ;
404+ float zCor = (pz[0 ] + pz[1 ] * eta + pz[2 ] * eta * eta) + (pz[3 ] + pz[4 ] * eta + pz[5 ] * eta * eta) * ee + (pz[6 ] + pz[7 ] * eta + pz[8 ] * eta * eta) * ee * ee;
405+ cluster.setZ (z > 0 ? z - zCor : z + zCor);
372406 }
373-
374- cluster.setE (ee);
375- cluster.setZ (cluster.getZ () - zCor);
376407
377408 // check if cluster is at the edge of detector module
378409 bool isEdge = 0 ;
@@ -385,7 +416,7 @@ void Clusterizer::evalClusters(std::vector<Cluster>& clusters)
385416 }
386417 cluster.setEdgeFlag (isEdge);
387418
388- LOGF (debug, " Cluster coordinates: (%6.2f,%6.2f,%6.2f), eCor=%6.2f zCor=%6.2f " , cluster.getX (), cluster.getY (), cluster.getZ (), eCor, zCor );
419+ LOGF (debug, " Cluster coordinates: (%6.2f,%6.2f,%6.2f)" , cluster.getX (), cluster.getY (), cluster.getZ ());
389420 }
390421}
391422
0 commit comments