// $Id: DetectorGeometry.cc,v 1.4 2005/04/14 17:04:34 thea 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"
ClassImp(DetectorGeometry)
//_____________________________________________________________________________
DetectorGeometry::DetectorGeometry() : EsafRefSys() {
//
// Constructor
//
}
//_____________________________________________________________________________
DetectorGeometry::~DetectorGeometry() {
//
// Destructor
//
}
//_____________________________________________________________________________
Double_t DetectorGeometry::SolidAngle(const EarthVector& pos) const {
//
// Returns the solid angle made by Euso pupil as seen from pos
//
// //FIXME : if detector tilting, formula change
//
EarthVector inter = GetPos() - pos;
Double_t th = inter.Theta();
//return 2*pi*(pow(sin(0.5*atan( sqrt(r*r*cos(th)/inter.Mag2()) )),2));
return pi*GetRadius()*GetRadius()*cos(th)/inter.Mag2();
}