//---------------------------------------------------------- // // Description: // Class mapping positions (x,y,z) to set of dch data // (like chamber, plane, wire, distance form wire) // and vice versa // //---------------------------------------------------------- #ifndef PNDDCHMAPPER_HH #define PNDDCHMAPPER_HH #include "TObject.h" #include class PndDchPoint; class PndDchStructure; class PndDchMapper : public TObject { public: static PndDchMapper* Instance(); ~PndDchMapper(); static Int_t CalculateDetectorID(Int_t ch, Int_t pl) { return fOffset*ch+pl;} static Int_t CalculatePlane(Int_t detID) { return detID%fOffset;} static Int_t CalculateChamber(Int_t detID) { return detID/fOffset;} Int_t WhichWire(Int_t detID, Double_t xLocal ) const; Int_t GetFiredWires(std::vector &wireID, std::vector &distance, const PndDchPoint* point) const; Bool_t TransformToLocal(Double_t* localPosition, Double_t* localMomentum, const PndDchPoint* point) const; void Print(const Option_t*) const; protected: PndDchMapper(); static const Int_t fOffset = 1000; private: // interface to geo data PndDchStructure *fDchStructure; static PndDchMapper* fMapperInstance; ClassDef(PndDchMapper,1); }; #endif