]> git.uio.no Git - u/mrichter/AliRoot.git/blame - RICH/AliRICHParam.cxx
Some violations for AliRICHParam checked
[u/mrichter/AliRoot.git] / RICH / AliRICHParam.cxx
CommitLineData
53fd478b 1// **************************************************************************
2// * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3// * *
4// * Author: The ALICE Off-line Project. *
5// * Contributors are mentioned in the code where appropriate. *
6// * *
7// * Permission to use, copy, modify and distribute this software and its *
8// * documentation strictly for non-commercial purposes is hereby granted *
9// * without fee, provided that the above copyright notice appears in all *
10// * copies and that both the copyright notice and this permission notice *
11// * appear in the supporting documentation. The authors make no claims *
12// * about the suitability of this software for any purpose. It is *
13// * provided "as is" without express or implied warranty. *
14// **************************************************************************
56148d0e 15#include "AliRICHParam.h"
e42a7b46 16#include "AliRICHChamber.h"
a25b3368 17#include "AliRICHDisplFast.h"
18#include <TCanvas.h>
19#include <TLatex.h>
20#include <THStack.h>
21#include <TLegend.h>
22#include <TView.h>
23#include <TPolyMarker3D.h>
24#include <TPolyLine3D.h>
d3eb6079 25#include <TPolyLine.h>
56148d0e 26
ed3ceb24 27ClassImp(AliRICHParam)
a25b3368 28Bool_t AliRICHParam::fgIsWireSag =kTRUE; //take ware sagita into account?
29Bool_t AliRICHParam::fgIsResolveClusters =kTRUE; //do cluster resolving?
d3eb6079 30Bool_t AliRICHParam::fgIsFeedback =kTRUE; //generate feedback photons?
a25b3368 31Bool_t AliRICHParam::fgIsRadioSrc =kFALSE; //put radioactive source instead of radiators?
32Bool_t AliRICHParam::fgIsAerogel =kFALSE; //special aerogel configuration
33Bool_t AliRICHParam::fgIsTestBeam =kFALSE; //special test beam configuration
34
e42a7b46 35Int_t AliRICHParam::fgHV[kNsectors] ={2050,2050,2050,2050,2050,2050};
08479a10 36Int_t AliRICHParam::fgNsigmaTh =4;
e42a7b46 37Float_t AliRICHParam::fgSigmaThMean =1.132; //QDC
38Float_t AliRICHParam::fgSigmaThSpread =0.035; //
08479a10 39
3582c1f9 40//__________________________________________________________________________________________________
c4a03891 41void AliRICHParam::Print(Option_t*) const
3582c1f9 42{
ae754cdf 43//print some usefull (hopefully) info on some internal guts of RICH parametrisation
d3eb6079 44 AliInfo(Form("Pads in chamber (%3i,%3i) in sector (%2i,%2i) pad size (%4.2f,%4.2f)",NpadsX(),NpadsY(),NpadsXsec(),NpadsYsec(),PadSizeX(),PadSizeY()));
a25b3368 45 AliInfo(Form("Resolve clusters %i sagita %i Radio source %i Aerogel %i TestBeam %i",
46 IsResolveClusters(),IsWireSag(),IsRadioSrc(),IsAerogel(),IsTestBeam()));
47 fpChambers->Print();
998b831f 48}//Print()
3582c1f9 49//__________________________________________________________________________________________________
e42a7b46 50void AliRICHParam::CreateChambers()
51{
52//Create all RICH Chambers on each call. Previous chambers deleted.
53 if(fpChambers) delete fpChambers;
a25b3368 54 if(fgIsTestBeam){
998b831f 55 fpChambers=new TObjArray(1);//test beam configuration 1 chamber
56 fpChambers->AddAt(new AliRICHChamber(0),0);
57 }else{
58 fpChambers=new TObjArray(kNchambers);//normal configuration 7 chambers
59 for(int iChamberN=0;iChamberN<kNchambers;iChamberN++) fpChambers->AddAt(new AliRICHChamber(iChamberN+1),iChamberN);
60 }
e42a7b46 61 fpChambers->SetOwner();
998b831f 62}//CreateChambers()
a25b3368 63//__________________________________________________________________________________________________
64Float_t AliRICHParam::AbsCH4(Float_t eV)
65{
66//Evaluate the absorbtion lenght of CH4 for a photon of energy eV in electron-volts
67 const Float_t kLoschmidt=2.686763e19; // LOSCHMIDT NUMBER IN CM-3
68 const Float_t kPressure=750.0; //mm of Hg
69 const Float_t kTemperature=283.0; //K (10 grad C)
70 const Float_t kPn=kPressure/760.;
71 const Float_t kTn=kTemperature/273.16;
72 const Float_t kC0=-1.655279e-1;
73 const Float_t kC1= 6.307392e-2;
74 const Float_t kC2=-8.011441e-3;
75 const Float_t kC3= 3.392126e-4;
76
77 Float_t crossSection=0;
78 if (eV<7.75)
79 crossSection=0.06e-22;
80 else //------ METHANE CROSS SECTION cm-2 ASTROPH. J. 214, L47 (1978)
81 crossSection=(kC0+kC1*eV+kC2*eV*eV+kC3*eV*eV*eV)*1.e-18;
82
83 Float_t density=kLoschmidt*kPn/kTn; //CH4 molecular concentration (cm^-3)
84 return 1.0/(density*crossSection);
85}//AbsoCH4()
86//__________________________________________________________________________________________________
87void AliRICHParam::TestSeg()
ae754cdf 88{
89//Provides a set of pictures to test segementation currently in use.
d3eb6079 90 new TCanvas("pads","PC segmentation - pads display",700,600);
91 gPad->Range(-5,-5,PcSizeX()+5,PcSizeY()+15);
92 TVector p(2); TVector2 c; TVector2 b; //current: pad, pad center, pad boundary
93// list of corners:
94 Double_t x0=0,x1=SectorSizeX(),x2=SectorSizeX()+DeadZone(), x3=PcSizeX();
95 Double_t y0=0,y1=SectorSizeY(),y2=SectorSizeY()+DeadZone(),y3=2*SectorSizeY()+DeadZone(),y4=PcSizeY()-SectorSizeY(),y5=PcSizeY();
96 DrawSectors();
97//header
98 TLatex t;
99 t.SetTextSize(0.02); t.SetTextColor(kBlack); t.SetTextAlign(11);
100 t.DrawLatex(0,PcSizeY()+10,Form("IP in front of this page. pad size %.2fx%.2fcm dead zone %.2fcm",PadSizeX(),PadSizeY(),DeadZone()));
101 t.DrawLatex(0,PcSizeY()+ 5,Form("Pc %.2fx%.2f cm %ix%i pads Sec %.2fx%.2f cm %ix%i pads",
102 PcSizeX() , PcSizeY() , NpadsX() , NpadsY() ,
103 SectorSizeX() , SectorSizeY() , NpadsXsec() , NpadsYsec() ));
104//sectors
105 t.SetTextSize(0.015); t.SetTextColor(kRed); t.SetTextAlign(22);
106 c=Pad2Loc( 40, 24); t.DrawText(c.X(),c.Y(),Form("sec 1 (%.2f,%.2f)",c.X(),c.Y() ));
107 c=Pad2Loc( 40, 75); t.DrawText(c.X(),c.Y(),Form("sec 3 (%.2f,%.2f)",c.X(),c.Y() ));
108 c=Pad2Loc( 40,121); t.DrawText(c.X(),c.Y(),Form("sec 5 (%.2f,%.2f)",c.X(),c.Y() ));
109 c=Pad2Loc(120, 24); t.DrawText(c.X(),c.Y(),Form("sec 2 (%.2f,%.2f)",c.X(),c.Y() ));
110 c=Pad2Loc(120, 75); t.DrawText(c.X(),c.Y(),Form("sec 4 (%.2f,%.2f)",c.X(),c.Y() ));
111 c=Pad2Loc(120,121); t.DrawText(c.X(),c.Y(),Form("sec 6 (%.2f,%.2f)",c.X(),c.Y() ));
112//coners
113 t.SetTextSize(0.015); t.SetTextColor(kBlue);
114
115 b.Set(x0,y0);p=Loc2Pad(b);c=Pad2Loc(p);t.SetTextAlign(11);t.DrawText(c.X(),c.Y(),Form("(%.2f,%.2f)-(%.0f,%.0f)-(%.2f,%.2f)",b.X(),b.Y(),p(0),p(1),c.X(),c.Y()));
116 b.Set(x0,y1);p=Loc2Pad(b);c=Pad2Loc(p);t.SetTextAlign(13);t.DrawText(c.X(),c.Y(),Form("(%.2f,%.2f)-(%.0f,%.0f)-(%.2f,%.2f)",b.X(),b.Y(),p(0),p(1),c.X(),c.Y()));
117 b.Set(x0,y2);p=Loc2Pad(b);c=Pad2Loc(p);t.SetTextAlign(11);t.DrawText(c.X(),c.Y(),Form("(%.2f,%.2f)-(%.0f,%.0f)-(%.2f,%.2f)",b.X(),b.Y(),p(0),p(1),c.X(),c.Y()));
118 b.Set(x0,y3);p=Loc2Pad(b);c=Pad2Loc(p);t.SetTextAlign(13);t.DrawText(c.X(),c.Y(),Form("(%.2f,%.2f)-(%.0f,%.0f)-(%.2f,%.2f)",b.X(),b.Y(),p(0),p(1),c.X(),c.Y()));
119 b.Set(x0,y4);p=Loc2Pad(b);c=Pad2Loc(p);t.SetTextAlign(11);t.DrawText(c.X(),c.Y(),Form("(%.2f,%.2f)-(%.0f,%.0f)-(%.2f,%.2f)",b.X(),b.Y(),p(0),p(1),c.X(),c.Y()));
120 b.Set(x0,y5);p=Loc2Pad(b);c=Pad2Loc(p);t.SetTextAlign(13);t.DrawText(c.X(),c.Y(),Form("(%.2f,%.2f)-(%.0f,%.0f)-(%.2f,%.2f)",b.X(),b.Y(),p(0),p(1),c.X(),c.Y()));
a25b3368 121
d3eb6079 122 b.Set(x1,y0);p=Loc2Pad(b);c=Pad2Loc(p);t.SetTextAlign(31);t.DrawText(c.X(),c.Y(),Form("(%.2f,%.2f)-(%.0f,%.0f)-(%.2f,%.2f)",b.X(),b.Y(),p(0),p(1),c.X(),c.Y()));
123 b.Set(x1,y1);p=Loc2Pad(b);c=Pad2Loc(p);t.SetTextAlign(33);t.DrawText(c.X(),c.Y(),Form("(%.2f,%.2f)-(%.0f,%.0f)-(%.2f,%.2f)",b.X(),b.Y(),p(0),p(1),c.X(),c.Y()));
124 b.Set(x1,y2);p=Loc2Pad(b);c=Pad2Loc(p);t.SetTextAlign(31);t.DrawText(c.X(),c.Y(),Form("(%.2f,%.2f)-(%.0f,%.0f)-(%.2f,%.2f)",b.X(),b.Y(),p(0),p(1),c.X(),c.Y()));
125 b.Set(x1,y3);p=Loc2Pad(b);c=Pad2Loc(p);t.SetTextAlign(33);t.DrawText(c.X(),c.Y(),Form("(%.2f,%.2f)-(%.0f,%.0f)-(%.2f,%.2f)",b.X(),b.Y(),p(0),p(1),c.X(),c.Y()));
126 b.Set(x1,y4);p=Loc2Pad(b);c=Pad2Loc(p);t.SetTextAlign(31);t.DrawText(c.X(),c.Y(),Form("(%.2f,%.2f)-(%.0f,%.0f)-(%.2f,%.2f)",b.X(),b.Y(),p(0),p(1),c.X(),c.Y()));
127 b.Set(x1,y5);p=Loc2Pad(b);c=Pad2Loc(p);t.SetTextAlign(33);t.DrawText(c.X(),c.Y(),Form("(%.2f,%.2f)-(%.0f,%.0f)-(%.2f,%.2f)",b.X(),b.Y(),p(0),p(1),c.X(),c.Y()));
a25b3368 128
d3eb6079 129 b.Set(x2,y0);p=Loc2Pad(b);c=Pad2Loc(p);t.SetTextAlign(11);t.DrawText(c.X(),c.Y(),Form("(%.2f,%.2f)-(%.0f,%.0f)-(%.2f,%.2f)",b.X(),b.Y(),p(0),p(1),c.X(),c.Y()));
130 b.Set(x2,y1);p=Loc2Pad(b);c=Pad2Loc(p);t.SetTextAlign(13);t.DrawText(c.X(),c.Y(),Form("(%.2f,%.2f)-(%.0f,%.0f)-(%.2f,%.2f)",b.X(),b.Y(),p(0),p(1),c.X(),c.Y()));
131 b.Set(x2,y2);p=Loc2Pad(b);c=Pad2Loc(p);t.SetTextAlign(11);t.DrawText(c.X(),c.Y(),Form("(%.2f,%.2f)-(%.0f,%.0f)-(%.2f,%.2f)",b.X(),b.Y(),p(0),p(1),c.X(),c.Y()));
132 b.Set(x2,y3);p=Loc2Pad(b);c=Pad2Loc(p);t.SetTextAlign(13);t.DrawText(c.X(),c.Y(),Form("(%.2f,%.2f)-(%.0f,%.0f)-(%.2f,%.2f)",b.X(),b.Y(),p(0),p(1),c.X(),c.Y()));
133 b.Set(x2,y4);p=Loc2Pad(b);c=Pad2Loc(p);t.SetTextAlign(11);t.DrawText(c.X(),c.Y(),Form("(%.2f,%.2f)-(%.0f,%.0f)-(%.2f,%.2f)",b.X(),b.Y(),p(0),p(1),c.X(),c.Y()));
134 b.Set(x2,y5);p=Loc2Pad(b);c=Pad2Loc(p);t.SetTextAlign(13);t.DrawText(c.X(),c.Y(),Form("(%.2f,%.2f)-(%.0f,%.0f)-(%.2f,%.2f)",b.X(),b.Y(),p(0),p(1),c.X(),c.Y()));
a25b3368 135
d3eb6079 136 b.Set(x3,y0);p=Loc2Pad(b);c=Pad2Loc(p);t.SetTextAlign(31);t.DrawText(c.X(),c.Y(),Form("(%.2f,%.2f)-(%.0f,%.0f)-(%.2f,%.2f)",b.X(),b.Y(),p(0),p(1),c.X(),c.Y()));
137 b.Set(x3,y1);p=Loc2Pad(b);c=Pad2Loc(p);t.SetTextAlign(33);t.DrawText(c.X(),c.Y(),Form("(%.2f,%.2f)-(%.0f,%.0f)-(%.2f,%.2f)",b.X(),b.Y(),p(0),p(1),c.X(),c.Y()));
138 b.Set(x3,y2);p=Loc2Pad(b);c=Pad2Loc(p);t.SetTextAlign(31);t.DrawText(c.X(),c.Y(),Form("(%.2f,%.2f)-(%.0f,%.0f)-(%.2f,%.2f)",b.X(),b.Y(),p(0),p(1),c.X(),c.Y()));
139 b.Set(x3,y3);p=Loc2Pad(b);c=Pad2Loc(p);t.SetTextAlign(33);t.DrawText(c.X(),c.Y(),Form("(%.2f,%.2f)-(%.0f,%.0f)-(%.2f,%.2f)",b.X(),b.Y(),p(0),p(1),c.X(),c.Y()));
140 b.Set(x3,y4);p=Loc2Pad(b);c=Pad2Loc(p);t.SetTextAlign(31);t.DrawText(c.X(),c.Y(),Form("(%.2f,%.2f)-(%.0f,%.0f)-(%.2f,%.2f)",b.X(),b.Y(),p(0),p(1),c.X(),c.Y()));
141 b.Set(x3,y5);p=Loc2Pad(b);c=Pad2Loc(p);t.SetTextAlign(33);t.DrawText(c.X(),c.Y(),Form("(%.2f,%.2f)-(%.0f,%.0f)-(%.2f,%.2f)",b.X(),b.Y(),p(0),p(1),c.X(),c.Y()));
a25b3368 142}//TestSeg()
143//__________________________________________________________________________________________________
144void AliRICHParam::TestResp()
145{
ae754cdf 146//Provides a set of plot to check the response parametrisation currently in use.
a25b3368 147 TCanvas *pC=new TCanvas("c","Amplification test",900,800);
148 pC->Divide(1,2);
149
150
ae754cdf 151 const Int_t kNpoints=8;
a25b3368 152 THStack *pStackPhot=new THStack("StackPhot","photons");
153 THStack *pStackMip =new THStack("StackMip","mips");
154 TLegend *pLeg=new TLegend(0.6,0.2,0.9,0.5,"legend");
ae754cdf 155 TH1F *apHphot[kNpoints];
156 TH1F *apHmip[kNpoints];
a25b3368 157
158 Double_t starty=0;
ae754cdf 159 Double_t deltay=AliRICHParam::SectorSizeY()/kNpoints;
a25b3368 160
ae754cdf 161 for(int i=0;i<kNpoints;i++){
a25b3368 162 apHphot[i]=new TH1F(Form("hphot%i",i),"Qdc for Photon;QDC;Counts",500,0,500); apHphot[i]->SetLineColor(i);pStackPhot->Add(apHphot[i]);
163 apHmip[i] =new TH1F(Form("hmip%i",i),"Qdc for Mip;QDC;Counts",4000,0,4000); apHmip[i]->SetLineColor(i);pStackMip->Add(apHmip[i]);
164
165 pLeg->AddEntry(apHphot[i],Form("@(10,%5.2f->%5.2f)",starty+i*deltay,starty+i*deltay-SectorSizeY()/2));
166 }
167
168
169 TVector2 x2(0,0);
170 for(Int_t i=0;i<10000;i++){//events loop
ae754cdf 171 for(int j=0;j<kNpoints;j++){
a25b3368 172 x2.Set(10,starty+j*deltay);
173 apHphot[j]->Fill(TotQdc(x2,0));
174 apHmip[j]->Fill(TotQdc(x2,gRandom->Landau(600,150)*1e-9));
175 }
176 }
177
178 pC->cd(1); pStackMip->Draw("nostack");
179 pC->cd(2); pStackPhot->Draw("nostack"); pLeg->Draw();
180}//TestResp()
181//__________________________________________________________________________________________________
182void AliRICHParam::TestTrans()
183{
ae754cdf 184//Provides a set of plots to test transformation methods
a25b3368 185 new TCanvas("trasform","Test LRS-MRS transform");
186 TLatex t; t.SetTextSize(0.02);
187
188 TView *pView=new TView(1);
189 pView->SetRange(-600,-600,-600,600,600,600);
190 DrawAxis();
191//Draw PC for all chambers by trasfering Pc plane using Pc2Mrs methode
192 Int_t iNpointsX=50,iNpointsY=50;
193 for(Int_t iChamberN=1;iChamberN<=7;iChamberN++){//chamber loop
194 TPolyMarker3D *pChamber=new TPolyMarker3D(iNpointsX*iNpointsY);
195 Int_t i=0;
196 for(Double_t x=0;x<PcSizeX();x+=PcSizeX()/iNpointsX)
197 for(Double_t y=0;y<PcSizeY();y+=PcSizeY()/iNpointsY){//step loop
198 TVector3 v3=C(iChamberN)->Pc2Mrs(TVector2(x,y));//from regular grid of local PC points to MRS presentation
199 pChamber->SetPoint(i++,v3.X(),v3.Y(),v3.Z());//Pc plane poing in MRS
200 }//step loop
201 pChamber->SetMarkerSize(1);
202 pChamber->SetMarkerColor(iChamberN);
203 pChamber->Draw();
204 t.SetNDC();t.SetTextColor(iChamberN); t.DrawText(0.1,iChamberN*0.1,Form("Chamber %i",iChamberN));
205 }//chamber loop
206// gPad->GetView()->RotateView(94,45);
207}//TestTrans()
208//__________________________________________________________________________________________________
209void AliRICHParam::DrawAxis()
210{
ae754cdf 211//Utility: draws axis on geometry scene
212 Double_t x[6]={0,0,0,300,0,0}; Double_t y[6]={0,0,0,0,300,0}; Double_t z[6]={0,0,0,0,0,300};
213 TPolyLine3D *pXaxis=new TPolyLine3D(2,x);pXaxis->SetLineColor(kRed); pXaxis->Draw();
214 TPolyLine3D *pYaxis=new TPolyLine3D(2,y);pYaxis->SetLineColor(kGreen); pYaxis->Draw();
215 TPolyLine3D *pZaxis=new TPolyLine3D(2,z);pZaxis->SetLineColor(kBlue); pZaxis->Draw();
a25b3368 216}
d3eb6079 217//__________________________________________________________________________________________________
218void AliRICHParam::DrawSectors()
219{
ae754cdf 220//Utility: draws RICH chamber sectors on event display.
d3eb6079 221 Double_t xLeft[5] = {0,0,SectorSizeX(),SectorSizeX(),0};
222 Double_t xRight[5] = {SectorSizeX()+DeadZone(),SectorSizeX()+DeadZone(),PcSizeX(),PcSizeX(),SectorSizeX()+DeadZone()};
223
224 Double_t yDown[5] = {0,SectorSizeY(),SectorSizeY(),0,0};
225 Double_t yCenter[5] = { SectorSizeY()+DeadZone(),2*SectorSizeY()+DeadZone(),2*SectorSizeY()+DeadZone(),
226 SectorSizeY()+DeadZone(),SectorSizeY()+DeadZone()};
227 Double_t yUp[5] = {2*SectorSizeY()+2*DeadZone(),PcSizeY(),PcSizeY(),2*SectorSizeY()+2*DeadZone(),2*SectorSizeY()+2*DeadZone()};
228
229 TPolyLine *sec1 = new TPolyLine(5,xLeft ,yDown); sec1->SetLineColor(21); sec1->Draw();
230 TPolyLine *sec2 = new TPolyLine(5,xRight,yDown); sec2->SetLineColor(21); sec2->Draw();
231 TPolyLine *sec3 = new TPolyLine(5,xLeft ,yCenter); sec3->SetLineColor(21); sec3->Draw();
232 TPolyLine *sec4 = new TPolyLine(5,xRight,yCenter); sec4->SetLineColor(21); sec4->Draw();
233 TPolyLine *sec5 = new TPolyLine(5,xLeft, yUp); sec5->SetLineColor(21); sec5->Draw();
234 TPolyLine *sec6 = new TPolyLine(5,xRight,yUp); sec6->SetLineColor(21); sec6->Draw();
235}//DrawSectors()