13 #include <boost/format.hpp>
14 #include <evt/Event.h>
15 #include <evt/ShowerFRecData.h>
16 #include <evt/GaisserHillas4Parameter.h>
17 #include <sevt/SEvent.h>
18 #include <sevt/Header.h>
20 #include <fevt/EyeRecData.h>
21 #include <fevt/EyeHeader.h>
22 #include <utl/PhysicalConstants.h>
23 #include <utl/PhysicalFunctions.h>
24 #include <utl/AugerUnits.h>
25 #include <utl/UTMPoint.h>
26 #include <utl/Reader.h>
27 #include <det/Detector.h>
28 #include <atm/Atmosphere.h>
29 #include <atm/ProfileResult.h>
30 #include <atm/InclinedAtmosphericProfile.h>
31 #include <fwk/CentralConfig.h>
38 using namespace FdProfileReconstructorKG;
39 using namespace oBLAS;
47 using namespace boost;
64 string outputFileName;
66 fOutputFile =
new TFile(outputFileName.c_str(),
"RECREATE");
67 if (fVerbosity >- 1) {
68 std::ostringstream info;
69 info <<
"\n\t saving matrix visualization to "
70 << outputFileName << endl;
82 cout <<
"\n writing ROOT output" << endl;
86 const SEvent& sEvent =
event.GetSEvent();
89 const int eyeId = eye.
GetId();
91 const string eventDirName = (format(
"Event_%04d_eye%1d") % eventId % eyeId ).str();
93 fOutputFile->mkdir(eventDirName.c_str(),
" ");
94 fOutputFile->cd(eventDirName.c_str());
96 WriteLateral(eye, chfl);
104 namespace ublas = boost::numeric::ublas;
110 const double Xmax = gh4->
GetXMax();
111 const double dEdXmax = gh4->
GetNMax();
116 unsigned int n = chFlMatrix.size1();
118 const std::deque<double>& depth = *ChFl.
GetDepth();
120 ublas::vector<double> dEdX(n);
121 for (
unsigned int i = 0; i < n; ++i)
122 dEdX(i) =
GaisserHillas(depth[i], X0, Xmax, dEdXmax, lambda);
130 ublas::vector<double> allScat = allChMScat + allChRScat;
132 vector<double> groundLevelDistance(1, 0.);
133 vector<double> groundLevelScattered(1, 0.);
134 vector<double> groundLevelFluo(1, 0.);
135 vector<double> xmaxLevelDistance(1, 0.);
136 vector<double> xmaxLevelScattered(1, 0.);
137 vector<double> xmaxLevelFluo(1, 0.);
142 for (
unsigned int i = 0; i < depth.size(); ++i) {
143 if (i == 0 || fabs(Xmax - depth[i]) < minDist) {
145 minDist = fabs(Xmax - depth[i]);
150 while (zeta < 10.*
degree) {
157 groundLevelFluo.push_back(vFluo[iGround] / allFluo[iGround]);
158 groundLevelScattered.push_back((vChMScat[iGround] + vChRScat[iGround]) / allScat[iGround]);
162 xmaxLevelFluo.push_back(vFluo[iXmax] / allFluo[iXmax]);
163 xmaxLevelScattered.push_back((vChMScat[iXmax] + vChRScat[iXmax]) / allScat[iXmax]);
167 cout <<
"calc. zeta " << zeta/
degree << endl;
172 double ageAtGround = floor(
ShowerAge(depth[iGround], Xmax)*10. + 0.5) / 10.;
173 const string groundAge = (format(
"s=%3.1f") % ageAtGround).str();
175 TGraph groundFluoGraph(groundLevelDistance.size(),
176 &groundLevelDistance.front(),
177 &groundLevelFluo.front());
178 groundFluoGraph.SetName(
"groundFluo");
179 groundFluoGraph.SetTitle(groundAge.c_str());
180 groundFluoGraph.Write();
182 TGraph groundScatteredGraph(groundLevelDistance.size(),
183 &groundLevelDistance.front(),
184 &groundLevelScattered.front());
185 groundScatteredGraph.SetName(
"groundScattered");
186 groundScatteredGraph.SetTitle(groundAge.c_str());
187 groundScatteredGraph.Write();
189 TGraph xmaxFluoGraph(xmaxLevelDistance.size(),
190 &xmaxLevelDistance.front(),
191 &xmaxLevelFluo.front());
192 xmaxFluoGraph.SetName(
"xmaxFluo");
193 xmaxFluoGraph.SetTitle(
"s=1");
194 xmaxFluoGraph.Write();
196 TGraph xmaxScatteredGraph(xmaxLevelDistance.size(),
197 &xmaxLevelDistance.front(),
198 &xmaxLevelScattered.front());
199 xmaxScatteredGraph.SetName(
"xmaxScattered");
200 xmaxScatteredGraph.SetTitle(
"s=1");
201 xmaxScatteredGraph.Write();
207 fOutputFile->Write();
208 fOutputFile->Close();
double GetShapeParameter(const gh::EShapeParameter par) const
access to all variants of shape parameters (see GaisserHillasTypes.h)
unsigned int GetId() const
const oBLAS::lowerTriangularMatrix * GetMieScatteredCherenkovMatrix() const
returns Mie scattered Cherenkov light matrix
void Write(const evt::Event &event, const fevt::Eye &eye, CherenkovFluorescenceMatrix chfl)
Fluorescence Detector Eye Event.
Interface class to access to the SD part of an event.
const oBLAS::lowerTriangularMatrix * GetRayleighScatteredCherenkovMatrix() const
returns Rayleigh scattered Cherenkov light matrix
#define INFO(message)
Macro for logging informational messages.
void Init()
Initialise the registry.
void SetZeta(const double z)
set zeta
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
void WriteLateral(const fevt::Eye &eye, CherenkovFluorescenceMatrix &chfl)
Class representing a document branch.
double GetZetaDistance(const int) const
get distance to shower axis corresponding to zeta
evt::ShowerFRecData & GetFRecShower()
Reconstructed shower info for this eye.
void GetData(bool &b) const
Overloads of the GetData member template function.
const oBLAS::lowerTriangularMatrix * GetCherenkovFluorescenceMatrix() const
returns total light matrix (not const as we eventually want to invert it ...)
double GaisserHillas(const double x, const double x0, const double xMax, const double nMax, const double lambda)
Calculate the Gaisser-Hillas function.
double ShowerAge(const double slantDepth, const double showerMax)
General definition of shower age.
const std::deque< double > * GetDepth() const
returns depth
Calculation of Cherenkov and Fluorescence matrix.
Interface class to access to Fluorescence reconstruction of a Shower.
sevt::Header & GetHeader()
Main configuration utility.
const oBLAS::diagonalMatrix * GetFluorescenceMatrix() const
returns fluorescence light matrix
Gaisser Hillas with 4 parameters.
utl::Branch GetTopBranch(const std::string &id)
Get top branch for moduleConfigLink with given id (XML files)
fevt::EyeRecData & GetRecData()
Reconstructed data for this eye.