// class Elementary Cell // $Id: ElementaryCell.hh,v 1.9 2005/02/24 11:00:25 pesce Exp $ // M. Pallavicini - created 10-10-03 // #ifndef _ELEMENTARYCELL__H #define _ELEMENTARYCELL__H #include "EVector.hh" #include "Photomultiplier.hh" #include "FrontEndChip.hh" class ElementaryCell { public: // ctor ElementaryCell(); // dtor virtual ~ElementaryCell(); // reset static counter static void ResetClass() {gElemCellCounter=1;} // get id inline int Id() { return fId;} // get normal inline const EVector& GetNormal() const { return fNormal;} // get up-left corner inline const EVector& GetUpLeft() const { return fUpLeft;} // get up-right corner inline const EVector& GetUpRight() const { return fUpRight;} // get down-left corner inline const EVector& GetDownLeft() const { return fDownLeft;} // get down-right corner inline const EVector& GetDownRight() const { return fDownRight;} // GetXAxis inline const EVector& GetXAxis() const { return fXAxis;} // GetYAxis inline const EVector& GetYAxis() const { return fYAxis;} // get center EVector GetCenter() const; // pointer to front end chip (the chip must be unique!!) inline FrontEndChip* FrontEnd() const { return pPmts[0]->FrontEnd();} // associate for PMTs and compute internal infos void AssociatePmts(Photomultiplier *p1, Photomultiplier *p2=NULL, Photomultiplier *p3=NULL, Photomultiplier *p4=NULL); // get row and column offset in MacroCell trigger from the chip inline int GetRowOffset() const {return FrontEnd()->GetCellRowOffset();} inline int GetColOffset() const {return FrontEnd()->GetCellColOffset();} // infos about PMTs inline int GetNumPmts() const { return fNumPmts; } inline Photomultiplier *GetPmt(Int_t i); private: // elementary cell info Int_t fId; static Int_t gElemCellCounter; Int_t fNumPmts; Photomultiplier *pPmts[4]; // geometry of the Elementary Cell EVector fNormal; EVector fUpLeft; EVector fUpRight; EVector fDownLeft; EVector fDownRight; EVector fXAxis; EVector fYAxis; // row and column position of this elementaty cell in MacroCell trigger // logic ClassDef(ElementaryCell,0) }; // inline Photomultiplier *ElementaryCell::GetPmt(Int_t i) { if ( i>0 && i<=GetNumPmts() ) { return pPmts[i-1]; } else { return (Photomultiplier*)NULL; } } #endif