Skip to content

Commit 3c4a6e6

Browse files
committed
feat(r3bgen): Add method to select only p2p and ppn reactions in the INCL generator.
fix(r3bgen): Allow for non-QF p2p selection.
1 parent 3b429c7 commit 3c4a6e6

2 files changed

Lines changed: 68 additions & 5 deletions

File tree

r3bgen/R3BINCLRootGenerator.cxx

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,29 @@ bool R3BINCLRootGenerator::ReadEvent(FairPrimaryGenerator* primGen)
9898
fEvt++;
9999
}
100100
}
101+
102+
else if (fOnlyP2pSpallation)
103+
{
104+
Int_t nbp = 0;
105+
for (Int_t j = 0; j < fParticles; j++)
106+
if (fOrigin[j] == 0)
107+
validevent = true;
108+
if (!validevent)
109+
{
110+
fEvt++;
111+
}
112+
113+
for (Int_t j = 0; j < fParticles; j++)
114+
if (fPdgCode[j] == 2212)
115+
nbp++;
116+
117+
if (nbp != 2 && validevent)
118+
{
119+
fEvt++;
120+
validevent = false;
121+
}
122+
}
123+
101124
else if (fOnlyP2pFission)
102125
{
103126
Int_t nbp = 0;
@@ -119,6 +142,34 @@ bool R3BINCLRootGenerator::ReadEvent(FairPrimaryGenerator* primGen)
119142
validevent = false;
120143
}
121144
}
145+
146+
else if (fOnlyPpnSpallation)
147+
{
148+
Int_t nbp = 0;
149+
Int_t nbn = 0;
150+
for (Int_t j = 0; j < fParticles; j++)
151+
if (fOrigin[j] == 0)
152+
validevent = true;
153+
if (!validevent)
154+
{
155+
fEvt++;
156+
}
157+
158+
for (Int_t j = 0; j < fParticles; j++)
159+
{
160+
if (fPdgCode[j] == 2212)
161+
nbp++;
162+
if (fPdgCode[j] == 2112)
163+
nbn++;
164+
}
165+
166+
if ((nbp != 1 || nbn != 1) && validevent)
167+
{
168+
fEvt++;
169+
validevent = false;
170+
}
171+
}
172+
122173
else
123174
{
124175
validevent = true;

r3bgen/R3BINCLRootGenerator.h

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,16 @@ class R3BINCLRootGenerator : public FairGenerator
7575
**/
7676
void SetOnlyP2pFission(bool Opt = true) { fOnlyP2pFission = Opt; }
7777

78+
/**
79+
** Method to simulate only p2p-spallation events
80+
**/
81+
void SetOnlyP2pSpallation(bool Opt = true) { fOnlyP2pSpallation = Opt; }
82+
83+
/**
84+
** Method to simulate only ppn-spallation events
85+
**/
86+
void SetOnlyPpnSpallation(bool Opt = true) { fOnlyPpnSpallation = Opt; }
87+
7888
/**
7989
** Method to simulate only fragments (changed with SetMinPdgCode)
8090
**/
@@ -90,11 +100,13 @@ class R3BINCLRootGenerator : public FairGenerator
90100
private:
91101
TString fFileName; // Input file name
92102
TFile* fInput;
93-
bool fOnlyFission = false; // True if we want to simulate only fission events
94-
bool fOnlyP2pFission = false; // True if we want to simulate only p2p-fission events
95-
bool fOnlySpallation = false; // True if we want to simulate only spallation events
96-
bool fOnlyFragments = false; // True if we want to simulate only fragments
97-
int fPdgCodeMin = 1000050070; // Limit in Boro-7
103+
bool fOnlyFission = false; // True if we want to simulate only fission events
104+
bool fOnlyP2pFission = false; // True if we want to simulate only p2p-fission events
105+
bool fOnlyP2pSpallation = false; // True if we want to simulate only p2p-spallation events
106+
bool fOnlyPpnSpallation = false; // True if we want to simulate only ppn-spallation events
107+
bool fOnlySpallation = false; // True if we want to simulate only spallation events
108+
bool fOnlyFragments = false; // True if we want to simulate only fragments
109+
int fPdgCodeMin = 1000050070; // Limit in Boro-7
98110
double fRotXBeam = 0.;
99111
double fRotYBeam = 0.;
100112

0 commit comments

Comments
 (0)