// ESAF : Euso Simulation and Analysis Framework // $Id: ScanPhotonsOnPupil.hh,v 1.8 2005/09/27 20:19:08 thea Exp $ // A.Thea, J.Watts created Mar, 18 2004 #ifndef __SCANPHOTONSONPUPIL_HH_ #define __SCANPHOTONSONPUPIL_HH_ #include "euso.hh" #include "PhotonsOnPupil.hh" #include "ParentPhoton.hh" #include "EsafConfigurable.hh" class OpticalSystem; class ScanPhotonsOnPupil : public PhotonsOnPupil, EsafConfigurable { public: // ctor ScanPhotonsOnPupil(); // dtor virtual ~ScanPhotonsOnPupil(); virtual Photon* GetPhoton(); virtual void Clear() {}; virtual inline Int_t GetEntries() const { return GetNumPos(); } // size of the scan grid inline Int_t GetNumPos() const { return fNumPos; } inline Int_t GetNumRows() const { return fNumRows; } inline const vector& GetRows() const { return fNumCols; } Int_t GetNumCols(Int_t r); // true when all angles have been done Bool_t IsAngleEnd() const; // move to the next angle void NextAngle(); // true when all wavelengths have been done Bool_t IsWlEnd() const; // move to the next wavelenth void NextWl(); // getters // position inline Double_t GetXYStep() { return fXYStep; } inline Int_t GetLastPosId() { return fCurPosId-1; } inline Int_t GetCurPosId() { return fCurPosId; } inline Double_t GetEntranceDiscRadius() { return fEntranceDiscRadius; }; // angles inline Int_t GetNumAngles() const { return fAngles.size(); } inline const vector& GetAngles() const { return fAngles; } inline Double_t GetCurAngle() const { if(!IsAngleEnd()) return fAngles[fCurAngle]; else return 0; } inline Int_t GetCurAngleId() const { return fCurAngle; } // wavelength inline Int_t GetNumWavelengths() const { return fWavelengths.size(); } inline const vector& GetWavelengths() const { return fWavelengths; } inline Double_t GetCurWl() const { if(!IsWlEnd()) return fWavelengths[fCurWl]; else return 0; } inline Int_t GetCurWlId() const { return fCurWl; } EsafConfigClass(Tools,PhotonsDatabaseBuilder) private: void ResetPhoton( Double_t x, Double_t y, // reset the photon at (X,Y,0) Double_t th,Double_t wl); // coordinates with dir=(1,th,0) inline void ResetPos() { fCurRow=0; fCurCol=0; fCurPosId=0;} inline void ResetAngle() { fCurAngle=0; } // returns current x and y Double_t GetX() { return fCurCol*GetXYStep();} Double_t GetY() { return ((GetNumRows()-1)/2-fCurRow)*GetXYStep();} // size of the grid Int_t fNumPos; Int_t fNumRows; vector fNumCols; Double_t fXYStep; Double_t fEntranceDiscRadius; ParentPhoton fParent; OpticalSystem *fOptics; // Current row and column Int_t fCurRow; Int_t fCurCol; Int_t fCurPosId; // Current angle Int_t fCurAngle; // Current wavelength Int_t fCurWl; // list of angles vector fAngles; // list of wavelengths vector fWavelengths; ClassDef(ScanPhotonsOnPupil,0) }; #endif /* __SCANPHOTONSONPUPIL_HH_ */