2 #include <io/CONEXStructures.h>
3 #include <utl/AugerException.h>
4 #include <utl/ErrorLogger.h>
5 #include <evt/ShowerSimData.h>
16 using namespace ConexShowerGeneratorKG;
27 ConexInterface::ConexInterface(
const EHEModel model,
28 const string& parameterPathName,
29 const int storedGenerations,
31 ConexDynamicInterface(model)
35 #if _CONEX2R_VERSION >= 565
42 int nShower = 1000000;
43 int maxDetail = storedGenerations;
44 #ifdef CONEX_EXTENSIONS
45 int particleListMode = 0;
48 parameterPathName.c_str(), parameterPathName.size());
51 parameterPathName.c_str(), parameterPathName.size());
85 double impactParameter = altitude;
86 #if _CONEX2R_VERSION >= 436
87 RunConex(
fRandomSeeds, energyInGeV, zenith, azimuth, impactParameter, particleType);
89 if (impactParameter != 0) {
90 ERROR(
"CONEX version < 4.36, can not set impact parameter (altitude).");
92 RunConex(
fRandomSeeds, energyInGeV, zenith, azimuth, particleType);
101 #if _CONEX2R_VERSION >= 436
106 float outputVersion = 2.5;
116 float outputVersion = 2;
125 int nX = GetNumberOfDepthBins();
135 float miscParameters[13];
137 miscParameters[0], height[0], distance[0]);
148 #if _CONEX2R_VERSION >= 565 // Handling of data related to leading particles
150 std::vector<LeadingInteractionsData> leadingIntData;
151 leadingIntData = GetLeadingInteractionsData();
153 std::vector<LeadingInteractionsParticleData> leadingIntParticleData;
154 leadingIntParticleData = GetLeadingInteractionsParticleData();
158 sort(leadingIntParticleData.begin(),leadingIntParticleData.end(),
161 int nInt = leadingIntData.size();
162 int nParticleInt = leadingIntParticleData.size();
166 for (
int i=0; i<nInt; ++i) {
176 fLeadingParticlesTemp.
SetKinel(leadingIntData[i].kinel);
177 fLeadingParticlesTemp.
SetParentId(leadingIntData[i].pId);
181 fLeadingParticlesTemp.
SetDepth(leadingIntData[i].Depth);
182 fLeadingParticlesTemp.
SetHeight(leadingIntData[i].Height);
185 if (storedParticles > leadingIntData[i].mult)
186 PartMax = leadingIntData[i].mult;
188 PartMax = storedParticles;
191 for (
int k=0; k<PartMax; ++k) {
194 leadingIntParticleData[nParticleInt-1-Ncount-k].fEnergy);
196 leadingIntParticleData[nParticleInt-1-Ncount-k].fID);
198 leadingIntParticleData[nParticleInt-1-Ncount-k].fnInt);
200 Ncount += leadingIntData[i].mult;
204 leadingIntData.clear();
205 leadingIntParticleData.clear();
207 #endif // end of leading interactions data
211 #if _CONEX2R_VERSION >= 436
static bool ParticleSort(const LeadingInteractionsParticleData &lhs, const LeadingInteractionsParticleData &rhs)
Wrapper for CONEX header shower profile data.
void AddParticleId(const double pId)
void SetTargetMass(const int targetMass)
void SimulateShower(int particleType, double energyInGeV, double zenith, double azimuth, double altitude, int storedParticles)
void SetKinel(const double kinel)
void SetParentEnergy(const double parentEnergy)
void SetMultiplicity(const int mult)
void AddInteractionNumber(const int intnumber)
io::CONEXHeader * fHeader
io::CONEXShower * fShower
std::vector< io::CONEXLeadingParticles > fLeadingParticles
void SetHeight(const double height)
void SetVectorLength(const int n)
#define ERROR(message)
Macro for logging error messages.
void SetParentId(const int parentId)
void AddParticleEnergy(const double penergy)
void SetDepth(const double depth)