Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 60 additions & 1 deletion r3bgen/R3BINCLRootGenerator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ bool R3BINCLRootGenerator::ReadEvent(FairPrimaryGenerator* primGen)
if (!validevent)
{
fEvt++;
continue;
}
}
else if (fOnlySpallation)
Expand All @@ -96,8 +97,34 @@ bool R3BINCLRootGenerator::ReadEvent(FairPrimaryGenerator* primGen)
if (!validevent)
{
fEvt++;
continue;
}
}

else if (fOnlyP2pSpallation)
{
Comment thread
jose-luis-rs marked this conversation as resolved.
Int_t nbp = 0;
for (Int_t j = 0; j < fParticles; j++)
if (fOrigin[j] == 0)
Comment thread
jose-luis-rs marked this conversation as resolved.
validevent = true;
Comment thread
jose-luis-rs marked this conversation as resolved.
if (!validevent)
{
fEvt++;
Comment thread
jose-luis-rs marked this conversation as resolved.
continue;
}

for (Int_t j = 0; j < fParticles; j++)
if (fPdgCode[j] == 2212)
nbp++;

if (nbp != 2 && validevent)
{
fEvt++;
validevent = false;
continue;
}
}

else if (fOnlyP2pFission)
{
Int_t nbp = 0;
Expand All @@ -107,6 +134,7 @@ bool R3BINCLRootGenerator::ReadEvent(FairPrimaryGenerator* primGen)
if (!validevent)
{
fEvt++;
continue;
}

for (Int_t j = 0; j < fParticles; j++)
Expand All @@ -117,14 +145,45 @@ bool R3BINCLRootGenerator::ReadEvent(FairPrimaryGenerator* primGen)
{
fEvt++;
validevent = false;
continue;
}
}

else if (fOnlyPpnSpallation)
{
Int_t nbp = 0;
Int_t nbn = 0;
for (Int_t j = 0; j < fParticles; j++)
if (fOrigin[j] == 0)
validevent = true;
if (!validevent)
{
fEvt++;
continue;
}

Comment thread
jose-luis-rs marked this conversation as resolved.
for (Int_t j = 0; j < fParticles; j++)
{
if (fPdgCode[j] == 2212)
nbp++;
if (fPdgCode[j] == 2112)
nbn++;
}

if ((nbp != 1 || nbn != 1) && validevent)
{
fEvt++;
validevent = false;
continue;
}
}

else
{
validevent = true;
}

if (fEvt > fEvtRoot)
if (fEvt >= fEvtRoot)
{
LOG(error)
<< "\033[5m\033[31m R3BINCLRootGenerator: Number of simulated events larger than the ones contained "
Expand Down
22 changes: 17 additions & 5 deletions r3bgen/R3BINCLRootGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ class R3BINCLRootGenerator : public FairGenerator
**/
void SetOnlyP2pFission(bool Opt = true) { fOnlyP2pFission = Opt; }

/**
** Method to simulate only p2p-spallation events
**/
void SetOnlyP2pSpallation(bool Opt = true) { fOnlyP2pSpallation = Opt; }

/**
** Method to simulate only ppn-spallation events
**/
void SetOnlyPpnSpallation(bool Opt = true) { fOnlyPpnSpallation = Opt; }

/**
** Method to simulate only fragments (changed with SetMinPdgCode)
**/
Expand All @@ -90,11 +100,13 @@ class R3BINCLRootGenerator : public FairGenerator
private:
TString fFileName; // Input file name
TFile* fInput;
bool fOnlyFission = false; // True if we want to simulate only fission events
bool fOnlyP2pFission = false; // True if we want to simulate only p2p-fission events
bool fOnlySpallation = false; // True if we want to simulate only spallation events
bool fOnlyFragments = false; // True if we want to simulate only fragments
int fPdgCodeMin = 1000050070; // Limit in Boro-7
bool fOnlyFission = false; // True if we want to simulate only fission events
bool fOnlyP2pFission = false; // True if we want to simulate only p2p-fission events
bool fOnlyP2pSpallation = false; // True if we want to simulate only p2p-spallation events
bool fOnlyPpnSpallation = false; // True if we want to simulate only ppn-spallation events
bool fOnlySpallation = false; // True if we want to simulate only spallation events
bool fOnlyFragments = false; // True if we want to simulate only fragments
int fPdgCodeMin = 1000050070; // Limit in Boro-7
double fRotXBeam = 0.;
double fRotYBeam = 0.;

Expand Down
Loading