Transition to NewIO
[u/mrichter/AliRoot.git] / RICH / AliRICHChamber.h
1 #ifndef AliRICHChamber_h
2 #define AliRICHChamber_h
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 /* $Id$ */
8
9 #include <Riostream.h>
10
11 #include <TRotMatrix.h>
12 #include <TVector3.h>
13 #include <TMath.h>
14
15 #include "AliRICHTresholdMap.h"
16 #include "AliSegmentation.h"
17 #include "AliRICHGeometry.h"
18 #include "AliRICHResponse.h"
19
20 class AliRICHClusterFinder;
21
22 typedef enum {kMip, kCerenkov} ResponseType;
23
24 class AliRICHChamber : public TObject
25 {
26 public:
27     
28    Int_t                fIndexMap[50];   //indeces of tresholds
29    AliRICHTresholdMap*  fTresh;          //map of tresholds
30
31 public:
32 // ctor & dtor      
33    AliRICHChamber();                                  // default ctor
34    AliRICHChamber(const AliRICHChamber & Chamber){}   // copy ctor 
35    ~AliRICHChamber(){}                                // dtor
36 // The following staff is defined in AliRICHChamber.cxx:
37    void LocaltoGlobal(Float_t pos[3],Float_t Localpos[3]);//Transformation from local to global coordinates, chamber-dependant
38    void GlobaltoLocal(Float_t pos[3],Float_t localpos[3]);//Transformation from Global to local coordinates, chamber-dependant 
39    void GenerateTresholds();                              //Generate pad dependent tresholds
40    void DisIntegration(Float_t eloss, Float_t xhit, Float_t yhit, Int_t&x, Float_t newclust[6][500], ResponseType res);// Cluster formation method
41 // Inline methods:   
42    void    Init(Int_t id)           {fSegmentation->Init(id);} // Recalculates all the values after some of them have been changed
43    
44    void    SetGid(Int_t id)         {fGid=id;}           // Set and get GEANT id  
45    Int_t   GetGid()            const{return fGid;}       // Get GEANT id  
46
47    void SetRInner(Float_t rmin)     {frMin=rmin;}        // Set inner radius of sensitive volume   
48    Float_t RInner()            const{return frMin;}      // Return inner radius of sensitive volume 
49    
50    void SetROuter(Float_t rmax)     {frMax=rmax;}        // Set outer radius of sensitive volum  
51    Float_t ROuter()            const{return frMax;}      // Return outer radius of sensitive volum  
52  
53    void    SetZPOS(Float_t p1)      {fzPos=p1;}
54    Float_t ZPosition()         const{return fzPos;}
55     
56    void         SetChamberTransform(Float_t x,Float_t y,Float_t z,TRotMatrix *pRotMatrix) {fX=x; fY=y; fZ=z; fpRotMatrix=pRotMatrix;}
57    TRotMatrix * GetRotMatrix()                                                    const   {return fpRotMatrix;}
58    Float_t      GetX()                                                            const   {return fX;}
59    Float_t      GetY()                                                            const   {return fY;}
60    Float_t      GetZ()                                                            const   {return fZ;}    
61    Float_t      GetOffset()                                                       const   {return TMath::Sqrt(fX*fX+fY*fY+fZ*fZ);}    
62     
63    void              SetGeometryModel(AliRICHGeometry* pRICHGeometry)           {fGeometry=pRICHGeometry;}        
64    AliRICHGeometry*  GetGeometryModel()                                    const{return fGeometry;}
65    
66    void              SetResponseModel(AliRICHResponse* pRICHResponse)            {fResponse=pRICHResponse;}
67    AliRICHResponse*  GetResponseModel()                                     const{return fResponse;}
68    
69    void              SetSegmentationModel(AliSegmentation* pRICHSegmentation)   {fSegmentation=pRICHSegmentation;}
70    AliSegmentation*  GetSegmentationModel(Int_t i=0)                       const{return fSegmentation;}
71    
72    void                  SetReconstructionModel(AliRICHClusterFinder *pRICHReconstruction)    {fReconstruction=pRICHReconstruction;}
73    AliRICHClusterFinder* &GetReconstructionModel()                                            {return fReconstruction;}
74
75    void   SigGenInit(Float_t x, Float_t y, Float_t z)   {fSegmentation->SigGenInit(x, y, z) ;}
76    Int_t  SigGenCond(Float_t x, Float_t y, Float_t z)   {return fSegmentation->SigGenCond(x, y, z);}
77    Int_t  Sector(Float_t x, Float_t y)                  {return fSegmentation->Sector((Int_t)x, (Int_t)y);} // Returns number of sector containing (x,y) position    
78  
79    void   SetPadSize(Float_t p1, Float_t p2)            {fSegmentation->SetPadSize(p1,p2);}
80    
81    Float_t IntPH(Float_t eloss, Float_t yhit)                        {return fResponse->IntPH(eloss,yhit);}
82    Float_t IntPH(Float_t yhit)                                       {return fResponse->IntPH(yhit);}
83    void   SetSigmaIntegration(Float_t p)                             {fResponse->SetSigmaIntegration(p);}
84    void   SetChargeSlope(Float_t p)                                  {fResponse->SetChargeSlope(p);}
85    void   SetChargeSpread(Float_t p1, Float_t p2)                    {fResponse->SetChargeSpread(p1,p2);}
86    void   SetMaxAdc(Float_t p)                                       {fResponse->SetMaxAdc(p);}
87    void   SetSqrtKx3(Float_t p)                                      {fResponse->SetSqrtKx3(p);}
88    void   SetKx2(Float_t p)                                          {fResponse->SetKx2(p);}
89    void   SetKx4(Float_t p)                                          {fResponse->SetKx4(p);}
90    void   SetSqrtKy3(Float_t p)                                      {fResponse->SetSqrtKy3(p);}
91    void   SetKy2(Float_t p)                                          {fResponse->SetKy2(p);}
92    void   SetKy4(Float_t p)                                          {fResponse->SetKy4(p);}    
93    void   SetPitch(Float_t p)                                        {fResponse->SetPitch(p);}
94    void   SetWireSag(Int_t p)                                        {fResponse->SetWireSag(p);}
95    void   SetVoltage(Int_t p)                                        {fResponse->SetVoltage(p);}    
96    
97    void   SetGapThickness(Float_t thickness)                         {fGeometry->SetGapThickness(thickness);} 
98    void   SetProximityGapThickness(Float_t thickness)                {fGeometry->SetProximityGapThickness(thickness);}
99    void   SetQuartzLength(Float_t length)                            {fGeometry->SetQuartzLength(length);}
100    void   SetQuartzWidth(Float_t width)                              {fGeometry->SetQuartzWidth(width);}
101    void   SetQuartzThickness(Float_t thickness)                      {fGeometry->SetQuartzThickness(thickness);}
102    void   SetOuterFreonLength(Float_t length)                        {fGeometry->SetOuterFreonLength(length);}
103    void   SetOuterFreonWidth(Float_t width)                          {fGeometry->SetOuterFreonWidth(width);}
104    void   SetInnerFreonLength(Float_t length)                        {fGeometry->SetInnerFreonLength(length);}
105    void   SetInnerFreonWidth(Float_t width)                          {fGeometry->SetInnerFreonWidth(width);}
106    void   SetFreonThickness(Float_t thickness)                       {fGeometry->SetFreonThickness(thickness);}
107    
108    AliRICHChamber& operator=(const AliRICHChamber& rhs){return *this;}
109    
110    inline virtual void Print(Option_t *sOption)const;   
111
112 private:
113    Float_t frMin;                                         // Minimum Chamber size
114    Float_t frMax;                                         // Maximum Chamber size 
115    Int_t   fGid;                                          // Id tag 
116    Float_t fzPos;                                         // z-position of this chamber
117
118    TRotMatrix *fpRotMatrix;                               // Rotation matrix of the chamber with respect to MRS 
119    Float_t fX,fY,fZ;                                      // Position of the center of the chamber in MRS (cm)
120
121    AliSegmentation               *fSegmentation;          // Segmentation model for each chamber
122    AliRICHResponse               *fResponse;              // Response model for each chamber
123    AliRICHGeometry               *fGeometry;              // Geometry model for each chamber
124    AliRICHClusterFinder          *fReconstruction;        // Reconstruction model for each chamber
125    ClassDef(AliRICHChamber,1)                             // A single RICH chamber desription
126 };
127     
128 inline void AliRICHChamber::Print(Option_t *sOption)const
129 {
130    TObject::Print(sOption);
131    cout<<"X="<<fX<<endl;   
132    cout<<"Y="<<fY<<endl;
133    cout<<"Z="<<fZ<<endl;
134    TVector3 vector3(fX,fY,fZ);
135    cout<<"Offset="<<vector3.Mag()<<endl;
136    cout<<"Polar angle="<<vector3.Theta()/TMath::Pi()*180<<endl;
137    cout<<"Azimithal angle="<<vector3.Phi()/TMath::Pi()*180<<endl;
138 }// inline void AliRICHChamber::Print(Option_t *sOPtion)
139      
140 #endif //AliRICHChamber_h