// $Id: DetectorGeometry.cc,v 1.14 2005/11/03 12:01:33 moreggia Exp $
// Author: Alessandro Thea 2005/03/10
/*****************************************************************************
* ESAF: Euso Simulation and Analysis Framework *
* *
* Id: DetectorGeometry *
* Package: Optics *
* Coordinator: Alessandro.Thea *
* *
*****************************************************************************/
//_____________________________________________________________________________
//
// DetectorGeometry
//
// Contains the fundamental information of the detector seen from "outside":
// Position, orientation in the space, external radius and field of view.
//
#include "DetectorGeometry.hh"
#include "EarthVector.hh"
#include <TMath.h>
using namespace TMath;
ClassImp(DetectorGeometry)
//_____________________________________________________________________________
DetectorGeometry::DetectorGeometry() : EsafRefFrame() {
//
// Constructor
//
}
//_____________________________________________________________________________
DetectorGeometry::~DetectorGeometry() {
//
// Destructor
//
}
//_____________________________________________________________________________
Double_t DetectorGeometry::SolidAngle(const EarthVector& pos) const {
//
// Returns the true solid angle made by Euso pupil (with its actual geometry) as seen from pos
// pos is expressed in MES frame
//
EarthVector dPos = GetPos();
Double_t radius = GetRadius();
EarthVector inter = dPos - pos;
Double_t th = fabs(inter.Theta());
return TwoPi() * (1 - inter.Mag() / Sqrt(inter.Mag2() + radius*radius)) * Cos(th);
}
//_____________________________________________________________________________
Double_t DetectorGeometry::MaxSolidAngle(const EarthVector& pos) const {
//
// Returns the solid angle made a sphere (diameter = detector pupil diameter) as seen from pos
//
EarthVector dPos = GetPos();
Double_t radius = GetRadius();
EarthVector inter = dPos - pos;
return TwoPi() * (1 - inter.Mag() / Sqrt(inter.Mag2() + radius*radius));
}
//_____________________________________________________________________________
Bool_t DetectorGeometry::IsInFoV(const TVector3& local_dir) const {
//
// tell if incoming direction is in FoV or not
//
return (local_dir.Theta() <= GetFoV());
}