]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDtrigger.cxx
Pre-allocate right amount of memory when used for de,manu storage (Laurent)
[u/mrichter/AliRoot.git] / TRD / AliTRDtrigger.cxx
index abb77ee7ef22667641f6cc6b9f9b5a412b5f0c94..4f01dfaef3ed34f108bededc427fdf54a2c7e99b 100644 (file)
@@ -45,6 +45,7 @@
 #include "AliTRDtrigParam.h"
 #include "AliTRDmcm.h"
 #include "AliTRDzmaps.h"
+#include "AliTRDCalibra.h"
 #include "Cal/AliTRDCalPIDLQ.h"
 
 ClassImp(AliTRDtrigger)
@@ -229,20 +230,6 @@ Bool_t AliTRDtrigger::Open(const Char_t *name, Int_t nEvent)
     return kFALSE;
   }
 
-  // Open input
-  if (fRunLoader->GetAliRun() == 0x0) {
-    fRunLoader->LoadgAlice();
-  }
-  gAlice = fRunLoader->GetAliRun();
-  if (!(gAlice)) {
-    fRunLoader->LoadgAlice();
-    gAlice = fRunLoader->GetAliRun();
-    if (!(gAlice)) {
-      AliError("Could not find AliRun object.");
-      return kFALSE;
-    }
-  }
-
   // Import the Trees for the event nEvent in the file
   fRunLoader->GetEvent(nEvent);
 
@@ -428,6 +415,10 @@ Bool_t AliTRDtrigger::MakeTracklets(Bool_t makeTracks)
         // Get the digits
         fDigits = fDigitsManager->GetDigits(idet);
        if (!fDigits) return kFALSE;
+       // This is to take care of switched off super modules
+        if (fDigits->GetNtime() == 0) {
+          continue;
+       }
         fDigits->Expand();
         fTrack0 = fDigitsManager->GetDictionary(idet,0);
        if (!fTrack0) return kFALSE;
@@ -486,16 +477,6 @@ Bool_t AliTRDtrigger::MakeTracklets(Bool_t makeTracks)
                  AliInfo(Form("Add tracklet %d in col %02d \n",fNtracklets,fMCM->GetSeedCol()[iSeed]));
                }
 
-               if (fTrigParam->GetDebugLevel() == -1) {
-                 AliInfo(Form("Add tracklet %d in col %02d \n",fNtracklets,fMCM->GetSeedCol()[iSeed]));
-                 for (time = 0; time < nTimeTotal; time++) {
-                   for (col = 0; col < kMcmCol; col++) {                   
-                     printf("%03.0f  ",fMCM->GetADC(col,time));
-                   }
-                   printf("\n");
-                 }
-               }
-
                if (TestTracklet(idet,row,iSeed,0)) {
                  AddTracklet(idet,row,iSeed,fNtracklets++);
                }
@@ -593,6 +574,12 @@ Bool_t AliTRDtrigger::TestTracklet(Int_t det, Int_t row, Int_t seed, Int_t n)
 
   Int_t nTimeTotal  = fCalib->GetNumberOfTimeBins();
 
+  // Calibration fill 2D
+  AliTRDCalibra *calibra = AliTRDCalibra::Instance();
+  if (!calibra) {
+    AliInfo("Could not get Calibra instance\n");
+  }
+
   fTrkTest->Reset();
 
   fTrkTest->SetDetector(det);
@@ -649,9 +636,15 @@ Bool_t AliTRDtrigger::TestTracklet(Int_t det, Int_t row, Int_t seed, Int_t n)
   }
   */
   // LTU Pt cut
-    
   fTrkTest->MakeTrackletGraph(fGeo,fField);
+
+  // TRD Online calibration
+  if (calibra->GetMcmTracking()) {
+    calibra->UpdateHistogramcm(fTrkTest);
+  }
+
   fTrkTest->MakeClusAmpGraph();
+
   if (TMath::Abs(fTrkTest->GetPt()) < fTrigParam->GetLtuPtCut()) {
     return kFALSE;
   }