// $Id: EusoMapping.hh,v 1.13 2004/10/08 22:13:34 thea Exp $ // Author: M.Pallavicini 8 2003 /***************************************************************************** * ESAF: Euso Simulation and Analysis Framework * * * * Id: EusoMapping * * Package: Optics * * Coordinator: Alessandro.Thea * * * *****************************************************************************/ #ifndef __EUSOMAPPING_HH_ #define __EUSOMAPPING_HH_ #include "euso.hh" #include "EsafConfigurable.hh" #include #include //////////////////////////////////////////////////////////////////////////////// // // // EusoMapping // // // // Class containing the angle-pixel map. // // // //////////////////////////////////////////////////////////////////////////////// typedef int ChannelUniqueId; class EusoMapping:public EsafConfigurable, public EsafMsgSource { public: virtual ~EusoMapping(); // dtor static EusoMapping *Get(); // singleton Double_t GetThetaFOV( ChannelUniqueId id ); // returns theta in field-of-view for a given unique channel id Double_t GetSigmaThetaFOV( ChannelUniqueId id ); // returns theta spreadin field-of-view for a given unique channel id Double_t GetPhiFOV( ChannelUniqueId id ); // returns theta in field-of-view for a given unique channel id Double_t GetSigmaPhiFOV( ChannelUniqueId id ); // returns theta in field-of-view for a given unique channel id inline Int_t GetPixelsNumber() { return fAnglePixelMap.size();} // returns pixelmap size private: EusoMapping(); // private ctor static EusoMapping *fMe; // singleton struct Pixel { Float_t fThetaFOV; // theta Float_t fSigmaThetaFOV; // sigma theta Float_t fPhiFOV; // phi Float_t fSigmaPhiFOV; // sigma phi }; vector fAnglePixelMap; // array of pixels // geometry maps built on the fly or read from file // given a channel (ChannelUniqueId as integer) store theta and phi // seen by pixel (theta1 and phi1 in Euso slang) //associate direction to pixel using map file void LoadAscii(); void SaveBinary(); void LoadBinary(); Bool_t CheckCacheFile(); Bool_t fUseCache; // use auxilar to save a binary copy of the maps to speed up loading string fMapFile; // name of map ascii(gzip) file string fMapCacheFile; // name of bin cache file friend class ERunParsPixelMapFiller; EsafConfigClass(Optics,EusoMapping) ClassDef(EusoMapping,0) }; #endif /* __EUSOMAPPING_HH_ */