]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
New TRD version now inserted in the space frame
authorfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 Jul 1999 05:48:42 +0000 (05:48 +0000)
committerfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 Jul 1999 05:48:42 +0000 (05:48 +0000)
TRD/AliTRD.cxx
TRD/AliTRD.h
TRD/AliTRDconst.h [new file with mode: 0644]
TRD/AliTRDv0.cxx
TRD/AliTRDv0.h
TRD/AliTRDv1.cxx
TRD/AliTRDv1.h
TRD/AliTRDv2.cxx
TRD/AliTRDv2.h
TRD/DrawTRD.C
TRD/ViewTRD.C

index 711270fdeb0787875a7e76a2c116b5d0c627437f..527172204f3907bdecc364c5ba578ff724bfb5f2 100644 (file)
@@ -31,12 +31,17 @@ AliTRD::AliTRD()
   //
   // Default constructor
   //
   //
   // Default constructor
   //
+
   fIshunt      = 0;
   fGasMix      = 0;
   fIshunt      = 0;
   fGasMix      = 0;
-  fSensSelect  = 0;
-  fSensPlane   = 0;
-  fSensChamber = 0;
-  fSensSector  = 0;
+
+  // The chamber dimensions
+  for (Int_t iplan = 0; iplan < kNplan; iplan++) {
+    fClengthI[iplan] = 0.;
+    fClengthM[iplan] = 0.;
+    fClengthO[iplan] = 0.;
+  }
+
 }
  
 //_____________________________________________________________________________
 }
  
 //_____________________________________________________________________________
@@ -47,19 +52,30 @@ AliTRD::AliTRD(const char *name, const char *title)
   // Standard constructor for the TRD
   //
 
   // Standard constructor for the TRD
   //
 
-  //
+
+  // Check that FRAME is there otherwise we have no place where to put the TRD
+  AliModule* FRAME = gAlice->GetModule("FRAME");
+  if (!FRAME) {
+    Error("AliTRD","TRD needs FRAME to be present\n");
+    exit(1);
+  }
+
   // Allocate the hit array
   // Allocate the hit array
   fHits   = new TClonesArray("AliTRDhit",  405);
   
   fHits   = new TClonesArray("AliTRDhit",  405);
   
-  fIshunt      = 0;
-  fGasMix      = 0;
-  fSensSelect  = 0;
-  fSensPlane   = 0;
-  fSensChamber = 0;
-  fSensSector  = 0;
+  fIshunt = 0;
+  fGasMix = 0;
+
+  // The chamber dimensions
+  for (Int_t iplan = 0; iplan < kNplan; iplan++) {
+    fClengthI[iplan] = 0.;
+    fClengthM[iplan] = 0.;
+    fClengthO[iplan] = 0.;
+    fCwidth[iplan]   = 0.;
+  }
   
   SetMarkerColor(kWhite);   
   
   SetMarkerColor(kWhite);   
+
 }
  
 //_____________________________________________________________________________
 }
  
 //_____________________________________________________________________________
@@ -68,8 +84,10 @@ void AliTRD::AddHit(Int_t track, Int_t *vol, Float_t *hits)
   //
   // Add a hit for the TRD
   //
   //
   // Add a hit for the TRD
   //
+
   TClonesArray &lhits = *fHits;
   new(lhits[fNhits++]) AliTRDhit(fIshunt,track,vol,hits);
   TClonesArray &lhits = *fHits;
   new(lhits[fNhits++]) AliTRDhit(fIshunt,track,vol,hits);
+
 }
 
 //_____________________________________________________________________________
 }
 
 //_____________________________________________________________________________
@@ -78,21 +96,22 @@ void AliTRD::BuildGeometry()
   //
   // Create the ROOT TNode geometry for the TRD
   //
   //
   // Create the ROOT TNode geometry for the TRD
   //
+
   TNode *Node, *Top;
   TPGON *pgon;
   const Int_t kColorTRD = 46;
   
   // Find the top node alice
   TNode *Node, *Top;
   TPGON *pgon;
   const Int_t kColorTRD = 46;
   
   // Find the top node alice
-  Top=gAlice->GetGeometry()->GetNode("alice");
+  Top = gAlice->GetGeometry()->GetNode("alice");
   
   
-  pgon = new TPGON("S_TRD","TRD","void",0,360,nsect,4);
-  Float_t ff    = TMath::Cos(kDegrad * 180 / nsect);
-  Float_t rrmin = rmin / ff;
-  Float_t rrmax = rmax / ff;
-  pgon->DefineSection(0,-zmax1,rrmax,rrmax);
-  pgon->DefineSection(1,-zmax2,rrmin,rrmax);
-  pgon->DefineSection(2, zmax2,rrmin,rrmax);
-  pgon->DefineSection(3, zmax1,rrmax,rrmax);
+  pgon = new TPGON("S_TRD","TRD","void",0,360,kNsect,4);
+  Float_t ff    = TMath::Cos(kDegrad * 180 / kNsect);
+  Float_t rrmin = kRmin / ff;
+  Float_t rrmax = kRmax / ff;
+  pgon->DefineSection(0,-kZmax1,rrmax,rrmax);
+  pgon->DefineSection(1,-kZmax2,rrmin,rrmax);
+  pgon->DefineSection(2, kZmax2,rrmin,rrmax);
+  pgon->DefineSection(3, kZmax1,rrmax,rrmax);
   Top->cd();
   Node = new TNode("TRD","TRD","S_TRD",0,0,0,"");
   Node->SetLineColor(kColorTRD);
   Top->cd();
   Node = new TNode("TRD","TRD","S_TRD",0,0,0,"");
   Node->SetLineColor(kColorTRD);
@@ -101,9 +120,358 @@ void AliTRD::BuildGeometry()
 }
  
 //_____________________________________________________________________________
 }
  
 //_____________________________________________________________________________
