]>
Commit | Line | Data |
---|---|---|
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 | // ************************************************************************** | |
4c039060 | 15 | |
53fd478b | 16 | #include "AliRICH.h" |
17 | #include "AliRICHParam.h" | |
18 | #include "AliRICHChamber.h" | |
d3eb6079 | 19 | #include "AliRICHTracker.h" |
56030c8d | 20 | #include "AliRICHHelix.h" |
d3eb6079 | 21 | //#include <TArrayF.h> |
543d5224 | 22 | #include <TGeometry.h> |
116cbefd | 23 | #include <TBRIK.h> |
543d5224 | 24 | #include <TTUBE.h> |
237c933d | 25 | #include <TFile.h> |
116cbefd | 26 | #include <TNode.h> |
27 | #include <TObjArray.h> | |
3582c1f9 | 28 | #include <TParticle.h> |
29 | #include <AliStack.h> | |
e53ffca5 | 30 | #include <AliHeader.h> |
31 | #include <AliGenEventHeader.h> | |
32 | #include <AliGenHijingEventHeader.h> | |
c60862bf | 33 | #include <AliMagF.h> |
c60862bf | 34 | #include <AliRun.h> |
35 | #include <AliRunDigitizer.h> | |
53fd478b | 36 | #include <AliMC.h> |
e42a7b46 | 37 | #include <AliESD.h> |
5d12ce38 | 38 | #include <TVirtualMC.h> |
e42a7b46 | 39 | #include <TH1F.h> |
40 | #include <TH2F.h> | |
d3eb6079 | 41 | #include <TBenchmark.h> |
998b831f | 42 | #include <AliLog.h> |
d3eb6079 | 43 | #include <TNtupleD.h> |
44 | #include <AliTracker.h> | |
45 | #include <AliRawDataHeader.h> | |
0fe8fa07 | 46 | #include <TLatex.h> //Display() |
47 | #include <TCanvas.h> //Display() | |
56030c8d | 48 | #include <TGraph.h> //Display() |
f770edb5 | 49 | #include <TStyle.h> //Display() |
50 | #include <TMarker.h> //Display() | |
ddae0931 | 51 | |
c60862bf | 52 | ClassImp(AliRICH) |
53 | //__________________________________________________________________________________________________ | |
15d8311d | 54 | // RICH manager class |
c60862bf | 55 | //BEGIN_HTML |
15d8311d | 56 | /* |
57 | <img src="gif/alirich.gif"> | |
58 | */ | |
c60862bf | 59 | //END_HTML |
60 | //__________________________________________________________________________________________________ | |
0fe8fa07 | 61 | AliRICH::AliRICH():AliDetector(),fParam(0), fSdigits(0),fNsdigits(0),fDigs(0),fClus(0) |
53fd478b | 62 | { |
63 | //Default ctor should not contain any new operators | |
543d5224 | 64 | //AliDetector ctor deals with Hits and Digits |
0fe8fa07 | 65 | for(int i=0;i<kNchambers;i++) fNdigs[i] =0; |
66 | for(int i=0;i<kNchambers;i++) fNclus[i]=0; | |
e42a7b46 | 67 | // fCounters.ResizeTo(20); fCounters.Zero(); |
15d8311d | 68 | }//AliRICH::AliRICH() |
c021cb15 | 69 | //__________________________________________________________________________________________________ |
fe4da5cc | 70 | AliRICH::AliRICH(const char *name, const char *title) |
0fe8fa07 | 71 | :AliDetector(name,title),fParam(new AliRICHParam),fSdigits(0),fNsdigits(0),fDigs(0),fClus(0) |
53fd478b | 72 | { |
73 | //Named ctor | |
998b831f | 74 | AliDebug(1,"Start."); |
543d5224 | 75 | //AliDetector ctor deals with Hits and Digits (reset them to 0, does not create them) |
0fe8fa07 | 76 | HitsCreate(); gAlice->GetMCApp()->AddHitList(fHits); |
e42a7b46 | 77 | fCounters.ResizeTo(20); fCounters.Zero(); |
998b831f | 78 | AliDebug(1,"Stop."); |
dfb4e77d | 79 | }//AliRICH::AliRICH(const char *name, const char *title) |
c021cb15 | 80 | //__________________________________________________________________________________________________ |
fe4da5cc | 81 | AliRICH::~AliRICH() |
53fd478b | 82 | { |
83 | //dtor | |
998b831f | 84 | AliDebug(1,"Start."); |
237c933d | 85 | |
0fe8fa07 | 86 | if(fParam) delete fParam; |
c60862bf | 87 | |
88 | if(fHits) delete fHits; | |
89 | if(fSdigits) delete fSdigits; | |
90 | if(fDigits) delete fDigits; | |
0fe8fa07 | 91 | if(fDigs) {fDigs->Delete(); delete fDigs;} |
92 | if(fClus) {fClus->Delete(); delete fClus;} | |
998b831f | 93 | AliDebug(1,"Stop."); |
dfb4e77d | 94 | }//AliRICH::~AliRICH() |
c021cb15 | 95 | //__________________________________________________________________________________________________ |
3ea9cb08 | 96 | void AliRICH::Hits2SDigits() |
53fd478b | 97 | { |
3582c1f9 | 98 | // Create a list of sdigits corresponding to list of hits. Every hit generates one or more sdigits. |
998b831f | 99 | AliDebug(1,"Start."); |
3582c1f9 | 100 | for(Int_t iEventN=0;iEventN<GetLoader()->GetRunLoader()->GetAliRun()->GetEventsPerRun();iEventN++){//events loop |
e42a7b46 | 101 | GetLoader()->GetRunLoader()->GetEvent(iEventN);//get next event |
3582c1f9 | 102 | |
e42a7b46 | 103 | if(!GetLoader()->TreeH()) GetLoader()->LoadHits(); GetLoader()->GetRunLoader()->LoadHeader(); |
d0831219 | 104 | if(!GetLoader()->GetRunLoader()->TreeK()) GetLoader()->GetRunLoader()->LoadKinematics();//from |
e42a7b46 | 105 | if(!GetLoader()->TreeS()) GetLoader()->MakeTree("S"); MakeBranch("S");//to |
3582c1f9 | 106 | |
107 | for(Int_t iPrimN=0;iPrimN<GetLoader()->TreeH()->GetEntries();iPrimN++){//prims loop | |
e42a7b46 | 108 | GetLoader()->TreeH()->GetEntry(iPrimN); |
3582c1f9 | 109 | for(Int_t iHitN=0;iHitN<Hits()->GetEntries();iHitN++){//hits loop |
0fe8fa07 | 110 | AliRICHHit *pHit=(AliRICHHit*)Hits()->At(iHitN);//get current hit |
d3eb6079 | 111 | TVector2 x2 = C(pHit->C())->Mrs2Anod(0.5*(pHit->InX3()+pHit->OutX3()));//hit position in the anod plane |
e42a7b46 | 112 | Int_t iTotQdc=P()->TotQdc(x2,pHit->Eloss());//total charge produced by hit, 0 if hit in dead zone |
09c52ebc | 113 | if(iTotQdc==0) continue; |
1cb5a97c | 114 | // |
115 | //need to quantize the anod.... | |
116 | TVector padHit=AliRICHParam::Loc2Pad(x2); | |
117 | TVector2 padHitXY=AliRICHParam::Pad2Loc(padHit); | |
118 | TVector2 anod; | |
119 | if((x2.Y()-padHitXY.Y())>0) anod.Set(x2.X(),padHitXY.Y()+AliRICHParam::PitchAnod()/2); | |
120 | else anod.Set(x2.X(),padHitXY.Y()-AliRICHParam::PitchAnod()/2); | |
121 | //end to quantize anod | |
122 | // | |
123 | TVector area=P()->Loc2Area(anod);//determine affected pads, dead zones analysed inside | |
124 | AliDebug(1,Form("hitanod(%6.2f,%6.2f)->area(%3.0f,%3.0f)-(%3.0f,%3.0f) QDC=%4i",anod.X(),anod.Y(),area[0],area[1],area[2],area[3],iTotQdc)); | |
e42a7b46 | 125 | TVector pad(2); |
126 | for(pad[1]=area[1];pad[1]<=area[3];pad[1]++)//affected pads loop | |
127 | for(pad[0]=area[0];pad[0]<=area[2];pad[0]++){ | |
1cb5a97c | 128 | Double_t padQdc=iTotQdc*P()->FracQdc(anod,pad); |
998b831f | 129 | AliDebug(1,Form("current pad(%3.0f,%3.0f) with QDC =%6.2f",pad[0],pad[1],padQdc)); |
0fe8fa07 | 130 | if(padQdc>0.1) SDigitAdd(pHit->C(),pad,padQdc,GetLoader()->GetRunLoader()->Stack()->Particle(pHit->GetTrack())->GetPdgCode(),pHit->GetTrack()); |
3582c1f9 | 131 | }//affected pads loop |
132 | }//hits loop | |
133 | }//prims loop | |
e42a7b46 | 134 | GetLoader()->TreeS()->Fill(); |
135 | GetLoader()->WriteSDigits("OVERWRITE"); | |
d0831219 | 136 | SDigitsReset(); |
3582c1f9 | 137 | }//events loop |
e42a7b46 | 138 | GetLoader()->UnloadHits(); GetLoader()->GetRunLoader()->UnloadHeader(); GetLoader()->GetRunLoader()->UnloadKinematics(); |
3582c1f9 | 139 | GetLoader()->UnloadSDigits(); |
998b831f | 140 | AliDebug(1,"Stop."); |
3582c1f9 | 141 | }//Hits2SDigits() |
c021cb15 | 142 | //__________________________________________________________________________________________________ |
d3eb6079 | 143 | void AliRICH::Digits2Raw() |
144 | { | |
145 | //Loops over all digits and creates raw data files in DDL format. GetEvent() is done outside (AliSimulation) | |
0fe8fa07 | 146 | //RICH has 2 DDL per chamber, even number for right part(2-4-6) odd number for left part(1-3-5) |
147 | //RICH has no any propriate header just uses the common one | |
148 | //Each PC is divided by 8 rows counted from 1 to 8 from top to bottom for left PCs(1-3-5) and from bottom to top for right PCc(2-4-6) (denoted rrrrr 5 bits 32 values) | |
149 | //Each raw is composed from 10 DILOGIC chips counted from left to right from 1 to 10 (denoted dddd 4 bits 16 values) | |
150 | //Each DILOGIC chip serves 48 channels counted from 0 to 47 (denoted aaaaaa 6 bits 64 values) | |
151 | //So RICH info word is 32 bits word with structure: 0000 0rrr rrdd ddaa aaaa qqqq qqqq qqqq (five 0 five r six a twelve q) with QDC (denoted q...q 12 bits 4096 values) | |
d3eb6079 | 152 | AliDebug(1,"Start."); |
153 | GetLoader()->LoadDigits(); | |
154 | GetLoader()->TreeD()->GetEntry(0); | |
155 | ||
156 | Int_t kRichOffset=0x700; //currently one DDL per 3 sectors | |
157 | ||
158 | ofstream file135,file246;//output streams 2 DDL per chamber | |
159 | AliRawDataHeader header;//empty DDL miniheader | |
160 | UInt_t word32=1; //32 bits data word | |
161 | ||
162 | for(Int_t iChN=1;iChN<=kNchambers;iChN++){ //2 DDL per chamber open both in parallel | |
0fe8fa07 | 163 | file135.open(Form("RICH_%4i.ddl",kRichOffset+2*iChN-1)); //left part of chamber; sectors 1-3-5 odd DDL number |
164 | file246.open(Form("RICH_%4i.ddl",kRichOffset+2*iChN)); //right part of chamber; sectors 2-4-6 even DDL number | |
d3eb6079 | 165 | //common DDL header defined by standart, now dummy as the total number of bytes is not yet known |
166 | file135.write((char*)&header,sizeof(header)); //dummy header just place holder | |
167 | file246.write((char*)&header,sizeof(header)); //actual will be written later | |
d3eb6079 | 168 | |
169 | Int_t counter135=0,counter246=0;//counts total number of records per DDL | |
170 | ||
171 | for(Int_t iDigN=0;iDigN<Digits(iChN)->GetEntriesFast();iDigN++){//digits loop for a given chamber | |
0fe8fa07 | 172 | AliRICHDigit *pDig=(AliRICHDigit*)Digits(iChN)->At(iDigN); |
173 | word32=UInt_t (pDig->Q()+0x400*pDig->X()+0x4000*pDig->Y()); //arbitrary structure | |
d3eb6079 | 174 | switch(pDig->S()){//readout by vertical sectors: 1,3,5-left DDL 2,4,6-right DDL |
175 | case 1: case 3: case 5: file135.write((char*)&word32,sizeof(word32)); counter135++; break; | |
176 | case 2: case 4: case 6: file246.write((char*)&word32,sizeof(word32)); counter246++; break; | |
177 | }//switch sector | |
178 | }//digits loop for a given chamber | |
179 | //now count total byte number for each DDL file and rewrite actual header | |
180 | header.fSize=sizeof(header)+counter135*sizeof(word32); header.SetAttribute(0); file135.seekp(0); file135.write((char*)&header,sizeof(header)); | |
181 | header.fSize=sizeof(header)+counter246*sizeof(word32); header.SetAttribute(0); file246.seekp(0); file246.write((char*)&header,sizeof(header)); | |
182 | file135.close(); file246.close(); | |
183 | }//chambers loop | |
184 | GetLoader()->UnloadDigits(); | |
185 | AliDebug(1,"Stop."); | |
186 | }//Digits2Raw() | |
187 | //__________________________________________________________________________________________________ | |
dfb4e77d | 188 | void AliRICH::BuildGeometry() |
53fd478b | 189 | { |
190 | //Builds a TNode geometry for event display | |
998b831f | 191 | AliInfo("Start."); |
237c933d | 192 | |
3ea9cb08 | 193 | TNode *node, *subnode, *top; |
194 | top=gAlice->GetGeometry()->GetNode("alice"); | |
53d98323 | 195 | |
a25b3368 | 196 | Float_t widx =P()->SectorSizeX(); |
197 | Float_t leny =P()->SectorSizeY(); | |
198 | Float_t dz =P()->Zfreon()+P()->Zwin()+P()->Pc2Win(); | |
199 | Float_t dead =P()->DeadZone(); | |
998b831f | 200 | |
201 | new TBRIK("RICH","RICH","void",widx+dead/2,leny+leny/2+dead,dz+0.1); //RICH chamber | |
202 | new TBRIK("RPC" ,"RPC" ,"void",widx/2,leny/2,0.01); //RICH sector | |
203 | ||
a25b3368 | 204 | for(int i=1;i<=P()->Nchambers();i++){ |
237c933d | 205 | top->cd(); |
998b831f | 206 | node = new TNode(Form("RICH%i",i),Form("RICH%i",i),"RICH",C(i)->Center().X(),C(i)->Center().Y(),C(i)->Center().Z(),C(i)->RotMatrixName()); |
3ea9cb08 | 207 | node->SetLineColor(kRed); |
91975aa2 | 208 | node->cd(); |
998b831f | 209 | subnode = new TNode("PHOTO1","PHOTO1","RPC",-widx/2-dead/2,-leny-dead/2,dz,""); |
91975aa2 | 210 | subnode->SetLineColor(kGreen); |
211 | fNodes->Add(subnode); | |
998b831f | 212 | subnode = new TNode("PHOTO1","PHOTO1","RPC", widx/2+dead/2,-leny-dead/2,dz,""); |
91975aa2 | 213 | subnode->SetLineColor(kGreen); |
214 | fNodes->Add(subnode); | |
998b831f | 215 | subnode = new TNode("PHOTO1","PHOTO1","RPC",-widx/2-dead/2, 0,dz,""); |
91975aa2 | 216 | subnode->SetLineColor(kGreen); |
217 | fNodes->Add(subnode); | |
998b831f | 218 | subnode = new TNode("PHOTO1","PHOTO1","RPC", widx/2+dead/2, 0,dz,""); |
91975aa2 | 219 | subnode->SetLineColor(kGreen); |
220 | fNodes->Add(subnode); | |
998b831f | 221 | subnode = new TNode("PHOTO1","PHOTO1","RPC",-widx/2-dead/2, leny+dead/2,dz,""); |
91975aa2 | 222 | subnode->SetLineColor(kGreen); |
223 | fNodes->Add(subnode); | |
998b831f | 224 | subnode = new TNode("PHOTO1","PHOTO1","RPC", widx/2+dead/2, leny+dead/2,dz,""); |
91975aa2 | 225 | subnode->SetLineColor(kGreen); |
226 | fNodes->Add(subnode); | |
237c933d | 227 | fNodes->Add(node); |
998b831f | 228 | } |
229 | ||
230 | AliDebug(1,"Stop."); | |
dfb4e77d | 231 | }//void AliRICH::BuildGeometry() |
a25b3368 | 232 | //__________________________________________________________________________________________________ |
452a64c6 | 233 | void AliRICH::CreateMaterials() |
234 | { | |
e42a7b46 | 235 | // Definition of available RICH materials |
af3d25a6 | 236 | |
998b831f | 237 | Int_t material=0; //tmp material id number |
238 | Float_t a=0,z=0,den=0,radl=0,absl=0; //tmp material parameters | |
a25b3368 | 239 | |
c60862bf | 240 | Float_t tmaxfd=-10.0, deemax=-0.2, stemax=-0.1,epsil=0.001, stmin=-0.001; |
241 | Int_t isxfld = gAlice->Field()->Integ(); | |
242 | Float_t sxmgmx = gAlice->Field()->Max(); | |
452a64c6 | 243 | |
a25b3368 | 244 | Float_t aAir[4]={12,14,16,36}; Float_t zAir[4]={6,7,8,18}; Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};//total 0.9999999 |
998b831f | 245 | AliMixture(++material, "RichAir",aAir,zAir,den=0.00120479,4,wAir); //1 (Air) 0.01% C 75% N 23% O 1% Ar |
246 | AliMedium(kAir, "RichAir",material, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); | |
452a64c6 | 247 | |
a25b3368 | 248 | AliMixture(++material, "RichAerogel",aAir,zAir,den=P()->DenGel(),4,wAir); //Aerogel represented by Air |
249 | AliMedium(kGel, "RichAerogel",material, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); | |
250 | ||
251 | AliMixture(++material, "RichAerogelReflector",aAir,zAir,den=P()->DenGel(),4,wAir); //Aerogel reflector represented by Air | |
252 | AliMedium(kReflector, "RichAerogelReflector",material, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); | |
253 | ||
998b831f | 254 | AliMaterial(++material, "RichRohacell", a=12.01,z=6.0, den=0.1, radl=18.8, absl=0); //2 Rohacell 51 C-equiv radl rad cover |
255 | AliMedium(kRoha, "RichRohacell", material, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); | |
c60862bf | 256 | |
998b831f | 257 | Float_t aQuartz[2]={28.09,16.0}; Float_t zQuartz[2]={14.00, 8.0}; Float_t wQuartz[2]={1,2}; |
258 | AliMixture(++material, "RichSiO2",aQuartz,zQuartz,den=2.64,-2, wQuartz); //3 Quarz (SiO2) -trasparent rad window | |
259 | AliMedium(kSiO2, "RichSiO2",material, 1, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); | |
c60862bf | 260 | |
a25b3368 | 261 | Float_t aFreon[2]={12,19}; Float_t zFreon[2]={6,9}; Float_t wmatFreon[2]={6,14}; // C12-6 F19-9 |
998b831f | 262 | AliMixture(++material, "RichC6F14",aFreon,zFreon,den=1.68,-2,wmatFreon); //4 Freon (C6F14) |
263 | AliMedium(kC6F14, "RichC6F14",material, 1, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); | |
264 | ||
265 | Float_t aMethane[2]={12.01,1}; Float_t zMethane[2]={6,1}; Float_t wMethane[2]={1,4}; | |
266 | AliMixture (++material, "RichCH4", aMethane, zMethane, den=7.17e-4,-2, wMethane); //5,9 methane (CH4) normal and for Gap | |
267 | AliMedium(kCH4, "RichCH4" , material, 1, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); | |
a25b3368 | 268 | AliMixture (++material, "RichCH4gap", aMethane, zMethane, den=7.17e-4,-2, wMethane); //5,9 methane (CH4) normal and for Gap |
269 | AliMedium(kGap, "RichCH4gap", material, 1, isxfld, sxmgmx, tmaxfd, 0.1 , -deemax, epsil, -stmin); | |
998b831f | 270 | |
271 | AliMaterial(++material, "RichCsI", a=12.01,z=6.0, den=0.1, radl=18.8, absl=0); //6 CsI-radl equivalent | |
a25b3368 | 272 | AliMedium(kCsI, "RichCsI", material, 1, isxfld, sxmgmx,tmaxfd, stemax, deemax, epsil, stmin); |
c60862bf | 273 | |
a25b3368 | 274 | AliMaterial(++material, "RichGridCu", a=63.54,z=29.0,den=8.96, radl=1.43, absl=0); //7 anode grid (Cu) |
275 | AliMedium(kGridCu, "RichGridCu", material, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); | |
276 | ||
277 | AliMaterial(++material, "RichPcbCu", a=63.54,z=29.0,den=8.96, radl=1.4, absl=0); //12 Cu | |
278 | AliMedium(kCu, "RichPcbCu", material, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); | |
c60862bf | 279 | |
a25b3368 | 280 | AliMixture (++material, "RichOpSiO2",aQuartz, zQuartz, den=2.64, -2, wQuartz); //8 Quarz (SiO2) - opaque |
281 | AliMedium(kOpSiO2, "RichOpSiO2",material, 1, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); | |
c60862bf | 282 | |
a25b3368 | 283 | AliMaterial(++material, "RichAl", a=26.98,z=13.0,den=2.699, radl=8.9, absl=0); //10 aluminium sheet (Al) |
284 | AliMedium(kAl, "RichAl", material, 1, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); | |
c60862bf | 285 | |
998b831f | 286 | Float_t aGlass[5]={12.01,28.09,16,10.8,23}; Float_t zGlass[5]={6,14,8,5,11}; Float_t wGlass[5]={0.5,0.105,0.355,0.03,0.01}; |
a25b3368 | 287 | AliMixture(++material,"RichGlass",aGlass, zGlass, den=1.74, 5, wGlass); //11 Glass 50%-C 10.5%-Si 35.5%-O 3%-B 1%-Na |
288 | AliMedium(kGlass, "RichGlass", material, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); | |
998b831f | 289 | |
a25b3368 | 290 | AliMaterial(++material, "RichW", a=183.84,z=74.0,den=19.3, radl=0.35, absl=185.0/den); //13 W - anod wires |
291 | AliMedium(kW, "RichW", material, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); | |
c60862bf | 292 | |
e42a7b46 | 293 | |
294 | if(P()->IsRadioSrc()){ | |
998b831f | 295 | AliInfo("Special radioactive source materials"); |
a25b3368 | 296 | AliMaterial(++material, "RichSteel", a=55.845,z=26.0,den=7.87, radl=1.76, absl=131.9/den); //14 Steel (Fe) |
297 | AliMedium(kSteel, "RichSteel", material, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); | |
c60862bf | 298 | |
a25b3368 | 299 | AliMaterial(++material, "RichPerpex", a=63.54,z=29.0,den=8.96, radl=1.4, absl=0); //15 Perpex |
300 | AliMedium(kPerpex, "RichPerpex", material, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); | |
e42a7b46 | 301 | |
a25b3368 | 302 | AliMaterial(++material, "RichSr90", a=87.62,z=38.0,den=2.54, radl=4.24, absl=0); //16 Sr90 |
303 | AliMedium(kSr90, "RichSr90", material, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); | |
304 | ||
305 | Float_t aMylar[5]={12.01,1,16}; Float_t zMylar[5]={6,1,8}; Float_t wMylar[5]={5,4,5}; //17 Mylar C5H4O5 | |
306 | AliMixture(++material,"RichMylar",aMylar, zMylar, den=1.39, -3, wMylar); | |
307 | AliMedium(kMylar, "RichMylar", material, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); | |
e42a7b46 | 308 | } |
c60862bf | 309 | |
998b831f | 310 | //Optical properties: |
311 | #include "Opticals.h" | |
a25b3368 | 312 | gMC->SetCerenkov((*fIdtmed)[kAir] , kNbins, aPckov, aAbsCH4 , aQeAll, aIdxCH4); //1 Air |
313 | gMC->SetCerenkov((*fIdtmed)[kRoha] , kNbins, aPckov, aAbsCH4 , aQeAll, aIdxCH4); //2 Honeycomb | |
314 | gMC->SetCerenkov((*fIdtmed)[kSiO2] , kNbins, aPckov, aAbsSiO2 , aQeAll, aIdxSiO2); //3 Quartz SiO2 | |
315 | gMC->SetCerenkov((*fIdtmed)[kC6F14] , kNbins, aPckov, aAbsC6F14 , aQeAll, aIdxC6F14); //4 Freon C6F14 | |
316 | gMC->SetCerenkov((*fIdtmed)[kCH4] , kNbins, aPckov, aAbsCH4 , aQeAll, aIdxCH4); //5 Methane CH4 | |
317 | gMC->SetCerenkov((*fIdtmed)[kCsI] , kNbins, aPckov, aAbsCsI , aQeCsI, aIdxCH4); //6 CsI | |
318 | gMC->SetCerenkov((*fIdtmed)[kGridCu] , kNbins, aPckov, aAbsGrid , aQeAll, aIdxMetal); //7 grid Cu | |
319 | gMC->SetCerenkov((*fIdtmed)[kOpSiO2] , kNbins, aPckov, aAbsOpSiO2 , aQeAll, aIdxMetal); //8 Opaque quartz SiO2 | |
320 | gMC->SetCerenkov((*fIdtmed)[kGap] , kNbins, aPckov, aAbsCH4 , aQeAll, aIdxCH4); //9 Special methane gap | |
321 | gMC->SetCerenkov((*fIdtmed)[kAl] , kNbins, aPckov, aAbsGrid , aQeAll, aIdxMetal); //10 Aluminium | |
322 | gMC->SetCerenkov((*fIdtmed)[kGlass] , kNbins, aPckov, aAbsOpSiO2 , aQeAll, aIdxMetal); //11 Glass | |
323 | gMC->SetCerenkov((*fIdtmed)[kGel] , kNbins, aPckov, aAbsGel , aQeAll, aIdxGel); //12 Aerogel | |
324 | gMC->SetCerenkov((*fIdtmed)[kReflector], kNbins, aPckov, aAbsRef , aQeAll, aIdxMetal); //13 Aerogel reflector | |
c60862bf | 325 | }//void AliRICH::CreateMaterials() |
c021cb15 | 326 | //__________________________________________________________________________________________________ |
a25b3368 | 327 | Float_t AliRICH::Fresnel(Float_t ene,Float_t pdoti, Bool_t pola) |
452a64c6 | 328 | { |
329 | ||
330 | //ENE(EV), PDOTI=COS(INC.ANG.), PDOTR=COS(POL.PLANE ROT.ANG.) | |
331 | ||
332 | Float_t en[36] = {5.0,5.1,5.2,5.3,5.4,5.5,5.6,5.7,5.8,5.9,6.0,6.1,6.2, | |
333 | 6.3,6.4,6.5,6.6,6.7,6.8,6.9,7.0,7.1,7.2,7.3,7.4,7.5,7.6,7.7, | |
334 | 7.8,7.9,8.0,8.1,8.2,8.3,8.4,8.5}; | |
452a64c6 | 335 | Float_t csin[36] = {2.14,2.21,2.33,2.48,2.76,2.97,2.99,2.59,2.81,3.05, |
336 | 2.86,2.53,2.55,2.66,2.79,2.96,3.18,3.05,2.84,2.81,2.38,2.11, | |
337 | 2.01,2.13,2.39,2.73,3.08,3.15,2.95,2.73,2.56,2.41,2.12,1.95, | |
338 | 1.72,1.53}; | |
452a64c6 | 339 | Float_t csik[36] = {0.,0.,0.,0.,0.,0.196,0.408,0.208,0.118,0.49,0.784,0.543, |
340 | 0.424,0.404,0.371,0.514,0.922,1.102,1.139,1.376,1.461,1.253,0.878, | |
341 | 0.69,0.612,0.649,0.824,1.347,1.571,1.678,1.763,1.857,1.824,1.824, | |
342 | 1.714,1.498}; | |
343 | Float_t xe=ene; | |
344 | Int_t j=Int_t(xe*10)-49; | |
345 | Float_t cn=csin[j]+((csin[j+1]-csin[j])/0.1)*(xe-en[j]); | |
346 | Float_t ck=csik[j]+((csik[j+1]-csik[j])/0.1)*(xe-en[j]); | |
347 | ||
348 | //FORMULAE FROM HANDBOOK OF OPTICS, 33.23 OR | |
349 | //W.R. HUNTER, J.O.S.A. 54 (1964),15 , J.O.S.A. 55(1965),1197 | |
350 | ||
351 | Float_t sinin=TMath::Sqrt(1-pdoti*pdoti); | |
352 | Float_t tanin=sinin/pdoti; | |
353 | ||
354 | Float_t c1=cn*cn-ck*ck-sinin*sinin; | |
355 | Float_t c2=4*cn*cn*ck*ck; | |
356 | Float_t aO=TMath::Sqrt(0.5*(TMath::Sqrt(c1*c1+c2)+c1)); | |
357 | Float_t b2=0.5*(TMath::Sqrt(c1*c1+c2)-c1); | |
358 | ||
359 | Float_t rs=((aO-pdoti)*(aO-pdoti)+b2)/((aO+pdoti)*(aO+pdoti)+b2); | |
360 | Float_t rp=rs*((aO-sinin*tanin)*(aO-sinin*tanin)+b2)/((aO+sinin*tanin)*(aO+sinin*tanin)+b2); | |
361 | ||
362 | ||
363 | //CORRECTION FACTOR FOR SURFACE ROUGHNESS | |
364 | //B.J. STAGG APPLIED OPTICS, 30(1991),4113 | |
365 | ||
366 | Float_t sigraf=18.; | |
367 | Float_t lamb=1240/ene; | |
368 | Float_t fresn; | |
369 | ||
370 | Float_t rO=TMath::Exp(-(4*TMath::Pi()*pdoti*sigraf/lamb)*(4*TMath::Pi()*pdoti*sigraf/lamb)); | |
371 | ||
372 | if(pola) | |
373 | { | |
374 | Float_t pdotr=0.8; //DEGREE OF POLARIZATION : 1->P , -1->S | |
375 | fresn=0.5*(rp*(1+pdotr)+rs*(1-pdotr)); | |
376 | } | |
377 | else | |
378 | fresn=0.5*(rp+rs); | |
379 | ||
380 | fresn = fresn*rO; | |
381 | return(fresn); | |
53fd478b | 382 | }//Fresnel() |
c021cb15 | 383 | //__________________________________________________________________________________________________ |
dfb4e77d | 384 | void AliRICH::MakeBranch(Option_t* option) |
53fd478b | 385 | { |
386 | //Create Tree branches for the RICH. | |
998b831f | 387 | AliDebug(1,Form("Start with option= %s.",option)); |
dfb4e77d | 388 | |
389 | const Int_t kBufferSize = 4000; | |
dfb4e77d | 390 | |
dfb4e77d | 391 | const char *cH = strstr(option,"H"); |
392 | const char *cD = strstr(option,"D"); | |
393 | const char *cR = strstr(option,"R"); | |
394 | const char *cS = strstr(option,"S"); | |
395 | ||
c60862bf | 396 | if(cH&&TreeH()){//H |
0fe8fa07 | 397 | HitsCreate(); //branch will be created in AliDetector::MakeBranch |
c60862bf | 398 | }//H |
dfb4e77d | 399 | AliDetector::MakeBranch(option);//this is after cH because we need to guarantee that fHits array is created |
400 | ||
c60862bf | 401 | if(cS&&fLoader->TreeS()){//S |
0fe8fa07 | 402 | SDigitsCreate(); MakeBranchInTree(fLoader->TreeS(),"RICH",&fSdigits,kBufferSize,0) ; |
c60862bf | 403 | }//S |
dfb4e77d | 404 | |
c60862bf | 405 | if(cD&&fLoader->TreeD()){//D |
0fe8fa07 | 406 | DigitsCreate(); |
e42a7b46 | 407 | for(Int_t i=0;i<kNchambers;i++){ |
0fe8fa07 | 408 | MakeBranchInTree(fLoader->TreeD(),Form("%s%d",GetName(),i+1),&((*fDigs)[i]),kBufferSize,0); |
543d5224 | 409 | } |
c60862bf | 410 | }//D |
411 | ||
412 | if(cR&&fLoader->TreeR()){//R | |
0fe8fa07 | 413 | ClustersCreate(); |
e42a7b46 | 414 | for(Int_t i=0;i<kNchambers;i++) |
0fe8fa07 | 415 | MakeBranchInTree(fLoader->TreeR(),Form("%sClusters%d",GetName(),i+1), &((*fClus)[i]), kBufferSize, 0); |
cb8189e7 | 416 | }//R |
998b831f | 417 | AliDebug(1,"Stop."); |
c021cb15 | 418 | }//void AliRICH::MakeBranch(Option_t* option) |
c60862bf | 419 | //__________________________________________________________________________________________________ |
dfb4e77d | 420 | void AliRICH::SetTreeAddress() |
53fd478b | 421 | { |
422 | //Set branch address for the Hits and Digits Tree. | |
998b831f | 423 | AliDebug(1,"Start."); |
c60862bf | 424 | |
dfb4e77d | 425 | TBranch *branch; |
dfb4e77d | 426 | |
c60862bf | 427 | if(fLoader->TreeH()){//H |
998b831f | 428 | AliDebug(1,"tree H is requested."); |
0fe8fa07 | 429 | HitsCreate();//branch map will be in AliDetector::SetTreeAddress |
c60862bf | 430 | }//H |
c021cb15 | 431 | AliDetector::SetTreeAddress();//this is after TreeH because we need to guarantee that fHits array is created |
432 | ||
c60862bf | 433 | if(fLoader->TreeS()){//S |
998b831f | 434 | AliDebug(1,"tree S is requested."); |
0fe8fa07 | 435 | branch=fLoader->TreeS()->GetBranch(GetName()); if(branch){SDigitsCreate(); branch->SetAddress(&fSdigits);} |
c60862bf | 436 | }//S |
dfb4e77d | 437 | |
c60862bf | 438 | if(fLoader->TreeD()){//D |
998b831f | 439 | AliDebug(1,"tree D is requested."); |
e42a7b46 | 440 | for(int i=0;i<kNchambers;i++){ |
c60862bf | 441 | branch=fLoader->TreeD()->GetBranch(Form("%s%d",GetName(),i+1)); |
0fe8fa07 | 442 | if(branch){DigitsCreate(); branch->SetAddress(&((*fDigs)[i]));} |
aed240d4 | 443 | } |
c60862bf | 444 | }//D |
dfb4e77d | 445 | |
c60862bf | 446 | if(fLoader->TreeR()){//R |
998b831f | 447 | AliDebug(1,"tree R is requested."); |
e42a7b46 | 448 | for(int i=0;i<kNchambers;i++){ |
c60862bf | 449 | branch=fLoader->TreeR()->GetBranch(Form("%sClusters%d" ,GetName(),i+1)); |
0fe8fa07 | 450 | if(branch){ClustersCreate(); branch->SetAddress(&((*fClus)[i]));} |
dfb4e77d | 451 | } |
c60862bf | 452 | }//R |
998b831f | 453 | AliDebug(1,"Stop."); |
dfb4e77d | 454 | }//void AliRICH::SetTreeAddress() |
c021cb15 | 455 | //__________________________________________________________________________________________________ |
dfb4e77d | 456 | void AliRICH::Print(Option_t *option)const |
457 | { | |
53fd478b | 458 | //Debug printout |
dfb4e77d | 459 | TObject::Print(option); |
e42a7b46 | 460 | P()->Print(); |
461 | fCounters.Print(); | |
dfb4e77d | 462 | }//void AliRICH::Print(Option_t *option)const |
c021cb15 | 463 | //__________________________________________________________________________________________________ |
e42a7b46 | 464 | void AliRICH::ControlPlots() |
465 | { | |
d3eb6079 | 466 | //Creates a set of QA hists to control the results of simulation. Hists are in file $HOME/RCP.root |
a25b3368 | 467 | TH1F *pElecP=0 ,*pMuonP=0 ,*pPionP=0 ,*pKaonP=0 ,*pProtP=0, //stack particles |
d3eb6079 | 468 | *pHxD=0,*pHyD=0,*pHxSd=0,*pHySd=0, //diff hit position - digit sdigit position |
469 | *pNumClusH1=0, | |
e42a7b46 | 470 | *pQdcH1=0, *pSizeH1=0, |
471 | *pPureMipQdcH1=0,*pPureMipSizeH1=0, | |
472 | *pPureCerQdcH1=0,*pPureCerSizeH1=0, | |
473 | *pPureFeeQdcH1=0,*pPureFeeSizeH1=0, | |
474 | *pMipQdcH1=0, *pPhotQdcH1=0; | |
475 | TH2F *pMapH2=0,*pPureMipMapH2=0,*pPureCerMapH2=0,*pPureFeeMapH2=0; | |
d3eb6079 | 476 | TH1F *pelecRadius=0,*pprotRadius=0,*pprotbarRadius=0; |
477 | //load all information | |
478 | GetLoader()->GetRunLoader()->LoadHeader(); | |
479 | GetLoader()->GetRunLoader()->LoadKinematics(); | |
480 | GetLoader()->LoadHits(); | |
481 | Bool_t isSdig=0;//!GetLoader()->LoadSDigits(); | |
482 | Bool_t isDig =0;//!GetLoader()->LoadDigits(); | |
e42a7b46 | 483 | Bool_t isClus=!GetLoader()->LoadRecPoints(); |
484 | ||
d3eb6079 | 485 | gBenchmark->Start("ControlPlots"); |
c021cb15 | 486 | |
e42a7b46 | 487 | TFile *pFile = new TFile("$(HOME)/RCP.root","RECREATE"); |
d3eb6079 | 488 | |
489 | pElecP=new TH1F("Pelec","Electrons made hit in RICH;p [GeV]",1000,-30,30); | |
490 | pMuonP=new TH1F("Pmuon","Muons made hit in RICH;p [GeV]",1000,-30,30); | |
491 | pPionP=new TH1F("Ppion","Pions made hit in RICH;p [GeV]",1000,-30,30); | |
492 | pKaonP=new TH1F("Pkaon","Kaon made hit in RICH;p [GeV]",1000,-30,30); | |
493 | pProtP=new TH1F("Pprot","Protons made hit in RICH;p [GeV]",1000,-30,30); | |
494 | pelecRadius=new TH1F("elecRadius","elec",600,0.,600.); | |
495 | pprotRadius=new TH1F("protRadius","elec",600,0.,600.); | |
496 | pprotbarRadius=new TH1F("protbarRadius","elec",600,0.,600.); | |
497 | ||
498 | if(isSdig){ | |
499 | AliInfo("SDigits available"); | |
500 | pHxSd=new TH1F("DiffHitSDigitX","Hit-SDigit diff X all chambers;diff [cm]",300,-10,10); | |
501 | pHySd=new TH1F("DiffHitSDigitY","Hit-SDigit diff Y all chambers;diff [cm]",300,-10,10); | |
502 | }//isSdig | |
e42a7b46 | 503 | |
504 | if(isDig){ | |
998b831f | 505 | AliInfo("Digits available"); |
d3eb6079 | 506 | pHxD=new TH1F("DiffHitDigitX","Hit-Digit diff X all chambers;diff [cm]",300,-10,10); |
507 | pHyD=new TH1F("DiffHitDigitY","Hit-Digit diff Y all chambers;diff [cm]",300,-10,10); | |
e42a7b46 | 508 | }//isDig |
509 | ||
510 | if(isClus){ | |
a25b3368 | 511 | AliInfo("Clusters available"); |
e42a7b46 | 512 | pNumClusH1=new TH1F("NumClusPerEvent","Number of clusters per event;number",50,0,49); |
c021cb15 | 513 | |
a25b3368 | 514 | pQdcH1 =new TH1F("ClusQdc", "Cluster Charge all chambers;q [QDC]",P()->MaxQdc(),0,P()->MaxQdc()); |
e42a7b46 | 515 | pSizeH1 =new TH1F("ClusSize", "Cluster size all chambers;size [number of pads in cluster]",100,0,100); |
a25b3368 | 516 | pMapH2 =new TH2F("ClusMap", "Cluster map;x [cm];y [cm]",1000,0,P()->PcSizeX(),1000,0,P()->PcSizeY()); |
e42a7b46 | 517 | |
a25b3368 | 518 | pMipQdcH1 =new TH1F("QdcMip" ,"MIP Cluster Charge all chambers;q [QDC]",P()->MaxQdc(),0,P()->MaxQdc()); |
519 | pPhotQdcH1 =new TH1F("QdcPhot" ,"Cer+Fee Cluster Charge all chambers;q [QDC]",P()->MaxQdc(),0,P()->MaxQdc()); | |
e42a7b46 | 520 | |
a25b3368 | 521 | pPureMipQdcH1 =new TH1F("QdcPureMip" ,"MIP only Cluster Charge all chambers;q [QDC]",P()->MaxQdc(),0,P()->MaxQdc()); |
e42a7b46 | 522 | pPureMipSizeH1=new TH1F("SizePureMip" ,"MIP only Cluster size all chambers;size [number of pads in cluster]",100,0,100); |
a25b3368 | 523 | pPureMipMapH2 =new TH2F("MapPureMip" ,"MIP only Cluster map;x [cm];y [cm]",1000,0,P()->PcSizeX(),1000,0,P()->PcSizeY()); |
e42a7b46 | 524 | |
a25b3368 | 525 | pPureCerQdcH1 =new TH1F("QdcPureCer" ,"Cerenkov only Cluster Charge all chambers;q [QDC]",P()->MaxQdc(),0,P()->MaxQdc()); |
e42a7b46 | 526 | pPureCerSizeH1=new TH1F("SizePureCer" ,"Cernekov only Cluster size all chambers;size [number of pads in cluster]",100,0,100); |
a25b3368 | 527 | pPureCerMapH2 =new TH2F("MapPureCer" ,"Cerenkov only Cluster map;x [cm];y [cm]",1000,0,P()->PcSizeX(),1000,0,P()->PcSizeY()); |
c021cb15 | 528 | |
a25b3368 | 529 | pPureFeeQdcH1 =new TH1F("QdcPureFee" ,"Feedback only Cluster Charge all chambers;q [QDC]",P()->MaxQdc(),0,P()->MaxQdc()); |
e42a7b46 | 530 | pPureFeeSizeH1=new TH1F("SizePureFee" ,"Feedback only Cluster size all chambers;size [number of pads in cluster]",100,0,100); |
a25b3368 | 531 | pPureFeeMapH2 =new TH2F("MapPureFee" ,"Feedback only Cluster map;x [cm];y [cm]",1000,0,P()->PcSizeX(),1000,0,P()->PcSizeY()); |
d3eb6079 | 532 | |
e42a7b46 | 533 | }//isClus |
d3eb6079 | 534 | //end of hists booking |
e42a7b46 | 535 | for(Int_t iEvtN=0;iEvtN < GetLoader()->GetRunLoader()->GetAliRun()->GetEventsPerRun();iEvtN++){//events loop |
d3eb6079 | 536 | GetLoader()->GetRunLoader()->GetEvent(iEvtN); //get current event |
c021cb15 | 537 | |
a25b3368 | 538 | for(Int_t iPrimN=0;iPrimN < GetLoader()->TreeH()->GetEntries();iPrimN++){//hit tree loop |
539 | GetLoader()->TreeH()->GetEntry(iPrimN); | |
d3eb6079 | 540 | for(Int_t j=0;j<Hits()->GetEntries();j++){//hits loop |
0fe8fa07 | 541 | AliRICHHit *pHit = (AliRICHHit*)Hits()->At(j); |
d3eb6079 | 542 | TParticle *pParticle = GetLoader()->GetRunLoader()->Stack()->Particle(pHit->GetTrack());//get particle produced this hit |
0fe8fa07 | 543 | Double_t dRadius = TMath::Sqrt(pParticle->Vx()*pParticle->Vx()+pParticle->Vy()*pParticle->Vy()+pParticle->Vz()*pParticle->Vz()); |
a25b3368 | 544 | switch(pParticle->GetPdgCode()){ |
0fe8fa07 | 545 | case kPositron : pElecP->Fill( pParticle->P());pelecRadius->Fill(dRadius); break; |
546 | case kElectron : pElecP->Fill(-pParticle->P());pelecRadius->Fill(dRadius); break; | |
a25b3368 | 547 | |
548 | case kMuonPlus : pMuonP->Fill( pParticle->P()); break; | |
549 | case kMuonMinus: pMuonP->Fill(-pParticle->P()); break; | |
550 | ||
551 | case kPiPlus : pPionP->Fill( pParticle->P()); break; | |
552 | case kPiMinus : pPionP->Fill(-pParticle->P()); break; | |
553 | ||
554 | case kKPlus : pKaonP->Fill( pParticle->P()); break; | |
555 | case kKMinus : pKaonP->Fill(-pParticle->P()); break; | |
556 | ||
0fe8fa07 | 557 | case kProton : pProtP->Fill( pParticle->P()); pprotRadius->Fill(dRadius); break; |
558 | case kProtonBar: pProtP->Fill(-pParticle->P()); pprotbarRadius->Fill(dRadius); break; | |
a25b3368 | 559 | |
560 | }//switch PdgCode | |
561 | ||
562 | }//hits loop | |
563 | }//hit tree loop | |
c021cb15 | 564 | |
d3eb6079 | 565 | if(isSdig){ |
566 | GetLoader()->TreeS()->GetEntry(0); | |
567 | for(Int_t iSdigN=0;iSdigN<SDigits()->GetEntries();iSdigN++){//sdigits loop | |
0fe8fa07 | 568 | AliRICHDigit *pSdig=(AliRICHDigit*)SDigits()->At(iSdigN); //get current sdigit pointer |
569 | AliRICHHit *pHit=Hit(pSdig->GetTrack(0)); //get hit of this sdigit (always one) | |
d3eb6079 | 570 | TVector2 hit2 =C(pHit->C())->Mrs2Pc(pHit->OutX3()); //this hit position in local system |
571 | TVector2 sdig2=P()->Pad2Loc(pSdig->Pad()); //center of pad for this sdigit | |
572 | pHxSd->Fill(hit2.X()-sdig2.X()); | |
573 | pHySd->Fill(hit2.Y()-sdig2.Y()); | |
574 | }//sdigits loop | |
575 | }//if(isSdig) | |
576 | ||
e42a7b46 | 577 | if(isDig) GetLoader()->TreeD()->GetEntry(0); |
d3eb6079 | 578 | if(isClus) GetLoader()->TreeR()->GetEntry(0); |
c021cb15 | 579 | |
e42a7b46 | 580 | for(Int_t iChamN=1;iChamN<=7;iChamN++){//chambers loop |
d3eb6079 | 581 | if(isDig){ |
582 | for(Int_t iDigN=0;iDigN<Digits(iChamN)->GetEntries();iDigN++){//digits loop | |
0fe8fa07 | 583 | AliRICHDigit *pDig=(AliRICHDigit*)Digits(iChamN)->At(iDigN); |
584 | AliRICHHit *pHit=Hit(pDig->GetTrack(0)); //get first hit of this digit | |
d3eb6079 | 585 | TVector2 hitV2=C(iChamN)->Mrs2Pc(pHit->OutX3()); |
586 | TVector2 digV2=P()->Pad2Loc(pDig->Pad()); //center of pad for this digit | |
587 | pHxD->Fill(hitV2.X()-digV2.X()); pHyD->Fill(hitV2.Y()-digV2.Y()); | |
588 | }//digits loop | |
589 | }//isDig | |
e42a7b46 | 590 | if(isClus){ |
591 | Int_t iNclusCham=Clusters(iChamN)->GetEntries(); if(iNclusCham) pNumClusH1->Fill(iNclusCham);//number of clusters per event | |
592 | for(Int_t iClusN=0;iClusN<iNclusCham;iClusN++){//clusters loop | |
0fe8fa07 | 593 | AliRICHCluster *pClus=(AliRICHCluster*)Clusters(iChamN)->At(iClusN); |
e42a7b46 | 594 | pQdcH1 ->Fill(pClus->Q()); |
595 | pSizeH1 ->Fill(pClus->Size()); | |
596 | pMapH2 ->Fill(pClus->X(),pClus->Y()); //common | |
597 | ||
598 | if(pClus->IsSingleMip()) {pPureMipQdcH1 ->Fill(pClus->Q()); | |
599 | pPureMipSizeH1->Fill(pClus->Size()); | |
600 | pPureMipMapH2 ->Fill(pClus->X(),pClus->Y());}//Pure Mips | |
601 | ||
602 | if(pClus->IsSingleCerenkov()){pPureCerQdcH1 ->Fill(pClus->Q()); | |
603 | pPureCerSizeH1->Fill(pClus->Size()); | |
604 | pPureCerMapH2 ->Fill(pClus->X(),pClus->Y());}//Pure Cerenkovs | |
605 | ||
606 | if(pClus->IsSingleFeedback()){pPureFeeQdcH1 ->Fill(pClus->Q()); | |
607 | pPureFeeSizeH1->Fill(pClus->Size()); | |
608 | pPureFeeMapH2 ->Fill(pClus->X(),pClus->Y());}//Pure Feedbacks | |
609 | ||
610 | if(pClus->IsMip()) {pMipQdcH1 ->Fill(pClus->Q());} //MIP+ other contributions | |
611 | if(!pClus->IsPureMip()) pPhotQdcH1->Fill(pClus->Q()); //not MIP | |
612 | }//clusters loop | |
613 | }//isClus | |
e42a7b46 | 614 | }//chambers loop |
615 | Info("ControlPlots","Event %i processed.",iEvtN); | |
616 | }//events loop | |
d3eb6079 | 617 | GetLoader()->UnloadHits(); |
618 | if(isSdig) GetLoader()->UnloadSDigits(); | |
e42a7b46 | 619 | if(isDig) GetLoader()->UnloadDigits(); |
620 | if(isClus) GetLoader()->UnloadRecPoints(); | |
621 | ||
a25b3368 | 622 | GetLoader()->GetRunLoader()->UnloadHeader(); |
623 | GetLoader()->GetRunLoader()->UnloadKinematics(); | |
624 | ||
e42a7b46 | 625 | pFile->Write(); delete pFile; |
d3eb6079 | 626 | |
627 | gBenchmark->Show("ControlPlots"); | |
e42a7b46 | 628 | }//ControlPlots() |
629 | //__________________________________________________________________________________________________ | |
0fe8fa07 | 630 | AliRICHHit* AliRICH::Hit(Int_t tid)const |
e42a7b46 | 631 | { |
632 | //defines which hit provided by given tid for the currently loaded event | |
a25b3368 | 633 | GetLoader()->LoadHits(); |
634 | for(Int_t iPrimN=0;iPrimN<GetLoader()->TreeH()->GetEntries();iPrimN++){//prims loop | |
635 | GetLoader()->TreeH()->GetEntry(iPrimN); | |
636 | for(Int_t iHitN=0;iHitN<Hits()->GetEntries();iHitN++){ | |
0fe8fa07 | 637 | AliRICHHit *pHit=(AliRICHHit*)Hits()->At(iHitN); |
a25b3368 | 638 | if(tid==pHit->Track()) {GetLoader()->UnloadHits();return pHit;} |
e42a7b46 | 639 | }//hits |
640 | }//prims loop | |
a25b3368 | 641 | GetLoader()->UnloadHits(); |
e42a7b46 | 642 | return 0; |
643 | } | |
644 | //__________________________________________________________________________________________________ | |
0fe8fa07 | 645 | void AliRICH::HitsPrint(Int_t iEvtN)const |
e42a7b46 | 646 | { |
647 | //Prints a list of RICH hits for a given event. Default is event number 0. | |
d3eb6079 | 648 | if(GetLoader()->GetRunLoader()->GetEvent(iEvtN)) return; |
998b831f | 649 | AliInfo(Form("List of RICH hits for event %i",iEvtN)); |
a25b3368 | 650 | if(GetLoader()->LoadHits()) return; |
e42a7b46 | 651 | |
652 | Int_t iTotalHits=0; | |
a25b3368 | 653 | for(Int_t iPrimN=0;iPrimN<GetLoader()->TreeH()->GetEntries();iPrimN++){//prims loop |
654 | GetLoader()->TreeH()->GetEntry(iPrimN); | |
655 | Hits()->Print(); | |
656 | iTotalHits+=Hits()->GetEntries(); | |
e42a7b46 | 657 | } |
a25b3368 | 658 | GetLoader()->UnloadHits(); |
998b831f | 659 | AliInfo(Form("totally %i hits",iTotalHits)); |
e42a7b46 | 660 | } |
661 | //__________________________________________________________________________________________________ | |
0fe8fa07 | 662 | void AliRICH::SDigitsPrint(Int_t iEvtN)const |
e42a7b46 | 663 | { |
664 | //prints a list of RICH sdigits for a given event | |
d3eb6079 | 665 | if(GetLoader()->GetRunLoader()->GetEvent(iEvtN)) return; |
e42a7b46 | 666 | Info("PrintSDigits","List of RICH sdigits for event %i",iEvtN); |
a25b3368 | 667 | if(GetLoader()->LoadSDigits()) return; |
e42a7b46 | 668 | |
a25b3368 | 669 | GetLoader()->TreeS()->GetEntry(0); |
670 | SDigits()->Print(); | |
671 | GetLoader()->UnloadSDigits(); | |
672 | Info("PrintSDigits","totally %i sdigits",SDigits()->GetEntries()); | |
e42a7b46 | 673 | } |
674 | //__________________________________________________________________________________________________ | |
0fe8fa07 | 675 | void AliRICH::DigitsPrint(Int_t iEvtN)const |
e42a7b46 | 676 | { |
677 | //prints a list of RICH digits for a given event | |
d3eb6079 | 678 | if(GetLoader()->GetRunLoader()->GetEvent(iEvtN)) return; |
e42a7b46 | 679 | Info("PrintDigits","List of RICH digits for event %i",iEvtN); |
a25b3368 | 680 | if(GetLoader()->LoadDigits()) return; |
e42a7b46 | 681 | |
682 | Int_t iTotalDigits=0; | |
a25b3368 | 683 | GetLoader()->TreeD()->GetEntry(0); |
e42a7b46 | 684 | for(Int_t iChamber=1;iChamber<=kNchambers;iChamber++){ |
a25b3368 | 685 | Digits(iChamber)->Print(); |
686 | iTotalDigits+=Digits(iChamber)->GetEntries(); | |
e42a7b46 | 687 | } |
a25b3368 | 688 | GetLoader()->UnloadDigits(); |
e42a7b46 | 689 | Info("PrintDigits","totally %i Digits",iTotalDigits); |
690 | } | |
691 | //__________________________________________________________________________________________________ | |
e53ffca5 | 692 | void AliRICH::OccupancyPrint(Int_t iEvtNreq)const |
c23b3bc0 | 693 | { |
694 | //prints occupancy for each chamber in a given event | |
e53ffca5 | 695 | Int_t iEvtNmin,iEvtNmax; |
696 | if(iEvtNreq==-1){ | |
697 | iEvtNmin=0; | |
698 | iEvtNmax=gAlice->GetEventsPerRun(); | |
699 | } else { | |
700 | iEvtNmin=iEvtNreq;iEvtNmax=iEvtNreq+1; | |
701 | } | |
702 | ||
703 | if(GetLoader()->GetRunLoader()->LoadHeader()) return; | |
704 | if(GetLoader()->GetRunLoader()->LoadKinematics()) return; | |
705 | ||
706 | // Info("Occupancy","for event %i",iEvtN); | |
707 | if(GetLoader()->LoadHits()) return; | |
c23b3bc0 | 708 | if(GetLoader()->LoadDigits()) return; |
709 | ||
710 | Int_t totPadsPerChamber = AliRICHParam::NpadsX()*AliRICHParam::NpadsY(); | |
e53ffca5 | 711 | |
712 | Int_t nDigCh[kNchambers]={0,0,0,0,0,0,0}; | |
713 | Int_t iChHits[kNchambers]={0,0,0,0,0,0,0}; | |
714 | Int_t nPrim[kNchambers]={0,0,0,0,0,0,0}; | |
715 | Int_t nSec[kNchambers]={0,0,0,0,0,0,0}; | |
716 | ||
717 | for(Int_t iEvtN=iEvtNmin;iEvtN<iEvtNmax;iEvtN++){ | |
718 | if(iEvtN%10==0) AliInfo(Form("events processed %i",iEvtN)); | |
719 | if(GetLoader()->GetRunLoader()->GetEvent(iEvtN)) return; | |
720 | AliStack *pStack = GetLoader()->GetRunLoader()->Stack(); | |
721 | for(Int_t iPrimN=0;iPrimN<GetLoader()->TreeH()->GetEntries();iPrimN++){//prims loop | |
722 | GetLoader()->TreeH()->GetEntry(iPrimN); | |
723 | for(Int_t iHitN=0;iHitN<Hits()->GetEntries();iHitN++){ | |
724 | AliRICHHit *pHit = (AliRICHHit *)Hits()->At(iHitN); | |
725 | if(pHit->Eloss()>0){ | |
726 | iChHits[pHit->C()-1]++; | |
727 | if(pStack->Particle(pHit->GetTrack())->Rho()<0.01) nPrim[pHit->C()-1]++;else nSec[pHit->C()-1]++; | |
728 | } | |
729 | } | |
730 | } | |
731 | GetLoader()->TreeD()->GetEntry(0); | |
732 | for(Int_t iChamber=1;iChamber<=kNchambers;iChamber++) nDigCh[iChamber-1]= Digits(iChamber)->GetEntries(); | |
733 | } | |
c23b3bc0 | 734 | for(Int_t iChamber=1;iChamber<=kNchambers;iChamber++){ |
e53ffca5 | 735 | Double_t occupancy = (Double_t)nDigCh[iChamber-1]/(Double_t)totPadsPerChamber; |
736 | Info("Occupancy","for chamber %i = %4.2f %% and charged prim tracks %i and sec. tracks %i with total %i", | |
737 | iChamber,occupancy*100.,nPrim[iChamber-1],nSec[iChamber-1],iChHits[iChamber-1]); | |
738 | } | |
739 | GetLoader()->UnloadHits(); | |
c23b3bc0 | 740 | GetLoader()->UnloadDigits(); |
e53ffca5 | 741 | GetLoader()->GetRunLoader()->UnloadHeader(); |
742 | GetLoader()->GetRunLoader()->UnloadKinematics(); | |
c23b3bc0 | 743 | } |
744 | //__________________________________________________________________________________________________ | |
0fe8fa07 | 745 | void AliRICH::ClustersPrint(Int_t iEvtN)const |
e42a7b46 | 746 | { |
747 | //prints a list of RICH clusters for a given event | |
d3eb6079 | 748 | AliInfo(Form("List of RICH clusters for event %i",iEvtN)); |
a25b3368 | 749 | GetLoader()->GetRunLoader()->GetEvent(iEvtN); |
750 | if(GetLoader()->LoadRecPoints()) return; | |
e42a7b46 | 751 | |
752 | Int_t iTotalClusters=0; | |
a25b3368 | 753 | GetLoader()->TreeR()->GetEntry(0); |
e42a7b46 | 754 | for(Int_t iChamber=1;iChamber<=kNchambers;iChamber++){ |
a25b3368 | 755 | Clusters(iChamber)->Print(); |
756 | iTotalClusters+=Clusters(iChamber)->GetEntries(); | |
e42a7b46 | 757 | } |
a25b3368 | 758 | GetLoader()->UnloadRecPoints(); |
d3eb6079 | 759 | AliInfo(Form("totally %i clusters for event %i",iTotalClusters,iEvtN)); |
e42a7b46 | 760 | } |
761 | //__________________________________________________________________________________________________ | |
998b831f | 762 | void AliRICH::PrintTracks(Int_t iEvtN) |
e42a7b46 | 763 | { |
a25b3368 | 764 | //prints a list of tracks (including secondary) for a given event |
765 | AliInfo(Form("List of all tracks for event %i",iEvtN)); | |
766 | GetLoader()->GetRunLoader()->GetEvent(iEvtN); | |
767 | if(GetLoader()->GetRunLoader()->LoadHeader()) return; | |
768 | if(GetLoader()->GetRunLoader()->LoadKinematics()) return; | |
769 | AliStack *pStack=GetLoader()->GetRunLoader()->Stack(); | |
770 | ||
d3eb6079 | 771 | for(Int_t i=0;i<pStack->GetNtrack();i++) pStack->Particle(i)->Print(); |
a25b3368 | 772 | |
d3eb6079 | 773 | AliInfo(Form("totally %i tracks including %i primaries for event %i",pStack->GetNtrack(),pStack->GetNprimary(),iEvtN)); |
a25b3368 | 774 | GetLoader()->GetRunLoader()->UnloadHeader(); |
775 | GetLoader()->GetRunLoader()->UnloadKinematics(); | |
e42a7b46 | 776 | } |
a25b3368 | 777 | //__________________________________________________________________________________________________ |
d3eb6079 | 778 | void AliRICH::GeomPadPanelFrame()const |
a25b3368 | 779 | { |
780 | //Pad Panel frame 6 sectors | |
781 | Double_t cm=1,mm=0.1*cm;//default is cm | |
782 | Float_t par[3]; | |
783 | ||
784 | par[0]=648*mm/2;par[1]= 411*mm/2;par[2]=40 *mm/2;gMC->Gsvolu("RPPF","BOX ",(*fIdtmed)[kAl] ,par,3);//PPF 2001P2 inner size of the slab by 1mm more | |
785 | par[0]=181*mm/2;par[1]=89.25*mm/2;par[2]=38.3*mm/2;gMC->Gsvolu("PPFL","BOX ",(*fIdtmed)[kAir] ,par,3);//large whole | |
786 | par[0]=114*mm/2;par[1]=89.25*mm/2;par[2]=38.3*mm/2;gMC->Gsvolu("PPFS","BOX ",(*fIdtmed)[kAir] ,par,3);//small whole | |
787 | par[0]=644*mm/2;par[1]= 407*mm/2;par[2]= 1.7*mm/2;gMC->Gsvolu("RPC ","BOX ",(*fIdtmed)[kCsI] ,par,3);//by 0.2 mm more then actual size (PCB 2006P1) | |
788 | ||
789 | gMC->Gspos("RPPF",1,"RICH", -335*mm, -433*mm, 8*cm+20*mm, 0,"ONLY");//F1 2040P1 z p.84 TDR | |
790 | gMC->Gspos("RPPF",2,"RICH", +335*mm, -433*mm, 8*cm+20*mm, 0,"ONLY"); | |
791 | gMC->Gspos("RPPF",3,"RICH", -335*mm, 0*mm, 8*cm+20*mm, 0,"ONLY"); | |
792 | gMC->Gspos("RPPF",4,"RICH", +335*mm, 0*mm, 8*cm+20*mm, 0,"ONLY"); | |
793 | gMC->Gspos("RPPF",5,"RICH", -335*mm, +433*mm, 8*cm+20*mm, 0,"ONLY"); | |
794 | gMC->Gspos("RPPF",6,"RICH", +335*mm, +433*mm, 8*cm+20*mm, 0,"ONLY"); | |
795 | gMC->Gspos("RPC ",1,"RPPF", 0*mm, 0*mm, -19.15*mm, 0,"ONLY");//PPF 2001P2 | |
796 | gMC->Gspos("PPFL",1,"RPPF", -224.5*mm, -151.875*mm, 0.85*mm, 0,"ONLY"); | |
797 | gMC->Gspos("PPFL",2,"RPPF", -224.5*mm, - 50.625*mm, 0.85*mm, 0,"ONLY"); | |
798 | gMC->Gspos("PPFL",3,"RPPF", -224.5*mm, + 50.625*mm, 0.85*mm, 0,"ONLY"); | |
799 | gMC->Gspos("PPFL",4,"RPPF", -224.5*mm, +151.875*mm, 0.85*mm, 0,"ONLY"); | |
800 | gMC->Gspos("PPFS",1,"RPPF", - 65.0*mm, -151.875*mm, 0.85*mm, 0,"ONLY"); | |
801 | gMC->Gspos("PPFS",2,"RPPF", - 65.0*mm, - 50.625*mm, 0.85*mm, 0,"ONLY"); | |
802 | gMC->Gspos("PPFS",3,"RPPF", - 65.0*mm, + 50.625*mm, 0.85*mm, 0,"ONLY"); | |
803 | gMC->Gspos("PPFS",4,"RPPF", - 65.0*mm, +151.875*mm, 0.85*mm, 0,"ONLY"); | |
804 | gMC->Gspos("PPFS",5,"RPPF", + 65.0*mm, -151.875*mm, 0.85*mm, 0,"ONLY"); | |
805 | gMC->Gspos("PPFS",6,"RPPF", + 65.0*mm, - 50.625*mm, 0.85*mm, 0,"ONLY"); | |
806 | gMC->Gspos("PPFS",7,"RPPF", + 65.0*mm, + 50.625*mm, 0.85*mm, 0,"ONLY"); | |
807 | gMC->Gspos("PPFS",8,"RPPF", + 65.0*mm, +151.875*mm, 0.85*mm, 0,"ONLY"); | |
808 | gMC->Gspos("PPFL",5,"RPPF", +224.5*mm, -151.875*mm, 0.85*mm, 0,"ONLY"); | |
809 | gMC->Gspos("PPFL",6,"RPPF", +224.5*mm, - 50.625*mm, 0.85*mm, 0,"ONLY"); | |
810 | gMC->Gspos("PPFL",7,"RPPF", +224.5*mm, + 50.625*mm, 0.85*mm, 0,"ONLY"); | |
811 | gMC->Gspos("PPFL",8,"RPPF", +224.5*mm, +151.875*mm, 0.85*mm, 0,"ONLY"); | |
812 | }//GeomPadPanelFrame() | |
813 | //__________________________________________________________________________________________________ | |
d3eb6079 | 814 | void AliRICH::GeomAmpGap()const |
a25b3368 | 815 | { |
816 | //Gap - anod wires 6 copies to RICH | |
817 | Double_t cm=1,mm=0.1*cm,mkm=0.001*mm;//default is cm | |
818 | Int_t matrixIdReturn=0; //matrix id returned by AliMatrix | |
819 | Float_t par[3]; | |
820 | ||
821 | par[0]=648*mm/2;par[1]= 411*mm/2 ;par[2]=4.45*mm/2;gMC->Gsvolu("RGAP ","BOX ",(*fIdtmed)[kCH4] ,par,3);//xy as PPF 2001P2 z WP 2099P1 | |
822 | par[0]= 0*mm ;par[1]= 20*mkm/2 ;par[2]= 648*mm/2;gMC->Gsvolu("RANO","TUBE",(*fIdtmed)[kW] ,par,3);//WP 2099P1 z = gap x PPF 2001P2 | |
823 | AliMatrix(matrixIdReturn,180,0, 90,90, 90,0); //wires along x | |
824 | ||
825 | gMC->Gspos("RGAP",1,"RICH", -335*mm, -433*mm,8*cm-2.225*mm, 0,"ONLY"); //F1 2040P1 z WP 2099P1 | |
826 | gMC->Gspos("RGAP",2,"RICH", +335*mm, -433*mm,8*cm-2.225*mm, 0,"ONLY"); | |
827 | gMC->Gspos("RGAP",3,"RICH", -335*mm, 0*mm,8*cm-2.225*mm, 0,"ONLY"); | |
828 | gMC->Gspos("RGAP",4,"RICH", +335*mm, 0*mm,8*cm-2.225*mm, 0,"ONLY"); | |
829 | gMC->Gspos("RGAP",5,"RICH", -335*mm, +433*mm,8*cm-2.225*mm, 0,"ONLY"); | |
830 | gMC->Gspos("RGAP",6,"RICH", +335*mm, +433*mm,8*cm-2.225*mm, 0,"ONLY"); | |
831 | for(int i=1;i<=96;i++) | |
832 | gMC->Gspos("RANO",i,"RGAP", 0*mm, -411/2*mm+i*4*mm, 0.185*mm, matrixIdReturn,"ONLY"); //WP 2099P1 | |
833 | }//GeomAmpGap() | |
834 | //__________________________________________________________________________________________________ | |
d3eb6079 | 835 | void AliRICH::GeomRadiators()const |
a25b3368 | 836 | { |
837 | //Defines radiators geometry | |
838 | Double_t mm=0.1;//default is cm | |
839 | Float_t par[3]; | |
840 | par[0]=1330*mm/2 ;par[1]= 413*mm/2 ;par[2]= 24*mm/2; gMC->Gsvolu("RRAD","BOX ",(*fIdtmed)[kC6F14] ,par,3); // Rad 2011P1 | |
841 | par[0]=1330*mm/2 ;par[1]= 413*mm/2 ;par[2]= 4*mm/2; gMC->Gsvolu("RRFR","BOX ",(*fIdtmed)[kRoha] ,par,3); //front | |
842 | par[0]=1330*mm/2 ;par[1]= 413*mm/2 ;par[2]= 5*mm/2; gMC->Gsvolu("RRWI","BOX ",(*fIdtmed)[kSiO2] ,par,3); //window | |
843 | par[0]=1330*mm/2 ;par[1]= 5*mm/2 ;par[2]= 15*mm/2; gMC->Gsvolu("RRLO","BOX ",(*fIdtmed)[kRoha] ,par,3); //long side | |
844 | par[0]= 10*mm/2 ;par[1]= 403*mm/2 ;par[2]= 15*mm/2; gMC->Gsvolu("RRSH","BOX ",(*fIdtmed)[kRoha] ,par,3); //short side | |
845 | par[0]= 0 ;par[1]= 10*mm/2 ;par[2]= 15*mm/2; gMC->Gsvolu("RRSP","TUBE",(*fIdtmed)[kSiO2] ,par,3); //spacer | |
846 | ||
847 | gMC->Gspos("RRAD",1,"RICH", 0*mm,-434*mm, -12*mm, 0,"ONLY"); //3 radiators to RICH | |
848 | gMC->Gspos("RRAD",2,"RICH", 0*mm, 0*mm, -12*mm, 0,"ONLY"); | |
849 | gMC->Gspos("RRAD",3,"RICH", 0*mm,+434*mm, -12*mm, 0,"ONLY"); | |
850 | gMC->Gspos("RRFR",1,"RRAD", 0*mm, 0*mm, -10.0*mm, 0,"ONLY"); //front cover | |
851 | gMC->Gspos("RRWI",1,"RRAD", 0*mm, 0*mm, 9.5*mm, 0,"ONLY"); //quartz window (back cover) | |
852 | gMC->Gspos("RRLO",1,"RRAD", 0*mm,-204*mm, -0.5*mm, 0,"ONLY"); //long side | |
853 | gMC->Gspos("RRLO",2,"RRAD", 0*mm,+204*mm, -0.5*mm, 0,"ONLY"); //long side | |
854 | gMC->Gspos("RRSH",1,"RRAD",-660*mm, 0*mm, -0.5*mm, 0,"ONLY"); //short side | |
855 | gMC->Gspos("RRSH",2,"RRAD",+660*mm, 0*mm, -0.5*mm, 0,"ONLY"); //short side | |
856 | for(int i=0;i<3;i++) | |
857 | for(int j=0;j<10;j++) | |
858 | gMC->Gspos("RRSP",10*i+j,"RRAD",-1330*mm/2+116*mm+j*122*mm,(i-1)*105*mm,-0.5*mm,0,"ONLY");//spacers | |
859 | }//GeomRadiators() | |
860 | //__________________________________________________________________________________________________ | |
d3eb6079 | 861 | void AliRICH::GeomSandBox()const |
a25b3368 | 862 | { |
863 | //Defines SandBox geometry | |
864 | Double_t mm=0.1;//default is cm | |
865 | Float_t par[3]; | |
866 | par[0]=1419*mm/2 ;par[1]=1378*mm/2;par[2]=50.5*mm/2; gMC->Gsvolu("RSNB","BOX ",(*fIdtmed)[kAir] ,par,3); //2072P1 | |
867 | par[0]=1419*mm/2 ;par[1]=1378*mm/2;par[2]= 0.5*mm/2; gMC->Gsvolu("RSCO","BOX ",(*fIdtmed)[kAl] ,par,3); //cover | |
868 | par[0]=1359*mm/2 ;par[1]=1318*mm/2;par[2]=49.5*mm/2; gMC->Gsvolu("RSHO","BOX ",(*fIdtmed)[kRoha] ,par,3); //honeycomb structure | |
869 | ||
870 | gMC->Gspos("RSNB",1,"RICH", 0*mm, 0*mm, -73.75*mm, 0,"ONLY"); //p.84 TDR sandbox to rich | |
871 | gMC->Gspos("RSHO",1,"RSNB", 0*mm, 0*mm, 0*mm, 0,"ONLY"); //2072P1 honeycomv to sandbox | |
872 | gMC->Gspos("RSCO",1,"RSNB", 0*mm, 0*mm, +25*mm, 0,"ONLY"); //cover to sandbox | |
873 | gMC->Gspos("RSCO",2,"RSNB", 0*mm, 0*mm, -25*mm, 0,"ONLY"); //cover to sandbox | |
874 | }//GeomSandBox() | |
875 | //__________________________________________________________________________________________________ | |
d3eb6079 | 876 | void AliRICH::GeomRadioSrc()const |
a25b3368 | 877 | { |
878 | // Defines geometry for radioactive source | |
879 | Double_t cm=1,mm=0.1*cm,mkm=0.001*cm; | |
880 | Float_t par[3]; | |
881 | ||
882 | par[0]=0 ;par[1]= 70*mm/2 ;par[2]= 30*mm/2; gMC->Gsvolu("RSRC","TUBE",(*fIdtmed)[kCH4] ,par,3); //top src container | |
883 | par[0]=0 ;par[1]= 38*mm/2 ;par[2]= 21.8*mm/2; gMC->Gsvolu("RSAG","TUBE",(*fIdtmed)[kAl] ,par,3); //Al glass | |
884 | par[0]=0 ;par[1]= 34*mm/2 ;par[2]= 20*mm/2; gMC->Gsvolu("RSPP","TUBE",(*fIdtmed)[kPerpex] ,par,3); //perpex plug | |
885 | par[0]=0 ;par[1]= 5*mm/2 ;par[2]= 15*mm/2; gMC->Gsvolu("RSSC","TUBE",(*fIdtmed)[kSteel] ,par,3); //steel screw in center of perpex | |
886 | par[0]=0 ;par[1]= 2*mm/2 ;par[2]= 10*mm/2; gMC->Gsvolu("RSSS","TUBE",(*fIdtmed)[kSteel] ,par,3); //Steel screw to support Sr90 | |
887 | par[0]=0 ;par[1]= 1*mm/2 ;par[2]= 1*mm/2; gMC->Gsvolu("RSSR","TUBE",(*fIdtmed)[kSr90] ,par,3); //Sr90 source | |
888 | par[0]=0 ;par[1]= 4*mm/2 ;par[2]= 10*mm/2; gMC->Gsvolu("RSWP","TUBE",(*fIdtmed)[kAir] ,par,3); //Air hole in perpex plug | |
889 | par[0]=0 ;par[1]= 5*mm/2 ;par[2]= 1.8*mm/2; gMC->Gsvolu("RSWA","TUBE",(*fIdtmed)[kAir] ,par,3); //Air hole in Al glass bottom | |
890 | par[0]=0 ;par[1]= 30*mm/2 ;par[2]= 50*mkm/2; gMC->Gsvolu("RSMF","TUBE",(*fIdtmed)[kMylar] ,par,3); //Mylar foil | |
891 | ||
892 | gMC->Gspos("RSRC",1,"RICH", 30*cm, 0, 1*cm, 0,"ONLY"); //source to RICH | |
893 | gMC->Gspos("RSMF",1,"RSRC", 0, 0,21.8*mm/2+50*mkm/2, 0,"ONLY");//mylar foil to top src volume | |
894 | gMC->Gspos("RSAG",1,"RSRC", 0, 0, 0, 0,"ONLY");//Al glass to fake Src volume | |
895 | gMC->Gspos("RSWA",1,"RSAG", 6*mm, 0, -10*mm, 0,"ONLY");//air whole in al glass bottom | |
896 | gMC->Gspos("RSPP",1,"RSAG", 0, 0, 0.9*mm, 0,"ONLY");//perpex plug to Al glass | |
897 | gMC->Gspos("RSWP",1,"RSPP", 6*mm, 0, -5*mm, 0,"ONLY");//air whole in perpex plug | |
898 | gMC->Gspos("RSSC",1,"RSPP", 0, 0, 2.5*mm, 0,"ONLY");//steel screw in center of perpex plug | |
899 | gMC->Gspos("RSSS",1,"RSPP", 6*mm, 0, 5*mm, 0,"ONLY");//steel screw to support Sr90 in perpex plug | |
900 | gMC->Gspos("RSSR",1,"RSSS", 0, 0, -4.5*mm, 0,"ONLY");//Sr90 in support steel screw | |
901 | }//GeomSr90() | |
902 | //__________________________________________________________________________________________________ | |
d3eb6079 | 903 | void AliRICH::GeomAerogel()const |
a25b3368 | 904 | { |
905 | //Creates detailed geometry for aerogel study. | |
906 | AliDebug(1,"Start."); | |
907 | Double_t cm=1; | |
908 | Float_t par[3]; //tmp array for volume dimentions | |
909 | ||
910 | par[0]=10.1*cm/2;par[1]=10.1*cm/2;par[2]=10.1*cm/2; | |
911 | gMC->Gsvolu("RREF","BOX ",(*fIdtmed)[kReflector],par,3);//reflector box | |
912 | gMC->Gspos("RREF",1,"RICH",0,0,0,0, "ONLY"); //put it to RICH volume | |
913 | ||
914 | par[0]=10*cm/2;par[1]=10*cm/2;par[2]=10*cm/2; | |
915 | gMC->Gsvolu("RGEL","BOX ",(*fIdtmed)[kGel],par,3);//10x10x10 cm^3 cubic of aerogel | |
916 | gMC->Gspos("RGEL",1,"RREF",0,0,0,0,"ONLY");//put gel cell to reflector | |
917 | AliDebug(1,"Stop."); | |
918 | }//GeomAerogel() | |
919 | //__________________________________________________________________________________________________ | |
920 | void AliRICH::CreateGeometry() | |
921 | { | |
922 | //Creates detailed geometry simulation (currently GEANT volumes tree) | |
923 | AliDebug(1,"Start main."); | |
924 | Double_t mm=0.1;//default is cm | |
925 | Float_t par[3]; | |
926 | Int_t matrixIdReturn=0; //matrix id returned by AliMatrix | |
927 | ||
928 | //place chambers into mother volume ALIC | |
929 | par[0]=(6*mm+1681*mm+6*mm)/2;par[1]=(6*mm+1466*mm+6*mm)/2;par[2]=(80*mm+40*mm)*2/2; | |
930 | gMC->Gsvolu("RICH","BOX ",(*fIdtmed)[kCH4],par,3);//2033P1 z p84 TDR | |
931 | for(int i=1;i<=P()->Nchambers();i++){ //test configuration with single chamber is taken into account automaticaly in AliRICHParam | |
932 | AliMatrix(matrixIdReturn, | |
933 | C(i)->ThetaXd(),C(i)->PhiXd(), | |
934 | C(i)->ThetaYd(),C(i)->PhiYd(), | |
935 | C(i)->ThetaZd(),C(i)->PhiZd()); | |
936 | gMC->Gspos("RICH",i,"ALIC",C(i)->Center().X(), | |
937 | C(i)->Center().Y(), | |
938 | C(i)->Center().Z(),matrixIdReturn, "ONLY"); | |
939 | } | |
940 | ||
941 | if(P()->IsAerogel()) | |
942 | GeomAerogel(); | |
943 | else{ | |
944 | GeomPadPanelFrame(); | |
945 | GeomAmpGap(); | |
946 | if(P()->IsRadioSrc()) GeomRadioSrc(); else GeomRadiators(); | |
947 | GeomSandBox(); | |
948 | } | |
949 | AliDebug(1,"Stop main."); | |
950 | }//CreateGeometry() | |
951 | //__________________________________________________________________________________________________ | |
d3eb6079 | 952 | void AliRICH::CheckPR()const |
953 | { | |
954 | //Pattern recognition with stack particles | |
955 | TFile *pFile = new TFile("$(HOME)/RPR.root","RECREATE","RICH Pattern Recognition"); | |
956 | TNtupleD *hn = new TNtupleD("hn","ntuple","Pmod:Charge:TrackTheta:TrackPhi:TrackX:TrackY:MinX:MinY:ChargeMIP:ThetaCerenkov:NPhotons:MipIndex:Chamber:Particle"); | |
ef210ba6 | 957 | // printf("\n\n"); |
958 | // printf("Pattern Recognition done for event %5i",0); | |
d3eb6079 | 959 | AliMagF * magf = gAlice->Field(); |
960 | AliTracker::SetFieldMap(magf); | |
961 | for(Int_t iEvtN=0;iEvtN<GetLoader()->GetRunLoader()->GetNumberOfEvents();iEvtN++) { | |
962 | GetLoader()->GetRunLoader()->GetEvent(iEvtN); | |
963 | AliRICHTracker *tr = new AliRICHTracker(); | |
964 | tr->RecWithStack(hn); | |
ef210ba6 | 965 | Info("CheckPR","Pattern Recognition done for event %i \b",iEvtN); |
966 | // printf("\b\b\b\b\b%5i",iEvtN+1); | |
d3eb6079 | 967 | } |
968 | printf("\n\n"); | |
969 | pFile->Write();pFile->Close(); | |
970 | } | |
0fe8fa07 | 971 | //__________________________________________________________________________________________________ |
972 | void AliRICH::DisplayEvent(Int_t iEvtNmin,Int_t iEvtNmax)const | |
973 | { | |
974 | TH2F *pDigitsH2[8]; | |
975 | ||
976 | Bool_t isDigits =!GetLoader()->LoadDigits(); | |
977 | if(!isDigits){Error("ShoEvent","No digits. Nothing to display.");return;} | |
978 | ||
f770edb5 | 979 | TCanvas *canvas = new TCanvas("RICHDisplay","RICH Display",0,0,1226,900); |
980 | gStyle->SetPalette(1); | |
0fe8fa07 | 981 | |
982 | ||
983 | for(Int_t iChamber=1;iChamber<=7;iChamber++) { | |
984 | pDigitsH2[iChamber] = new TH2F(Form("pDigitsH2_%i",iChamber),Form("Chamber %i",iChamber),165,0,P()->PcSizeX(),144,0,P()->PcSizeY()); | |
985 | pDigitsH2[iChamber]->SetMarkerColor(kGreen); | |
986 | pDigitsH2[iChamber]->SetMarkerStyle(29); | |
987 | pDigitsH2[iChamber]->SetMarkerSize(0.4); | |
988 | pDigitsH2[iChamber]->SetStats(kFALSE); | |
f770edb5 | 989 | pDigitsH2[iChamber]->SetMaximum(300); |
0fe8fa07 | 990 | } |
991 | ||
f770edb5 | 992 | if(iEvtNmax>gAlice->GetEventsPerRun()||iEvtNmax==0) iEvtNmax=gAlice->GetEventsPerRun()-1; |
0fe8fa07 | 993 | |
d0831219 | 994 | TLatex t; t.SetTextSize(0.1); |
0fe8fa07 | 995 | for(Int_t iEventN=iEvtNmin;iEventN<=iEvtNmax;iEventN++) {//events loop |
f770edb5 | 996 | canvas->Divide(3,3); |
0fe8fa07 | 997 | canvas->cd(1); |
998 | t.DrawText(0.2,0.4,Form("Event Number %i",iEventN)); | |
999 | ||
1000 | GetLoader()->GetRunLoader()->GetEvent(iEventN); //get event | |
1001 | GetLoader()->TreeD()->GetEntry(0); //get list of digits | |
1002 | for(Int_t iChamber=1;iChamber<=7;iChamber++) {//chambers loop | |
1003 | pDigitsH2[iChamber]->Reset(); | |
1004 | for(Int_t j=0;j<Digits(iChamber)->GetEntries();j++) {//digits loop | |
1005 | AliRICHDigit *pDig = (AliRICHDigit*)Digits(iChamber)->At(j); | |
1006 | TVector2 x2=AliRICHParam::Pad2Loc(pDig->Pad()); | |
f770edb5 | 1007 | pDigitsH2[iChamber]->Fill(x2.X(),x2.Y(),pDig->Q()); |
0fe8fa07 | 1008 | }//digits loop |
1009 | if(iChamber==1) canvas->cd(7); | |
1010 | if(iChamber==2) canvas->cd(8); | |
1011 | if(iChamber==3) canvas->cd(4); | |
1012 | if(iChamber==4) canvas->cd(5); | |
1013 | if(iChamber==5) canvas->cd(6); | |
1014 | if(iChamber==6) canvas->cd(2); | |
1015 | if(iChamber==7) canvas->cd(3); | |
f770edb5 | 1016 | pDigitsH2[iChamber]->Draw("col"); |
1017 | ReadESD(iEventN,iChamber); | |
1018 | AliRICHParam::DrawSectors(); | |
0fe8fa07 | 1019 | }//chambers loop |
1020 | canvas->Update(); | |
1021 | canvas->Modified(); | |
f770edb5 | 1022 | |
1023 | if(iEventN<iEvtNmax) {gPad->WaitPrimitive();canvas->Clear();} | |
0fe8fa07 | 1024 | }//events loop |
1025 | }//ShowEvent() | |
1026 | //__________________________________________________________________________________________________ | |
1027 | void AliRICH::Display()const | |
1028 | { | |
1029 | //Provides fast event display | |
1030 | //For RICH only, full display is .x Display.C | |
1031 | Bool_t isHits =!GetLoader()->LoadHits(); | |
1032 | Bool_t isDigits =!GetLoader()->LoadDigits(); | |
1033 | Bool_t isClusters=!GetLoader()->LoadRecPoints(); | |
1034 | ||
1035 | if(!isHits && !isDigits && !isClusters){Error("Exec","No hits digits and clusters. Nothing to display.");return;} | |
1036 | ||
1037 | TCanvas *pCanvas = new TCanvas("Display","RICH Display",0,0,600,600); | |
1038 | ||
1039 | TH2F *pHitsH2=0,*pDigitsH2=0,*pClustersH2=0; | |
1040 | ||
1041 | if(isHits) pHitsH2 = new TH2F("pHitsH2" , "Event Display;x,cm;y,cm",165,0,AliRICHParam::PcSizeX(), | |
1042 | 144,0,AliRICHParam::PcSizeY()); | |
1043 | if(pHitsH2) pHitsH2->SetStats(kFALSE); | |
1044 | ||
1045 | if(isDigits) pDigitsH2 = new TH2F("pDigitsH2" ,"Event Display",165,0,AliRICHParam::PcSizeX(), | |
1046 | 144,0,AliRICHParam::PcSizeY()); | |
1047 | if(isClusters) pClustersH2 = new TH2F("pClustersH2","Event Display",165,0,AliRICHParam::PcSizeX(), | |
1048 | 144,0,AliRICHParam::PcSizeY()); | |
1049 | ||
1050 | for(Int_t iEventN=0;iEventN<gAlice->GetEventsPerRun();iEventN++){//events Loop | |
1051 | GetLoader()->GetRunLoader()->GetEvent(iEventN); | |
1052 | //display all the staff on chamber by chamber basis | |
1053 | for(Int_t iChamber=1;iChamber<=7;iChamber++){//chambers loop | |
1054 | if(isHits) pHitsH2 ->Reset(); | |
1055 | if(isDigits) pDigitsH2 ->Reset(); | |
1056 | if(isClusters) pClustersH2->Reset(); | |
1057 | //deals with hits | |
1058 | for(Int_t i=0;i<GetLoader()->TreeH()->GetEntries();i++){//TreeH loop | |
1059 | GetLoader()->TreeH()->GetEntry(i); | |
1060 | for(Int_t j=0;j<Hits()->GetEntries();j++){//hits loop | |
1061 | AliRICHHit *pHit = (AliRICHHit*)Hits()->At(j); | |
1062 | if(pHit->C()==iChamber){ | |
1063 | TVector3 hitGlobX3= pHit->OutX3(); | |
1064 | TVector2 hitLocX2 = C(iChamber)->Mrs2Pc(hitGlobX3); | |
1065 | pHitsH2->Fill(hitLocX2.X(),hitLocX2.Y(),200); | |
1066 | }//if | |
1067 | }//hits loop | |
1068 | }//TreeH loop | |
1069 | pHitsH2->SetTitle(Form("event %i chamber %2i",iEventN,iChamber)); | |
1070 | pHitsH2->SetMarkerColor(kRed); pHitsH2->SetMarkerStyle(29); pHitsH2->SetMarkerSize(0.4); | |
f770edb5 | 1071 | ReadESD(iEventN,iChamber); |
0fe8fa07 | 1072 | pHitsH2->Draw(); |
56030c8d | 1073 | ReadESD(iEventN,iChamber); |
0fe8fa07 | 1074 | AliRICHParam::DrawSectors(); |
1075 | TLatex l; l.SetNDC(); l.SetTextSize(0.02); | |
1076 | if(!isHits) {l.SetTextColor(kRed) ;l.DrawLatex(0.1,0.01,"No Hits" );} | |
1077 | if(!isDigits) {l.SetTextColor(kGreen);l.DrawLatex(0.4,0.01,"No DIGITS" );} | |
1078 | if(!isClusters) {l.SetTextColor(kBlue) ;l.DrawLatex(0.8,0.01,"No CLUSTERS");} | |
1079 | pCanvas->Update(); pCanvas->Modified(); gPad->WaitPrimitive(); | |
1080 | //deals with digits | |
1081 | if(isDigits){ | |
1082 | GetLoader()->TreeD()->GetEntry(0); | |
1083 | for(Int_t j=0;j<Digits(iChamber)->GetEntries();j++){//digits loop | |
1084 | AliRICHDigit *pDig = (AliRICHDigit*)Digits(iChamber)->At(j); | |
1085 | TVector2 x2=AliRICHParam::Pad2Loc(pDig->Pad()); | |
1086 | pDigitsH2->Fill(x2.X(),x2.Y(),100); | |
1087 | }//digits loop | |
1088 | pDigitsH2->SetMarkerColor(kGreen); pDigitsH2->SetMarkerStyle(29); pDigitsH2->SetMarkerSize(0.4); | |
1089 | pDigitsH2->Draw("same"); | |
1090 | pCanvas->Update(); pCanvas->Modified(); gPad->WaitPrimitive(); | |
1091 | }//if(isDigits) | |
1092 | //deals with clusters | |
1093 | if(isClusters){ | |
1094 | GetLoader()->TreeR()->GetEntry(0); | |
1095 | for(Int_t j=0;j<Clusters(iChamber)->GetEntries();j++){//clusters loop | |
1096 | AliRICHCluster *pClus = (AliRICHCluster*)Clusters(iChamber)->At(j); | |
1097 | pClustersH2->Fill(pClus->X(),pClus->Y(),50); | |
1098 | }//clusters loop | |
1099 | pClustersH2->SetMarkerColor(kBlue); pClustersH2->SetMarkerStyle(29); pClustersH2->SetMarkerSize(0.4); | |
1100 | pClustersH2->Draw("same"); | |
1101 | pCanvas->Update(); pCanvas->Modified(); gPad->WaitPrimitive(); | |
1102 | }//if(isClusters) | |
1103 | }//chambers loop | |
1104 | }//events Loop | |
1105 | ||
1106 | delete pCanvas; | |
1107 | GetLoader()->UnloadHits(); | |
1108 | if(isDigits) GetLoader()->UnloadDigits(); | |
1109 | if(isClusters) GetLoader()->UnloadRecPoints(); | |
1110 | }//Display() | |
1111 | //__________________________________________________________________________________________________ | |
1112 | Int_t AliRICH::Nparticles(Int_t iPartID,Int_t iEvtN,AliRunLoader *pRL) | |
1113 | { | |
1114 | //counts total number of particles of given type (including secondary) for a given event | |
1115 | pRL->GetEvent(iEvtN); | |
1116 | if(pRL->LoadHeader()) return 0; | |
1117 | if(pRL->LoadKinematics()) return 0; | |
1118 | AliStack *pStack=pRL->Stack(); | |
1119 | ||
1120 | Int_t iCounter=0; | |
1121 | for(Int_t i=0;i<pStack->GetNtrack();i++){ | |
1122 | if(pStack->Particle(i)->GetPdgCode()==iPartID) iCounter++; | |
1123 | } | |
1124 | ||
1125 | pRL->UnloadHeader(); | |
1126 | pRL->UnloadKinematics(); | |
1127 | return iCounter; | |
1128 | } | |
56030c8d | 1129 | //__________________________________________________________________________________________________ |
1130 | void AliRICH::ReadESD(Int_t iEventN, Int_t iChamber)const | |
1131 | { | |
1132 | // | |
f770edb5 | 1133 | AliInfo("Start."); |
56030c8d | 1134 | TFile *pFile=TFile::Open("AliESDs.root","read"); |
1135 | if(!pFile || !pFile->IsOpen()) {AliInfo("ESD file not open.");return;} //open AliESDs.root | |
1136 | TTree *pTree = (TTree*) pFile->Get("esdTree"); | |
1137 | if(!pTree){AliInfo("ESD not found.");return;} //get ESD tree | |
1138 | ||
f770edb5 | 1139 | AliInfo("ESD found. Try to draw ring"); |
56030c8d | 1140 | |
1141 | AliESD *pESD=new AliESD; pTree->SetBranchAddress("ESD", &pESD); | |
1142 | ||
1143 | pTree->GetEvent(iEventN); | |
1144 | ||
1145 | Double_t b = pESD->GetMagneticField()/10.; | |
1146 | ||
1147 | Int_t iNtracks=pESD->GetNumberOfTracks(); | |
1148 | ||
1149 | for(Int_t iTrackN=0;iTrackN<iNtracks;iTrackN++){//ESD tracks loop | |
1150 | AliESDtrack *pTrack = pESD->GetTrack(iTrackN);// get next reconstructed track | |
cc764ba7 | 1151 | Int_t charge = (Int_t)(-TMath::Sign(1.,pTrack->GetSign()*b)); |
1152 | AliRICHHelix helix(pTrack->X3(),pTrack->P3(),charge,b); | |
1153 | Int_t iChamberOnRICH=helix.RichIntersect(P()); | |
1154 | if(iChamberOnRICH==iChamber) { | |
1155 | // | |
f770edb5 | 1156 | TMarker *trackImpact = new TMarker(helix.PosPc().X(),helix.PosPc().Y(),kStar); |
1157 | trackImpact->SetMarkerColor(kRed); | |
1158 | trackImpact->Draw(); | |
cc764ba7 | 1159 | // |
1160 | Int_t iChamberRecon = pTrack->GetRICHcluster()/100000; | |
1161 | if(iChamberRecon==iChamber) { | |
1162 | Double_t thetaCer = pTrack->GetRICHsignal(); | |
1163 | if(thetaCer<0) continue; | |
1164 | TVector3 entrance(helix.PosRad().X(),helix.PosRad().Y(),0); | |
1165 | Double_t thetaTrack,phiTrack; | |
1166 | pTrack->GetRICHthetaPhi(thetaTrack,phiTrack); | |
1167 | TVector3 vectorTrack; | |
1168 | vectorTrack.SetMagThetaPhi(pTrack->GetP(),thetaTrack,phiTrack); | |
1169 | AliInfo(Form("Draw ring started for track %i on chamber %i",iTrackN,iChamber)); | |
1170 | AliInfo(Form("ThetaCer %f TrackTheta %f TrackPhi %f Momentum %f",thetaCer,thetaTrack,phiTrack,pTrack->GetP())); | |
1171 | Double_t dx,dy; | |
1172 | pTrack->GetRICHdxdy(dx,dy); | |
1173 | AliInfo(Form("dx %f dy %f ",dx,dy)); | |
1174 | DrawRing(entrance,vectorTrack,thetaCer); | |
1175 | } | |
56030c8d | 1176 | } |
1177 | } | |
1178 | delete pESD; pFile->Close();//close AliESDs.root | |
f770edb5 | 1179 | AliInfo("Stop."); |
56030c8d | 1180 | } |
1181 | //__________________________________________________________________________________________________ | |
1182 | void AliRICH::DrawRing(TVector3 entrance,TVector3 vectorTrack,Double_t thetaCer)const | |
1183 | { | |
1184 | Double_t xGraph[100],yGraph[100]; | |
1185 | Int_t nPointsToDraw = 0; | |
1186 | for(Int_t i=0;i<100;i++) { | |
1187 | Double_t phiCer = 2*TMath::Pi()*i/100; | |
1188 | TVector3 pos = AliRICHParam::ForwardTracing(entrance,vectorTrack,thetaCer,phiCer); | |
f770edb5 | 1189 | if(pos.X()==-999) continue; |
56030c8d | 1190 | xGraph[nPointsToDraw] = pos.X();yGraph[nPointsToDraw] = pos.Y();nPointsToDraw++; |
1191 | } | |
cc764ba7 | 1192 | // AliInfo(Form("Npoints per ring %i",nPointsToDraw)); |
56030c8d | 1193 | TGraph *gra = new TGraph(nPointsToDraw,xGraph,yGraph); |
f770edb5 | 1194 | gra->Draw("C"); |
56030c8d | 1195 | } |
e53ffca5 | 1196 | //__________________________________________________________________________________________________ |
1197 | void AliRICH::SummaryOfEvent(Int_t iEvtN) const | |
1198 | { | |
1199 | //prints a summary for a given event | |
1200 | AliInfo(Form("Summary of event %i",iEvtN)); | |
1201 | GetLoader()->GetRunLoader()->GetEvent(iEvtN); | |
1202 | if(GetLoader()->GetRunLoader()->LoadHeader()) return; | |
1203 | if(GetLoader()->GetRunLoader()->LoadKinematics()) return; | |
1204 | AliStack *pStack=GetLoader()->GetRunLoader()->Stack(); | |
1205 | ||
1206 | AliGenEventHeader* pGenHeader = gAlice->GetHeader()->GenEventHeader(); | |
1207 | if(pGenHeader->InheritsFrom("AliGenHijingEventHeader")) { | |
1208 | AliInfo(Form(" Hijing event with impact parameter b = %.2f (fm)",((AliGenHijingEventHeader*) pGenHeader)->ImpactParameter())); | |
1209 | } | |
1210 | Int_t nChargedPrimaries=0; | |
1211 | for(Int_t i=0;i<pStack->GetNtrack();i++) { | |
1212 | TParticle *pParticle = pStack->Particle(i); | |
1213 | if(pParticle->IsPrimary()&&pParticle->GetPDG()->Charge()!=0) nChargedPrimaries++; | |
1214 | } | |
1215 | AliInfo(Form("Total number of primaries %i",pStack->GetNprimary())); | |
1216 | AliInfo(Form("Total number of charged primaries %i",nChargedPrimaries)); | |
1217 | AliInfo(Form("Total n. of tracks in stack(+sec) %i",pStack->GetNtrack())); | |
1218 | GetLoader()->GetRunLoader()->UnloadHeader(); | |
1219 | GetLoader()->GetRunLoader()->UnloadKinematics(); | |
1220 | } | |
1221 | //__________________________________________________________________________________________________ | |
1222 | void AliRICH::HitsQA(Double_t cut,Double_t cutele,Double_t cutR) | |
1223 | { | |
1224 | // Provides a set of control plots intended primarily for charged particle flux analisys | |
1225 | // Arguments: cut (GeV) - cut on momentum of any charged particles but electrons, | |
1226 | // cetele (GeV) - the same for electrons-positrons | |
1227 | // cutR (cm) - cut on production vertex radius (cylindrical system) | |
1228 | gBenchmark->Start("HitsAna"); | |
1229 | ||
1230 | Double_t cutPantiproton =cut; | |
1231 | Double_t cutPkaonminus =cut; | |
1232 | Double_t cutPpionminus =cut; | |
1233 | Double_t cutPmuonminus =cut; | |
1234 | Double_t cutPpositron =cutele; | |
1235 | ||
1236 | Double_t cutPelectron =cutele; | |
1237 | Double_t cutPmuonplus =cut; | |
1238 | Double_t cutPpionplus =cut; | |
1239 | Double_t cutPkaonplus =cut; | |
1240 | Double_t cutPproton =cut; | |
1241 | ||
1242 | ||
1243 | TH2F *pEleHitRZ =new TH2F("EleHitRZ" ,Form("e^{+} e^{-} hit %s;z[cm];R[cm]" ,GetName()) , 400,-300,300 ,400,-500,500); //R-z plot 0cm<R<550cm -300cm<z<300cm | |
1244 | TH2F *pEleHitRP =new TH2F("EleHitRP" ,Form("e^{+} e^{-} hit %s;p[GeV];R[cm]",GetName()) ,1000,-1 ,1 ,400, 0,550); //R-p plot 0cm<R<550cm -1GeV<p<1GeV | |
1245 | TH1F *pEleAllP =new TH1F("EleAllP" , "e^{+} e^{-} all;p[GeV]" ,1000,-1 ,1 ); | |
1246 | TH1F *pEleHitP =new TH1F("EleHitP" ,Form("e^{+} e^{-} hit %s;p[GeV]" ,GetName()) ,1000,-1 ,1 ); | |
1247 | TH1F *pMuoHitP =new TH1F("MuoHitP" ,Form("#mu^{-} #mu^{+} hit %s;p[GeV]" ,GetName()) ,1000,-4 ,4 ); | |
1248 | TH1F *pPioHitP =new TH1F("PioHitP" ,Form("#pi^{-} #pi^{+} hit %s;p[GeV]" ,GetName()) ,1000,-4 ,4 ); | |
1249 | TH1F *pKaoHitP =new TH1F("KaoHitP" ,Form("K^{-} K^{+} hit %s;p[GeV]" ,GetName()) ,1000,-4 ,4 ); | |
1250 | TH1F *pProHitP =new TH1F("ProHitP" ,Form("p^{-} p^{+} hit %s;p[GeV]" ,GetName()) ,1000,-4 ,4 ); | |
1251 | TH2F *pFlux =new TH2F("flux" ,Form("%s flux with Rvertex<%.1fcm" ,GetName(),cutR),10 ,-5 ,5 , 10,0 ,10); //special text hist | |
1252 | pFlux->SetStats(0); | |
1253 | pFlux->GetXaxis()->SetBinLabel(1 ,Form("p^{-}>%.3fGeV/c" ,cutPantiproton)); | |
1254 | pFlux->GetXaxis()->SetBinLabel(2 ,Form("K^{-}>%.3fGeV/c" ,cutPkaonminus )); | |
1255 | pFlux->GetXaxis()->SetBinLabel(3 ,Form("#pi^{-}>%.3fGeV/c" ,cutPpionminus )); | |
1256 | pFlux->GetXaxis()->SetBinLabel(4 ,Form("#mu^{-}>%.3fGeV/c" ,cutPmuonminus )); | |
1257 | pFlux->GetXaxis()->SetBinLabel(5 ,Form("e^{+}>%.3fGeV/c" ,cutPpositron )); | |
1258 | ||
1259 | pFlux->GetXaxis()->SetBinLabel(6 ,Form("e^{-}>%.3fGeV/c" ,cutPelectron )); | |
1260 | pFlux->GetXaxis()->SetBinLabel(7 ,Form("#mu^{+}>%.3fGeV/c" ,cutPmuonplus )); | |
1261 | pFlux->GetXaxis()->SetBinLabel(8 ,Form("#pi^{+}>%.3fGeV/c" ,cutPpionplus )); | |
1262 | pFlux->GetXaxis()->SetBinLabel(9 ,Form("K^{+}>%.3fGeV/c" ,cutPkaonplus )); | |
1263 | pFlux->GetXaxis()->SetBinLabel(10,Form("p^{+}>%.3fGeV/c" ,cutPproton )); | |
1264 | ||
1265 | pFlux->GetYaxis()->SetBinLabel(1,"sum"); | |
1266 | pFlux->GetYaxis()->SetBinLabel(2,"ch1"); | |
1267 | pFlux->GetYaxis()->SetBinLabel(3,"ch2"); | |
1268 | pFlux->GetYaxis()->SetBinLabel(4,"ch3"); | |
1269 | pFlux->GetYaxis()->SetBinLabel(5,"ch4"); | |
1270 | pFlux->GetYaxis()->SetBinLabel(6,"ch5"); | |
1271 | pFlux->GetYaxis()->SetBinLabel(7,"ch6"); | |
1272 | pFlux->GetYaxis()->SetBinLabel(8,"ch7"); | |
1273 | pFlux->GetYaxis()->SetBinLabel(9,"prim"); | |
1274 | pFlux->GetYaxis()->SetBinLabel(10,"tot"); | |
1275 | ||
1276 | //end of hists definition | |
1277 | ||
1278 | Int_t iNevents=fLoader->GetRunLoader()->GetAliRun()->GetEventsPerRun(),iCntPrimParts=0,iCntTotParts=0; | |
1279 | //load all needed trees | |
1280 | fLoader->LoadHits(); | |
1281 | fLoader->GetRunLoader()->LoadHeader(); | |
1282 | fLoader->GetRunLoader()->LoadKinematics(); | |
1283 | ||
1284 | for(Int_t iEvtN=0;iEvtN < iNevents;iEvtN++){//events loop | |
1285 | fLoader->GetRunLoader()->GetEvent(iEvtN); | |
1286 | AliInfo(Form(" %i event processes",fLoader->GetRunLoader()->GetEventNumber())); | |
1287 | AliStack *pStack= fLoader->GetRunLoader()->Stack(); | |
1288 | ||
1289 | for(Int_t iParticleN=0;iParticleN<pStack->GetNtrack();iParticleN++){//stack loop | |
1290 | TParticle *pPart=pStack->Particle(iParticleN); | |
1291 | ||
1292 | if(iParticleN%10000==0) AliInfo(Form(" %i particles read",iParticleN)); | |
1293 | ||
1294 | switch(pPart->GetPdgCode()){ | |
1295 | case kProtonBar: pFlux->Fill(-4.5,9); if(pPart->Rho()<0.01) pFlux->Fill(-4.5,8); break; | |
1296 | case kKMinus: pFlux->Fill(-3.5,9); if(pPart->Rho()<0.01) pFlux->Fill(-3.5,8); break; | |
1297 | case kPiMinus: pFlux->Fill(-2.5,9); if(pPart->Rho()<0.01) pFlux->Fill(-2.5,8); break; | |
1298 | case kMuonMinus: pFlux->Fill(-1.5,9); if(pPart->Rho()<0.01) pFlux->Fill(-1.5,8); break; | |
1299 | case kPositron: pFlux->Fill(-0.5,9); if(pPart->Rho()<0.01) pFlux->Fill(-0.5,8); pEleAllP->Fill(-pPart->P()); break; | |
1300 | ||
1301 | case kElectron: pFlux->Fill( 0.5,9); if(pPart->Rho()<0.01) pFlux->Fill( 0.5,8); pEleAllP->Fill( pPart->P()); break; | |
1302 | case kMuonPlus: pFlux->Fill( 1.5,9); if(pPart->Rho()<0.01) pFlux->Fill( 1.5,8); break; | |
1303 | case kPiPlus: pFlux->Fill( 2.5,9); if(pPart->Rho()<0.01) pFlux->Fill( 2.5,8); break; | |
1304 | case kKPlus: pFlux->Fill( 3.5,9); if(pPart->Rho()<0.01) pFlux->Fill( 3.5,8); break; | |
1305 | case kProton: pFlux->Fill( 4.5,9); if(pPart->Rho()<0.01) pFlux->Fill( 4.5,8); break; | |
1306 | }//switch | |
1307 | }//stack loop | |
1308 | //now hits analiser | |
1309 | for(Int_t iEntryN=0;iEntryN < fLoader->TreeH()->GetEntries();iEntryN++){//TreeH loop | |
1310 | fLoader->TreeH()->GetEntry(iEntryN); //get current entry (prim) | |
1311 | for(Int_t iHitN=0;iHitN < Hits()->GetEntries();iHitN++){//hits loop | |
1312 | AliRICHHit *pHit = (AliRICHHit*)Hits()->At(iHitN); //get current hit | |
1313 | TParticle *pPart=pStack->Particle(pHit->GetTrack()); //get stack particle which produced the current hit | |
1314 | ||
1315 | if(pPart->R()>cutR) continue; //cut on production radius (cylindrical system) | |
1316 | ||
1317 | switch(pPart->GetPdgCode()){ | |
1318 | case kProtonBar: if(pPart->P()>cutPantiproton) {pProHitP->Fill(-pPart->P()); pFlux->Fill(-4.5,pHit->C());}break; | |
1319 | case kKMinus : if(pPart->P()>cutPkaonminus) {pKaoHitP->Fill(-pPart->P()); pFlux->Fill(-3.5,pHit->C());}break; | |
1320 | case kPiMinus : if(pPart->P()>cutPpionminus) {pPioHitP->Fill(-pPart->P()); pFlux->Fill(-2.5,pHit->C());}break; | |
1321 | case kMuonMinus: if(pPart->P()>cutPmuonminus) {pMuoHitP->Fill(-pPart->P()); pFlux->Fill(-1.5,pHit->C());}break; | |
1322 | case kPositron : if(pPart->P()>cutPpositron) {pEleHitP->Fill(-pPart->P()); pFlux->Fill(-0.5,pHit->C()); | |
1323 | pEleHitRP->Fill(-pPart->P(),pPart->R()); pEleHitRZ->Fill(pPart->Vz(),pPart->R()); }break; | |
1324 | ||
1325 | case kElectron : if(pPart->P()>cutPelectron) {pEleHitP->Fill( pPart->P()); pFlux->Fill( 0.5,pHit->C()); | |
1326 | pEleHitRP->Fill( pPart->P(),pPart->R()); pEleHitRZ->Fill(pPart->Vz(),pPart->R()); }break; | |
1327 | case kMuonPlus : if(pPart->P()>cutPmuonplus) {pMuoHitP->Fill( pPart->P()); pFlux->Fill( 1.5,pHit->C());}break; | |
1328 | case kPiPlus : if(pPart->P()>cutPpionplus) {pPioHitP->Fill( pPart->P()); pFlux->Fill( 2.5,pHit->C());}break; | |
1329 | case kKPlus : if(pPart->P()>cutPkaonplus) {pKaoHitP->Fill( pPart->P()); pFlux->Fill( 3.5,pHit->C());}break; | |
1330 | case kProton : if(pPart->P()>cutPproton) {pProHitP->Fill( pPart->P()); pFlux->Fill( 4.5,pHit->C());}break; | |
1331 | } | |
1332 | }//hits loop | |
1333 | }//TreeH loop | |
1334 | iCntPrimParts +=pStack->GetNprimary(); | |
1335 | iCntTotParts +=pStack->GetNtrack(); | |
1336 | }//events loop | |
1337 | //unload all loaded staff | |
1338 | fLoader->UnloadHits(); | |
1339 | fLoader->GetRunLoader()->UnloadHeader(); | |
1340 | fLoader->GetRunLoader()->UnloadKinematics(); | |
1341 | //Calculater some sums | |
1342 | Stat_t sum=0; | |
1343 | //sum row, sum over rows | |
1344 | for(Int_t i=1;i<=pFlux->GetNbinsX();i++){ | |
1345 | sum=0; for(Int_t j=2;j<=8;j++) sum+=pFlux->GetBinContent(i,j); | |
1346 | pFlux->SetBinContent(i,1,sum); | |
1347 | } | |
1348 | ||
1349 | //display everything | |
1350 | new TCanvas("canvas1",Form("Events %i Nprims=%i Nparticles=%i",iNevents,iCntPrimParts,iCntTotParts),1000,900); pFlux->Draw("text"); gPad->SetGrid(); | |
1351 | //total prims and particles | |
1352 | TLatex latex; latex.SetTextSize(0.02); | |
1353 | sum=0; for(Int_t i=1;i<=pFlux->GetNbinsX();i++) sum+=pFlux->GetBinContent(i,10); latex.DrawLatex(5.1,9.5,Form("%.0f",sum)); | |
1354 | sum=0; for(Int_t i=1;i<=pFlux->GetNbinsX();i++) sum+=pFlux->GetBinContent(i,9); latex.DrawLatex(5.1,8.5,Form("%.0f",sum)); | |
1355 | for(Int_t iChN=1;iChN<=kNchambers;iChN++) { | |
1356 | sum=0; for(Int_t i=1;i<=pFlux->GetNbinsX();i++) sum+=pFlux->GetBinContent(i,iChN+1);latex.DrawLatex(5.1,iChN+0.5,Form("%.0f",sum)); | |
1357 | } | |
1358 | sum=0; for(Int_t i=1;i<=pFlux->GetNbinsX();i++) sum+=pFlux->GetBinContent(i,1); latex.DrawLatex(5.1,0.5,Form("%.0f",sum)); | |
1359 | ||
1360 | new TCanvas("cEleAllP" ,"e" ,200,100); pEleAllP->Draw(); | |
1361 | new TCanvas("cEleHitRP" ,"e" ,200,100); pEleHitRP->Draw(); | |
1362 | new TCanvas("cEleHitRZ" ,"e" ,200,100); pEleHitRZ->Draw(); | |
1363 | new TCanvas("cEleHitP" ,"e" ,200,100); pEleHitP->Draw(); | |
1364 | new TCanvas("cMuoHitP" ,"mu",200,100); pMuoHitP->Draw(); | |
1365 | new TCanvas("cPioHitP" ,"pi",200,100); pPioHitP->Draw(); | |
1366 | new TCanvas("cKaoHitP" ,"K" ,200,100); pKaoHitP->Draw(); | |
1367 | new TCanvas("cProHitP" ,"p" ,200,100); pProHitP->Draw(); | |
1368 | ||
1369 | gBenchmark->Show("HitsPlots"); | |
1370 | }//HitsPlots() |