]>
Commit | Line | Data |
---|---|---|
d48cca74 | 1 | #ifndef AliRICHParam_h |
2 | #define AliRICHParam_h | |
3 | ||
1c349ae5 | 4 | #include <TError.h> |
c712cb2f | 5 | #include <TMath.h> |
1c349ae5 | 6 | #include <TObjArray.h> |
7 | #include <TObject.h> | |
998b831f | 8 | #include <TMath.h> |
1c349ae5 | 9 | #include <TRandom.h> |
10 | #include <TVector.h> | |
3582c1f9 | 11 | #include <TVector2.h> |
e42a7b46 | 12 | #include <TVector3.h> |
998b831f | 13 | #include <TRandom.h> |
14 | #include <TError.h> | |
15 | #include <TObjArray.h> | |
16 | #include <AliLog.h> | |
17 | #include <TClass.h> | |
18 | ||
ed3ceb24 | 19 | |
e42a7b46 | 20 | static const int kNchambers=7; //number of RICH chambers |
21 | static const int kNpadsX = 160; //number of pads along X in single chamber | |
22 | static const int kNpadsY = 144; //number of pads along Y in single chamber | |
e42a7b46 | 23 | static const int kNsectors=6; //number of sectors per chamber |
ed3ceb24 | 24 | |
ed3ceb24 | 25 | static const int kCerenkov=50000050; //??? go to something more general like TPDGCode |
26 | static const int kFeedback=50000051; //??? go to something more general like TPDGCode | |
27 | ||
e42a7b46 | 28 | class AliRICHChamber; |
ed3ceb24 | 29 | |
ae754cdf | 30 | // Class providing all the needed parametrised information |
31 | // to construct the geometry, to define segmentation and to provide response model | |
32 | // In future will also provide all the staff needed for alignment and calibration | |
33 | ||
34 | ||
d48cca74 | 35 | class AliRICHParam :public TObject |
36 | { | |
37 | public: | |
a25b3368 | 38 | //ctor&dtor |
e42a7b46 | 39 | AliRICHParam():TObject(),fpChambers(0) {CreateChambers();} |
40 | virtual ~AliRICHParam() {delete fpChambers;} | |
a25b3368 | 41 | //test methodes |
c4a03891 | 42 | void Print(Option_t *opt="") const; //print current parametrization |
a25b3368 | 43 | void Test() {TestSeg();TestTrans();TestResp();} //test all groups of methodes |
44 | void TestResp(); //test the response group of methodes | |
45 | void TestSeg(); //test the segmentation group of methodes | |
46 | void TestTrans(); //test the transform group of methodes | |
d3eb6079 | 47 | static void DrawAxis(); |
48 | static void DrawSectors(); | |
a25b3368 | 49 | //flags staff |
50 | static void SetAerogel(Bool_t a) {fgIsAerogel=a;} | |
51 | static Bool_t IsAerogel() {return fgIsAerogel;} | |
52 | static void SetRadioSrc(Bool_t a) {fgIsRadioSrc=a;} | |
53 | static Bool_t IsRadioSrc() {return fgIsRadioSrc;} | |
54 | static void SetTestBeam(Bool_t a) {fgIsTestBeam=a;} | |
55 | static Bool_t IsTestBeam() {return fgIsTestBeam;} | |
56 | static void SetWireSag(Bool_t a) {fgIsWireSag=a;} | |
57 | static Bool_t IsWireSag() {return fgIsWireSag;} | |
58 | static void SetResolveClusters(Bool_t a) {fgIsResolveClusters=a;} | |
59 | static Bool_t IsResolveClusters() {return fgIsResolveClusters;} | |
60 | //Chambers manipulation methodes | |
61 | void CreateChambers(); //form chamber structure | |
998b831f | 62 | AliRICHChamber* C(Int_t i) {return (AliRICHChamber*)fpChambers->UncheckedAt(i-1);} //returns pointer to chamber i |
a25b3368 | 63 | Int_t Nchambers() {return fpChambers->GetEntriesFast();} //returns number of chambers |
64 | //Geometrical properties | |
e42a7b46 | 65 | static Int_t NpadsX() {return kNpadsX;} //pads along X in chamber |
66 | static Int_t NpadsY() {return kNpadsY;} //pads along Y in chamber | |
67 | static Int_t NpadsXsec() {return NpadsX()/2;} //pads along X in sector | |
68 | static Int_t NpadsYsec() {return NpadsY()/3;} //pads along Y in sector | |
3582c1f9 | 69 | static Double_t DeadZone() {return 2.6;} //dead zone size in cm |
a25b3368 | 70 | static Double_t PadSizeX() {return 0.8;} //pad size x, cm |
71 | static Double_t PadSizeY() {return 0.84;} //pad size y, cm | |
998b831f | 72 | |
a25b3368 | 73 | static Double_t SectorSizeX() {return NpadsX()*PadSizeX()/2;} //sector size x, cm |
74 | static Double_t SectorSizeY() {return NpadsY()*PadSizeY()/3;} //sector size y, cm | |
998b831f | 75 | static Double_t PcSizeX() {return NpadsX()*PadSizeX()+DeadZone();} //PC size x, cm |
76 | static Double_t PcSizeY() {return NpadsY()*PadSizeY()+2*DeadZone();} //PC size y, cm | |
a25b3368 | 77 | // |
998b831f | 78 | static Double_t Zfreon() {return 1.5;} //freon thinkness, cm |
79 | static Double_t Zwin() {return 0.5;} //radiator quartz window, cm | |
80 | static Double_t Pc2Win() {return 8.0;} //cm between CsI PC and radiator quartz window | |
81 | static Double_t Pc2Coll() {return 7.0;} //cm between CsI PC and third wire grid (collection wires) | |
82 | static Double_t Pc2Anod() {return 0.204;} //cm between CsI PC and first wire grid (anod wires) | |
83 | static Double_t Pc2Cath() {return 0.445;} //cm between CsI PC and second wire grid (cathode wires) | |
84 | static Double_t Freon2Pc() {return Zfreon()+Zwin()+Pc2Win();} //cm between CsI PC and entrance to freon | |
e42a7b46 | 85 | static Double_t PitchAnod() {return PadSizeY()/2;} //cm between anode wires |
86 | static Double_t PitchCath() {return PadSizeY()/4;} //cm between cathode wires | |
998b831f | 87 | static Double_t PitchColl() {return 0.5;} //cm between collection wires |
e42a7b46 | 88 | |
e42a7b46 | 89 | static Double_t IonisationPotential() {return 26.0e-9;} //for CH4 in GeV taken from ???? |
90 | static TVector2 MathiesonDelta() {return TVector2(5*0.18,5*0.18);} //area of 5 sigmas of Mathieson distribution (cm) | |
91 | static Int_t MaxQdc() {return 4095;} //QDC number of channels | |
a25b3368 | 92 | |
0fe8fa07 | 93 | static Int_t HV(Int_t sector) {if (sector>=1 && sector <=6) return fgHV[sector-1]; else return -1;} //high voltage for this sector |
3582c1f9 | 94 | static void SetHV(Int_t sector,Int_t hv){fgHV[sector-1]=hv;} |
a25b3368 | 95 | //optical properties methodes |
101624cd | 96 | static Double_t MeanCkovEnergy() {return 6.766;} //mean Ckov energy according to the total trasmission curve |
a25b3368 | 97 | static Float_t PhotonEnergy(Int_t i) {return 0.1*i+5.5;} //photon energy (eV) for i-th point |
98 | static Float_t AbsCH4(Float_t ev); //CH4 absorption length (cm) for photon with given energy (eV) | |
99 | static Float_t AbsGel(Float_t) {return 500;} //Aerogel absorption length (cm) for photon with given energy (eV) | |
100 | static Float_t RefIdxC6F14(Float_t eV) {return eV*0.0172+1.177;} //Freon ref index for photon with given energy (eV) | |
101 | static Float_t RefIdxCH4(Float_t) {return 1.000444;} //Methane ref index for photon with given energy (eV) | |
102 | static Float_t RefIdxSiO2(Float_t eV) {Float_t e1=10.666,e2=18.125,f1=46.411,f2= 228.71; | |
103 | return TMath::Sqrt(1.+f1/(e1*e1-eV*eV)+f2/(e2*e2-eV*eV));}//Quartz window ref index from TDR p.35 | |
104 | static Float_t RefIdxGel(Float_t) {return 1.05;} //aerogel ref index | |
105 | static Float_t DenGel() {return (RefIdxGel(0)-1)/0.21;} //aerogel density gr/cm^3 parametrization by E.Nappi | |
106 | //trasformation methodes | |
107 | inline static TVector Loc2Area(const TVector2 &x2); //return area affected by hit x2 | |
d3eb6079 | 108 | inline static Int_t Loc2Sec(const TVector2 &x2); //return sector containing given position |
109 | static Int_t Loc2Sec(Double_t x,Double_t y) {return Loc2Sec(TVector2(x,y));} //return sector containing given position | |
a25b3368 | 110 | inline static TVector Loc2Pad(const TVector2 &x2); //return pad containing given position |
d3eb6079 | 111 | static TVector Loc2Pad(Double_t x,Double_t y) {return Loc2Pad(TVector2(x,y));} //return pad containing given position |
e42a7b46 | 112 | inline static TVector2 Pad2Loc(TVector pad); //return center of the pad |
a25b3368 | 113 | static TVector2 Pad2Loc(Int_t x,Int_t y) {TVector pad(2);pad[0]=x;pad[1]=y;return Pad2Loc(pad);}//return center of the pad (x,y) |
114 | inline static Int_t Pad2Sec(const TVector &pad); //return sector of given pad | |
3582c1f9 | 115 | inline static Int_t PadNeighbours(Int_t iPadX,Int_t iPadY,Int_t aListX[4],Int_t aListY[4]); //number of neighbours for this pad |
a25b3368 | 116 | static Bool_t IsAccepted(const TVector2 &x2) {return ( x2.X()>=0 && x2.X()<=PcSizeX() && x2.Y()>=0 && x2.Y()<=PcSizeY() ) ? kTRUE:kFALSE;} |
117 | //charge response methodes | |
118 | inline static Double_t Mathieson(Double_t x1,Double_t x2,Double_t y1,Double_t y2); //Mathienson integral over given limits | |
e42a7b46 | 119 | inline static Double_t GainSag(Double_t x,Int_t sector); //gain variations in % |
0fe8fa07 | 120 | static Double_t QdcSlope(Int_t sec){switch(sec){case -1: return 0; default: return 33;}} //weight of electon in QDC channels |
a25b3368 | 121 | static Double_t Gain(const TVector2 &x2){//gives chamber gain in terms of QDC channels for given point in local ref system |
122 | if(fgIsWireSag) return QdcSlope(Loc2Sec(x2))*(1+GainSag(x2.X(),Loc2Sec(x2))/100); | |
123 | else return QdcSlope(Loc2Sec(x2));} | |
124 | inline static Double_t FracQdc(const TVector2 &x2,const TVector &pad); //charge fraction to pad from hit | |
3582c1f9 | 125 | inline static Int_t TotQdc(TVector2 x2,Double_t eloss); //total charge for hit eloss=0 for photons |
0fe8fa07 | 126 | inline static Bool_t IsOverTh(Int_t c,TVector pad,Double_t q); //is QDC of the pad registered by FEE |
e42a7b46 | 127 | static Int_t NsigmaTh() {return fgNsigmaTh;} // |
128 | static Float_t SigmaThMean() {return fgSigmaThMean;} //QDC electronic noise mean | |
129 | static Float_t SigmaThSpread() {return fgSigmaThSpread;} //QDC electronic noise width | |
e42a7b46 | 130 | |
ae754cdf | 131 | static Double_t CogCorr(Double_t x) {return 3.31267e-2*TMath::Sin(2*TMath::Pi()/PadSizeX()*x) //correction of cluster CoG due to sinoidal |
ed83829e | 132 | -2.66575e-3*TMath::Sin(4*TMath::Pi()/PadSizeX()*x) |
f770edb5 | 133 | +2.80553e-3*TMath::Sin(6*TMath::Pi()/PadSizeX()*x)+0.0070;} |
d0831219 | 134 | static void ReadErrFiles(); //Read Err file parameters |
135 | static TVector3 SigmaSinglePhoton(Int_t Npart, Double_t mom, Double_t theta, Double_t phi); //Find Sigma for single photon | |
101624cd | 136 | static Double_t Interpolate(Double_t par[4][330],Double_t x, Double_t y, Double_t phi); //Find the error value from interpolation |
137 | ||
56030c8d | 138 | static TVector3 ForwardTracing(TVector3 entranceTrackPoint,TVector3 vectorTrack, Double_t thetaC, Double_t phiC); //it traces foward a photon from Emission Point to PC |
d0831219 | 139 | static TVector3 PlaneIntersect(TVector3 vstart,TVector3 p0,TVector3 n,TVector3 v0); //it finds intersection between straight track and plane |
140 | static Double_t SnellAngle(Float_t n1, Float_t n2, Float_t theta1); // Snell law | |
141 | static void AnglesInDRS(Double_t trackTheta,Double_t trackPhi,Double_t thetaCerenkov,Double_t phiCerenkov,Double_t &tout,Double_t &pout);//It finds photon angles in | |
142 | //Detector Reference System | |
a25b3368 | 143 | |
144 | static Bool_t fgIsAerogel; //aerogel geometry instead of normal RICH flag | |
e42a7b46 | 145 | protected: |
a25b3368 | 146 | static Bool_t fgIsRadioSrc; //radioactive source instead of radiators flag |
147 | static Bool_t fgIsTestBeam; //test beam geometry instead of normal RICH flag | |
e42a7b46 | 148 | static Bool_t fgIsWireSag; //wire sagitta ON/OFF flag |
149 | static Bool_t fgIsResolveClusters; //declustering ON/OFF flag | |
d3eb6079 | 150 | static Bool_t fgIsFeedback; //generate feedback photon? |
a25b3368 | 151 | |
152 | TObjArray *fpChambers; //list of chambers | |
e42a7b46 | 153 | static Int_t fgHV[6]; //HV applied to anod wires |
e42a7b46 | 154 | static Int_t fgNsigmaTh; //n. of sigmas to cut for zero suppression |
155 | static Float_t fgSigmaThMean; //sigma threshold value | |
156 | static Float_t fgSigmaThSpread; //spread of sigma | |
101624cd | 157 | |
158 | static Double_t fgErrChrom[4][330]; // | |
159 | static Double_t fgErrGeom[4][330]; // | |
160 | static Double_t fgErrLoc[4][330]; //Chromatic, Geometric and Localization array to parametrize SigmaCerenkov | |
161 | ||
162 | ClassDef(AliRICHParam,6) //RICH main parameters class | |
d48cca74 | 163 | }; |
c2c6679b | 164 | //__________________________________________________________________________________________________ |
c712cb2f | 165 | Int_t AliRICHParam::PadNeighbours(Int_t iPadX,Int_t iPadY,Int_t listX[4],Int_t listY[4]) |
166 | { | |
a25b3368 | 167 | //Determines all the neighbouring pads for the given one (iPadX,iPadY). Returns total number of these pads. |
168 | //Dead zones are taken into account, meaning pads from different sector are not taken. | |
e42a7b46 | 169 | // 1 |
170 | // 2 3 | |
171 | // 4 | |
c712cb2f | 172 | Int_t nPads=0; |
e42a7b46 | 173 | if(iPadY!=NpadsY()&&iPadY!=2*NpadsYsec()&&iPadY!=NpadsYsec()){listX[nPads]=iPadX; listY[nPads]=iPadY+1; nPads++;} //1 |
174 | if(iPadX!=1&&iPadX!=NpadsXsec()+1) {listX[nPads]=iPadX-1; listY[nPads]=iPadY; nPads++;} //2 | |
175 | if(iPadX!=NpadsXsec()&&iPadX!=NpadsX()) {listX[nPads]=iPadX+1; listY[nPads]=iPadY; nPads++;} //3 | |
176 | if(iPadY!=1&&iPadY!=NpadsYsec()+1&&2*NpadsYsec()+1) {listX[nPads]=iPadX; listY[nPads]=iPadY-1; nPads++;} //4 | |
ed3ceb24 | 177 | |
c712cb2f | 178 | return nPads; |
179 | }//Pad2ClosePads() | |
180 | //__________________________________________________________________________________________________ | |
a25b3368 | 181 | Int_t AliRICHParam::Loc2Sec(const TVector2 &v2) |
3582c1f9 | 182 | { |
a25b3368 | 183 | //Determines sector containing the given point. |
184 | //Returns sector code: | |
e42a7b46 | 185 | //y ^ 5 6 |
186 | // | 3 4 | |
187 | // | 1 2 | |
188 | // -------> x | |
189 | Double_t x0=0; Double_t x1=SectorSizeX(); Double_t x2=SectorSizeX()+DeadZone(); Double_t x3=PcSizeX(); | |
190 | Double_t y0=0; Double_t y1=SectorSizeY(); Double_t y2=SectorSizeY()+DeadZone(); Double_t y3=2*SectorSizeY()+DeadZone(); | |
191 | Double_t y4=PcSizeY()-SectorSizeY(); Double_t y5=PcSizeY(); | |
192 | ||
0fe8fa07 | 193 | Int_t sector=-1; |
a25b3368 | 194 | if (v2.X() >= x0 && v2.X() <= x1 ) sector=1; |
195 | else if(v2.X() >= x2 && v2.X() <= x3 ) sector=2; | |
0fe8fa07 | 196 | else return -1; |
3582c1f9 | 197 | |
a25b3368 | 198 | if (v2.Y() >= y0 && v2.Y() <= y1 ) ; //sectors 1 or 2 |
199 | else if(v2.Y() >= y2 && v2.Y() <= y3 ) sector+=2; //sectors 3 or 4 | |
200 | else if(v2.Y() >= y4 && v2.Y() <= y5 ) sector+=4; //sectors 5 or 6 | |
0fe8fa07 | 201 | else return -1; |
3582c1f9 | 202 | return sector; |
c712cb2f | 203 | }//Loc2Sec(Double_t x, Double_t y) |
c2c6679b | 204 | //__________________________________________________________________________________________________ |
a25b3368 | 205 | TVector AliRICHParam::Loc2Pad(const TVector2 &loc) |
3582c1f9 | 206 | { |
a25b3368 | 207 | //Determines pad number TVector(padx,pady) containing the given point x2 defined in the chamber RS. |
208 | //Pad count starts in lower left corner from 1,1 to 144,160 in upper right corner of a chamber. | |
e42a7b46 | 209 | //y ^ 5 6 |
210 | // | 3 4 | |
211 | // | 1 2 | |
212 | // -------> x | |
213 | TVector pad(2); | |
a25b3368 | 214 | Int_t sec=Loc2Sec(loc);//trasforms x2 to sector reference system |
0fe8fa07 | 215 | if(sec==-1) {pad[0]=pad[1]=-1; return pad;} |
a25b3368 | 216 | //first we deal with x |
217 | if(sec==1||sec==3||sec==5) pad[0]= Int_t( loc.X() / PadSizeX() )+1; //sector 1 or 3 or 5 | |
218 | else pad[0]=NpadsX() - Int_t( (PcSizeX()-loc.X()) / PadSizeX() ) ; //sector 2 or 4 or 6 | |
219 | //second deal with y | |
d3eb6079 | 220 | if(sec==1||sec==2) pad[1]=Int_t( loc.Y() / PadSizeY())+1; //sector 1 or 2 |
221 | else if(sec==3||sec==4) pad[1]=Int_t( (loc.Y()-SectorSizeY()-DeadZone()) / PadSizeY())+NpadsYsec()+1; //sector 3 or 4 | |
222 | else pad[1]=NpadsY() - Int_t( (PcSizeY()-loc.Y()) / PadSizeY()); //sector 5 or 6 | |
e42a7b46 | 223 | return pad; |
3582c1f9 | 224 | } |
225 | //__________________________________________________________________________________________________ | |
998b831f | 226 | Int_t AliRICHParam::Pad2Sec(const TVector &pad) |
3582c1f9 | 227 | { |
a25b3368 | 228 | //Determines sector containing the given pad. |
0fe8fa07 | 229 | Int_t sector=-1; |
e42a7b46 | 230 | if (pad[0] >= 1 && pad[0] <= NpadsXsec() ) {sector=1;} |
231 | else if(pad[0] > NpadsXsec() && pad[0] <= NpadsX() ) {sector=2;} | |
998b831f | 232 | else AliDebugClass(1,Form("Wrong pad (%3.0f,%3.0f)",pad[0],pad[1])); |
e42a7b46 | 233 | |
234 | if (pad[1] >= 1 && pad[1] <= NpadsYsec() ) {} | |
235 | else if(pad[1] > NpadsYsec() && pad[1] <= 2*NpadsYsec() ) {sector+=2;} | |
236 | else if(pad[1] > 2*NpadsYsec() && pad[1] <= NpadsY() ) {sector+=4;} | |
998b831f | 237 | else AliDebugClass(1,Form("Wrong pad (%3.0f,%3.0f)",pad[0],pad[1])); |
c712cb2f | 238 | |
e42a7b46 | 239 | return sector; |
c712cb2f | 240 | }//Pad2Sec() |
241 | //__________________________________________________________________________________________________ | |
e42a7b46 | 242 | TVector2 AliRICHParam::Pad2Loc(TVector pad) |
c712cb2f | 243 | { |
a25b3368 | 244 | //Returns position of the center of the given pad in local system of the chamber (cm) |
e42a7b46 | 245 | // y ^ 5 6 |
998b831f | 246 | // | 3 4 sector numbers |
e42a7b46 | 247 | // | 1 2 |
248 | // -------> x | |
0fe8fa07 | 249 | Double_t x=-1,y=-1; |
e42a7b46 | 250 | if(pad[0] > 0 && pad[0] <= NpadsXsec())//it's 1 or 3 or 5 |
251 | x=(pad[0]-0.5)*PadSizeX(); | |
252 | else if(pad[0] > NpadsXsec() && pad[0] <= NpadsX())//it's 2 or 4 or 6 | |
253 | x=(pad[0]-0.5)*PadSizeX()+DeadZone(); | |
c2c6679b | 254 | else |
998b831f | 255 | AliDebugClass(1,Form("Wrong pad (%3.0f,%3.0f)",pad[0],pad[1])); |
e42a7b46 | 256 | |
257 | if(pad[1] > 0 && pad[1] <= NpadsYsec())//it's 1 or 2 | |
258 | y=(pad[1]-0.5)*PadSizeY(); | |
259 | else if(pad[1] > NpadsYsec() && pad[1] <= 2*NpadsYsec())//it's 3 or 4 | |
260 | y=(pad[1]-0.5)*PadSizeY()+DeadZone(); | |
261 | else if(pad[1] > 2*NpadsYsec() && pad[1]<= NpadsY())//it's 5 or 6 | |
262 | y=(pad[1]-0.5)*PadSizeY()+2*DeadZone(); | |
263 | else | |
998b831f | 264 | AliDebugClass(1,Form("Wrong pad (%3.0f,%3.0f)",pad[0],pad[1])); |
e42a7b46 | 265 | |
3582c1f9 | 266 | return TVector2(x,y); |
267 | } | |
c60862bf | 268 | //__________________________________________________________________________________________________ |
e42a7b46 | 269 | Double_t AliRICHParam::GainSag(Double_t x,Int_t sector) |
c60862bf | 270 | { |
a25b3368 | 271 | //Returns % of gain variation due to wire sagita. |
272 | //All curves are parametrized as per sector basis, so x must be apriory transformed to the Sector RS. | |
273 | //Here x is a distance along wires. | |
e42a7b46 | 274 | x-=SectorSizeX()/2; |
275 | if(x>SectorSizeX()) x-=SectorSizeX(); | |
3582c1f9 | 276 | switch(HV(sector)){ |
e42a7b46 | 277 | case 2150: return 9e-6*TMath::Power(x,4)+2e-7*TMath::Power(x,3)-0.0316*TMath::Power(x,2)-3e-4*x+25.367;//% |
278 | case 2100: return 8e-6*TMath::Power(x,4)+2e-7*TMath::Power(x,3)-0.0283*TMath::Power(x,2)-2e-4*x+23.015; | |
279 | case 2050: return 7e-6*TMath::Power(x,4)+1e-7*TMath::Power(x,3)-0.0254*TMath::Power(x,2)-2e-4*x+20.888; | |
280 | case 2000: return 6e-6*TMath::Power(x,4)+8e-8*TMath::Power(x,3)-0.0227*TMath::Power(x,2)-1e-4*x+18.961; | |
3582c1f9 | 281 | default: return 0; |
282 | } | |
c712cb2f | 283 | } |
284 | //__________________________________________________________________________________________________ | |
3582c1f9 | 285 | Int_t AliRICHParam::TotQdc(TVector2 x2,Double_t eloss) |
286 | { | |
a25b3368 | 287 | //Calculates the total charge produced by the eloss in point x2 (Chamber RS). |
288 | //Returns this change parametrised in QDC channels, or 0 if the hit in the dead zone. | |
289 | //eloss=0 means photon which produces 1 electron only eloss > 0 for Mip | |
0fe8fa07 | 290 | if(Loc2Sec(x2)==-1) return 0; //hit in the dead zone |
3582c1f9 | 291 | Int_t iNelectrons=Int_t(eloss/IonisationPotential()); if(iNelectrons==0) iNelectrons=1; |
292 | Double_t qdc=0; | |
293 | for(Int_t i=1;i<=iNelectrons;i++) qdc+=-Gain(x2)*TMath::Log(gRandom->Rndm()); | |
294 | return Int_t(qdc); | |
295 | } | |
296 | //__________________________________________________________________________________________________ | |
a25b3368 | 297 | Double_t AliRICHParam::FracQdc(const TVector2 &x2,const TVector &pad) |
3582c1f9 | 298 | { |
a25b3368 | 299 | //Calculates the charge fraction induced to given pad by the hit from the given point. |
300 | //Integrated Mathieson distribution is used. | |
e42a7b46 | 301 | TVector2 center2=Pad2Loc(pad);//gives center of requested pad |
998b831f | 302 | Double_t normXmin=(x2.X()-center2.X()-PadSizeX()/2) /Pc2Cath();//parametrise for Mathienson |
303 | Double_t normXmax=(x2.X()-center2.X()+PadSizeX()/2) /Pc2Cath(); | |
304 | Double_t normYmin=(x2.Y()-center2.Y()-PadSizeY()/2) /Pc2Cath(); | |
305 | Double_t normYmax=(x2.Y()-center2.Y()+PadSizeY()/2) /Pc2Cath(); | |
306 | ||
307 | //requested pad might not belong to the sector of the given hit position, hence the check: | |
308 | return (Loc2Sec(x2)!=Pad2Sec(pad)) ? 0:Mathieson(normXmin, normYmin, normXmax, normYmax); | |
3582c1f9 | 309 | } |
c712cb2f | 310 | //__________________________________________________________________________________________________ |
9d6f9427 | 311 | Double_t AliRICHParam::Mathieson(Double_t xMin,Double_t yMin,Double_t xMax,Double_t yMax) |
3582c1f9 | 312 | { |
a25b3368 | 313 | //All arguments are parametrised according to NIM A370(1988)602-603 |
314 | //Returns a charge fraction. | |
53fd478b | 315 | const Double_t kSqrtKx3=0.77459667;const Double_t kX2=0.962;const Double_t kX4=0.379; |
316 | const Double_t kSqrtKy3=0.77459667;const Double_t kY2=0.962;const Double_t kY4=0.379; | |
c712cb2f | 317 | |
53fd478b | 318 | Double_t ux1=kSqrtKx3*TMath::TanH(kX2*xMin); |
319 | Double_t ux2=kSqrtKx3*TMath::TanH(kX2*xMax); | |
320 | Double_t uy1=kSqrtKy3*TMath::TanH(kY2*yMin); | |
321 | Double_t uy2=kSqrtKy3*TMath::TanH(kY2*yMax); | |
322 | return 4*kX4*(TMath::ATan(ux2)-TMath::ATan(ux1))*kY4*(TMath::ATan(uy2)-TMath::ATan(uy1)); | |
c712cb2f | 323 | } |
324 | //__________________________________________________________________________________________________ | |
a25b3368 | 325 | TVector AliRICHParam::Loc2Area(const TVector2 &x2) |
3582c1f9 | 326 | { |
a25b3368 | 327 | //Calculates the area of disintegration for a given point. It's assumed here that this points lays on anode wire. |
328 | //Area is a rectangulare set of pads defined by its left-down and right-up coners. | |
e42a7b46 | 329 | TVector area(4); |
330 | TVector pad=Loc2Pad(x2); | |
331 | area[0]=area[2]=pad[0]; area[1]=area[3]=pad[1];//area is just a pad fired | |
332 | if(pad[0]!=1 && pad[0]!= NpadsXsec()+1 ) area[0]--; //left down coner X | |
333 | if(pad[1]!=1 && pad[1]!= NpadsYsec()+1 && pad[1]!= 2*NpadsYsec()+1) area[1]--; //left down coner Y | |
334 | if(pad[0]!=NpadsXsec() && pad[0]!= NpadsX() ) area[2]++; //right up coner X | |
335 | if(pad[1]!=NpadsYsec() && pad[1]!= 2*NpadsYsec() && pad[1]!= NpadsY() ) area[3]++; //right up coner Y | |
336 | return area; | |
3582c1f9 | 337 | } |
08479a10 | 338 | //__________________________________________________________________________________________________ |
e42a7b46 | 339 | Bool_t AliRICHParam::IsOverTh(Int_t ,TVector ,Double_t q) |
3582c1f9 | 340 | { |
a25b3368 | 341 | //Checks if the current q is over threshold and FEE will save this value to data concentrator. |
e42a7b46 | 342 | return (q>NsigmaTh()*(SigmaThMean()+(1.-2*gRandom->Rndm())*SigmaThSpread())); |
3582c1f9 | 343 | } |
d48cca74 | 344 | #endif //AliRICHParam_h |
a25b3368 | 345 | |
346 |