1 #include "AliRICHParam.h"
2 #include "AliRICHConst.h"
8 // RICH main parameters manipulator
9 //__________________________________________________________________________________________________
10 AliRICHParam::AliRICHParam():
11 fNpadsX(0),fNpadsY(0),fNpadsXsector(0),fNpadsYsector(0),
13 fPadSizeX(0),fPadSizeY(0),
14 fSectorSizeX(0),fSectorSizeY(0),
16 fCurrentPadX(0),fCurrentPadY(0),fCurrentWire(0),
18 fAngleRot(0),fAngleYZ(0),fAngleXY(0),
21 fProximityGapThickness(0),
49 {//defines the default parameters
50 Segmentation (144,160); //nx,ny for the whole chamber
51 DeadZone (3*kcm); //spacer between PC planes
52 PadSize (8.4*kmm,8.0*kmm);
53 fWirePitch=PadSizeX()/2;
55 Size (132.6*kcm,26*kcm,136.7*kcm); //full length, not GEANT half notation
56 AngleRot (-60); //rotation of the whole RICH around Z, deg
57 Angles (20,19.5); //XY angle, YZ angle deg
58 Offset (490*kcm+1.267*kcm); //1.267???????cm distance from IP to the center of module
60 ProximityGapThickness(0.4*kcm);
61 QuartzLength (133*kcm);
62 QuartzWidth (127.9*kcm);
63 QuartzThickness (0.5*kcm);
64 OuterFreonLength (133*kcm);
65 OuterFreonWidth (41.3*kcm);
66 InnerFreonLength (133*kcm);
67 InnerFreonWidth (41.3*kcm);
68 FreonThickness (1.5*kcm);
69 RadiatorToPads (80*kmm);
72 ChargeSpreadX(0.18);ChargeSpreadY(0.18);
84 WireSag(1); // 1->On, 0->Off
85 Voltage(2150); // Should only be 2000, 2050, 2100 or 2150
88 }//AliRICHParam::named ctor
89 //__________________________________________________________________________________________________
90 void AliRICHParam::Recalc()
92 fNpadsXsector=NpadsX()/3; fNpadsYsector=NpadsY()/2;
93 fPcSizeX=NpadsX()*fPadSizeX+2*fDeadZone;
94 fPcSizeY=NpadsY()*fPadSizeY+fDeadZone;
95 fSectorSizeX=(fPcSizeX-2*fDeadZone)/3;
96 fSectorSizeY=(fPcSizeY-fDeadZone)/2;
97 }//void AliRICHParam::Recalc()
98 //__________________________________________________________________________________________________
99 Int_t AliRICHParam::Sector(Float_t &x, Float_t &y)const
100 {//Determines sector for a given hit (x,y) and trasform this point to the local system of that sector.
103 if(x<=-fSectorSizeX/2-fDeadZone&&x>=-fPcSizeX/2) {sector=1;x+=fPcSizeX/2;}
104 else if(x>=-fSectorSizeX/2 && x<=fSectorSizeX/2) {sector=2;x+=fSectorSizeX/2;}
105 else if(x>= fSectorSizeX/2+fDeadZone&&x<=fPcSizeX/2) {sector=3;x-=fSectorSizeX/2+fDeadZone;}
106 else if(x<-fPcSizeX/2||x>fPcSizeX/2) {Error("Sector","given x position is out of active PC area");return kBad;}
107 else {return kBad;} //in dead zone
109 if(y>=-fPcSizeY/2&&y<= -fDeadZone/2) {y+=fPcSizeY/2; return -sector;}
110 else if(y>-fDeadZone/2&&y<fDeadZone/2) {return kBad;} //in dead zone
111 else if(y>=fDeadZone/2&&y<=fPcSizeY/2) {y-=fDeadZone/2; return sector;}
112 else {Error("Sector","given y position is out of active PC area");return kBad;}
113 }//Int_t AliRICHParam::Sector(Float_t x, Float_t y)
114 //__________________________________________________________________________________________________
115 Int_t AliRICHParam::L2P(Float_t x, Float_t y, Int_t &padx, Int_t &pady)const
116 {//returns pad numbers (iPadX,iPadY) for given point in local coordinates (x,y)
117 //count starts in lower left corner from 1,1 to 144,180
120 Int_t sector=Sector(x,y);
121 if(sector==kBad) return sector;
123 padx=Int_t(x/fPadSizeX)+1;
124 if(padx>fNpadsXsector) padx=fNpadsXsector;
125 if(sector==2||sector==-2) padx+=fNpadsXsector;
126 else if(sector==3||sector==-3) padx+=fNpadsXsector*2;
128 pady=Int_t(y/fPadSizeY)+1;
129 if(pady>fNpadsYsector) padx=fNpadsYsector;
130 if(sector>0) pady+=fNpadsYsector;
133 }//void AliRICHParam::L2P(Float_t x, Float_t y, Int_t &padx, Int_t &pady)
134 //__________________________________________________________________________________________________
135 Float_t AliRICHParam::Gain(Float_t y)
136 {//Calculates the gain
138 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;
139 Float_t gain = (ChargeSlope()+ChargeSlope()*gainK/100)*0.9;
140 return -gain*TMath::Log(gRandom->Rndm());
142 return -ChargeSlope()*TMath::Log(gRandom->Rndm());
143 }//Float_t AliRICHParam::IntPH(Float_t yhit)
144 //__________________________________________________________________________________________________
145 Float_t AliRICHParam::TotalCharge(Int_t iPID,Float_t eloss,Float_t y)
146 {//Get number of electrons and return charge
148 if(iPID>50000)//it's photon no more then 1 electron after photoelectron conversion
151 Int_t iNelectrons=Int_t(eloss/fEIonisation);if(iNelectrons==0) iNelectrons=1;
153 for(Int_t i=1;i<=iNelectrons;i++)
157 }//Float_t AliRICHParam::TotalCharge(Int_t iPID,Float_t eloss, Float_t y)
158 //__________________________________________________________________________________________________
159 void AliRICHParam::FirstPad(Float_t x,Float_t y)
163 }//void AliRICHParam::FirstPad(Float_t x,Float_t y)