7 #include <fdet/Telescope.h>
9 #include <utl/RandomEngine.h>
10 #include <utl/Photon.h>
12 #include <fwk/RunController.h>
13 #include <evt/Event.h>
14 #include <evt/Header.h>
16 #include <TPolyLine3D.h>
18 #include <TObjArray.h>
26 using namespace TelescopeSimulatorKG;
36 bool plotPhotonTracks,
37 double drawPhotonsProbabilty)
41 fDoShadowSupport(doShadowSupport),
42 fHasMercedes(hasMercedes),
43 fPlotPhotonTracks(plotPhotonTracks),
44 fDrawPhotonProbability(drawPhotonsProbabilty) {
61 ostringstream fnameBase, fnameRoot, fnameCanvas;
62 const string id = fwk::RunController::GetInstance().GetCurrentEvent().GetHeader().GetId();
63 fnameBase <<
"raytrace_" <<
id
66 fnameRoot << fnameBase.str() <<
".root";
67 fnameCanvas << fnameBase.str() <<
".eps";
74 TPolyLine3D* photon =
dynamic_cast<TPolyLine3D*
>((*fObjectsPhotons)[iObj]);
78 c.Print(fnameCanvas.str().c_str());
79 TFile f(fnameRoot.str().c_str(),
"RECREATE");
103 int& nreflections,
int& col,
int& row) {
107 bool plotTrack =
false;
108 int trackColor = kBlue;
130 if (lensStatus !=
eOK)
145 if (mirStatus !=
eOK)
179 TPolyLine3D* track =
new TPolyLine3D(2);
180 track->SetPoint(0, p1.
GetX(telCS), p1.
GetY(telCS), p1.
GetZ(telCS));
181 track->SetPoint(1, p2.
GetX(telCS), p2.
GetY(telCS), p2.
GetZ(telCS));
182 track->SetLineColor(color);
RTResult Trace(const utl::Photon &photonIn, utl::Photon &photonOut)
brief Simulate the filter
RTResult Trace(const utl::Photon &photonIn, utl::Photon &photonOut, int &nreflections, int &col, int &row, double &cosTheta, bool doMercedes=true)
Simulates the mirror in the raytracing of the TelescopeSimulator module.
double GetR(const CoordinateSystemPtr &coordinateSystem) const
radius r in spherical coordinates coordinates (distance to origin)
unsigned int GetEyeId() const
bool HasCorrectorRing() const
flag for corrector ring presence
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
utl::CoordinateSystemPtr GetTelescopeCoordinateSystem() const
Simulates the corrector ring in the raytracing of the TelescopeSimulator module.
double GetX(const CoordinateSystemPtr &coordinateSystem) const
Wraps the random number engine used to generate distributions.
const fdet::Telescope * fTel
RTResult TraceShadow(const utl::Photon &photonIn, const bool doSupport=true)
RTResult Trace(const utl::Photon &photonIn, utl::Photon &photonOut)
Simulates the UV filter in the raytracing of the TelescopeSimulator module.
double fDrawPhotonProbability
TPolyLine3D * DrawTrack(const utl::Point &p1, const utl::Point &p2, int color) const
double GetY(const CoordinateSystemPtr &coordinateSystem) const
Detector description interface for Telescope-related data.
TObjArray * fObjectsPhotons
RTResult Trace(const utl::Photon &photonIn, utl::Photon &photonOut, int &nreflections, int &col, int &row)
Raytracing through the telescope components.
double GetZ(const CoordinateSystemPtr &coordinateSystem) const
RTResult Trace(const utl::Photon &photonIn, utl::Photon &photonOut)
unsigned int GetId() const
const utl::Point & GetPosition() const