]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCv2.cxx
Corrected bug in the outer containment vessel and
[u/mrichter/AliRoot.git] / TPC / AliTPCv2.cxx
index 4f0e0dd5658ab9df90a5263c7d8b4968a98198be..e73674e613dae8604537d95e7937f96bc443b10e 100644 (file)
 
 /*
 $Log$
+Revision 1.28  2000/11/02 16:55:24  kowal2
+Corrected bug in the inner containment vessel geometry.
+Thanks to J. Belikov
+
+Revision 1.27  2000/11/02 07:24:11  kowal2
+Correction in the TPC geometry.
+Changes due to the new hit structure.
+
+Revision 1.26  2000/10/05 16:16:29  kowal2
+Corrections of the hit recording algorithm.
+
+Revision 1.25  2000/10/02 21:28:18  fca
+Removal of useless dependecies via forward declarations
+
+Revision 1.24  2000/08/28 10:02:30  kowal2
+Corrected bug in the StepManager
+
+Revision 1.23  2000/07/10 20:57:39  hristov
+Update of TPC code and macros by M.Kowalski
+
 Revision 1.22  2000/06/30 12:07:50  kowal2
 Updated from the TPC-PreRelease branch
 
@@ -84,10 +104,13 @@ Introduction of the Copyright and cvs Log
 #include "AliTPCv2.h"
 #include "AliTPCDigitsArray.h"
 #include "AliRun.h"
+#include "AliMC.h"
 #include "AliConst.h"
 #include "AliPDG.h"
 #include "AliTPCParam.h"
 #include "AliTPCParamSR.h"
+#include "AliTPCTrackHits.h"
+
 
 ClassImp(AliTPCv2)
  
@@ -143,7 +166,7 @@ void AliTPCv2::CreateGeometry()
 
   Int_t nRotMat = 0;
 
-  Int_t i,ifl1,ifl2=0;
+  Int_t i,ifl1=0;
 
   // number of sectors
 
@@ -168,33 +191,26 @@ void AliTPCv2::CreateGeometry()
     ifl1 = 1;
   }
 
+  if (ifl1 == 0) {
+    printf("*** ERROR: AT LEAST ONE LOWER SECTOR MUST BE SPECIFIED ***\n");
+    printf("!!! PROGRAM STOPPED !!!\n");
+    exit(1);
+  }
+
   if (fSecAU >= 0) {
-    ifl2 = 0;
     
     for (i = 0; i < 12; ++i) {
       if (fSecUps[i] > 2*nInnerSector-1 && 
           fSecUps[i] < 2*(nInnerSector+nOuterSector)) {
-       ifl2 = 1;
        printf("*** SECTOR %d selected\n",fSecUps[i]);
       }
     }
     
   } else {
     printf("*** ALL UPPER SECTORS SELECTED ***\n");
-    ifl1 = 1;
-  }
-  
-  if (ifl1 == 0 && ifl2 == 0) {
-    printf("*** ERROR: AT LEAST ONE SECTOR MUST BE SPECIFIED ***\n");
-    printf("!!! PROGRAM STOPPED !!!\n");
-    exit(1);
   }
   
-  if ((fSecAL < 0 || fSecAU < 0) && fSens >= 0) {
-    printf("** ERROR: STRIPS CANNOT BE SPECIFIED FOR ALL SECTORS **\n");
-    printf("!!! PROGRAM STOPPED !!!\n");
-    exit(1);
-  }
 
   //--------------------------------------------------------------------
 
@@ -360,7 +376,7 @@ void AliTPCv2::CreateGeometry()
   
   dm[0]= 0.;
   dm[1]= 360.;
-  dm[2]=5.;
+  dm[2]=6.;
 
   //
 
@@ -375,24 +391,28 @@ void AliTPCv2::CreateGeometry()
   dm[8]= 277.95;
 
   //
-
-  dm[9]= 253.6;
-  dm[10]= 272.2;
+  dm[9]= -248.4;
+  dm[10]= 274.81;
   dm[11]= 277.95;
-
   //
 
   dm[12]= 253.6;
-  dm[13]= 265.2;
+  dm[13]= 274.81;
   dm[14]= 277.95;
 
-  // 
+  //
 
-  dm[15]= 255.6;
+  dm[15]= 253.6;
   dm[16]= 265.2;
   dm[17]= 277.95;
 
-  gMC->Gsvolu("TOCV","PCON",idtmed[4],dm,18);
+  // 
+
+  dm[18]= 255.6;
+  dm[19]= 265.2;
+  dm[20]= 277.95;
+
+  gMC->Gsvolu("TOCV","PCON",idtmed[4],dm,21);
 
   // Daughter volumes
 
@@ -472,7 +492,7 @@ void AliTPCv2::CreateGeometry()
 
   dm[15]= 251.;
   dm[16]= 258.;
-  dm[17]= 260.05;
+  dm[17]= 270.9;
 
   //
 
@@ -484,38 +504,31 @@ void AliTPCv2::CreateGeometry()
 
   // Daughter volumes 
 
-  // Tpc SAndwich 5 - Al
+  // Tpc SAndwich 5 - Tedlar
 
   dm[0]= 258.;
   dm[1]= 260.05;
   dm[2]= 251.7;
 
-  gMC->Gsvolu("TSA5","TUBE",idtmed[4],dm,3);
+  gMC->Gsvolu("TSA5","TUBE",idtmed[9],dm,3);
 
-  // Tpc SAndwich 6 - Tedlar
+  // Tpc SAndwich 6 - Kevlar
 
   dm[0] += 5.e-3;
   dm[1] -= 5.e-3;
 
-  gMC->Gsvolu("TSA6","TUBE",idtmed[9],dm,3);
-
-  // Tpc SAndwich 7 - Kevlar
+  gMC->Gsvolu("TSA6","TUBE",idtmed[5],dm,3);
 
-  dm[0] += 5.e-3;
-  dm[1] -= 5.e-3;
-
-  gMC->Gsvolu("TSA7","TUBE",idtmed[5],dm,3);
 
   // Tpc SAndwich 8 - NOMEX
 
   dm[0] += 0.02;
   dm[1] -= 0.02;
 
-  gMC->Gsvolu("TSA8","TUBE",idtmed[6],dm,3);    
+  gMC->Gsvolu("TSA7","TUBE",idtmed[6],dm,3);    
 
-  // 8->7->6->5->TOFC
+  // 7->6->5->TOFC
 
-  gMC->Gspos("TSA8",1,"TSA7",0.,0.,0.,0,"ONLY");
   gMC->Gspos("TSA7",1,"TSA6",0.,0.,0.,0,"ONLY");
   gMC->Gspos("TSA6",1,"TSA5",0.,0.,0.,0,"ONLY"); 
 
@@ -953,38 +966,31 @@ void AliTPCv2::CreateGeometry()
 
   // Daughter volumes
 
-  // Tpc Sandwich 17 - Al
+  // Tpc Sandwich 17 - Tedlar
 
   dm[0]= 77.15;
   dm[1]= 79.2;
   dm[2]= 251.7;
 
-  gMC->Gsvolu("TS17","TUBE",idtmed[4],dm,3);
+  gMC->Gsvolu("TS17","TUBE",idtmed[9],dm,3);
 
-  // Tpc Sandwich 18 - Tedlar
+  // Tpc Sandwich 18 - Kevlar
 
   dm[0]+= 5.e-3;
   dm[1]-= 5.e-3;
 
-  gMC->Gsvolu("TS18","TUBE",idtmed[9],dm,3);
+  gMC->Gsvolu("TS18","TUBE",idtmed[5],dm,3);
 
-  // Tpc Sandwich 19 - Kevlar
 
-  dm[0]+= 5.e-3;
-  dm[1]-= 5.e-3;
+  // Tpc Sandwich 19 - NOMEX
 
-  gMC->Gsvolu("TS19","TUBE",idtmed[5],dm,3);
-
-  // Tpc Sandwich 20 - NOMEX
-
-  dm[0]+= 0.06;
-  dm[1]-= 0.06;
+  dm[0]+= 0.02;
+  dm[1]-= 0.02;
 
-  gMC->Gsvolu("TS20","TUBE",idtmed[6],dm,3);
+  gMC->Gsvolu("TS19","TUBE",idtmed[6],dm,3);
 
-  // 20->19->18->17
+  // 19->18->17
 
-  gMC->Gspos("TS20",1,"TS19",0.,0.,0.,0,"ONLY");
   gMC->Gspos("TS19",1,"TS18",0.,0.,0.,0,"ONLY");
   gMC->Gspos("TS18",1,"TS17",0.,0.,0.,0,"ONLY");
 
@@ -1024,8 +1030,8 @@ void AliTPCv2::CreateGeometry()
 
   // Tpc Sandwich 21 - Al (central barrel)
 
-  dm[0]= 77.15;
-  dm[1]= 79.2;
+  dm[0]= 60.65;
+  dm[1]= 61.21;
   dm[2]= 75.2;
 
   gMC->Gsvolu("TS21","TUBE",idtmed[4],dm,3);
@@ -1531,9 +1537,7 @@ void AliTPCv2::CreateGeometry()
   gMC->Gsvolu("TPUS", "TRD1", idtmed[2], dm, 4); // sensitive
 
 
-  // if sensitive strips selected
 
-  if(fSens >= 0){
 
     gMC->Gsvolu("TPSS","TRD1",idtmed[2],dm,0); // sensitive
 
@@ -1544,12 +1548,16 @@ void AliTPCv2::CreateGeometry()
 
     // inner sector
 
-    nofStrips = fTPCParam->GetNRowLow();
+
+    // if all lower sectors selected define only 1 strip
+
+    nofStrips=((fSecAL <0)||(fSecAL>=0 && fSens<0)) ? 1 : fTPCParam->GetNRowLow(); 
     deadSpace = fTPCParam->GetInnerWireMount();
 
     dm[2] = 0.5*(250. - 0.3);
     dm[3] = 0.5 * stripThick;  
 
+
     for(nstr=0;nstr<nofStrips;nstr++){
 
       r1 = fTPCParam->GetPadRowRadiiLow(nstr);
@@ -1562,10 +1570,13 @@ void AliTPCv2::CreateGeometry()
     
       gMC->Gsposp("TPSS", nstr+1, "TPLS", 0., 0., zs, 0, "ONLY", dm, 4);
 
-      gMC->Gsord("TPLS",3);
 
     }
 
+    // strips only if several upper sectors selected end fSens > 0
+
+    if(fSecAU >=0 && fSens >0){
+
     Int_t nsSave = nofStrips;
 
     // outer sector
@@ -1575,6 +1586,7 @@ void AliTPCv2::CreateGeometry()
 
     dm[2] = 0.5*(250. - 0.3);
     dm[3] = 0.5 * stripThick;
+
   
     for(nstr=0;nstr<nofStrips;nstr++){
     
@@ -1589,7 +1601,7 @@ void AliTPCv2::CreateGeometry()
       gMC->Gsposp("TPSS", nstr+1+nsSave, "TPUS", 0., 0., zs, 0, "ONLY", dm, 4);
 
      }    
-  } // if strips
+    }
 
   //-------------------------------------------------------
   //  positioning of the empty spaces into the main wheel
@@ -1863,8 +1875,8 @@ void AliTPCv2::CreateGeometry()
   gMC->Gspos("TSSW",2,"TPC ",0.,0.,-278.7,0,"ONLY");
 
   gMC->Gsord("TPMW",6);
-  gMC->Gsord("TPLS",3);
-  gMC->Gsord("TPUS",3);
+  if(fSecAL >=0)  gMC->Gsord("TPLS",3);
+  if(fSecAU >=0 && fSens >0)  gMC->Gsord("TPUS",3);
   gMC->Gsord("TDGN",6);
   gMC->Gsord("TSSW",6);
   gMC->Gsord("TSWC",6);
@@ -1906,7 +1918,6 @@ void AliTPCv2::DrawDetector()
   gMC->Gsatt("TSA5","SEEN",0);
   gMC->Gsatt("TSA6","SEEN",0);
   gMC->Gsatt("TSA7","SEEN",0);
-  gMC->Gsatt("TSA8","SEEN",0);
   gMC->Gsatt("TIIN","COLO",7);
   gMC->Gsatt("TIIN","SEEN",1);
   gMC->Gsatt("TICL","SEEN",0);
@@ -1924,7 +1935,6 @@ void AliTPCv2::DrawDetector()
   gMC->Gsatt("TS17","SEEN",0);
   gMC->Gsatt("TS18","SEEN",0);
   gMC->Gsatt("TS19","SEEN",0);
-  gMC->Gsatt("TS20","SEEN",0);
   gMC->Gsatt("TS21","SEEN",0);
   gMC->Gsatt("TS22","SEEN",0);
   gMC->Gsatt("TS23","SEEN",0);
@@ -2007,8 +2017,12 @@ void AliTPCv2::Init()
   Int_t *idtmed = fIdtmed->GetArray();
   
   AliTPC::Init();
-  fIdSens=gMC->VolId("TPSS"); // sensitive strips (not always used)
-  fIdLSec=gMC->VolId("TPLS"); // lower sector
+
+
+  
+  fIdSens=gMC->VolId("TPSS");  
+
+  fIdLSec=gMC->VolId("TPLS"); // lower sector 
   fIdUSec=gMC->VolId("TPUS"); // upper sector
 
   gMC->SetMaxNStep(30000); // max. number of steps increased
@@ -2042,7 +2056,6 @@ void AliTPCv2::StepManager()
   Int_t id,copy;
   Float_t hits[4];
   Int_t vol[2];  
-  TClonesArray &lhits = *fHits;
   TLorentzVector p;
   
   vol[1]=0; // preset row number to 0
@@ -2089,7 +2102,7 @@ void AliTPCv2::StepManager()
       // upper sector
 
       vol[0] = copy-1+fTPCParam->GetNInnerSector(); // sector number
-      vol[1] -= fTPCParam->GetNRowLow(); // row number  
+      vol[1] -= fTPCParam->GetNRowLow(); // row number (starts also from 0)  
 
     } 
 
@@ -2102,16 +2115,21 @@ void AliTPCv2::StepManager()
       hits[1]=p[1];
       hits[2]=p[2];
       hits[3]=0.; // this hit has no energy loss
-      new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
+      // new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
 
-      gMC->TrackPosition(p);
-      hits[0]=p[0];
-      hits[1]=p[1];
-      hits[2]=p[2];
-      hits[3]=0.; // this hit has no energy loss
-      new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
+      AddHit(gAlice->CurrentTrack(), vol,hits);  //MI change
+
+    }
+
+     gMC->TrackPosition(p);
+     hits[0]=p[0];
+     hits[1]=p[1];
+     hits[2]=p[2];
+     hits[3]=0.; // this hit has no energy loss
+     // new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
+
+     AddHit(gAlice->CurrentTrack(), vol,hits);  //MI change    
 
-    } 
   }
   else return;
     
@@ -2132,7 +2150,14 @@ void AliTPCv2::StepManager()
     
     // Add this hit
     
-    new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
+    // new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
+    if (fHitType&&2){
+      gMC->TrackMomentum(p);
+      Float_t momentum = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
+      Float_t precision =   (momentum>0.1) ? 0.002 :0.01;
+      fTrackHits->SetHitPrecision(precision);
+    }
+    AddHit(gAlice->CurrentTrack(), vol,hits);  //MI change 
     
   }