]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RICH/RichGeom.C
Working version of the class for the TOF Trigger. For the time being,
[u/mrichter/AliRoot.git] / RICH / RichGeom.C
1
2 Int_t copy; //volume copy number 
3 Double_t dx,dy,dz,r1,r2;//tmp vars for volume dimentions
4 Double_t cm=1,m=100*cm,mm=0.1*cm,mkm=0.001*cm;//length units  
5 TGeoManager *g=0;
6
7 void RichGeom(Bool_t isOnlyChambers=kFALSE)
8 {
9   
10   g=new TGeoManager("RICH","Private RICH geometry");
11   Materials();  
12   gGeoManager->MakeBox("ALIC",gGeoManager->GetMedium("Air"),dx=30*m/2,dy=30*m/2,dz=30*m/2); //arbitrary values  
13   gGeoManager->SetTopVolume(gGeoManager->GetVolume("ALIC"));
14     
15   Rich(isOnlyChambers);
16   
17 //  RusGel();
18   
19 //  Vhmpid();
20   
21   gGeoManager->CloseGeometry();
22   
23   gGeoManager->SetVisOption(0); gGeoManager->SetVisLevel(5); 
24   
25   gGeoManager->GetMasterVolume()->Draw();
26   Axis();
27 //  gPad->GetView()->SetView(3,94,-70,0);
28   new TBrowser;
29 }
30 //__________________________________________________________________________________________________
31 void Materials()
32 {
33 //Media for RICH
34   Double_t a=0,z=0,den=0,radlen=0,intlen=0;//tmp vars for material parameters
35   new TGeoMaterial("Air"           ,a=26.98 ,z=13,den=0.4224                             ); new TGeoMedium("Air"          ,1,gGeoManager->GetMaterial("Air")); 
36   new TGeoMaterial("RICH_CH4"      ,a=26.98 ,z=13,den=0.4224                             ); new TGeoMedium("RICH_CH4"     ,2,gGeoManager->GetMaterial("RICH_CH4"));
37   new TGeoMaterial("RICH_CsI"      ,a=26.98 ,z=13,den=2.7 ,radlen=24.01*cm,intlen=70.6*cm); new TGeoMedium("RICH_CsI"     ,3,gGeoManager->GetMaterial("RICH_CsI"));
38   new TGeoMaterial("RICH_Al"       ,a=26.98 ,z=13,den=2.7 ,radlen=24.01*cm,intlen=70.6*cm); new TGeoMedium("RICH_Al"      ,4,gGeoManager->GetMaterial("RICH_Al")); 
39   new TGeoMaterial("RICH_W"        ,a=183.84,z=27,den=19.3,radlen= 9.59*cm,intlen=0.35*cm); new TGeoMedium("RICH_W"       ,5,gGeoManager->GetMaterial("RICH_W"));
40   new TGeoMaterial("RICH_Cu"       ,a=55.845,z=26,den=7.87,radlen=13.84*cm,intlen=82.8*cm); new TGeoMedium("RICH_Cu"      ,6,gGeoManager->GetMaterial("RICH_Cu"));
41   new TGeoMaterial("RICH_Rohacell" ,a=12.01 ,z=6 ,den=0.1 ,radlen=18.8,intlen=0);           new TGeoMedium("RICH_Rohacell",7,gGeoManager->GetMaterial("RICH_Rohacell"));
42   new TGeoMaterial("RICH_SiO2"     ,a=0     ,z=0 ,den=0);                                   new TGeoMedium("RICH_SiO2"    ,8,gGeoManager->GetMaterial("RICH_SiO2")); 
43   new TGeoMaterial("RICH_C6F14"    ,a=0     ,z=0 ,den=0);                                   new TGeoMedium("RICH_C6F14"   ,9,gGeoManager->GetMaterial("RICH_C6F14"));
44 //Media for Sr90 source  
45   new TGeoMaterial("RICH_Perpex"   ,a=55.845,z=26,den=7.87,radlen=13.84*cm,intlen=82.8*cm); new TGeoMedium("RICH_Perpex"  ,10,gGeoManager->GetMaterial("RICH_Perpex"));
46   new TGeoMaterial("RICH_Steel"    ,a=55.845,z=26,den=7.87,radlen=13.84*cm,intlen=82.8*cm); new TGeoMedium("RICH_Steel"   ,11,gGeoManager->GetMaterial("RICH_Steel"));
47   new TGeoMaterial("RICH_Mylar"    ,a=55.845,z=26,den=7.87,radlen=13.84*cm,intlen=82.8*cm); new TGeoMedium("RICH_Mylar"   ,12,gGeoManager->GetMaterial("RICH_Mylar"));
48   new TGeoMaterial("RICH_Sr90"     ,a=87.62 ,z=38,den=7.87,radlen=13.84*cm,intlen=82.8*cm); new TGeoMedium("RICH_Sr90"    ,13,gGeoManager->GetMaterial("RICH_Sr90"));
49 //Media for VHMPID Gas option  
50   new TGeoMaterial("RICH_CF4"      ,a=0     ,z=0 ,den=0);                                   new TGeoMedium("RICH_CF4"     ,14,gGeoManager->GetMaterial("RICH_CF4"));
51   new TGeoMaterial("RICH_C4F10"    ,a=0     ,z=0 ,den=0);                                   new TGeoMedium("RICH_C4F10"   ,15,gGeoManager->GetMaterial("RICH_C4F10"));
52   new TGeoMaterial("RICH_Ag"       ,a=0     ,z=0 ,den=0);                                   new TGeoMedium("RICH_Ag"      ,16,gGeoManager->GetMaterial("RICH_Ag"));
53 //Media for VHMPID aerogel option  
54   new TGeoMaterial("RICH_Gel24"    ,a=0     ,z=0 ,den=0);                                   new TGeoMedium("RICH_Gel24"   ,17,gGeoManager->GetMaterial("RICH_Gel24"));
55   new TGeoMaterial("RICH_Gel26"    ,a=0     ,z=0 ,den=0);                                   new TGeoMedium("RICH_Gel26"   ,18,gGeoManager->GetMaterial("RICH_Gel26"));
56   new TGeoMaterial("RICH_Gel28"    ,a=0     ,z=0 ,den=0);                                   new TGeoMedium("RICH_Gel28"   ,19,gGeoManager->GetMaterial("RICH_Gel28"));
57   new TGeoMaterial("RICH_Gel30"    ,a=0     ,z=0 ,den=0);                                   new TGeoMedium("RICH_Gel30"   ,20,gGeoManager->GetMaterial("RICH_Gel30"));
58   new TGeoMaterial("RICH_Si"       ,a=0     ,z=0 ,den=0);                                   new TGeoMedium("RICH_Si"      ,21,gGeoManager->GetMaterial("RICH_Si"));
59   new TGeoMaterial("RICH_Apd"      ,a=0     ,z=0 ,den=0);                                   new TGeoMedium("RICH_Apd"     ,22,gGeoManager->GetMaterial("RICH_Apd"));
60 }//Materials()
61 //__________________________________________________________________________________________________
62 void Rich(Bool_t isOnlyChambers)
63 {
64 //Rich  chamber
65   TGeoVolume *pRich=gGeoManager->MakeBox("RICH",gGeoManager->GetMedium("Air"),dx=(6*mm+1681*mm+6*mm)/2,  //main RICH volume
66                                                                               dy=(6*mm+1466*mm+6*mm)/2,
67                                                                               dz=(80*mm+40*mm)*2/2);     //x,y taken from 2033P1  z from p84 TDR  
68   const Double_t kAngHor=19.5; //  horizontal angle between chambers  19.5 grad
69   const Double_t kAngVer=20;   //  vertical angle between chambers    20   grad     
70   const Double_t kAngCom=30;   //  common RICH rotation with respect to x axis  30   grad     
71   const Double_t trans[3]={490,0,0}; //center of the chamber is on window-gap surface
72   for(Int_t iCh=1;iCh<=7;iCh++){//place 7 chambers
73     TGeoHMatrix *pMatrix=new TGeoHMatrix;
74     pMatrix->RotateY(90);           //rotate around y since initial position is in XY plane -> now in YZ plane
75     pMatrix->SetTranslation(trans); //now plane in YZ is shifted along x 
76     switch(iCh){
77       case 1:                pMatrix->RotateY(kAngHor);  pMatrix->RotateZ(-kAngVer);  break; //right and down 
78       case 2:                                            pMatrix->RotateZ(-kAngVer);  break; //down              
79       case 3:                pMatrix->RotateY(kAngHor);                               break; //right 
80       case 4:                                                                         break; //no rotation
81       case 5:                pMatrix->RotateY(-kAngHor);                              break; //left   
82       case 6:                                            pMatrix->RotateZ(kAngVer);   break; //up
83       case 7:                pMatrix->RotateY(-kAngHor); pMatrix->RotateZ(kAngVer);   break; //left and up 
84     }
85     pMatrix->RotateZ(kAngCom);     //apply common rotation  in XY plane    
86     gGeoManager->GetVolume("ALIC")->AddNode(pRich,iCh,pMatrix);
87   }
88   if(isOnlyChambers) return; //do not construct the detailed geometry  
89 //Pad Panel frame  
90   TGeoVolume *pPpf     =gGeoManager->MakeBox("Rppf"  ,gGeoManager->GetMedium("RICH_Al")  ,dx=648*mm/2,dy=  411*mm/2 ,dz=40  *mm/2);//PPF 2001P2 inner size of the slab by 1mm more
91   TGeoVolume *pPpfLarge=gGeoManager->MakeBox("Rppf1" ,gGeoManager->GetMedium("Air")      ,dx=181*mm/2,dy=89.25*mm/2 ,dz=38.3*mm/2);     //large whole
92   TGeoVolume *pPpfSmall=gGeoManager->MakeBox("Rppf2" ,gGeoManager->GetMedium("Air")      ,dx=114*mm/2,dy=89.25*mm/2 ,dz=38.3*mm/2);//small whole
93   TGeoVolume *pPc      =gGeoManager->MakeBox("Rpc"   ,gGeoManager->GetMedium("RICH_CsI") ,dx=644*mm/2,dy=  407*mm/2 ,dz= 1.7*mm/2);//by 0.2 mm more then actual size (PCB 2006P1)
94   
95   pRich->AddNode(pPpf,copy=1,new TGeoTranslation(-335*mm,-433*mm,8*cm+20*mm));//F1 2040P1 z p.84 TDR
96   pRich->AddNode(pPpf,copy=2,new TGeoTranslation(+335*mm,-433*mm,8*cm+20*mm));
97   pRich->AddNode(pPpf,copy=3,new TGeoTranslation(-335*mm,   0*mm,8*cm+20*mm));
98   pRich->AddNode(pPpf,copy=4,new TGeoTranslation(+335*mm,   0*mm,8*cm+20*mm));
99   pRich->AddNode(pPpf,copy=5,new TGeoTranslation(-335*mm,+433*mm,8*cm+20*mm));
100   pRich->AddNode(pPpf,copy=6,new TGeoTranslation(+335*mm,+433*mm,8*cm+20*mm));
101   pPpf->AddNode( pPc ,copy=1,new TGeoTranslation(   0*mm,   0*mm,-19.15*mm));//PPF 2001P2 
102   pPpf->AddNode(pPpfLarge,copy=1,new TGeoTranslation(-224.5*mm,-151.875*mm,  0.85*mm));
103   pPpf->AddNode(pPpfLarge,copy=2,new TGeoTranslation(-224.5*mm,- 50.625*mm,  0.85*mm));
104   pPpf->AddNode(pPpfLarge,copy=3,new TGeoTranslation(-224.5*mm,+ 50.625*mm,  0.85*mm));
105   pPpf->AddNode(pPpfLarge,copy=4,new TGeoTranslation(-224.5*mm,+151.875*mm,  0.85*mm));
106   pPpf->AddNode(pPpfSmall,copy=1,new TGeoTranslation(- 65.0*mm,-151.875*mm,  0.85*mm));
107   pPpf->AddNode(pPpfSmall,copy=2,new TGeoTranslation(- 65.0*mm,- 50.625*mm,  0.85*mm));
108   pPpf->AddNode(pPpfSmall,copy=3,new TGeoTranslation(- 65.0*mm,+ 50.625*mm,  0.85*mm));
109   pPpf->AddNode(pPpfSmall,copy=4,new TGeoTranslation(- 65.0*mm,+151.875*mm,  0.85*mm));
110   pPpf->AddNode(pPpfSmall,copy=5,new TGeoTranslation(+ 65.0*mm,-151.875*mm,  0.85*mm));
111   pPpf->AddNode(pPpfSmall,copy=6,new TGeoTranslation(+ 65.0*mm,- 50.625*mm,  0.85*mm));
112   pPpf->AddNode(pPpfSmall,copy=7,new TGeoTranslation(+ 65.0*mm,+ 50.625*mm,  0.85*mm));
113   pPpf->AddNode(pPpfSmall,copy=8,new TGeoTranslation(+ 65.0*mm,+151.875*mm,  0.85*mm)); 
114   pPpf->AddNode(pPpfLarge,copy=5,new TGeoTranslation(+224.5*mm,-151.875*mm,  0.85*mm));
115   pPpf->AddNode(pPpfLarge,copy=6,new TGeoTranslation(+224.5*mm,- 50.625*mm,  0.85*mm));
116   pPpf->AddNode(pPpfLarge,copy=7,new TGeoTranslation(+224.5*mm,+ 50.625*mm,  0.85*mm));
117   pPpf->AddNode(pPpfLarge,copy=8,new TGeoTranslation(+224.5*mm,+151.875*mm,  0.85*mm));
118 //gap - anod wires
119   TGeoVolume *pGap =gGeoManager->MakeBox ("Rgap" ,gGeoManager->GetMedium("RICH_CH4") ,dx=648*mm/2,dy=  411*mm/2 ,dz=4.45*mm/2);//xy as PPF 2001P2 z WP 2099P1
120   TGeoVolume *pAnod=gGeoManager->MakeTube("Rano" ,gGeoManager->GetMedium("RICH_W")   ,r1=  0*mm  ,r2=  20*mkm/2 ,dz=648*mm/2); //WP 2099P1 z = gap x PPF 2001P2
121   TGeoRotation *pAnodRot=new TGeoRotation("RanW",90,90,0);
122   
123   pRich->AddNode(pGap,copy=1,new TGeoTranslation(-335*mm,-433*mm,8*cm-2.225*mm)); //F1 2040P1 z WP 2099P1
124   pRich->AddNode(pGap,copy=2,new TGeoTranslation(+335*mm,-433*mm,8*cm-2.225*mm)); 
125   pRich->AddNode(pGap,copy=3,new TGeoTranslation(-335*mm,   0*mm,8*cm-2.225*mm)); 
126   pRich->AddNode(pGap,copy=4,new TGeoTranslation(+335*mm,   0*mm,8*cm-2.225*mm)); 
127   pRich->AddNode(pGap,copy=5,new TGeoTranslation(-335*mm,+433*mm,8*cm-2.225*mm)); 
128   pRich->AddNode(pGap,copy=6,new TGeoTranslation(+335*mm,+433*mm,8*cm-2.225*mm)); 
129   for(int i=1;i<=96;i++)
130     pGap->AddNode(pAnod,copy=i,new TGeoCombiTrans( 0*mm, -411/2*mm+i*4*mm, 0.185*mm,pAnodRot)); //WP 2099P1  
131 //frame 3- cathode wires      
132   TGeoVolume *pCath=gGeoManager->MakeTube("RcaW"  ,gGeoManager->GetMedium("Cu")  ,r1=0  ,r2=100*mkm/2,dz=1323*mm/2);//r WP 2099P1 z F3 2041P1       
133   TGeoRotation *pCathRot=new TGeoRotation("CathRot",90,90,0);
134   for(int i=1;i<=618;i++)
135     pRich->AddNode(pCath,copy=i,new TGeoCombiTrans( 0*mm, -649.5*mm+i*2.1*mm, 75*mm,pCathRot)); //WP 2099P1    
136 //Frame 4- collection wires
137   TGeoVolume *pF4  =gGeoManager->MakeBox( "Rfr4"       ,gGeoManager->GetMedium("RICH_CH4")   ,dx=1407*mm/2 ,dy=1366*mm/2  ,dz=  15*mm/2);//F4 2043P1 
138   TGeoVolume *pF4al=gGeoManager->MakeBox( "Rfr4al"     ,gGeoManager->GetMedium("RICH_Al")    ,dx=1407*mm/2 ,dy=1366*mm/2  ,dz=  10*mm/2); 
139   TGeoVolume *pF4in=gGeoManager->MakeBox( "Rfr4in"     ,gGeoManager->GetMedium("RICH_CH4")   ,dx=1323*mm/2 ,dy=1296*mm/2  ,dz=  10*mm/2); 
140   TGeoVolume *pColl=gGeoManager->MakeTube("RcoW"       ,gGeoManager->GetMedium("RICH_Cu")    ,r1=   0*mm   ,r2=100*mkm/2  ,dz=1323*mm/2);
141   TGeoRotation *pCollRot=new TGeoRotation("RcoRot",90,90,0);
142   
143   pRich->AddNode(pF4      ,copy=1,new TGeoTranslation(   0*mm,0*mm,   9*mm)); //F4 to Rich p.84 TDR
144     pF4  ->AddNode(pF4al    ,copy=1,new TGeoTranslation(   0*mm,0*mm, 2.5*mm)); //F4 al to F4 2043P1 
145     pF4al->AddNode(pF4in    ,copy=1,new TGeoTranslation(   0*mm,0*mm,   0*mm)); //F4 whole F4 al 2043P1   
146     for(int i=1;i<=322;i++)
147       pF4->AddNode(pColl,copy=i,new TGeoCombiTrans( 0*mm, -1296/2*mm+i*4*mm, -5*mm,pCollRot)); //F4 2043P1
148 //radiators
149   TGeoVolume *pRad      =gGeoManager->MakeBox( "Rad"      ,gGeoManager->GetMedium("RICH_C6F14")    ,dx=1330*mm/2 ,dy= 413*mm/2  ,dz=  24*mm/2); // Rad 2011P1
150   TGeoVolume *pRadFront =gGeoManager->MakeBox( "RadFront" ,gGeoManager->GetMedium("RICH_Neoceram") ,dx=1330*mm/2 ,dy= 413*mm/2  ,dz=   4*mm/2); 
151   TGeoVolume *pRadWin   =gGeoManager->MakeBox( "RadWin"   ,gGeoManager->GetMedium("RICH_SiO2")     ,dx=1330*mm/2 ,dy= 413*mm/2  ,dz=   5*mm/2); 
152   TGeoVolume *pRadLong  =gGeoManager->MakeBox( "RadLong"  ,gGeoManager->GetMedium("RICH_Neoceram") ,dx=1330*mm/2 ,dy=   5*mm/2  ,dz=  15*mm/2);    
153   TGeoVolume *pRadShort =gGeoManager->MakeBox( "RadShort" ,gGeoManager->GetMedium("RICH_Neoceram") ,dx=  10*mm/2 ,dy= 403*mm/2  ,dz=  15*mm/2);    
154   TGeoVolume *pRadSpacer=gGeoManager->MakeTube("RadSpacer",gGeoManager->GetMedium("RICH_SiO2")     ,r1= 0        ,r2=10*mm/2  ,dz=  15*mm/2);         
155     
156   pRich->AddNode(pRad      ,copy=1,new TGeoTranslation(   0*mm,-434*mm,   -12*mm)); 
157   pRich->AddNode(pRad      ,copy=2,new TGeoTranslation(   0*mm,   0*mm,   -12*mm)); 
158   pRich->AddNode(pRad      ,copy=3,new TGeoTranslation(   0*mm,+434*mm,   -12*mm)); 
159     
160   pRad ->AddNode(pRadFront ,copy=1,new TGeoTranslation(   0*mm,   0*mm, -10.0*mm));
161   pRad ->AddNode(pRadWin   ,copy=1,new TGeoTranslation(   0*mm,   0*mm,   9.5*mm));
162   pRad ->AddNode(pRadLong  ,copy=1,new TGeoTranslation(   0*mm,-204*mm,  -0.5*mm));
163   pRad ->AddNode(pRadLong  ,copy=2,new TGeoTranslation(   0*mm,+204*mm,  -0.5*mm));
164   pRad ->AddNode(pRadShort ,copy=1,new TGeoTranslation(-660*mm,   0*mm,  -0.5*mm));
165   pRad ->AddNode(pRadShort ,copy=2,new TGeoTranslation(+660*mm,   0*mm,  -0.5*mm));
166   for(int i=0;i<3;i++) for(int j=0;j<10;j++)  pRad->AddNode(pRadSpacer,copy=10*i+j,new TGeoTranslation(-1330*mm/2+116*mm+j*122*mm,(i-1)*105*mm,-0.5*mm));
167 //sandbox  
168   TGeoVolume *pSandBox  =gGeoManager->MakeBox( "RSandBox"  ,gGeoManager->GetMedium("Air")  ,dx=1419*mm/2 ,dy=1378*mm/2   ,dz=50.5*mm/2);  //2072P1   
169   TGeoVolume *pSandCover=gGeoManager->MakeBox( "RSandCover",gGeoManager->GetMedium("RICH_Al")       ,dx=1419*mm/2 ,dy=1378*mm/2   ,dz= 0.5*mm/2);  
170   TGeoVolume *pSandComb =gGeoManager->MakeBox( "RSandComb" ,gGeoManager->GetMedium("RICH_Rohacell") ,dx=1359*mm/2 ,dy=1318*mm/2   ,dz=49.5*mm/2);  
171   
172   pRich->AddNode(pSandBox,copy=1,new TGeoTranslation(  0*mm,0*mm, -73.75*mm)); //p.84 TDR
173     pSandBox->AddNode(pSandComb  ,copy=1,new TGeoTranslation(  0*mm,0*mm,      0*mm)); //2072P1
174     pSandBox->AddNode(pSandCover ,copy=1,new TGeoTranslation(  0*mm,0*mm,    +25*mm)); 
175     pSandBox->AddNode(pSandCover ,copy=2,new TGeoTranslation(  0*mm,0*mm,    -25*mm)); 
176 }//Rich()
177 //__________________________________________________________________________________________________
178 void Sr90(TGeoVolume *pTop)
179 {
180     pSrc               =gGeoManager->MakeTube("Src"              ,gGeoManager->GetMedium("Air")        , 0 , 70*mm/2 ,  30*mm/2);       //top container
181       pAlGlass         =gGeoManager->MakeTube("SrcAlGlass"       ,gGeoManager->GetMedium("RICH_Al")    , 0 , 38*mm/2 ,21.8*mm/2);       //Al glass wall        
182         pPerpexPlug    =gGeoManager->MakeTube("SrcPerpex"        ,gGeoManager->GetMedium("RICH_Perpex"), 0 , 34*mm/2 ,  20*mm/2);       //Perpex plug         
183           pScrewCentral=gGeoManager->MakeTube("SrcScrewCentral"  ,gGeoManager->GetMedium("RICH_Steel") , 0 ,  5*mm/2 ,  15*mm/2);       //Steel screw in the center        
184           pScrewSr90   =gGeoManager->MakeTube("SrcScrewSr90"     ,gGeoManager->GetMedium("RICH_Steel") , 0 ,  2*mm/2 ,  10*mm/2);       //Steel screw to support Sr90 
185             pSr90      =gGeoManager->MakeTube("SrcSr90"          ,gGeoManager->GetMedium("RICH_Sr90")  , 0 ,  1*mm/2 ,   1*mm/2);       //Sr90 source
186           pHolePerpex  =gGeoManager->MakeTube("SrcHolePerpex"    ,gGeoManager->GetMedium("Air")        , 0 ,  4*mm/2 ,  10*mm/2);       //Air hole in perpex plug      
187         pHoleAl        =gGeoManager->MakeTube("SrcHoleAl"        ,gGeoManager->GetMedium("Air")        , 0 ,  5*mm/2 , 1.8*mm/2);       //Air hole in Al glass bottom
188     pMylarFoil         =gGeoManager->MakeTube("SrcMylarFoil"     ,gGeoManager->GetMedium("RICH_Mylar") , 0 , 30*mm/2 , 50*mkm/2);       //Mylar foil                
189                 
190     pTop->AddNode(pSrc,1,new TGeoTranslation(30*cm,0,1*cm));
191       pSrc ->AddNode(pMylarFoil,1,new TGeoTranslation(0,0,21.8*mm/2+50*mkm/2));
192       pSrc ->AddNode(pAlGlass,1,new TGeoTranslation(0,0,0));                           //Al glass to fake Src volume
193         pAlGlass->AddNode(       pHoleAl      ,1,new TGeoTranslation(6*mm,0, -10*mm));
194         pAlGlass->AddNode(       pPerpexPlug  ,1,new TGeoTranslation(0*mm,0, 0.9*mm));
195           pPerpexPlug->AddNode(  pHolePerpex  ,1,new TGeoTranslation(6*mm,0,  -5*mm));      
196           pPerpexPlug->AddNode(  pScrewCentral,1,new TGeoTranslation(0   ,0, 2.5*mm));  
197           pPerpexPlug->AddNode(  pScrewSr90   ,1,new TGeoTranslation(6*mm,0,   5*mm));  
198             pScrewSr90->AddNode( pSr90        ,1,new TGeoTranslation(0   ,0,-4.5*mm));  
199 }//Sr90()    
200 //__________________________________________________________________________________________________
201 void RusGel()
202 {
203 //Defines VHMPID aerogel option geometry. 
204 //                 top view normal position                                   side view normal position
205 //                                                                                                 ^ y
206 //                  --------                                                                       | 
207 //                  |      |                                                                       |
208 //                  |      |          z<-----* y                                          z<-------* x  ----> MUON side
209 //                  |      |                 |                                  ----                    
210 //                  |      |                 |                                  |  | 
211 //                  ________                 v x                                |  |
212 //                                                                              |--|
213 //                                                                              |  |
214 //                                                                              ----       
215 //Chamber consists from Al box filled with air where 4 aerogel blocks and APD wall are positioned.
216 //  ------------------------------
217 //  |-|           |-| |-| |-| |-||
218 //  |-|           | | | | | | | ||  
219 //  |-|           | | | | | | | ||
220 //  |-| APD wall  | | | | | | | ||    z<---* y  top view   
221 //  |-|           | | | | | | | ||         |
222 //  |-|           | | | | | | | ||         | 
223 //  |-|           |_| |_| |_| |_||         v x
224 //  ------------------------------          
225 // 
226 //             ALIC
227 //               |
228 //             Vbox (Al)
229 //               |
230 //             Vair (Air) 
231 //        _______|________
232 //        |              |
233 //       4*Vgel         Vwall
234 //                       |
235 //                      Vcolumn (division along X)
236 //                       |
237 //                      Vcell   (division along Y)
238 //                       |
239 //                      Vapd
240
241   Double_t cm=1 , m=100 , mm=0.1                                                     ;//dimentions, default is cm
242   
243   Int_t    iNapdsX        =10                                    ;//number of APDs along x
244   Int_t    iNapdsY        =16                                    ;//number of APDs along y
245   Double_t dCellX         =1.5*mm             *0.5                ;//cell X half size
246   Double_t dCellY         =1.5*mm             *0.5                ;//cell Y half size
247   Double_t dCellZ         =0.5*mm             *0.5                ;//APD wall thickness   
248   Double_t dWallX         =                         iNapdsX*dCellX;//APD wall X half size
249   Double_t dWallY         =                         iNapdsY*dCellY;//APD wall Y half size
250   Double_t dWallZ         =                                 dCellZ;//APD wall half thickness  
251   Double_t dApdR          =0.5*mm                                 ;//APD radius 
252   Double_t dApdZ          =                                 dCellZ;//APD Z half size
253   Double_t dGelX          =                                 dWallX;//gel block X half size
254   Double_t dGelY          =                                 dWallY;//gel block Y half size
255   Double_t dGelZ          =10*mm              *0.5                ;//gel block Z half size
256   Double_t dProxGap       =50*cm                                  ;//half distance between APD wall and last aerogel block
257   Double_t dAirX          =                                 dWallX;//internal air X hald size
258   Double_t dAirY          =                                 dWallY;//internal air Y hald size
259   Double_t dAirZ          =                dWallZ+dProxGap+7*dGelZ;//internal air Z hald size
260   Double_t dBoxWall       =2*mm               *0.5                ;//Al box walls thickness
261   Double_t dBoxX          =                         dAirX+dBoxWall;//Al box x half size 
262   Double_t dBoxY          =                         dAirY+dBoxWall;//Al box y half size 
263   Double_t dBoxZ          =                         dAirZ+dBoxWall;//Al box z half size
264   
265   Int_t copy;    Double_t rmin,rmax,dx,dy,dz;
266 //make external Al box
267   TGeoVolume *pBox=gGeoManager->MakeBox("Gbox",gGeoManager->GetMedium("RICH_Al"),dx=dBoxX,dy=dBoxY,dz=dBoxZ);
268   TGeoRotation *pRot=new TGeoRotation("GboxRot"); pRot->RotateX(90);
269   gGeoManager->GetVolume("ALIC")->AddNode(pBox,copy=1,new TGeoCombiTrans(0*m,-5.2*m,2.5*m,pRot));//normal position
270 //position Air to Al box   
271   TGeoVolume *pAir=gGeoManager->MakeBox( "Gair",gGeoManager->GetMedium("Air"),dx=dAirX,dy=dAirY,dz=dAirZ);                   
272   pBox->AddNode(pAir,copy=1); 
273 //position 4 gel blocks to Air
274   TGeoVolume *pGel24=gGeoManager->MakeBox( "Ggel24",gGeoManager->GetMedium("RICH_Gel24"),dx=dGelX,dy=dGelY,dz=dGelZ);     
275     pAir->AddNode(pGel24,copy=1,new TGeoTranslation(0,0,-dAirZ+1*dGelZ)); 
276   TGeoVolume *pGel26=gGeoManager->MakeBox( "Ggel26",gGeoManager->GetMedium("RICH_Gel26"),dx=dGelX,dy=dGelY,dz=dGelZ);     
277     pAir->AddNode(pGel26,copy=1,new TGeoTranslation(0,0,-dAirZ+5*dGelZ)); 
278   TGeoVolume *pGel28=gGeoManager->MakeBox( "Ggel28",gGeoManager->GetMedium("RICH_Gel28"),dx=dGelX,dy=dGelY,dz=dGelZ);     
279     pAir->AddNode(pGel28,copy=1,new TGeoTranslation(0,0,-dAirZ+9*dGelZ)); 
280   TGeoVolume *pGel30=gGeoManager->MakeBox( "Ggel30",gGeoManager->GetMedium("RICH_Gel30"),dx=dGelX,dy=dGelY,dz=dGelZ);     
281     pAir->AddNode(pGel30,copy=1,new TGeoTranslation(0,0,-dAirZ+13*dGelZ)); 
282 //position APD wall to air
283   TGeoVolume   *pWall     =gGeoManager->MakeBox ("Gwall",gGeoManager->GetMedium("RICH_Si"),dx=dWallX , dy=dWallY , dz=dWallZ );  
284   pAir->AddNode(pWall,copy=1,new TGeoTranslation(0,0,dAirZ-dWallZ)); 
285 //divide wall into cells
286   Int_t axis,ndiv; Double_t start,step;
287   TGeoVolume *pWallCol =pWall      ->Divide("Gcol",axis=1,ndiv=iNapdsX,start=0,step=0);//divide VhGap along X by NpadsX columns
288   TGeoVolume *pWallCell=pWallCol   ->Divide("Gcel",axis=2,ndiv=iNapdsY,start=0,step=0);//divide VhGapCol along Y by NpadsY cells
289 //position APD to wall cell
290   TGeoVolume *pApd=gGeoManager->MakeTube("Gapd",gGeoManager->GetMedium("RICH_Apd"),rmin=0,rmax=dApdR,dz=dApdZ); pWallCell->AddNode(pApd,copy=1); 
291 }//RusGel()
292 //__________________________________________________________________________________________________
293 void Vhmpid()
294 {
295 //Defines VHMPID geometry for TIC option.
296 //                 top view normal position                                   side view normal position
297 //                                                                                                 ^ y
298 //                  --------                                                                       | 
299 //                  |------|                                                                       |
300 //                  |      |          z<-----* y                                          z<-------* x  ----> MUON side
301 //                  |      |                 |                                  ----                    
302 //                  |      |                 |                                  |  | 
303 //                  ________                 v x                                |  |
304 //                                                                              |--|
305 //                                                                              |  |
306 //                                                                              ----       
307 //Chamber consists from Al box filled with radiator CF4 and C4F10 quartz window in between , Al mirror and MWPC.
308 //  ---------------------------------------------------  top view chamber in test position
309 //  |  -------------- MWPC     | quartz window        |
310 //  |   . . . . . .            |                      |  
311 //  |   \                      |                      |
312 //  |    \             CF4     |    C4F10             |  z<-----* y   
313 //  |     \ mirror             |                      |         |
314 //  |      \                   |                      |         | 
315 //  |       \                  |                      |         v x  
316 //  ---------------------------------------------------    
317 //                                                         z ^
318 //                                                           |
319 //                                                           | 
320 //    <-Y0-> X <--Y1--> X <--Y1--> X <--Y1--> X <-Y0->       |            cath wires: r 50mkm; shift Y0=1.05m;, pitch Y1=2.1; center to PC  4.45mm; material Cu
321 //                                                         x *------->y            
322 //        
323 //    <--Y0--> x <-----------Y1-----------> x <--Y0-->                    anod wires: r 20mkm; shift Y0=2.2mm; pitch Y1=4.0mm; center to PC  2.04mm; material W
324 //                                                                       
325 //                                                                                                
326 //   |________________________________________________|                   pad size y 8.4mm
327 // 
328 //             ALIC
329 //               |
330 //             Vbox
331 //        _______|______
332 //       |       |      |
333 //     Vc4f    Vwin   Vcf4
334 //                 _____|________
335 //                |              |
336 //              Vmir             |
337 //                               |
338 //                             Vgap
339 //                               |
340 //                             Vcol (column of gap cells) X
341 //                               |
342 //                             Vcel  cell in the column   Y                  
343 //                         ______|______
344 //                        |      |      |
345 //                      Vpad   Vano   Vcat
346   Double_t cm=1 , m=100 , mm=0.1 , um=1e-4                                                      ;//dimentions, default is cm
347   
348   Int_t    iNpadsX        =                                    AliRICHParam::NpadsX()           ;//number of pads along x parametrised
349   Int_t    iNpadsY        =                                    AliRICHParam::NpadsY()           ;//number of pads along y parametrised
350   Double_t wCathR         =50  *um                                                              ;//cathode wire radius defined by USER
351   Double_t wCathShift     =1.05*mm                                                              ;//cathode wire shift from pad edge defined by USER
352   Double_t wCathPitch     =2.1 *mm                                                              ;//cathode wire pitch defined by USER
353   Double_t wCathPc        =4.45*mm                                                              ;//distance from pc to cathode wire defined by USER
354   Double_t wAnodR         =20  *um                                                              ;//anod wire radius defined by USER
355   Double_t wAnodShift     =2.2 *mm                                                              ;//anod wire shift from pad edge defined by USER
356   Double_t wAnodPc        =2.04*mm                                                              ;//distance from anod wire center to pc defined by USER
357   Double_t dPadX          =                    0.5*                   AliRICHParam::PadSizeX()  ;//pad X half size parametrised
358   Double_t dPadY          =                    0.5*                   AliRICHParam::PadSizeY()  ;//pad Y half size parametrised
359   Double_t dPadZ          =1.0 *mm            *0.5                                              ;//CsI film thickness 
360   Double_t dGapX          =                    0.5*                          iNpadsX*2*dPadX    ;//gap x half size n. pads x * pad size
361   Double_t dGapY          =                    0.5*                          iNpadsY*2*dPadY    ;//gap y half size
362   Double_t dGapZ          =                    0.5*                    (2*dPadZ+wCathPc+wCathR) ;//gap half thickness
363   Double_t dMirX          =                    0.5*     2*dGapX/TMath::Cos(45*TMath::DegToRad());//Ag mirror x half size defined by gap size and angle 45 degrees
364   Double_t dMirY          =                    0.5*                           2*dGapY           ;//Ag mirror y half size defined by gap size
365   Double_t dMirZ          =1.0 *mm            *0.5                                              ;//Ag mirror z half size defined by USER
366   Double_t wBoxWall       =2.0 *mm                                                              ;//Al box walls thickness defined by USER
367   Double_t dBoxX          =                    0.5*                         (2*dGapX+2*cm)      ;//Al box x half size defined by gap size 2 cm for tolerance
368   Double_t dBoxY          =                    0.5*                         (2*dGapY+2*cm)      ;//Al box y half size defined by gap size 2 cm for tolerance 
369   Double_t dBoxZ          =1.8*m              *0.5                                              ;//Al box z half size defined by USER
370   Double_t dWinX          =                                                  (dBoxX-wBoxWall)   ;//SiO2 window x half size defined by box size
371   Double_t dWinY          =                                                  (dBoxY-wBoxWall)   ;//SiO2 window y half size defined by box size
372   Double_t dWinZ          =1.0*cm             *0.5                                              ;//SiO2 window z half size defined by USER
373   Double_t dCF4X          =                                                  (dBoxX-wBoxWall)   ;//CF4 radiator x half size defined by box size
374   Double_t dCF4Y          =                                                  (dBoxY-wBoxWall)   ;//CF4 radiator y half size defined by box size
375   Double_t dCF4Z          =                                                  0.4*dBoxZ          ;//CF4 radiator z half size defined by box size or by USER
376   Double_t dC4F10X        =                                                  (dBoxX-wBoxWall)   ;//C4F10 radiator x half size defined by box size
377   Double_t dC4F10Y        =                                                  (dBoxY-wBoxWall)   ;//C4F10 radiator y half size defined by box size
378   Double_t dC4F10Z        =                                      (dBoxZ-dWinZ-dCF4Z-wBoxWall)   ;//C4F10 radiator z half size defined by box, CF4 and window sizes
379   
380   Int_t copy;  
381   Double_t rmin,rmax,dx,dy,dz;
382   
383 //make VHMPID type 2 volume  (2 radiators)
384   TGeoVolume *pBox=gGeoManager->MakeBox("Vbox",gGeoManager->GetMedium("RICH_Al"),dx=dBoxX,dy=dBoxY,dz=dBoxZ);
385   
386   TGeoRotation *pRot=new TGeoRotation("VboxRot"); pRot->RotateX(90);//normal position
387   gGeoManager->GetVolume("ALIC")->AddNode(pBox,copy=1,new TGeoCombiTrans(0*m,-5.2*m,2.5*m,pRot));
388 //position C4F10 radiator to Al box   
389   TGeoVolume *pC4F10=gGeoManager->MakeBox("Vc4f",gGeoManager->GetMedium("RICH_C4F10"),dx=dC4F10X,dy=dC4F10Y,dz=dC4F10Z);      
390   pBox->AddNode(pC4F10,copy=1,new TGeoTranslation(0*cm,0*cm,-dBoxZ+wBoxWall+dC4F10Z)); 
391 //position quartz window  to Al box  
392   TGeoVolume *pWindow=gGeoManager->MakeBox( "Vwin",gGeoManager->GetMedium("RICH_SiO2"),dx=dWinX,dy=dWinY,dz=dWinZ); 
393   pBox->AddNode(pWindow,copy=1,new TGeoTranslation(0*cm,0*cm,-dBoxZ+wBoxWall+2*dCF4Z+dWinZ)); 
394 //position CF4 radiator to Al box   
395   TGeoVolume *pCF4=gGeoManager->MakeBox( "Vcf4",gGeoManager->GetMedium("RICH_CF4"),dx=dCF4X,dy=dCF4Y,dz=dCF4Z);                   
396   pBox->AddNode(pCF4,copy=1,new TGeoTranslation(0*cm,0*cm,dBoxZ-wBoxWall-dCF4Z)); 
397 //position mirror to CF4 radiator   
398   TGeoVolume *pMirror=gGeoManager->MakeBox( "Vmir",gGeoManager->GetMedium("RICH_Ag"),dx=dMirX,dy=dMirY,dz=dMirZ);     
399   TGeoRotation *pMirrorRot=new TGeoRotation("VmirRot"); pMirrorRot->RotateY(45);   
400   pCF4->AddNode(pMirror,copy=1,new TGeoCombiTrans(0*cm,0*cm,dCF4Z-1*cm-dGapX,pMirrorRot)); 
401 //position gap to  CF4 radiator   
402   TGeoVolume   *pGap     =gGeoManager->MakeBox ("Vgap"     ,gGeoManager->GetMedium("RICH_CF4"),dx=dGapX , dy=dGapY , dz=dGapZ );  
403   TGeoRotation *pMwpcRot=new TGeoRotation("VmpcRot"); pMwpcRot->RotateY(90);  
404   pCF4->AddNode(pGap,copy=1,new TGeoCombiTrans(-dBoxX+1*cm,0*cm,dCF4Z-1*cm-dGapX,pMwpcRot)); 
405 //divide gap into 80x48 cells
406   Int_t axis,ndiv; Double_t start,step;
407   TGeoVolume *pGapCol =pGap      ->Divide("Vcol",axis=1,ndiv=iNpadsX,start=0,step=0);//divide VhGap along X by NpadsX columns
408   TGeoVolume *pGapCell=pGapCol   ->Divide("Vcel",axis=2,ndiv=iNpadsY,start=0,step=0);//divide VhGapCol along Y by NpadsY cells
409 //position pad to gap cell
410   TGeoVolume *pPad=gGeoManager->MakeBox ("Vpad",gGeoManager->GetMedium("RICH_CsI"),dx=dPadX,dy=dPadY,dz=dPadZ);      
411   pGapCell->AddNode(pPad,copy=1,new TGeoTranslation(0,0,-dGapZ+dPadZ)); 
412 //define wire rotation common for both anod and cathode wires
413   TGeoRotation *pWireRot=new TGeoRotation("VwireRot"); pWireRot->RotateY(90); //rotate wires around Y to be along X (initially along Z)
414 //position 2 anod  wires to gap cell
415   TGeoVolume *pAnodWire =gGeoManager->MakeTube("Vano",gGeoManager->GetMedium("RICH_W")  ,rmin=0   , rmax=wAnodR   , dz=dPadX );  
416   pGapCell->AddNode(pAnodWire,copy=1,new TGeoCombiTrans (0, -dPadY+wAnodShift             , -dGapZ+wAnodPc+2*dPadZ , pWireRot)); 
417   pGapCell->AddNode(pAnodWire,copy=2,new TGeoCombiTrans (0,  dPadY-wAnodShift             , -dGapZ+wAnodPc+2*dPadZ , pWireRot)); 
418 //position 4 cathode wires to gap cell  
419   TGeoVolume *pCathWire =gGeoManager->MakeTube("Vcat",gGeoManager->GetMedium("RICH_Cu") ,rmin=0   , rmax=wCathR , dz=dPadX );
420   pGapCell->AddNode(pCathWire,copy=1,new TGeoCombiTrans (0, -dPadY+wCathShift            , -dGapZ+wCathPc+2*dPadZ , pWireRot)); 
421   pGapCell->AddNode(pCathWire,copy=2,new TGeoCombiTrans (0, -dPadY+wCathShift+wCathPitch , -dGapZ+wCathPc+2*dPadZ , pWireRot)); 
422   pGapCell->AddNode(pCathWire,copy=3,new TGeoCombiTrans (0,  dPadY-wCathShift-wCathPitch , -dGapZ+wCathPc+2*dPadZ , pWireRot)); 
423   pGapCell->AddNode(pCathWire,copy=4,new TGeoCombiTrans (0,  dPadY-wCathShift            , -dGapZ+wCathPc+2*dPadZ , pWireRot)); 
424 }//Vhmpid()
425 //__________________________________________________________________________________________________
426 void Axis()
427 {
428 // Draw axises  on top of geometry    
429   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};  
430   TPolyLine3D *pXaxis=new TPolyLine3D(2,X);pXaxis->SetLineColor(kRed);   pXaxis->Draw();
431   TPolyLine3D *pYaxis=new TPolyLine3D(2,Y);pYaxis->SetLineColor(kGreen); pYaxis->Draw();
432   TPolyLine3D *pZaxis=new TPolyLine3D(2,Z);pZaxis->SetLineColor(kBlue);  pZaxis->Draw();  
433 }
434 //__________________________________________________________________________________________________