@@ -228,7 +228,6 @@ struct OnTheFlyTofPid {
228228 pRandomNumberGenerator.SetSeed (0 ); // fully randomize
229229 if (simConfig.flagTOFLoadDelphesLUTs ) {
230230 for (int icfg = 0 ; icfg < nGeometries; ++icfg) {
231- const std::string histPath = " Configuration_" + std::to_string (icfg) + " /" ;
232231 mSmearer .emplace_back (std::make_unique<o2::fastsim::TrackSmearer>());
233232 mSmearer [icfg]->setCcdbManager (ccdb.operator ->());
234233 std::map<std::string, std::string> globalConfiguration = mGeoContainer .getConfiguration (icfg, " global" );
@@ -392,8 +391,13 @@ struct OnTheFlyTofPid {
392391 delete hHitMapInPixelBefore;
393392 }
394393
395- TOFLayerEfficiency (float r, float l, std::array<float , 2 > pDimensions, float fIA , float m)
396- : layerRadius(r), layerLength(l), pixelDimensionZ(pDimensions[0 ]), pixelDimensionRPhi(pDimensions[1 ]), fractionInactive(fIA ), magField(m), axisZ(new TAxis(static_cast <int >(layerLength / pixelDimensionZ), -layerLength / 2 , layerLength))
394+ TOFLayerEfficiency (float r, float l, std::array<float , 2 > pDimensions, float fIA , float m) : layerRadius(r),
395+ layerLength (l),
396+ pixelDimensionZ(pDimensions[0 ]),
397+ pixelDimensionRPhi(pDimensions[1 ]),
398+ fractionInactive(fIA ),
399+ magField(m),
400+ axisZ(new TAxis(static_cast <int >(layerLength / pixelDimensionZ), -layerLength / 2, layerLength))
397401 {
398402 // Assuming square pixels for simplicity
399403 const float circumference = o2::constants::math::TwoPI * layerRadius;
@@ -466,18 +470,22 @@ struct OnTheFlyTofPid {
466470 // LOG(warning) << "Local hit difference in z is bigger than the pixel size";
467471 }
468472 hHitMapInPixelBefore->Fill (localZ, localRPhi);
473+ enum PixelBin : int { kInactiveLeft = 0 ,
474+ kInactiveRight = 1 ,
475+ kInactiveBottom = 3 ,
476+ kInactiveTop = 4 };
469477 switch (axisInPixelRPhi->FindBin (localRPhi)) {
470- case 0 :
471- case 1 :
472- case 3 :
473- case 4 :
478+ case kInactiveLeft :
479+ case kInactiveRight :
480+ case kInactiveBottom :
481+ case kInactiveTop :
474482 return false ;
475483 }
476484 switch (axisInPixelZ->FindBin (localZ)) {
477- case 0 :
478- case 1 :
479- case 3 :
480- case 4 :
485+ case kInactiveLeft :
486+ case kInactiveRight :
487+ case kInactiveBottom :
488+ case kInactiveTop :
481489 return false ;
482490 }
483491 hHitMapInPixel->Fill (localZ, localRPhi);
@@ -809,7 +817,7 @@ struct OnTheFlyTofPid {
809817 static std::array<float , NParticles> expectedTimeInnerTOF, expectedTimeOuterTOF;
810818 static std::array<float , NParticles> deltaTimeInnerTOF, deltaTimeOuterTOF;
811819 static std::array<float , NParticles> nSigmaInnerTOF, nSigmaOuterTOF;
812- float momentumHypotheses[ NParticles] ; // Store momentum hypothesis for each particle
820+ std::array< float , NParticles> momentumHypotheses ; // Store momentum hypothesis for each particle
813821 auto truePdgInfo = pdg->GetParticle (mcParticle.pdgCode ());
814822 float rigidity = momentum; // fallback to momentum if charge unknown
815823
@@ -866,8 +874,8 @@ struct OnTheFlyTofPid {
866874 double etaResolution = std::fabs (std::sin (2.0 * std::atan (std::exp (-pseudorapidity)))) * std::sqrt (trkWithTime.mPseudorapidity .second );
867875 if (simConfig.flagTOFLoadDelphesLUTs ) {
868876 if (mSmearer [collision.lutConfigId ()]->hasTable (Particles[ii].pdgCode )) { // Only if the LUT for this particle was loaded
869- ptResolution = mSmearer [collision.lutConfigId ()]->getAbsPtRes (Particles[ii].pdgCode , dNdEta, pseudorapidity , transverseMomentum);
870- etaResolution = mSmearer [collision.lutConfigId ()]->getAbsEtaRes (Particles[ii].pdgCode , dNdEta, pseudorapidity , transverseMomentum);
877+ ptResolution = mSmearer [collision.lutConfigId ()]->getAbsPtRes (Particles[ii].pdgCode , pseudorapidity, dNdEta , transverseMomentum);
878+ etaResolution = mSmearer [collision.lutConfigId ()]->getAbsEtaRes (Particles[ii].pdgCode , pseudorapidity, dNdEta , transverseMomentum);
871879 }
872880 }
873881 const float innerTrackTimeReso = calculateTrackTimeResolutionAdvanced (transverseMomentum, pseudorapidity, ptResolution, etaResolution, Particles[ii].mass , simConfig.innerTOFRadius , mMagneticField );
0 commit comments