]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCv1.cxx
Formatting changes.
[u/mrichter/AliRoot.git] / TPC / AliTPCv1.cxx
index 582a05083b2402d9ee3a6828751c26c3e592d79e..0209c58625a40bbeddfdd1dc28d2d2e01815fe0b 100644 (file)
@@ -38,6 +38,8 @@
 #include <TNode.h>
 #include <TTUBE.h>
 #include <TVirtualMC.h>
+#include <TString.h>
+#include <TSystem.h>
 
 #include "AliConst.h"
 #include "AliRun.h"
@@ -59,7 +61,8 @@ ClassImp(AliTPCv1)
 
 //_____________________________________________________________________________
 
-  AliTPCv1::AliTPCv1(){
+  AliTPCv1::AliTPCv1():AliTPC(),fIdSens(0)
+{
 
   fHitType = 1;
 
@@ -67,11 +70,11 @@ ClassImp(AliTPCv1)
  
 //_____________________________________________________________________________
 AliTPCv1::AliTPCv1(const char *name, const char *title) 
-  :AliTPC(name, title) {
+  :AliTPC(name, title),fIdSens(0)
+ {
   //
   // Standard constructor for Time Projection Chamber
   //
-  fIdSens=0;
 
 
   if (fTPCParam)
@@ -115,7 +118,7 @@ void AliTPCv1::CreateGeometry()
   //
   TGeoPcon *tpc = new TGeoPcon(0.,360.,18); //18 sections
   tpc->DefineSection(0,-290.,77.,278.);
-  tpc->DefineSection(1,-259.6,77.,278.);
+  tpc->DefineSection(1,-259.6,70.,278.);
   //
   tpc->DefineSection(2,-259.6,68.1,278.);
   tpc->DefineSection(3,-253.6,68.1,278.);
@@ -138,7 +141,7 @@ void AliTPCv1::CreateGeometry()
   tpc->DefineSection(14,253.6,65.6,278.);
   tpc->DefineSection(15,259.6,65.6,278.);
   //
-  tpc->DefineSection(16,259.6,77.0,278.);
+  tpc->DefineSection(16,259.6,70.0,278.);
   tpc->DefineSection(17,290.,77.,278.);
   //
   TGeoMedium *m1 = gGeoManager->GetMedium("TPC_Air");
@@ -244,7 +247,7 @@ void AliTPCv1::CreateGeometry()
   //
   tf1v->AddNode(tf2v,1); tf2v->AddNode(tf3v,1);
   //
-  v3->AddNode(tov1,1); v4->AddNode(tf1v,1);
+  v3->AddNode(tov1,1,new TGeoTranslation(0.,0.,-1.5)); v4->AddNode(tf1v,1);
   //
   v2->AddNode(v3,1); v2->AddNode(v4,1); 
   //
@@ -424,12 +427,12 @@ void AliTPCv1::CreateGeometry()
   //
   // define reflection matrix 
   //
-  TGeoRotation *ref = new TGeoRotation("ref",90.,0.,90.,270.,180.,0.);
+  TGeoRotation *ref = new TGeoRotation("ref",90.,0.,90.,90.,180.,0.);
   //
   cd1v->AddNode(cd2v,1); cd2v->AddNode(cd3v,1); cflv->AddNode(cd1v,1);
   //
-  v1->AddNode(siv,1,new TGeoTranslation(0.,0.,-72.1));
-  v1->AddNode(siv,2,new TGeoTranslation(0.,0.,72.1));
+  v1->AddNode(siv,1,new TGeoTranslation(0.,0.,-70.1));
+  v1->AddNode(siv,2,new TGeoTranslation(0.,0.,70.1));
   v1->AddNode(sev,1); v1->AddNode(sev,2,ref); v1->AddNode(cflv,1);
   //
   // central membrane - 2 rings and a mylar membrane - assembly
@@ -450,25 +453,25 @@ void AliTPCv1::CreateGeometry()
   // end caps - they are make as an assembly of single segments
   // containing both readout chambers
   //
-  Double_t OpeningAngle = 10.*TMath::DegToRad();
+  Double_t openingAngle = 10.*TMath::DegToRad();
   Double_t thick=1.5; // rib
-  Double_t shift = thick/TMath::Sin(OpeningAngle);
+  Double_t shift = thick/TMath::Sin(openingAngle);
   //
-  Double_t LowEdge = 86.3; // hole in the wheel
-  Double_t UpEdge = 240.4; // hole in the wheel
+  Double_t lowEdge = 86.3; // hole in the wheel
+  Double_t upEdge = 240.4; // hole in the wheel
   //
   new TGeoTubeSeg("sec",74.5,264.4,3.,0.,20.);
   //
   TGeoPgon *hole = new TGeoPgon("hole",0.,20.,1,4);
   //
-  hole->DefineSection(0,-3.5,LowEdge-shift,UpEdge-shift);
-  hole->DefineSection(1,-1.5,LowEdge-shift,UpEdge-shift);
+  hole->DefineSection(0,-3.5,lowEdge-shift,upEdge-shift);
+  hole->DefineSection(1,-1.5,lowEdge-shift,upEdge-shift);
   //
-  hole->DefineSection(2,-1.5,LowEdge-shift,UpEdge+3.-shift);
-  hole->DefineSection(3,3.5,LowEdge-shift,UpEdge+3.-shift);
+  hole->DefineSection(2,-1.5,lowEdge-shift,upEdge+3.-shift);
+  hole->DefineSection(3,3.5,lowEdge-shift,upEdge+3.-shift);
   //
-  Double_t ys = shift*TMath::Sin(OpeningAngle); 
-  Double_t xs = shift*TMath::Cos(OpeningAngle);
+  Double_t ys = shift*TMath::Sin(openingAngle); 
+  Double_t xs = shift*TMath::Cos(openingAngle);
   TGeoTranslation *tr = new TGeoTranslation("tr",xs,ys,0.);  
   tr->RegisterYourself();
   TGeoCompositeShape *chamber = new TGeoCompositeShape("sec-hole:tr");
@@ -514,12 +517,15 @@ void AliTPCv1::CreateGeometry()
    //
    TGeoBBox *conn = new TGeoBBox(0.4,0.3,4.675); // identical for iroc and oroc
    TGeoVolume *connv = new TGeoVolume("TPC_RCCON",conn,m1);
+   TString fileName(gSystem->Getenv("ALICE_ROOT"));
+   fileName += "/TPC/conn_iroc.dat";
    ifstream in;
-   in.open("conn_iroc.dat", ios_base::in); // asci file
+   in.open(fileName.Data(), ios_base::in); // asci file
    for(Int_t i =0;i<86;i++){
-      Double_t y = 3.9;
+      Double_t y = 3.99;
       Double_t x,z,ang;
       in>>x>>z>>ang;
+      z-=26.5;
       TGeoRotation *rrr = new TGeoRotation();
       rrr->RotateY(ang);
       TGeoCombiTrans *trans = new TGeoCombiTrans("trans",x,y,z,rrr);
@@ -630,7 +636,9 @@ void AliTPCv1::CreateGeometry()
    //
    // holes for connectors
    //
-   in.open("conn_oroc.dat", ios_base::in); // asci file
+   fileName = gSystem->Getenv("ALICE_ROOT");
+   fileName += "/TPC/conn_oroc.dat";
+   in.open(fileName.Data(), ios_base::in); // asci file
    for(Int_t i =0;i<78;i++){
       Double_t y =3.89;
       Double_t x,z,ang;
@@ -689,11 +697,11 @@ void AliTPCv1::CreateGeometry()
    *rot=rot1*rot2;
    //
    Double_t x0,y0;
-   x0=110.2*TMath::Cos(OpeningAngle);
-   y0=110.2*TMath::Sin(OpeningAngle);
+   x0=110.2*TMath::Cos(openingAngle);
+   y0=110.2*TMath::Sin(openingAngle);
    TGeoCombiTrans *combi1 = new TGeoCombiTrans("combi1",x0,y0,1.09,rot);
-   x0=188.45*TMath::Cos(OpeningAngle);
-   y0=188.45*TMath::Sin(OpeningAngle);
+   x0=188.45*TMath::Cos(openingAngle);
+   y0=188.45*TMath::Sin(openingAngle);
    TGeoCombiTrans *combi2 = new TGeoCombiTrans("combi2",x0,y0,0.99,rot);
    //
    sect->AddNode(ch,1);
@@ -713,9 +721,9 @@ void AliTPCv1::CreateGeometry()
     
    }
    // wheels in the drift volume!
-   v9->AddNode(wheel,1,new TGeoTranslation(0.,0.,-256.6));
    TGeoCombiTrans *combi3 = new TGeoCombiTrans("combi3",0.,0.,256.6,ref);
-   v9->AddNode(wheel,2,combi3);
+   v9->AddNode(wheel,1,combi3);
+   v9->AddNode(wheel,2,new TGeoTranslation(0.,0.,-256.6));
    
    //_____________________________________________________________
    // service support wheel
@@ -726,14 +734,23 @@ void AliTPCv1::CreateGeometry()
   TGeoVolume *swv = new TGeoVolume("TPC_SWSEG",sw,m3); //Al
   //
   thick=1.;
-  shift = thick/TMath::Sin(OpeningAngle);
+  shift = thick/TMath::Sin(openingAngle);
   TGeoPgon *sh = new TGeoPgon(0.,20.,1,2);
   sh->DefineSection(0,-4.,81.5-shift,250.75-shift);
   sh->DefineSection(1,4.,81.5-shift,250.75-shift);
   TGeoVolume *shv = new TGeoVolume("TPC_SWS1",sh,m1); //Air
   //
-  ys = shift*TMath::Sin(OpeningAngle);
-  xs = shift*TMath::Cos(OpeningAngle);
+  TGeoMedium *m9 =  gGeoManager->GetMedium("TPC_Si"); 
+  TGeoPgon *el = new TGeoPgon(0.,20.,1,2);
+  el->DefineSection(0,-1.872,81.5-shift,250.75-shift);
+  el->DefineSection(1,1.872,81.5-shift,250.75-shift);
+  TGeoVolume *elv = new TGeoVolume("TPC_ELEC",el,m9); //Si 
+  //
+  shv->AddNode(elv,1);
+  //
+  //
+  ys = shift*TMath::Sin(openingAngle);
+  xs = shift*TMath::Cos(openingAngle);
   swv->AddNode(shv,1,new TGeoTranslation(xs,ys,0.));
   // cover
   TGeoPgon *co = new TGeoPgon(0.,20.,1,2);
@@ -742,14 +759,14 @@ void AliTPCv1::CreateGeometry()
   TGeoVolume *cov = new TGeoVolume("TPC_SWC1",co,m3);//Al
   // hole in a cover
   TGeoPgon *coh = new TGeoPgon(0.,20.,1,2);
-  shift=4./TMath::Sin(OpeningAngle);
+  shift=4./TMath::Sin(openingAngle);
   coh->DefineSection(0,-0.5,85.-shift,247.25-shift);
   coh->DefineSection(1,0.5,85.-shift,247.25-shift);  
   //
   TGeoVolume *cohv = new TGeoVolume("TPC_SWC2",coh,m1);
   //
-  ys = shift*TMath::Sin(OpeningAngle);
-  xs = shift*TMath::Cos(OpeningAngle);  
+  ys = shift*TMath::Sin(openingAngle);
+  xs = shift*TMath::Cos(openingAngle);  
   cov->AddNode(cohv,1,new TGeoTranslation(xs,ys,0.));
   //
   // Sector as an Assembly
@@ -840,14 +857,14 @@ void AliTPCv1::CreateGeometry()
   
   //
   //HV rods - makrolon + 0.58cm (diameter) Cu
-  TGeoTube *hvr = new TGeoTube(0.,4.4,126.64);
+  TGeoTube *hvr = new TGeoTube(0.,2.2,126.64);
   TGeoTube *hvc = new TGeoTube(0.,0.29,126.64);
   //
   TGeoVolume *hvrv = new TGeoVolume("TPC_HV_Rod",hvr,m6);
   TGeoVolume *hvcv = new TGeoVolume("TPC_HV_Cable",hvc,m7);
   hvrv->AddNode(hvcv,1);
   
-  for(Int_t i=0;i<17;i++){
+  for(Int_t i=0;i<18;i++){
     Double_t angle,x,y;
     Double_t z,r; 
     angle=TMath::DegToRad()*20.*(Double_t)i;
@@ -873,7 +890,8 @@ void AliTPCv1::CreateGeometry()
     gGeoManager->Node("TPC_Rod",i+54,"TPC_Drift",x,y,-z,0,kTRUE,upar,3);
   }
 
-  gMC->Gspos("TPC_M",1,"ALIC",0.,0.,0.,0,"ONLY");
+  TGeoVolume *alice = gGeoManager->GetVolume("ALIC");
+  alice->AddNode(v1,1);
 
 } // end of function