]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Move pad planes from AliTRDCommomParam to AliTRDgeometry
authorcblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 19 Jun 2007 13:50:47 +0000 (13:50 +0000)
committercblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 19 Jun 2007 13:50:47 +0000 (13:50 +0000)
43 files changed:
TRD/AliTRD.cxx
TRD/AliTRDCalibPadStatus.cxx
TRD/AliTRDCalibPadStatus.h
TRD/AliTRDCalibraFillHisto.cxx
TRD/AliTRDCalibraFillHisto.h
TRD/AliTRDCalibraFit.cxx
TRD/AliTRDCalibraFit.h
TRD/AliTRDCalibraMode.cxx
TRD/AliTRDCalibraMode.h
TRD/AliTRDCommonParam.cxx
TRD/AliTRDCommonParam.h
TRD/AliTRDRawStream.cxx
TRD/AliTRDRawStream.h
TRD/AliTRDReconstructor.cxx
TRD/AliTRDTriggerL1.cxx
TRD/AliTRDcluster.cxx
TRD/AliTRDcluster.h
TRD/AliTRDclusterMI.cxx
TRD/AliTRDclusterMI.h
TRD/AliTRDclusterizer.cxx
TRD/AliTRDclusterizerV1.cxx
TRD/AliTRDdigitizer.cxx
TRD/AliTRDgeometry.cxx
TRD/AliTRDgeometry.h
TRD/AliTRDmcm.cxx
TRD/AliTRDmcm.h
TRD/AliTRDmcmTracklet.cxx
TRD/AliTRDmcmTracklet.h
TRD/AliTRDmodule.cxx
TRD/AliTRDmodule.h
TRD/AliTRDpadPlane.cxx
TRD/AliTRDpadPlane.h
TRD/AliTRDpidESD.cxx
TRD/AliTRDrawData.cxx
TRD/AliTRDrawData.h
TRD/AliTRDtracker.cxx
TRD/AliTRDtrackingAnalysis.cxx
TRD/AliTRDtrigParam.cxx
TRD/AliTRDtrigParam.h
TRD/AliTRDtrigger.cxx
TRD/AliTRDtrigger.h
TRD/TRDrecLinkDef.h
TRD/libTRDrec.pkg

index 9b48974e5b2b5e6272f8d69cf04a90149e318577..7e44e869da9294f7302fefc1215cdd7048d49c24 100644 (file)
@@ -108,18 +108,10 @@ AliTRD::AliTRD(const char *name, const char *title)
     exit(1);
   }
 
-  // Save the geometry
-  TDirectory *saveDir = gDirectory;
-  gAlice->GetRunLoader()->CdGAFile();
-  fGeometry->Write("TRDgeometry");
-  saveDir->cd();
-
   // Allocate the hit array
   fHits = new TClonesArray("AliTRDhit",405);
   gAlice->GetMCApp()->AddHitList(fHits);
 
-  //PH SetMarkerColor(kWhite);   
-
 }
 
 //_____________________________________________________________________________
index 09f1d032c7b544cddbe956bb7c5be0448f8a0973..0308a6aa6e2b6e3bb4aaf841c7c9cc309abb7f92 100644 (file)
@@ -64,17 +64,18 @@ histo->Draw();
 #include <TFile.h>
 #include <AliMathBase.h>
 #include "TTreeStream.h"
+
 //AliRoot includes
 #include "AliRawReader.h"
 #include "AliRawReaderRoot.h"
 #include "AliRawReaderDate.h"
+
 #include "AliTRDRawStream.h"
+#include "AliTRDarrayF.h"
+#include "AliTRDgeometry.h"
 #include "./Cal/AliTRDCalROC.h"
 #include "./Cal/AliTRDCalPadStatus.h"
 #include "./Cal/AliTRDCalSingleChamberStatus.h"
-#include "AliTRDarrayF.h"
-#include "AliTRDCommonParam.h"
-
 
 #ifdef ALI_DATE
 #include "event.h"
@@ -83,13 +84,12 @@ histo->Draw();
 //header file
 #include "AliTRDCalibPadStatus.h"
 
-
-
 ClassImp(AliTRDCalibPadStatus) /*FOLD00*/
 
 //_____________________________________________________________________
 AliTRDCalibPadStatus::AliTRDCalibPadStatus() : /*FOLD00*/
   TObject(),
+  fGeo(0),
   fAdcMin(0),
   fAdcMax(20),
   fDetector(-1),
@@ -107,11 +107,15 @@ AliTRDCalibPadStatus::AliTRDCalibPadStatus() : /*FOLD00*/
     //
     // default constructor
     //
+
+  fGeo = new AliTRDgeometry();
+
 }
 
 //_____________________________________________________________________
 AliTRDCalibPadStatus::AliTRDCalibPadStatus(const AliTRDCalibPadStatus &ped) : /*FOLD00*/
   TObject(ped),
+  fGeo(0),
   fAdcMin(ped.GetAdcMin()),
   fAdcMax(ped.GetAdcMax()),
   fDetector(ped.fDetector),
@@ -150,7 +154,14 @@ AliTRDCalibPadStatus::AliTRDCalibPadStatus(const AliTRDCalibPadStatus &ped) : /*
        }
        
     }
+
+    if (fGeo) {
+      delete fGeo;
+    }
+    fGeo = new AliTRDgeometry();
+
 }
+
 //_____________________________________________________________________
 AliTRDCalibPadStatus& AliTRDCalibPadStatus::operator = (const  AliTRDCalibPadStatus &source)
 {
@@ -162,13 +173,20 @@ AliTRDCalibPadStatus& AliTRDCalibPadStatus::operator = (const  AliTRDCalibPadSta
 
   return *this;
 }
+
 //_____________________________________________________________________
 AliTRDCalibPadStatus::~AliTRDCalibPadStatus() /*FOLD00*/
 {
   //
   // destructor
   //
+
+  if (fGeo) {
+    delete fGeo;
+  }
+  
 }
