// and AliITSgeomSSD for a more detailed example.
////////////////////////////////////////////////////////////////////////
#include <Riostream.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
+//#include <stdlib.h>
+//#include <stdio.h>
+//#include <string.h>
+//#include <ctype.h>
#include <TSystem.h>
#include <TRandom.h>
return *this;
}
//______________________________________________________________________
+inline Int_t AliITSgeom::GetNdetectors(Int_t lay) const {
+ // Return the number of detectors/ladder for the given layer
+ // Inputs:
+ // Int_t lay the layer number
+ // Outputs:
+ // none.
+ // Return:
+ // Int_t the number of detectors/ladders for the give layer
+ Int_t ndet;
+
+ ndet = fNdet[lay-1];
+ return ndet;
+}
+//______________________________________________________________________
+inline Int_t AliITSgeom::GetNladders(Int_t lay) const {
+ // Return the number of ladders for the given layer
+ // Inputs:
+ // Int_t lay the layer number
+ // Outputs:
+ // none.
+ // Return:
+ // Int_t the number of ladders for the give layer
+ Int_t nlad;
+
+ nlad = fNlad[lay-1];
+ return nlad;
+}
+//______________________________________________________________________
Int_t AliITSgeom::GetModuleIndex(Int_t lay,Int_t lad,Int_t det){
// This routine computes the module index number from the layer,
// ladder, and detector numbers. The number of ladders and detectors
return 0;
}
//______________________________________________________________________
+inline void AliITSgeom::GetCenterThetaPhi(Int_t lay,Int_t lad,Int_t det,
+ TVector &x){
+ // 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).
+ // Inputs:
+ // Int_t lay ITS Layer number
+ // Int_t lad ITS Ladder number
+ // Int_t det ITS Detector number
+ // Outputs:
+ // TVector &x The translation vector and the 6 rotaion angles
+ // Return:
+ // none.
+ 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];
+}
+//______________________________________________________________________
void AliITSgeom::PrintComparison(FILE *fp,AliITSgeom *other){
// This function was primarily created for diagnostic reasons. It
// print to a file pointed to by the file pointer fp the difference
#include "AliITSgeomMatrix.h"
-
typedef enum {kSPD=0, kSDD=1, kSSD=2, kSSDp=3,kSDDp=4} AliITSDetector;
//_______________________________________________________________________
AliITSgeom(const char *filename); // Constructor
AliITSgeom(Int_t itype,Int_t nlayers,Int_t *nlads,Int_t *ndets,
Int_t nmods); // Constructor
+ AliITSgeom(AliITSgeom &source); // Copy constructor
+ AliITSgeom& operator=(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;}
//
return (AliITSgeomMatrix*)(fGm->At(index));}
// This function returns the number of detectors/ladder for a give
// layer. In particular it returns fNdet[layer-1].
- Int_t GetNdetectors(Int_t lay) const {return fNdet[lay-1];}
+ Int_t GetNdetectors(Int_t lay) const;
// 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;
// This function returns the number of layers defined in the ITS
// geometry. In particular it returns fNlayers.
Int_t GetNlayers() const {return fNlayers;}
// Returns the detector type
Int_t GetModuleType(Int_t index){
return GetGeomMatrix(index)->GetDetectorIndex();}
+ // Returns the detector type as a string
+ Char_t * 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);
// 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];}
+ void GetCenterThetaPhi(Int_t lay,Int_t lad,Int_t det,TVector &x);
//
// This function returns the rotation matrix in Double
// precision for a given module.