Transition to NewIO
[u/mrichter/AliRoot.git] / RICH / AliRICHv1.cxx
CommitLineData
c28632f0 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 **************************************************************************/
15
88cb7938 16/* $Id$ */
c28632f0 17
18
19//////////////////////////////////////////////////////////
20// Manager and hits classes for set: RICH full version //
21//////////////////////////////////////////////////////////
22
88cb7938 23#include "Riostream.h"
24
c28632f0 25#include <TNode.h>
237c933d 26#include <TParticle.h>
88cb7938 27#include <TRandom.h>
28#include <TTUBE.h>
29#include <TVirtualMC.h>
c28632f0 30
88cb7938 31#include "AliConst.h"
32#include "AliPDG.h"
33#include "AliRICHGeometry.h"
237c933d 34#include "AliRICHHit.h"
64e9b5aa 35#include "AliRICHResponse.h"
64e9b5aa 36#include "AliRICHResponseV0.h"
88cb7938 37#include "AliRICHSegmentationV1.h"
38#include "AliRICHv1.h"
c28632f0 39#include "AliRun.h"
c28632f0 40
41ClassImp(AliRICHv1)
42
43//___________________________________________
452a64c6 44AliRICHv1::AliRICHv1()
c28632f0 45{
237c933d 46
47// Default constructor fo AliRICHvv1 (full version)
48
c28632f0 49 //fChambers = 0;
50}
51
52//___________________________________________
53AliRICHv1::AliRICHv1(const char *name, const char *title)
452a64c6 54 : AliRICH(name,title)
c28632f0 55{
c28632f0 56
237c933d 57// Full version of RICH with hits and diagnostics
58
64e9b5aa 59 // Version 0
60// Default Segmentation, no hits
03f3e21a 61 AliRICHSegmentationV1* segmentation = new AliRICHSegmentationV1;
64e9b5aa 62//
63// Segmentation parameters
c4384528 64 segmentation->SetPadSize(0.84,0.80);
65 segmentation->SetDAnod(0.84/2);
64e9b5aa 66//
67// Geometry parameters
68 AliRICHGeometry* geometry = new AliRICHGeometry;
69 geometry->SetGapThickness(8);
70 geometry->SetProximityGapThickness(.4);
2463d46d 71 geometry->SetQuartzLength(133);
72 geometry->SetQuartzWidth(127.9);
64e9b5aa 73 geometry->SetQuartzThickness(.5);
2463d46d 74 geometry->SetOuterFreonLength(133);
75 geometry->SetOuterFreonWidth(41.3);
76 geometry->SetInnerFreonLength(133);
77 geometry->SetInnerFreonWidth(41.3);
78 geometry->SetFreonThickness(1.5);
64e9b5aa 79//
80// Response parameters
c4384528 81 AliRICHResponseV0* response = new AliRICHResponseV0;
82 response->SetSigmaIntegration(5.);
83 response->SetChargeSlope(27.);
84 response->SetChargeSpread(0.18, 0.18);
85 response->SetMaxAdc(4096);
86 response->SetAlphaFeedback(0.036);
87 response->SetEIonisation(26.e-9);
88 response->SetSqrtKx3(0.77459667);
89 response->SetKx2(0.962);
90 response->SetKx4(0.379);
91 response->SetSqrtKy3(0.77459667);
92 response->SetKy2(0.962);
93 response->SetKy4(0.379);
94 response->SetPitch(0.25);
03f3e21a 95 response->SetWireSag(1); // 1->On, 0->Off
c4384528 96 response->SetVoltage(2150); // Should only be 2000, 2050, 2100 or 2150
97
64e9b5aa 98//
99// AliRICH *RICH = (AliRICH *) gAlice->GetDetector("RICH");
100
237c933d 101 fCkovNumber=0;
102 fFreonProd=0;
64e9b5aa 103 Int_t i=0;
c28632f0 104
64e9b5aa 105 fChambers = new TObjArray(kNCH);
106 for (i=0; i<kNCH; i++) {
107
2682e810 108 //PH (*fChambers)[i] = new AliRICHChamber();
109 fChambers->AddAt(new AliRICHChamber(), i);
64e9b5aa 110
c28632f0 111 }
64e9b5aa 112
113 for (i=0; i<kNCH; i++) {
114 SetGeometryModel(i,geometry);
c4384528 115 SetSegmentationModel(i, segmentation);
116 SetResponseModel(i, response);
64e9b5aa 117 SetDebugLevel(0);
118 }
119
120
c28632f0 121}
122
237c933d 123void AliRICHv1::Init()
124{
125
9e1a0ddb 126 if(fDebug) {
127 printf("%s: *********************************** RICH_INIT ***********************************\n",ClassName());
128 printf("%s: * *\n",ClassName());
129 printf("%s: * AliRICHv1 Full version started *\n",ClassName());
130 printf("%s: * *\n",ClassName());
131 }
237c933d 132
133
a2f7eaf6 134 AliSegmentation* segmentation;
237c933d 135 AliRICHGeometry* geometry;
136 AliRICHResponse* response;
137
138
139 //
140 // Initialize Tracking Chambers
141 //
2fc6393f 142 for (Int_t i=0; i<kNCH; i++) {
237c933d 143 //printf ("i:%d",i);
2682e810 144 //PH ( (AliRICHChamber*) (*fChambers)[i])->Init(i);
145 ( (AliRICHChamber*)fChambers->At(i))->Init(i);
237c933d 146 }
147
148 //
149 // Set the chamber (sensitive region) GEANT identifier
150
2682e810 151 //PH ((AliRICHChamber*)(*fChambers)[0])->SetGid(1);
152 //PH ((AliRICHChamber*)(*fChambers)[1])->SetGid(2);
153 //PH ((AliRICHChamber*)(*fChambers)[2])->SetGid(3);
154 //PH ((AliRICHChamber*)(*fChambers)[3])->SetGid(4);
155 //PH ((AliRICHChamber*)(*fChambers)[4])->SetGid(5);
156 //PH ((AliRICHChamber*)(*fChambers)[5])->SetGid(6);
157 //PH ((AliRICHChamber*)(*fChambers)[6])->SetGid(7);
158
159 ((AliRICHChamber*)fChambers->At(0))->SetGid(1);
160 ((AliRICHChamber*)fChambers->At(1))->SetGid(2);
161 ((AliRICHChamber*)fChambers->At(2))->SetGid(3);
162 ((AliRICHChamber*)fChambers->At(3))->SetGid(4);
163 ((AliRICHChamber*)fChambers->At(4))->SetGid(5);
164 ((AliRICHChamber*)fChambers->At(5))->SetGid(6);
165 ((AliRICHChamber*)fChambers->At(6))->SetGid(7);
166
237c933d 167
237c933d 168 segmentation=Chamber(0).GetSegmentationModel(0);
169 geometry=Chamber(0).GetGeometryModel();
170 response=Chamber(0).GetResponseModel();
171
449e6743 172 Float_t offset = 490 + 1.276 - geometry->GetGapThickness()/2; //distance from center of mother volume to methane
173 Float_t deltaphi = 19.5; //phi angle between center of chambers - z direction
174 Float_t deltatheta = 20; //theta angle between center of chambers - x direction
175 Float_t cosphi = TMath::Cos(deltaphi*TMath::Pi()/180);
176 Float_t sinphi = TMath::Sin(deltaphi*TMath::Pi()/180);
177 Float_t costheta = TMath::Cos(deltatheta*TMath::Pi()/180);
178 Float_t sintheta = TMath::Sin(deltatheta*TMath::Pi()/180);
179
180 Float_t pos1[3]={0. , offset*cosphi , offset*sinphi};
181 Float_t pos2[3]={offset*sintheta , offset*costheta , 0. };
182 Float_t pos3[3]={0. , offset , 0.};
183 Float_t pos4[3]={-offset*sintheta , offset*costheta , 0.};
184 Float_t pos5[3]={offset*sinphi , offset*costheta*cosphi, -offset*sinphi};
185 Float_t pos6[3]={0. , offset*cosphi , -offset*sinphi};
186 Float_t pos7[3]={ -offset*sinphi , offset*costheta*cosphi, -offset*sinphi};
187
188 Chamber(0).SetChamberTransform(pos1[0],pos1[1],pos1[2],new TRotMatrix("rot993","rot993",90., 0. , 90. - deltaphi, 90. , deltaphi, -90. ));
189 Chamber(1).SetChamberTransform(pos2[0],pos2[1],pos2[2],new TRotMatrix("rot994","rot994",90., -deltatheta , 90. , 90.- deltatheta , 0. , 0. ));
190 Chamber(2).SetChamberTransform(pos3[0],pos3[1],pos3[2],new TRotMatrix("rot995","rot995",90., 0. , 90. , 90. , 0. , 0. ));
191 Chamber(3).SetChamberTransform(pos4[0],pos4[1],pos4[2],new TRotMatrix("rot996","rot996",90., deltatheta , 90. , 90 + deltatheta , 0. , 0. ));
192 Chamber(4).SetChamberTransform(pos5[0],pos5[1],pos5[2],new TRotMatrix("rot997","rot997",90., 360. - deltatheta, 108.2 , 90.- deltatheta ,18.2 , 90 - deltatheta));
193 Chamber(5).SetChamberTransform(pos6[0],pos6[1],pos6[2],new TRotMatrix("rot998","rot998",90., 0. , 90 + deltaphi , 90. , deltaphi, 90. ));
194 Chamber(6).SetChamberTransform(pos7[0],pos7[1],pos7[2],new TRotMatrix("rot999","rot999",90., deltatheta , 108.2 , 90.+ deltatheta ,18.2 , 90 + deltatheta));
237c933d 195
9e1a0ddb 196 if(fDebug) {
197 printf("%s: * Pads : %3dx%3d *\n",
198 ClassName(),segmentation->Npx(),segmentation->Npy());
199 printf("%s: * Pad size : %5.2f x%5.2f mm2 *\n",
200 ClassName(),segmentation->Dpx(),segmentation->Dpy());
201 printf("%s: * Gap Thickness : %5.1f cm *\n",
202 ClassName(),geometry->GetGapThickness());
203 printf("%s: * Radiator Width : %5.1f cm *\n",
204 ClassName(),geometry->GetQuartzWidth());
205 printf("%s: * Radiator Length : %5.1f cm *\n",
206 ClassName(),geometry->GetQuartzLength());
207 printf("%s: * Freon Thickness : %5.1f cm *\n",
208 ClassName(),geometry->GetFreonThickness());
209 printf("%s: * Charge Slope : %5.1f ADC *\n",
210 ClassName(),response->ChargeSlope());
211 printf("%s: * Feedback Prob. : %5.2f %% *\n",
212 ClassName(),response->AlphaFeedback()*100);
213 printf("%s: * Debug Level : %3d *\n",
214 ClassName(),GetDebugLevel());
215 printf("%s: * *\n",
216 ClassName());
217 printf("%s: *********************************************************************************\n",
218 ClassName());
219 }
237c933d 220}
c28632f0 221
2463d46d 222
223
224
225
226
227
228