+
 //_____________________________________________________________________
 Int_t AliTRDCalibPadStatus::Update(const Int_t icdet, /*FOLD00*/
                                   const Int_t icRow,
@@ -336,20 +354,16 @@ Bool_t AliTRDCalibPadStatus::TestEvent(Int_t nevent) /*FOLD00*/
   // fill one oroc and one iroc with random gaus
   //
 
-  AliTRDCommonParam *comParam = AliTRDCommonParam::Instance();
-  if (!comParam) {
-    return 0;
-  }
   gRandom->SetSeed(0);
 
     for (Int_t ism=0; ism<18; ism++){
                for (Int_t ich=0; ich < 5; ich++){
            for (Int_t ipl=0; ipl < 6; ipl++){
-             for(Int_t irow = 0; irow < comParam->GetRowMax(ipl,ich,ism); irow++){
-               for(Int_t icol = 0; icol < comParam->GetColMax(ipl); icol++){
+             for(Int_t irow = 0; irow < fGeo->GetRowMax(ipl,ich,ism); irow++){
+               for(Int_t icol = 0; icol < fGeo->GetColMax(ipl); icol++){
                  for (Int_t iTimeBin=0; iTimeBin<(30*nevent); iTimeBin++){
                    Int_t signal=(Int_t)(ich+8+gRandom->Gaus(0,1.2));
-                   if ( signal>0 )Update((ipl+ich*6+ism*6*5),irow,icol,signal,comParam->GetRowMax(ipl,ich,ism));
+                   if ( signal>0 )Update((ipl+ich*6+ism*6*5),irow,icol,signal,fGeo->GetRowMax(ipl,ich,ism));
                  }
                }
              }
@@ -366,20 +380,16 @@ Bool_t AliTRDCalibPadStatus::TestEventHisto(Int_t nevent) /*FOLD00*/
   // fill one oroc and one iroc with random gaus
   //
 
-  AliTRDCommonParam *comParam = AliTRDCommonParam::Instance();
-  if (!comParam) {
-    return 0;
-  }
   gRandom->SetSeed(0);
 
     for (Int_t ism=0; ism<18; ism++){
                for (Int_t ich=0; ich < 5; ich++){
            for (Int_t ipl=0; ipl < 6; ipl++){
-             for(Int_t irow = 0; irow < comParam->GetRowMax(ipl,ich,ism); irow++){
-               for(Int_t icol = 0; icol < comParam->GetColMax(ipl); icol++){
+             for(Int_t irow = 0; irow < fGeo->GetRowMax(ipl,ich,ism); irow++){
+               for(Int_t icol = 0; icol < fGeo->GetColMax(ipl); icol++){
                  for (Int_t iTimeBin=0; iTimeBin<(30*nevent); iTimeBin++){
                    Int_t signal=(Int_t)(ich+8+gRandom->Gaus(0,1.2));
-                   if ( signal>0 )UpdateHisto((ipl+ich*6+ism*6*5),irow,icol,signal,comParam->GetRowMax(ipl,ich,ism));
+                   if ( signal>0 )UpdateHisto((ipl+ich*6+ism*6*5),irow,icol,signal,fGeo->GetRowMax(ipl,ich,ism));
                  }
                }
              }
@@ -406,11 +416,8 @@ TH2F* AliTRDCalibPadStatus::GetHisto(Int_t det, TObjArray *arr, /*FOLD00*/
     sprintf(name,"hCalib%s%.2d",type,det);
     sprintf(title,"%s calibration histogram detector %.2d;ADC channel;Channel (pad)",type,det);
 
-    AliTRDCommonParam *comParam = AliTRDCommonParam::Instance();
-    if (!comParam) {
-      return 0x0;
-    }
-    Int_t nbchannels = comParam->GetRowMax(GetPlane(det),GetChamber(det),GetSector(det))*comParam->GetColMax(GetPlane(det));
+    Int_t nbchannels = fGeo->GetRowMax(GetPlane(det),GetChamber(det),GetSector(det))
+                     * fGeo->GetColMax(GetPlane(det));
 
     // new histogram with calib information. One value for each pad!
     TH2F* hist = new TH2F(name,title,
@@ -443,11 +450,8 @@ AliTRDarrayF* AliTRDCalibPadStatus::GetCal(Int_t det, TObjArray* arr, Bool_t for
 
     // if we are forced and histogram doesn't yes exist create it
     AliTRDarrayF *croc = new AliTRDarrayF();
-    AliTRDCommonParam *comParam = AliTRDCommonParam::Instance();
-    if (!comParam) {
-      return croc;
-    }
-    Int_t nbpad = comParam->GetRowMax(GetPlane(det),GetChamber(det),GetSector(det))*comParam->GetColMax(GetPlane(det));
+    Int_t nbpad = fGeo->GetRowMax(GetPlane(det),GetChamber(det),GetSector(det))
+                * fGeo->GetColMax(GetPlane(det));
 
     // new AliTRDCalROC. One value for each pad!
     croc->Expand(nbpad);
index cfa1cb73a3856515efba6d9d19296fdc23a55ac1..69d3dc6a9cd596384c66809a657e597546ad9b97 100644 (file)
 class TObjArray;
 class TH2F;
 class TTreeSRedirector;
+
+class AliRawReader;
+
 class AliTRDCalROC;
 class AliTRDCalPadStatus;
 class AliTRDRawStream;
 class AliTRDarrayF;
-class AliRawReader;
+class AliTRDgeometry;
+
 struct eventHeaderStruct;
 
 class AliTRDCalibPadStatus : public TObject {
@@ -64,6 +68,9 @@ public:
 
 private:
 
+  // Geometry
+  AliTRDgeometry  *fGeo;            //! The TRD geometry
+
   Int_t fAdcMin;                    //  min adc channel of pedestal value
   Int_t fAdcMax;                    //  max adc channel of pedestal value
   Int_t fDetector;                  //  Current detector
@@ -93,9 +100,7 @@ private:
   virtual Int_t    GetChamber(Int_t d) const;
   virtual Int_t    GetSector(Int_t d) const;
 
-public:
-
-  ClassDef(AliTRDCalibPadStatus,1)
+  ClassDef(AliTRDCalibPadStatus,2)
 
 };
 
index 15dac5e5b1a9da487dc7b4121b1b7bd9220668e5..cffb941b6a0cbc725263560a7cbcf6d00dcaf169 100644 (file)
@@ -54,6 +54,8 @@
 
 #include "AliLog.h"
 #include "AliCDBManager.h"
+#include "AliRawReader.h"
+#include "AliRawReaderDate.h"
 
 #include "AliTRDCalibraFillHisto.h"
 #include "AliTRDCalibraMode.h"
 #include "AliTRDcluster.h"
 #include "AliTRDtrack.h"
 #include "AliTRDRawStream.h"
-#include "AliRawReader.h"
-#include "AliRawReaderDate.h"
+#include "AliTRDgeometry.h"
 
 #ifdef ALI_DATE
 #include "event.h"
 #endif
 
-
 ClassImp(AliTRDCalibraFillHisto)
 
 AliTRDCalibraFillHisto* AliTRDCalibraFillHisto::fgInstance = 0;
@@ -116,6 +116,7 @@ void AliTRDCalibraFillHisto::Terminate()
 //______________________________________________________________________________________
 AliTRDCalibraFillHisto::AliTRDCalibraFillHisto()
   :TObject()
+  ,fGeo(0)
   ,fMITracking(kFALSE)
   ,fMcmTracking(kFALSE)
   ,fMcmCorrectAngle(kFALSE)
@@ -174,56 +175,60 @@ AliTRDCalibraFillHisto::AliTRDCalibraFillHisto()
   fNumberUsedCh[1]       = 0;
   fNumberUsedPh[0]       = 0;
   fNumberUsedPh[1]       = 0;
+
+  fGeo = new AliTRDgeometry();
  
 }
+
 //______________________________________________________________________________________
 AliTRDCalibraFillHisto::AliTRDCalibraFillHisto(const AliTRDCalibraFillHisto &c)
-:TObject(c)
-,fMITracking(c.fMITracking)
-,fMcmTracking(c.fMcmTracking)
-,fMcmCorrectAngle(c.fMcmCorrectAngle)
-,fCH2dOn(c.fCH2dOn)
-,fPH2dOn(c.fPH2dOn)
-,fPRF2dOn(c.fPRF2dOn)
-,fHisto2d(c.fHisto2d)
-,fVector2d(c.fVector2d)
-,fLinearFitterOn(c.fLinearFitterOn)
-,fLinearFitterDebugOn(c.fLinearFitterDebugOn)
-,fRelativeScale(c.fRelativeScale)
-,fThresholdClusterPRF2(c.fThresholdClusterPRF2)
-,fCalibraMode(0x0)
-,fDebugStreamer(0)
-,fDebugLevel(c.fDebugLevel)
-,fDetectorAliTRDtrack(c.fDetectorAliTRDtrack)
-,fDetectorPreviousTrack(c.fDetectorPreviousTrack)
-,fNumberClusters(c.fNumberClusters)
-,fProcent(c.fProcent)
-,fDifference(c.fDifference)
-,fNumberTrack(c.fNumberTrack)
-,fTimeMax(c.fTimeMax)
-,fSf(c.fSf)
-,fNumberBinCharge(c.fNumberBinCharge)
-,fNumberBinPRF(c.fNumberBinPRF)
-,fNgroupprf(c.fNgroupprf)
-,fListClusters(new TObjArray())
-,fPar0(c.fPar0)
-,fPar1(c.fPar1)
-,fPar2(c.fPar2)
-,fPar3(c.fPar3)
-,fPar4(c.fPar4)
-,fAmpTotal(c.fAmpTotal)
-,fPHPlace(c.fPHPlace)
-,fPHValue(c.fPHValue)
-,fGoodTracklet(c.fGoodTracklet)
-,fGoodTrack(c.fGoodTrack)
-,fEntriesCH(c.fEntriesCH)
-,fEntriesLinearFitter(fEntriesLinearFitter)
-,fCalibraVector(0x0)
-,fPH2d(0x0)
-,fPRF2d(0x0)
-,fCH2d(0x0)
-,fLinearFitterArray(0)
-,fLinearFitterHistoArray(0)
+  :TObject(c)
+  ,fGeo(0)
+  ,fMITracking(c.fMITracking)
+  ,fMcmTracking(c.fMcmTracking)
+  ,fMcmCorrectAngle(c.fMcmCorrectAngle)
+  ,fCH2dOn(c.fCH2dOn)
+  ,fPH2dOn(c.fPH2dOn)
+  ,fPRF2dOn(c.fPRF2dOn)
+  ,fHisto2d(c.fHisto2d)
+  ,fVector2d(c.fVector2d)
+  ,fLinearFitterOn(c.fLinearFitterOn)
+  ,fLinearFitterDebugOn(c.fLinearFitterDebugOn)
+  ,fRelativeScale(c.fRelativeScale)
+  ,fThresholdClusterPRF2(c.fThresholdClusterPRF2)
+  ,fCalibraMode(0x0)
+  ,fDebugStreamer(0)
+  ,fDebugLevel(c.fDebugLevel)
+  ,fDetectorAliTRDtrack(c.fDetectorAliTRDtrack)
+  ,fDetectorPreviousTrack(c.fDetectorPreviousTrack)
+  ,fNumberClusters(c.fNumberClusters)
+  ,fProcent(c.fProcent)
+  ,fDifference(c.fDifference)
+  ,fNumberTrack(c.fNumberTrack)
+  ,fTimeMax(c.fTimeMax)
+  ,fSf(c.fSf)
+  ,fNumberBinCharge(c.fNumberBinCharge)
+  ,fNumberBinPRF(c.fNumberBinPRF)
+  ,fNgroupprf(c.fNgroupprf)
+  ,fListClusters(new TObjArray())
+  ,fPar0(c.fPar0)
+  ,fPar1(c.fPar1)
+  ,fPar2(c.fPar2)
+  ,fPar3(c.fPar3)
+  ,fPar4(c.fPar4)
+  ,fAmpTotal(c.fAmpTotal)
+  ,fPHPlace(c.fPHPlace)
+  ,fPHValue(c.fPHValue)
+  ,fGoodTracklet(c.fGoodTracklet)
+  ,fGoodTrack(c.fGoodTrack)
+  ,fEntriesCH(c.fEntriesCH)
+  ,fEntriesLinearFitter(fEntriesLinearFitter)
+  ,fCalibraVector(0x0)
+  ,fPH2d(0x0)
+  ,fPRF2d(0x0)
+  ,fCH2d(0x0)
+  ,fLinearFitterArray(0)
+  ,fLinearFitterHistoArray(0)
 {
   //
   // Copy constructor
@@ -260,7 +265,13 @@ AliTRDCalibraFillHisto::AliTRDCalibraFillHisto(const AliTRDCalibraFillHisto &c)
       }
     }
   }
+  if (fGeo) {
+    delete fGeo;
+  }
+  fGeo = new AliTRDgeometry();
+
 }
+
 //____________________________________________________________________________________
 AliTRDCalibraFillHisto::~AliTRDCalibraFillHisto()
 {
@@ -270,6 +281,10 @@ AliTRDCalibraFillHisto::~AliTRDCalibraFillHisto()
 
   ClearHistos();
   if ( fDebugStreamer ) delete fDebugStreamer;
+
+  if (fGeo) {
+    delete fGeo;
+  }
   
 }
 
@@ -720,13 +735,6 @@ Int_t *AliTRDCalibraFillHisto::CalculateRowCol(AliTRDcluster *cl) const
   rowcol[0] =  0;
   rowcol[1] =  0;
 
-  // Get the parameter object
-  AliTRDCommonParam *parCom = AliTRDCommonParam::Instance();
-  if (!parCom) {
-    AliInfo("Could not get CommonParam");
-    return rowcol;
-  }
-
   // Localisation of the detector
   Int_t detector = cl->GetDetector();
   Int_t chamber  = GetChamber(detector);
@@ -739,7 +747,7 @@ Int_t *AliTRDCalibraFillHisto::CalculateRowCol(AliTRDcluster *cl) const
   pos[2] = cl->GetZ();
 
   // Position of the cluster
-  AliTRDpadPlane *padplane  = parCom->GetPadPlane(plane,chamber);
+  AliTRDpadPlane *padplane  = fGeo->GetPadPlane(plane,chamber);
   Int_t    row              = padplane->GetPadRowNumber(pos[2]);
   //Do not take from here because it was corrected from ExB already....
   //Double_t offsetz         = padplane->GetPadRowOffset(row,pos[2]);
@@ -1771,13 +1779,6 @@ Bool_t AliTRDCalibraFillHisto::FindP1TrackPH()
   // This function will be called in the functions UpdateHistogram... 
   // to fill the find the parameter P1 of a track for the drift velocity  calibration
   //
-
-  // Get the parameter object
-  AliTRDCommonParam *parCom = AliTRDCommonParam::Instance();
-  if (!parCom) {
-    AliInfo("Could not get CommonParam");
-    return kFALSE;
-  }
   
   //Number of points: if less than 3 return kFALSE
   Int_t Npoints = fListClusters->GetEntriesFast();
@@ -1799,7 +1800,7 @@ Bool_t AliTRDCalibraFillHisto::FindP1TrackPH()
   Double_t  tiltingangle              = 0;                                  // tiltingangle of the pad
   Float_t   dzdx                      = 0;                                  // dz/dx now from dz/dl
   Int_t     nbli                      = 0;                                  // number linear fitter points
-  AliTRDpadPlane *padplane            = parCom->GetPadPlane(GetPlane(detector),GetChamber(detector));
+  AliTRDpadPlane *padplane            = fGeo->GetPadPlane(GetPlane(detector),GetChamber(detector));
 
   linearFitterTracklet.StoreData(kFALSE);
   linearFitterTracklet.ClearPoints();
@@ -1908,13 +1909,6 @@ Bool_t AliTRDCalibraFillHisto::HandlePRF()
   // For the offline tracking
   // Fit the tracklet with a line and take the position as reference for the PRF
   //
-
-  // Get the parameter object
-  AliTRDCommonParam *parCom = AliTRDCommonParam::Instance();
-  if (!parCom) {
-    AliInfo("Could not get CommonParam");
-    return kFALSE;
-  }
   
   //Number of points
   Int_t Npoints  = fListClusters->GetEntriesFast();                         // number of total points
index 67a44f552ea0556bbc3834ef08612ff9ee667428..6324d6d0c2d982288620052f75c41c4ba2700f9d 100644 (file)
@@ -33,14 +33,15 @@ class TH2;
 class TLinearFitter;
 
 class AliLog;
+class AliRawReader;
+
 class AliTRDCalibraMode;
 class AliTRDCalibraVector;
-
-class AliRawReader;
 class AliTRDRawStream;
 class AliTRDcluster;
 class AliTRDtrack;
 class AliTRDmcmTracklet;
+class AliTRDgeometry;
 class TTreeSRedirector;
 
 struct eventHeaderStruct;
@@ -164,6 +165,9 @@ AliTRDCalibraVector *GetCalibraVector() const                                { r
 
  protected:
 
+  // Geometry
+  AliTRDgeometry  *fGeo;                    //! The TRD geometry
+
   // Choice to fill or not the 2D
           Bool_t   fMITracking;             // Chose to fill the 2D histos or vectors during the offline MI tracking
           Bool_t   fMcmTracking;            // Chose to fill the 2D histos or vectors during the tracking with tracklets
@@ -274,7 +278,7 @@ AliTRDCalibraVector *GetCalibraVector() const                                { r
   static  Bool_t   fgTerminated;                             // If terminated
  
     
-  ClassDef(AliTRDCalibraFillHisto,2)                         // TRD Calibration class
+  ClassDef(AliTRDCalibraFillHisto,3)                         // TRD Calibration class
 
 };
   
index 6bf95201556ba9b1183e88d84ec6245d82b3d964..91a73d8b2996e0898d04c0cada2c3a49f6998f7c 100644 (file)
@@ -75,7 +75,6 @@
 #include "AliTRDCalibraVector.h"
 #include "AliTRDcalibDB.h"
 #include "AliTRDgeometry.h"
-#include "AliTRDCommonParam.h"
 #include "./Cal/AliTRDCalROC.h"
 #include "./Cal/AliTRDCalPad.h"
 #include "./Cal/AliTRDCalDet.h"
@@ -125,6 +124,7 @@ void AliTRDCalibraFit::Terminate()
 //______________________________________________________________________________________
 AliTRDCalibraFit::AliTRDCalibraFit()
   :TObject()
+  ,fGeo(0)
   ,fWriteNameCoef(0)
   ,fFitPHOn(kFALSE)
   ,fFitPol2On(kFALSE)
@@ -173,6 +173,7 @@ AliTRDCalibraFit::AliTRDCalibraFit()
   // Default constructor
   //
 
+  fGeo         = new AliTRDgeometry();
   fCalibraMode = new AliTRDCalibraMode();
 
   // Write
@@ -197,6 +198,7 @@ AliTRDCalibraFit::AliTRDCalibraFit()
 //______________________________________________________________________________________
 AliTRDCalibraFit::AliTRDCalibraFit(const AliTRDCalibraFit &c)
   :TObject(c)
+  ,fGeo(0)
   ,fWriteNameCoef(0)
   ,fFitPHOn(kFALSE)
   ,fFitPol2On(kFALSE)
@@ -256,6 +258,10 @@ AliTRDCalibraFit::~AliTRDCalibraFit()
 
   ClearTree();
 
+  if (fGeo) {
+    delete fGeo;
+  }
+
 }
 
 //_____________________________________________________________________________
@@ -2495,13 +2501,6 @@ Bool_t AliTRDCalibraFit::InitFit(Int_t nbins, Int_t i)
   gStyle->SetPadLeftMargin(0.13);
   gStyle->SetPadRightMargin(0.01);
 
-  // Get the parameter object
-  AliTRDCommonParam *parCom = AliTRDCommonParam::Instance();
-  if (!parCom) {
-    AliInfo("Could not get CommonParam");
-    return kFALSE;
-  }
-
   // Mode groups of pads: the total number of bins!
   Int_t numberofbinsexpected = 0;
   fCalibraMode->ModePadCalibration(2,i);
@@ -2617,8 +2616,8 @@ Bool_t AliTRDCalibraFit::InitFit(Int_t nbins, Int_t i)
        AliInfo(Form("You will see the detector: iPlane %d, iChamb %d, iSect %d"
                     ,fDet[0],fDet[1],fDet[2]));
        // A little geometry:
-       Int_t rowMax = parCom->GetRowMax(fDet[0],fDet[1],fDet[2]);
-       Int_t colMax = parCom->GetColMax(fDet[0]);
+       Int_t rowMax = fGeo->GetRowMax(fDet[0],fDet[1],fDet[2]);
+       Int_t colMax = fGeo->GetColMax(fDet[0]);
        // Create the histos to visualise
        CreateFitHistoCHDB(rowMax,colMax);
        if (fDebug == 4) {
@@ -2689,8 +2688,8 @@ Bool_t AliTRDCalibraFit::InitFit(Int_t nbins, Int_t i)
        AliInfo(Form("You will see the detector: iPlane %d, iChamb %d, iSect %d"
                     ,fDet[0],fDet[1],fDet[2]));
        // A little geometry:
-       Int_t rowMax = parCom->GetRowMax(fDet[0],fDet[1],fDet[2]);
-       Int_t colMax = parCom->GetColMax(fDet[0]);
+       Int_t rowMax = fGeo->GetRowMax(fDet[0],fDet[1],fDet[2]);
+       Int_t colMax = fGeo->GetColMax(fDet[0]);
        // Create the histos to visualise
        CreateFitHistoPHDB(rowMax,colMax);
        CreateFitHistoT0DB(rowMax,colMax);
@@ -2761,8 +2760,8 @@ Bool_t AliTRDCalibraFit::InitFit(Int_t nbins, Int_t i)
        AliInfo(Form("You will see the detector: iPlane %d, iChamb %d, iSect %d"
                     ,fDet[0],fDet[1],fDet[2]));
        // A little geometry:
-       Int_t rowMax = parCom->GetRowMax(fDet[0],fDet[1],fDet[2]);
-       Int_t colMax = parCom->GetColMax(fDet[0]);
+       Int_t rowMax = fGeo->GetRowMax(fDet[0],fDet[1],fDet[2]);
+       Int_t colMax = fGeo->GetColMax(fDet[0]);
        // Create the histos to visualise
        CreateFitHistoPRFDB(rowMax,colMax);
        if (fDebug == 4) {
@@ -2865,14 +2864,7 @@ Bool_t AliTRDCalibraFit::NotEnoughStatistic(Int_t idect, Int_t i)
   // of the calibration group, the value present in the choosen database
   // will be put. A negativ sign enables to know that a fit was not possible.
   //
-  
-  // Get the parameter object
-  AliTRDCommonParam *parCom = AliTRDCommonParam::Instance();
-  if (!parCom) {
-    AliInfo("Could not get CommonParam Manager");
-    return kFALSE;
-  }
-  
+
   // Get cal
   AliTRDcalibDB     *cal    = AliTRDcalibDB::Instance();
   if (!cal) {
@@ -3051,7 +3043,7 @@ Bool_t AliTRDCalibraFit::NotEnoughStatistic(Int_t idect, Int_t i)
     // Pointer to the branch
     for (Int_t k = fCalibraMode->GetRowMin(2); k < fCalibraMode->GetRowMax(2); k++) {
       for (Int_t j = fCalibraMode->GetColMin(2); j < fCalibraMode->GetColMax(2); j++) {
-       if((parCom->GetColMax(GetPlane(fCountDet[2])) != (j+1)) && (j != 0)){
+       if((fGeo->GetColMax(GetPlane(fCountDet[2])) != (j+1)) && (j != 0)){
          if (GetChamber(fCountDet[2]) == 2) {
             fPRFPad[(Int_t)(j*12+k)] = -fPRFCoef[1];
          }
@@ -3099,13 +3091,6 @@ Bool_t AliTRDCalibraFit::FillInfosFit(Int_t idect, Int_t i)
   // methods from the Fit functions
   //
 
-  // Get the parameter object
-  AliTRDCommonParam *parCom = AliTRDCommonParam::Instance();
-  if (!parCom) {
-    AliInfo("Could not get CommonParam Manager");
-    return kFALSE;
-  }
-
   // Get cal
   AliTRDcalibDB     *cal    = AliTRDcalibDB::Instance();
   if (!cal) {
@@ -3180,7 +3165,7 @@ Bool_t AliTRDCalibraFit::FillInfosFit(Int_t idect, Int_t i)
     // Pointer to the branch
     for (Int_t k = fCalibraMode->GetRowMin(2); k < fCalibraMode->GetRowMax(2); k++) {
       for (Int_t j = fCalibraMode->GetColMin(2); j < fCalibraMode->GetColMax(2); j++) {
-       if ((parCom->GetColMax(GetPlane(fCountDet[2])) != (j+1)) && (j != 0)) {
+       if ((fGeo->GetColMax(GetPlane(fCountDet[2])) != (j+1)) && (j != 0)) {
          if (GetChamber(fCountDet[2]) == 2) {
             fPRFPad[(Int_t)(j*12+k)] = fPRFCoef[fFitPRFNDB];
          }
@@ -4931,11 +4916,6 @@ Bool_t AliTRDCalibraFit::CalculChargeCoefMean(Int_t dect, Int_t idect, Bool_t vr
     AliInfo("Could not get calibDB  Manager");
     return kFALSE;
   }
-  AliTRDCommonParam *parCom = AliTRDCommonParam::Instance();
-  if (!parCom) {
-    AliInfo("Could not get CommonParam  Manager");
-    return kFALSE;
-  }
 
   fChargeCoef[3] = 0.0;
 
@@ -5004,12 +4984,6 @@ Bool_t AliTRDCalibraFit::CalculPRFCoefMean(Int_t dect, Int_t idect)
     return kFALSE;
   }
 
-  AliTRDCommonParam *parCom = AliTRDCommonParam::Instance();
-  if (!parCom) {
-    AliInfo("Could not get CommonParam  Manager");
-    return kFALSE;
-  }
-
   fPRFCoef[1] = 0.0;
   Int_t cot = 0;
 
@@ -5017,7 +4991,7 @@ Bool_t AliTRDCalibraFit::CalculPRFCoefMean(Int_t dect, Int_t idect)
     
     for (Int_t row = fCalibraMode->GetRowMin(2); row < fCalibraMode->GetRowMax(2); row++) {
       for (Int_t col = fCalibraMode->GetColMin(2); col < fCalibraMode->GetColMax(2); col++) {
-       if ((parCom->GetColMax(GetPlane(dect)) != (col+1)) && (col != 0)) {
+       if ((fGeo->GetColMax(GetPlane(dect)) != (col+1)) && (col != 0)) {
          cot++;
          if (fAccCDB) {
             fPRFCoef[1] += (Float_t) cal->GetPRFWidth(dect,col,row);
index 1b6e3bff4ca31b5f794ff255ba64788314d65355..4e247f218f491b77afac1f0e73672fae7a9f4535 100644 (file)
@@ -27,9 +27,11 @@ class TH2F;
 class TF1;
 
 class AliLog;
+
 class AliTRDCalibraMode;
 class AliTRDCalibraVector;
 class AliTRDCalDet;
+class AliTRDgeometry;
 
 class AliTRDCalibraFit : public TObject {
 
@@ -174,6 +176,9 @@ AliTRDCalibraVector *GetCalibraVector() const                                { r
 
  protected:
 
+  // Geometry
+  AliTRDgeometry  *fGeo;                    //! The TRD geometry
+
   // Write
           Bool_t   fWriteCoef[3];           // Do you want to write the result in a file?
           TString  fWriteNameCoef;          // Where the coef Det are written
@@ -393,7 +398,7 @@ AliTRDCalibraVector *GetCalibraVector() const                                { r
   static  AliTRDCalibraFit *fgInstance;        // Instance
   static  Bool_t   fgTerminated;               // If terminated
     
-  ClassDef(AliTRDCalibraFit,1)                 // TRD Calibration class
+  ClassDef(AliTRDCalibraFit,2)                 // TRD Calibration class
 
 };
   
index 1dfada6c9b400daae93ee6e2cf59f6eb41620887..0c95899fb1533b67b8512a9e1558ab002f6bf689 100644 (file)
 #include "AliLog.h"
 
 #include "AliTRDCalibraMode.h"
-#include "AliTRDCommonParam.h"
+#include "AliTRDgeometry.h"
 
 ClassImp(AliTRDCalibraMode)
 
 //______________________________________________________________________________________
 AliTRDCalibraMode::AliTRDCalibraMode()
   :TObject()
+  ,fGeo(0)
 {
   //
   // Default constructor
@@ -89,12 +90,15 @@ AliTRDCalibraMode::AliTRDCalibraMode()
     fNfragRphi[i] = -1;
     fXbins[i]     = -1;
   }
-   
+  
+  fGeo = new AliTRDgeometry();
 }
 
 //______________________________________________________________________________________
 AliTRDCalibraMode::AliTRDCalibraMode(const AliTRDCalibraMode &c)
   :TObject(c)
+  ,fGeo(0)
 {
   //
   // Copy constructor
@@ -116,7 +120,13 @@ AliTRDCalibraMode::AliTRDCalibraMode(const AliTRDCalibraMode &c)
     fDetChamb2[k] = c.fDetChamb2[k];
   }
 
+  if (fGeo) {
+    delete fGeo;
+  }
+  fGeo = new AliTRDgeometry();
+
 }
+
 //____________________________________________________________________________________
 AliTRDCalibraMode::~AliTRDCalibraMode()
 {
@@ -124,6 +134,10 @@ AliTRDCalibraMode::~AliTRDCalibraMode()
   // AliTRDCalibraMode destructor
   //
 
+  if (fGeo) {
+    delete fGeo;
+  }
+
 }
 
 //_____________________________________________________________________________
@@ -232,16 +246,10 @@ Bool_t AliTRDCalibraMode::ModePadFragmentation(Int_t iPlane,Int_t iChamb, Int_t
 
   fNfragZ[i]    = 0;
   fNfragRphi[i] = 0;
-  
-  AliTRDCommonParam *parCom = AliTRDCommonParam::Instance();
-  if (!parCom) {
-    AliInfo("Could not get CommonParam Manager");
-    return kFALSE;
-  }
 
   // A little geometry:
-  Int_t rowMax = parCom->GetRowMax(iPlane,iChamb,iSect);
-  Int_t colMax = parCom->GetColMax(iPlane);
+  Int_t rowMax = fGeo->GetRowMax(iPlane,iChamb,iSect);
+  Int_t colMax = fGeo->GetColMax(iPlane);
   
   // The fragmentation
   if (fNnZ[i]    != 0) {
index d3e9afcb5d4d5b23fa9f3de3cfe6b0a25f669f3c..9b087d6a45dde16c9ccd7d1201cea7c961e65608 100644 (file)
@@ -15,6 +15,8 @@
 #  include <TObject.h>
 #endif
 
+class AliTRDgeometry;
+
 class AliTRDCalibraMode : public TObject {
 
  public: 
@@ -64,6 +66,9 @@ class AliTRDCalibraMode : public TObject {
      
  protected:
 
+  // Geometry
+  AliTRDgeometry  *fGeo;                    //! The TRD geometry
+
           Short_t  fNz[3];                  // Mode of calibration 
           Short_t  fNrphi[3];               // Mode of calibration 
          Short_t  fNnZ[3];                 // Number of pad rows in a group
@@ -83,7 +88,7 @@ class AliTRDCalibraMode : public TObject {
   virtual Int_t    GetChamber(Int_t d) const;
   virtual Int_t    GetSector(Int_t d) const;
  
-  ClassDef(AliTRDCalibraMode,1)             // TRD Calibration class
+  ClassDef(AliTRDCalibraMode,2)             // TRD Calibration class
 
 };
 #endif
index aa025f39305d1f95a1d12c98faf6e2659b27e868..ed377a62d56bf4ea95138ee15f758d9b032207dd 100644 (file)
@@ -30,8 +30,6 @@
 #include "AliRun.h"
 
 #include "AliTRDCommonParam.h"
-#include "AliTRDpadPlane.h"
-
 
 ClassImp(AliTRDCommonParam)
 
@@ -82,7 +80,6 @@ AliTRDCommonParam::AliTRDCommonParam()
   :TObject()
   ,fExBOn(kFALSE)
   ,fSamplingFrequency(0.0)
-  ,fPadPlaneArray(0)
 {
   //
   // Default constructor
@@ -104,19 +101,6 @@ void AliTRDCommonParam::Init()
 
   // Sampling Frequency in MHz
   fSamplingFrequency = 10.0;
-  
-  // ----------------------------------------------------------------------------
-  // The pad planes
-  // ----------------------------------------------------------------------------
-  
-  fPadPlaneArray = new TObjArray(kNplan * kNcham);
-  
-  for (Int_t iplan = 0; iplan < kNplan; iplan++) {
-    for (Int_t icham = 0; icham < kNcham; icham++) {
-      Int_t ipp = iplan + icham * kNplan;
-      fPadPlaneArray->AddAt(new AliTRDpadPlane(iplan,icham),ipp);
-    }
-  }
 
 }
 
@@ -127,12 +111,6 @@ AliTRDCommonParam::~AliTRDCommonParam()
   // Destructor
   //
   
-  if (fPadPlaneArray) {
-    fPadPlaneArray->Delete();
-    delete fPadPlaneArray;
-    fPadPlaneArray = 0;
-  }
-
 }
 
 //_____________________________________________________________________________
@@ -140,7 +118,6 @@ AliTRDCommonParam::AliTRDCommonParam(const AliTRDCommonParam &p)
   :TObject(p)
   ,fExBOn(p.fExBOn)
   ,fSamplingFrequency(p.fSamplingFrequency)
-  ,fPadPlaneArray(0)
 {
   //
   // Copy constructor
@@ -179,59 +156,3 @@ void AliTRDCommonParam::Copy(TObject &p) const
   target->fSamplingFrequency = fSamplingFrequency;
 
 }
-
-//_____________________________________________________________________________
-AliTRDpadPlane *AliTRDCommonParam::GetPadPlane(Int_t p, Int_t c) const
-{
-  //
-  // Returns the pad plane for a given plane <p> and chamber <c> number
-  //
-
-  Int_t ipp = p + c * kNplan;
-  return ((AliTRDpadPlane *) fPadPlaneArray->At(ipp));
-
-}
-
-//_____________________________________________________________________________
-Int_t AliTRDCommonParam::GetRowMax(Int_t p, Int_t c, Int_t /*s*/) const
-{
-  //
-  // Returns the number of rows on the pad plane
-  //
-
-  return GetPadPlane(p,c)->GetNrows();
-
-}
-
-//_____________________________________________________________________________
-Int_t AliTRDCommonParam::GetColMax(Int_t p) const
-{
-  //
-  // Returns the number of rows on the pad plane
-  //
-
-  return GetPadPlane(p,0)->GetNcols();
-
-}
-
-//_____________________________________________________________________________
-Double_t AliTRDCommonParam::GetRow0(Int_t p, Int_t c, Int_t /*s*/) const
-{
-  //
-  // Returns the position of the border of the first pad in a row
-  //
-
-  return GetPadPlane(p,c)->GetRow0();
-
-}
-
-//_____________________________________________________________________________
-Double_t AliTRDCommonParam::GetCol0(Int_t p) const
-{
-  //
-  // Returns the position of the border of the first pad in a column
-  //
-
-  return GetPadPlane(p,0)->GetCol0();
-
-}
index 34789af7498503f108d7d247168e896561559be2..c29c23b4d65088b9613813d150911884f3c64a63 100644 (file)
@@ -36,11 +36,6 @@ class AliTRDCommonParam : public TObject
     
     Bool_t          ExBOn() const                                  { return fExBOn;              }
     
-    AliTRDpadPlane *GetPadPlane(Int_t p, Int_t c) const;
-    Int_t           GetRowMax(Int_t p, Int_t c, Int_t /*s*/) const;
-    Int_t           GetColMax(Int_t p) const;
-    Double_t        GetRow0(Int_t p, Int_t c, Int_t /*s*/) const;
-    Double_t        GetCol0(Int_t p) const;
     Float_t         GetSamplingFrequency() const                   { return fSamplingFrequency;  }
 
   protected:
@@ -54,14 +49,13 @@ class AliTRDCommonParam : public TObject
 
     Float_t                   fSamplingFrequency; //  Sampling Frequency in MHz
   
-    TObjArray                *fPadPlaneArray;     //! Array of pad plane objects
-  
   private:
 
     // This is a singleton, constructor is private!  
     AliTRDCommonParam();
   
-    ClassDef(AliTRDCommonParam,3)                  // The constant parameters common to simulation and reconstruction
+    ClassDef(AliTRDCommonParam,4)                  // The constant parameters common to simulation and reconstruction
+
 };
 
 #endif
index a34a9f2a6fbb9a81d46322483af173bd5f2cd833..cf249cc43a3c5e9aa8712087defb837dd6b5cdab 100644 (file)
@@ -32,7 +32,6 @@
 #include "AliRawReader.h"
 #include "AliTRDRawStream.h"
 #include "AliTRDgeometry.h"
-#include "AliTRDCommonParam.h"
 #include "AliTRDcalibDB.h"
 
 ClassImp(AliTRDRawStream)
@@ -104,8 +103,6 @@ AliTRDRawStream::AliTRDRawStream()
   ,fDataWord(NULL)
   ,fTimeBinsCalib(0)
   ,fGeo(NULL) 
-  ,fCommonParam(NULL)
-  ,fCalibration(NULL)
 {
   //
   // Default constructor
@@ -184,8 +181,6 @@ AliTRDRawStream::AliTRDRawStream(AliRawReader *rawReader)
   ,fDataWord(NULL)
   ,fTimeBinsCalib(0)
   ,fGeo(NULL) 
-  ,fCommonParam(NULL)
-  ,fCalibration(NULL)
 {
   //
   // Create an object to read TRD raw digits
@@ -266,8 +261,6 @@ AliTRDRawStream::AliTRDRawStream(const AliTRDRawStream& stream)
   ,fDataWord(NULL)
   ,fTimeBinsCalib(0)
   ,fGeo(NULL)
-  ,fCommonParam(NULL)
-  ,fCalibration(NULL)
 {
   //
   // Copy constructor
@@ -296,8 +289,11 @@ AliTRDRawStream::~AliTRDRawStream()
   //
   // Destructor
   //
-  
-  delete fGeo;
+
+  if (fGeo) {  
+    delete fGeo;
+  }
+
 }
 
 //_____________________________________________________________________________
@@ -308,6 +304,7 @@ void AliTRDRawStream::SetRawReader(AliRawReader *rawReader)
       fRawReader = rawReader;
     }
 }
+
 //_____________________________________________________________________________
 Bool_t AliTRDRawStream::SetRawVersion(Int_t rv)
 {
@@ -332,24 +329,16 @@ Int_t AliTRDRawStream::Init()
   // Initialization
   //
 
-  fCommonParam = AliTRDCommonParam::Instance();
-  if (!fCommonParam) {
-    AliError("Could not get common parameters");
-    return 0;
-  }
-
-  fCalibration = AliTRDcalibDB::Instance();
-  if (!fCalibration) {
+  if (!AliTRDcalibDB::Instance()) {
     AliError("Could not get calibration object");
     return 0;
   }
 
-  if (!fGeo)
-    {
-      fGeo = new AliTRDgeometry();
-    }
+  if (!fGeo) {
+    fGeo = new AliTRDgeometry();
+  }
   
-  fTimeBinsCalib = fCalibration->GetNumberOfTimeBins();
+  fTimeBinsCalib = AliTRDcalibDB::Instance()->GetNumberOfTimeBins();
   AliDebug(2, Form("Number of Timebins read from CDB: %d", fTimeBinsCalib));
 
   // The number of data words needed for this number of time bins (there
@@ -550,8 +539,8 @@ Bool_t AliTRDRawStream::Next()
            { // HC header
              DecodeHCheader(fTimeBinsCalib); // This is the new header!
              fDET    = fGeo->GetDetector(fLAYER, fSTACK, fSM);
-             fRowMax = fCommonParam->GetRowMax(fLAYER,fSTACK,fSM);
-             fColMax = fCommonParam->GetColMax(fROC);
+             fRowMax = fGeo->GetRowMax(fLAYER,fSTACK,fSM);
+             fColMax = fGeo->GetColMax(fROC);
              
              fMCMHctr2 = 0;
              fHCdataCtr = 0;
index 7c47d633978c7d1e8b55504ad3ecd9438c590329..06eec72a33a1c5e3b97c348cbbd15f0269b684ea 100644 (file)
@@ -15,8 +15,6 @@
 
 class AliTRDgeometry;
 class AliRawReader;
-class AliTRDCommonParam;
-class AliTRDcalibDB;
 
 // Some constants:
 const UInt_t kEndoftrackletmarker = 0xAAAAAAAA; /*This marks the end of tracklet data words*/
@@ -144,15 +142,15 @@ class AliTRDRawStream: public TObject {
     Bool_t   fADCmask[21];                 //  Mask of active ADCs for zero suppression
     UShort_t fChamberDone[540];            //  Chamber was processed already (1=1HC, 2=full chamber)
 
-    Int_t    fRetVal;                         //  Datadecode return
-    Int_t    fEqID;                           //  Equipment id
-    UInt_t   fDataSize;                       //  Size of the data available in the current buffer
-    Bool_t   fSizeOK;                         //  Did we read anything
+    Int_t    fRetVal;                      //  Datadecode return
+    Int_t    fEqID;                        //  Equipment id
+    UInt_t   fDataSize;                    //  Size of the data available in the current buffer
+    Bool_t   fSizeOK;                      //  Did we read anything
     UInt_t   fCountBytes;                  //  Bytes traversed in the buffer
     UInt_t   fBufSize;                     //  Size of the current RawReader buffer
     Bool_t   fkBufferSet;                  //  Is the RawReader buffer available
-    UChar_t  *fPos;                        //  Position in the buffer of the RawReader
-    UInt_t   *fDataWord;                   //  The pointer to the current 32 bit data word
+    UChar_t *fPos;                         //  Position in the buffer of the RawReader
+    UInt_t  *fDataWord;                    //  The pointer to the current 32 bit data word
     UInt_t   fTimeBinsCalib;               //  N of time bins retrieved from calibration
 
     enum ETRDzRawStreamError {
@@ -175,17 +173,10 @@ class AliTRDRawStream: public TObject {
 
     AliTRDgeometry *fGeo;                  //  TRD geometry
 
-    AliTRDCommonParam *fCommonParam;
-    AliTRDcalibDB     *fCalibration;
-
     void  DecodeHCheader(Int_t timeBins);
-
     void  DecodeMCMheader();
-
     void  DecodeTracklet();
-
     void  DecodeGTUlinkMask();
-
     Int_t DecodeDataWord();
     Int_t DecodeDataWordV1V2();                // Valid for fRawversion = 1, 2, ... 
     Int_t DecodeDataWordV3();                  // Valid for fRawversion = 3, ... 
@@ -194,7 +185,7 @@ class AliTRDRawStream: public TObject {
 
     enum { fkStart, fkStop, fkWordOK, fkNoMoreData, fkNextSM, fkNextHC, fkSeekNonEoTracklet, fkDecodeHC, fkNextMCM, fkNextData, fkReading};
     
-    ClassDef(AliTRDRawStream, 4)               // Class for reading TRD raw digits
+    ClassDef(AliTRDRawStream, 5)               // Class for reading TRD raw digits
 
 };
 #endif
index 372faa488cf3a93773a61dbddd2e9fd3646d8a25..680b1034d4f638db65c375f566e21b6112ab4af0 100644 (file)
@@ -33,8 +33,6 @@
 #include "AliTRDclusterizerV1.h"
 #include "AliTRDtracker.h"
 #include "AliTRDpidESD.h"
-#include "AliTRDtrigger.h"
-#include "AliTRDtrigParam.h"
 #include "AliTRDgtuTrack.h"
 #include "AliTRDrawData.h"
 #include "AliTRDdigitsManager.h"
@@ -86,39 +84,6 @@ void AliTRDReconstructor::Reconstruct(AliRunLoader *runLoader
 
   loader->UnloadRecPoints();
 
-  //
-  // Trigger (tracklets, LTU)
-  //
-//   loader->LoadTracks();
-//   if (loader->TreeT()) {
-//     AliError("Tracklets already exist");
-//     return;
-//   }
-//   AliInfo("Trigger tracklets will be produced");
-
-//   AliTRDtrigger trdTrigger("Trigger","Trigger class"); 
-
-//   AliTRDtrigParam *trigp = new AliTRDtrigParam("TRDtrigParam"
-//                                               ,"TRD Trigger parameters");
-
-//   Float_t field = AliTracker::GetBz() * 0.1; // Tesla
-//   AliInfo(Form("Trigger set for magnetic field = %f Tesla \n",field));
-//   trigp->SetField(field);
-//   trigp->Init();
-//   trdTrigger.SetParameter(trigp);
-
-//   rawReader->RewindEvents();
-
-//   for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
-//     if (!rawReader->NextEvent()) break;
-//     trdTrigger.Open(runLoader->GetFileName(),iEvent);
-//     trdTrigger.ReadDigits(rawReader);
-//     trdTrigger.MakeTracklets();
-//     trdTrigger.WriteTracklets(-1);
-//   }
-
-//   loader->UnloadTracks();
-
 }
 
 //_____________________________________________________________________________
@@ -136,10 +101,6 @@ void AliTRDReconstructor::Reconstruct(AliRawReader *rawReader
   clusterer.ReadDigits(rawReader);
   clusterer.MakeClusters();
 
-  //
-  // No trigger, since we don't have the output tree for tracklets
-  //
-
 }
 
 //_____________________________________________________________________________
@@ -155,10 +116,6 @@ void AliTRDReconstructor::Reconstruct(TTree *digitsTree
   clusterer.ReadDigits(digitsTree);
   clusterer.MakeClusters();
 
-  //
-  // No trigger, since we don't have the output tree for tracklets
-  //
-
 }
 
 //_____________________________________________________________________________
@@ -184,32 +141,6 @@ void AliTRDReconstructor::Reconstruct(AliRunLoader *runLoader) const
 
   loader->UnloadRecPoints();
 
-  //
-  // Trigger (tracklets, LTU)
-  //
-  loader->LoadTracks("RECREATE");
-  AliInfo("Trigger tracklets will be produced");
-
-  AliTRDtrigger trdTrigger("Trigger","Trigger class"); 
-
-  AliTRDtrigParam *trigp = new AliTRDtrigParam("TRDtrigParam"
-                                              ,"TRD Trigger parameters");
-
-  Float_t field = AliTracker::GetBz() * 0.1; // Tesla
-  AliInfo(Form("Trigger set for magnetic field = %f Tesla \n",field));
-  trigp->SetField(field);
-  trigp->Init();
-  trdTrigger.SetParameter(trigp);
-
-  for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
-    trdTrigger.Open(runLoader->GetFileName(),iEvent);
-    trdTrigger.ReadDigits();
-    trdTrigger.MakeTracklets();
-    trdTrigger.WriteTracklets(-1);
-  }
-
-  loader->UnloadTracks();
-
 }
 
 //_____________________________________________________________________________
@@ -237,10 +168,6 @@ void AliTRDReconstructor::FillESD(AliRunLoader* /*runLoader*/
   AliTRDpidESD trdPID;
   trdPID.MakePID(esd);
 
-  //
-  // No trigger, since we don't have the output tree for tracklets
-  //
-
 }
 
 //_____________________________________________________________________________
@@ -255,10 +182,6 @@ void AliTRDReconstructor::FillESD(AliRawReader* /*rawReader*/
   AliTRDpidESD trdPID;
   trdPID.MakePID(esd);
 
-  //
-  // No trigger, since we don't have the output tree for tracklets
-  //
-
 }
 
 //_____________________________________________________________________________
@@ -273,10 +196,6 @@ void AliTRDReconstructor::FillESD(TTree* /*digitsTree*/
   AliTRDpidESD trdPID;
   trdPID.MakePID(esd);
 
-  //
-  // No trigger, since we don't have the output tree for tracklets
-  //
-
 }
 
 //_____________________________________________________________________________
@@ -290,51 +209,4 @@ void AliTRDReconstructor::FillESD(AliRunLoader* /*runLoader*/
   AliTRDpidESD trdPID;
   trdPID.MakePID(esd);
 
-  //
-  // Trigger (tracks, GTU)
-  //
-//   AliTRDtrigger trdTrigger("Trigger","Trigger class"); 
-
-//   AliTRDtrigParam *trigp = new AliTRDtrigParam("TRDtrigParam"
-//                                               ,"TRD Trigger parameters");
-
-//   Float_t field = AliTracker::GetBz() * 0.1; // Tesla
-//   AliInfo(Form("Trigger set for magnetic field = %f Tesla \n",field));
-//   trigp->SetField(field);
-//   trigp->Init();
-
-//   trdTrigger.SetParameter(trigp);
-//   trdTrigger.SetRunLoader(runLoader);
-//   trdTrigger.Init();
-
-//   Int_t iEvent = runLoader->GetEventNumber(); 
-//   runLoader->GetEvent(iEvent);
-//   trdTrigger.ReadTracklets(runLoader);
-
-//   AliESDTrdTrack *TrdTrack = new AliESDTrdTrack();
-//   AliTRDgtuTrack *GtuTrack;
-
-//   Int_t nTracks = trdTrigger.GetNumberOfTracks();
-//   for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
-
-//     GtuTrack = trdTrigger.GetTrack(iTrack);
-
-//     TrdTrack->SetYproj(GtuTrack->GetYproj());
-//     TrdTrack->SetZproj(GtuTrack->GetZproj());
-//     TrdTrack->SetSlope(GtuTrack->GetSlope());
-//     TrdTrack->SetDetector(GtuTrack->GetDetector());
-//     TrdTrack->SetTracklets(GtuTrack->GetTracklets());
-//     TrdTrack->SetPlanes(GtuTrack->GetPlanes());
-//     TrdTrack->SetClusters(GtuTrack->GetClusters());
-//     TrdTrack->SetPt(GtuTrack->GetPt());
-//     TrdTrack->SetPhi(GtuTrack->GetPhi());
-//     TrdTrack->SetEta(GtuTrack->GetEta());
-//     TrdTrack->SetLabel(GtuTrack->GetLabel());
-//     TrdTrack->SetPID(GtuTrack->GetPID());
-//     TrdTrack->SetIsElectron(GtuTrack->IsElectron());
-
-//     esd->AddTrdTrack(TrdTrack);
-
-//   }
-
 }
index a8cb2fe259c8ddd9eae17ae05f90551ff3a98340..5b72aa992756d078875bbd55ee4a81cb3a8a0add 100644 (file)
@@ -90,18 +90,13 @@ void AliTRDTriggerL1::Trigger()
   TString          evfoldname = AliConfig::GetDefaultEventFolderName();
   AliRunLoader    *runLoader  = AliRunLoader::GetRunLoader(evfoldname);
   AliLoader       *loader     = runLoader->GetLoader("TRDLoader");
-  AliTRDgeometry  *geo        = AliTRDgeometry::GetGeometry(runLoader);
-  AliTRDtrigParam *trigp      = new AliTRDtrigParam("TRDtrigParam","TRD Trigger parameters");
+  AliTRDgeometry   geo;
 
   AliTRDtrigger trdTrigger("Trigger","Trigger class"); 
 
   Float_t field = AliTracker::GetBz() * 0.1; // Tesla
   AliInfo(Form("Trigger set for magnetic field = %f Tesla \n",field));
 
-  trigp->SetField(field);
-  trigp->Init();
-
-  trdTrigger.SetParameter(trigp);
   trdTrigger.SetRunLoader(runLoader);
   trdTrigger.Init();
 
@@ -112,9 +107,9 @@ void AliTRDTriggerL1::Trigger()
 
   // Trigger (tracks, GTU)
 
-  Float_t highPt    = trigp->GetHighPt();
-  Float_t jetLowPt  = trigp->GetJetLowPt();
-  Float_t jetHighPt = trigp->GetJetHighPt();
+  Float_t highPt    = AliTRDtrigParam::Instance()->GetHighPt();
+  Float_t jetLowPt  = AliTRDtrigParam::Instance()->GetJetLowPt();
+  Float_t jetHighPt = AliTRDtrigParam::Instance()->GetJetHighPt();
 
   Float_t pid;
   Float_t pt;
@@ -154,7 +149,7 @@ void AliTRDTriggerL1::Trigger()
     isElectron = gtuTrack->IsElectron();
     pt         = gtuTrack->GetPt();
     det        = gtuTrack->GetDetector();
-    sec        = geo->GetSector(det);
+    sec        = geo.GetSector(det);
 
     if (isElectron) {
 
@@ -201,10 +196,10 @@ void AliTRDTriggerL1::Trigger()
   }
 
   // Hadrons from jets
-  if (hadronJetLowPt  >= trigp->GetNPartJetLow() ) {
+  if (hadronJetLowPt  >= AliTRDtrigParam::Instance()->GetNPartJetLow() ) {
     SetInput("TRD_Jet_LPt_L1");
   }
-  if (hadronJetHighPt >= trigp->GetNPartJetHigh()) {
+  if (hadronJetHighPt >= AliTRDtrigParam::Instance()->GetNPartJetHigh()) {
     SetInput("TRD_Jet_HPt_L1");
   }
 
index bef947b92960f8019e07279c962a0d5408b53706..279733c6fd7fea2d1a3dcd4cdaf8adc4ad3cd054 100644 (file)
@@ -23,7 +23,6 @@
 /////////////////////////////////////////////////////////////////////////////// 
 
 #include "AliTRDcluster.h"
-#include "AliTRDrecPoint.h"
 
 ClassImp(AliTRDcluster)
 
@@ -47,34 +46,6 @@ AliTRDcluster::AliTRDcluster()
 
 }
 
-//_____________________________________________________________________________
-AliTRDcluster::AliTRDcluster(const AliTRDrecPoint &p)
-  :AliCluster()
-  ,fDetector(p.GetDetector())
-  ,fTimeBin(p.GetLocalTimeBin())
-  ,fQ(p.GetEnergy())
-  ,fNPads(0)
-  ,fCenter(0)
-  ,fPad(0)
-{
-  //
-  // Constructor from AliTRDrecPoint
-  //
-
-  SetLabel(p.GetTrackIndex(0),0);
-  SetLabel(p.GetTrackIndex(1),1);
-  SetLabel(p.GetTrackIndex(2),2);
-  SetY(p.GetY());
-  SetZ(p.GetZ());
-
-  //fSigmaY2   = p.GetSigmaY2();
-  //fSigmaZ2   = p.GetSigmaZ2();  
-  // Why is this ????
-  SetSigmaY2(0.2);
-  SetSigmaZ2(5.0);  
-
-}
-
 //_____________________________________________________________________________
 AliTRDcluster::AliTRDcluster(const AliTRDcluster &c)
   :AliCluster()
index 84a11d02838f8c31a1c494823f21073efa585233..0c369f3311cb99c55655c7c78686b4a8a2600fd9 100644 (file)
 
 #include "AliCluster.h"  
 
-class AliTRDrecPoint;
-
 class AliTRDcluster : public AliCluster {
 
  public:
 
   AliTRDcluster();
   AliTRDcluster(const AliTRDcluster &c);
-  AliTRDcluster(const AliTRDrecPoint &p);
 
   virtual void     AddTrackIndex(Int_t *i); 
 
index 45b9e04481a7a19a823134ec2af73187e83aa9ab..b9fad66f8f910e46188f86400d0a305a22a3bf42 100644 (file)
@@ -22,7 +22,6 @@
 /////////////////////////////////////////////////////////////////////////////// 
 
 #include "AliTRDclusterMI.h"
-#include "AliTRDrecPoint.h"
 
 ClassImp(AliTRDclusterMI)
 
@@ -51,17 +50,3 @@ AliTRDclusterMI::AliTRDclusterMI(const AliTRDcluster &c)
   //
 
 }
-
-//_____________________________________________________________________________
-AliTRDclusterMI::AliTRDclusterMI(const AliTRDrecPoint &p)
-  :AliTRDcluster(p)
-  ,fRmsY(0)
-  ,fNPads(0)
-  ,fRelPos(0)
-{
-  //
-  // Constructor from AliTRDrecPoint
-  //
-  
-}
-
index 4776f67369d6a1de15b3552c880c9cc327b3825c..2f96e7d7297099ffa18329c78979e11411dbc32c 100644 (file)
 #include "AliTRDcluster.h"  
 #include "TMath.h"  
 
-class AliTRDrecPoint;
-
 class AliTRDclusterMI : public AliTRDcluster {
 
  public:
 
   AliTRDclusterMI();
   AliTRDclusterMI(const AliTRDcluster &c);
-  AliTRDclusterMI(const AliTRDrecPoint &p);
 
           void     SetRmsY(Float_t rmsy)          { fRmsY   = rmsy;                   }
           void     SetNPads(Int_t npads)          { fNPads  = npads;                  }
index fcc53cf9c466c4f7b4c63b16b0e5d2ca8a41e962..618cab4a7d9596d6c90ea9c998e22dcdfff3137f 100644 (file)
@@ -32,7 +32,6 @@
 
 #include "AliTRDclusterizer.h"
 #include "AliTRDcluster.h"
-#include "AliTRDrecPoint.h"
 #include "AliTRDgeometry.h"
 #include "AliTRDcalibDB.h"
 #include "AliTRDCommonParam.h"
index e1bcf39295812cdb6047f2bcc21a7ef859e36288..76ac45754387e8f8d5868e0d9b6b37dd3fd678c4 100644 (file)
@@ -43,7 +43,6 @@
 #include "AliTRDcalibDB.h"
 #include "AliTRDSimParam.h"
 #include "AliTRDRecParam.h"
-#include "AliTRDCommonParam.h"
 #include "AliTRDcluster.h"
 
 #include "Cal/AliTRDCalROC.h"
@@ -192,11 +191,12 @@ Bool_t AliTRDclusterizerV1::MakeClusters()
   AliTRDdataArrayI *tracksIn;
 
   // Get the geometry
-  AliTRDgeometry *geo            = AliTRDgeometry::GetGeometry(fRunLoader);  
-  if (!geo) {
-    AliWarning("Loading default TRD geometry!");
-    geo = new AliTRDgeometry();
-  }
+  //AliTRDgeometry *geo            = AliTRDgeometry::GetGeometry(fRunLoader);  
+  //if (!geo) {
+  //  AliWarning("Creating default TRD geometry!");
+  //  geo = new AliTRDgeometry();
+  //}
+  AliTRDgeometry geo;
 
   AliTRDcalibDB  *calibration    = AliTRDcalibDB::Instance();
   if (!calibration) {
@@ -215,12 +215,6 @@ Bool_t AliTRDclusterizerV1::MakeClusters()
     AliError("No AliTRDRecParam instance available\n");
     return kFALSE;  
   }
-  
-  AliTRDCommonParam *commonParam = AliTRDCommonParam::Instance();
-  if (!commonParam) {
-    AliError("Could not get common parameters\n");
-    return kFALSE;
-  }
 
   // ADC thresholds
   Float_t ADCthreshold   = simParam->GetADCthreshold();
@@ -269,7 +263,7 @@ Bool_t AliTRDclusterizerV1::MakeClusters()
     for (iplan = planBeg; iplan < planEnd; iplan++) {
       for (isect = sectBeg; isect < sectEnd; isect++) {
 
-        Int_t    idet    = geo->GetDetector(iplan,icham,isect);
+        Int_t    idet    = geo.GetDetector(iplan,icham,isect);
         Int_t    ilayer  = AliGeomManager::kTRD1 + iplan;
         Int_t    imodule = icham + chamEnd * isect;
         UShort_t volid   = AliGeomManager::LayerToVolUID(ilayer,imodule); 
@@ -284,10 +278,10 @@ Bool_t AliTRDclusterizerV1::MakeClusters()
         AliTRDdataArrayI *tracksTmp = fDigitsManager->GetDictionary(idet,0);
         tracksTmp->Expand();
 
-       Int_t nRowMax = commonParam->GetRowMax(iplan,icham,isect);
-       Int_t nColMax = commonParam->GetColMax(iplan);
+       Int_t nRowMax = geo.GetRowMax(iplan,icham,isect);
+       Int_t nColMax = geo.GetColMax(iplan);
 
-        AliTRDpadPlane *padPlane = commonParam->GetPadPlane(iplan,icham);
+        AliTRDpadPlane *padPlane = geo.GetPadPlane(iplan,icham);
 
        // Calibration object with pad wise values for t0
         AliTRDCalROC *calT0ROC              = calibration->GetT0ROC(idet);
index 2f033f0ec7275be1468e7d78cf8d71f51dc9e209..a3438eb3e115dab6237873cfefd6124808d41d94 100644 (file)
@@ -333,6 +333,11 @@ AliTRDdigitizer::~AliTRDdigitizer()
     fTimeStruct2 = 0;
   }
 
+  if (fGeo) {
+    delete fGeo;
+    fGeo = 0;
+  }
+
 }
 
 //_____________________________________________________________________________
@@ -658,8 +663,7 @@ Bool_t AliTRDdigitizer::InitDetector()
   }
 
   // Get the geometry
-  fGeo = fTRD->GetGeometry();
-  AliDebug(1,Form("Geometry version %d",fGeo->IsVersion()));
+  fGeo = new AliTRDgeometry();
 
   // Create a digits manager
   delete fDigitsManager;
@@ -858,7 +862,7 @@ Bool_t AliTRDdigitizer::MakeDigits()
       Float_t hittime  = hit->GetTime();
       Int_t   plane    = fGeo->GetPlane(detector);
       Int_t   chamber  = fGeo->GetChamber(detector);
-      padPlane         = commonParam->GetPadPlane(plane,chamber);
+      padPlane         = fGeo->GetPadPlane(plane,chamber);
       Float_t row0     = padPlane->GetRow0ROC();
       Int_t   nRowMax  = padPlane->GetNrows();
       Int_t   nColMax  = padPlane->GetNcols();
@@ -1169,8 +1173,8 @@ Bool_t AliTRDdigitizer::MakeDigits()
     Int_t plane      = fGeo->GetPlane(iDet);
     Int_t sector     = fGeo->GetSector(iDet);
     Int_t chamber    = fGeo->GetChamber(iDet);
-    Int_t nRowMax    = commonParam->GetRowMax(plane,chamber,sector);
-    Int_t nColMax    = commonParam->GetColMax(plane);
+    Int_t nRowMax    = fGeo->GetRowMax(plane,chamber,sector);
+    Int_t nColMax    = fGeo->GetColMax(plane);
 
     Double_t *inADC  = new Double_t[nTimeTotal];
     Double_t *outADC = new Double_t[nTimeTotal];
@@ -1385,12 +1389,6 @@ Bool_t AliTRDdigitizer::ConvertSDigits()
     return kFALSE;
   }
   
-  AliTRDCommonParam *commonParam = AliTRDCommonParam::Instance();
-  if (!commonParam) {
-    AliFatal("Could not get common parameters");
-    return kFALSE;
-  }
-  
   AliTRDcalibDB     *calibration = AliTRDcalibDB::Instance();
   if (!calibration) {
     AliFatal("Could not get calibration object");
@@ -1424,8 +1422,8 @@ Bool_t AliTRDdigitizer::ConvertSDigits()
     Int_t plane      = fGeo->GetPlane(iDet);
     Int_t sector     = fGeo->GetSector(iDet);
     Int_t chamber    = fGeo->GetChamber(iDet);
-    Int_t nRowMax    = commonParam->GetRowMax(plane,chamber,sector);
-    Int_t nColMax    = commonParam->GetColMax(plane);
+    Int_t nRowMax    = fGeo->GetRowMax(plane,chamber,sector);
+    Int_t nColMax    = fGeo->GetColMax(plane);
 
     Double_t *inADC  = new Double_t[nTimeTotal];
     Double_t *outADC = new Double_t[nTimeTotal];
@@ -1549,12 +1547,6 @@ Bool_t AliTRDdigitizer::MergeSDigits()
     return kFALSE;
   }
   
-  AliTRDCommonParam *commonParam = AliTRDCommonParam::Instance();
-  if (!commonParam) {
-    AliFatal("Could not get common parameters");
-    return kFALSE;
-  }
-  
   AliTRDcalibDB     *calibration = AliTRDcalibDB::Instance();
   if (!calibration) {
     AliFatal("Could not get calibration object");
@@ -1601,8 +1593,8 @@ Bool_t AliTRDdigitizer::MergeSDigits()
       Int_t plane   = fGeo->GetPlane(iDet);
       Int_t sector  = fGeo->GetSector(iDet);
       Int_t chamber = fGeo->GetChamber(iDet);
-      Int_t nRowMax = commonParam->GetRowMax(plane,chamber,sector);
-      Int_t nColMax = commonParam->GetColMax(plane);
+      Int_t nRowMax = fGeo->GetRowMax(plane,chamber,sector);
+      Int_t nColMax = fGeo->GetColMax(plane);
 
       // Loop through the pixels of one detector and add the signals
       digitsA = fSDigitsManager->GetDigits(iDet);
index 401fd25ce27186595e4723f93b0ab1af89f12b1b..f451be96b3086499ea51aa37e6850980e5be48e4 100644 (file)
@@ -34,7 +34,6 @@
 
 #include "AliTRD.h"
 #include "AliTRDcalibDB.h"
-#include "AliTRDCommonParam.h"
 #include "AliTRDgeometry.h"
 #include "AliTRDpadPlane.h"
 
@@ -164,7 +163,7 @@ AliTRDgeometry::AliTRDgeometry()
   ,fMatrixArray(0)
   ,fMatrixCorrectionArray(0)
   ,fMatrixGeo(0)
-
+  ,fPadPlaneArray(0)
 {
   //
   // AliTRDgeometry default constructor
@@ -177,9 +176,10 @@ AliTRDgeometry::AliTRDgeometry()
 //_____________________________________________________________________________
 AliTRDgeometry::AliTRDgeometry(const AliTRDgeometry &g)
   :AliGeometry(g)
-  ,fMatrixArray(g.fMatrixArray)
-  ,fMatrixCorrectionArray(g.fMatrixCorrectionArray)
-  ,fMatrixGeo(g.fMatrixGeo)
+  ,fMatrixArray(0)
+  ,fMatrixCorrectionArray(0)
+  ,fMatrixGeo(0)
+  ,fPadPlaneArray(0)
 {
   //
   // AliTRDgeometry copy constructor
@@ -214,6 +214,12 @@ AliTRDgeometry::~AliTRDgeometry()
     fMatrixGeo = 0;
   }
 
+  if (fPadPlaneArray) {
+    fPadPlaneArray->Delete();
+    delete fPadPlaneArray;
+    fPadPlaneArray = 0;
+  }
+
 }
 
 //_____________________________________________________________________________
@@ -275,12 +281,253 @@ void AliTRDgeometry::Init()
     fRotB22[isect] = TMath::Cos(phi);
   }
 
+  // Initialize the SM status
   for (isect = 0; isect < fgkNsect; isect++) {
     SetSMstatus(isect,1);
   }
  
 }
 
+//_____________________________________________________________________________
+void AliTRDgeometry::CreatePadPlaneArray()
+{
+  //
+  // Creates the array of AliTRDpadPlane objects
+  //
+
+  if (fPadPlaneArray) {
+    fPadPlaneArray->Delete();
+    delete fPadPlaneArray;
+  }
+
+  fPadPlaneArray = new TObjArray(fgkNplan * fgkNcham);  
+  for (Int_t iplan = 0; iplan < fgkNplan; iplan++) {
+    for (Int_t icham = 0; icham < fgkNcham; icham++) {
+      Int_t ipp = GetDetectorSec(iplan,icham);
+      fPadPlaneArray->AddAt(CreatePadPlane(iplan,icham),ipp);
+    }
+  }
+
+}
+
+//_____________________________________________________________________________
+AliTRDpadPlane *AliTRDgeometry::CreatePadPlane(Int_t iplan, Int_t icham)
+{
+  //
+  // Creates an AliTRDpadPlane object
+  //
+
+  AliTRDpadPlane *padPlane = new AliTRDpadPlane();
+
+  padPlane->SetPlane(iplan);
+  padPlane->SetChamber(icham);
+
+  padPlane->SetRowSpacing(0.0);
+  padPlane->SetColSpacing(0.0);
+
+  padPlane->SetLengthRim(1.0);
+  padPlane->SetWidthRim(0.5);
+
+  padPlane->SetNcols(144);
+
+  //
+  // The pad plane parameter
+  //
+  switch (iplan) {
+  case 0:
+    if (icham == 2) {
+      // L0C0 type
+      padPlane->SetNrows(12);
+      padPlane->SetLength(108.0);
+      padPlane->SetWidth(92.2);
+      padPlane->SetLengthOPad(8.0);
+      padPlane->SetWidthOPad(0.515);
+      padPlane->SetLengthIPad(9.0);
+      padPlane->SetWidthIPad(0.635);
+      padPlane->SetTiltingAngle(-2.0);
+    }
+    else {
+      // L0C1 type
+      padPlane->SetNrows(16);
+      padPlane->SetLength(122.0);
+      padPlane->SetWidth(92.2);
+      padPlane->SetLengthOPad(7.5);
+      padPlane->SetWidthOPad(0.515);
+      padPlane->SetLengthIPad(7.5);
+      padPlane->SetWidthIPad(0.635);
+      padPlane->SetTiltingAngle(-2.0);
+    }
+    break;
+  case 1:
+    if (icham == 2) {
+      // L1C0 type
+      padPlane->SetNrows(12);
+      padPlane->SetLength(108.0);
+      padPlane->SetWidth(96.6);
+      padPlane->SetLengthOPad(8.0);
+      padPlane->SetWidthOPad(0.585);
+      padPlane->SetLengthIPad(9.0);
+      padPlane->SetWidthIPad(0.665);
+      padPlane->SetTiltingAngle(2.0);
+    }
+    else {
+      // L1C1 type
+      padPlane->SetNrows(16);
+      padPlane->SetLength(122.0);
+      padPlane->SetWidth(96.6);
+      padPlane->SetLengthOPad(7.5);
+      padPlane->SetWidthOPad(0.585);
+      padPlane->SetLengthIPad(7.5);
+      padPlane->SetWidthIPad(0.665);
+      padPlane->SetTiltingAngle(2.0);
+    }
+    break;
+  case 2:
+    if (icham == 2) {
+      // L2C0 type
+      padPlane->SetNrows(12);
+      padPlane->SetLength(108.0);
+      padPlane->SetWidth(101.1);
+      padPlane->SetLengthOPad(8.0);
+      padPlane->SetWidthOPad(0.705);
+      padPlane->SetLengthIPad(9.0);
+      padPlane->SetWidthIPad(0.695);
+      padPlane->SetTiltingAngle(-2.0);
+    }
+    else {
+      // L2C1 type
+      padPlane->SetNrows(16);
+      padPlane->SetLength(129.0);
+      padPlane->SetWidth(101.1);
+      padPlane->SetLengthOPad(7.5);
+      padPlane->SetWidthOPad(0.705);
+      padPlane->SetLengthIPad(8.0);
+      padPlane->SetWidthIPad(0.695);
+      padPlane->SetTiltingAngle(-2.0);
+    }
+    break;
+  case 3:
+    if (icham == 2) {
+      // L3C0 type
+      padPlane->SetNrows(12);
+      padPlane->SetLength(108.0);
+      padPlane->SetWidth(105.5);
+      padPlane->SetLengthOPad(8.0);
+      padPlane->SetWidthOPad(0.775);
+      padPlane->SetLengthIPad(9.0);
+      padPlane->SetWidthIPad(0.725);
+      padPlane->SetTiltingAngle(2.0);
+    }
+    else {
+      // L3C1 type
+      padPlane->SetNrows(16);
+      padPlane->SetLength(136.0);
+      padPlane->SetWidth(105.5);
+      padPlane->SetLengthOPad(7.5);
+      padPlane->SetWidthOPad(0.775);
+      padPlane->SetLengthIPad(8.5);
+      padPlane->SetWidthIPad(0.725);
+      padPlane->SetTiltingAngle(2.0);
+    }
+    break;
+  case 4:
+    if (icham == 2) {
+      // L4C0 type
+      padPlane->SetNrows(12);
+      padPlane->SetLength(108.0);
+      padPlane->SetWidth(109.9);
+      padPlane->SetLengthOPad(8.0);
+      padPlane->SetWidthOPad(0.845);
+      padPlane->SetLengthIPad(9.0);
+      padPlane->SetWidthIPad(0.755);
+      padPlane->SetTiltingAngle(-2.0);
+    }
+    else {
+      // L4C1 type
+      padPlane->SetNrows(16);
+      padPlane->SetLength(143.0);
+      padPlane->SetWidth(109.9);
+      padPlane->SetLengthOPad(7.5);
+      padPlane->SetWidthOPad(0.845);
+      padPlane->SetLengthIPad(9.0);
+      padPlane->SetWidthIPad(0.755);
+      padPlane->SetTiltingAngle(-2.0);
+    }
+    break;
+  case 5:
+    if (icham == 2) {
+      // L5C0 type
+      padPlane->SetNrows(12);
+      padPlane->SetLength(108.0);
+      padPlane->SetWidth(114.4);
+      padPlane->SetLengthOPad(8.0);
+      padPlane->SetWidthOPad(0.965);
+      padPlane->SetLengthIPad(9.0);
+      padPlane->SetWidthIPad(0.785);
+      padPlane->SetTiltingAngle(2.0);
+    }
+    else {
+      // L5C1 type
+      padPlane->SetNrows(16);
+      padPlane->SetLength(145.0);
+      padPlane->SetWidth(114.4);
+      padPlane->SetLengthOPad(8.5);
+      padPlane->SetWidthOPad(0.965);
+      padPlane->SetLengthIPad(9.0);
+      padPlane->SetWidthIPad(0.785);
+      padPlane->SetTiltingAngle(2.0);
+    }
+    break;
+  };
+
+  //
+  // The positions of the borders of the pads
+  //
+  // Row direction
+  //
+  Double_t row = fClength[iplan][icham] / 2.0
+               - fgkRpadW
+               - padPlane->GetLengthRim();
+  for (Int_t ir = 0; ir < padPlane->GetNrows(); ir++) {
+    padPlane->SetPadRow(ir,row);
+    row -= padPlane->GetRowSpacing();
+    if (ir == 0) {
+      row -= padPlane->GetLengthOPad();
+    }
+    else {
+      row -= padPlane->GetLengthIPad();
+    }
+  }
+  //
+  // Column direction
+  //
+  Double_t col = fCwidth[iplan] / 2.0
+               + fgkCroW
+               - padPlane->GetWidthRim();
+  for (Int_t ic = 0; ic < padPlane->GetNcols(); ic++) {
+    padPlane->SetPadCol(ic,col);
+    col -= padPlane->GetColSpacing();
+    if (ic == 0) {
+      col -= padPlane->GetWidthOPad();
+    }
+    else {
+      col -= padPlane->GetWidthIPad();
+    }
+  }
+  // Calculate the offset to translate from the local ROC system into
+  // the local supermodule system, which is used for clusters
+  Double_t rowTmp = fClength[iplan][0]
+                 + fClength[iplan][1]
+                  + fClength[iplan][2] / 2.0;
+  for (Int_t ic = 0; ic < icham; ic++) {
+    rowTmp -= fClength[iplan][ic];
+  }
+  padPlane->SetPadRowSMOffset(rowTmp - fClength[iplan][icham]/2.0);
+
+  return padPlane;
+
+}
+
 //_____________________________________________________________________________
 void AliTRDgeometry::CreateGeometry(Int_t *idtmed)
 {
@@ -937,12 +1184,6 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed)
   gMC->Matrix(matrix[1],  80.0,   0.0,  90.0,  90.0,  10.0, 180.0);
   gMC->Matrix(matrix[2],   0.0,   0.0,  90.0,  90.0,  90.0,   0.0);
   gMC->Matrix(matrix[3], 180.0,   0.0,  90.0,  90.0,  90.0, 180.0);
-
-  AliTRDCommonParam *commonParam = AliTRDCommonParam::Instance();
-  if (!commonParam) {
-    AliError("Could not get common parameters\n");
-    return;
-  }
     
   //
   // The cooling arterias
@@ -1090,7 +1331,7 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed)
     for (iplan = 0; iplan < kNplan; iplan++) {
       Int_t   iDet    = GetDetectorSec(iplan,icham);
       Int_t   iCopy   = GetDetector(iplan,icham,0) * 100;
-      Int_t   nMCMrow = commonParam->GetRowMax(iplan,icham,0);
+      Int_t   nMCMrow = GetRowMax(iplan,icham,0);
       Float_t ySize   = (GetChamberLength(iplan,icham) - 2.0*fgkRpadW) 
                       / ((Float_t) nMCMrow);
       sprintf(cTagV,"UU%02d",iDet);
@@ -1123,7 +1364,7 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed)
     for (iplan = 0; iplan < kNplan; iplan++) {
       Int_t   iDet    = GetDetectorSec(iplan,icham);
       Int_t   iCopy   = GetDetector(iplan,icham,0) * 100;
-      Int_t   nMCMrow = commonParam->GetRowMax(iplan,icham,0);
+      Int_t   nMCMrow = GetRowMax(iplan,icham,0);
       Float_t ySize   = (GetChamberLength(iplan,icham) - 2.0*fgkRpadW) 
                       / ((Float_t) nMCMrow);
       sprintf(cTagV,"UU%02d",iDet);
@@ -1200,7 +1441,7 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed)
     for (iplan = 0; iplan < kNplan; iplan++) {
       Int_t   iDet    = GetDetectorSec(iplan,icham);
       Int_t   iCopy   = GetDetector(iplan,icham,0) * 1000;
-      Int_t   nMCMrow = commonParam->GetRowMax(iplan,icham,0);
+      Int_t   nMCMrow = GetRowMax(iplan,icham,0);
       Float_t ySize   = (GetChamberLength(iplan,icham) - 2.0*fgkRpadW) 
                       / ((Float_t) nMCMrow);
       Int_t   nMCMcol = 8;
@@ -1397,23 +1638,82 @@ Int_t AliTRDgeometry::GetSector(Int_t d) const
 
 }
 
-//CL
 //_____________________________________________________________________________
-Int_t AliTRDgeometry::GetPadRowFromMCM(Int_t irob, Int_t imcm) const
+AliTRDpadPlane *AliTRDgeometry::GetPadPlane(Int_t p, Int_t c)
 {
+  //
+  // Returns the pad plane for a given plane <p> and chamber <c> number
+  //
 
-  // return on which row this mcm sits 
+  if (!fPadPlaneArray) {
+    CreatePadPlaneArray();
+  }
+
+  Int_t ipp = GetDetectorSec(p,c);
+  return ((AliTRDpadPlane *) fPadPlaneArray->At(ipp));
+
+}
+
+//_____________________________________________________________________________
+Int_t AliTRDgeometry::GetRowMax(Int_t p, Int_t c, Int_t /*s*/)
+{
+  //
+  // Returns the number of rows on the pad plane
+  //
+
+  return GetPadPlane(p,c)->GetNrows();
+
+}
+
+//_____________________________________________________________________________
+Int_t AliTRDgeometry::GetColMax(Int_t p)
+{
+  //
+  // Returns the number of rows on the pad plane
+  //
+
+  return GetPadPlane(p,0)->GetNcols();
+
+}
+
+//_____________________________________________________________________________
+Double_t AliTRDgeometry::GetRow0(Int_t p, Int_t c, Int_t /*s*/)
+{
+  //
+  // Returns the position of the border of the first pad in a row
+  //
+
+  return GetPadPlane(p,c)->GetRow0();
+
+}
+
+//_____________________________________________________________________________
+Double_t AliTRDgeometry::GetCol0(Int_t p)
+{
+  //
+  // Returns the position of the border of the first pad in a column
+  //
+
+  return GetPadPlane(p,0)->GetCol0();
+
+}
+
+//_____________________________________________________________________________
+Int_t AliTRDgeometry::GetPadRowFromMCM(Int_t irob, Int_t imcm) const
+{
+  //
+  // Return on which row this mcm sits 
+  //
 
   return fgkMCMrow*(irob/2) + imcm/fgkMCMrow;
 
-;
 }
 
 //_____________________________________________________________________________
 Int_t AliTRDgeometry::GetPadColFromADC(Int_t irob, Int_t imcm, Int_t iadc) const
 {
   //
-  // return which pad is connected to this adc channel. return -1 if it
+  // Return which pad is connected to this adc channel. return -1 if it
   // is one of the not directly connected adc channels (0, 1 20)
   //
 
@@ -1426,8 +1726,9 @@ Int_t AliTRDgeometry::GetPadColFromADC(Int_t irob, Int_t imcm, Int_t iadc) const
 //_____________________________________________________________________________
 Int_t AliTRDgeometry::GetMCMfromPad(Int_t irow, Int_t icol) const
 {
-
-  // return on which mcm this pad is
+  //
+  // Return on which mcm this pad is
+  //
 
   if ( irow < 0 || icol < 0 || irow > fgkRowmaxC1 || icol > fgkColmax ) return -1;
 
@@ -1438,8 +1739,9 @@ Int_t AliTRDgeometry::GetMCMfromPad(Int_t irow, Int_t icol) const
 //_____________________________________________________________________________
 Int_t AliTRDgeometry::GetROBfromPad(Int_t irow, Int_t icol) const
 {
-
-  // return on which rob this pad is
+  //
+  // Return on which rob this pad is
+  //
 
   return (irow/fgkMCMrow)*2 + GetColSide(icol);
 
@@ -1448,8 +1750,9 @@ Int_t AliTRDgeometry::GetROBfromPad(Int_t irow, Int_t icol) const
 //_____________________________________________________________________________
 Int_t AliTRDgeometry::GetRobSide(Int_t irob) const
 {
-
-  // return on which side this rob sits (A side = 0, B side = 1)
+  //
+  // Return on which side this rob sits (A side = 0, B side = 1)
+  //
 
   if ( irob < 0 || irob >= fgkROBmaxC1 ) return -1;
 
@@ -1459,51 +1762,14 @@ Int_t AliTRDgeometry::GetRobSide(Int_t irob) const
 
 //_____________________________________________________________________________
 Int_t AliTRDgeometry::GetColSide(Int_t icol) const
-{
-
-  // return on which side this column sits (A side = 0, B side = 1)
-
-  if ( icol < 0 || icol >= fgkColmax ) return -1;
-
-  return icol/(fgkColmax/2);
-
-}
-
-//_____________________________________________________________________________
-AliTRDgeometry *AliTRDgeometry::GetGeometry(AliRunLoader *runLoader)
 {
   //
-  // Load the geometry from the galice file
+  // Return on which side this column sits (A side = 0, B side = 1)
   //
 
-  if (!runLoader) {
-    runLoader = AliRunLoader::GetRunLoader();
-  }
-  if (!runLoader) {
-    AliErrorGeneral("AliTRDgeometry::GetGeometry","No run loader");
-    return NULL;
-  }
-
-  TDirectory *saveDir = gDirectory;
-  runLoader->CdGAFile();
-
-  // Try from the galice.root file
-  static AliTRDgeometry *geom = (AliTRDgeometry *) gDirectory->Get("TRDgeometry");
-
-  if (!geom) {
-    // If it is not in the file, try to get it from the run loader 
-    if (runLoader->GetAliRun()) {
-      AliTRD *trd = (AliTRD *) runLoader->GetAliRun()->GetDetector("TRD");
-      geom = trd->GetGeometry();
-    }
-  }
-  if (!geom) {
-    AliErrorGeneral("AliTRDgeometry::GetGeometry","Geometry not found");
-    return NULL;
-  }
+  if ( icol < 0 || icol >= fgkColmax ) return -1;
 
-  saveDir->cd();
-  return geom;
+  return icol/(fgkColmax/2);
 
 }
 
index 2b98b1862f73d0b08dc23544aba06826784d52ac..2c6e6260c6191e1f210e7c76cac1f8d6d4ef25ad 100644 (file)
 
 #include "TObjArray.h"
 
-class AliRunLoader;
 class TGeoHMatrix;
 
+class AliRunLoader;
+
+class AliTRDpadPlane;
+
 class AliTRDgeometry : public AliGeometry {
 
  public:
@@ -49,14 +52,20 @@ class AliTRDgeometry : public AliGeometry {
 
           void     SetSMstatus(Int_t sm, Char_t status)                { fSMstatus[sm] = status; }
 
-  static  AliTRDgeometry* GetGeometry(AliRunLoader *runLoader = NULL);
-  
   static  Int_t    GetDetectorSec(Int_t p, Int_t c);
   static  Int_t    GetDetector(Int_t p, Int_t c, Int_t s);
   virtual Int_t    GetPlane(Int_t d) const;
   virtual Int_t    GetChamber(Int_t d) const;
   virtual Int_t    GetSector(Int_t d) const;
 
+          void     CreatePadPlaneArray();
+  AliTRDpadPlane  *CreatePadPlane(Int_t p, Int_t c);
+  AliTRDpadPlane  *GetPadPlane(Int_t p, Int_t c);
+          Int_t    GetRowMax(Int_t p, Int_t c, Int_t /*s*/);
+          Int_t    GetColMax(Int_t p);
+          Double_t GetRow0(Int_t p, Int_t c, Int_t /*s*/);
+          Double_t GetCol0(Int_t p);
+
   // Translation from MCM to Pad and vice versa
   virtual Int_t    GetPadRowFromMCM(Int_t irob, Int_t imcm) const;
   virtual Int_t    GetPadColFromADC(Int_t irob, Int_t imcm, Int_t iadc) const;
@@ -217,7 +226,9 @@ class AliTRDgeometry : public AliGeometry {
   TObjArray            *fMatrixCorrectionArray;              //! Transformation Cluster to  Tracking systerm
   TObjArray            *fMatrixGeo;                          //! Geo matrices
 
-  ClassDef(AliTRDgeometry,13)                                //  TRD geometry class
+  TObjArray            *fPadPlaneArray;                      //! Array of pad plane objects
+
+  ClassDef(AliTRDgeometry,14)                                //  TRD geometry class
 
 };
 
index 481c81e95c98195eef76f29928a44078d4490c37..e51c0ca5e63e83faeeff117e6317a48a88c7d718 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.4  2006/08/28 17:12:18  cblume
+Remove the last print statements
+
 Revision 1.3  2006/08/11 17:58:05  cblume
 Next round of effc++ changes
 
@@ -60,7 +63,6 @@ ClassImp(AliTRDmcm)
 //_____________________________________________________________________________
 AliTRDmcm::AliTRDmcm() 
   :TObject()
-  ,fTrigParam(0)
   ,fNtrk(0)
   ,fRobId(0)
   ,fChaId(0)
@@ -101,19 +103,18 @@ AliTRDmcm::AliTRDmcm()
 }
 
 //_____________________________________________________________________________
-AliTRDmcm::AliTRDmcm(AliTRDtrigParam *trigp, const Int_t id) 
+AliTRDmcm::AliTRDmcm(const Int_t id) 
   :TObject()
-  ,fTrigParam(trigp)
   ,fNtrk(0)
   ,fRobId(0)
   ,fChaId(0)
   ,fRow(0)
   ,fColFirst(0)
   ,fColLast(0)
-  ,fTime1(trigp->GetTime1())
-  ,fTime2(trigp->GetTime2())
-  ,fClusThr(trigp->GetClusThr())
-  ,fPadThr(trigp->GetPadThr())
+  ,fTime1(0)
+  ,fTime2(0)
+  ,fClusThr(0)
+  ,fPadThr(0)
   ,fNtrkSeeds(0)
   ,fR1(0)
   ,fR2(0)
@@ -140,15 +141,19 @@ AliTRDmcm::AliTRDmcm(AliTRDtrigParam *trigp, const Int_t id)
       fIsClus[i][j] = kFALSE;
     }
   }
+
+  fTime1   = AliTRDtrigParam::Instance()->GetTime1();
+  fTime2   = AliTRDtrigParam::Instance()->GetTime2();
+  fClusThr = AliTRDtrigParam::Instance()->GetClusThr();
+  fPadThr  = AliTRDtrigParam::Instance()->GetPadThr();
   
-  fTrigParam->GetFilterParam(fR1,fR2,fC1,fC2,fPedestal);
+  AliTRDtrigParam::Instance()->GetFilterParam(fR1,fR2,fC1,fC2,fPedestal);
 
 }
 
 //_____________________________________________________________________________
 AliTRDmcm::AliTRDmcm(const AliTRDmcm &m) 
   :TObject(m)
-  ,fTrigParam(NULL)
   ,fNtrk(m.fNtrk)
   ,fRobId(m.fRobId)
   ,fChaId(m.fChaId)
@@ -220,7 +225,6 @@ void AliTRDmcm::Copy(TObject &m) const
   Int_t i = 0;
   Int_t j = 0;
 
-  ((AliTRDmcm &) m).fTrigParam  = NULL;
   ((AliTRDmcm &) m).fNtrk       = fNtrk;
   ((AliTRDmcm &) m).fRobId      = fRobId;
   ((AliTRDmcm &) m).fChaId      = fChaId;
@@ -301,7 +305,6 @@ Bool_t AliTRDmcm::Run()
 
   Int_t   iTime = 0;
   Int_t   iCol  = 0;
-  Int_t   iPad  = 0;
   Int_t   iPlus = 0;
   Int_t   i     = 0;
   Int_t   j     = 0;
@@ -395,8 +398,8 @@ Int_t AliTRDmcm::CreateSeeds()
     }
   }
 
-  Int_t sum10 = fTrigParam->GetSum10();
-  Int_t sum12 = fTrigParam->GetSum12();
+  Int_t sum10 = AliTRDtrigParam::Instance()->GetSum10();
+  Int_t sum12 = AliTRDtrigParam::Instance()->GetSum12();
 
   // Build the 2padSum
   Int_t nsum2seed = 0;
@@ -440,15 +443,11 @@ Int_t AliTRDmcm::CreateSeeds()
     if ((fHit2padSum[0][i]+1) == fHit2padSum[0][i+1]) {
       nSeeds--;
       if (fHit2padSum[1][i] >= fHit2padSum[1][i+1]) {
-       if (fTrigParam->GetDebugLevel() > 1) {
-         AliWarning(Form("Reject seed %1d in col %02d. \n",i,fHit2padSum[0][i+1]));
-       }
+       AliDebug(2,Form("Reject seed %1d in col %02d. \n",i,fHit2padSum[0][i+1]));
        fSeedCol[i+1] = -1;
       } 
       else {
-       if (fTrigParam->GetDebugLevel() > 1) {
-         AliWarning(Form("Reject seed %1d in col %02d. \n",i,fHit2padSum[0][i]));
-       }
+       AliDebug(2,Form("Reject seed %1d in col %02d. \n",i,fHit2padSum[0][i]));
        fSeedCol[i]   = -1;
       }
     }
index 0b47a330319d744646881b75b39969118450fac5..4c0aff422c9bddb7ce470ffd2af0965a46cc6be9 100644 (file)
@@ -13,8 +13,6 @@
 
 #include <TObject.h>
 
-class AliTRDtrigParam;
-
 class AliTRDmcm : public TObject {
 
  public:
@@ -23,7 +21,7 @@ class AliTRDmcm : public TObject {
 
   AliTRDmcm();
   AliTRDmcm(const AliTRDmcm &m);
-  AliTRDmcm(AliTRDtrigParam *trigp, Int_t id);
+  AliTRDmcm(Int_t id);
   virtual         ~AliTRDmcm();
   AliTRDmcm       &operator=(const AliTRDmcm &m);
 
@@ -67,8 +65,6 @@ class AliTRDmcm : public TObject {
 
  protected:
 
-  AliTRDtrigParam *fTrigParam;                         //! Pointer to the trigger parameters class
-
           Int_t    fNtrk;                              //  Number of found tracklets
           Int_t    fTrkIndex[kMaxTrackletsPerMCM];     //  Index of found tracklets
           Int_t    fRobId;                             //  ROB id
@@ -94,7 +90,7 @@ class AliTRDmcm : public TObject {
 
           Int_t    fId;                                //  Dummy id
  
-  ClassDef(AliTRDmcm,2)                                //  TRD MCM class
+  ClassDef(AliTRDmcm,3)                                //  TRD MCM class
 
 };
 
index 3b269e2f4c137b90285f01a4019e205c70c5eb27..e895ebcfe0c20f8f9ba7cff12511e4f25e7b65dd 100644 (file)
@@ -38,6 +38,7 @@ ClassImp(AliTRDmcmTracklet)
 //_____________________________________________________________________________
 AliTRDmcmTracklet::AliTRDmcmTracklet() 
   :TObject()
+  ,fGeo(0)
   ,fDetector(-1)
   ,fRow(-1)
   ,fTrackLabel(-1)
@@ -67,11 +68,14 @@ AliTRDmcmTracklet::AliTRDmcmTracklet()
     fCol[time]    = 0;
   }
 
+  fGeo = new AliTRDgeometry();
+
 }
 
 //_____________________________________________________________________________
 AliTRDmcmTracklet::AliTRDmcmTracklet(Int_t det, Int_t row, Int_t n) 
   :TObject()
+  ,fGeo(0)
   ,fDetector(det)
   ,fRow(row)
   ,fTrackLabel(-1)
@@ -104,11 +108,14 @@ AliTRDmcmTracklet::AliTRDmcmTracklet(Int_t det, Int_t row, Int_t n)
   fGPos = new TGraph(0);
   fGAmp = new TGraph(0);
 
+  fGeo  = new AliTRDgeometry();
+
 }
 
 //_____________________________________________________________________________
 AliTRDmcmTracklet::AliTRDmcmTracklet(const AliTRDmcmTracklet &t) 
   :TObject(t)
+  ,fGeo(0)
   ,fDetector(t.fDetector)
   ,fRow(t.fRow)
   ,fTrackLabel(t.fTrackLabel)
@@ -138,6 +145,11 @@ AliTRDmcmTracklet::AliTRDmcmTracklet(const AliTRDmcmTracklet &t)
     ((AliTRDmcmTracklet &) t).fCol[time]    = 0;
   }
 
+  if (fGeo) {
+    delete fGeo;
+  }
+  fGeo = new AliTRDgeometry();
+
 }
 
 //_____________________________________________________________________________
@@ -150,6 +162,10 @@ AliTRDmcmTracklet::~AliTRDmcmTracklet()
   if (fGPos != 0) delete fGPos;
   if (fGAmp != 0) delete fGAmp;
 
+  if (fGeo) {
+    delete fGeo;
+  }
+
 }
 
 //_____________________________________________________________________________
@@ -270,8 +286,7 @@ void AliTRDmcmTracklet::MakeTrackletGraph(AliTRDgeometry *geo, Float_t field)
     return;
   }
   
-  AliTRDCommonParam* commonParam = AliTRDCommonParam::Instance();
-  if (!commonParam) {
+  if (!AliTRDCommonParam::Instance()) {
     AliError("No common parameters.");
     return;
   }
@@ -287,9 +302,9 @@ void AliTRDmcmTracklet::MakeTrackletGraph(AliTRDgeometry *geo, Float_t field)
   iplan = geo->GetPlane(fDetector);
   icham = geo->GetChamber(fDetector);
 
-  AliTRDpadPlane *padPlane = commonParam->GetPadPlane(iplan,icham);
+  AliTRDpadPlane *padPlane = fGeo->GetPadPlane(iplan,icham);
 
-  Float_t samplFreq = commonParam->GetSamplingFrequency();
+  Float_t samplFreq = AliTRDCommonParam::Instance()->GetSamplingFrequency();
 
   Int_t time, col;
   Float_t amp[3];
index 416cd3037174d6a9a7244932d3feaec6f5e72540..7292ab41061cc8318526c6c4e3fd234bc8084b93 100644 (file)
@@ -59,6 +59,8 @@ class AliTRDmcmTracklet : public TObject {
   Int_t     GetClusterCol(Int_t icl)  const { return fCol[icl];   };
 
  protected:
+  // Geometry
+  AliTRDgeometry  *fGeo;                 //! The TRD geometry
 
   Int_t   fDetector;                     //  TRD detector number (0 ... 539)
   Int_t   fRow;                          //  Row number in the detector
@@ -81,7 +83,7 @@ class AliTRDmcmTracklet : public TObject {
   Float_t fPt;                           //  Transverse momentum
   Float_t fdQdl;                         //  Charge per unit length
 
-  ClassDef(AliTRDmcmTracklet,2)          //  Track segment for the TRD (Tracklet)
+  ClassDef(AliTRDmcmTracklet,3)          //  Track segment for the TRD (Tracklet)
 
 };
 
index 477dadecbeec4c3b657bdd3964eb417c6addba53..b2ed6c0b896873e616007b2cc9a404992f6713eb 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <TObject.h>
 
+#include "AliRun.h"
 #include "AliLog.h"
 
 #include "AliTRDgeometry.h"
@@ -36,11 +37,11 @@ ClassImp(AliTRDmodule)
 
 //_____________________________________________________________________________
 AliTRDmodule::AliTRDmodule()
-  :TObject() 
+  :TObject()
   ,fXprojPlane(0)
   ,fField(0)
-  ,fTracklets(NULL)
-  ,fTracks(NULL)
+  ,fTracklets(new TObjArray(400))
+  ,fTracks(new TObjArray(400))
   ,fDeltaY(0)
   ,fDeltaS(0)
   ,fLTUtrk(0)
@@ -50,23 +51,15 @@ AliTRDmodule::AliTRDmodule()
   // AliTRDmodule default constructor
   //
 
-}
+  fXprojPlane = AliTRDtrigParam::Instance()->GetXprojPlane();
+  fDeltaY     = AliTRDtrigParam::Instance()->GetDeltaY();
+  fDeltaS     = AliTRDtrigParam::Instance()->GetDeltaS();
 
-//_____________________________________________________________________________
-AliTRDmodule::AliTRDmodule(AliTRDtrigParam *trigp) 
-  :TObject()
-  ,fXprojPlane(trigp->GetXprojPlane())
-  ,fField(trigp->GetField())
-  ,fTracklets(new TObjArray(400))
-  ,fTracks(new TObjArray(400))
-  ,fDeltaY(trigp->GetDeltaY())
-  ,fDeltaS(trigp->GetDeltaS())
-  ,fLTUtrk(0)
-  ,fGTUtrk(0)
-{
-  //
-  // AliTRDmodule constructor
-  //
+  // The magnetic field strength
+  Double_t x[3] = { 0.0, 0.0, 0.0 };
+  Double_t b[3];
+  gAlice->Field(x,b);  // b[] is in kilo Gauss
+  fField = b[2] * 0.1; // Tesla
 
   for (Int_t iPlan = 0; iPlan < AliTRDgeometry::Nplan(); iPlan++) {
     for (Int_t i = 0; i < kNsubZchan; i++) {
index 17ae3dacfc666b1206533db274dd564a8972c7c4..7c27b0e6f6a1e7812dafbed2e3bcdd38cae03957 100644 (file)
@@ -15,7 +15,6 @@
 
 class AliTRDgtuTrack;
 class AliTRDltuTracklet;
-class AliTRDtrigParam;
 
 class AliTRDmodule : public TObject {
 
@@ -25,7 +24,6 @@ class AliTRDmodule : public TObject {
 
   AliTRDmodule();
   AliTRDmodule(const AliTRDmodule &m);
-  AliTRDmodule(AliTRDtrigParam *trigp);
   virtual         ~AliTRDmodule();
   AliTRDmodule    &operator=(const AliTRDmodule &m);
 
index 23e40f01ecf86863cd027be55fda7a77eb18e8fd..11606597cde0cc587ff126fd5527bc5c83e68a21 100644 (file)
@@ -38,7 +38,6 @@ ClassImp(AliTRDpadPlane)
 //_____________________________________________________________________________
 AliTRDpadPlane::AliTRDpadPlane()
   :TObject()
-  ,fGeo(0)
   ,fPla(0)
   ,fCha(0)
   ,fLength(0)
@@ -65,254 +64,9 @@ AliTRDpadPlane::AliTRDpadPlane()
 
 }
 
-//_____________________________________________________________________________
-AliTRDpadPlane::AliTRDpadPlane(Int_t p, Int_t c)
-  :TObject()
-  ,fGeo(0)
-  ,fPla(0)
-  ,fCha(0)
-  ,fLength(0)
-  ,fWidth(0)
-  ,fLengthRim(0)
-  ,fWidthRim(0)
-  ,fLengthOPad(0)
-  ,fWidthOPad(0)
-  ,fLengthIPad(0)
-  ,fWidthIPad(0)
-  ,fRowSpacing(0)
-  ,fColSpacing(0)
-  ,fNrows(0)
-  ,fNcols(0)
-  ,fTiltingAngle(0)
-  ,fTiltingTan(0)
-  ,fPadRow(0)
-  ,fPadCol(0)
-  ,fPadRowSMOffset(0)
-{
-  //
-  // Constructor that initializes a given pad plane type
-  //
-
-  fGeo = new AliTRDgeometry();
-
-  fPla = p;
-  fCha = c;
-
-  fRowSpacing = 0.0;
-  fColSpacing = 0.0;
-
-  fLengthRim  = 1.0;
-  fWidthRim   = 0.5;
-
-  fNcols      = 144;
-
-  //
-  // The pad plane parameter
-  //
-  switch (p) {
-  case 0:
-    if (c == 2) {
-      // L0C0 type
-      fNrows        =  12;
-      fLength       = 108.0;
-      fWidth        =  92.2;
-      fLengthOPad   =   8.0;
-      fWidthOPad    =   0.515;
-      fLengthIPad   =   9.0;
-      fWidthIPad    =   0.635;
-      fTiltingAngle =  -2.0;
-    }
-    else {
-      // L0C1 type
-      fNrows        =  16;
-      fLength       = 122.0;
-      fWidth        =  92.2;
-      fLengthOPad   =   7.5;
-      fWidthOPad    =   0.515;
-      fLengthIPad   =   7.5;
-      fWidthIPad    =   0.635;
-      fTiltingAngle =  -2.0;
-    }
-    break;
-  case 1:
-    if (c == 2) {
-      // L1C0 type
-      fNrows        =  12;
-      fLength       = 108.0;
-      fWidth        =  96.6;
-      fLengthOPad   =   8.0;
-      fWidthOPad    =   0.585;
-      fLengthIPad   =   9.0;
-      fWidthIPad    =   0.665;
-      fTiltingAngle =   2.0;
-    }
-    else {
-      // L1C1 type
-      fNrows        =  16;
-      fLength       = 122.0;
-      fWidth        =  96.6;
-      fLengthOPad   =   7.5;
-      fWidthOPad    =   0.585;
-      fLengthIPad   =   7.5;
-      fWidthIPad    =   0.665;
-      fTiltingAngle =   2.0;
-    }
-    break;
-  case 2:
-    if (c == 2) {
-      // L2C0 type
-      fNrows        =  12;
-      fLength       = 108.0;
-      fWidth        = 101.1;
-      fLengthOPad   =   8.0;
-      fWidthOPad    =   0.705;
-      fLengthIPad   =   9.0;
-      fWidthIPad    =   0.695;
-      fTiltingAngle =  -2.0;
-    }
-    else {
-      // L2C1 type
-      fNrows        =  16;
-      fLength       = 129.0;
-      fWidth        = 101.1;
-      fLengthOPad   =   7.5;
-      fWidthOPad    =   0.705;
-      fLengthIPad   =   8.0;
-      fWidthIPad    =   0.695;
-      fTiltingAngle =  -2.0;
-    }
-    break;
-  case 3:
-    if (c == 2) {
-      // L3C0 type
-      fNrows        =  12;
-      fLength       = 108.0;
-      fWidth        = 105.5;
-      fLengthOPad   =   8.0;
-      fWidthOPad    =   0.775;
-      fLengthIPad   =   9.0;
-      fWidthIPad    =   0.725;
-      fTiltingAngle =   2.0;
-    }
-    else {
-      // L3C1 type
-      fNrows        =  16;
-      fLength       = 136.0;
-      fWidth        = 105.5;
-      fLengthOPad   =   7.5;
-      fWidthOPad    =   0.775;
-      fLengthIPad   =   8.5;
-      fWidthIPad    =   0.725;
-      fTiltingAngle =   2.0;
-    }
-    break;
-  case 4:
-    if (c == 2) {
-      // L4C0 type
-      fNrows        =  12;
-      fLength       = 108.0;
-      fWidth        = 109.9;
-      fLengthOPad   =   8.0;
-      fWidthOPad    =   0.845;
-      fLengthIPad   =   9.0;
-      fWidthIPad    =   0.755;
-      fTiltingAngle =  -2.0;
-    }
-    else {
-      // L4C1 type
-      fNrows        =  16;
-      fLength       = 143.0;
-      fWidth        = 109.9;
-      fLengthOPad   =   7.5;
-      fWidthOPad    =   0.845;
-      fLengthIPad   =   9.0;
-      fWidthIPad    =   0.755;
-      fTiltingAngle =  -2.0;
-    }
-    break;
-  case 5:
-    if (c == 2) {
-      // L5C0 type
-      fNrows        =  12;
-      fLength       = 108.0;
-      fWidth        = 114.4;
-      fLengthOPad   =   8.0;
-      fWidthOPad    =   0.965;
-      fLengthIPad   =   9.0;
-      fWidthIPad    =   0.785;
-      fTiltingAngle =   2.0;
-    }
-    else {
-      // L5C1 type
-      fNrows        =  16;
-      fLength       = 145.0;
-      fWidth        = 114.4;
-      fLengthOPad   =   8.5;
-      fWidthOPad    =   0.965;
-      fLengthIPad   =   9.0;
-      fWidthIPad    =   0.785;
-      fTiltingAngle =   2.0;
-    }
-    break;
-  };
-
-  //
-  // Store tilting angle as tangens
-  //
-  fTiltingTan = TMath::Tan(TMath::Pi()/180.0 * fTiltingAngle);
-
-  //
-  // The positions of the borders of the pads
-  //
-  // Row direction
-  //
-  fPadRow = new Double_t[fNrows];
-  Double_t row = fGeo->GetChamberLength(p,c) / 2.0
-               - fGeo->RpadW()
-               - fLengthRim;
-  for (Int_t ir = 0; ir < fNrows; ir++) {
-    fPadRow[ir] = row;
-    row -= fRowSpacing;
-    if (ir == 0) {
-      row -= fLengthOPad;
-    }
-    else {
-      row -= fLengthIPad;
-    }
-  }
-  //
-  // Column direction
-  //
-  fPadCol = new Double_t[fNcols];
-  Double_t col = fGeo->GetChamberWidth(p) / 2.0
-               + fGeo->CroWid()
-               - fWidthRim;
-  for (Int_t ic = 0; ic < fNcols; ic++) {
-    fPadCol[ic] = col;
-    col -= fColSpacing;
-    if (ic == 0) {
-      col -= fWidthOPad;
-    }
-    else {
-      col -= fWidthIPad;
-    }
-  }
-  // Calculate the offset to translate from the local ROC system into
-  // the local supermodule system, which is used for clusters
-  Double_t rowTmp = fGeo->GetChamberLength(p,0)
-                 + fGeo->GetChamberLength(p,1)
-                  + fGeo->GetChamberLength(p,2) / 2.0;
-  for (Int_t ic = 0; ic < c; ic++) {
-    rowTmp -= fGeo->GetChamberLength(p,ic);
-  }
-  fPadRowSMOffset = rowTmp - fGeo->GetChamberLength(p,c)/2.0;
-
-}
-
 //_____________________________________________________________________________
 AliTRDpadPlane::AliTRDpadPlane(const AliTRDpadPlane &p)
   :TObject(p)
-  ,fGeo(0)
   ,fPla(p.fPla)
   ,fCha(p.fCha)
   ,fLength(p.fLength)
@@ -364,11 +118,6 @@ AliTRDpadPlane::~AliTRDpadPlane()
   // AliTRDpadPlane destructor
   //
 
-  if (fGeo) {
-    delete fGeo;
-    fGeo    = 0;
-  }
-
   if (fPadRow) {
     delete [] fPadRow;
     fPadRow = 0;
@@ -405,8 +154,6 @@ void AliTRDpadPlane::Copy(TObject &p) const
 
   Int_t iBin = 0;
 
-  ((AliTRDpadPlane &) p).fGeo            = 0;
-
   ((AliTRDpadPlane &) p).fPla            = fPla;
   ((AliTRDpadPlane &) p).fCha            = fCha;
 
index 000166b3482d0f5dc840af5b882b88370f938647..b1e2aaf4c2072defc06c2dcfc0784e42f9e81d49 100644 (file)
@@ -3,7 +3,7 @@
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
-/* $Id: AliTRDpadPlane.h,v */
+/* $Id$ */
 
 //////////////////////////////////////////////////
 //                                              //
 
 #include <TObject.h>
 
-class AliTRDgeometry;
-
 //_____________________________________________________________________________
 class AliTRDpadPlane : public TObject {
 
  public:
 
   AliTRDpadPlane();
-  AliTRDpadPlane(Int_t p, Int_t c);
   AliTRDpadPlane(const AliTRDpadPlane &p);
   virtual           ~AliTRDpadPlane();
   AliTRDpadPlane    &operator=(const AliTRDpadPlane &p);
   virtual void       Copy(TObject &p) const;
 
+  void     SetPlane(Int_t p)                   { fPla            = p; };
+  void     SetChamber(Int_t c)                 { fCha            = c; };
+  void     SetRowSpacing(Double_t s)           { fRowSpacing     = s; };
+  void     SetColSpacing(Double_t s)           { fColSpacing     = s; };
+  void     SetLengthRim(Double_t l)            { fLengthRim      = l; };
+  void     SetWidthRim(Double_t w)             { fWidthRim       = w; };
+  void     SetNcols(Int_t n)                   { fNcols          = n;
+                                                 if (fPadCol) delete[] fPadCol;
+                                                 fPadCol         = new Double_t[fNcols]; };
+  void     SetNrows(Int_t n)                   { fNrows          = n;
+                                                 if (fPadRow) delete[] fPadRow;
+                                                 fPadRow         = new Double_t[fNrows]; };
+  void     SetPadCol(Int_t ic, Double_t c)     { if (ic < fNcols) fPadCol[ic] = c;       };
+  void     SetPadRow(Int_t ir, Double_t r)     { if (ir < fNrows) fPadRow[ir] = r;       };
+  void     SetLength(Double_t l)               { fLength         = l; };
+  void     SetWidth(Double_t w)                { fWidth          = w; };
+  void     SetLengthOPad(Double_t l)           { fLengthOPad     = l; };
+  void     SetWidthOPad(Double_t w)            { fWidthOPad      = w; };
+  void     SetLengthIPad(Double_t l)           { fLengthIPad     = l; };
+  void     SetWidthIPad(Double_t w)            { fWidthIPad      = w; };
+  void     SetTiltingAngle(Double_t t)         { fTiltingAngle   = t; 
+                                                 fTiltingTan     = TMath::Tan(TMath::Pi()/180.0 * fTiltingAngle); };
+  void     SetPadRowSMOffset(Double_t o)       { fPadRowSMOffset = o; };
+
   Int_t    GetPadRowNumber(Double_t z) const;
   Int_t    GetPadRowNumberROC(Double_t z) const;
   Int_t    GetPadColNumber(Double_t rphi) const;
@@ -81,11 +102,20 @@ class AliTRDpadPlane : public TObject {
                                                  return fWidthOPad;
                                                else
                                                   return fWidthIPad; };
+
   Double_t GetLengthRim() const              { return fLengthRim;    };
+  Double_t GetWidthRim() const               { return fWidthRim;     };
 
- protected:
+  Double_t GetRowSpacing() const             { return fRowSpacing;   };
+  Double_t GetColSpacing() const             { return fColSpacing;   };
 
-  AliTRDgeometry *fGeo;       //! TRD geometry       
+  Double_t GetLengthOPad() const             { return fLengthOPad;   };
+  Double_t GetLengthIPad() const             { return fLengthIPad;   };
+
+  Double_t GetWidthOPad() const              { return fWidthOPad;    };
+  Double_t GetWidthIPad() const              { return fWidthIPad;    };
+
+ protected:
 
   Int_t     fPla;             //  Plane number
   Int_t     fCha;             //  Chamber number
@@ -111,12 +141,12 @@ class AliTRDpadPlane : public TObject {
   Double_t  fTiltingAngle;    //  Pad tilting angle  
   Double_t  fTiltingTan;      //  Tangens of pad tilting angle
 
-  Double_t *fPadRow;          //! Pad border positions in row direction
-  Double_t *fPadCol;          //! Pad border positions in column direction
+  Double_t *fPadRow;          //  Pad border positions in row direction
+  Double_t *fPadCol;          //  Pad border positions in column direction
 
   Double_t  fPadRowSMOffset;  //  To be added to translate local ROC system to local SM system
 
-  ClassDef(AliTRDpadPlane,3)  //  TRD ROC pad plane
+  ClassDef(AliTRDpadPlane,4)  //  TRD ROC pad plane
 
 };
 
index 52d1aa7b28eaf7cde3fd6ad973e4a3600634f763..fb255d892189b02e4048f70d1aa116a988e114e6 100644 (file)
@@ -220,16 +220,9 @@ Bool_t AliTRDpidESD::GetTrackSegmentKine(AliESDtrack *t, Int_t plan, Float_t &mo
        }
        
        // Retrieve TRD geometry -> Maybe there is a better way to do this
-       Bool_t kSelfGeom = kFALSE;
-       AliTRDgeometry *TRDgeom =0x0;
-       if(gAlice) TRDgeom = AliTRDgeometry::GetGeometry(gAlice->GetRunLoader());
-       if(!TRDgeom){
-               AliWarningGeneral("AliTRDpidESD::GetTrackSegmentKine()", "Cannot load TRD geometry from gAlice! Build a new one.\n");
-               TRDgeom = new AliTRDgeometry();
-               kSelfGeom = kTRUE;
-       }
+       AliTRDgeometry trdGeom;
        const Float_t kAmHalfWidth = AliTRDgeometry::AmThick() / 2.;
-  const Float_t kDrWidth = AliTRDgeometry::DrThick();
+        const Float_t kDrWidth     = AliTRDgeometry::DrThick();
        
 
        // retrive the magnetic field
@@ -237,19 +230,17 @@ Bool_t AliTRDpidESD::GetTrackSegmentKine(AliESDtrack *t, Int_t plan, Float_t &mo
        Double_t b[3], alpha;
        gAlice->Field(xyz0,b);      // b[] is in kilo Gauss
        Float_t field = b[2] * 0.1; // Tesla
-
                
        // find momentum at chamber entrance and track length in chamber
        AliExternalTrackParam *param = (plan<3) ? new AliExternalTrackParam(*t->GetInnerParam()) : new AliExternalTrackParam(*t->GetOuterParam());
 
-       param->PropagateTo(TRDgeom->GetTime0(plan)+kAmHalfWidth, field);
+       param->PropagateTo(trdGeom.GetTime0(plan)+kAmHalfWidth, field);
        param->GetXYZ(xyz0);
        alpha = param->GetAlpha();
-       param->PropagateTo(TRDgeom->GetTime0(plan)-kAmHalfWidth-kDrWidth, field);
+       param->PropagateTo(trdGeom.GetTime0(plan)-kAmHalfWidth-kDrWidth, field);
        // eliminate track segments which are crossing SM boundaries along chamber
        if(TMath::Abs(alpha-param->GetAlpha())>.01){
                delete param;
-               if(kSelfGeom) delete TRDgeom;
                return kFALSE;
        }
        param->GetXYZ(xyz1);
@@ -261,7 +252,6 @@ Bool_t AliTRDpidESD::GetTrackSegmentKine(AliESDtrack *t, Int_t plan, Float_t &mo
        param->GetPxPyPz(xyz1);
        mom = sqrt(xyz1[0]*xyz1[0] + xyz1[1]*xyz1[1] + xyz1[2]*xyz1[2]);
        delete param;
-       if(kSelfGeom) delete TRDgeom;
 
        return kTRUE;
 }
index 70367642040933569cf24201cf92669fbb2b4c00..54aed2d4b5e98c0e415477b937ac9e507f9f5b0e 100644 (file)
@@ -35,7 +35,6 @@
 #include "AliTRDdataArrayI.h"
 #include "AliTRDRawStream.h"
 
-#include "AliTRDCommonParam.h"
 #include "AliTRDcalibDB.h"
 
 ClassImp(AliTRDrawData)
@@ -44,8 +43,6 @@ ClassImp(AliTRDrawData)
 AliTRDrawData::AliTRDrawData()
   :TObject()
   ,fRawVersion(2)    // Default Raw Data version set here
-  ,fCommonParam(0)
-  ,fCalibration(0)
   ,fGeo(0)
   ,fNumberOfDDLs(0)
 {
@@ -59,8 +56,6 @@ AliTRDrawData::AliTRDrawData()
 AliTRDrawData::AliTRDrawData(const AliTRDrawData &r)
   :TObject(r)
   ,fRawVersion(2)    // Default Raw Data version set here
-  ,fCommonParam(0)
-  ,fCalibration(0)
   ,fGeo(0)
   ,fNumberOfDDLs(0)
 {
@@ -123,16 +118,7 @@ Bool_t AliTRDrawData::Digits2Raw(TTree *digitsTree, TTree *tracks )
 
   fGeo = new AliTRDgeometry();
 
-  fCommonParam = AliTRDCommonParam::Instance();
-  if (!fCommonParam) {
-    AliError("Could not get common params");
-    delete fGeo;
-    delete digitsManager;
-    return kFALSE;
-  }
-
-  fCalibration = AliTRDcalibDB::Instance();
-  if (!fCalibration) {
+  if (!AliTRDcalibDB::Instance()) {
     AliError("Could not get calibration object");
     delete fGeo;
     delete digitsManager;
@@ -196,7 +182,7 @@ Bool_t AliTRDrawData::Digits2Raw(AliTRDdigitsManager *digitsManager)
        Int_t iDet = fGeo->GetDetector(plan, cham, sect);
        // If chamber status is ok, we assume that the optical link is also OK.
         // This is shown in the GTU link mask.
-       if ( fCalibration->GetChamberStatus(iDet) )
+       if ( AliTRDcalibDB::Instance()->GetChamberStatus(iDet) )
          GtuCdh = GtuCdh | (3 << (2*plan));
       }
       of->write((char *) (& GtuCdh), sizeof(GtuCdh));
@@ -271,9 +257,9 @@ Int_t AliTRDrawData::ProduceHcDataV1andV2(AliTRDdataArrayI *digits, Int_t side
   Int_t        plan = fGeo->GetPlane( det );   // Plane
   Int_t        cham = fGeo->GetChamber( det ); // Chamber
   Int_t        sect = fGeo->GetSector( det );  // Sector (=iDDL)
-  Int_t        nRow = fCommonParam->GetRowMax( plan, cham, sect );
-  Int_t        nCol = fCommonParam->GetColMax( plan );
-  const Int_t nTBin = fCalibration->GetNumberOfTimeBins();
+  Int_t        nRow = fGeo->GetRowMax( plan, cham, sect );
+  Int_t        nCol = fGeo->GetColMax( plan );
+  const Int_t nTBin = AliTRDcalibDB::Instance()->GetNumberOfTimeBins();
   Int_t      kCtype = 0;                       // Chamber type (0:C0, 1:C1)
   Int_t         iEv = 0xA;                     // Event ID. Now fixed to 10, how do I get event id?
   UInt_t          x = 0;                       // General used number
index ed1a4e61916a73b54b4946d4c7d4950b96c1c432..772b5953113b8e5edaecdb9931cbcb91d51af2f2 100644 (file)
@@ -18,8 +18,6 @@ class TTree;
 class AliRawReader;
 
 class AliTRDdigitsManager;
-class AliTRDCommonParam;
-class AliTRDcalibDB;
 class AliTRDgeometry;
 class AliTRDdataArrayI;
 
@@ -45,12 +43,10 @@ class AliTRDrawData : public TObject {
   virtual Int_t        ProduceHcDataV1andV2(AliTRDdataArrayI *digits, Int_t side, Int_t det, UInt_t *buf, Int_t maxSize);
   
   Int_t                fRawVersion;     //  Which version of raw simulator is used
-  AliTRDCommonParam   *fCommonParam;    //! Common parameters
-  AliTRDcalibDB       *fCalibration;    //! Offline database interface
   AliTRDgeometry      *fGeo;            //! Geometry
   Int_t                fNumberOfDDLs;   //  Number of DDLs
 
-  ClassDef(AliTRDrawData,3)             //  TRD raw data class
+  ClassDef(AliTRDrawData,4)             //  TRD raw data class
 
 };
 #endif
index 03e0db3d4a375721eef4ead28e25df1f8c33f50e..772ca8b958f1f852bfc440139aea5e2c02860843 100644 (file)
@@ -173,24 +173,26 @@ AliTRDtracker::AliTRDtracker(const TFile *geomfile)
   //  
    
   TDirectory *savedir = gDirectory; 
-  TFile      *in      = (TFile *) geomfile; 
-  if (!in->IsOpen()) {
-    AliWarning("geometry file is not open!\n");
-    AliWarning("FULL TRD geometry and DEFAULT TRD parameter will be used\n");
-  }
-  else {
-    in->cd();  
-    fGeom = (AliTRDgeometry *) in->Get("TRDgeometry");
-  }
 
-  if (!fGeom) {
-    AliWarning("Cannot find TRD geometry!\n");
-    fGeom = new AliTRDgeometry();
-  } 
+  //TFile      *in      = (TFile *) geomfile; 
+  //
+  //if (!in->IsOpen()) {
+  //  AliWarning("geometry file is not open!\n");
+  //  AliWarning("FULL TRD geometry and DEFAULT TRD parameter will be used\n");
+  //}
+  //else {
+  //  in->cd();  
+  //  fGeom = (AliTRDgeometry *) in->Get("TRDgeometry");
+  //}
+  //
+  //if (!fGeom) {
+  //  AliWarning("Cannot find TRD geometry!\n");
+  //  fGeom = new AliTRDgeometry();
+  //} 
+  fGeom = new AliTRDgeometry();
   fGeom->ReadGeoMatrices();
 
-  savedir->cd();  
+  //savedir->cd();  
 
   for (Int_t geomS = 0; geomS < kTrackingSectors; geomS++) {
     Int_t trS   = geomS;
@@ -200,7 +202,7 @@ AliTRDtracker::AliTRDtracker(const TFile *geomfile)
     }
   }
 
-  AliTRDpadPlane *padPlane = AliTRDCommonParam::Instance()->GetPadPlane(0,0);
+  AliTRDpadPlane *padPlane = fGeom->GetPadPlane(0,0);
   Float_t tiltAngle = TMath::Abs(padPlane->GetTiltingAngle());
   if (tiltAngle < 0.1) {
     fNoTilt = kTRUE;
@@ -241,7 +243,9 @@ AliTRDtracker::~AliTRDtracker()
     delete fSeeds;
   }
 
-  delete fGeom;  
+  if (fGeom) {
+    delete fGeom;  
+  }
 
   for (Int_t geomS = 0; geomS < kTrackingSectors; geomS++) {
     delete fTrSec[geomS];
@@ -367,8 +371,7 @@ Bool_t  AliTRDtracker::Transform(AliTRDcluster *cluster)
   Double_t vdrift = AliTRDcalibDB::Instance()->GetVdrift(cluster->GetDetector(),0,0);
   Double_t exB    = AliTRDcalibDB::Instance()->GetOmegaTau(vdrift,-AliTracker::GetBz()*0.1);
 
-  AliTRDCommonParam *commonParam = AliTRDCommonParam::Instance();  
-  AliTRDpadPlane    *padPlane    = commonParam->GetPadPlane(plane,chamber);
+  AliTRDpadPlane    *padPlane    = fGeom->GetPadPlane(plane,chamber);
   Double_t zshiftIdeal = 0.5*(padPlane->GetRow0()+padPlane->GetRowEnd());
   Double_t localPos[3];
   Double_t localPosTracker[3];
@@ -1571,7 +1574,7 @@ void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd)
     }
   }
 
-  AliTRDpadPlane *padPlane = AliTRDCommonParam::Instance()->GetPadPlane(0,0);
+  AliTRDpadPlane *padPlane = fGeom->GetPadPlane(0,0);
   Double_t h01 = TMath::Tan(-TMath::Pi() / 180.0 * padPlane->GetTiltingAngle());
   Double_t hL[6];                                                // Tilting angle
   Double_t xcl[6];                                               // X - position of reference cluster
@@ -3035,31 +3038,24 @@ AliTRDtracker::AliTRDtrackingSector
   Double_t *zc            = new Double_t[kNchambers];
   Double_t *zmax          = new Double_t[kNchambers];
   Double_t *zmaxsensitive = new Double_t[kNchambers];  
-
-  AliTRDCommonParam *commonParam = AliTRDCommonParam::Instance();
-  if (!commonParam) {
-    AliErrorGeneral("AliTRDtrackingSector::Ctor"
-                   ,"Could not get common parameters\n");
-    return;
-  }
     
   for (Int_t plane = 0; plane < AliTRDgeometry::Nplan(); plane++) {
 
     ymax          = fGeom->GetChamberWidth(plane) / 2.0;
-    padPlane      = commonParam->GetPadPlane(plane,0);
+    padPlane      = fGeom->GetPadPlane(plane,0);
     ymaxsensitive = (padPlane->GetColSize(1) * padPlane->GetNcols() - 4.0) / 2.0;    
 
     for (Int_t ch = 0; ch < kNchambers; ch++) {
       zmax[ch]          = fGeom->GetChamberLength(plane,ch) / 2.0;
       Float_t pad       = padPlane->GetRowSize(1);
-      Float_t row0      = commonParam->GetRow0(plane,ch,0);
-      Int_t   nPads     = commonParam->GetRowMax(plane,ch,0);
+      Float_t row0      = fGeom->GetRow0(plane,ch,0);
+      Int_t   nPads     = fGeom->GetRowMax(plane,ch,0);
       zmaxsensitive[ch] = Float_t(nPads) * pad / 2.0;      
       zc[ch]            = -(pad * nPads) / 2.0 + row0;
     }
 
     dx        = AliTRDcalibDB::Instance()->GetVdrift(0,0,0)
-              / commonParam->GetSamplingFrequency();
+              / AliTRDCommonParam::Instance()->GetSamplingFrequency();
     rho       = 0.00295 * 0.85; //????
     radLength = 11.0;  
 
@@ -3446,7 +3442,7 @@ Double_t AliTRDtracker::GetTiltFactor(const AliTRDcluster *c)
 
   Int_t    det   = c->GetDetector();    
   Int_t    plane = fGeom->GetPlane(det);
-  AliTRDpadPlane *padPlane = AliTRDCommonParam::Instance()->GetPadPlane(plane,0);
+  AliTRDpadPlane *padPlane = fGeom->GetPadPlane(plane,0);
   Double_t h01   = TMath::Tan(-TMath::Pi() / 180.0 * padPlane->GetTiltingAngle());
 
   if (fNoTilt) {
index 9ec479c47221a3f10ef74d12be59e22803684971..dd7758e51e253d57f76c64634b96c6db79a2d783 100644 (file)
@@ -44,7 +44,6 @@
 #include "AliTrackReference.h"
 
 #include "AliTRDcluster.h"
-#include "AliTRDCommonParam.h"
 #include "AliTRDpadPlane.h"
 #include "AliTRDcalibDB.h"
 #include "AliTracker.h"
@@ -441,7 +440,7 @@ void  AliTRDtrackingAnalysis::DrawRecPointResolution(int startEvent, int stopEve
        fClZXcl->Fill(cls->GetZ(), cls->GetX());
        fClZXref->Fill(zref, cls->GetX());
 
-       AliTRDpadPlane *padPlane = AliTRDCommonParam::Instance()->GetPadPlane(plane,0);
+       AliTRDpadPlane *padPlane = fGeo->GetPadPlane(plane,0);
        Double_t h01   = TMath::Tan(-TMath::Pi() / 180.0 * padPlane->GetTiltingAngle());
        
        //double dz = zref - padPlane->GetRow0();
@@ -653,8 +652,8 @@ void  AliTRDtrackingAnalysis::CheckFiles()
   
   fEsdTree = (TTree*)esdFile->Get("esdTree"); 
   fESD = new AliESD();
-  
-  fEsdTree->SetBranchAddress("ESD", &fESD);
+  fESD->ReadFromTree(fEsdTree);
+  //fEsdTree->SetBranchAddress("ESD", &fESD);
 }
 
 //////////////////////////////////////////////////////////////////////////////////////////
index 3fd55530efc054e2de24fb4c13b2dd66b41a5e9f..71096fa23220df5c7d44aa57eac3239b14ee7c58 100644 (file)
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
-//                                                                           //
 //  TRD trigger parameters class                                             //
 //                                                                           //
+//  Request an instance with AliTRDCommonParam::Instance()                   //
+//  Then request the needed values                                           //
+//                                                                           //
 //  Author:                                                                  //
 //     Bogdan Vulpescu                                                       //
 //                                                                           //
 
 ClassImp(AliTRDtrigParam)
 
+AliTRDtrigParam *AliTRDtrigParam::fgInstance = 0;
+Bool_t AliTRDtrigParam::fgTerminated = kFALSE;
+
+//_ singleton implementation __________________________________________________
+AliTRDtrigParam *AliTRDtrigParam::Instance()
+{
+  //
+  // Singleton implementation
+  // Returns an instance of this class, it is created if neccessary
+  //
+
+  if (fgTerminated != kFALSE) {
+    return 0;
+  }
+
+  if (fgInstance == 0) {
+    fgInstance = new AliTRDtrigParam();
+  }
+
+  return fgInstance;
+
+}
+
 //_____________________________________________________________________________
-AliTRDtrigParam::AliTRDtrigParam()
-  :TNamed()
-  ,fDebug(0)
-  ,fTime1(0)
-  ,fTime2(0)
-  ,fClusThr(0)
-  ,fPadThr(0)
-  ,fSum10(0)
-  ,fSum12(0)
-  ,fTCOn(0)
-  ,fTCnexp(0)
-  ,fFilterType(0)
-  ,fR1(0)
-  ,fR2(0)
-  ,fC1(0)
-  ,fC2(0)
-  ,fPedestal(0)
-  ,fADCnoise(0)
-  ,fDeltaY(0)
-  ,fDeltaS(0)
-  ,fXprojPlane(0)
-  ,fLtuPtCut(0)
-  ,fGtuPtCut(0)
-  ,fField(0)
-  ,fHighPt(0)
-  ,fNPartJetLow(0)
-  ,fNPartJetHigh(0)
-  ,fJetLowPt(0)
-  ,fJetHighPt(0)
+void AliTRDtrigParam::Terminate()
 {
   //
-  // AliTRDtrigParam default constructor
+  // Singleton implementation
+  // Deletes the instance of this class and sets the terminated flag,
+  // instances cannot be requested anymore
+  // This function can be called several times.
   //
 
+  fgTerminated = kTRUE;
+
+  if (fgInstance != 0) {
+    delete fgInstance;
+    fgInstance = 0;
+  }
+
 }
 
 //_____________________________________________________________________________
-AliTRDtrigParam::AliTRDtrigParam(const Text_t *name, const Text_t *title)
-  :TNamed(name,title)
-  ,fDebug(0)
+AliTRDtrigParam::AliTRDtrigParam()
+  :TObject()
   ,fTime1(2)
   ,fTime2(22)
   ,fClusThr(10.0)
@@ -90,7 +96,6 @@ AliTRDtrigParam::AliTRDtrigParam(const Text_t *name, const Text_t *title)
   ,fXprojPlane(0)
   ,fLtuPtCut(2.3)
   ,fGtuPtCut(3.0)
-  ,fField(0)
   ,fHighPt(10.0)
   ,fNPartJetLow(5)
   ,fNPartJetHigh(3)
@@ -98,7 +103,7 @@ AliTRDtrigParam::AliTRDtrigParam(const Text_t *name, const Text_t *title)
   ,fJetHighPt(5.0)
 {
   //
-  // AliTRDtrigParam constructor
+  // AliTRDtrigParam default constructor
   //
 
   // PASA.v.4
@@ -114,13 +119,14 @@ AliTRDtrigParam::AliTRDtrigParam(const Text_t *name, const Text_t *title)
     fC1 = 0.1141;
     fC2 = 0.6241;
   }
+  Init();
 
 }
 
 //_____________________________________________________________________________
 AliTRDtrigParam::AliTRDtrigParam(const AliTRDtrigParam &p)
-  :TNamed(p)
-  ,fDebug(p.fDebug)
+  :TObject(p)
   ,fTime1(p.fTime1)
   ,fTime2(p.fTime2)
   ,fClusThr(p.fClusThr)
@@ -141,7 +147,6 @@ AliTRDtrigParam::AliTRDtrigParam(const AliTRDtrigParam &p)
   ,fXprojPlane(p.fXprojPlane)
   ,fLtuPtCut(p.fLtuPtCut)
   ,fGtuPtCut(p.fGtuPtCut)
-  ,fField(p.fField)
   ,fHighPt(p.fHighPt)
   ,fNPartJetLow(p.fNPartJetLow)
   ,fNPartJetHigh(p.fNPartJetHigh)
@@ -182,7 +187,6 @@ void AliTRDtrigParam::Copy(TObject &p) const
   // Copy function
   //
 
-  ((AliTRDtrigParam &) p).fDebug        = fDebug;
   ((AliTRDtrigParam &) p).fTime1        = fTime1;
   ((AliTRDtrigParam &) p).fTime2        = fTime2;
   ((AliTRDtrigParam &) p).fClusThr      = fClusThr;
@@ -201,7 +205,6 @@ void AliTRDtrigParam::Copy(TObject &p) const
   ((AliTRDtrigParam &) p).fDeltaY       = fDeltaY;
   ((AliTRDtrigParam &) p).fDeltaS       = fDeltaS;
   ((AliTRDtrigParam &) p).fXprojPlane   = fXprojPlane;
-  ((AliTRDtrigParam &) p).fField        = fField;
   ((AliTRDtrigParam &) p).fLtuPtCut     = fLtuPtCut;
   ((AliTRDtrigParam &) p).fGtuPtCut     = fGtuPtCut;
   ((AliTRDtrigParam &) p).fHighPt       = fHighPt;
index 97b8b0951534e97ec18651845b9e1040d5727c5a..98dd5633736c570f8d865b2980df3e4c787c50ff 100644 (file)
@@ -9,18 +9,19 @@
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
-#include <TNamed.h>
+#include "TObject.h"
 
-class AliTRDtrigParam : public TNamed {
+class AliTRDtrigParam : public TObject {
 
  public:
 
-  AliTRDtrigParam();
-  AliTRDtrigParam(const Text_t* name, const Text_t* title);
   AliTRDtrigParam(const AliTRDtrigParam &p);   
   virtual         ~AliTRDtrigParam();
   AliTRDtrigParam &operator=(const AliTRDtrigParam &p); 
 
+  static AliTRDtrigParam *Instance();
+  static  void     Terminate();
+
   virtual void     Copy(TObject &p) const;
 
           void     Init();
@@ -41,11 +42,9 @@ class AliTRDtrigParam : public TNamed {
                                                              c2            = fC2; 
                                                              ped           = fPedestal; };
           Float_t  GetADCnoise() const                     { return fADCnoise;      };
-          Int_t    GetDebugLevel() const                   { return fDebug;         };
           Float_t  GetDeltaY() const                       { return fDeltaY;        };
           Float_t  GetDeltaS() const                       { return fDeltaS;        }; 
           Float_t  GetXprojPlane() const                   { return fXprojPlane;    };
-          Float_t  GetField() const                        { return fField;         };
           Float_t  GetLtuPtCut() const                     { return fLtuPtCut;      };
           Float_t  GetGtuPtCut() const                     { return fGtuPtCut;      };
           Float_t  GetHighPt() const                       { return fHighPt;        };
@@ -70,10 +69,8 @@ class AliTRDtrigParam : public TNamed {
                                                              fC2           = c2; 
                                                              fPedestal     = ped;   };
           void     SetADCnoise(Float_t adcn)               { fADCnoise     = adcn;  };
-          void     SetDebugLevel(Int_t deb)                { fDebug        = deb;   };
           void     SetDeltaY(Float_t dy)                   { fDeltaY       = dy;    };
           void     SetDeltaS(Float_t ds)                   { fDeltaS       = ds;    };
-          void     SetField(Float_t b)                     { fField        = b;     };
           void     SetLtuPtCut(Float_t ptcut)              { fLtuPtCut     = ptcut; };
           void     SetGtuPtCut(Float_t ptcut)              { fGtuPtCut     = ptcut; };
           void     SetHighPt(Float_t hpt)                  { fHighPt       = hpt;   };
@@ -84,7 +81,8 @@ class AliTRDtrigParam : public TNamed {
 
  protected:
 
-          Int_t    fDebug;                         // Debugging flag
+  static  AliTRDtrigParam *fgInstance;             // Instance of this class (singleton implementation)
+  static  Bool_t           fgTerminated;           // Defines if this class has already been terminated
 
           Int_t    fTime1;                         // First time bin for tracking (incl.)
           Int_t    fTime2;                         // Last  time bin for tracking (incl.)
@@ -112,8 +110,6 @@ class AliTRDtrigParam : public TNamed {
           Float_t  fLtuPtCut;                      // Local pt cut
           Float_t  fGtuPtCut;                      // Global pt cut
 
-          Float_t  fField;                         // Magnetic field
-
           Float_t  fHighPt;                        // High pt selection
 
           Int_t    fNPartJetLow;                   // Number of tracks for jet (low)
@@ -121,7 +117,12 @@ class AliTRDtrigParam : public TNamed {
           Float_t  fJetLowPt;                      // Low pt threshold for jet particles
           Float_t  fJetHighPt;                     // High pt threshold for jet particles
 
-  ClassDef(AliTRDtrigParam,2)                      // TRD trigger parameter class
+ private:
+
+  // This is a singleton, constructor is private!
+  AliTRDtrigParam();
+
+  ClassDef(AliTRDtrigParam,3)                      // TRD trigger parameter class
 
 };
 
index e0f4ddbd91869899183a42eef65f129e1f7605e8..b1b95375eee425cea84f97b16ba8307c0a52c65d 100644 (file)
@@ -36,7 +36,6 @@
 #include "AliTRDgeometry.h"
 #include "AliTRDdataArrayI.h"
 #include "AliTRDcalibDB.h"
-#include "AliTRDCommonParam.h"
 #include "AliTRDrawData.h"
 #include "AliTRDtrigger.h"
 #include "AliTRDmodule.h"
@@ -55,9 +54,6 @@ AliTRDtrigger::AliTRDtrigger()
   :TNamed()
   ,fField(0)
   ,fGeo(NULL)
-  ,fCalib(NULL)
-  ,fCParam(NULL)
-  ,fTrigParam(NULL)
   ,fRunLoader(NULL)
   ,fDigitsManager(NULL)
   ,fTrackletTree(NULL)
@@ -87,9 +83,6 @@ AliTRDtrigger::AliTRDtrigger(const Text_t *name, const Text_t *title)
   :TNamed(name,title)
   ,fField(0)
   ,fGeo(NULL)
-  ,fCalib(NULL)
-  ,fCParam(NULL)
-  ,fTrigParam(NULL)
   ,fRunLoader(NULL)
   ,fDigitsManager(new AliTRDdigitsManager())
   ,fTrackletTree(NULL)
@@ -119,9 +112,6 @@ AliTRDtrigger::AliTRDtrigger(const AliTRDtrigger &p)
   :TNamed(p)
   ,fField(p.fField)
   ,fGeo(NULL)
-  ,fCalib(NULL)
-  ,fCParam(NULL)
-  ,fTrigParam(NULL)
   ,fRunLoader(NULL)
   ,fDigitsManager(NULL)
   ,fTrackletTree(NULL)
@@ -144,6 +134,11 @@ AliTRDtrigger::AliTRDtrigger(const AliTRDtrigger &p)
   // AliTRDtrigger copy constructor
   //
 
+  if (fGeo) {
+    delete fGeo;
+  }
+  fGeo = new AliTRDgeometry();
+
 }
 
 ///_____________________________________________________________________________
@@ -163,6 +158,10 @@ AliTRDtrigger::~AliTRDtrigger()
     delete fTracks;
   }
 
+  if (fGeo) {
+    delete fGeo;
+  }
+
 }
 
 //_____________________________________________________________________________
@@ -192,24 +191,22 @@ void AliTRDtrigger::Copy(TObject &) const
 void AliTRDtrigger::Init()
 {
 
-  fModule = new AliTRDmodule(fTrigParam); 
+  fModule = new AliTRDmodule(); 
   fTracks->Clear();
 
-  fField  = fTrigParam->GetField();
-  fGeo    = (AliTRDgeometry*)AliTRDgeometry::GetGeometry(fRunLoader);
+  // The magnetic field strength
+  Double_t x[3] = { 0.0, 0.0, 0.0 };
+  Double_t b[3];
+  gAlice->Field(x,b);  // b[] is in kilo Gauss
+  fField = b[2] * 0.1; // Tesla
+
+  fGeo = new AliTRDgeometry();
 
-  fCalib  = AliTRDcalibDB::Instance();
-  if (!fCalib) {
+  if (!AliTRDcalibDB::Instance()) {
     AliError("No instance of AliTRDcalibDB.");
     return;  
   }
 
-  fCParam = AliTRDCommonParam::Instance();
-  if (!fCParam) {
-    AliError("No common parameters.");
-    return;
-  }
-
 }
 
 //_____________________________________________________________________________
@@ -327,7 +324,7 @@ Bool_t AliTRDtrigger::ReadTracklets(AliRunLoader *rl)
     
     for (itrk = 0; itrk < tracklets->GetEntriesFast(); itrk++) {
 
-      fTrk   = (AliTRDmcmTracklet*)tracklets->UncheckedAt(itrk);
+      fTrk   = (AliTRDmcmTracklet *) tracklets->UncheckedAt(itrk);
       idet   = fTrk->GetDetector();
       iStack = idet / (AliTRDgeometry::Nplan());
 
@@ -376,7 +373,7 @@ Bool_t AliTRDtrigger::MakeTracklets(Bool_t makeTracks)
   Int_t sectEnd = AliTRDgeometry::Nsect();
 
   fTrkTest = new AliTRDmcmTracklet(0,0,0);
-  fMCM     = new AliTRDmcm(fTrigParam,0);
+  fMCM     = new AliTRDmcm(0);
 
   Int_t   time;
   Int_t   col;
@@ -419,9 +416,9 @@ Bool_t AliTRDtrigger::MakeTracklets(Bool_t makeTracks)
          }
        }
 
-        Int_t nRowMax    = fCParam->GetRowMax(iplan,icham,isect);
-       Int_t nColMax    = fCParam->GetColMax(iplan);
-        Int_t nTimeTotal = fCalib->GetNumberOfTimeBins();
+        Int_t nRowMax    = fGeo->GetRowMax(iplan,icham,isect);
+       Int_t nColMax    = fGeo->GetColMax(iplan);
+        Int_t nTimeTotal = AliTRDcalibDB::Instance()->GetNumberOfTimeBins();
 
         // Get the digits
         fDigits = fDigitsManager->GetDigits(idet);
@@ -472,8 +469,9 @@ Bool_t AliTRDtrigger::MakeTracklets(Bool_t makeTracks)
              }
            }
 
-           if (fTrigParam->GetTailCancelation()) {
-             fMCM->Filter(fTrigParam->GetNexponential(),fTrigParam->GetFilterType());
+           if (AliTRDtrigParam::Instance()->GetTailCancelation()) {
+             fMCM->Filter(AliTRDtrigParam::Instance()->GetNexponential()
+                          ,AliTRDtrigParam::Instance()->GetFilterType());
            }
            
            if (fMCM->Run()) {
@@ -484,9 +482,7 @@ Bool_t AliTRDtrigger::MakeTracklets(Bool_t makeTracks)
                   continue;
                }
 
-               if (fTrigParam->GetDebugLevel()   > 1) { 
-                 AliInfo(Form("Add tracklet %d in col %02d \n",fNtracklets,fMCM->GetSeedCol()[iSeed]));
-               }
+               AliDebug(2,Form("Add tracklet %d in col %02d \n",fNtracklets,fMCM->GetSeedCol()[iSeed]));
 
                if (TestTracklet(idet,row,iSeed,0)) {
                  AddTracklet(idet,row,iSeed,fNtracklets++);
@@ -583,7 +579,7 @@ Bool_t AliTRDtrigger::TestTracklet(Int_t det, Int_t row, Int_t seed, Int_t n)
   // Check first the tracklet pt
   //
 
-  Int_t nTimeTotal  = fCalib->GetNumberOfTimeBins();
+  Int_t nTimeTotal  = AliTRDcalibDB::Instance()->GetNumberOfTimeBins();
 
   // Calibration fill 2D
   AliTRDCalibraFillHisto *calibra = AliTRDCalibraFillHisto::Instance();
@@ -656,7 +652,7 @@ Bool_t AliTRDtrigger::TestTracklet(Int_t det, Int_t row, Int_t seed, Int_t n)
 
   fTrkTest->MakeClusAmpGraph();
 
-  if (TMath::Abs(fTrkTest->GetPt()) < fTrigParam->GetLtuPtCut()) {
+  if (TMath::Abs(fTrkTest->GetPt()) < AliTRDtrigParam::Instance()->GetLtuPtCut()) {
     return kFALSE;
   }
   
@@ -671,7 +667,7 @@ void AliTRDtrigger::AddTracklet(Int_t det, Int_t row, Int_t seed, Int_t n)
   // Add a found tracklet
   //
 
-  Int_t nTimeTotal  = fCalib->GetNumberOfTimeBins();
+  Int_t nTimeTotal  = AliTRDcalibDB::Instance()->GetNumberOfTimeBins();
 
   fTrk = new AliTRDmcmTracklet(det,row,n);
 
@@ -727,7 +723,7 @@ void AliTRDtrigger::AddTracklet(Int_t det, Int_t row, Int_t seed, Int_t n)
   // LTU Pt cut
   fTrk->MakeTrackletGraph(fGeo,fField);
   fTrk->MakeClusAmpGraph();
-  if (TMath::Abs(fTrk->GetPt()) < fTrigParam->GetLtuPtCut()) {
+  if (TMath::Abs(fTrk->GetPt()) < AliTRDtrigParam::Instance()->GetLtuPtCut()) {
     return;
   }
       
@@ -821,7 +817,7 @@ void AliTRDtrigger::MakeTracks(Int_t det)
     icham = fGeo->GetChamber(trk->GetDetector());
     isect = fGeo->GetSector(trk->GetDetector());
 
-    nRowMax = fCParam->GetRowMax(iplan,icham,isect);
+    nRowMax = fGeo->GetRowMax(iplan,icham,isect);
     row = trk->GetRow();
 
     fModule->AddTracklet(trk->GetDetector(),
@@ -847,7 +843,7 @@ void AliTRDtrigger::MakeTracks(Int_t det)
   AliTRDgtuTrack *gtutrk;
   for (Int_t i = 0; i < nModTracks; i++) {
     gtutrk = (AliTRDgtuTrack*)fModule->GetTrack(i);
-    if (TMath::Abs(gtutrk->GetPt()) < fTrigParam->GetGtuPtCut()) continue;
+    if (TMath::Abs(gtutrk->GetPt()) < AliTRDtrigParam::Instance()->GetGtuPtCut()) continue;
     gtutrk->CookLabel();
     gtutrk->MakePID();
     AddTrack(gtutrk,det);
index 8682f0258c0007db9002d3bfb2398be1ef314597..b74f415338a48fd641fdb0f5dfbecb52158ebe3c 100644 (file)
@@ -24,12 +24,9 @@ class AliTRDmcmTracklet;
 class AliTRDgtuTrack;
 class AliTRDmcm;
 class AliTRDmodule;
-class AliTRDtrigParam;
 class AliTRDdigitsManager;
 class AliTRDdataArrayI;
 class AliTRDgeometry;
-class AliTRDcalibDB;
-class AliTRDCommonParam;
 
 class AliTRDtrigger : public TNamed {
 
@@ -64,22 +61,16 @@ class AliTRDtrigger : public TNamed {
 
           Int_t    GetNumberOfTracks() const;
           Int_t    GetNPrimary() const                           { return fNPrimary;   };
-          AliTRDtrigParam *GetParameter() const                  { return fTrigParam;  };
           AliTRDgtuTrack  *GetTrack(Int_t i) const;
 
           void     SetRunLoader(AliRunLoader *rl)                { fRunLoader = rl;    };
           void     SetMCMcoordinates(Int_t imcm);
-          void     SetParameter(AliTRDtrigParam *trigp)          { fTrigParam = trigp; };
-
 
  protected:
 
           Float_t                fField;                       //! Magnetic field
           AliTRDgeometry        *fGeo;                         //! TRD geometry
-          AliTRDcalibDB         *fCalib;                       //! Calibration DB
-          AliTRDCommonParam     *fCParam;                      //! Common parameters
 
-          AliTRDtrigParam       *fTrigParam;                   //! Trigger class parameters
           AliRunLoader          *fRunLoader;                   //! Run Loader
           AliTRDdigitsManager   *fDigitsManager;               //! TRD digits manager
           TTree                 *fTrackletTree;                //! Tree with tracklets
@@ -103,7 +94,7 @@ class AliTRDtrigger : public TNamed {
 
           TClonesArray          *fTracks;                      //! Array of GTU tracks
 
-  ClassDef(AliTRDtrigger,3)                                    //  TRD trigger class
+  ClassDef(AliTRDtrigger,4)                                    //  TRD trigger class
 
 };
 
index f11f43425954ff15d73b9136e2c731a56037ad14..1dda033e46297c67d75efe36e64a158d10c09fa1 100644 (file)
@@ -8,7 +8,6 @@
 #pragma link off all classes;
 #pragma link off all functions;
 
-#pragma link C++ class  AliTRDrecPoint+;
 #pragma link C++ class  AliTRDcluster+;
 #pragma link C++ class  AliTRDclusterMI+;
 
index 91d7deba8531980080a3a5a9547170f2779741b4..7938cbde194bd35fd38fc53bd9eb8f3b7034823c 100644 (file)
@@ -1,5 +1,4 @@
-SRCS= AliTRDrecPoint.cxx \
-      AliTRDcluster.cxx \
+SRCS= AliTRDcluster.cxx \
       AliTRDclusterMI.cxx \
       AliTRDclusterizer.cxx \
       AliTRDclusterizerV1.cxx \