RdREASSimPreparator.h
Go to the documentation of this file.
1 #ifndef _RdREASSimPreparator_RdREASSimPreparator_h_
2 #define _RdREASSimPreparator_RdREASSimPreparator_h_
3 
4 #include <fwk/VModule.h>
5 #include <utl/CoordinateSystem.h>
6 #include <utl/TimeStamp.h>
7 
8 #include <string>
9 #include <vector>
10 
11 
12 namespace evt {
13  class Event;
14  class ShowerRecData;
15  class Header;
16 }
17 
18 namespace revt {
19  class Header;
20 }
21 
22 namespace RdREASSimPreparator {
23 
24  enum Eprimary {
25  eProton = 24,
26  eIron = 5626
27  };
28 
29 
31 
32  public:
34  virtual ~RdREASSimPreparator() { }
35 
39 
40  private:
41  std::string eventHeader;
42 
43  std::string CorsikaInpFileWriter(const evt::ShowerRecData& show, const utl::Point& core, unsigned int modatm);
44  std::string LaunchCorsikaSim(const std::string& inpfilename);
45  std::string REASFileWriter(const utl::Point& zeCore, const evt::ShowerRecData& show, const std::string& corfilename,
46  const evt::Header& head, const revt::Header& rHead);
47  std::vector<std::string> WriteDetectorFile(const utl::Point& core, const utl::Vector& axis);
48  std::string LaunchConexSim(const evt::ShowerRecData& show, const utl::Point& core);
49  std::string GetEventNumber(const std::string& eventid); // extract the SD event Number from the AUGER ID
50  std::string AddZero(const int runID, const int numberofdigit); // Return runNumber as 000042
51 
52  float CalibrateEnergy(const float e);
53  bool ExtractTypicalShower(const std::string& workdir, const std::string& filename, double& firstintheight,
54  long& firstinttarget, std::string& selshowstring,
55  const std::string& runnrstring);
56 
57  int fRunNumber = 0; // static because the module might be called N-Time
58  int fSeed = 1;
59  int fAntennaPerJob = 50;
60  int fNConexShower = 0;
61  std::string fWorkingDir;
62  std::string fUserName;
63  std::string fROOTSYS_Corsika;
64  std::string fROOTSYS_Reas;
65  std::string fCorsikapath;
66  std::string fCorsikaBin;
67  std::string fPathToREAS;
68  std::string fREASbin;
69  std::string fFLUPRO;
70  std::string fCOAST_BASE_DIR;
71  std::string fCOAST_DIR;
72  std::string fCOAST_USER_LIB;
73  std::string fConexDir;
74  std::string fConexBin;
75  std::string fUseGeometry;
76  std::string fUseEnergy;
77  std::string fprim;
78  bool fUseCoreDistance = false;
79  int fModel = 0;
83  bool fUseConex = false;
87  double fBFieldHorizontal = 0;
88  double fBFieldVertical = 0;
89  double fStepfc = 0;
90  double fThinningLevel = 0;
92  double fMagneticFieldX = 0;
93  double fMagneticFieldY = 0;
95  bool fWriteAERAlist = true;
96  double fMaxAxisDistance = 0;
97 
98  REGISTER_MODULE("RdREASSimPreparator", RdREASSimPreparator);
99 
100  };
101 
102 
103  class tupel {
104  public:
105  tupel(int a, float b, float c, float pg, float p1, float p2, float p3, float p4)
106  : num(a), xmax(b), mult(c), eg(pg), e1(p1), e2(p2), e3(p3), e4(p4) { }
107 
108  bool operator<(const tupel& rhs) const { return xmax < rhs.xmax; } // sort by xmax value
109 
110  float
111  quality()
112  const
113  {
114  return (pow((1.f - (fabs(xmax - avgxmax) / avgxmax)), 5.f) * sqrt(1. - e1 / eg)
115  * sqrt((e1 + e2 + e3 + e4) / (4. * e1)));
116  }
117 
118  bool
119  operator()(const tupel& lhs, const tupel& rhs)
120  const
121  { // sort by quality
122  return lhs.quality() > rhs.quality();
123  }
124 
125  int num;
126  float xmax;
127  float mult;
128  float avgxmax;
129  float eg;
130  float e1;
131  float e2;
132  float e3;
133  float e4;
134  };
135 
136 }
137 
138 
139 #endif
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)
std::string GetEventNumber(const std::string &eventid)
REGISTER_MODULE("RdREASSimPreparator", RdREASSimPreparator)
std::string LaunchCorsikaSim(const std::string &inpfilename)
Point object.
Definition: Point.h:32
Interface class to access Shower Reconstructed parameters.
Definition: ShowerRecData.h:33
bool ExtractTypicalShower(const std::string &workdir, const std::string &filename, double &firstintheight, long &firstinttarget, std::string &selshowstring, const std::string &runnrstring)
From the conex output file find typical shower ///.
std::string LaunchConexSim(const evt::ShowerRecData &show, const utl::Point &core)
std::vector< std::string > WriteDetectorFile(const utl::Point &core, const utl::Vector &axis)
double pow(const double x, const unsigned int i)
bool operator<(const tupel &rhs) const
std::string CorsikaInpFileWriter(const evt::ShowerRecData &show, const utl::Point &core, unsigned int modatm)
constexpr double meter
Definition: AugerUnits.h:81
fwk::VModule::ResultFlag Run(evt::Event &event)
Run: invoked once per event.
Module interface.
Definition: VModule.h:53
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
std::string AddZero(const int runID, const int numberofdigit)
constexpr double volt
Definition: AugerUnits.h:229
Header file holding the RD Event Trigger class definition (based on SD)
Definition: REvent/Header.h:14
Vector object.
Definition: Vector.h:30
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
bool operator()(const tupel &lhs, const tupel &rhs) const
char * filename
Definition: dump1090.h:266
tupel(int a, float b, float c, float pg, float p1, float p2, float p3, float p4)
Global event header.
Definition: Event/Header.h:27
std::string REASFileWriter(const utl::Point &zeCore, const evt::ShowerRecData &show, const std::string &corfilename, const evt::Header &head, const revt::Header &rHead)

, generated on Tue Sep 26 2023.