Skip to content

Commit 6f9c772

Browse files
preghenellasawenzel
authored andcommitted
Generators add all particles, primaries in Stack via TMCProcess
1 parent 4fac3ef commit 6f9c772

3 files changed

Lines changed: 7 additions & 11 deletions

File tree

DataFormats/simulation/src/Stack.cxx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,11 @@ void Stack::PushTrack(Int_t toBeDone, Int_t parentId, Int_t pdgCode, Double_t px
150150
Double_t vx, Double_t vy, Double_t vz, Double_t time, Double_t polx, Double_t poly, Double_t polz,
151151
TMCProcess proc, Int_t& ntr, Double_t weight, Int_t is, Int_t secondparentID)
152152
{
153-
if (toBeDone < 10) {
154-
// printf("Pushing Secondary: toBeDone %5d parentId %5d pdgCode %5d is %5d entries %5d \n", toBeDone, parentId, pdgCode, is, mNumberOfEntriesInParticles);
155-
} else {
156-
// printf("Push from Generator Device: toBeDone %5d parentId %5d pdgCode %5d is %5d entries %5d \n", toBeDone, parentId, pdgCode, is, mNumberOfEntriesInParticles);
157-
}
158-
153+
// if (proc == kPPrimary) {
154+
// printf("Push from Generator Device: toBeDone %5d parentId %5d pdgCode %5d is %5d entries %5d \n", toBeDone, parentId, pdgCode, is, mNumberOfEntriesInParticles);
155+
// } else {
156+
// printf("Pushing Secondary: toBeDone %5d parentId %5d pdgCode %5d is %5d entries %5d \n", toBeDone, parentId, pdgCode, is, mNumberOfEntriesInParticles);
157+
// }
159158

160159
//
161160
// This method is called
@@ -184,7 +183,7 @@ void Stack::PushTrack(Int_t toBeDone, Int_t parentId, Int_t pdgCode, Double_t px
184183

185184

186185
// Push particle on the stack if toBeDone is set
187-
if (toBeDone >= 10) {
186+
if (proc == kPPrimary) {
188187
// This is a particle from the primary particle generator
189188
//
190189
// SetBit is used to pass information about the primary particle to the stack during transport.
@@ -194,7 +193,6 @@ void Stack::PushTrack(Int_t toBeDone, Int_t parentId, Int_t pdgCode, Double_t px
194193
mIndexMap[trackId] = trackId;
195194
p.SetBit(ParticleStatus::kKeep);
196195
p.SetBit(ParticleStatus::kPrimary);
197-
toBeDone-=10;
198196
if (toBeDone == 1) {
199197
p.SetBit(ParticleStatus::kToBeDone, 1);
200198
mNumberOfPrimariesforTracking++;

Generators/src/Generator.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ Bool_t
9999

100100
/** loop over particles **/
101101
for (const auto& particle : mParticles) {
102-
if (particle.GetStatusCode() != 1)
103-
continue;
104102
primGen->AddTrack(particle.GetPdgCode(),
105103
particle.Px() * mMomentumUnit,
106104
particle.Py() * mMomentumUnit,

Generators/src/PrimaryGenerator.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ void PrimaryGenerator::AddTrack(Int_t pdgid, Double_t px, Double_t py, Double_t
129129
}
130130

131131
/** success **/
132-
FairPrimaryGenerator::AddTrack(pdgid, px, py, pz, vx, vy, vz, parent, wanttracking + 10, e, tof, weight, proc);
132+
FairPrimaryGenerator::AddTrack(pdgid, px, py, pz, vx, vy, vz, parent, wanttracking, e, tof, weight, proc);
133133
}
134134

135135
/*****************************************************************/

0 commit comments

Comments
 (0)