Skip to content

Commit 8393c60

Browse files
amorschsawenzel
authored andcommitted
primary kinematic initialisation for MaterialBudgetMap moved to Stepping
1 parent f2d261c commit 8393c60

2 files changed

Lines changed: 16 additions & 18 deletions

File tree

Steer/include/Steer/O2MCApplicationEvalMat.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class O2MCApplicationEvalMat : public O2MCApplicationBase
4040
O2MCApplicationEvalMat(const char* name, const char* title, TObjArray* ModList, const char* MatName) : O2MCApplicationBase(name, title, ModList, MatName), mMaterialBudgetMap(nullptr), mPhi(0), mMode(-1) {}
4141

4242
~O2MCApplicationEvalMat() override = default;
43-
void BeginPrimary() override;
4443
void FinishPrimary() override;
4544
void Stepping() override;
4645
void BeginEvent() override;

Steer/src/O2MCApplicationEvalMat.cxx

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,6 @@ namespace o2
2020
{
2121
namespace steer
2222
{
23-
void O2MCApplicationEvalMat::BeginPrimary()
24-
{
25-
TLorentzVector p;
26-
fMC->TrackMomentum(p);
27-
Float_t x, y, z;
28-
fMC->TrackPosition(x, y, z);
29-
30-
mPhi = p.Phi() * 180. / TMath::Pi();
31-
if (mPhi < 0.) {
32-
mPhi += 360.;
33-
}
34-
35-
mC1[0] = p.Theta() * 180. / TMath::Pi();
36-
mC1[1] = p.Eta();
37-
mC1[2] = z;
38-
}
39-
4023
void O2MCApplicationEvalMat::FinishPrimary()
4124
{
4225
mMaterialBudgetMap->FinishPrimary(mC1[mMode], mPhi);
@@ -46,6 +29,22 @@ void O2MCApplicationEvalMat::FinishPrimary()
4629
void O2MCApplicationEvalMat::Stepping()
4730
{
4831
// dispatch to MaterialBudget Map
32+
if (fMC->IsNewTrack()) {
33+
TLorentzVector p;
34+
fMC->TrackMomentum(p);
35+
Float_t x, y, z;
36+
fMC->TrackPosition(x, y, z);
37+
38+
mPhi = p.Phi() * 180. / TMath::Pi();
39+
if (mPhi < 0.) {
40+
mPhi += 360.;
41+
}
42+
43+
mC1[0] = p.Theta() * 180. / TMath::Pi();
44+
mC1[1] = p.Eta();
45+
mC1[2] = z;
46+
}
47+
4948
mMaterialBudgetMap->Stepping();
5049
}
5150

0 commit comments

Comments
 (0)