-void AliTRD::CreateMaterials()
+void AliTRD::CreateGeometry()
 {
 {
+  //
+  // Creates the volumes for the TRD chambers
+  //
+  // Author: Christoph Blume (C.Blume@gsi.de) 20/07/99
+  //
+  // The volumes:
+  //    TRD        (Air)   --- The TRD mother volume for one sector. 
+  //                           To be placed into the spaceframe.
+  //
+  //    UAFI(/M/O) (Al)    --- The aluminum frame of the inner(/middle/outer) chambers (readout)
+  //    UCFI(/M/O) (C)     --- The carbon frame of the inner(/middle/outer) chambers 
+  //                           (driftchamber + radiator)
+  //    UAII(/M/O) (Air)   --- The inner part of the readout of the inner(/middle/outer) chambers
+  //    UFII(/M/O) (Air)   --- The inner part of the chamner and radiator of the 
+  //                           inner(/middle/outer) chambers
+  //
+  // The material layers in one chamber:
+  //    UL01       (G10)   --- The gas seal of the radiator
+  //    UL02       (CO2)   --- The gas in the radiator
+  //    UL03       (PE)    --- The foil stack
+  //    UL04       (Mylar) --- Entrance window to the driftvolume and HV-cathode
+  //    UL05       (Xe)    --- The driftvolume
+  //    UL06       (Xe)    --- The amplification region
+  //    
+  //    UL07       (Cu)    --- The pad plane
+  //    UL08       (G10)   --- The Nomex honeycomb support structure
+  //    UL09       (Cu)    --- FEE and signal lines
+  //    UL10       (PE)    --- The cooling devices
+  //    UL11       (Water) --- The cooling water
+
+  // Check that FRAME is there otherwise we have no place where to put the TRD
+  AliModule* FRAME = gAlice->GetModule("FRAME");
+  if (!FRAME) return;
+
+  const Int_t npar_trd = 4;
+  const Int_t npar_cha = 3;
+
+  Float_t par_dum[3];
+  Float_t par_trd[npar_trd];
+  Float_t par_cha[npar_cha];
+
+  Float_t xpos, ypos, zpos;
+
+  Int_t *idtmed = fIdtmed->GetArray()-1299;
+
+  // The length of the inner chambers
+  for (Int_t iplan = 0; iplan < kNplan; iplan++) fClengthI[iplan] = 110.0;
+  // The length of the middle chambers
+  fClengthM[0] = 123.5;
+  fClengthM[1] = 131.0;
+  fClengthM[2] = 138.5;
+  fClengthM[3] = 146.0;
+  fClengthM[4] = 153.0;
+  fClengthM[5] = 160.5;
+  // The length of the outer chambers
+  fClengthO[0] = 123.5;
+  fClengthO[1] = 131.0;
+  fClengthO[2] = 134.5;
+  fClengthO[3] = 142.0;
+  fClengthO[4] = 142.0;
+  fClengthO[5] = 134.5;
+
+  // The width of the chambers
+  fCwidth[0] =  99.6;
+  fCwidth[1] = 104.1;
+  fCwidth[2] = 108.5;
+  fCwidth[3] = 112.9;
+  fCwidth[4] = 117.4;
+  fCwidth[5] = 121.8;
+
+  // The TRD mother volume for one sector (Air) (dimensions identical to BTR1-3)
+  par_trd[0] = kSwidth1/2.;
+  par_trd[1] = kSwidth2/2.;
+  par_trd[2] = kSlength/2.;
+  par_trd[3] = kSheight/2.;
+  gMC->Gsvolu("TRD ","TRD1",idtmed[1302-1],par_trd,npar_trd);
+
+  // The aluminum frames - readout + electronics (Al)
+  // The inner chambers
+  gMC->Gsvolu("UAFI","BOX ",idtmed[1301-1],par_dum,0);
+  // The middle chambers
+  gMC->Gsvolu("UAFM","BOX ",idtmed[1301-1],par_dum,0);
+  // The outer chambers
+  gMC->Gsvolu("UAFO","BOX ",idtmed[1301-1],par_dum,0);
+
+  // The inner part of the aluminum frames (Air)
+  // The inner chambers
+  gMC->Gsvolu("UAII","BOX ",idtmed[1302-1],par_dum,0);
+  // The middle chambers
+  gMC->Gsvolu("UAIM","BOX ",idtmed[1302-1],par_dum,0);
+  // The outer chambers
+  gMC->Gsvolu("UAIO","BOX ",idtmed[1302-1],par_dum,0);
+
+  // The carbon frames - radiator + driftchamber (C)
+  // The inner chambers
+  gMC->Gsvolu("UCFI","BOX ",idtmed[1307-1],par_dum,0);
+  // The middle chambers
+  gMC->Gsvolu("UCFM","BOX ",idtmed[1307-1],par_dum,0);
+  // The outer chambers
+  gMC->Gsvolu("UCFO","BOX ",idtmed[1307-1],par_dum,0);
+
+  // The inner part of the carbon frames (Air)
+  // The inner chambers
+  gMC->Gsvolu("UCII","BOX ",idtmed[1302-1],par_dum,0);
+  // The middle chambers
+  gMC->Gsvolu("UCIM","BOX ",idtmed[1302-1],par_dum,0);
+  // The outer chambers
+  gMC->Gsvolu("UCIO","BOX ",idtmed[1302-1],par_dum,0);
+
+  // The material layers inside the chambers
+  par_cha[0] = -1.;
+  par_cha[1] = -1.;
+  // G10 layer (radiator seal)
+  par_cha[2] = kSeThick/2;
+  gMC->Gsvolu("UL01","BOX ",idtmed[1313-1],par_cha,npar_cha);
+  // CO2 layer (radiator)
+  par_cha[2] = kRaThick/2;
+  gMC->Gsvolu("UL02","BOX ",idtmed[1312-1],par_cha,npar_cha);
+  // PE layer (radiator)
+  par_cha[2] = kPeThick/2;
+  gMC->Gsvolu("UL03","BOX ",idtmed[1303-1],par_cha,npar_cha);
+  // Mylar layer (entrance window + HV cathode) 
+  par_cha[2] = kMyThick/2;
+  gMC->Gsvolu("UL04","BOX ",idtmed[1308-1],par_cha,npar_cha);
+  // Xe/Isobutane layer (drift volume, sensitive) 
+  par_cha[2] = kDrThick/2.;
+  gMC->Gsvolu("UL05","BOX ",idtmed[1309-1],par_cha,npar_cha);
+  // Xe/Isobutane layer (amplification volume, not sensitive)
+  par_cha[2] = kAmThick/2.;
+  gMC->Gsvolu("UL06","BOX ",idtmed[1309-1],par_cha,npar_cha);
+  
+  // Cu layer (pad plane)
+  par_cha[2] = kCuThick/2;
+  gMC->Gsvolu("UL07","BOX ",idtmed[1305-1],par_cha,npar_cha);
+  // G10 layer (support structure)
+  par_cha[2] = kSuThick/2;
+  gMC->Gsvolu("UL08","BOX ",idtmed[1313-1],par_cha,npar_cha);
+  // Cu layer (FEE + signal lines)
+  par_cha[2] = kFeThick/2;
+  gMC->Gsvolu("UL09","BOX ",idtmed[1305-1],par_cha,npar_cha);
+  // PE layer (cooling devices)
+  par_cha[2] = kCoThick/2;
+  gMC->Gsvolu("UL10","BOX ",idtmed[1303-1],par_cha,npar_cha);
+  // Water layer (cooling)
+  par_cha[2] = kWaThick/2;
+  gMC->Gsvolu("UL11","BOX ",idtmed[1314-1],par_cha,npar_cha);
+
+  // Position the layers in the chambers
+  xpos = 0;
+  ypos = 0;
+
+  // G10 layer (radiator seal)
+  zpos = kSeZpos;
+  gMC->Gspos("UL01",1,"UCII",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("UL01",2,"UCIM",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("UL01",3,"UCIO",xpos,ypos,zpos,0,"ONLY");
+  // CO2 layer (radiator)
+  zpos = kRaZpos;
+  gMC->Gspos("UL02",1,"UCII",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("UL02",2,"UCIM",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("UL02",3,"UCIO",xpos,ypos,zpos,0,"ONLY");
+  // PE layer (radiator)
+  zpos = 0;
+  gMC->Gspos("UL03",1,"UL02",xpos,ypos,zpos,0,"ONLY");
+  // Mylar layer (entrance window + HV cathode)   
+  zpos = kMyZpos;
+  gMC->Gspos("UL04",1,"UCII",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("UL04",2,"UCIM",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("UL04",3,"UCIO",xpos,ypos,zpos,0,"ONLY");
+  // Xe/Isobutane layer (drift volume) 
+  zpos = kDrZpos;
+  gMC->Gspos("UL05",1,"UCII",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("UL05",2,"UCIM",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("UL05",3,"UCIO",xpos,ypos,zpos,0,"ONLY");
+  // Xe/Isobutane layer (amplification volume)
+  zpos = kAmZpos;
+  gMC->Gspos("UL06",1,"UCII",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("UL06",2,"UCIM",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("UL06",3,"UCIO",xpos,ypos,zpos,0,"ONLY");
+
+  // Cu layer (pad plane)
+  zpos = kCuZpos;
+  gMC->Gspos("UL07",1,"UAII",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("UL07",2,"UAIM",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("UL07",3,"UAIO",xpos,ypos,zpos,0,"ONLY");
+  // G10 layer (support structure)
+  zpos = kSuZpos;
+  gMC->Gspos("UL08",1,"UAII",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("UL08",2,"UAIM",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("UL08",3,"UAIO",xpos,ypos,zpos,0,"ONLY");
+  // Cu layer (FEE + signal lines)
+  zpos = kFeZpos; 
+  gMC->Gspos("UL09",1,"UAII",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("UL09",2,"UAIM",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("UL09",3,"UAIO",xpos,ypos,zpos,0,"ONLY");
+  // PE layer (cooling devices)
+  zpos = kCoZpos;
+  gMC->Gspos("UL10",1,"UAII",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("UL10",2,"UAIM",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("UL10",3,"UAIO",xpos,ypos,zpos,0,"ONLY");
+  // Water layer (cooling)
+  zpos = kWaZpos;
+  gMC->Gspos("UL11",1,"UAII",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("UL11",1,"UAIM",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("UL11",1,"UAIO",xpos,ypos,zpos,0,"ONLY");
+
+  // Position the chambers in the TRD mother volume
+  for (Int_t iplan = 1; iplan <= kNplan; iplan++) {
+
+    // The inner chambers ---------------------------------------------------------------
+
+    // the aluminum frame
+    //par_cha[0] = kSwidth1/2. + (iplan-1) * kCwidcha/2.;
+    par_cha[0] = fCwidth[iplan-1]/2.;
+    par_cha[1] = fClengthI[iplan-1]/2.;
+    par_cha[2] = kCaframe/2.;
+    xpos       = 0.;
+    ypos       = 0.;
+    zpos       = kCheight - kCaframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
+    gMC->Gsposp("UAFI",iplan       ,"TRD ",xpos,ypos,zpos,0,"MANY",par_cha,npar_cha);
+
+    // the inner part of the aluminum frame
+    //par_cha[0] = kSwidth1/2. + (iplan-1) * kCwidcha/2. - kCathick;
+    par_cha[0] = fCwidth[iplan-1]/2.   - kCathick;
+    par_cha[1] = fClengthI[iplan-1]/2. - kCathick;
+    par_cha[2] = kCaframe/2.;
+    xpos       = 0.;
+    ypos       = 0.;
+    zpos       = kCheight - kCaframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
+    gMC->Gsposp("UAII",iplan       ,"TRD ",xpos,ypos,zpos,0,"ONLY",par_cha,npar_cha);
+
+    // the carbon frame
+    //par_cha[0] = kSwidth1/2. + (iplan-1) * kCwidcha/2.;
+    par_cha[0] = fCwidth[iplan-1]/2.;
+    par_cha[1] = fClengthI[iplan-1]/2.;
+    par_cha[2] = kCcframe/2.;
+    xpos       = 0.;
+    ypos       = 0.;
+    zpos       = kCcframe/2.            - kSheight/2. + (iplan-1) * (kCheight + kCspace);
+    gMC->Gsposp("UCFI",iplan       ,"TRD ",xpos,ypos,zpos,0,"MANY",par_cha,npar_cha);
+
+    // the inner part of the carbon frame
+    //par_cha[0] = kSwidth1/2. + (iplan-1) * kCwidcha/2. - kCcthick;
+    par_cha[0] = fCwidth[iplan-1]/2.   - kCcthick;
+    par_cha[1] = fClengthI[iplan-1]/2. - kCcthick;
+    par_cha[2] = kCcframe/2.;
+    xpos       = 0.;
+    ypos       = 0.;
+    zpos       = kCcframe/2.            - kSheight/2. + (iplan-1) * (kCheight + kCspace);
+    gMC->Gsposp("UCII",iplan       ,"TRD ",xpos,ypos,zpos,0,"ONLY",par_cha,npar_cha);
+
+    // The middle chambers --------------------------------------------------------------
+
+    // the aluminum frame
+    //par_cha[0] = kSwidth1/2. + (iplan-1) * kCwidcha/2.;
+    par_cha[0] = fCwidth[iplan-1]/2.;
+    par_cha[1] = fClengthM[iplan-1]/2.;
+    par_cha[2] = kCaframe/2.;
+    xpos       = 0.;
+    ypos       = fClengthI[iplan-1]/2. + fClengthM[iplan-1]/2.;
+    zpos       = kCheight - kCaframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
+    gMC->Gsposp("UAFM",iplan       ,"TRD ",xpos, ypos,zpos,0,"MANY",par_cha,npar_cha);
+    gMC->Gsposp("UAFM",iplan+kNplan,"TRD ",xpos,-ypos,zpos,0,"MANY",par_cha,npar_cha);
+
+    // the inner part of the aluminum frame
+    //par_cha[0] = kSwidth1/2. + (iplan-1) * kCwidcha/2. - kCathick;
+    par_cha[0] = fCwidth[iplan-1]/2.   - kCathick;
+    par_cha[1] = fClengthM[iplan-1]/2. - kCathick;
+    par_cha[2] = kCaframe/2.;
+    xpos       = 0.;
+    ypos       = fClengthI[iplan-1]/2. + fClengthM[iplan-1]/2.;
+    zpos       = kCheight - kCaframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
+    gMC->Gsposp("UAIM",iplan       ,"TRD ",xpos, ypos,zpos,0,"ONLY",par_cha,npar_cha);
+    gMC->Gsposp("UAIM",iplan+kNplan,"TRD ",xpos,-ypos,zpos,0,"ONLY",par_cha,npar_cha);
+
+    // the carbon frame
+    //par_cha[0] = kSwidth1/2. + (iplan-1) * kCwidcha/2.;
+    par_cha[0] = fCwidth[iplan-1]/2.;
+    par_cha[1] = fClengthM[iplan-1]/2.;
+    par_cha[2] = kCcframe/2.;
+    xpos       = 0.;
+    ypos       = fClengthI[iplan-1]/2. + fClengthM[iplan-1]/2.;
+    zpos       = kCcframe/2.            - kSheight/2. + (iplan-1) * (kCheight + kCspace);
+    gMC->Gsposp("UCFM",iplan,       "TRD ",xpos, ypos,zpos,0,"MANY",par_cha,npar_cha);
+    gMC->Gsposp("UCFM",iplan+kNplan,"TRD ",xpos,-ypos,zpos,0,"MANY",par_cha,npar_cha);
+
+    // the inner part of the carbon frame
+    //par_cha[0] = kSwidth1/2. + (iplan-1) * kCwidcha/2. - kCcthick;
+    par_cha[0] = fCwidth[iplan-1]/2.   - kCcthick;
+    par_cha[1] = fClengthM[iplan-1]/2. - kCcthick;
+    par_cha[2] = kCcframe/2.;
+    xpos       = 0.;
+    ypos       = fClengthI[iplan-1]/2. + fClengthM[iplan-1]/2.;
+    zpos       = kCcframe/2.            - kSheight/2. + (iplan-1) * (kCheight + kCspace);
+    gMC->Gsposp("UCIM",iplan       ,"TRD ",xpos, ypos,zpos,0,"ONLY",par_cha,npar_cha);
+    gMC->Gsposp("UCIM",iplan+kNplan,"TRD ",xpos,-ypos,zpos,0,"ONLY",par_cha,npar_cha);
+
+    // The outer chambers ---------------------------------------------------------------
+
+    // the aluminum frame
+    //par_cha[0] = kSwidth1/2. + (iplan-1) * kCwidcha/2.;
+    par_cha[0] = fCwidth[iplan-1]/2.;
+    par_cha[1] = fClengthO[iplan-1]/2.;
+    par_cha[2] = kCaframe/2.;
+    xpos       = 0.;
+    ypos       = fClengthI[iplan-1]/2. + fClengthM[iplan-1]    + fClengthO[iplan-1]/2.;
+    zpos       = kCheight - kCaframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
+    gMC->Gsposp("UAFO",iplan       ,"TRD ",xpos, ypos,zpos,0,"MANY",par_cha,npar_cha);
+    gMC->Gsposp("UAFO",iplan+kNplan,"TRD ",xpos,-ypos,zpos,0,"MANY",par_cha,npar_cha);
+
+    // the inner part of the aluminum frame
+    //par_cha[0] = kSwidth1/2. + (iplan-1) * kCwidcha/2. - kCathick;
+    par_cha[0] = fCwidth[iplan-1]/2.   - kCathick;
+    par_cha[1] = fClengthO[iplan-1]/2.  - kCathick;
+    par_cha[2] = kCaframe/2.;
+    xpos       = 0.;
+    ypos       = fClengthI[iplan-1]/2. + fClengthM[iplan-1]    + fClengthO[iplan-1]/2.;
+    zpos       = kCheight - kCaframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
+    gMC->Gsposp("UAIO",iplan       ,"TRD ",xpos, ypos,zpos,0,"ONLY",par_cha,npar_cha);
+    gMC->Gsposp("UAIO",iplan+kNplan,"TRD ",xpos,-ypos,zpos,0,"ONLY",par_cha,npar_cha);
+
+    // the carbon frame
+    //par_cha[0] = kSwidth1/2. + (iplan-1) * kCwidcha/2.;
+    par_cha[0] = fCwidth[iplan-1]/2.;
+    par_cha[1] = fClengthO[iplan-1]/2.;
+    par_cha[2] = kCcframe/2.;
+    xpos       = 0.;
+    ypos       = fClengthI[iplan-1]/2. + fClengthM[iplan-1]    + fClengthO[iplan-1]/2.;
+    zpos       = kCcframe/2.            - kSheight/2. + (iplan-1) * (kCheight + kCspace);
+    gMC->Gsposp("UCFO",iplan,       "TRD ",xpos, ypos,zpos,0,"MANY",par_cha,npar_cha);
+    gMC->Gsposp("UCFO",iplan+kNplan,"TRD ",xpos,-ypos,zpos,0,"MANY",par_cha,npar_cha);
+
+    // the inner part of the carbon frame
+    //par_cha[0] = kSwidth1/2. + (iplan-1) * kCwidcha/2. - kCcthick;
+    par_cha[0] = fCwidth[iplan-1]/2.   - kCcthick;
+    par_cha[1] = fClengthO[iplan-1]/2. - kCcthick;
+    par_cha[2] = kCcframe/2.;
+    xpos       = 0.;
+    ypos       = fClengthI[iplan-1]/2. + fClengthM[iplan-1]    + fClengthO[iplan-1]/2.;
+    zpos       = kCcframe/2.            - kSheight/2. + (iplan-1) * (kCheight + kCspace);
+    gMC->Gsposp("UCIO",iplan       ,"TRD ",xpos, ypos,zpos,0,"ONLY",par_cha,npar_cha);
+    gMC->Gsposp("UCIO",iplan+kNplan,"TRD ",xpos,-ypos,zpos,0,"ONLY",par_cha,npar_cha);
+
+  }
 
 
+}
+//_____________________________________________________________________________
+void AliTRD::CreateMaterials()
+{
   //
   // Create the materials for the TRD
   // Origin Y.Foka
   //
   // Create the materials for the TRD
   // Origin Y.Foka
@@ -176,10 +544,10 @@ void AliTRD::CreateMaterials()
   AliMixture(7, "Mylar$",          amy, zmy, dmy, -3, wmy);
   AliMixture(8, "CO2$",            aco, zco, dco, -2, wco);
   AliMixture(9, "Isobutane$",      ais, zis, dis, -2, wis);
   AliMixture(7, "Mylar$",          amy, zmy, dmy, -3, wmy);
   AliMixture(8, "CO2$",            aco, zco, dco, -2, wco);
   AliMixture(9, "Isobutane$",      ais, zis, dis, -2, wis);
-  AliMixture(13, "Water$"        , awa, zwa, dwa, -2, wwa);
+  AliMixture(13,"Water$",          awa, zwa, dwa, -2, wwa);
 
   // Gas mixtures
 
   // Gas mixtures
-  char namate[21];
+  Char_t namate[21];
   // Xe/CO2-mixture
   // Get properties of Xe 
   gMC->Gfmate((*fIdmate)[4], namate, agm[0], zgm[0], d, radl, absl, buf, nbuf);
   // Xe/CO2-mixture
   // Get properties of Xe 
   gMC->Gfmate((*fIdmate)[4], namate, agm[0], zgm[0], d, radl, absl, buf, nbuf);
@@ -257,14 +625,56 @@ void AliTRD::CreateMaterials()
 
 }
 
 
 }
 
+//_____________________________________________________________________________
+void AliTRD::DrawModule()
+{
+  //
+  // Draw a shaded view of the Transition Radiation Detector version 0
+  //
+
+  // Set everything unseen
+  gMC->Gsatt("*"   ,"SEEN",-1);
+  
+  // Set ALIC mother transparent
+  gMC->Gsatt("ALIC","SEEN", 0);
+  
+  // Set the volumes visible
+  gMC->Gsatt("B032","SEEN", 0);
+  gMC->Gsatt("B028","SEEN", 0);
+  gMC->Gsatt("B029","SEEN", 0);
+  gMC->Gsatt("B030","SEEN", 0);
+  gMC->Gsatt("BTR1","SEEN", 0);
+  gMC->Gsatt("BTR2","SEEN", 0);
+  gMC->Gsatt("BTR3","SEEN", 0);
+  gMC->Gsatt("TRD" ,"SEEN", 0);
+  gMC->Gsatt("UCII","SEEN", 0);
+  gMC->Gsatt("UCIM","SEEN", 0);
+  gMC->Gsatt("UCIO","SEEN", 0);
+  gMC->Gsatt("UL02","SEEN", 1);
+  gMC->Gsatt("UL05","SEEN", 1);
+  gMC->Gsatt("UL06","SEEN", 1);
+  
+  gMC->Gdopt("hide", "on");
+  gMC->Gdopt("shad", "on");
+  gMC->Gsatt("*", "fill", 7);
+  gMC->SetClipBox(".");
+  gMC->SetClipBox("*", 0, 2000, -2000, 2000, -2000, 2000);
+  gMC->DefaultRange();
+  gMC->Gdraw("alic", 40, 30, 0, 12, 9.4, .021, .021);
+  gMC->Gdhead(1111, "Transition Radiation Detector");
+  gMC->Gdman(18, 4, "MAN");
+
+}
+
 //_____________________________________________________________________________
 Int_t AliTRD::DistancetoPrimitive(Int_t , Int_t )
 {
   //
   // Distance between the mouse and the TRD detector on the screen
   // Dummy routine
 //_____________________________________________________________________________
 Int_t AliTRD::DistancetoPrimitive(Int_t , Int_t )
 {
   //
   // Distance between the mouse and the TRD detector on the screen
   // Dummy routine
-  //
-   return 9999;
+  
+  return 9999;
+
 }
  
 //_____________________________________________________________________________
 }
  
 //_____________________________________________________________________________
@@ -273,8 +683,9 @@ void AliTRD::Init()
   //
   // Initialise the TRD detector after the geometry has been created
   //
   //
   // Initialise the TRD detector after the geometry has been created
   //
+
   Int_t i;
   Int_t i;
-  //
+  
   printf("\n");
   for(i=0;i<35;i++) printf("*");
   printf(" TRD_INIT ");
   printf("\n");
   for(i=0;i<35;i++) printf("*");
   printf(" TRD_INIT ");
@@ -286,21 +697,16 @@ void AliTRD::Init()
     printf("          Gas Mixture: 90%% Xe + 10%% CO2\n");
   else
     printf("          Gas Mixture: 97%% Xe + 3%% Isobutane\n");
     printf("          Gas Mixture: 90%% Xe + 10%% CO2\n");
   else
     printf("          Gas Mixture: 97%% Xe + 3%% Isobutane\n");
-  if (fSensPlane)
-    printf("          Only plane %d is sensitive\n",fSensPlane);
-  if (fSensChamber)   
-    printf("          Only chamber %d is sensitive\n",fSensChamber);
-  if (fSensSector)
-    printf("          Only sector %d is sensitive\n",fSensSector);
-
-  for(i=0;i<80;i++) printf("*");
-  printf("\n");
+
 }
 
 //_____________________________________________________________________________
 void AliTRD::SetGasMix(Int_t imix)
 {
 }
 
 //_____________________________________________________________________________
 void AliTRD::SetGasMix(Int_t imix)
 {
-
+  //
+  // Defines the gas mixture (imix=0:  Xe/Isobutane imix=1: Xe/CO2)
+  //
+  
   if ((imix < 0) || (imix > 1)) {
     printf("Wrong input value: %d\n",imix);
     printf("Use standard setting\n");
   if ((imix < 0) || (imix > 1)) {
     printf("Wrong input value: %d\n",imix);
     printf("Use standard setting\n");
@@ -312,57 +718,6 @@ void AliTRD::SetGasMix(Int_t imix)
 
 }
 
 
 }
 
-//_____________________________________________________________________________
-void AliTRD::SetSensPlane(Int_t iplane)
-{
-
-  if ((iplane < 0) || (iplane > 6)) {
-    printf("Wrong input value: %d\n",iplane);
-    printf("Use standard setting\n");
-    fSensPlane  = 0;
-    fSensSelect = 0;
-    return;
-  }
-
-  fSensSelect = 1;
-  fSensPlane  = iplane;
-
-}
-
-//_____________________________________________________________________________
-void AliTRD::SetSensChamber(Int_t ichamber)
-{
-
-  if ((ichamber < 0) || (ichamber > 5)) {
-    printf("Wrong input value: %d\n",ichamber);
-    printf("Use standard setting\n");
-    fSensChamber = 0;
-    fSensSelect  = 0;
-    return;
-  }
-
-  fSensSelect  = 1;
-  fSensChamber = ichamber;
-
-}
-
-//_____________________________________________________________________________
-void AliTRD::SetSensSector(Int_t isector)
-{
-
-  if ((isector < 0) || (isector > 18)) {
-    printf("Wrong input value: %d\n",isector);
-    printf("Use standard setting\n");
-    fSensSector = 0;
-    fSensSelect = 0;
-    return;
-  }
-
-  fSensSelect = 1;
-  fSensSector = isector;
-
-}
-
 ClassImp(AliTRDhit)
  
 //_____________________________________________________________________________
 ClassImp(AliTRDhit)
  
 //_____________________________________________________________________________
@@ -373,15 +728,15 @@ AliTRDhit::AliTRDhit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
   // Create a TRD hit
   //
 
   // Create a TRD hit
   //
 
-  //
   // Store volume hierarchy
   fSector  = vol[0]; 
   fChamber = vol[1];
   fPlane   = vol[2];
   // Store volume hierarchy
   fSector  = vol[0]; 
   fChamber = vol[1];
   fPlane   = vol[2];
-  //
+  
   // Store position and charge
   fX       = hits[0];
   fY       = hits[1];
   fZ       = hits[2];
   fQ       = hits[3];
   // Store position and charge
   fX       = hits[0];
   fY       = hits[1];
   fZ       = hits[2];
   fQ       = hits[3];
+
 }
 }
index 6245efa93a6291442ab604b1696e2fc7631bd2d0..7c59c8b51ee164ee4873e10c8b0cbba002e04b36 100644 (file)
@@ -6,16 +6,18 @@
  
 #include "AliDetector.h"
 #include "AliHit.h" 
  
 #include "AliDetector.h"
 #include "AliHit.h" 
+#include "AliTRDconst.h"
+
+//_____________________________________________________________________________
 class AliTRD : public AliDetector {
  
 protected:
 class AliTRD : public AliDetector {
  
 protected:
+  Int_t         fGasMix;            // Gas mixture. 0: Xe/Isobutane 1: Xe/CO2
 
 
-  Int_t         fGasMix;         // Gas mixture. 0: Xe/Isobutane 1: Xe/CO2
-  Int_t         fSensSelect;     // Switch to select only parts of the detector
-  Int_t         fSensPlane;      // Sensitive detector plane
-  Int_t         fSensChamber;    // Sensitive detector chamber
-  Int_t         fSensSector;     // Sensitive detector sector
+  Float_t       fClengthI[kNplan];  // Length of the inner chambers
+  Float_t       fClengthM[kNplan];  // Length of the middle chambers
+  Float_t       fClengthO[kNplan];  // Length of the outer chambers
+  Float_t       fCwidth[kNplan];    // Width of the chambers
 
 public:
   AliTRD();
 
 public:
   AliTRD();
@@ -23,74 +25,22 @@ public:
   virtual      ~AliTRD() {}
   virtual void  AddHit(Int_t, Int_t*, Float_t*);
   virtual void  BuildGeometry();
   virtual      ~AliTRD() {}
   virtual void  AddHit(Int_t, Int_t*, Float_t*);
   virtual void  BuildGeometry();
+  virtual void  CreateGeometry();
   virtual void  CreateMaterials();
   virtual void  CreateMaterials();
+  virtual void  DrawModule();
   Int_t         DistancetoPrimitive(Int_t px, Int_t py);
   virtual void  Init();
   Int_t         DistancetoPrimitive(Int_t px, Int_t py);
   virtual void  Init();
-  virtual Int_t IsVersion() const =0;
-  virtual void  StepManager()=0; 
+  virtual Int_t IsVersion() const = 0;
+  virtual void  StepManager() = 0; 
   virtual void  SetGasMix(Int_t imix = 0);
   virtual void  SetGasMix(Int_t imix = 0);
-  virtual void  SetSensPlane(Int_t iplane = 0);
-  virtual void  SetSensChamber(Int_t ichamber = 0);
-  virtual void  SetSensSector(Int_t isector = 0);
-
-  ClassDef(AliTRD,1)             // Transition Radiation Detector base class
-};
-
-////////////////////////////////////////////////
-//  Geometry parameter
-////////////////////////////////////////////////
-
-const Int_t   nsect   = 18;      // Number of sectors in the full detector
-const Int_t   nmodul  = 6;       // Number of modules in each sector
-const Int_t   ncham   = 6;       // Number of different chambers
-const Int_t   narmsec = 5;       // Number of sectors in one arm (geometry 1)
-
-const Float_t rmin    = 294.0;   // r-dimensions of the TRD-frame
-const Float_t rmax    = 368.0;
-
-const Float_t zmax1   = 378.35;  // z-dimensions of the TRD-frame
-const Float_t zmax2   = 302.0;
+  virtual void  SetHits(Int_t ihit) {};
+  virtual void  SetSensPlane(Int_t iplane) {};
+  virtual void  SetSensChamber(Int_t ichamber) {};
+  virtual void  SetSensSector(Int_t isector) {};
 
 
-const Float_t zleni   = 110.0;   // z-dimension of the inner chamber
-const Float_t zlenn   = 156.0;   // z-dimension of the neighbouring chambers
-const Float_t zleno   = 156.0;   // z-dimension of the outer chambers
+  ClassDef(AliTRD,1)                // Transition Radiation Detector base class
 
 
-const Float_t widpl1  = 99.6;    // rphi-dimension of the innermost plane
-
-const Float_t alframe = 1.0;     // Thickness of the aluminium of the support frame
-const Float_t ccframe = 1.0;     // Thickness of the carbon chamber frame
-
-// Thicknesses of the the material layers
-const Float_t sethick = 0.02;    // Radiator seal
-const Float_t rathick = 4.2;     // Radiator
-const Float_t pethick = 0.20;    // PE-layer in the radiator
-const Float_t mythick = 0.005;   // Mylar-layer
-const Float_t xethick = 3.5;     // Gas mixture
-const Float_t cuthick = 0.001;   // Pad plane
-const Float_t suthick = 0.06;    // HEXCEL+G10 support structure (= 0.31% X0)
-const Float_t fethick = 0.0044;  // FEE + signal lines (= 0.31% X0)
-const Float_t cothick = 0.02;    // PE of the cooling device
-const Float_t wathick = 0.01;    // Cooling water
-
-// Position of the material layers
-const Float_t sezpos  = -5.657;  // Radiator seal
-const Float_t razpos  = -3.557;  // Radiator
-const Float_t pezpos  =  0.0;    // PE-layer in the radiator
-const Float_t myzpos  = -1.4545; // Mylar-layer
-const Float_t xezpos  =  0.298;  // Gas mixture
-const Float_t cuzpos  =  2.047;  // Pad plane
-const Float_t suzpos  =  3.046;  // HEXCEL+G10 support structure
-const Float_t fezpos  =  4.0482; // FEE + signal lines
-const Float_t cozpos  =  4.1504; // PE of the cooling devices
-const Float_t wazpos  =  4.3004; // Cooling water
-
-////////////////////////////////////////////////
-// Parameter for the energy loss calculation
-////////////////////////////////////////////////
-
-const Float_t kPoti = 12.1;      // First ionization potential (eV)
-const Float_t kEend = 50000.0;   // Maximum energy (50 keV);
+};
 
 //_____________________________________________________________________________
 class AliTRDhit : public AliHit {
 
 //_____________________________________________________________________________
 class AliTRDhit : public AliHit {
@@ -107,6 +57,7 @@ public:
   virtual ~AliTRDhit() {}
  
   ClassDef(AliTRDhit,1)     // Hits for Transition Radiation Detector
   virtual ~AliTRDhit() {}
  
   ClassDef(AliTRDhit,1)     // Hits for Transition Radiation Detector
+
 };
 
 #endif
 };
 
 #endif
diff --git a/TRD/AliTRDconst.h b/TRD/AliTRDconst.h
new file mode 100644 (file)
index 0000000..8f92026
--- /dev/null
@@ -0,0 +1,60 @@
+//
+// Parameter for the TRD
+//
+
+//_____________________________________________________________________________
+//  Geometry parameter
+
+const Int_t   kNsect   = 18;      // Number of sectors in the full detector
+const Int_t   kNplan   = 6;       // Number of planes of the TRD
+
+const Float_t kRmin    = 294.0;   // r-dimensions of the TRD
+const Float_t kRmax    = 368.0;
+
+const Float_t kZmax1   = 378.35;  // z-dimensions of the TRD
+const Float_t kZmax2   = 302.0;
+
+const Float_t kSheight =  74.0;   // Height of the TRD-volume in spaceframe
+const Float_t kSwidth1 = 103.674; // Lower width of the TRD-volume in spaceframe
+const Float_t kSwidth2 = 129.768; // Upper width of the TRD-volume in spaceframe
+const Float_t kSlength = 751.0;   // Length of the TRD-volume in spaceframe
+
+const Float_t kCheight =  11.0;   // Height of the chambers
+const Float_t kCspace  =   1.6;   // Vertical spacing of the chambers
+const Float_t kCaframe =   2.675; // Height of the aluminum frame
+const Float_t kCathick =   1.0;   // Thickness of the aluminum frame
+const Float_t kCcthick =   1.0;   // Thickness of the carbon frame
+
+const Float_t kCwidcha = (kSwidth2 - kSwidth1) / kSheight * (kCheight + kCspace);
+const Float_t kCcframe = kCheight - kCaframe;
+
+// Thicknesses of the the material layers
+const Float_t kSeThick = 0.02;                // Radiator seal
+const Float_t kRaThick = 4.8;                 // Radiator
+const Float_t kPeThick = 0.20;                // PE-layer in the radiator
+const Float_t kMyThick = 0.005;               // Mylar-layer
+const Float_t kXeThick = 3.5;                 // Gas mixture
+const Float_t kDrThick = 3.0;                 // Drift region
+const Float_t kAmThick = kXeThick - kDrThick; // Amplification region
+
+const Float_t kCuThick = 0.001;               // Pad plane
+const Float_t kSuThick = 0.06;                // HEXCEL+G10 support structure (= 0.31% X0)
+const Float_t kFeThick = 0.0044;              // FEE + signal lines (= 0.31% X0)
+const Float_t kCoThick = 0.02;                // PE of the cooling device
+const Float_t kWaThick = 0.01;                // Cooling water
+
+//  Position of the material layers
+const Float_t kSeZpos  = -4.1525;             // Radiator seal
+const Float_t kRaZpos  = -1.7425;             // Radiator
+const Float_t kPeZpos  =  0.0000;             // PE-layer in the radiator
+const Float_t kMyZpos  =  0.6600;             // Mylar-layer
+const Float_t kDrZpos  =  2.1625;             // Drift region
+const Float_t kAmZpos  =  4.1125;             // Amplification region
+
+const Float_t kCuZpos  = -1.3370;             // Pad plane
+const Float_t kSuZpos  =  0.0000;             // Support structure
+const Float_t kFeZpos  =  1.3053;             // FEE + signal lines
+const Float_t kCoZpos  =  1.3175;             // PE of the cooling device
+const Float_t kWaZpos  =  1.3325;             // Cooling Water
+
+//_____________________________________________________________________________
index e6a5d4ff71c1e20535323e8bd00d989c7e21d5fc..2497eaf10c1faa367977f51eb500aa95b2751800 100644 (file)
@@ -29,406 +29,46 @@ AliTRDv0::AliTRDv0(const char *name, const char *title)
   //
   // Standard constructor for Transition Radiation Detector version 0
   //
   //
   // Standard constructor for Transition Radiation Detector version 0
   //
-  fIdSens1 = fIdSens2 = fIdSens3 = 0;
+
+  fIdSens     = 0;
+  fHitsOn     = 0;
+
+  fIdSpace1   = 0;
+  fIdSpace2   = 0;
+  fIdSpace3   = 0;
+
+  fIdChamber1 = 0;
+  fIdChamber2 = 0;
+  fIdChamber3 = 0;
+
 }
  
 //_____________________________________________________________________________
 void AliTRDv0::CreateGeometry()
 {
   //
 }
  
 //_____________________________________________________________________________
 void AliTRDv0::CreateGeometry()
 {
   //
-  // Create the GEANT geometry for the Transition Radiation Detector
-  // --- The coarse geometry of the TRD, that can be used for background 
-  //     studies. This version covers the full azimuth. 
-  // --- Author :  Christoph Blume (GSI) 17/5/99 
-  //
-  // --- Volume names : 
-  //     TRD       --> Mother TRD volume                                     (Al) 
-  //     UTRS      --> Sectors of the sub-detector                           (Al)
-  //     UTRI      --> Inner part of the detector frame                      (Air) 
-  //     UTCI(N,O) --> Frames of the inner, neighbouring and outer chambers  (C) 
-  //     UTII(N,O) --> Inner part of the chambers                            (Air) 
-  //     UTMI(N,O) --> Modules in the chambers                               (Air) 
-  //     UT0I(N,O) --> Radiator seal                                         (G10)
-  //     UT1I(N,O) --> Radiator                                              (CO2)
-  //     UT2I(N,O) --> Polyethylene of radiator                              (PE)
-  //     UT3I(N,O) --> Entrance window                                       (Mylar)
-  //     UT4I(N,O) --> Gas volume (sensitive)                                (Xe/Isobutane)
-  //     UT5I(N,O) --> Pad plane                                             (Cu)
-  //     UT6I(N,O) --> Support structure                                     (G10)
-  //     UT7I(N,O) --> FEE + signal lines                                    (Cu)
-  //     UT8I(N,O) --> Polyethylene of cooling device                        (PE)
-  //     UT9I(N,O) --> Cooling water                                         (Water)
-  //
-  //Begin_Html
-  /*
-    <img src="picts/AliTRDv0.gif">
-  */
-  //End_Html
-  //Begin_Html
-  /*
-    <img src="picts/AliTRDv0Tree.gif">
-  */
-  //End_Html
-
-  Float_t xpos, ypos, zpos, f;
-  Int_t   idmat[2];
-
-  const Int_t nparmo = 10;
-  const Int_t nparfr =  4;
-  const Int_t nparic =  4;
-  const Int_t nparnc =  4;
-  const Int_t nparoc = 11;
-
-  Float_t par_mo[nparmo];
-  Float_t par_fr[nparfr];
-  Float_t par_ic[nparic];
-  Float_t par_nc[nparnc];
-  Float_t par_oc[nparoc];
-
-  Int_t *idtmed =fIdtmed->GetArray()-1299;
-  
-  //////////////////////////////////////////////////////////////////////////  
-  //     Definition of Volumes 
-  //////////////////////////////////////////////////////////////////////////  
-  
-  // Definition of the mother volume for the TRD (Al) 
-  par_mo[0] =   0.;
-  par_mo[1] = 360.;
-  par_mo[2] = nsect;
-  par_mo[3] = 2.;
-  par_mo[4] = -zmax1;
-  par_mo[5] = rmin;
-  par_mo[6] = rmax;
-  par_mo[7] =  zmax1;
-  par_mo[8] = rmin;
-  par_mo[9] = rmax;
-  gMC->Gsvolu("TRD ", "PGON", idtmed[1301-1], par_mo, nparmo);
-  gMC->Gsdvn("UTRS", "TRD ", nsect, 2);
-
-  // The minimal width of a sector in rphi-direction
-  Float_t widmi = rmin * TMath::Tan(kPI/nsect);
-  // The maximal width of a sector in rphi-direction
-  Float_t widma = rmax * TMath::Tan(kPI/nsect);
-  // The total thickness of the spaceframe (Al + Air)
-  Float_t frame = widmi - (widpl1 / 2);
-
-  // Definition of the inner part of the detector frame (Air) 
-  par_fr[0] = widmi - alframe / 2.;
-  par_fr[1] = widma - alframe / 2.;
-  par_fr[2] = zmax1;
-  par_fr[3] = (rmax - rmin) / 2;
-  gMC->Gsvolu("UTRI", "TRD1", idtmed[1302-1], par_fr, nparfr); 
-
-  // 
-  // The outer chambers
-  //
-
-  // Calculate some shape-parameter
-  Float_t tanzr = (zmax1 - zmax2) / (rmax - rmin);
-  Float_t theoc = -kRaddeg * TMath::ATan(tanzr / 2);
-
-  // The carbon frame (C)
-  par_oc[0]  = (rmax - rmin) / 2;
-  par_oc[1]  = theoc;
-  par_oc[2]  = 90.;
-  par_oc[3]  = (zmax2 - zlenn - zleni/2)   / 2;
-  par_oc[4]  = widmi - frame;
-  par_oc[5]  = widmi - frame;
-  par_oc[6]  = 0.;
-  par_oc[7]  = (zmax1 - zlenn - zleni/2)   / 2;
-  par_oc[8]  = widma - frame;
-  par_oc[9]  = widma - frame;
-  par_oc[10] = 0.;
-  gMC->Gsvolu("UTCO", "TRAP", idtmed[1307-1], par_oc, nparoc);
-
-  // The inner part (Air) 
-  par_oc[3] -= ccframe;
-  par_oc[4] -= ccframe;
-  par_oc[5] -= ccframe; 
-  par_oc[7] -= ccframe;
-  par_oc[8] -= ccframe;
-  par_oc[9] -= ccframe;
-  gMC->Gsvolu("UTIO", "TRAP", idtmed[1302-1], par_oc, nparoc);
-
-  // Definition of the six modules within each chamber 
-  gMC->Gsdvn("UTMO", "UTIO", nmodul, 3);
-
-  // Definition of the layers of each chamber 
-  par_oc[1]  =  theoc;
-  par_oc[2]  =  90.;
-  par_oc[3]  = -1.;
-  par_oc[4]  = -1.;
-  par_oc[5]  = -1.;
-  par_oc[6]  =  0.;
-  par_oc[7]  = -1.;
-  par_oc[8]  = -1.;
-  par_oc[9]  = -1.;
-  par_oc[10] =  0.;
-  // G10 layer (radiator layer)
-  par_oc[0] = sethick / 2;
-  gMC->Gsvolu("UT0O", "TRAP", idtmed[1313-1], par_oc, nparoc);
-  // CO2 layer (radiator)
-  par_oc[0] = rathick / 2;
-  gMC->Gsvolu("UT1O", "TRAP", idtmed[1312-1], par_oc, nparoc);
-  // PE layer (radiator)
-  par_oc[0] = pethick / 2;
-  gMC->Gsvolu("UT2O", "TRAP", idtmed[1303-1], par_oc, nparoc);
-  // Mylar layer (entrance window + HV cathode) 
-  par_oc[0] = mythick / 2;
-  gMC->Gsvolu("UT3O", "TRAP", idtmed[1308-1], par_oc, nparoc);
-  // Xe/Isobutane layer (gasvolume)
-  par_oc[0] = xethick / 2;
-  gMC->Gsvolu("UT4O", "TRAP", idtmed[1309-1], par_oc, nparoc);
-  // Cu layer (pad plane)
-  par_oc[0] = cuthick / 2;
-  gMC->Gsvolu("UT5O", "TRAP", idtmed[1305-1], par_oc, nparoc);
-  // G10 layer (support structure)
-  par_oc[0] = suthick / 2;
-  gMC->Gsvolu("UT6O", "TRAP", idtmed[1313-1], par_oc, nparoc);
-  // Cu layer (FEE + signal lines)
-  par_oc[0] = fethick / 2;
-  gMC->Gsvolu("UT7O", "TRAP", idtmed[1305-1], par_oc, nparoc);
-  // PE layer (cooling devices)
-  par_oc[0] = cothick / 2;
-  gMC->Gsvolu("UT8O", "TRAP", idtmed[1303-1], par_oc, nparoc);
-  // Water layer (cooling)
-  par_oc[0] = wathick / 2;
-  gMC->Gsvolu("UT9O", "TRAP", idtmed[1314-1], par_oc, nparoc);
-
-  //
-  // The neighbouring chambers
-  //
-
-  // The carbon frame (C) 
-  par_nc[0] = widmi - frame;
-  par_nc[1] = widma - frame;
-  par_nc[2] = zlenn / 2;
-  par_nc[3] = (rmax - rmin) / 2;
-  gMC->Gsvolu("UTCN", "TRD1", idtmed[1307-1], par_nc, nparnc);
-
-  // The inner part (Air) 
-  par_nc[0] -= ccframe;
-  par_nc[1] -= ccframe;
-  par_nc[2] -= ccframe;
-  gMC->Gsvolu("UTIN", "TRD1", idtmed[1302-1], par_nc, nparnc);
-
-  // Definition of the six modules within each outer chamber 
-  gMC->Gsdvn("UTMN", "UTIN", nmodul, 3);
-
-  // Definition of the layers of each chamber 
-  par_nc[0] = -1.;
-  par_nc[1] = -1.;
-  par_nc[2] = -1.;
-  // G10 layer (radiator layer)
-  par_nc[3] = sethick / 2;
-  gMC->Gsvolu("UT0N", "TRD1", idtmed[1313-1], par_nc, nparnc);
-  // CO2 layer (radiator)
-  par_nc[3] = rathick / 2;
-  gMC->Gsvolu("UT1N", "TRD1", idtmed[1312-1], par_nc, nparnc);
-  // PE layer (radiator)
-  par_nc[3] = pethick / 2;
-  gMC->Gsvolu("UT2N", "TRD1", idtmed[1303-1], par_nc, nparnc);
-  // Mylar layer (entrance window + HV cathode) 
-  par_nc[3] = mythick / 2;
-  gMC->Gsvolu("UT3N", "TRD1", idtmed[1308-1], par_nc, nparnc);
-  // Xe/Isobutane layer (gasvolume)
-  par_nc[3] = xethick / 2;
-  gMC->Gsvolu("UT4N", "TRD1", idtmed[1309-1], par_nc, nparnc);
-  // Cu layer (pad plane)
-  par_nc[3] = cuthick / 2;
-  gMC->Gsvolu("UT5N", "TRD1", idtmed[1305-1], par_nc, nparnc);
-  // G10 layer (support structure)
-  par_nc[3] = suthick / 2;
-  gMC->Gsvolu("UT6N", "TRD1", idtmed[1313-1], par_nc, nparnc);
-  // Cu layer (FEE + signal lines)
-  par_nc[3] = fethick / 2;
-  gMC->Gsvolu("UT7N", "TRD1", idtmed[1305-1], par_nc, nparnc);
-  // PE layer (cooling devices)
-  par_nc[3] = cothick / 2;
-  gMC->Gsvolu("UT8N", "TRD1", idtmed[1303-1], par_nc, nparnc);
-  // Water layer (cooling)
-  par_nc[3] = wathick / 2;
-  gMC->Gsvolu("UT9N", "TRD1", idtmed[1314-1], par_nc, nparnc);
-
+  // Create the GEANT geometry for the Transition Radiation Detector - Version 0
+  // This version covers the full azimuth. 
   //
   //
-  // The inner chamber
+  // Author:  Christoph Blume (C.Blume@gsi.de) 20/07/99 
   //
 
   //
 
-  // The carbon frame (C) 
-  par_ic[0] = widmi - frame;
-  par_ic[1] = widma - frame;
-  par_ic[2] = zleni / 2;
-  par_ic[3] = (rmax - rmin) / 2;
-  gMC->Gsvolu("UTCI", "TRD1", idtmed[1307-1], par_ic, nparic);
-
-  // The inner part (Air) 
-  par_ic[0] -= ccframe;
-  par_ic[1] -= ccframe;
-  par_ic[2] -= ccframe;
-  gMC->Gsvolu("UTII", "TRD1", idtmed[1302-1], par_ic, nparic);
-
-  // Definition of the six modules within each outer chamber 
-  gMC->Gsdvn("UTMI", "UTII", nmodul, 3);
-
-  // Definition of the layers of each inner chamber 
-  par_ic[0] = -1.;
-  par_ic[1] = -1.;
-  par_ic[2] = -1.;
-  // G10 layer (radiator layer)
-  par_ic[3] = sethick / 2;
-  gMC->Gsvolu("UT0I", "TRD1", idtmed[1313-1], par_ic, nparic);
-  // CO2 layer (radiator)
-  par_ic[3] = rathick / 2;
-  gMC->Gsvolu("UT1I", "TRD1", idtmed[1312-1], par_ic, nparic);
-  // PE layer (radiator)
-  par_ic[3] = pethick / 2;
-  gMC->Gsvolu("UT2I", "TRD1", idtmed[1303-1], par_ic, nparic);
-  // Mylar layer (entrance window + HV cathode) 
-  par_ic[3] = mythick / 2;
-  gMC->Gsvolu("UT3I", "TRD1", idtmed[1308-1], par_ic, nparic);
-  // Xe/Isobutane layer (gasvolume)
-  par_ic[3] = xethick / 2;
-  gMC->Gsvolu("UT4I", "TRD1", idtmed[1309-1], par_ic, nparic);
-  // Cu layer (pad plane)
-  par_ic[3] = cuthick / 2;
-  gMC->Gsvolu("UT5I", "TRD1", idtmed[1305-1], par_ic, nparic);
-  // G10 layer (support structure)
-  par_ic[3] = suthick / 2;
-  gMC->Gsvolu("UT6I", "TRD1", idtmed[1313-1], par_ic, nparic);
-  // Cu layer (FEE + signal lines)
-  par_ic[3] = fethick / 2;
-  gMC->Gsvolu("UT7I", "TRD1", idtmed[1305-1], par_ic, nparic);
-  // PE layer (cooling devices)
-  par_ic[3] = cothick / 2;
-  gMC->Gsvolu("UT8I", "TRD1", idtmed[1303-1], par_ic, nparic);
-  // Water layer (cooling)
-  par_ic[3] = wathick / 2;
-  gMC->Gsvolu("UT9I", "TRD1", idtmed[1314-1], par_ic, nparic);
-
-  //////////////////////////////////////////////////////////////////////////  
-  //     Positioning of Volumes   
-  //////////////////////////////////////////////////////////////////////////  
-
-  // The rotation matrices 
-  AliMatrix(idmat[0],  90.,  90., 180.,   0.,  90.,   0.);
-  AliMatrix(idmat[1],  90., 180.,  90., 270.,   0.,   0.);
-
-  // Position of the layers in a TRD module 
-  f = TMath::Tan(theoc * kDegrad);
-  gMC->Gspos("UT9O", 1, "UTMO", 0., f*wazpos, wazpos, 0, "ONLY");
-  gMC->Gspos("UT8O", 1, "UTMO", 0., f*cozpos, cozpos, 0, "ONLY");
-  gMC->Gspos("UT7O", 1, "UTMO", 0., f*fezpos, fezpos, 0, "ONLY");
-  gMC->Gspos("UT6O", 1, "UTMO", 0., f*suzpos, suzpos, 0, "ONLY");
-  gMC->Gspos("UT5O", 1, "UTMO", 0., f*cuzpos, cuzpos, 0, "ONLY");
-  gMC->Gspos("UT4O", 1, "UTMO", 0., f*xezpos, xezpos, 0, "ONLY");
-  gMC->Gspos("UT3O", 1, "UTMO", 0., f*myzpos, myzpos, 0, "ONLY");
-  gMC->Gspos("UT1O", 1, "UTMO", 0., f*razpos, razpos, 0, "ONLY");
-  gMC->Gspos("UT0O", 1, "UTMO", 0., f*sezpos, sezpos, 0, "ONLY");
-  gMC->Gspos("UT2O", 1, "UT1O", 0., f*pezpos, pezpos, 0, "ONLY");
-
-  gMC->Gspos("UT9N", 1, "UTMN", 0.,       0., wazpos, 0, "ONLY");
-  gMC->Gspos("UT8N", 1, "UTMN", 0.,       0., cozpos, 0, "ONLY");
-  gMC->Gspos("UT7N", 1, "UTMN", 0.,       0., fezpos, 0, "ONLY");
-  gMC->Gspos("UT6N", 1, "UTMN", 0.,       0., suzpos, 0, "ONLY");
-  gMC->Gspos("UT5N", 1, "UTMN", 0.,       0., cuzpos, 0, "ONLY");
-  gMC->Gspos("UT4N", 1, "UTMN", 0.,       0., xezpos, 0, "ONLY");
-  gMC->Gspos("UT3N", 1, "UTMN", 0.,       0., myzpos, 0, "ONLY");
-  gMC->Gspos("UT1N", 1, "UTMN", 0.,       0., razpos, 0, "ONLY");
-  gMC->Gspos("UT0N", 1, "UTMN", 0.,       0., sezpos, 0, "ONLY");
-  gMC->Gspos("UT2N", 1, "UT1N", 0.,       0., pezpos, 0, "ONLY");
-
-  gMC->Gspos("UT9I", 1, "UTMI", 0.,       0., wazpos, 0, "ONLY");
-  gMC->Gspos("UT8I", 1, "UTMI", 0.,       0., cozpos, 0, "ONLY");
-  gMC->Gspos("UT7I", 1, "UTMI", 0.,       0., fezpos, 0, "ONLY");
-  gMC->Gspos("UT6I", 1, "UTMI", 0.,       0., suzpos, 0, "ONLY");
-  gMC->Gspos("UT5I", 1, "UTMI", 0.,       0., cuzpos, 0, "ONLY");
-  gMC->Gspos("UT4I", 1, "UTMI", 0.,       0., xezpos, 0, "ONLY");
-  gMC->Gspos("UT3I", 1, "UTMI", 0.,       0., myzpos, 0, "ONLY");
-  gMC->Gspos("UT1I", 1, "UTMI", 0.,       0., razpos, 0, "ONLY");
-  gMC->Gspos("UT0I", 1, "UTMI", 0.,       0., sezpos, 0, "ONLY");
-  gMC->Gspos("UT2I", 1, "UT1I", 0.,       0., pezpos, 0, "ONLY");
-
-  // Position of the inner part of the chambers 
-  xpos = 0.;
-  ypos = 0.;
-  zpos = 0.;
-  gMC->Gspos("UTII", 1, "UTCI", xpos, ypos, zpos, 0, "ONLY");
-  gMC->Gspos("UTIN", 1, "UTCN", xpos, ypos, zpos, 0, "ONLY");
-  gMC->Gspos("UTIO", 1, "UTCO", xpos, ypos, zpos, 0, "ONLY");
-
-  // Position of the chambers in the support frame 
-  xpos = 0.;
-  ypos = ((zmax1 + zmax2) / 2 + zlenn + zleni / 2) / 2;
-  zpos = 0.;
-  gMC->Gspos("UTCO", 1, "UTRI", xpos, ypos, zpos, idmat[1], "ONLY");
-  gMC->Gspos("UTCO", 2, "UTRI", xpos,-ypos, zpos,       0 , "ONLY");
-  xpos = 0.;
-  ypos = (zlenn + zleni) / 2;
-  zpos = 0.;
-  gMC->Gspos("UTCN", 1, "UTRI", xpos, ypos, zpos,       0 , "ONLY");
-  gMC->Gspos("UTCN", 2, "UTRI", xpos,-ypos, zpos,       0 , "ONLY");
-  xpos = 0.;
-  ypos = 0.;
-  zpos = 0.;
-  gMC->Gspos("UTCI", 1, "UTRI", xpos, ypos, zpos,       0 , "ONLY");
-
-  // Position of the inner part of the detector frame
-  xpos = (rmax + rmin) / 2;
-  ypos = 0.;
-  zpos = 0.;
-  gMC->Gspos("UTRI", 1, "UTRS", xpos, ypos, zpos, idmat[0], "ONLY");
-
-  // Position of the TRD mother volume in the ALICE experiment 
-  xpos = 0.;
-  ypos = 0.;
-  zpos = 0.;
-  gMC->Gspos("TRD ", 1, "ALIC", xpos, ypos, zpos,        0, "ONLY");
+  Float_t xpos, ypos, zpos;
 
 
-}
+  // Check that FRAME is there otherwise we have no place where to put the TRD
+  AliModule* FRAME = gAlice->GetModule("FRAME");
+  if (!FRAME) return;
 
 
-//_____________________________________________________________________________
-void AliTRDv0::DrawModule()
-{
-
-  //
-  // Draw a shaded view of the Transition Radiation Detector version 0
-  //
+  // Define the chambers
+  AliTRD::CreateGeometry();
 
 
-  // Set everything unseen
-  gMC->Gsatt("*", "seen", -1);
-  // 
-  // Set ALIC mother transparent
-  gMC->Gsatt("ALIC","SEEN",0);
-  //
-  // Set the volumes visible
-  gMC->Gsatt("TRD" ,"SEEN",0);
-  gMC->Gsatt("UTRS","SEEN",0);
-  gMC->Gsatt("UTRI","SEEN",0);
-  gMC->Gsatt("UTCO","SEEN",0);
-  gMC->Gsatt("UTIO","SEEN",0);
-  gMC->Gsatt("UTMO","SEEN",0);
-  gMC->Gsatt("UTCN","SEEN",0);
-  gMC->Gsatt("UTIN","SEEN",0);
-  gMC->Gsatt("UTMN","SEEN",0);
-  gMC->Gsatt("UTCI","SEEN",0);
-  gMC->Gsatt("UTII","SEEN",0);
-  gMC->Gsatt("UTMI","SEEN",0);
-  gMC->Gsatt("UT1O","SEEN",1);
-  gMC->Gsatt("UT4O","SEEN",1);
-  gMC->Gsatt("UT1N","SEEN",1);
-  gMC->Gsatt("UT4N","SEEN",1);
-  gMC->Gsatt("UT1I","SEEN",1);
-  gMC->Gsatt("UT4I","SEEN",1);
-  //
-  gMC->Gdopt("hide", "on");
-  gMC->Gdopt("shad", "on");
-  gMC->Gsatt("*", "fill", 7);
-  gMC->SetClipBox(".");
-  gMC->SetClipBox("*", 0, 2000, -2000, 2000, -2000, 2000);
-  gMC->DefaultRange();
-  gMC->Gdraw("alic", 40, 30, 0, 12, 9.4, .021, .021);
-  gMC->Gdhead(1111, "Transition Radiation Detector Version 0");
-  gMC->Gdman(18, 4, "MAN");
+  // Position the the TRD-sectors in all TRD-volumes in the spaceframe
+  xpos     = 0.;
+  ypos     = 0.;
+  zpos     = 0.;
+  gMC->Gspos("TRD ",1,"BTR1",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("TRD ",2,"BTR2",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("TRD ",3,"BTR3",xpos,ypos,zpos,0,"ONLY");
 
 }
 
 
 }
 
@@ -438,7 +78,9 @@ void AliTRDv0::CreateMaterials()
   //
   // Create materials for the Transition Radiation Detector
   //
   //
   // Create materials for the Transition Radiation Detector
   //
+
   AliTRD::CreateMaterials();
   AliTRD::CreateMaterials();
+
 }
 
 //_____________________________________________________________________________
 }
 
 //_____________________________________________________________________________
@@ -447,12 +89,25 @@ void AliTRDv0::Init()
   //
   // Initialise Transition Radiation Detector after geometry is built
   //
   //
   // Initialise Transition Radiation Detector after geometry is built
   //
+
   AliTRD::Init();
   AliTRD::Init();
-  //
-  // Retrieve the numeric identifier of the sensitive volumes (gas volume)
-  fIdSens1 = gMC->VolId("UT4I");
-  fIdSens2 = gMC->VolId("UT4N");
-  fIdSens3 = gMC->VolId("UT4O");
+
+  for (Int_t i = 0; i < 80; i++) printf("*");
+  printf("\n");
+  
+  // Identifier of the sensitive volume (amplification region)
+  fIdSens     = gMC->VolId("UL06");
+
+  // Identifier of the TRD-spaceframe volumina
+  fIdSpace1   = gMC->VolId("B028");
+  fIdSpace2   = gMC->VolId("B029");
+  fIdSpace3   = gMC->VolId("B030");
+
+  // Identifier of the TRD-driftchambers
+  fIdChamber1 = gMC->VolId("UCIO");
+  fIdChamber2 = gMC->VolId("UCIM");
+  fIdChamber3 = gMC->VolId("UCII");
+
 }
 
 //_____________________________________________________________________________
 }
 
 //_____________________________________________________________________________
@@ -460,65 +115,68 @@ void AliTRDv0::StepManager()
 {
   //
   // Procedure called at every step in the TRD
 {
   //
   // Procedure called at every step in the TRD
+  // Fast simulator. If switched on, a hit is produced when a track
+  // crosses the border between amplification region and pad plane.
   //
 
   //
 
-  Int_t         vol[3]; 
-  Int_t         icopy, idSens, icSens, i; 
+  Int_t   vol[3]; 
+  Int_t   iIdSens, icSens; 
+  Int_t   iIdSpace, icSpace;
+  Int_t   iIdChamber, icChamber;
+
+  Int_t   secMap1[10] = {  3,  7,  8,  9, 10, 11,  2,  1, 18, 17 };
+  Int_t   secMap2[ 5] = { 16, 15, 14, 13, 12 };
+  Int_t   secMap3[ 3] = {  5,  6,  4 };
+
+  Float_t hits[4];
 
 
-  Float_t       hits[4];
   TLorentzVector p;
   TLorentzVector p;
+  TClonesArray  &lhits = *fHits;
 
 
-  TClonesArray &lhits = *fHits;
+  // Writing out hits enabled?
+  if (!(fHitsOn)) return;
 
   // Use only charged tracks and count them only once per volume
 
   // Use only charged tracks and count them only once per volume
-  if (gMC->TrackCharge() && gMC->IsTrackExiting()) {
+  if (gMC->TrackCharge()    && 
+      gMC->IsTrackExiting()) {
     
     // Check on sensitive volume
     
     // Check on sensitive volume
-    idSens = gMC->CurrentVolID(icSens);
-    if ((idSens == fIdSens1) || 
-        (idSens == fIdSens2) ||
-        (idSens == fIdSens3)) { 
-      
+    iIdSens = gMC->CurrentVolID(icSens);
+    if (iIdSens == fIdSens) { 
+
+      gMC->TrackPosition(p);
+      for (Int_t i = 0; i < 3; i++) hits[i] = p[i];
+      // No charge created
+      hits[3] = 0;
+
+      iIdSpace   = gMC->CurrentVolOffID(4,icSpace  );
+      iIdChamber = gMC->CurrentVolOffID(1,icChamber);
+
       // The sector number
       // The sector number
-      gMC->CurrentVolOffID(5,icopy);
-      vol[0] = icopy;
-      
+      if      (iIdSpace == fIdSpace1) 
+        vol[0] = secMap1[icSpace-1];
+      else if (iIdSpace == fIdSpace2) 
+        vol[0] = secMap2[icSpace-1];
+      else if (iIdSpace == fIdSpace3) 
+        vol[0] = secMap3[icSpace-1];
+
       // The chamber number 
       //   1: outer left
       // The chamber number 
       //   1: outer left
-      //   2: neighbouring left
+      //   2: middle left
       //   3: inner
       //   3: inner
-      //   4: neighbouring right
+      //   4: middle right
       //   5: outer right
       //   5: outer right
-      gMC->CurrentVolOffID(3,icopy);
-      if      (idSens == fIdSens3)
-        vol[1] = 4 * icopy - 3; 
-      else if (idSens == fIdSens2)
-        vol[1] = 2 * icopy;
-      else 
+      if      (iIdChamber == fIdChamber1)
+        vol[1] = (hits[2] < 0 ? 1 : 5);
+      else if (iIdChamber == fIdChamber2)       
+        vol[1] = (hits[2] < 0 ? 2 : 4);
+      else if (iIdChamber == fIdChamber3)       
         vol[1] = 3;
         vol[1] = 3;
-      
+
       // The plane number
       // The plane number
-      gMC->CurrentVolOffID(1,icopy);
-      vol[2] = icopy;
-
-      if (fSensSelect) {
-        Int_t addthishit = 1;
-        if ((fSensPlane)   && (vol[2] != fSensPlane  )) addthishit = 0;
-        if ((fSensChamber) && (vol[1] != fSensChamber)) addthishit = 0;
-        if ((fSensSector)  && (vol[0] != fSensSector )) addthishit = 0;
-        if (addthishit) {
-          gMC->TrackPosition(p);
-         for(i=0;i<3;++i) hits[i]=p[i];
-          hits[3] = 0;
-          new(lhits[fNhits++]) AliTRDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
-       }
-      }
-      else {      
-       gMC->TrackPosition(p);
-       for(i=0;i<3;++i) hits[i]=p[i];
-        hits[3] = 0;
-        new(lhits[fNhits++]) AliTRDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
-      }
+      vol[2] = icChamber - TMath::Nint((Float_t) (icChamber / 7)) * 6;
+
+      new(lhits[fNhits++]) AliTRDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
 
     }
 
 
     }
 
index 229d30b90ad1302b48aa995e46a5591ad85198c2..1741fa62c5ac4e5b6dad2c15ae5ade4a7b08bd2d 100644 (file)
@@ -14,17 +14,26 @@ public:
   virtual      ~AliTRDv0() {}
   virtual void  CreateGeometry();
   virtual void  CreateMaterials();
   virtual      ~AliTRDv0() {}
   virtual void  CreateGeometry();
   virtual void  CreateMaterials();
-  virtual Int_t IsVersion() const {return 0;}
+  virtual Int_t IsVersion() const       { return 0;       };
+  virtual void  SetHits(Int_t ihit = 1) { fHitsOn = ihit; };
   virtual void  StepManager();
   virtual void  Init();
   virtual void  StepManager();
   virtual void  Init();
-  virtual void  DrawModule();
   
 protected:
   
 protected:
-  Int_t        fIdSens1;    // 1st sensitive volume identifier
-  Int_t        fIdSens2;    // 2nd sensitive volume identifier
-  Int_t        fIdSens3;    // 3rd sensitive volume identifier
-  
+  Int_t        fIdSens;     // Sensitive volume identifier
+
+  Int_t        fIdSpace1;   // Spaceframe volume identifier
+  Int_t        fIdSpace2;   // 
+  Int_t        fIdSpace3;   // 
+
+  Int_t        fIdChamber1; // Driftchamber volume identifier
+  Int_t        fIdChamber2; // 
+  Int_t        fIdChamber3; // 
+
+  Int_t        fHitsOn;     // Used to switch hits on
+
   ClassDef(AliTRDv0,1)      // Transition Radiation Detector version 0
   ClassDef(AliTRDv0,1)      // Transition Radiation Detector version 0
+
 };
 
 #endif
 };
 
 #endif
index b6a61a888cd14c9107093f4f4c556545d1a6feab..aeed814aa500e04ede46731b57c70dad438fbd44 100644 (file)
@@ -31,432 +31,45 @@ AliTRDv1::AliTRDv1(const char *name, const char *title)
   //
   // Standard constructor for the Transition Radiation Detector version 1
   //
   //
   // Standard constructor for the Transition Radiation Detector version 1
   //
-  fIdSens1 = fIdSens2 = fIdSens3 = 0;
+
+  fIdSens     = 0;
+  fHitsOn     = 0;
+
+  fIdSpace1   = 0;
+  fIdSpace2   = 0;
+  fIdSpace3   = 0;
+
+  fIdChamber1 = 0;
+  fIdChamber2 = 0;
+  fIdChamber3 = 0;
+
 }
  
 //_____________________________________________________________________________
 void AliTRDv1::CreateGeometry()
 {
   //
 }
  
 //_____________________________________________________________________________
 void AliTRDv1::CreateGeometry()
 {
   //
-  // Create the geometry for the Transition Radiation Detector version 1
-  // --- The coarse geometry of the TRD, that can be used for background 
-  //     studies. This version leaves the space in front of the PHOS and 
-  //     HMPID empty. 
-  // --- Author :  Christoph Blume (GSI) 18/5/99 
+  // Create the GEANT geometry for the Transition Radiation Detector - Version 1
+  // This version covers only part of the azimuth. 
   //
   //
-  // --- Volume names : 
-  //     TRD       --> Mother TRD volume                                     (Air)
-  //     UTRD      --> The detector arms                                     (Al)
-  //     UTRS      --> Sectors of the sub-detector                           (Al)
-  //     UTRI      --> Inner part of the detector frame                      (Air) 
-  //     UTCI(N,O) --> Frames of the inner, neighbouring and outer chambers  (C) 
-  //     UTII(N,O) --> Inner part of the chambers                            (Air) 
-  //     UTMI(N,O) --> Modules in the chambers                               (Air) 
-  //     UT0I(N,O) --> Radiator seal                                         (G10)
-  //     UT1I(N,O) --> Radiator                                              (CO2)
-  //     UT2I(N,O) --> Polyethylene of radiator                              (PE)
-  //     UT3I(N,O) --> Entrance window                                       (Mylar)
-  //     UT4I(N,O) --> Gas volume (sensitive)                                (Xe/Isobutane)
-  //     UT5I(N,O) --> Pad plane                                             (Cu)
-  //     UT6I(N,O) --> Support structure                                     (G10)
-  //     UT7I(N,O) --> FEE + signal lines                                    (Cu)
-  //     UT8I(N,O) --> Polyethylene of cooling device                        (PE)
-  //     UT9I(N,O) --> Cooling water                                         (Water)
-  //
-  //Begin_Html
-  /*
-    <img src="picts/AliTRDv1.gif">
-  */
-  //End_Html
-  //Begin_Html
-  /*
-    <img src="picts/AliTRDv1Tree.gif">
-  */
-  //End_Html
-
-  Float_t xpos, ypos, zpos, f;
-  Int_t   idmat[5];
-
-  const Int_t nparmo = 10;
-  const Int_t nparar = 10;
-  const Int_t nparfr =  4;
-  const Int_t nparic =  4;
-  const Int_t nparnc =  4;
-  const Int_t nparoc = 11;
-
-  Float_t par_mo[nparmo];
-  Float_t par_ar[nparar];
-  Float_t par_fr[nparfr];
-  Float_t par_ic[nparic];
-  Float_t par_nc[nparnc];
-  Float_t par_oc[nparoc];
-  
-  Int_t *idtmed = fIdtmed->GetArray()-1299;
-  
-  //////////////////////////////////////////////////////////////////////////
-  //     Definition of Volumes   
-  //////////////////////////////////////////////////////////////////////////
-
-  // Definition of the mother volume for the TRD (Air) 
-  par_mo[0] =   0.;
-  par_mo[1] = 360.;
-  par_mo[2] = nsect;
-  par_mo[3] = 2.;
-  par_mo[4] = -zmax1;
-  par_mo[5] = rmin;
-  par_mo[6] = rmax;
-  par_mo[7] =  zmax1;
-  par_mo[8] = rmin;
-  par_mo[9] = rmax;
-  gMC->Gsvolu("TRD ", "PGON", idtmed[1302-1], par_mo, nparmo);
-  
-  Float_t phisec = 360. / nsect;   
-  // Definition of the two detector arms (Al) 
-  par_ar[0] = 120.;
-  par_ar[1] = narmsec * phisec;
-  par_ar[2] = narmsec;
-  par_ar[3] = 2.;
-  par_ar[4] = -zmax1;
-  par_ar[5] = rmin;
-  par_ar[6] = rmax;
-  par_ar[7] =  zmax1;
-  par_ar[8] = rmin;
-  par_ar[9] = rmax;
-  gMC->Gsvolu("UTRD", "PGON", idtmed[1301-1], par_ar, nparar);
-  gMC->Gsdvn("UTRS", "UTRD", narmsec, 2);
-
-  // The minimal width of a sector in rphi-direction
-  Float_t widmi = rmin * TMath::Tan(kPI/nsect);
-  // The maximal width of a sector in rphi-direction
-  Float_t widma = rmax * TMath::Tan(kPI/nsect);
-  // The total thickness of the spaceframe (Al + Air)
-  Float_t frame = widmi - (widpl1 / 2);
-
-  // Definition of the inner part of the detector frame (Air) 
-  par_fr[0] = widmi - alframe / 2;
-  par_fr[1] = widma - alframe / 2;
-  par_fr[2] = zmax1;
-  par_fr[3] = (rmax - rmin) / 2;
-  gMC->Gsvolu("UTRI", "TRD1", idtmed[1302-1], par_fr, nparfr); 
-
-  // 
-  // The outer chambers
+  // Author:  Christoph Blume (C.Blume@gsi.de) 20/07/99 
   //
 
   //
 
-  // Calculate some shape-parameter
-  Float_t tanzr = (zmax1 - zmax2) / (rmax - rmin);
-  Float_t theoc = -kRaddeg * TMath::ATan(tanzr / 2);
-
-  // The carbon frame (C)
-  par_oc[0]  = (rmax - rmin) / 2;
-  par_oc[1]  = theoc;
-  par_oc[2]  = 90.;
-  par_oc[3]  = (zmax2 - zlenn - zleni/2)   / 2;
-  par_oc[4]  = widmi - frame;
-  par_oc[5]  = widmi - frame;
-  par_oc[6]  = 0.;
-  par_oc[7]  = (zmax1 - zlenn - zleni/2)   / 2;
-  par_oc[8]  = widma - frame;
-  par_oc[9]  = widma - frame;
-  par_oc[10] = 0.;
-  gMC->Gsvolu("UTCO", "TRAP", idtmed[1307-1], par_oc, nparoc);
-
-  // The inner part (Air) 
-  par_oc[3] -= ccframe;
-  par_oc[4] -= ccframe;
-  par_oc[5] -= ccframe; 
-  par_oc[7] -= ccframe;
-  par_oc[8] -= ccframe;
-  par_oc[9] -= ccframe;
-  gMC->Gsvolu("UTIO", "TRAP", idtmed[1302-1], par_oc, nparoc);
-
-  // Definition of the six modules within each chamber 
-  gMC->Gsdvn("UTMO", "UTIO", nmodul, 3);
-
-  // Definition of the layers of each chamber 
-  par_oc[1]  =  theoc;
-  par_oc[2]  =  90.;
-  par_oc[3]  = -1.;
-  par_oc[4]  = -1.;
-  par_oc[5]  = -1.;
-  par_oc[6]  =  0.;
-  par_oc[7]  = -1.;
-  par_oc[8]  = -1.;
-  par_oc[9]  = -1.;
-  par_oc[10] =  0.;
-  // G10 layer (radiator layer)
-  par_oc[0] = sethick / 2;
-  gMC->Gsvolu("UT0O", "TRAP", idtmed[1313-1], par_oc, nparoc);
-  // CO2 layer (radiator)
-  par_oc[0] = rathick / 2;
-  gMC->Gsvolu("UT1O", "TRAP", idtmed[1312-1], par_oc, nparoc);
-  // PE layer (radiator)
-  par_oc[0] = pethick / 2;
-  gMC->Gsvolu("UT2O", "TRAP", idtmed[1303-1], par_oc, nparoc);
-  // Mylar layer (entrance window + HV cathode) 
-  par_oc[0] = mythick / 2;
-  gMC->Gsvolu("UT3O", "TRAP", idtmed[1308-1], par_oc, nparoc);
-  // Xe/Isobutane layer (gasvolume)
-  par_oc[0] = xethick / 2;
-  gMC->Gsvolu("UT4O", "TRAP", idtmed[1309-1], par_oc, nparoc);
-  // Cu layer (pad plane)
-  par_oc[0] = cuthick / 2;
-  gMC->Gsvolu("UT5O", "TRAP", idtmed[1305-1], par_oc, nparoc);
-  // G10 layer (support structure)
-  par_oc[0] = suthick / 2;
-  gMC->Gsvolu("UT6O", "TRAP", idtmed[1313-1], par_oc, nparoc);
-  // Cu layer (FEE + signal lines)
-  par_oc[0] = fethick / 2;
-  gMC->Gsvolu("UT7O", "TRAP", idtmed[1305-1], par_oc, nparoc);
-  // PE layer (cooling devices)
-  par_oc[0] = cothick / 2;
-  gMC->Gsvolu("UT8O", "TRAP", idtmed[1303-1], par_oc, nparoc);
-  // Water layer (cooling)
-  par_oc[0] = wathick / 2;
-  gMC->Gsvolu("UT9O", "TRAP", idtmed[1314-1], par_oc, nparoc);
+  Float_t xpos, ypos, zpos;
 
 
-  //
-  // The neighbouring chambers
-  //
+  // Check that FRAME is there otherwise we have no place where to put the TRD
+  AliModule* FRAME = gAlice->GetModule("FRAME");
+  if (!FRAME) return;
 
 
-  // The carbon frame (C) 
-  par_nc[0] = widmi - frame;
-  par_nc[1] = widma - frame;
-  par_nc[2] = zlenn / 2;
-  par_nc[3] = (rmax - rmin) / 2;
-  gMC->Gsvolu("UTCN", "TRD1", idtmed[1307-1], par_nc, nparnc);
-
-  // The inner part (Air) 
-  par_nc[0] -= ccframe;
-  par_nc[1] -= ccframe;
-  par_nc[2] -= ccframe;
-  gMC->Gsvolu("UTIN", "TRD1", idtmed[1302-1], par_nc, nparnc);
-
-  // Definition of the six modules within each outer chamber 
-  gMC->Gsdvn("UTMN", "UTIN", nmodul, 3);
-
-  // Definition of the layers of each chamber 
-  par_nc[0] = -1.;
-  par_nc[1] = -1.;
-  par_nc[2] = -1.;
-  // G10 layer (radiator layer)
-  par_nc[3] = sethick / 2;
-  gMC->Gsvolu("UT0N", "TRD1", idtmed[1313-1], par_nc, nparnc);
-  // CO2 layer (radiator)
-  par_nc[3] = rathick / 2;
-  gMC->Gsvolu("UT1N", "TRD1", idtmed[1312-1], par_nc, nparnc);
-  // PE layer (radiator)
-  par_nc[3] = pethick / 2;
-  gMC->Gsvolu("UT2N", "TRD1", idtmed[1303-1], par_nc, nparnc);
-  // Mylar layer (entrance window + HV cathode) 
-  par_nc[3] = mythick / 2;
-  gMC->Gsvolu("UT3N", "TRD1", idtmed[1308-1], par_nc, nparnc);
-  // Xe/Isobutane layer (gasvolume)
-  par_nc[3] = xethick / 2;
-  gMC->Gsvolu("UT4N", "TRD1", idtmed[1309-1], par_nc, nparnc);
-  // Cu layer (pad plane)
-  par_nc[3] = cuthick / 2;
-  gMC->Gsvolu("UT5N", "TRD1", idtmed[1305-1], par_nc, nparnc);
-  // G10 layer (support structure)
-  par_nc[3] = suthick / 2;
-  gMC->Gsvolu("UT6N", "TRD1", idtmed[1313-1], par_nc, nparnc);
-  // Cu layer (FEE + signal lines)
-  par_nc[3] = fethick / 2;
-  gMC->Gsvolu("UT7N", "TRD1", idtmed[1305-1], par_nc, nparnc);
-  // PE layer (cooling devices)
-  par_nc[3] = cothick / 2;
-  gMC->Gsvolu("UT8N", "TRD1", idtmed[1303-1], par_nc, nparnc);
-  // Water layer (cooling)
-  par_nc[3] = wathick / 2;
-  gMC->Gsvolu("UT9N", "TRD1", idtmed[1314-1], par_nc, nparnc);
+  // Define the chambers
+  AliTRD::CreateGeometry();
 
 
-  //
-  // The inner chamber
-  //
-
-  // The carbon frame (C) 
-  par_ic[0] = widmi - frame;
-  par_ic[1] = widma - frame;
-  par_ic[2] = zleni / 2;
-  par_ic[3] = (rmax - rmin) / 2;
-  gMC->Gsvolu("UTCI", "TRD1", idtmed[1307-1], par_ic, nparic);
-
-  // The inner part (Air) 
-  par_ic[0] -= ccframe;
-  par_ic[1] -= ccframe;
-  par_ic[2] -= ccframe;
-  gMC->Gsvolu("UTII", "TRD1", idtmed[1302-1], par_ic, nparic);
-
-  // Definition of the six modules within each outer chamber 
-  gMC->Gsdvn("UTMI", "UTII", nmodul, 3);
-
-  // Definition of the layers of each inner chamber 
-  par_ic[0] = -1.;
-  par_ic[1] = -1.;
-  par_ic[2] = -1.;
-  // G10 layer (radiator layer)
-  par_ic[3] = sethick / 2;
-  gMC->Gsvolu("UT0I", "TRD1", idtmed[1313-1], par_ic, nparic);
-  // CO2 layer (radiator)
-  par_ic[3] = rathick / 2;
-  gMC->Gsvolu("UT1I", "TRD1", idtmed[1312-1], par_ic, nparic);
-  // PE layer (radiator)
-  par_ic[3] = pethick / 2;
-  gMC->Gsvolu("UT2I", "TRD1", idtmed[1303-1], par_ic, nparic);
-  // Mylar layer (entrance window + HV cathode) 
-  par_ic[3] = mythick / 2;
-  gMC->Gsvolu("UT3I", "TRD1", idtmed[1308-1], par_ic, nparic);
-  // Xe/Isobutane layer (gasvolume)
-  par_ic[3] = xethick / 2;
-  gMC->Gsvolu("UT4I", "TRD1", idtmed[1309-1], par_ic, nparic);
-  // Cu layer (pad plane)
-  par_ic[3] = cuthick / 2;
-  gMC->Gsvolu("UT5I", "TRD1", idtmed[1305-1], par_ic, nparic);
-  // G10 layer (support structure)
-  par_ic[3] = suthick / 2;
-  gMC->Gsvolu("UT6I", "TRD1", idtmed[1313-1], par_ic, nparic);
-  // Cu layer (FEE + signal lines)
-  par_ic[3] = fethick / 2;
-  gMC->Gsvolu("UT7I", "TRD1", idtmed[1305-1], par_ic, nparic);
-  // PE layer (cooling devices)
-  par_ic[3] = cothick / 2;
-  gMC->Gsvolu("UT8I", "TRD1", idtmed[1303-1], par_ic, nparic);
-  // Water layer (cooling)
-  par_ic[3] = wathick / 2;
-  gMC->Gsvolu("UT9I", "TRD1", idtmed[1314-1], par_ic, nparic);
-
-  //////////////////////////////////////////////////////////////////////////
-  //     Positioning of Volumes 
-  //////////////////////////////////////////////////////////////////////////
-
-  // The rotation matrices 
-  AliMatrix(idmat[0],  90., 180.,  90.,  90.,   0.,   0.);
-  AliMatrix(idmat[1],  90.,  90., 180.,   0.,  90.,   0.);
-  AliMatrix(idmat[2],  90., 180.,  90., 270.,   0.,   0.);
-
-  // Position of the layers in a TRD module 
-  f = TMath::Tan(theoc * kDegrad);
-  gMC->Gspos("UT9O", 1, "UTMO", 0., f*wazpos, wazpos, 0, "ONLY");
-  gMC->Gspos("UT8O", 1, "UTMO", 0., f*cozpos, cozpos, 0, "ONLY");
-  gMC->Gspos("UT7O", 1, "UTMO", 0., f*fezpos, fezpos, 0, "ONLY");
-  gMC->Gspos("UT6O", 1, "UTMO", 0., f*suzpos, suzpos, 0, "ONLY");
-  gMC->Gspos("UT5O", 1, "UTMO", 0., f*cuzpos, cuzpos, 0, "ONLY");
-  gMC->Gspos("UT4O", 1, "UTMO", 0., f*xezpos, xezpos, 0, "ONLY");
-  gMC->Gspos("UT3O", 1, "UTMO", 0., f*myzpos, myzpos, 0, "ONLY");
-  gMC->Gspos("UT1O", 1, "UTMO", 0., f*razpos, razpos, 0, "ONLY");
-  gMC->Gspos("UT0O", 1, "UTMO", 0., f*sezpos, sezpos, 0, "ONLY");
-  gMC->Gspos("UT2O", 1, "UT1O", 0., f*pezpos, pezpos, 0, "ONLY");
-
-  gMC->Gspos("UT9N", 1, "UTMN", 0.,       0., wazpos, 0, "ONLY");
-  gMC->Gspos("UT8N", 1, "UTMN", 0.,       0., cozpos, 0, "ONLY");
-  gMC->Gspos("UT7N", 1, "UTMN", 0.,       0., fezpos, 0, "ONLY");
-  gMC->Gspos("UT6N", 1, "UTMN", 0.,       0., suzpos, 0, "ONLY");
-  gMC->Gspos("UT5N", 1, "UTMN", 0.,       0., cuzpos, 0, "ONLY");
-  gMC->Gspos("UT4N", 1, "UTMN", 0.,       0., xezpos, 0, "ONLY");
-  gMC->Gspos("UT3N", 1, "UTMN", 0.,       0., myzpos, 0, "ONLY");
-  gMC->Gspos("UT1N", 1, "UTMN", 0.,       0., razpos, 0, "ONLY");
-  gMC->Gspos("UT0N", 1, "UTMN", 0.,       0., sezpos, 0, "ONLY");
-  gMC->Gspos("UT2N", 1, "UT1N", 0.,       0., pezpos, 0, "ONLY");
-
-  gMC->Gspos("UT9I", 1, "UTMI", 0.,       0., wazpos, 0, "ONLY");
-  gMC->Gspos("UT8I", 1, "UTMI", 0.,       0., cozpos, 0, "ONLY");
-  gMC->Gspos("UT7I", 1, "UTMI", 0.,       0., fezpos, 0, "ONLY");
-  gMC->Gspos("UT6I", 1, "UTMI", 0.,       0., suzpos, 0, "ONLY");
-  gMC->Gspos("UT5I", 1, "UTMI", 0.,       0., cuzpos, 0, "ONLY");
-  gMC->Gspos("UT4I", 1, "UTMI", 0.,       0., xezpos, 0, "ONLY");
-  gMC->Gspos("UT3I", 1, "UTMI", 0.,       0., myzpos, 0, "ONLY");
-  gMC->Gspos("UT1I", 1, "UTMI", 0.,       0., razpos, 0, "ONLY");
-  gMC->Gspos("UT0I", 1, "UTMI", 0.,       0., sezpos, 0, "ONLY");
-  gMC->Gspos("UT2I", 1, "UT1I", 0.,       0., pezpos, 0, "ONLY");
-
-  // Position of the inner part of the chambers 
-  xpos = 0.;
-  ypos = 0.;
-  zpos = 0.;
-  gMC->Gspos("UTII", 1, "UTCI", xpos, ypos, zpos, 0, "ONLY");
-  gMC->Gspos("UTIN", 1, "UTCN", xpos, ypos, zpos, 0, "ONLY");
-  gMC->Gspos("UTIO", 1, "UTCO", xpos, ypos, zpos, 0, "ONLY");
-
-  // Position of the chambers in the support frame 
-  xpos = 0.;
-  ypos = ((zmax1 + zmax2) / 2 + zlenn + zleni / 2) / 2;
-  zpos = 0.;
-  gMC->Gspos("UTCO", 1, "UTRI", xpos, ypos, zpos, idmat[2], "ONLY");
-  gMC->Gspos("UTCO", 2, "UTRI", xpos,-ypos, zpos,       0 , "ONLY");
-  xpos = 0.;
-  ypos = (zlenn + zleni) / 2;
-  zpos = 0.;
-  gMC->Gspos("UTCN", 1, "UTRI", xpos, ypos, zpos,       0 , "ONLY");
-  gMC->Gspos("UTCN", 2, "UTRI", xpos,-ypos, zpos,       0 , "ONLY");
-  xpos = 0.;
-  ypos = 0.;
-  zpos = 0.;
-  gMC->Gspos("UTCI", 1, "UTRI", xpos, ypos, zpos,       0 , "ONLY");
-
-  // Position of the inner part of the detector frame
-  xpos = (rmax + rmin) / 2;
-  ypos = 0.;
-  zpos = 0.;
-  gMC->Gspos("UTRI", 1, "UTRS", xpos, ypos, zpos, idmat[1], "ONLY");
-
-  // Position of the two arms of the detector
-  xpos = 0.;
-  ypos = 0.;
-  zpos = 0.;
-  gMC->Gspos("UTRD", 1, "TRD ", xpos, ypos, zpos,        0, "ONLY");
-  gMC->Gspos("UTRD", 2, "TRD ", xpos, ypos, zpos, idmat[0], "ONLY");
-
-  // Position of TRD mother volume in ALICE experiment 
-  xpos = 0.;
-  ypos = 0.;
-  zpos = 0.;
-  gMC->Gspos("TRD ", 1, "ALIC", xpos, ypos, zpos,        0, "ONLY");
-
-}
-//_____________________________________________________________________________
-void AliTRDv1::DrawModule()
-{
-  //
-  // Draw a shaded view of the Transition Radiation Detector version 1
-  //
+  // Position the the TRD-sectors only in one TRD-volume in the spaceframe
+  xpos     = 0.;
+  ypos     = 0.;
+  zpos     = 0.;
+  gMC->Gspos("TRD ",1,"BTR1",xpos,ypos,zpos,0,"ONLY");
 
 
-  // Set everything unseen
-  gMC->Gsatt("*", "seen", -1);
-  // 
-  // Set ALIC mother transparent
-  gMC->Gsatt("ALIC","SEEN",0);
-  //
-  // Set the volumes visible
-  gMC->Gsatt("TRD" ,"SEEN",0);
-  gMC->Gsatt("UTRD","SEEN",0);
-  gMC->Gsatt("UTRS","SEEN",0);
-  gMC->Gsatt("UTRI","SEEN",0);
-  gMC->Gsatt("UTCO","SEEN",0);
-  gMC->Gsatt("UTIO","SEEN",0);
-  gMC->Gsatt("UTMO","SEEN",0);
-  gMC->Gsatt("UTCN","SEEN",0);
-  gMC->Gsatt("UTIN","SEEN",0);
-  gMC->Gsatt("UTMN","SEEN",0);
-  gMC->Gsatt("UTCI","SEEN",0);
-  gMC->Gsatt("UTII","SEEN",0);
-  gMC->Gsatt("UTMI","SEEN",0);
-  gMC->Gsatt("UT1O","SEEN",1);
-  gMC->Gsatt("UT4O","SEEN",1);
-  gMC->Gsatt("UT1N","SEEN",1);
-  gMC->Gsatt("UT4N","SEEN",1);
-  gMC->Gsatt("UT1I","SEEN",1);
-  gMC->Gsatt("UT4I","SEEN",1);
-  //
-  gMC->Gdopt("hide", "on");
-  gMC->Gdopt("shad", "on");
-  gMC->Gsatt("*", "fill", 7);
-  gMC->SetClipBox(".");
-  gMC->SetClipBox("*", 0, 2000, -2000, 2000, -2000, 2000);
-  gMC->DefaultRange();
-  gMC->Gdraw("alic", 40, 30, 0, 12, 9.4, .021, .021);
-  gMC->Gdhead(1111, "Transition Radiation Detector Version 1");
-  gMC->Gdman(18, 4, "MAN");
 }
 
 //_____________________________________________________________________________
 }
 
 //_____________________________________________________________________________
@@ -465,7 +78,9 @@ void AliTRDv1::CreateMaterials()
   //
   // Create materials for the Transition Radiation Detector version 1
   //
   //
   // Create materials for the Transition Radiation Detector version 1
   //
+
   AliTRD::CreateMaterials();
   AliTRD::CreateMaterials();
+
 }
 
 //_____________________________________________________________________________
 }
 
 //_____________________________________________________________________________
@@ -474,11 +89,25 @@ void AliTRDv1::Init()
   //
   // Initialise the Transition Radiation Detector after the geometry is built
   //
   //
   // Initialise the Transition Radiation Detector after the geometry is built
   //
+
   AliTRD::Init();
   AliTRD::Init();
-  // Retrieve the numeric identifier of the sensitive volumes (gas volume)
-  fIdSens1 = gMC->VolId("UT4I");
-  fIdSens2 = gMC->VolId("UT4N");
-  fIdSens3 = gMC->VolId("UT4O");
+
+  for (Int_t i = 0; i < 80; i++) printf("*");
+  printf("\n");
+  
+  // Identifier of the sensitive volume (amplification region)
+  fIdSens     = gMC->VolId("UL06");
+
+  // Identifier of the TRD-spaceframe volumina
+  fIdSpace1   = gMC->VolId("B028");
+  fIdSpace2   = gMC->VolId("B029");
+  fIdSpace3   = gMC->VolId("B030");
+
+  // Identifier of the TRD-driftchambers
+  fIdChamber1 = gMC->VolId("UCIO");
+  fIdChamber2 = gMC->VolId("UCIM");
+  fIdChamber3 = gMC->VolId("UCII");
+
 }
 
 //_____________________________________________________________________________
 }
 
 //_____________________________________________________________________________
@@ -486,80 +115,71 @@ void AliTRDv1::StepManager()
 {
   //
   // Procedure called at every step in the TRD
 {
   //
   // Procedure called at every step in the TRD
+  // Fast simulator. If switched on, a hit is produced when a track
+  // crosses the border between amplification region and pad plane.
   //
 
   //
 
-  Int_t         vol[3]; 
-  Int_t         icopy1, icopy2;
-  Int_t         idSens, icSens; 
-  TLorentzVector pos;
-  
-  Float_t       hits[4];
-  
-  TClonesArray &lhits = *fHits;
+  Int_t   vol[3]; 
+  Int_t   iIdSens, icSens; 
+  Int_t   iIdSpace, icSpace;
+  Int_t   iIdChamber, icChamber;
+
+  Int_t   secMap1[10] = {  3,  7,  8,  9, 10, 11,  2,  1, 18, 17 };
+  Int_t   secMap2[ 5] = { 16, 15, 14, 13, 12 };
+  Int_t   secMap3[ 3] = {  5,  6,  4 };
+
+  Float_t hits[4];
+
+  TLorentzVector p;
+  TClonesArray  &lhits = *fHits;
+
+  // Writing out hits enabled?
+  if (!(fHitsOn)) return;
 
   // Use only charged tracks and count them only once per volume
 
   // Use only charged tracks and count them only once per volume
-  if (gMC->TrackCharge() && gMC->IsTrackExiting()) {
+  if (gMC->TrackCharge()    && 
+      gMC->IsTrackExiting()) {
     
     // Check on sensitive volume
     
     // Check on sensitive volume
-    idSens = gMC->CurrentVolID(icSens);
+    iIdSens = gMC->CurrentVolID(icSens);
+    if (iIdSens == fIdSens) { 
+
+      gMC->TrackPosition(p);
+      for (Int_t i = 0; i < 3; i++) hits[i] = p[i];
+      // No charge created
+      hits[3] = 0;
+
+      iIdSpace   = gMC->CurrentVolOffID(4,icSpace  );
+      iIdChamber = gMC->CurrentVolOffID(1,icChamber);
 
 
-    // Check on sensitive volume
-    idSens = gMC->CurrentVolID(icSens);
-    if ((idSens == fIdSens1) || 
-        (idSens == fIdSens2) ||
-        (idSens == fIdSens3)) { 
-      
       // The sector number
       // The sector number
-      gMC->CurrentVolOffID(5,icopy1);
-      gMC->CurrentVolOffID(6,icopy2);
-      if (icopy2 == 1)
-        vol[0] =     icopy1;
-      else
-        vol[0] = 6 - icopy1 + 5;
-      
+      if      (iIdSpace == fIdSpace1) 
+        vol[0] = secMap1[icSpace-1];
+      else if (iIdSpace == fIdSpace2) 
+        vol[0] = secMap2[icSpace-1];
+      else if (iIdSpace == fIdSpace3) 
+        vol[0] = secMap3[icSpace-1];
+
       // The chamber number 
       //   1: outer left
       // The chamber number 
       //   1: outer left
-      //   2: neighbouring left
+      //   2: middle left
       //   3: inner
       //   3: inner
-      //   4: neighbouring right
+      //   4: middle right
       //   5: outer right
       //   5: outer right
-      gMC->CurrentVolOffID(3,icopy1);
-      if      (idSens == fIdSens3)
-        vol[1] = 4 * icopy1 - 3; 
-      else if (idSens == fIdSens2)
-        vol[1] = 2 * icopy1;
-      else 
+      if      (iIdChamber == fIdChamber1)
+        vol[1] = (hits[2] < 0 ? 1 : 5);
+      else if (iIdChamber == fIdChamber2)       
+        vol[1] = (hits[2] < 0 ? 2 : 4);
+      else if (iIdChamber == fIdChamber3)       
         vol[1] = 3;
         vol[1] = 3;
-      
+
       // The plane number
       // The plane number
-      gMC->CurrentVolOffID(1,icopy1);
-      vol[2] = icopy1;
-
-      if (fSensSelect) {
-        Int_t addthishit = 1;
-        if ((fSensPlane)   && (vol[2] != fSensPlane  )) addthishit = 0;
-        if ((fSensChamber) && (vol[1] != fSensChamber)) addthishit = 0;
-        if ((fSensSector)  && (vol[0] != fSensSector )) addthishit = 0;
-        if (addthishit) {
-          gMC->TrackPosition(pos);
-         hits[0] = pos[0];
-         hits[1] = pos[1];
-         hits[2] = pos[2];
-          hits[3] = 0;
-          new(lhits[fNhits++]) AliTRDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
-       }
-      }
-      else {      
-       gMC->TrackPosition(pos);
-       hits[0] = pos[0];
-       hits[1] = pos[1];
-       hits[2] = pos[2];
-        hits[3] = 0;
-        new(lhits[fNhits++]) AliTRDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
-      }
+      vol[2] = icChamber - TMath::Nint((Float_t) (icChamber / 7)) * 6;
+
+      new(lhits[fNhits++]) AliTRDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
 
     }
 
 
     }
 
-  } 
+  }  
 
 }
 
 }
index 3106a726bb7b8cfa4115674cb6966b81b637301b..e56b773dc62d50379c98aa936aadd2fe29d5a030 100644 (file)
@@ -15,16 +15,25 @@ public:
   virtual void  CreateGeometry();
   virtual void  CreateMaterials();
   virtual Int_t IsVersion() const {return 1;}
   virtual void  CreateGeometry();
   virtual void  CreateMaterials();
   virtual Int_t IsVersion() const {return 1;}
+  virtual void  SetHits(Int_t ihit = 1) { fHitsOn = ihit; };
   virtual void  StepManager();
   virtual void  Init();
   virtual void  StepManager();
   virtual void  Init();
-  virtual void  DrawModule();
 
 protected:
 
 protected:
-  Int_t        fIdSens1;    // 1st sensitive volume identifier
-  Int_t        fIdSens2;    // 2nd sensitive volume identifier
-  Int_t        fIdSens3;    // 3rd sensitive volume identifier
+  Int_t        fIdSens;     // Sensitive volume identifier
+
+  Int_t        fIdSpace1;   // Spaceframe volume identifier
+  Int_t        fIdSpace2;   // 
+  Int_t        fIdSpace3;   // 
+
+  Int_t        fIdChamber1; // Driftchamber volume identifier
+  Int_t        fIdChamber2; // 
+  Int_t        fIdChamber3; // 
+
+  Int_t        fHitsOn;     // Used to switch hits on
             
   ClassDef(AliTRDv1,1)      // Transition Radiation Detector version 1
             
   ClassDef(AliTRDv1,1)      // Transition Radiation Detector version 1
+
 };
 
 #endif
 };
 
 #endif
index 6e03ff1655c1418643de21187a41f18d6122c310..3f76921121119050c0adfc31dabf7fdb3e8da042 100644 (file)
@@ -28,438 +28,62 @@ AliTRDv2::AliTRDv2(const char *name, const char *title)
   //
   // Standard constructor for Transition Radiation Detector version 2
   //
   //
   // Standard constructor for Transition Radiation Detector version 2
   //
-  for (Int_t icham = 0; icham < ncham; ++icham) {
-    fIdSensI[icham] = 0;
-    fIdSensN[icham] = 0;
-    fIdSensO[icham] = 0;
-  }
-  fDeltaE = NULL;
+
+  fIdSens      = 0;
+
+  fIdSpace1    = 0;
+  fIdSpace2    = 0;
+  fIdSpace3    = 0;
+
+  fIdChamber1  = 0;
+  fIdChamber2  = 0;
+  fIdChamber3  = 0;
+
+  fSensSelect  = 0;
+  fSensPlane   = 0;
+  fSensChamber = 0;
+  fSensSector  = 0;
+
+  fDeltaE      = NULL;
 
   SetBufferSize(128000);
 
   SetBufferSize(128000);
+
 }
 
 AliTRDv2::~AliTRDv2()
 {
 }
 
 AliTRDv2::~AliTRDv2()
 {
-   if (fDeltaE)  delete fDeltaE;
+
+  if (fDeltaE)  delete fDeltaE;
+
 }
  
 //_____________________________________________________________________________
 void AliTRDv2::CreateGeometry()
 {
   //
 }
  
 //_____________________________________________________________________________
 void AliTRDv2::CreateGeometry()
 {
   //
-  // Create geometry for the Transition Radiation Detector version 2
+  // Create the GEANT geometry for the Transition Radiation Detector - Version 2
   // This version covers the full azimuth. 
   // This version covers the full azimuth. 
-  // --- Author :  Christoph Blume (GSI) 20/5/99 
   //
   //
-  // --- Volume names : 
-  //       TRD         --> Mother TRD volume                              (Al) 
-  //       UTRS        --> Sectors of the sub-detector                    (Al)
-  //       UTRI        --> Inner part of the detector frame               (Air) 
-  //     The chambers 
-  //       UCI1-6      --> The frame of the inner chambers                (C) 
-  //       UCN1-6      --> The frame of the neighbouring chambers         (C) 
-  //       UCO1-6      --> The frame of the outer chambers                (C) 
-  //       UII1-6      --> The inner part of the inner chambers           (Air) 
-  //       UIN1-6      --> The inner part of the neighbouring chambers    (Air) 
-  //       UIO1-6      --> The inner part of the outer chambers           (Air) 
-  //     The layers inside a chamber 
-  //       UT0I(N,O)   --> Radiator seal                                  (G10)
-  //       UT1I(N,O)   --> Radiator                                       (CO2)
-  //       UT2I(N,O)   --> Polyethylene of radiator                       (PE)
-  //       UT3I(N,O)   --> Entrance window                                (Mylar)
-  //       UXI(N,O)1-6 --> Gas volume (sensitive)                         (Xe/Isobutane)
-  //       UT5I(N,O)   --> Pad plane                                      (Cu)
-  //       UT6I(N,O)   --> Support structure                              (G10)
-  //       UT7I(N,O)   --> FEE + signal lines                             (Cu)
-  //       UT8I(N,O)   --> Polyethylene of cooling device                 (PE)
-  //       UT9I(N,O)   --> Cooling water                                  (Water)
+  // Author:  Christoph Blume (C.Blume@gsi.de) 20/07/99 
   //
   //
-  //Begin_Html
-  /*
-    <img src="picts/AliTRDv2.gif">
-  */
-  //End_Html
-  //Begin_Html
-  /*
-    <img src="picts/AliTRDv2Tree.gif">
-  */
-  //End_Html
-  
-  Float_t xpos, ypos, zpos;
-  Int_t   idmat[2];
-
-  const Int_t nparmo = 10;
-  const Int_t nparfr =  4;
-  const Int_t nparch =  3;
-  const Int_t nparic =  4;
-  const Int_t nparnc =  4;
-  const Int_t nparoc = 11;
-
-  Float_t par_mo[nparmo];
-  Float_t par_fr[nparfr];
-  Float_t par_ch[nparch];
-  Float_t par_ic[nparic];
-  Float_t par_nc[nparnc];
-  Float_t par_oc[nparoc];
-
-  Int_t icham;
-
-  Int_t *idtmed = fIdtmed->GetArray()-1299;
-  
-  //////////////////////////////////////////////////////////////////////////
-  //     Definition of Volumes 
-  //////////////////////////////////////////////////////////////////////////
-  
-  // Definition of the mother volume for the TRD (Al) 
-  par_mo[0] =   0.;
-  par_mo[1] = 360.;
-  par_mo[2] = nsect;
-  par_mo[3] = 2.;
-  par_mo[4] = -zmax1;
-  par_mo[5] = rmin;
-  par_mo[6] = rmax;
-  par_mo[7] =  zmax1;
-  par_mo[8] = rmin;
-  par_mo[9] = rmax;
-  gMC->Gsvolu("TRD ", "PGON", idtmed[1301-1], par_mo, nparmo);
-  gMC->Gsdvn("UTRS", "TRD ", nsect, 2);
-
-  // The minimal width of a sector in rphi-direction
-  Float_t widmi = rmin * TMath::Tan(kPI/nsect);
-  // The maximal width of a sector in rphi-direction
-  Float_t widma = rmax * TMath::Tan(kPI/nsect);
-  // The total thickness of the spaceframe (Al + Air)
-  Float_t frame = widmi - (widpl1 / 2);
-
-  // Definition of the inner part of the detector frame (Air) 
-  par_fr[0] = widmi - alframe / 2.;
-  par_fr[1] = widma - alframe / 2.;
-  par_fr[2] = zmax1;
-  par_fr[3] = (rmax - rmin) / 2;
-  gMC->Gsvolu("UTRI", "TRD1", idtmed[1302-1], par_fr, nparfr); 
-
-  // Some parameter for the chambers 
-  Float_t lendifc = (zmax1 - zmax2) / nmodul;
-  Float_t heightc = (rmax  - rmin ) / nmodul;
-  Float_t widdifc = (widma - widmi) / nmodul;
-
-  // Definition of the chambers 
-  Char_t ctagc[5], ctagi[5];
-  for (icham = 1; icham <= ncham; ++icham) {
-
-    // Carbon frame of the inner chambers (C) 
-    par_ch[0] = widmi + (icham-1) * widdifc - frame;
-    par_ch[1] = zleni   / 2.;
-    par_ch[2] = heightc / 2.;
-    sprintf(ctagc,"UCI%1d",icham);
-    gMC->Gsvolu(ctagc, "BOX ", idtmed[1307-1], par_ch, nparch);
-    // Inner part of the inner chambers (Air) 
-    par_ch[0] -= ccframe;
-    par_ch[1] -= ccframe;
-    sprintf(ctagc,"UII%1d",icham);
-    gMC->Gsvolu(ctagc, "BOX ", idtmed[1302-1], par_ch, nparch);
-
-    // Carbon frame of the neighbouring chambers (C) 
-    par_ch[0] = widmi + (icham-1) * widdifc - frame;
-    par_ch[1] = zlenn   / 2.;
-    par_ch[2] = heightc / 2.;
-    sprintf(ctagc,"UCN%1d",icham);
-    gMC->Gsvolu(ctagc, "BOX ", idtmed[1307-1], par_ch, nparch);
-    // Inner part of the neighbouring chambers (Air) 
-    par_ch[0] -= ccframe;
-    par_ch[1] -= ccframe;
-    sprintf(ctagc,"UIN%1d",icham);
-    gMC->Gsvolu(ctagc, "BOX ", idtmed[1302-1], par_ch, nparch);
-
-    // Carbon frame of the outer chambers (C) 
-    par_ch[0] = widmi + (icham-1) * widdifc - frame;
-    par_ch[1] = (icham - 6) * lendifc / 2. + zleno   / 2.;
-    par_ch[2] = heightc / 2.;
-    sprintf(ctagc,"UCO%1d",icham);
-    gMC->Gsvolu(ctagc, "BOX ", idtmed[1307-1], par_ch, nparch);
-    // Inner part of the outer chambers (Air) 
-    par_ch[0] -= ccframe;
-    par_ch[1] -= ccframe;
-    sprintf(ctagc,"UIO%1d",icham);
-    gMC->Gsvolu(ctagc, "BOX ", idtmed[1302-1], par_ch, nparch);
-
-  }
-
-  // Definition of the layers in each inner chamber 
-  par_ic[0] = -1.;
-  par_ic[1] = -1.;
-  // G10 layer (radiator layer)
-  par_ic[2] = sethick / 2;
-  gMC->Gsvolu("UT0I", "BOX ", idtmed[1313-1], par_ic, nparic);
-  // CO2 layer (radiator)
-  par_ic[2] = rathick / 2;
-  gMC->Gsvolu("UT1I", "BOX ", idtmed[1312-1], par_ic, nparic);
-  // PE layer (radiator)
-  par_ic[2] = pethick / 2;
-  gMC->Gsvolu("UT2I", "BOX ", idtmed[1303-1], par_ic, nparic);
-  // Mylar layer (entrance window + HV cathode) 
-  par_ic[2] = mythick / 2;
-  gMC->Gsvolu("UT3I", "BOX ", idtmed[1308-1], par_ic, nparic);
-  // Xe/Isobutane layer (gasvolume) 
-  par_ic[2] = xethick / 2.;
-  for (icham = 1; icham <= 6; ++icham) {
-    sprintf(ctagc,"UXI%1d",icham);
-    gMC->Gsvolu(ctagc, "BOX ", idtmed[1309-1], par_ic, nparic);
-  }
-  // Cu layer (pad plane)
-  par_ic[2] = cuthick / 2;
-  gMC->Gsvolu("UT5I", "BOX ", idtmed[1305-1], par_ic, nparic);
-  // G10 layer (support structure)
-  par_ic[2] = suthick / 2;
-  gMC->Gsvolu("UT6I", "BOX ", idtmed[1313-1], par_ic, nparic);
-  // Cu layer (FEE + signal lines)
-  par_ic[2] = fethick / 2;
-  gMC->Gsvolu("UT7I", "BOX ", idtmed[1305-1], par_ic, nparic);
-  // PE layer (cooling devices)
-  par_ic[2] = cothick / 2;
-  gMC->Gsvolu("UT8I", "BOX ", idtmed[1303-1], par_ic, nparic);
-  // Water layer (cooling)
-  par_ic[2] = wathick / 2;
-  gMC->Gsvolu("UT9I", "BOX ", idtmed[1314-1], par_ic, nparic);
-
-  // Definition of the layers in each neighbouring chamber 
-  par_nc[0] = -1.;
-  par_nc[1] = -1.;
-  // G10 layer (radiator layer)
-  par_nc[2] = sethick / 2;
-  gMC->Gsvolu("UT0N", "BOX ", idtmed[1313-1], par_nc, nparnc);
-  // CO2 layer (radiator)
-  par_nc[2] = rathick / 2;
-  gMC->Gsvolu("UT1N", "BOX ", idtmed[1312-1], par_nc, nparnc);
-  // PE layer (radiator)
-  par_nc[2] = pethick / 2;
-  gMC->Gsvolu("UT2N", "BOX ", idtmed[1303-1], par_nc, nparnc);
-  // Mylar layer (entrance window + HV cathode) 
-  par_nc[2] = mythick / 2;
-  gMC->Gsvolu("UT3N", "BOX ", idtmed[1308-1], par_nc, nparnc);
-  // Xe/Isobutane layer (gasvolume) 
-  par_nc[2] = xethick / 2.;
-  for (icham = 1; icham <= 6; ++icham) {
-    sprintf(ctagc,"UXN%1d",icham);
-    gMC->Gsvolu(ctagc, "BOX ", idtmed[1309-1], par_nc, nparnc);
-  }
-  // Cu layer (pad plane)
-  par_nc[2] = cuthick / 2;
-  gMC->Gsvolu("UT5N", "BOX ", idtmed[1305-1], par_nc, nparnc);
-  // G10 layer (support structure)
-  par_nc[2] = suthick / 2;
-  gMC->Gsvolu("UT6N", "BOX ", idtmed[1313-1], par_nc, nparnc);
-  // Cu layer (FEE + signal lines)
-  par_nc[2] = fethick / 2;
-  gMC->Gsvolu("UT7N", "BOX ", idtmed[1305-1], par_nc, nparnc);
-  // PE layer (cooling devices)
-  par_nc[2] = cothick / 2;
-  gMC->Gsvolu("UT8N", "BOX ", idtmed[1303-1], par_nc, nparnc);
-  // Water layer (cooling)
-  par_nc[2] = wathick / 2;
-  gMC->Gsvolu("UT9N", "BOX ", idtmed[1314-1], par_nc, nparnc);
-
-  // Definition of the layers in each outer chamber 
-  par_oc[0] = -1.;
-  par_oc[1] = -1.;
-  // G10 layer (radiator layer)
-  par_oc[2] = sethick / 2;
-  gMC->Gsvolu("UT0O", "BOX ", idtmed[1313-1], par_oc, nparoc);
-  // CO2 layer (radiator)
-  par_oc[2] = rathick / 2;
-  gMC->Gsvolu("UT1O", "BOX ", idtmed[1312-1], par_oc, nparoc);
-  // PE layer (radiator)
-  par_oc[2] = pethick / 2;
-  gMC->Gsvolu("UT2O", "BOX ", idtmed[1303-1], par_oc, nparoc);
-  // Mylar layer (entrance window + HV cathode) 
-  par_oc[2] = mythick / 2;
-  gMC->Gsvolu("UT3O", "BOX ", idtmed[1308-1], par_oc, nparoc);
-  // Xe/Isobutane layer (gasvolume) 
-  par_oc[2] = xethick / 2.;
-  for (icham = 1; icham <= 6; ++icham) {
-    sprintf(ctagc,"UXO%1d",icham);
-    gMC->Gsvolu(ctagc, "BOX ", idtmed[1309-1], par_oc, nparoc);
-  }
-  // Cu layer (pad plane)
-  par_oc[2] = cuthick / 2;
-  gMC->Gsvolu("UT5O", "BOX ", idtmed[1305-1], par_oc, nparoc);
-  // G10 layer (support structure)
-  par_oc[2] = suthick / 2;
-  gMC->Gsvolu("UT6O", "BOX ", idtmed[1313-1], par_oc, nparoc);
-  // Cu layer (FEE + signal lines)
-  par_oc[2] = fethick / 2;
-  gMC->Gsvolu("UT7O", "BOX ", idtmed[1305-1], par_oc, nparoc);
-  // PE layer (cooling devices)
-  par_oc[2] = cothick / 2;
-  gMC->Gsvolu("UT8O", "BOX ", idtmed[1303-1], par_oc, nparoc);
-  // Water layer (cooling)
-  par_oc[2] = wathick / 2;
-  gMC->Gsvolu("UT9O", "BOX ", idtmed[1314-1], par_oc, nparoc);
-
-  //////////////////////////////////////////////////////////////////////////
-  //     Positioning of Volumes   
-  //////////////////////////////////////////////////////////////////////////
-
-  // The rotation matrices 
-  AliMatrix(idmat[0],  90.,  90., 180.,   0.,  90.,   0.);
-  AliMatrix(idmat[1],  90.,  90.,   0.,   0.,  90.,   0.);
-
-  // Position of the layers in a chamber 
-  gMC->Gspos("UT2I", 1, "UT1I", 0., 0., pezpos, 0, "ONLY");
-  gMC->Gspos("UT2N", 1, "UT1N", 0., 0., pezpos, 0, "ONLY");
-  gMC->Gspos("UT2O", 1, "UT1O", 0., 0., pezpos, 0, "ONLY");
-  for (icham = 1; icham <= ncham; ++icham) {
-    // The inner chambers 
-    sprintf(ctagi,"UII%1d",icham);
-    sprintf(ctagc,"UXI%1d",icham);
-    gMC->Gspos("UT9I", icham, ctagi, 0., 0., wazpos, 0, "ONLY");
-    gMC->Gspos("UT8I", icham, ctagi, 0., 0., cozpos, 0, "ONLY");
-    gMC->Gspos("UT7I", icham, ctagi, 0., 0., fezpos, 0, "ONLY");
-    gMC->Gspos("UT6I", icham, ctagi, 0., 0., suzpos, 0, "ONLY");
-    gMC->Gspos("UT5I", icham, ctagi, 0., 0., cuzpos, 0, "ONLY");
-    gMC->Gspos(ctagc ,     1, ctagi, 0., 0., xezpos, 0, "ONLY");
-    gMC->Gspos("UT3I", icham, ctagi, 0., 0., myzpos, 0, "ONLY");
-    gMC->Gspos("UT1I", icham, ctagi, 0., 0., razpos, 0, "ONLY");
-    gMC->Gspos("UT0I", icham, ctagi, 0., 0., sezpos, 0, "ONLY");
-    // The neighbouring chambers 
-    sprintf(ctagi,"UIN%1d",icham);
-    sprintf(ctagc,"UXN%1d",icham);
-    gMC->Gspos("UT9N", icham, ctagi, 0., 0., wazpos, 0, "ONLY");
-    gMC->Gspos("UT8N", icham, ctagi, 0., 0., cozpos, 0, "ONLY");
-    gMC->Gspos("UT7N", icham, ctagi, 0., 0., fezpos, 0, "ONLY");
-    gMC->Gspos("UT6N", icham, ctagi, 0., 0., suzpos, 0, "ONLY");
-    gMC->Gspos("UT5N", icham, ctagi, 0., 0., cuzpos, 0, "ONLY");
-    gMC->Gspos(ctagc ,     1, ctagi, 0., 0., xezpos, 0, "ONLY");
-    gMC->Gspos("UT3N", icham, ctagi, 0., 0., myzpos, 0, "ONLY");
-    gMC->Gspos("UT1N", icham, ctagi, 0., 0., razpos, 0, "ONLY");
-    gMC->Gspos("UT0N", icham, ctagi, 0., 0., sezpos, 0, "ONLY");
-    // The outer chambers 
-    sprintf(ctagi,"UIO%1d",icham);
-    sprintf(ctagc,"UXO%1d",icham);
-    gMC->Gspos("UT9O", icham, ctagi, 0., 0., wazpos, 0, "ONLY");
-    gMC->Gspos("UT8O", icham, ctagi, 0., 0., cozpos, 0, "ONLY");
-    gMC->Gspos("UT7O", icham, ctagi, 0., 0., fezpos, 0, "ONLY");
-    gMC->Gspos("UT6O", icham, ctagi, 0., 0., suzpos, 0, "ONLY");
-    gMC->Gspos("UT5O", icham, ctagi, 0., 0., cuzpos, 0, "ONLY");
-    gMC->Gspos(ctagc ,     1, ctagi, 0., 0., xezpos, 0, "ONLY");
-    gMC->Gspos("UT3O", icham, ctagi, 0., 0., myzpos, 0, "ONLY");
-    gMC->Gspos("UT1O", icham, ctagi, 0., 0., razpos, 0, "ONLY");
-    gMC->Gspos("UT0O", icham, ctagi, 0., 0., sezpos, 0, "ONLY");
-  }
-
-  // Position of the inner part of the chambers in the carbon-frames 
-  for (icham = 1; icham <= ncham; ++icham) {
-    xpos = 0.;
-    ypos = 0.;
-    zpos = 0.;
-    // The inner chambers 
-    sprintf(ctagi,"UII%1d",icham);
-    sprintf(ctagc,"UCI%1d",icham);
-    gMC->Gspos(ctagi, 1, ctagc, xpos, ypos, zpos, 0, "ONLY");
-    // The neighbouring chambers 
-    sprintf(ctagi,"UIN%1d",icham);
-    sprintf(ctagc,"UCN%1d",icham);
-    gMC->Gspos(ctagi, 1, ctagc, xpos, ypos, zpos, 0, "ONLY");
-    // The outer chambers 
-    sprintf(ctagi,"UIO%1d",icham);
-    sprintf(ctagc,"UCO%1d",icham);
-    gMC->Gspos(ctagi, 1, ctagc, xpos, ypos, zpos, 0, "ONLY");
-  }
-
-  // Position of the chambers in the full TRD-setup 
-  for (icham = 1; icham <= ncham; ++icham) {
-    // The inner chambers
-    xpos = 0.;
-    ypos = 0.;
-    zpos = (icham-0.5) * heightc - (rmax - rmin) / 2;
-    sprintf(ctagc,"UCI%1d",icham);
-    gMC->Gspos(ctagc, 1, "UTRI", xpos, ypos, zpos, 0, "ONLY");
-    // The neighbouring chambers
-    xpos = 0.;
-    ypos = (zleni + zlenn) / 2.;
-    zpos = (icham-0.5) * heightc - (rmax - rmin) / 2;
-    sprintf(ctagc,"UCN%1d",icham);
-    gMC->Gspos(ctagc, 1, "UTRI", xpos, ypos, zpos, 0, "ONLY");
-    ypos = -ypos;
-    sprintf(ctagc,"UCN%1d",icham);
-    gMC->Gspos(ctagc, 2, "UTRI", xpos, ypos, zpos, 0, "ONLY");
-    // The outer chambers 
-    xpos = 0.;
-    ypos = (zleni / 2. + zlenn + zmax2 + (icham-1) * lendifc) / 2.;
-    zpos = (icham-0.5) * heightc - (rmax-rmin)/2;
-    sprintf(ctagc,"UCO%1d",icham);
-    gMC->Gspos(ctagc, 1, "UTRI", xpos, ypos, zpos, 0, "ONLY");
-    ypos = -ypos;
-    sprintf(ctagc,"UCO%1d",icham);
-    gMC->Gspos(ctagc, 2, "UTRI", xpos, ypos, zpos, 0, "ONLY");
-  }
 
 
-  // Position of the inner part of the detector frame
-  xpos = (rmax + rmin) / 2;
-  ypos = 0.;
-  zpos = 0.;
-  gMC->Gspos("UTRI", 1, "UTRS", xpos, ypos, zpos, idmat[0], "ONLY");
+  Float_t xpos, ypos, zpos;
 
 
-  // Position of the TRD mother volume in the ALICE experiment 
-  xpos = 0.;
-  ypos = 0.;
-  zpos = 0.;
-  gMC->Gspos("TRD ", 1, "ALIC", xpos, ypos, zpos,        0, "ONLY");
+  // Check that FRAME is there otherwise we have no place where to put the TRD
+  AliModule* FRAME = gAlice->GetModule("FRAME");
+  if (!FRAME) return;
 
 
-}
+  // Define the chambers
+  AliTRD::CreateGeometry();
 
 
-//_____________________________________________________________________________
-void AliTRDv2::DrawModule()
-{
-  //
-  // Draw a shaded view of the Transition Radiation Detector version 1
-  //
+  // Position the the TRD-sectors in all TRD-volumes in the spaceframe
+  xpos     = 0.;
+  ypos     = 0.;
+  zpos     = 0.;
+  gMC->Gspos("TRD ",1,"BTR1",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("TRD ",2,"BTR2",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("TRD ",3,"BTR3",xpos,ypos,zpos,0,"ONLY");
 
 
-  // Set everything unseen
-  gMC->Gsatt("*", "seen", -1);
-   
-  // Set ALIC mother transparent
-  gMC->Gsatt("ALIC","SEEN",0);
-  
-  // Set the volumes visible
-  gMC->Gsatt("TRD ","SEEN",0);
-  gMC->Gsatt("UTRS","SEEN",0);
-  gMC->Gsatt("UTRI","SEEN",0);
-  Char_t ctag[5];
-  for (Int_t icham = 0; icham < ncham; ++icham) {
-    sprintf(ctag,"UCI%1d",icham+1);
-    gMC->Gsatt(ctag,"SEEN",0);
-    sprintf(ctag,"UCN%1d",icham+1);
-    gMC->Gsatt(ctag,"SEEN",0);
-    sprintf(ctag,"UCO%1d",icham+1);
-    gMC->Gsatt(ctag,"SEEN",0);
-    sprintf(ctag,"UII%1d",icham+1);
-    gMC->Gsatt(ctag,"SEEN",0);
-    sprintf(ctag,"UIN%1d",icham+1);
-    gMC->Gsatt(ctag,"SEEN",0);
-    sprintf(ctag,"UIO%1d",icham+1);
-    gMC->Gsatt(ctag,"SEEN",0);
-    sprintf(ctag,"UXI%1d",icham+1);
-    gMC->Gsatt(ctag,"SEEN",1);
-    sprintf(ctag,"UXN%1d",icham+1);
-    gMC->Gsatt(ctag,"SEEN",1);
-    sprintf(ctag,"UXO%1d",icham+1);
-    gMC->Gsatt(ctag,"SEEN",1);
-  }
-  gMC->Gsatt("UT1I","SEEN",1);
-  gMC->Gsatt("UT1N","SEEN",1);
-  gMC->Gsatt("UT1O","SEEN",1);
-
-  gMC->Gdopt("hide", "on");
-  gMC->Gdopt("shad", "on");
-  gMC->Gsatt("*", "fill", 7);
-  gMC->SetClipBox(".");
-  gMC->SetClipBox("*", 0, 2000, -2000, 2000, -2000, 2000);
-  gMC->DefaultRange();
-  gMC->Gdraw("alic", 40, 30, 0, 12, 9.4, .021, .021);
-  gMC->Gdhead(1111, "Transition Radiation Detector Version 2");
-  gMC->Gdman(18, 4, "MAN");
-  gMC->Gdopt("hide", "off");
 }
 
 //_____________________________________________________________________________
 }
 
 //_____________________________________________________________________________
@@ -468,7 +92,9 @@ void AliTRDv2::CreateMaterials()
   //
   // Create materials for the Transition Radiation Detector version 2
   //
   //
   // Create materials for the Transition Radiation Detector version 2
   //
+
   AliTRD::CreateMaterials();
   AliTRD::CreateMaterials();
+
 }
 
 //_____________________________________________________________________________
 }
 
 //_____________________________________________________________________________
@@ -485,54 +111,132 @@ void AliTRDv2::Init()
 
   AliTRD::Init();
 
 
   AliTRD::Init();
 
-  // Get the sensitive volumes
-  Char_t ctag[5];
-  for (Int_t icham = 0; icham < ncham; ++icham) {
-    sprintf(ctag,"UXI%1d",icham+1);
-    fIdSensI[icham] = gMC->VolId(ctag);
-    sprintf(ctag,"UXN%1d",icham+1);
-    fIdSensN[icham] = gMC->VolId(ctag);
-    sprintf(ctag,"UXO%1d",icham+1);
-    fIdSensO[icham] = gMC->VolId(ctag);
-  }
+  if (fSensPlane)
+    printf("          Only plane %d is sensitive\n",fSensPlane);
+  if (fSensChamber)   
+    printf("          Only chamber %d is sensitive\n",fSensChamber);
+  if (fSensSector)
+    printf("          Only sector %d is sensitive\n",fSensSector);
 
 
-  Float_t Poti = TMath::Log(kPoti);
-  Float_t Eend = TMath::Log(kEend);
+  for(Int_t i = 0; i < 80; i++) printf("*");
+  printf("\n");
 
   // Ermilova distribution for the delta-ray spectrum
 
   // Ermilova distribution for the delta-ray spectrum
+  Float_t Poti = TMath::Log(kPoti);
+  Float_t Eend = TMath::Log(kEend);
   fDeltaE  = new TF1("deltae",Ermilova,Poti,Eend,0);
 
   fDeltaE  = new TF1("deltae",Ermilova,Poti,Eend,0);
 
+  // Identifier of the sensitive volume (drift region)
+  fIdSens     = gMC->VolId("UL05");
+
+  // Identifier of the TRD-spaceframe volumina
+  fIdSpace1   = gMC->VolId("B028");
+  fIdSpace2   = gMC->VolId("B029");
+  fIdSpace3   = gMC->VolId("B030");
+
+  // Identifier of the TRD-driftchambers
+  fIdChamber1 = gMC->VolId("UCIO");
+  fIdChamber2 = gMC->VolId("UCIM");
+  fIdChamber3 = gMC->VolId("UCII");
+
 }
 
 //_____________________________________________________________________________
 }
 
 //_____________________________________________________________________________
-void AliTRDv2::StepManager()
+void AliTRDv2::SetSensPlane(Int_t iplane)
 {
   //
 {
   //
-  // Called at every step in the Transition Radiation Detector version 2
+  // Defines the hit-sensitive plane (1-6)
   //
 
   //
 
-  Int_t          idSens, icSens, id;
-  Int_t          iPla, iCha, iSec;
-  Int_t          iOut;
-  Int_t          vol[3]; 
-  Int_t          iPid;
+  if ((iplane < 0) || (iplane > 6)) {
+    printf("Wrong input value: %d\n",iplane);
+    printf("Use standard setting\n");
+    fSensPlane  = 0;
+    fSensSelect = 0;
+    return;
+  }
 
 
-  const Double_t kBig = 1.0E+12;
+  fSensSelect = 1;
+  fSensPlane  = iplane;
 
 
-  Float_t        hits[4];
-  Float_t        random[1];
-  Float_t        charge;
-  Float_t        aMass;
+}
 
 
-  TLorentzVector pos, mom;
+//_____________________________________________________________________________
+void AliTRDv2::SetSensChamber(Int_t ichamber)
+{
+  //
+  // Defines the hit-sensitive chamber (1-5)
+  //
 
 
-  Double_t       pTot;
-  Double_t       qTot;
-  Double_t       eDelta;
-  Double_t       betaGamma, pp;
+  if ((ichamber < 0) || (ichamber > 5)) {
+    printf("Wrong input value: %d\n",ichamber);
+    printf("Use standard setting\n");
+    fSensChamber = 0;
+    fSensSelect  = 0;
+    return;
+  }
+
+  fSensSelect  = 1;
+  fSensChamber = ichamber;
 
 
+}
+
+//_____________________________________________________________________________
+void AliTRDv2::SetSensSector(Int_t isector)
+{
+  //
+  // Defines the hit-sensitive sector (1-18)
+  //
+
+  if ((isector < 0) || (isector > 18)) {
+    printf("Wrong input value: %d\n",isector);
+    printf("Use standard setting\n");
+    fSensSector = 0;
+    fSensSelect = 0;
+    return;
+  }
+
+  fSensSelect = 1;
+  fSensSector = isector;
+
+}
+
+//_____________________________________________________________________________
+void AliTRDv2::StepManager()
+{
+  //
+  // Called at every step in the Transition Radiation Detector version 2.
+  // Slow simulator. Every charged track produces electron cluster as hits 
+  // along its path across the drift volume. The step size is set acording
+  // to Bethe-Bloch. The energy distribution of the delta electrons follows
+  // a spectrum taken from Ermilova et al.
+  //
+
+  Int_t    iIdSens, icSens;
+  Int_t    iIdSpace, icSpace;
+  Int_t    iIdChamber, icChamber;
+  Int_t    vol[3]; 
+  Int_t    iPid;
+
+  Int_t    secMap1[10] = {  3,  7,  8,  9, 10, 11,  2,  1, 18, 17 };
+  Int_t    secMap2[ 5] = { 16, 15, 14, 13, 12 };
+  Int_t    secMap3[ 3] = {  5,  6,  4 };
+
+  Float_t  hits[4];
+  Float_t  random[1];
+  Float_t  charge;
+  Float_t  aMass;
+
+  Double_t pTot;
+  Double_t qTot;
+  Double_t eDelta;
+  Double_t betaGamma, pp;
+
+  TLorentzVector pos, mom;
   TClonesArray  &lhits = *fHits;
 
   TClonesArray  &lhits = *fHits;
 
+  const Double_t kBig = 1.0E+12;
+
   // Ionization energy
   const Float_t kWion    = 22.04;
   // Maximum energy for e+ e- g for the step-size calculation
   // Ionization energy
   const Float_t kWion    = 22.04;
   // Maximum energy for e+ e- g for the step-size calculation
@@ -552,31 +256,16 @@ void AliTRDv2::StepManager()
   gMC->SetMaxStep(kBig); 
 
   // Use only charged tracks 
   gMC->SetMaxStep(kBig); 
 
   // Use only charged tracks 
-  if (( gMC->TrackCharge()   ) &&
-      (!gMC->IsTrackStop()     ) && 
+  if (( gMC->TrackCharge()       ) &&
+      (!gMC->IsTrackStop()       ) && 
       (!gMC->IsTrackDisappeared())) {
 
       (!gMC->IsTrackDisappeared())) {
 
-    // Find the sensitive volume
-    idSens = gMC->CurrentVolID(icSens);
-    iPla   = 0;
-    iOut   = 0;
-    for (Int_t icham = 0; icham < ncham; ++icham) {
-      if (idSens == fIdSensI[icham]) {
-        iOut = 0;
-        iPla = icham + 1;
-      }
-      if (idSens == fIdSensN[icham]) {
-        iOut = 1;
-        iPla = icham + 1;
-      }
-      if (idSens == fIdSensO[icham]) {
-        iOut = 2;
-        iPla = icham + 1;
-      }
-    }
-
     // Inside a sensitive volume?
     // Inside a sensitive volume?
-    if (iPla) {
+    iIdSens = gMC->CurrentVolID(icSens);
+    if (iIdSens == fIdSens) { 
+
+      iIdSpace   = gMC->CurrentVolOffID(4,icSpace  );
+      iIdChamber = gMC->CurrentVolOffID(1,icChamber);
 
       // Calculate the energy of the delta-electrons
       eDelta = TMath::Exp(fDeltaE->GetRandom()) - kPoti;
 
       // Calculate the energy of the delta-electrons
       eDelta = TMath::Exp(fDeltaE->GetRandom()) - kPoti;
@@ -585,24 +274,36 @@ void AliTRDv2::StepManager()
       // The number of secondary electrons created
       qTot = (Double_t) ((Int_t) (eDelta / kWion) + 1);
 
       // The number of secondary electrons created
       qTot = (Double_t) ((Int_t) (eDelta / kWion) + 1);
 
-      // The sector number
-      id = gMC->CurrentVolOffID(4,iSec);
+      // The hit coordinates and charge
+      gMC->TrackPosition(pos);
+      hits[0] = pos[0];
+      hits[1] = pos[1];
+      hits[2] = pos[2];
+      hits[3] = qTot;
 
 
-      // The chamber number
+      // The sector number
+      if      (iIdSpace == fIdSpace1) 
+        vol[0] = secMap1[icSpace-1];
+      else if (iIdSpace == fIdSpace2) 
+        vol[0] = secMap2[icSpace-1];
+      else if (iIdSpace == fIdSpace3) 
+        vol[0] = secMap3[icSpace-1];
+
+      // The chamber number 
       //   1: outer left
       //   1: outer left
-      //   2: neighbouring left
+      //   2: middle left
       //   3: inner
       //   3: inner
-      //   4: neighbouring right
+      //   4: middle right
       //   5: outer right
       //   5: outer right
-      id = gMC->CurrentVolOffID(2,iCha);
-      if (iCha == 1) 
-        iCha = 3 + iOut;
-      else
-        iCha = 3 - iOut;
+      if      (iIdChamber == fIdChamber1)
+        vol[1] = (hits[2] < 0 ? 1 : 5);
+      else if (iIdChamber == fIdChamber2)       
+        vol[1] = (hits[2] < 0 ? 2 : 4);
+      else if (iIdChamber == fIdChamber3)       
+        vol[1] = 3;
 
 
-      vol[0]  = iSec;
-      vol[1]  = iCha;
-      vol[2]  = iPla;
+      // The plane number
+      vol[2] = icChamber - TMath::Nint((Float_t) (icChamber / 7)) * 6;
 
       // Check on selected volumes
       Int_t addthishit = 1;
 
       // Check on selected volumes
       Int_t addthishit = 1;
@@ -612,14 +313,9 @@ void AliTRDv2::StepManager()
         if ((fSensSector)  && (vol[0] != fSensSector )) addthishit = 0;
       }
 
         if ((fSensSector)  && (vol[0] != fSensSector )) addthishit = 0;
       }
 
+      // Add this hit
       if (addthishit) {
 
       if (addthishit) {
 
-        // Add this hit
-        gMC->TrackPosition(pos);
-       hits[0]=pos[0];
-       hits[1]=pos[1];
-       hits[2]=pos[2];
-        hits[3] = qTot;
         new(lhits[fNhits++]) AliTRDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
 
         // The energy loss according to Bethe Bloch
         new(lhits[fNhits++]) AliTRDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
 
         // The energy loss according to Bethe Bloch
index 420e028a81bd32d884c975e6e69d3e26b611c6a2..22c1022afce6dff2205341b4e8f1b20e72a6d8b9 100644 (file)
@@ -20,13 +20,26 @@ public:
   virtual void  CreateMaterials();
   virtual Int_t IsVersion() const {return 2;}
   virtual void  StepManager();
   virtual void  CreateMaterials();
   virtual Int_t IsVersion() const {return 2;}
   virtual void  StepManager();
+  virtual void  SetSensPlane(Int_t iplane = 0);
+  virtual void  SetSensChamber(Int_t ichamber = 0);
+  virtual void  SetSensSector(Int_t isector = 0);
   virtual void  Init();
   virtual void  Init();
-  virtual void  DrawModule();
 
 protected:
 
 protected:
-  Int_t        fIdSensI[ncham];  // Sensitive volume identifier (inner chambers)
-  Int_t        fIdSensN[ncham];  // Sensitive volume identifier (neighbouring chambers)
-  Int_t        fIdSensO[ncham];  // Sensitive volume identifier (outer chambers)
+  Int_t        fIdSens;          // Sensitive volume identifier
+
+  Int_t        fIdSpace1;        // Spaceframe volume identifier
+  Int_t        fIdSpace2;        // 
+  Int_t        fIdSpace3;        // 
+
+  Int_t        fIdChamber1;      // Driftchamber volume identifier
+  Int_t        fIdChamber2;      // 
+  Int_t        fIdChamber3;      // 
+
+  Int_t        fSensSelect;      // Switch to select only parts of the detector
+  Int_t        fSensPlane;       // Sensitive detector plane
+  Int_t        fSensChamber;     // Sensitive detector chamber
+  Int_t        fSensSector;      // Sensitive detector sector
 
 private:
   virtual Double_t BetheBloch(Double_t bg);
 
 private:
   virtual Double_t BetheBloch(Double_t bg);
@@ -34,6 +47,7 @@ private:
   TF1         *fDeltaE;          // Energy distribution of the delta-electrons
   
   ClassDef(AliTRDv2,1)           // Transition Radiation Detector version 2
   TF1         *fDeltaE;          // Energy distribution of the delta-electrons
   
   ClassDef(AliTRDv2,1)           // Transition Radiation Detector version 2
+
 };
 
 #endif
 };
 
 #endif
index 20e84a923390adf2aaee46e1e5efc5d1556ee8cb..cf2f25c2790d12abfb78adabd090565377f4aa54 100644 (file)
@@ -1,21 +1,15 @@
 //void DrawTRD()
 {
 //void DrawTRD()
 {
-   geant3->Gsatt("*", "seen", -1);
-   geant3->Gsatt("alic", "seen", 0);
-   AliTRD *TRD = gAlice->GetModule("TRD");
-   if      (TRD->IsVersion() == 0)
-     gROOT->Macro("ViewTRD0.C");
-   else if (TRD->IsVersion() == 1)
-     gROOT->Macro("ViewTRD1.C");
-   else if (TRD->IsVersion() == 2)
-     gROOT->Macro("ViewTRD2.C");
-   geant3->Gdopt("hide", "on");
-   geant3->Gdopt("shad", "on");
-   geant3->Gsatt("*", "fill", 7);
-   geant3->SetClipBox(".");
-   geant3->SetClipBox("*", 0, 2000, -2000, 2000, -2000, 2000);
-   geant3->DefaultRange();
-   geant3->Gdraw("alic", 40, 30, 0, 12, 9.4, .020, .020);
-   geant3->Gdhead(1111, "Transition Radiation Detector");
-   geant3->Gdman(18, 4, "MAN");
+   gMC->Gsatt("*", "seen", -1);
+   gMC->Gsatt("alic", "seen", 0);
+   gROOT->Macro("ViewTRD.C");
+   gMC->Gdopt("hide", "on");
+   gMC->Gdopt("shad", "on");
+   gMC->Gsatt("*", "fill", 7);
+   gMC->SetClipBox(".");
+   gMC->SetClipBox("*", 0, 2000, -2000, 2000, -2000, 2000);
+   gMC->DefaultRange();
+   gMC->Gdraw("alic", 40, 30, 0, 12, 9.4, .020, .020);
+   gMC->Gdhead(1111, "Transition Radiation Detector");
+   gMC->Gdman(18, 4, "MAN");
 }
 }
index a2b607f00ad04339a19e062db61089bc8ae7ae0a..61d9b312e32d34f0c118da1ad9fe5f105ec2c3c4 100644 (file)
@@ -1,50 +1,19 @@
-//void ViewUTD()
+//void ViewTRD()
 {
 {
-   gMC->Gsatt("TRD ","seen",0);
 
 
-   gMC->Gsatt("UTRL","seen",0);
-   gMC->Gsatt("UTSL","seen",0);
-   gMC->Gsatt("UTFI","seen",0);
-   gMC->Gsatt("UTFO","seen",0);
-   gMC->Gsatt("UTCI","seen",0);
-   gMC->Gsatt("UTCO","seen",0);
-   gMC->Gsatt("UTII","seen",0);
-   gMC->Gsatt("UTIO","seen",0);
-   gMC->Gsatt("UTMI","seen",0);
-   gMC->Gsatt("UTMO","seen",0);
+  gMC->Gsatt("B032","SEEN", 0);
+  gMC->Gsatt("B028","SEEN", 0);
+  gMC->Gsatt("B029","SEEN", 0);
+  gMC->Gsatt("B030","SEEN", 0);
+  gMC->Gsatt("BTR1","SEEN", 0);
+  gMC->Gsatt("BTR2","SEEN", 0);
+  gMC->Gsatt("BTR3","SEEN", 0);
+  gMC->Gsatt("TRD" ,"SEEN", 0);
+  gMC->Gsatt("UCII","SEEN", 0);
+  gMC->Gsatt("UCIM","SEEN", 0);
+  gMC->Gsatt("UCIO","SEEN", 0);
+  gMC->Gsatt("UL02","SEEN", 1);
+  gMC->Gsatt("UL05","SEEN", 1);
+  gMC->Gsatt("UL06","SEEN", 1);
 
 
-   gMC->Gsatt("UTRS","seen",0);
-   gMC->Gsatt("UTSS","seen",0);
-   gMC->Gsatt("UTFS","seen",0);
-   gMC->Gsatt("UTCS","seen",0);
-   gMC->Gsatt("UTIS","seen",0);
-   gMC->Gsatt("UTMS","seen",0);
-
-   gMC->Gsatt("UT1S","seen",1);
-   gMC->Gsatt("UT2S","seen",1);
-   gMC->Gsatt("UT3S","seen",1);
-   gMC->Gsatt("UT4S","seen",1);
-   gMC->Gsatt("UT5S","seen",1);
-   gMC->Gsatt("UT6S","seen",1);
-   gMC->Gsatt("UT7S","seen",1);
-   gMC->Gsatt("UT8S","seen",1);
-
-   gMC->Gsatt("UT1I","seen",1);
-   gMC->Gsatt("UT2I","seen",1);
-   gMC->Gsatt("UT3I","seen",1);
-   gMC->Gsatt("UT4I","seen",1);
-   gMC->Gsatt("UT5I","seen",1);
-   gMC->Gsatt("UT6I","seen",1);
-   gMC->Gsatt("UT7I","seen",1);
-   gMC->Gsatt("UT8I","seen",1);
-
-   gMC->Gsatt("UT1O","seen",1);
-   gMC->Gsatt("UTIO","seen",1);
-   gMC->Gsatt("UT3O","seen",1);
-   gMC->Gsatt("UT4O","seen",1);
-   gMC->Gsatt("UT5O","seen",1);
-   gMC->Gsatt("UT6O","seen",1);
-   gMC->Gsatt("UT7O","seen",1);
-   gMC->Gsatt("UT8O","seen",1);
-
-   }
+}