Skip to content

TPC: add UseGeant4Edep ionisation-fluctuation flag for Kr-83m calibration simulations#15615

Open
Ankyyadav wants to merge 1 commit into
AliceO2Group:devfrom
Ankyyadav:feature/tpc-kr-calibration-generator
Open

TPC: add UseGeant4Edep ionisation-fluctuation flag for Kr-83m calibration simulations#15615
Ankyyadav wants to merge 1 commit into
AliceO2Group:devfrom
Ankyyadav:feature/tpc-kr-calibration-generator

Conversation

@Ankyyadav

Copy link
Copy Markdown
  • Adds TPCDetParam.UseGeant4Edep, an opt-in flag (default off) that uses Geant4's energy deposit directly for ionisation in Detector::ProcessHits, with Fano-limited charge fluctuation via a Gamma-distributed smear (mean/variance tuned for GEANT4). Used for 83mKr TPC calibration simulations.
    • SetSpecialPhysicsCuts() calls matmgr.SpecialCut() for the TPC drift-gas media before the base class reads simcuts.dat (which sets a 10 keV default for these media). This is now exposed as TPCDetParam.SpecialCutsGeV (default 1e-6 GeV = 1 keV), so the actual effective cut
      can be set via configKeyValues.

@Ankyyadav
Ankyyadav marked this pull request as draft July 21, 2026 09:25
Ankyyadav added a commit to Ankyyadav/AliceO2 that referenced this pull request Jul 21, 2026
Please consider the following formatting changes to AliceO2Group#15615
@Ankyyadav
Ankyyadav force-pushed the feature/tpc-kr-calibration-generator branch from 833f9a1 to dfc712d Compare July 23, 2026 13:54
@Ankyyadav
Ankyyadav force-pushed the feature/tpc-kr-calibration-generator branch from dfc712d to cc9dea4 Compare July 23, 2026 14:01
@Ankyyadav
Ankyyadav marked this pull request as ready for review July 23, 2026 14:04
Comment on lines +35 to +41
namespace KrGenConfig
{
inline double rInner = 83.5;
inline double rOuter = 246.5; // TPC outermost pad row outer edge ~247 cm; stay inside
inline double halfZ = 249.7;
inline int nPerEvent = 1000; // override at runtime via KR_N_PER_EVENT env var
} // namespace KrGenConfig

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this namespace needed? I guess the variables could also go to the class.
If you would like to keep it follow the naming convention for the namespaces: lower case with underscore
namespace kr_gen_config

Part of the variable can then be const or constexpr.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comments. I have made the changes

Comment on lines +43 to +46
struct KrProduct {
int pdg;
double eKin;
};

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be only used in KrDecayTable, so it could also go there.

Comment on lines +168 to +171
std::cout << "[KrDecayTable] Loaded from " << path << "\n"
<< " T1: E=" << fE1 << " keV ICC=" << ICC_T1
<< " K_frac=" << Kfrac_T1 << "\n"
<< " T2: E=" << fE2 << " keV ICC=" << ICC_T2 << "\n";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use LOG(info) and remove last \n. Also in other places. Or the appropriate log level.

o2::tpc::KrGenConfig::nPerEvent = n;
}
}
std::cout << "[GeneratorKrDecay] Init:"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOG

<< " K_frac=" << Kfrac_T1 << "\n"
<< " T2: E=" << fE2 << " keV ICC=" << ICC_T2 << "\n";
} else {
std::cout << "[KrDecayTable] WARNING: could not parse " << path

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOG

<< " — using hardcoded fallback values\n";
}
} else {
std::cout << "[KrDecayTable] WARNING: G4LEVELGAMMADATA not set"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOG

Bool_t importParticles() override;

private:
o2::tpc::KrDecayTable* mTable;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use std::unique_ptr

…on support

- TPCDetParam.UseGeant4Edep: use Geant4's own energy deposit for ionisation
  instead of Bethe-Bloch/NA49, with a configurable SpecialCutsGeV threshold
- Adds the Kr-83m decay generator (GeneratorKrDecay) as a compiled Generator
  subclass in Detectors/TPC/simulation, with a thin krGenerator.C macro for
  use as an o2-sim external generator
- Adds plotCluster.C for viewing the resulting calibration spectrum
@Ankyyadav
Ankyyadav force-pushed the feature/tpc-kr-calibration-generator branch from cc9dea4 to d6a0c54 Compare July 24, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants