]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RICH/AliRICHChamber.h
New class to make V2 clusters starting from digits or hits (fast simulation). Origin...
[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(x, y);} // Returns number of sector containing (x,y) position    
78    void   SetPadSize(Float_t p1, Float_t p2)            {fSegmentation->SetPadSize(p1,p2);}
79    
80    Float_t IntPH(Float_t eloss, Float_t yhit)                        {return fResponse->IntPH(eloss,yhit);}
81    Float_t IntPH(Float_t yhit)                                       {return fResponse->IntPH(yhit);}
82    void   SetSigmaIntegration(Float_t p)                             {fResponse->SetSigmaIntegration(p);}
83    void   SetChargeSlope(Float_t p)                                  {fResponse->SetChargeSlope(p);}
84    void   SetChargeSpread(Float_t p1, Float_t p2)                    {fResponse->SetChargeSpread(p1,p2);}
85    void   SetMaxAdc(Float_t p)                                       {fResponse->SetMaxAdc(p);}
86    void   SetSqrtKx3(Float_t p)                                      {fResponse->SetSqrtKx3(p);}
87    void   SetKx2(Float_t p)                                          {fResponse->SetKx2(p);}
88    void   SetKx4(Float_t p)                                          {fResponse->SetKx4(p);}
89    void   SetSqrtKy3(Float_t p)                                      {fResponse->SetSqrtKy3(p);}
90    void   SetKy2(Float_t p)                                          {fResponse->SetKy2(p);}
91    void   SetKy4(Float_t p)                                          {fResponse->SetKy4(p);}    
92    void   SetPitch(Float_t p)                                        {fResponse->SetPitch(p);}
93    void   SetWireSag(Int_t p)                                        {fResponse->SetWireSag(p);}
94    void   SetVoltage(Int_t p)                                        {fResponse->SetVoltage(p);}    
95    
96    void   SetGapThickness(Float_t thickness)                         {fGeometry->SetGapThickness(thickness);} 
97    void   SetProximityGapThickness(Float_t thickness)                {fGeometry->SetProximityGapThickness(thickness);}
98    void   SetQuartzLength(Float_t length)                            {fGeometry->SetQuartzLength(length);}
99    void   SetQuartzWidth(Float_t width)                              {fGeometry->SetQuartzWidth(width);}
100    void   SetQuartzThickness(Float_t thickness)                      {fGeometry->SetQuartzThickness(thickness);}
101    void   SetOuterFreonLength(Float_t length)                        {fGeometry->SetOuterFreonLength(length);}
102    void   SetOuterFreonWidth(Float_t width)                          {fGeometry->SetOuterFreonWidth(width);}
103    void   SetInnerFreonLength(Float_t length)                        {fGeometry->SetInnerFreonLength(length);}
104    void   SetInnerFreonWidth(Float_t width)                          {fGeometry->SetInnerFreonWidth(width);}
105    void   SetFreonThickness(Float_t thickness)                       {fGeometry->SetFreonThickness(thickness);}
106    
107    AliRICHChamber& operator=(const AliRICHChamber& rhs){return *this;}
108    
109    inline virtual void Print(Option_t *sOption)const;   
110
111 private:
112    Float_t frMin;                                         // Minimum Chamber size
113    Float_t frMax;                                         // Maximum Chamber size 
114    Int_t   fGid;                                          // Id tag 
115    Float_t fzPos;                                         // z-position of this chamber
116
117    TRotMatrix *fpRotMatrix;                               // Rotation matrix of the chamber with respect to MRS 
118    Float_t fX,fY,fZ;                                      // Position of the center of the chamber in MRS (cm)
119
120    AliSegmentation               *fSegmentation;          // Segmentation model for each chamber
121    AliRICHResponse               *fResponse;              // Response model for each chamber
122    AliRICHGeometry               *fGeometry;              // Geometry model for each chamber
123    AliRICHClusterFinder          *fReconstruction;        // Reconstruction model for each chamber
124    ClassDef(AliRICHChamber,1)                             // A single RICH chamber desription
125 };
126     
127 inline void AliRICHChamber::Print(Option_t *sOption)const
128 {
129    TObject::Print(sOption);
130    cout<<"X="<<fX<<endl;   
131    cout<<"Y="<<fY<<endl;
132    cout<<"Z="<<fZ<<endl;
133    TVector3 vector3(fX,fY,fZ);
134    cout<<"Offset="<<vector3.Mag()<<endl;
135    cout<<"Polar angle="<<vector3.Theta()/TMath::Pi()*180<<endl;
136    cout<<"Azimithal angle="<<vector3.Phi()/TMath::Pi()*180<<endl;
137 }// inline void AliRICHChamber::Print(Option_t *sOPtion)
138      
139 #endif //AliRICHChamber_h