X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSgeom.h;h=7dc9f9738e6a41eb3cae97b982b87cc7fad8bad3;hb=7b54ea5c7f4a049ae41d5026aba55d64b07bf6cf;hp=9ef4a4c411f738d31a57fc9784e5a2ad2198aeac;hpb=85f1e34a8a08100dbb9328fe02ca1a852b5335d4;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSgeom.h b/ITS/AliITSgeom.h index 9ef4a4c411f..7dc9f9738e6 100644 --- a/ITS/AliITSgeom.h +++ b/ITS/AliITSgeom.h @@ -17,16 +17,14 @@ // the information needed to do the coordinate transformation are kept in // a specialized structure for ease of implementation. ///////////////////////////////////////////////////////////////////////// +#include #include #include #include #include "AliITSgeomMatrix.h" -class ofstream; -class ifstream; - -typedef enum {kSPD=0, kSDD=1, kSSD=2, kSSDp=3,kSDDp=4} AliITSDetector; +typedef enum {kND=-1,kSPD=0, kSDD=1, kSSD=2, kSSDp=3,kSDDp=4} AliITSDetector; //_______________________________________________________________________ @@ -37,15 +35,15 @@ class AliITSgeom : public TObject { AliITSgeom(const char *filename); // Constructor AliITSgeom(Int_t itype,Int_t nlayers,Int_t *nlads,Int_t *ndets, Int_t nmods); // Constructor + AliITSgeom(const AliITSgeom &source); // Copy constructor + AliITSgeom& operator=(const AliITSgeom &source);// = operator + virtual ~AliITSgeom(); // Default destructor // this function allocates a AliITSgeomMatrix for a particular module. void CreatMatrix(Int_t mod,Int_t lay,Int_t lad,Int_t det, AliITSDetector idet,const Double_t tran[3], const Double_t rot[10]); void ReadNewFile(const char *filename); // Constructor for new format. void WriteNewFile(const char *filename); // Output for new format. - AliITSgeom(AliITSgeom &source); // Copy constructor - AliITSgeom& operator=(AliITSgeom &source);// = operator - virtual ~AliITSgeom(); // Default destructor // Getters Int_t GetTransformationType() const {return fTrans;} // @@ -78,7 +76,7 @@ class AliITSgeom : public TObject { Int_t GetNdetectors(Int_t lay) const {return fNdet[lay-1];} // This function returns the number of ladders for a give layer. In // particular it returns fNlad[layer-1]. - Int_t GetNladders(Int_t lay) const {return fNlad[lay-1];} + Int_t GetNladders(Int_t lay) const {return fNlad[lay-1];}; // This function returns the number of layers defined in the ITS // geometry. In particular it returns fNlayers. Int_t GetNlayers() const {return fNlayers;} @@ -88,6 +86,13 @@ class AliITSgeom : public TObject { Int_t GetModuleIndex(const Int_t *id){ return GetModuleIndex(id[0],id[1],id[2]);} void GetModuleId(Int_t index,Int_t &lay,Int_t &lad,Int_t &det); + // Returns the detector type + Int_t GetModuleType(Int_t index){ + return GetGeomMatrix(index)->GetDetectorIndex();} + // Returns the detector type as a string + const char * GetModuleTypeName(Int_t index){switch(GetModuleType(index)) { + case kSPD: return "kSPD";case kSDD: return "kSDD";case kSSD: return "kSSD"; + case kSSDp: return"kSSDp";case kSDDp: return "kSDDp"; default: return "";}} // Int_t GetStartDet(Int_t dtype ); Int_t GetLastDet(Int_t dtype); @@ -183,13 +188,11 @@ class AliITSgeom : public TObject { // This function returns the Cartesian translation [cm] and the // 6 GEANT rotation angles [degrees]for a given layer ladder and // detector number, in the TVector x (at least 9 elements large). - void GetCenterThetaPhi(Int_t lay,Int_t lad,Int_t det, - TVector &x){Double_t t[3],ang[6]; - Int_t index=GetModuleIndex(lay,lad,det); - GetTrans(index,t);GetGeantAngles(index,ang); - x(0) = t[0];x(1) = t[1];x(2) = t[2]; - x(3) = ang[0];x(4) = ang[1];x(5) = ang[2]; - x(6) = ang[3];x(7) = ang[4];x(8) = ang[5];} + // This function is required to be inlined for speed. + void GetCenterThetaPhi(Int_t lay,Int_t lad,Int_t det,TVector &x){ + Double_t t[3],a[6];Int_t i=GetModuleIndex(lay,lad,det);GetTrans(i,t); + GetGeantAngles(i,a);x(0)=t[0];x(1)=t[1];x(2)=t[2];x(3)=a[0];x(4)=a[1]; + x(5)=a[2];x(6)=a[3];x(7)=a[4];x(8)=a[5];} // // This function returns the rotation matrix in Double // precision for a given module. @@ -224,7 +227,7 @@ class AliITSgeom : public TObject { // detector type based on AliITSDetector value. This will return a pointer // to one of the classes AliITSgeomSPD, AliITSgeomSDD, or AliITSgeomSSD, // for example. - virtual TObject *GetShape(const AliITSDetector idet) + virtual TObject *GetShape(AliITSDetector idet) {return fShape->At((Int_t)idet);}; // This function returns a pointer to the class describing the // detector for a particular module index. This will return a pointer @@ -248,14 +251,14 @@ class AliITSgeom : public TObject { // Sets the rotation angles and matrix for a give module index // via the 3 floating precision variables rx, ry, and rz [radians]. void SetByAngles(Int_t index, - const Float_t rx,const Float_t ry,const Float_t rz) { + Float_t rx, Float_t ry, Float_t rz) { Double_t a[3];a[0] = rx;a[1] = ry;a[2] = rz; GetGeomMatrix(index)->SetAngles(a);} // Sets the rotation angles and matrix for a give layer, ladder, // and detector numbers via the 3 floating precision variables rx, // ry, and rz [radians]. void SetByAngles(Int_t lay,Int_t lad,Int_t det, - const Float_t rx,const Float_t ry,const Float_t rz) { + Float_t rx, Float_t ry, Float_t rz) { SetByAngles(GetModuleIndex(lay,lad,det),rx,ry,rz);} // // Sets the rotation angles and matrix for a give module index