]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCParam.cxx
add new histograms with E/p after dedx wide cut (Mihael)
[u/mrichter/AliRoot.git] / TPC / AliTPCParam.cxx
index 9d21f816d323a4d9f89e193eb5933039f16656e6..1da830d564cca73bccfbf368e0d6e88820e7a8f7 100644 (file)
@@ -32,6 +32,7 @@
 
 #include <TGeoManager.h>
 #include <TGeoPhysicalNode.h>
+#include <TString.h>
 #include "AliAlignObj.h"
 #include "AliAlignObjParams.h"
 #include "AliLog.h"
@@ -115,6 +116,7 @@ AliTPCParam::AliTPCParam()
             fADCDynRange(0.),
             fTotalNormFac(0.),
             fNoiseNormFac(0.),
+       fNominalVoltage(),
             fNResponseMax(0),
             fResponseThreshold(0.),
             fCurrentMax(0),
@@ -143,29 +145,10 @@ AliTPCParam::~AliTPCParam()
   if (fResponseWeight!=0) delete [] fResponseWeight;
   if (fRotAngle      !=0) delete [] fRotAngle;
 
-  if (fTrackingMatrix) {
-    for(Int_t i = 0; i < fNSector; i++)
-      delete fTrackingMatrix[i];
-    delete [] fTrackingMatrix;
-  }
-
-  if (fClusterMatrix) {
-    for(Int_t i = 0; i < fNSector; i++)
-      delete fClusterMatrix[i];
-    delete [] fClusterMatrix;
-  }
-
-  if (fGlobalMatrix) {
-    for(Int_t i = 0; i < fNSector; i++)
-      delete fGlobalMatrix[i];
-    delete [] fGlobalMatrix;
-  }
+  CleanGeoMatrices();
 
 }
 
-
-
-
 Int_t  AliTPCParam::Transform0to1(Float_t *xyz, Int_t * index)  const
 {
   //
@@ -510,6 +493,14 @@ void AliTPCParam::SetDefault()
   SetMaxTBin(kMaxTBin);
   SetADCSat(kADCSat);
   SetADCDynRange(kADCDynRange);
+  for (UInt_t i=0; i<36; i++)
+  {
+    SetNominalVoltage(1196.0, i);
+  }
+  for (UInt_t i=36; i<72; i++)
+  {
+    SetNominalVoltage(1417.0, i);
+  }
 //   //set magnetic field
 //   SetBField(kBField);
 //   SetNPrimLoss(kNPrimLoss);
@@ -607,7 +598,31 @@ Bool_t AliTPCParam::Update()
   return kTRUE;
 }
 
+void AliTPCParam::CleanGeoMatrices(){
+  //
+  // clean geo matrices
+  //
 
+  if (fTrackingMatrix) {
+    for(Int_t i = 0; i < fNSector; i++)
+      delete fTrackingMatrix[i];
+    delete [] fTrackingMatrix;
+  }
+  
+  if (fClusterMatrix) {
+    for(Int_t i = 0; i < fNSector; i++)
+      delete fClusterMatrix[i];
+    delete [] fClusterMatrix;
+  }
+  
+  if (fGlobalMatrix) {
+    for(Int_t i = 0; i < fNSector; i++)
+      delete fGlobalMatrix[i];
+    delete [] fGlobalMatrix;
+  }
+  
+  return;
+}
 
 Bool_t AliTPCParam::ReadGeoMatrices(){
   //
@@ -618,12 +633,19 @@ Bool_t AliTPCParam::ReadGeoMatrices(){
   }
   AliAlignObjParams o;
   //
-  if (fTrackingMatrix) delete [] fTrackingMatrix;
+
+  // clean geo matrices
+  CleanGeoMatrices();
+
+  // create new geo matrices
   fTrackingMatrix = new TGeoHMatrix*[fNSector];
-  if (fClusterMatrix) delete [] fClusterMatrix;
   fClusterMatrix = new TGeoHMatrix*[fNSector];
-  if (fGlobalMatrix) delete [] fGlobalMatrix;
   fGlobalMatrix = new TGeoHMatrix*[fNSector];
+  for (Int_t isec=0; isec<fNSector; isec++) {
+    fGlobalMatrix[isec] = 0;
+    fClusterMatrix[isec]= 0;
+    fTrackingMatrix[isec]=0;
+  }   
   //
   for (Int_t isec=0; isec<fNSector; isec++) {
     fGlobalMatrix[isec] = 0;
@@ -651,7 +673,10 @@ Bool_t AliTPCParam::ReadGeoMatrices(){
     const char *path = pne->GetTitle();
     if (!gGeoManager->cd(path)) return kFALSE;
     TGeoHMatrix *m = gGeoManager->GetCurrentMatrix();
+    // Since GEANT4 does not allow reflections, in this case the reflection
+    // component if the matrix is embedded by TGeo inside TGeoScaledShape
+    if (gGeoManager->GetCurrentVolume()->GetShape()->IsReflected()) 
+       m->ReflectZ(kFALSE, kTRUE);
     //
     TGeoRotation mchange; 
     mchange.RotateY(90); mchange.RotateX(90);
@@ -822,5 +847,3 @@ Float_t AliTPCParam::GetChamberCenter(Int_t isec, Float_t * center) const
   }
 }
 
-
-