]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDv1.cxx
New DAQ calibration DAs by Raphaelle
[u/mrichter/AliRoot.git] / TRD / AliTRDv1.cxx
index 0c238f9c51b1b11165d97fbed4d692f133ca0b11..697ab9fe7fe6a26b13078936b0657f6cc126439f 100644 (file)
@@ -30,6 +30,7 @@
 #include <TVector.h>
 #include <TVirtualMC.h>
 #include <TGeoManager.h>
+#include <TGeoPhysicalNode.h>
 
 #include "AliConst.h"
 #include "AliLog.h"
@@ -177,6 +178,19 @@ void AliTRDv1::AddAlignableVolumes() const
 
         gGeoManager->SetAlignableEntry(symName.Data(),volPath.Data());
 
+       // Add the tracking to local matrix following the TPC example
+        TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symName.Data());
+        const char *path = alignableEntry->GetTitle();
+        if (!gGeoManager->cd(path)) {
+          AliFatal(Form("Volume path %s not valid!",path));
+       }
+        TGeoHMatrix *globMatrix = gGeoManager->GetCurrentMatrix();
+        Double_t sectorAngle = 20.0 * (isect % 18) + 10.0;
+        TGeoHMatrix *t2lMatrix  = new TGeoHMatrix();
+        t2lMatrix->RotateZ(sectorAngle);
+        t2lMatrix->MultiplyLeft(&(globMatrix->Inverse()));
+        alignableEntry->SetMatrix(t2lMatrix);
+
       }
     }
   }
@@ -297,12 +311,11 @@ void AliTRDv1::CreateTRhit(Int_t det)
 
     // Add the hit to the array. TR photon hits are marked 
     // by negative charge
-    // The hit time is needed for pile-up events
     AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber()
           ,det
           ,posHit
           ,-q
-         ,gMC->TrackTime()*1.0e06
+          ,gMC->TrackTime()*1.0e06
           ,kTRUE);
 
   }
@@ -595,12 +608,11 @@ void AliTRDv1::StepManagerGeant()
         qTot = ((Int_t) (eDelta / kWion) + 1);
 
         // Create a new dEdx hit
-        // The hit time is needed for pile-up events
         AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber()
               ,det
               ,hits
               ,qTot
-             ,gMC->TrackTime()*1.0e06
+              ,gMC->TrackTime()*1.0e06
               ,drRegion);
 
       }
@@ -789,13 +801,12 @@ void AliTRDv1::StepManagerErmilova()
         qTot = ((Int_t) (eDelta / kWion) + 1);
 
        // Create a new dEdx hit
-        // The hit time is needed for pile-up events
         if (drRegion) {
           AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber()
                 ,det
                 ,hits
                 ,qTot
-               ,gMC->TrackTime()*1.0e06
+                ,gMC->TrackTime()*1.0e06
                 ,kTRUE);
        }
         else {
@@ -803,7 +814,7 @@ void AliTRDv1::StepManagerErmilova()
                 ,det
                 ,hits
                 ,qTot
-               ,gMC->TrackTime()*1.0e06
+                ,gMC->TrackTime()*1.0e06
                 ,kFALSE);
        }
 
@@ -945,7 +956,7 @@ void AliTRDv1::StepManagerFixedStep()
   // The detector number
   det = fGeometry->GetDetector(pla,cha,sec);
 
-  // 0:InFlight 1:Entering 2:Exiting
+  // 0: InFlight 1:Entering 2:Exiting
   Int_t trkStat = 0;
 
   // Special hits only in the drift region
@@ -979,7 +990,6 @@ void AliTRDv1::StepManagerFixedStep()
   
   // Calculate the charge according to GEANT Edep
   // Create a new dEdx hit
-  // The hit time is needed for pile-up events
   eDep = TMath::Max(gMC->Edep(),0.0) * 1.0e+09;
   qTot = (Int_t) (eDep / kWion);
   if ((qTot) ||
@@ -988,7 +998,7 @@ void AliTRDv1::StepManagerFixedStep()
           ,det
           ,hits
           ,qTot
-         ,gMC->TrackTime()*1.0e06
+          ,gMC->TrackTime()*1.0e06
           ,drRegion);
   }