]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDv1.cxx
calibration files
[u/mrichter/AliRoot.git] / TRD / AliTRDv1.cxx
index e4fd93223c2853f0ce1ba403134b867be5c37f5f..f32a01dc906bb216cd5061b256f400a5c3881ed7 100644 (file)
@@ -29,6 +29,7 @@
 #include <TRandom.h>
 #include <TVector.h>
 #include <TVirtualMC.h>
+#include <TGeoManager.h>
 
 #include "AliConst.h"
 #include "AliLog.h"
@@ -65,7 +66,7 @@ AliTRDv1::AliTRDv1(const char *name, const char *title)
   :AliTRD(name,title) 
   ,fTRon(kTRUE)
   ,fTR(NULL)
-  ,fTypeOfStepManager(1)
+  ,fTypeOfStepManager(2)
   ,fStepSize(0.1)
   ,fDeltaE(NULL)
   ,fDeltaG(NULL)
@@ -80,28 +81,6 @@ AliTRDv1::AliTRDv1(const char *name, const char *title)
 
 }
 
-//_____________________________________________________________________________
-AliTRDv1::AliTRDv1(const AliTRDv1 &trd)
-  :AliTRD(trd)
-  ,fTRon(trd.fTRon)
-  ,fTR(NULL)
-  ,fTypeOfStepManager(trd.fTypeOfStepManager)
-  ,fStepSize(trd.fStepSize)
-  ,fDeltaE(NULL)
-  ,fDeltaG(NULL)
-  ,fTrackLength0(trd.fTrackLength0)
-  ,fPrimaryTrackPid(trd.fPrimaryTrackPid)
-{
-  //
-  // Copy constructor
-  //
-
-  fDeltaE->Copy(*((AliTRDv1 &) trd).fDeltaE);
-  fDeltaG->Copy(*((AliTRDv1 &) trd).fDeltaG);
-  fTR->Copy(*((AliTRDv1 &) trd).fTR);
-
-}
-
 //_____________________________________________________________________________
 AliTRDv1::~AliTRDv1()
 {
@@ -127,34 +106,80 @@ AliTRDv1::~AliTRDv1()
 }
  
 //_____________________________________________________________________________
-AliTRDv1 &AliTRDv1::operator=(const AliTRDv1 &trd)
+void AliTRDv1::AddAlignableVolumes() const
 {
   //
-  // Assignment operator
+  // Create entries for alignable volumes associating the symbolic volume
+  // name with the corresponding volume path. Needs to be syncronized with
+  // eventual changes in the geometry.
   //
 
-  if (this != &trd) ((AliTRDv1 &) trd).Copy(*this);
+  TString volPath;
+  TString symName;
 
-  return *this;
+  TString vpStr  = "ALIC_1/B077_1/BSEGMO";
+  TString vpApp1 = "_1/BTRD";
+  TString vpApp2 = "_1";
+  TString vpApp3 = "/UTR1_1/UTS1_1/UTI1_1/UT";
+
+  TString snStr  = "TRD/sm";
+  TString snApp1 = "/st";
+  TString snApp2 = "/pl";
 
-}
-//_____________________________________________________________________________
-void AliTRDv1::Copy(TObject &trd) const
-{
   //
-  // Copy function
+  // The super modules
+  // The symbolic names are: TRD/sm00
+  //                           ...
+  //                         TRD/sm17
   //
+  for (Int_t isect = 0; isect < AliTRDgeometry::Nsect(); isect++) {
+
+    volPath  = vpStr;
+    volPath += isect;
+    volPath += vpApp1;
+    volPath += isect;
+    volPath += vpApp2;
 
-  ((AliTRDv1 &) trd).fTypeOfStepManager = fTypeOfStepManager;
-  ((AliTRDv1 &) trd).fStepSize          = fStepSize;
-  ((AliTRDv1 &) trd).fTRon              = fTRon;
-  ((AliTRDv1 &) trd).fTrackLength0      = fTrackLength0;
-  ((AliTRDv1 &) trd).fPrimaryTrackPid   = fPrimaryTrackPid;
+    symName  = snStr;
+    symName += Form("%02d",isect);
+
+    gGeoManager->SetAlignableEntry(symName.Data(),volPath.Data());
+
+  }
 
-  fDeltaE->Copy(*((AliTRDv1 &) trd).fDeltaE);
-  fDeltaG->Copy(*((AliTRDv1 &) trd).fDeltaG);
-  fTR->Copy(*((AliTRDv1 &) trd).fTR);
+  //
+  // The readout chambers
+  // The symbolic names are: TRD/sm00/st0/pl0
+  //                           ...
+  //                         TRD/sm17/st4/pl5
+  //
+  for (Int_t isect = 0; isect < AliTRDgeometry::Nsect(); isect++) {
+    for (Int_t icham = 0; icham < AliTRDgeometry::Ncham(); icham++) {
+      for (Int_t iplan = 0; iplan < AliTRDgeometry::Nplan(); iplan++) {
+
+        Int_t idet = AliTRDgeometry::GetDetectorSec(iplan,icham);
+
+        volPath  = vpStr;
+        volPath += isect;
+        volPath += vpApp1;
+        volPath += isect;
+        volPath += vpApp2;
+        volPath += vpApp3;
+        volPath += Form("%02d",idet);
+        volPath += vpApp2;
+
+        symName  = snStr;
+        symName += Form("%02d",isect);
+        symName += snApp1;
+        symName += icham;
+        symName += snApp2;
+        symName += iplan;
+
+        gGeoManager->SetAlignableEntry(symName.Data(),volPath.Data());
+
+      }
+    }
+  }
 
 }
 
@@ -342,10 +367,17 @@ void AliTRDv1::StepManager()
   //
 
   switch (fTypeOfStepManager) {
-    case 0  : StepManagerErmilova();  break;  // 0 is Ermilova
-    case 1  : StepManagerGeant();     break;  // 1 is Geant
-    case 2  : StepManagerFixedStep(); break;  // 2 is fixed step
-    default : AliWarning("Not a valid Step Manager.");
+   case 0: 
+    StepManagerErmilova();
+    break;  
+   case 1: 
+    StepManagerGeant();  
+    break;  
+   case 2: 
+    StepManagerFixedStep();
+    break;  
+   default: 
+    AliWarning("Not a valid Step Manager.");
   }
 
 }
@@ -982,11 +1014,11 @@ Double_t AliTRDv1::BetheBloch(Double_t bg)
   //
 
   // This parameters have been adjusted to averaged values from GEANT
-  const Double_t kP1 = 7.17960e-02;
-  const Double_t kP2 = 8.54196;
-  const Double_t kP3 = 1.38065e-06;
-  const Double_t kP4 = 5.30972;
-  const Double_t kP5 = 2.83798;
+  const Double_t kP1    = 7.17960e-02;
+  const Double_t kP2    = 8.54196;
+  const Double_t kP3    = 1.38065e-06;
+  const Double_t kP4    = 5.30972;
+  const Double_t kP5    = 2.83798;
 
   // Lower cutoff of the Bethe-Bloch-curve to limit step sizes
   const Double_t kBgMin = 0.8;
@@ -1171,6 +1203,6 @@ Double_t IntSpecGeant(Double_t *x, Double_t *)
     AliErrorGeneral("AliTRDv1::IntSpecGeant","Given energy value is too small or zero");
   }
 
-   return arrdnde[i];
+  return arrdnde[i];
 
 }