1 #include "AliRICHParam.h"
7 // RICH main parameters manipulator
8 //__________________________________________________________________________________________________
9 AliRICHParam::AliRICHParam():
11 fPadSizeX(0),fPadSizeY(0),
12 fCurrentPadX(0),fCurrentPadY(0),fCurrentWire(0),
14 fAngleRot(0),fAngleYZ(0),fAngleXY(0),
17 fProximityGapThickness(0),
43 {//defines the default parameters
44 DeadZone (3); //spacer between PC planes
47 Size (132.6*kcm,26*kcm,136.7*kcm); //full length, not GEANT half notation
48 AngleRot (-60); //rotation of the whole RICH around Z, deg
49 Angles (20,19.5); //XY angle, YZ angle deg
50 Offset (490*kcm+1.267*kcm); //1.267???????cm distance from IP to the center of module
52 ProximityGapThickness(0.4*kcm);
53 QuartzLength (133*kcm);
54 QuartzWidth (127.9*kcm);
55 QuartzThickness (0.5*kcm);
56 OuterFreonLength (133*kcm);
57 OuterFreonWidth (41.3*kcm);
58 InnerFreonLength (133*kcm);
59 InnerFreonWidth (41.3*kcm);
60 FreonThickness (1.5*kcm);
61 RadiatorToPads (80*kmm);
64 ChargeSpreadX(0.18);ChargeSpreadY(0.18);
76 WireSag(1); // 1->On, 0->Off
77 Voltage(2150); // Should only be 2000, 2050, 2100 or 2150
78 }//AliRICHParam::named ctor
79 //__________________________________________________________________________________________________
80 Int_t AliRICHParam::Local2Sector(Float_t &x, Float_t &y)const
81 {//Determines sector for a given hit (x,y) and trasform this point to the local system of that sector.
83 Float_t x1=-0.5*PcSizeX(); Float_t x2=-0.5*SectorSizeX()-DeadZone(); Float_t x3=-0.5*SectorSizeX();
84 Float_t x4= 0.5*SectorSizeX(); Float_t x5= 0.5*SectorSizeX()+DeadZone(); Float_t x6= 0.5*PcSizeX();
86 if (x>=x1&&x<=x2) {sector=1;x+=0.5*PcSizeX();}
87 else if(x>=x3&&x<=x4) {sector=2;x+=0.5*SectorSizeX();}
88 else if(x>=x5&&x<=x6) {sector=3;x-=0.5*SectorSizeX()+DeadZone();}
89 else if(x< x1||x> x6) {Error("Sector","given x position is out of PC area");return kBad;}
90 else {return kBad;} //in dead zone
92 if (y>=-0.5*PcSizeY() &&y<=-0.5*DeadZone()) {y+=0.5*PcSizeY(); return -sector;}
93 else if(y> -0.5*DeadZone() &&y< 0.5*DeadZone()) {return kBad;} //in dead zone
94 else if(y>= 0.5*DeadZone() &&y<= 0.5*PcSizeY()) {y-=0.5*DeadZone(); return sector;}
95 else {Error("Sector","given y position is out of PC area");return kBad;}
96 }//Int_t AliRICHParam::Local2Sector(Float_t x, Float_t y)
97 //__________________________________________________________________________________________________
98 Int_t AliRICHParam::Pad2Sector(Int_t &padx, Int_t &pady)const
99 {//Determines sector for a given pad (padx,pady) and trasform this point to the local system of that sector.
101 if (padx>=1 &&padx<=NpadsXsec()) {sector=1;}
102 else if(padx> NpadsXsec() &&padx<=NpadsXsec()*2) {sector=2;padx-=NpadsXsec();}
103 else if(padx> NpadsXsec()*2&&padx<=NpadsX()) {sector=3;padx-=NpadsXsec()*2;}
104 else {Error("Sector","given padx position is out of PC area");return kBad;}
106 if (pady>=1 &&pady<= NpadsYsec()) {return -sector;}
107 else if(pady>NpadsYsec()&&pady<= NpadsY()) {pady-=NpadsYsec();return sector;}
108 else {Error("Sector","given y position is out of PC area");return kBad;}
110 //__________________________________________________________________________________________________
111 Int_t AliRICHParam::Local2Pad(Float_t x, Float_t y, Int_t &padx, Int_t &pady)const
112 {//returns pad numbers (iPadX,iPadY) for given point in local coordinates (x,y)
113 //count starts in lower left corner from 1,1 to 144,180
116 Int_t sector=Local2Sector(x,y);
117 if(sector==kBad) return sector;
119 padx=Int_t(x/PadSizeX())+1;
120 if(padx>NpadsXsec()) padx= NpadsXsec();
121 if(sector==2||sector==-2) padx+=NpadsXsec();
122 else if(sector==3||sector==-3) padx+=NpadsXsec()*2;
124 pady=Int_t(y/PadSizeY())+1;
125 if(pady>NpadsYsec()) padx= NpadsYsec();
126 if(sector>0) pady+=NpadsYsec();
130 //__________________________________________________________________________________________________
131 void AliRICHParam::Pad2Local(Int_t padx,Int_t pady,Float_t &x,Float_t &y)
133 Int_t sector=Pad2Sector(padx,pady);
135 y=0.5*DeadZone()+pady*PadSizeY()-0.5*PadSizeY();
138 y=-0.5*PcSizeY()+pady*PadSizeY()-0.5*PadSizeY();
141 x=-0.5*PcSizeX()+padx*PadSizeX()-0.5*PadSizeX();
143 x=-0.5*SectorSizeX()+padx*PadSizeX()-0.5*PadSizeX();
145 x= 0.5*SectorSizeX()+DeadZone()+padx*PadSizeX()-0.5*PadSizeX();
148 //__________________________________________________________________________________________________
149 Float_t AliRICHParam::Gain(Float_t y)
150 {//Calculates the gain
152 Float_t gainK=9e-6*TMath::Power(y,4)+2e-7*TMath::Power(y,3)-0.0316*TMath::Power(y,2)-3e-4*y+25.367;
153 Float_t gain = (ChargeSlope()+ChargeSlope()*gainK/100)*0.9;
154 return -gain*TMath::Log(gRandom->Rndm());
156 return -ChargeSlope()*TMath::Log(gRandom->Rndm());
157 }//Float_t AliRICHParam::IntPH(Float_t yhit)
158 //__________________________________________________________________________________________________
159 Float_t AliRICHParam::TotalCharge(Int_t iPID,Float_t eloss,Float_t y)
160 {//Get number of electrons and return charge
162 if(iPID>50000)//it's photon no more then 1 electron after photoelectron conversion
165 Int_t iNelectrons=Int_t(eloss/fEIonisation);if(iNelectrons==0) iNelectrons=1;
167 for(Int_t i=1;i<=iNelectrons;i++)
171 }//Float_t AliRICHParam::TotalCharge(Int_t iPID,Float_t eloss, Float_t y)
172 //__________________________________________________________________________________________________
173 void AliRICHParam::FirstPad(Float_t x,Float_t y)
176 Local2Pad(x,y,padx,pady);
177 }//void AliRICHParam::FirstPad(Float_t x,Float_t y)