11 #include <utl/ErrorLogger.h>
12 #include <utl/MathConstants.h>
13 #include <utl/Vector.h>
14 #include <utl/PhysicalConstants.h>
15 #include <utl/PhysicalFunctions.h>
16 #include <utl/Reader.h>
18 #include <utl/TabulatedFunctionErrors.h>
19 #include <utl/UTMPoint.h>
21 #include <evt/Event.h>
22 #include <evt/ShowerRecData.h>
23 #include <evt/ShowerFRecData.h>
25 #include <fevt/FEvent.h>
27 #include <fevt/Telescope.h>
28 #include <fevt/EyeRecData.h>
30 #include <det/Detector.h>
31 #include <atm/Atmosphere.h>
32 #include <atm/AttenuationResult.h>
33 #include <atm/ProfileResult.h>
35 #include <fdet/FDetector.h>
37 #include <fdet/Telescope.h>
38 #include <fdet/Pixel.h>
39 #include <fdet/Channel.h>
41 #include <fwk/LocalCoordinateSystem.h>
42 #include <fwk/CentralConfig.h>
45 using namespace FdProfileFinderOG;
85 eyeiter !=
event.GetFEvent().EyesEnd();
94 det::Detector::GetInstance().GetFDetector().GetEye(eye).GetEyeCoordinateSystem();
97 det::Detector::GetInstance().GetFDetector().GetEye(eye).GetPosition();
100 INFO(
"Eye has no geometry info");
116 Vector vertical(0,0,1,eyeCS);
120 double core_distance =
fRp / sin(
kPi - fChi0);
122 fCore_Eye_vec = core_distance * horizontalInSDP;
123 fCore = eyepos + fCore_Eye_vec;
125 LightAtApertureToSize(eye);
147 double showerMax = 800*
g/
cm/
cm;
154 const Atmosphere& atm = det::Detector::GetInstance().GetAtmosphere();
174 det::Detector::GetInstance().GetFDetector().GetTelescope(*itTel);
175 const double refLambda =
176 det::Detector::GetInstance().GetFDetector().GetReferenceLambda();
186 for (iter = lightflux.
Begin();
187 iter != lightflux.
End();
190 double time = iter->
X();
192 double ph_at_dia = iter->
Y();
193 double ph_at_dia_err = iter->
YErr();
196 double l = fCore_Eye_vec.GetMag() * sin (chi_i) / sin (fChi0 - chi_i);
200 Vector chi_i_vec = fCore_Eye_vec + l * fAxis;
203 Point chi_i_point = fCore + l * fAxis;
209 if (height>atmHeightMax || height<atmHeightMin) {
225 double time1 = time/
ns - dtime/
ns;
226 double time2 = time/
ns + dtime/
ns;
229 double l1 = fCore_Eye_vec.GetMag() * sin (chi_1) / sin (fChi0 - chi_1);
231 double l2 = fCore_Eye_vec.GetMag() * sin (chi_2) / sin (fChi0 - chi_2);
234 double deltaL =
abs (l2 - l1);
237 double verticalDepth = dvh.
Y(height);
240 double Xdepth = verticalDepth /
abs (cos(fAxis.GetTheta(coreCS)));
242 double solidangle = 1 / (4.0 *
kPi* chi_i_vec.
GetMag2());
248 std::vector<double> relfluorescenceYield_vec( fluoyield_tab.
GetNPoints());
249 std::vector<double> waveLength_vec( fluoyield_tab.
GetNPoints());
252 copy(fluoyield_tab.
YBegin(),fluoyield_tab.
YEnd(),
253 relfluorescenceYield_vec.begin());
255 double fluoyield_normalization = fluoyield_tab.
SumY();
257 double dEdX =
EnergyDeposit(Xdepth, showerMax, fEnergyCutoff);
262 double totalyield = fluoyield_normalization * dEdX / dEdX0;
264 for ( vector<double>::iterator it= relfluorescenceYield_vec.begin();
265 it != relfluorescenceYield_vec.end();
267 (*it) /= fluoyield_normalization;
270 copy(fluoyield_tab.
XBegin(), fluoyield_tab.
XEnd(),
271 waveLength_vec.begin());
275 det::Detector::GetInstance().GetFDetector().GetEye(eye).GetPosition();
276 Point trackpos = eyepos + chi_i_vec;
298 for (
unsigned int i = 0; i<waveLength_vec.size(); i++){
300 * rayleighAtt.
Y(waveLength_vec[i]) * mieAtt.
Y(waveLength_vec[i]);
304 n_e = ph_at_dia * detector_eff_ref/solidangle/deltaL/totalyield/convert;
305 L = ph_at_dia * detector_eff_ref/solidangle/convert;
307 double n_e_err= ph_at_dia_err* n_e / ph_at_dia;
309 longitudinalprofile.
PushBack(Xdepth,0,n_e,n_e_err);
312 double L_err= ph_at_dia_err* L / ph_at_dia;
314 photons_at_track.
PushBack(Xdepth,0,L,L_err);
AxialVector cross(const Vector &l, const Vector &r)
vector cross product
unsigned int GetNPoints() const
Top of the interface to Atmosphere information.
const utl::TabulatedFunction & EvaluateFluorescenceYield(const double heightAboveSeaLevel) const
Evaluated Fluorescence Yield for a specific model.
bool HasLightFlux(const FdConstants::LightSource source=FdConstants::eTotal) const
Check that light profile for source /par source is present.
fwk::VModule::ResultFlag Run(evt::Event &event)
Run: invoked once per event.
atm::AttenuationResult EvaluateMieAttenuation(const utl::Point &xInit, const utl::Point &xFinal, const std::vector< double > &wLength) const
Fluorescence Detector Eye Event.
bool HasFluorescencePhotons() const
const utl::TabulatedFunctionErrors & GetTransmissionFactor() const
Transmission factor.
void MakeLongitudinalProfile()
double GetChiZero() const
ArrayIterator XEnd()
end of array of X
Class to hold collection (x,y) points and provide interpolation between them.
const atm::ProfileResult & EvaluateDensityVsHeight() const
Tabulated function giving Y=density as a function of X=height.
void MakeFluorescencePhotons()
const std::string & GetConfigSignature(const std::string &module) const
#define INFO(message)
Macro for logging informational messages.
boost::filter_iterator< ComponentSelector, AllEyeIterator > EyeIterator
selective Eye iterators
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
double GetModelMeanEfficiency(const std::string &configSignature, const double wl) const
double Y(const double x) const
Get the Y value (coordinate) for given X (ordinate)
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
double SumY() const
return the sum of Y values
Class representing a document branch.
void MakeFRecShower()
Allocate reconstructed shower info.
Reference ellipsoids for UTM transformations.
bool HasLongitudinalProfile() const
Class describing the Atmospheric profile.
double abs(const SVector< n, T > &v)
atm::AttenuationResult EvaluateRayleighAttenuation(const utl::Point &xInit, const utl::Point &xFinal, const std::vector< double > &wLength) const
Compute Rayleigh attenuation between points.
bool HasFRecShower() const
Check if reconstructed shower info has been allocated.
evt::ShowerFRecData & GetFRecShower()
Reconstructed shower info for this eye.
EyeIterator EyesBegin(const ComponentSelector::Status status)
Triple PointToLatitudeLongitudeHeight(const Point &thePoint) const
Convert Point to Lat/Long/Height.
const atm::ProfileResult & EvaluateDepthVsHeight() const
Tabulated function giving Y=depth as a function of X=height.
boost::filter_iterator< ComponentSelector, AllTelescopeIterator > TelescopeIterator
selective Telescope iterators
void PushBack(const double x, const double xErr, const double y, const double yErr)
void GetData(bool &b) const
Overloads of the GetData member template function.
TelescopeIterator TelescopesBegin()
first available tel of status eHasData (DEPRECATED)
const utl::AxialVector & GetSDP() const
fevt::FEvent & GetFEvent()
ArrayIterator YBegin()
begin of array of Y
bool HasGHParameters() const
constexpr double kSpeedOfLight
Detector description interface for Telescope-related data.
double MinX() const
Return the minimum value for X (ordinate) stored in the profile.
ResultFlag
Flag returned by module methods to the RunController.
void SetEnergyCutoff(const double energy)
utl::TabulatedFunctionErrors & GetLongitudinalProfile()
retrieve longitudinal profile information (size vs depth)
utl::TabulatedFunctionErrors & GetFluorescencePhotons()
retrieve number of fluorescence photons versus depth
ArrayIterator XBegin()
begin of array of X
double EnergyDeposit(const double age, const double enCut)
Parametrization for the average energy deposit per particle.
Interface class to access to Fluorescence reconstruction of a Shower.
double GetdEdX0() const
get reference energy deposit for fluorescence yield model
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)
Main configuration utility.
utl::CoordinateSystemPtr Get(const std::string &id)
Get a well-known Coordinate System.
ArrayIterator YEnd()
end of array of Y
utl::TabulatedFunctionErrors & GetLightFlux(const FdConstants::LightSource source=fevt::FdConstants::eTotal)
Light flux at diaphragm, photons/m^2 versus time in ns.
double Y(const double x) const
Get or interpolate the Y value that corresponds to parameter x.
static Policy::type Create(const utl::Point &theOrigin)
Create the standard local coordinate system for a Point.
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
void LightAtApertureToSize(fevt::Eye &eye)
utl::Branch GetTopBranch(const std::string &id)
Get top branch for moduleConfigLink with given id (XML files)
Class describing the Atmospheric attenuation.
const atm::ProfileResult & EvaluateTemperatureVsHeight() const
Tabulated function giving Y=temperature as a function of X=height.
double MaxX() const
Return the maximum value for X (ordinate) stored in the profile.
fevt::EyeRecData & GetRecData()
Reconstructed data for this eye.
const utl::Vector & GetAxis() const
Shower Axis as reconstructed by the FD or FD eye.