]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
updates to comply with AliTOFGeometryV5 becoming AliTOFGeometry
authorarcelli <arcelli@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Oct 2007 13:15:37 +0000 (13:15 +0000)
committerarcelli <arcelli@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Oct 2007 13:15:37 +0000 (13:15 +0000)
TOF/AliTOFClusterFinder.cxx
TOF/AliTOFClusterFinder.h
TOF/AliTOFReconstructor.cxx
TOF/AliTOFReconstructor.h
TOF/AliTOFtrack.cxx
TOF/AliTOFtrack.h
TOF/AliTOFtracker.cxx
TOF/AliTOFv5T0.cxx
TOF/AliTOFv6T0.cxx

index ac6340b6a988547a7095539aef85195d416da875..05e7b23b2f4c4045fa24aa4fb8afcda9125e805f 100644 (file)
@@ -15,6 +15,9 @@
 
 /* 
 $Log$
+Revision 1.29  2007/10/03 10:42:33  arcelli
+updates to handle new AliTOFcluster, inheriting form AliCluster3D
+
 Revision 1.28  2007/05/31 16:06:05  arcelli
 move instance of AliRawStream outside loop on DDL
 
@@ -106,14 +109,13 @@ Revision 0.01  2005/07/25 A. De Caro
 #include "AliRawReader.h"
 #include "AliRunLoader.h"
 
-#include "AliTOFCal.h"
 #include "AliTOFcalib.h"
-#include "AliTOFChannel.h"
+#include "AliTOFChannelOnline.h"
+#include "AliTOFChannelOffline.h"
 #include "AliTOFClusterFinder.h"
 #include "AliTOFcluster.h"
 #include "AliTOFdigit.h"
 #include "AliTOFGeometry.h"
-#include "AliTOFGeometryV5.h"
 #include "AliTOFrawData.h"
 #include "AliTOFRawStream.h"
 #include "Riostream.h"
@@ -127,7 +129,6 @@ AliTOFClusterFinder::AliTOFClusterFinder(AliTOFcalib *calib):
   fTOFLoader(0),
   fTreeD(0),
   fTreeR(0),
-  fTOFGeometry(new AliTOFGeometryV5()),
   fDigits(new TClonesArray("AliTOFdigit", 4000)),
   fRecPoints(new TClonesArray("AliTOFcluster", 4000)),
   fNumberOfTofClusters(0),
@@ -139,8 +140,6 @@ AliTOFClusterFinder::AliTOFClusterFinder(AliTOFcalib *calib):
 // Constructor
 //
 
-  AliInfo("V5 TOF Geometry is taken as the default");
-
 }
 //______________________________________________________________________________
 
@@ -149,7 +148,6 @@ AliTOFClusterFinder::AliTOFClusterFinder(AliRunLoader* runLoader, AliTOFcalib *c
   fTOFLoader(runLoader->GetLoader("TOFLoader")),
   fTreeD(0),
   fTreeR(0),
-  fTOFGeometry(new AliTOFGeometryV5()),
   fDigits(new TClonesArray("AliTOFdigit", 4000)),
   fRecPoints(new TClonesArray("AliTOFcluster", 4000)),
   fNumberOfTofClusters(0),
@@ -170,7 +168,6 @@ AliTOFClusterFinder::AliTOFClusterFinder(const AliTOFClusterFinder &source)
   fTOFLoader(0),
   fTreeD(0),
   fTreeR(0),
-  fTOFGeometry(new AliTOFGeometryV5()),
   fDigits(new TClonesArray("AliTOFdigit", 4000)),
   fRecPoints(new TClonesArray("AliTOFcluster", 4000)),
   fNumberOfTofClusters(0),
@@ -181,7 +178,6 @@ AliTOFClusterFinder::AliTOFClusterFinder(const AliTOFClusterFinder &source)
   // copy constructor
   this->fDigits=source.fDigits;
   this->fRecPoints=source.fRecPoints;
-  this->fTOFGeometry=source.fTOFGeometry;
   this->fDecoderVersion=source.fDecoderVersion;
   this->fTOFcalib=source.fTOFcalib;
 
@@ -193,7 +189,6 @@ AliTOFClusterFinder& AliTOFClusterFinder::operator=(const AliTOFClusterFinder &s
   // ass. op.
   this->fDigits=source.fDigits;
   this->fRecPoints=source.fRecPoints;
-  this->fTOFGeometry=source.fTOFGeometry;
   this->fVerbose=source.fVerbose;
   this->fDecoderVersion=source.fDecoderVersion;
   this->fTOFcalib=source.fTOFcalib;
@@ -222,8 +217,6 @@ AliTOFClusterFinder::~AliTOFClusterFinder()
       fRecPoints=0;
     }
 
-  delete fTOFGeometry;
-
 }
 //______________________________________________________________________________
 
@@ -664,7 +657,7 @@ void AliTOFClusterFinder::Raw2Digits(Int_t iEvent, AliRawReader *rawReader)
   stopwatch.Start();
 
   //const Int_t kDDL = fTOFGeometry->NDDL()*fTOFGeometry->NSectors();
-  const Int_t kDDL = fTOFGeometry->NDDL()*fTOFGeometry->NSectors();
+  const Int_t kDDL = AliTOFGeometry::NDDL()*AliTOFGeometry::NSectors();
 
   fRunLoader->GetEvent(iEvent);
 
@@ -757,7 +750,7 @@ void AliTOFClusterFinder::Raw2Digits(AliRawReader *rawReader, TTree* digitsTree)
   TStopwatch stopwatch;
   stopwatch.Start();
 
-  const Int_t kDDL = fTOFGeometry->NDDL()*fTOFGeometry->NSectors();
+  const Int_t kDDL = AliTOFGeometry::NDDL()*AliTOFGeometry::NSectors();
 
   if (!digitsTree)
     {
@@ -931,40 +924,57 @@ void AliTOFClusterFinder::CalibrateRecPoint()
   Int_t   tdcCorr;
   AliInfo(" Calibrating TOF Clusters: ")
   
-  AliTOFCal *calTOFArray = fTOFcalib->GetTOFCalArray();  
-
+  TObjArray *calTOFArrayOnline = fTOFcalib->GetTOFCalArrayOnline();  
+  TObjArray *calTOFArrayOffline = fTOFcalib->GetTOFCalArrayOffline();
+  TString validity = (TString)fTOFcalib->GetOfflineValidity();
+  AliInfo(Form(" validity = %s",validity.Data()));
+  Int_t calibration = -1;
+  if (validity.CompareTo("valid")==0) {
+    AliInfo(" Using offline calibration parameters");
+    calibration = 1;
+  }
+  else {
+    AliInfo(" Using online calibration parameters");
+    calibration = 0 ;
+  }
   for (ii=0; ii<fNumberOfTofClusters; ii++) {
     digitIndex = fTofClusters[ii]->GetIndex();
     for(jj=0; jj<5; jj++) detectorIndex[jj] = fTofClusters[ii]->GetDetInd(jj);
 
-    Int_t index = fTOFcalib->GetIndex(detectorIndex);
+    Int_t index = AliTOFGeometry::GetIndex(detectorIndex);
      
-    AliTOFChannel * calChannel = calTOFArray->GetChannel(index);
+    AliTOFChannelOnline * calChannelOnline = (AliTOFChannelOnline* )calTOFArrayOnline->At(index);
 
     // Get channel status 
-    Bool_t status=calChannel->GetStatus();
+    Bool_t status=calChannelOnline->GetStatus();
     if(status)fTofClusters[ii]->SetStatus(!status); //odd convention, to avoid conflict with calibration objects currently in the db (temporary solution).
     // Get Rough channel online equalization 
-    Float_t roughDelay=calChannel->GetDelay();
-    AliDebug(2,Form(" channel delay = %f", roughDelay));
+    Double_t roughDelay=(Double_t)calChannelOnline->GetDelay();  // in ns
+    AliDebug(2,Form(" channel delay (ns) = %f", roughDelay));
     // Get Refined channel offline calibration parameters
-    Float_t par[6];
-    for (Int_t j = 0; j<6; j++){
-      par[j]=calChannel->GetSlewPar(j);
+    if (calibration ==1){
+      AliTOFChannelOffline * calChannelOffline = (AliTOFChannelOffline*)calTOFArrayOffline->At(index);
+      Double_t par[6];
+      for (Int_t j = 0; j<6; j++){
+       par[j]=(Double_t)calChannelOffline->GetSlewPar(j);
+     } 
       AliDebug(2,Form(" Calib Pars = %f, %f, %f, %f, %f, %f ",par[0],par[1],par[2],par[3],par[4],par[5]));
-     }
-    AliDebug(2,Form(" The ToT and Time, uncorr (counts) = %i , %i", fTofClusters[ii]->GetToT(),fTofClusters[ii]->GetTDC()));
-    tToT = (Double_t)(fTofClusters[ii]->GetToT()*AliTOFGeometry::ToTBinWidth());    tToT*=1.E-3; //ToT in ns
-    AliDebug(2,Form(" The ToT and Time, uncorr (ns)= %e, %e",fTofClusters[ii]->GetTDC()*AliTOFGeometry::TdcBinWidth()*1.E-3,tToT));
-    timeCorr=par[0]+par[1]*tToT+par[2]*tToT*tToT+par[3]*tToT*tToT*tToT+par[4]*tToT*tToT*tToT*tToT+par[5]*tToT*tToT*tToT*tToT*tToT+roughDelay; // the time correction
+      AliDebug(2,Form(" The ToT and Time, uncorr (counts) = %i , %i", fTofClusters[ii]->GetToT(),fTofClusters[ii]->GetTDC()));
+      tToT = (Double_t)(fTofClusters[ii]->GetToT()*AliTOFGeometry::ToTBinWidth());    
+      tToT*=1.E-3; //ToT in ns
+      AliDebug(2,Form(" The ToT and Time, uncorr (ns)= %e, %e",fTofClusters[ii]->GetTDC()*AliTOFGeometry::TdcBinWidth()*1.E-3,tToT));
+      timeCorr=par[0]+par[1]*tToT+par[2]*tToT*tToT+par[3]*tToT*tToT*tToT+par[4]*tToT*tToT*tToT*tToT+par[5]*tToT*tToT*tToT*tToT*tToT; // the time correction (ns)
+    }
+    else {
+      timeCorr = roughDelay; // correction in ns
+    }
+    AliDebug(2,Form(" The ToT and Time, uncorr (ns)= %e, %e",fTofClusters[ii]->GetTDC()*AliTOFGeometry::TdcBinWidth()*1.E-3,fTofClusters[ii]->GetToT()*AliTOFGeometry::ToTBinWidth()));
     AliDebug(2,Form(" The time correction (ns) = %f", timeCorr));
     timeCorr=(Double_t)(fTofClusters[ii]->GetTDC())*AliTOFGeometry::TdcBinWidth()*1.E-3-timeCorr;//redefine the time
     timeCorr*=1.E3;
     AliDebug(2,Form(" The channel time, corr (ps)= %e",timeCorr ));
     tdcCorr=(Int_t)(timeCorr/AliTOFGeometry::TdcBinWidth()); //the corrected time (tdc counts)
     fTofClusters[ii]->SetTDC(tdcCorr);
-    AliDebug(2,Form(" The channel time, corr (counts) = %i",fTofClusters[ii]->GetTDC()));
-
   } // loop on clusters
 
 }
index 7cd0daace8018f612f50b67931c05c7e35d7226f..30d9c2078a06d11730a1fc20ad39b1a85dab61e6 100644 (file)
@@ -32,6 +32,7 @@ class AliTOFClusterFinder : public TObject
   AliTOFClusterFinder(const AliTOFClusterFinder &source); // copy constructor
   AliTOFClusterFinder& operator=(const AliTOFClusterFinder &source); // ass. op.
   virtual ~AliTOFClusterFinder();
+
   void Digits2RecPoints(TTree* digitsTree, TTree* clusterTree);
   void Digits2RecPoints(Int_t ievt);
   void Digits2RecPoints(AliRawReader *rawReader, TTree *clustersTree);
@@ -59,7 +60,6 @@ class AliTOFClusterFinder : public TObject
 
   AliTOFcluster *fTofClusters[kTofMaxCluster];  // pointers to the TOF clusters
 
-  AliTOFGeometry  *fTOFGeometry; // Pointer to TOF geometry
   TClonesArray *fDigits;         // List of digits
   TClonesArray *fRecPoints;      // List of reconstructed points
 
index cb6ab047fa06bac912086730019ad085cb16861c..7e4a91c49b0853afdfc7991ed81394401bb674cf 100644 (file)
@@ -27,8 +27,6 @@
 #include "AliRawReader.h"
 
 #include "AliTOFClusterFinder.h"
-#include "AliTOFGeometry.h"
-#include "AliTOFGeometryV5.h"
 #include "AliTOFcalib.h"
 #include "AliTOFtrackerMI.h"
 #include "AliTOFtracker.h"
@@ -47,28 +45,26 @@ ClassImp(AliTOFReconstructor)
  //____________________________________________________________________
 AliTOFReconstructor::AliTOFReconstructor() 
   : AliReconstructor(),
-    fTOFGeometry(0),
     fTOFcalib(0)
 {
 //
 // ctor
 //
   //Retrieving the TOF calibration info  
-  fTOFGeometry = new AliTOFGeometryV5();
-  fTOFcalib    = new AliTOFcalib(fTOFGeometry);
-  if(!fTOFcalib->ReadParFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);}  
+  fTOFcalib    = new AliTOFcalib();
+  fTOFcalib->CreateCalArrays();
+  if(!fTOFcalib->ReadParOnlineFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);}  
+  if(!fTOFcalib->ReadParOfflineFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);}  
 }
 
 //------------------------------------------------------------------------
 AliTOFReconstructor::AliTOFReconstructor(const AliTOFReconstructor &source)
   : AliReconstructor(),
-    fTOFGeometry(0),
     fTOFcalib(0)
 {
 //
 // copy ctor
 //
-  this->fTOFGeometry=source.fTOFGeometry;
   this->fTOFcalib=source.fTOFcalib;
 }
 
@@ -78,7 +74,6 @@ AliTOFReconstructor & AliTOFReconstructor::operator=(const AliTOFReconstructor &
 //
 // assignment op.
 //
-  this->fTOFGeometry=source.fTOFGeometry;
   this->fTOFcalib=source.fTOFcalib;
   return *this;
 }
@@ -88,7 +83,6 @@ AliTOFReconstructor::~AliTOFReconstructor()
 //
 // dtor
 //
-  delete fTOFGeometry;
   delete fTOFcalib;
 }
 
@@ -137,9 +131,3 @@ AliTracker* AliTOFReconstructor::CreateTracker() const
   return new AliTOFtracker();
 }
 
-//_____________________________________________________________________________
-AliTOFGeometry* AliTOFReconstructor::GetTOFGeometry() const
-{
-  // get the TOF geometry
-  return fTOFGeometry;
-}
index 34f42f19b435ceba18e020c4bbcbf6e5e7f27285..7cd5e4991d8831163b805014cab1fdda1555d2c9 100644 (file)
@@ -19,7 +19,6 @@ class TTree;
 class AliESDEvent;
 class AliRawReader;
 
-class AliTOFGeometry;
 class AliTOFcalib;
 
 class AliTOFReconstructor: public AliReconstructor {
@@ -42,11 +41,9 @@ public:
   virtual void         FillESD(TTree*, TTree*, AliESDEvent*) const {}
 
 private:
-  AliTOFGeometry *fTOFGeometry; // pointer to TOF geometry
   AliTOFcalib    *fTOFcalib;    // pointer to TOF calib class
-  AliTOFGeometry*      GetTOFGeometry() const;
 
-  ClassDef(AliTOFReconstructor, 2)   // class for the TOF reconstruction
+  ClassDef(AliTOFReconstructor, 3)   // class for the TOF reconstruction
 };
 
 #endif
index 497ecedf7d6137ad92505e610ceee19f457e5e31..f515e79ac95c842c0a10440bbfdf74cd43d33ef1 100644 (file)
@@ -28,7 +28,6 @@
 #include "AliESDtrack.h" 
 #include "AliTracker.h" 
 
-#include "AliTOFGeometryV5.h"
 #include "AliTOFGeometry.h"
 #include "AliTOFtrack.h" 
 
@@ -38,8 +37,7 @@ ClassImp(AliTOFtrack)
 AliTOFtrack::AliTOFtrack() : 
   AliKalmanTrack(),
   fSeedInd(-1),
-  fSeedLab(-1),
-  fTOFgeometry(0)
+  fSeedLab(-1)
 {
   //
   // Default constructor.
@@ -50,8 +48,7 @@ AliTOFtrack::AliTOFtrack() :
 AliTOFtrack::AliTOFtrack(const AliTOFtrack& t) : 
   AliKalmanTrack(t),
   fSeedInd(t.fSeedInd),
-  fSeedLab(t.fSeedLab),
-  fTOFgeometry(new AliTOFGeometryV5()) 
+  fSeedLab(t.fSeedLab) 
 {
   //
   // Copy constructor.
@@ -62,8 +59,7 @@ AliTOFtrack::AliTOFtrack(const AliTOFtrack& t) :
 AliTOFtrack::AliTOFtrack(const AliESDtrack& t) :
   AliKalmanTrack(), 
   fSeedInd(-1),
-  fSeedLab(-1),
-  fTOFgeometry(new AliTOFGeometryV5()) 
+  fSeedLab(-1) 
 {
   //
   // Constructor from AliESDtrack
@@ -86,7 +82,6 @@ AliTOFtrack& AliTOFtrack::operator=(const AliTOFtrack &source)
 {
   // ass. op.
 
-  this->fTOFgeometry=source.fTOFgeometry;
   return *this;
 
 }
@@ -134,9 +129,9 @@ Bool_t AliTOFtrack::PropagateToInnerTOF()
   // defined by x=xk through media of density=rho and radiationLength=x0
 
 
-  Double_t ymax=fTOFgeometry->RinTOF()*TMath::Tan(0.5*AliTOFGeometry::GetAlpha());
+  Double_t ymax=AliTOFGeometry::RinTOF()*TMath::Tan(0.5*AliTOFGeometry::GetAlpha());
   Bool_t skip = kFALSE;
-  Double_t y=GetYat(fTOFgeometry->RinTOF(),skip);
+  Double_t y=GetYat(AliTOFGeometry::RinTOF(),skip);
   if (skip) {
     return kFALSE;
   }
@@ -161,7 +156,7 @@ Bool_t AliTOFtrack::PropagateToInnerTOF()
     
   }
   
-  if(!PropagateTo(fTOFgeometry->RinTOF()))return 0;
+  if(!PropagateTo(AliTOFGeometry::RinTOF()))return 0;
   
   return kTRUE;
   
index 28e21159aba63e397a03e05931056e96cd72d20a..cfdb06bd93ac43108a98cd4697d6ec7ba5362580 100644 (file)
@@ -15,8 +15,8 @@
 
 #include "AliKalmanTrack.h"
 
-#include "AliTOFGeometry.h"
 #include "AliCluster3D.h"
+#include "AliTOFGeometry.h"
 
 class TObject;
 
@@ -59,13 +59,12 @@ protected:
    
    Int_t    fSeedInd;     // ESD seed track index  
    Int_t    fSeedLab;     // track label taken from seeding  
-   AliTOFGeometry *fTOFgeometry; // pointer to the TOF geometry
 
  private:
 
    void GetPropagationParameters(Double_t *param);
    
-   ClassDef(AliTOFtrack,1) // TOF reconstructed tracks
+   ClassDef(AliTOFtrack,2) // TOF reconstructed tracks
 
 };                     
 
index 761c87c60b3bd7ae7070b3516acc8672062a9faf..71d911e70e751868adc5c0fc607c4e8555ffd644 100644 (file)
@@ -44,7 +44,7 @@
 #include "AliTOFcalib.h"
 #include "AliTOFRecoParam.h"
 #include "AliTOFcluster.h"
-#include "AliTOFGeometryV5.h"
+#include "AliTOFGeometry.h"
 #include "AliTOFtracker.h"
 #include "AliTOFtrack.h"
 
@@ -88,9 +88,9 @@ AliTOFtracker::AliTOFtracker():
   //AliTOFtracker main Ctor
    
    // Gettimg the geometry 
-   fGeom=new AliTOFGeometryV5();
+   fGeom= new AliTOFGeometry();
    // Read the reconstruction parameters from the OCDB
-   AliTOFcalib *calib = new AliTOFcalib(fGeom);
+   AliTOFcalib* calib=new AliTOFcalib();
    fRecoParam = (AliTOFRecoParam*)calib->ReadRecParFromCDB("TOF/Calib",-1);
    if(fRecoParam->GetApplyPbPbCuts())fRecoParam=fRecoParam->GetPbPbparam();
    Double_t parPID[2];   
@@ -98,7 +98,7 @@ AliTOFtracker::AliTOFtracker():
    parPID[1]=fRecoParam->GetTimeNSigma();
    fPid=new AliTOFpidESD(parPID);
    InitCheckHists();
-
+   delete calib;
 }
 //_____________________________________________________________________________
 AliTOFtracker::AliTOFtracker(const AliTOFtracker &t):
@@ -143,7 +143,6 @@ AliTOFtracker::AliTOFtracker(const AliTOFtracker &t):
   fnunmatch=t.fnunmatch;
   fnmatch=t.fnmatch;
   fRecoParam=t.fRecoParam;
-  fGeom=t.fGeom;
   fPid=t.fPid;
   fSeeds=t.fSeeds;
   fTracks=t.fTracks;
@@ -162,7 +161,7 @@ AliTOFtracker& AliTOFtracker::operator=(const AliTOFtracker &t)
   this->fnunmatch=t.fnunmatch;
   this->fnmatch=t.fnmatch;
   this->fRecoParam = t.fRecoParam;
-  this->fGeom = t.fGeom;
+  this->fGeom=t.fGeom;
   this->fPid = t.fPid;
   this->fSeeds=t.fSeeds;
   this->fTracks=t.fTracks;
@@ -310,9 +309,8 @@ void AliTOFtracker::CollectESD() {
 
     AliTOFtrack *track = new AliTOFtrack(*t); // New
     Double_t x = track->GetX(); //New
-
     if (((t->GetStatus()&AliESDtrack::kTRDout)!=0 ) && 
-        ( x >= fGeom->RinTOF()) ){
+        ( x >= AliTOFGeometry::RinTOF()) ){
       track->SetSeedIndex(i);
       t->UpdateTrackParams(track,AliESDtrack::kTOFout);    
       new(aTOFTrack[fNseedsTOF]) AliTOFtrack(*track);
@@ -353,8 +351,8 @@ void AliTOFtracker::MatchTracks( Bool_t mLastStep){
   static Float_t detDepth=15.3;
   static Float_t padDepth=0.5;
 
-  Float_t dY=fGeom->XPad(); 
-  Float_t dZ=fGeom->ZPad(); 
+  Float_t dY=AliTOFGeometry::XPad(); 
+  Float_t dZ=AliTOFGeometry::ZPad(); 
 
   Float_t sensRadius = fRecoParam->GetSensRadius();
   Float_t stepSize   = fRecoParam->GetStepSize();
@@ -382,8 +380,6 @@ void AliTOFtracker::MatchTracks( Bool_t mLastStep){
 
   Int_t nSteps=(Int_t)(detDepth/stepSize);
 
-  AliTOFcalib *calib = new AliTOFcalib(fGeom);
-
   //PH Arrays (moved outside of the loop)
 
   Float_t * trackPos[4];
@@ -447,6 +443,7 @@ void AliTOFtracker::MatchTracks( Bool_t mLastStep){
       Double_t dph=TMath::Abs(c->GetPhi()-phi);
       if (dph>TMath::Pi()) dph-=2.*TMath::Pi();
       if (TMath::Abs(dph)>dphi) continue;
+
       Double_t yc=(c->GetPhi() - trackTOFin->GetAlpha())*c->GetR();
       Double_t p[2]={yc, c->GetZ()};
       Double_t cov[3]= {dY*dY/12., 0., dZ*dZ/12.};
@@ -471,24 +468,23 @@ void AliTOFtracker::MatchTracks( Bool_t mLastStep){
       nc++;
     }
 
-
     //start fine propagation 
 
     Int_t nStepsDone = 0;
     for( Int_t istep=0; istep<nSteps; istep++){ 
 
-      Float_t xs=fGeom->RinTOF()+istep*0.1;
-      Double_t ymax=xs*TMath::Tan(0.5*fGeom->GetAlpha());
+      Float_t xs=AliTOFGeometry::RinTOF()+istep*0.1;
+      Double_t ymax=xs*TMath::Tan(0.5*AliTOFGeometry::GetAlpha());
 
       Bool_t skip=kFALSE;
       Double_t ysect=trackTOFin->GetYat(xs,skip);
       if (skip) break;
       if (ysect > ymax) {
-       if (!trackTOFin->Rotate(fGeom->GetAlpha())) {
+       if (!trackTOFin->Rotate(AliTOFGeometry::GetAlpha())) {
          break;
        }
       } else if (ysect <-ymax) {
-       if (!trackTOFin->Rotate(fGeom->GetAlpha())) {
+       if (!trackTOFin->Rotate(AliTOFGeometry::GetAlpha())) {
          break;
        }
       }
@@ -547,7 +543,7 @@ void AliTOFtracker::MatchTracks( Bool_t mLastStep){
          distZ[nfound]=dist3d[2];
          crecL[nfound]=trackPos[3][istep];
          index[nfound]=clind[5][i]; // store cluster id            
-         cxpos[nfound]=fGeom->RinTOF()+istep*0.1; //store prop.radius
+         cxpos[nfound]=AliTOFGeometry::RinTOF()+istep*0.1; //store prop.radius
          nfound++;
          if(accept &&!mLastStep)break;
        }//end if accept
@@ -619,19 +615,19 @@ void AliTOFtracker::MatchTracks( Bool_t mLastStep){
     delete trackTOFin;
 
     //  Store quantities to be used in the TOF Calibration
-    Float_t tToT=fGeom->ToTBinWidth()*c->GetToT()*1E-3; // in ns
+    Float_t tToT=AliTOFGeometry::ToTBinWidth()*c->GetToT()*1E-3; // in ns
     t->SetTOFsignalToT(tToT);
-    Float_t rawTime=fGeom->TdcBinWidth()*c->GetTDCRAW()+32; // RAW time,in ps
+    Float_t rawTime=AliTOFGeometry::TdcBinWidth()*c->GetTDCRAW()+32; // RAW time,in ps
     t->SetTOFsignalRaw(rawTime);
     t->SetTOFsignalDz(mindistZ);
-    AliDebug(2,Form(" Setting TOF raw time: %f  z distance: %f time: %f = ",rawTime,mindistZ));    
+    AliDebug(2,Form(" Setting TOF raw time: %f, z distance: %f time: %f = ",rawTime,mindistZ));    
     Int_t ind[5];
     ind[0]=c->GetDetInd(0);
     ind[1]=c->GetDetInd(1);
     ind[2]=c->GetDetInd(2);
     ind[3]=c->GetDetInd(3);
     ind[4]=c->GetDetInd(4);
-    Int_t calindex = calib->GetIndex(ind);
+    Int_t calindex = AliTOFGeometry::GetIndex(ind);
     t->SetTOFCalChannel(calindex);
 
     // keep track of the track labels in the matched cluster
@@ -640,7 +636,7 @@ void AliTOFtracker::MatchTracks( Bool_t mLastStep){
     tlab[1]=c->GetLabel(1);
     tlab[2]=c->GetLabel(2);
     AliDebug(2,Form(" tdc time of the matched track %i = ",c->GetTDC()));    
-    Double_t tof=fGeom->TdcBinWidth()*c->GetTDC()+32; // in ps
+    Double_t tof=AliTOFGeometry::TdcBinWidth()*c->GetTDC()+32; // in ps
     AliDebug(2,Form(" tof time of the matched track: %f = ",tof));    
     Double_t tofcorr=tof;
     if(timeWalkCorr)tofcorr=CorrectTimeWalk(mindistZ,tof);
@@ -688,7 +684,7 @@ void AliTOFtracker::MatchTracks( Bool_t mLastStep){
   }
   for (Int_t ii=0; ii<4; ii++) delete [] trackPos[ii];
   for (Int_t ii=0;ii<6;ii++) delete [] clind[ii];
-  delete calib;
 }
 //_________________________________________________________________________
 Int_t AliTOFtracker::LoadClusters(TTree *cTree) {
@@ -696,11 +692,11 @@ Int_t AliTOFtracker::LoadClusters(TTree *cTree) {
   //This function loads the TOF clusters
   //--------------------------------------------------------------------
 
-  Int_t npadX = fGeom->NpadX();
-  Int_t npadZ = fGeom->NpadZ();
-  Int_t nStripA = fGeom->NStripA();
-  Int_t nStripB = fGeom->NStripB();
-  Int_t nStripC = fGeom->NStripC();
+  Int_t npadX = AliTOFGeometry::NpadX();
+  Int_t npadZ = AliTOFGeometry::NpadZ();
+  Int_t nStripA = AliTOFGeometry::NStripA();
+  Int_t nStripB = AliTOFGeometry::NStripB();
+  Int_t nStripC = AliTOFGeometry::NStripC();
 
   TBranch *branch=cTree->GetBranch("TOF");
   if (!branch) { 
@@ -729,8 +725,8 @@ Int_t AliTOFtracker::LoadClusters(TTree *cTree) {
     Int_t ipadX = c->GetDetInd(4);
     Int_t ipadZ = c->GetDetInd(3);
 
-    Float_t time =(fGeom->TdcBinWidth()*c->GetTDC())*1E-3; // in ns
-    Float_t tot = (fGeom->TdcBinWidth()*c->GetToT())*1E-3;//in ns
+    Float_t time =(AliTOFGeometry::TdcBinWidth()*c->GetTDC())*1E-3; // in ns
+    Float_t tot = (AliTOFGeometry::TdcBinWidth()*c->GetToT())*1E-3;//in ns
  
     Int_t stripOffset = 0;
     switch (iplate) {
@@ -804,10 +800,10 @@ Bool_t AliTOFtracker::GetTrackPoint(Int_t index, AliTrackPoint& p) const
   xyz[2] = cl->GetZ();
   Float_t phiangle = (Int_t(cl->GetPhi()*TMath::RadToDeg()/20.)+0.5)*20.*TMath::DegToRad();
   Float_t sinphi = TMath::Sin(phiangle), cosphi = TMath::Cos(phiangle);
-  Float_t tiltangle = fGeom->GetAngles(cl->GetDetInd(1),cl->GetDetInd(2))*TMath::DegToRad();
+  Float_t tiltangle = AliTOFGeometry::GetAngles(cl->GetDetInd(1),cl->GetDetInd(2))*TMath::DegToRad();
   Float_t sinth = TMath::Sin(tiltangle), costh = TMath::Cos(tiltangle);
-  Float_t sigmay2 = fGeom->XPad()*fGeom->XPad()/12.;
-  Float_t sigmaz2 = fGeom->ZPad()*fGeom->ZPad()/12.;
+  Float_t sigmay2 = AliTOFGeometry::XPad()*AliTOFGeometry::XPad()/12.;
+  Float_t sigmaz2 = AliTOFGeometry::ZPad()*AliTOFGeometry::ZPad()/12.;
   Float_t cov[6];
   cov[0] = sinphi*sinphi*sigmay2 + cosphi*cosphi*sinth*sinth*sigmaz2;
   cov[1] = -sinphi*cosphi*sigmay2 + sinphi*cosphi*sinth*sinth*sigmaz2;
@@ -818,11 +814,11 @@ Bool_t AliTOFtracker::GetTrackPoint(Int_t index, AliTrackPoint& p) const
   p.SetXYZ(xyz[0],xyz[1],xyz[2],cov);
 
   // Detector numbering scheme
-  Int_t nSector = fGeom->NSectors();
-  Int_t nPlate  = fGeom->NPlates();
-  Int_t nStripA = fGeom->NStripA();
-  Int_t nStripB = fGeom->NStripB();
-  Int_t nStripC = fGeom->NStripC();
+  Int_t nSector = AliTOFGeometry::NSectors();
+  Int_t nPlate  = AliTOFGeometry::NPlates();
+  Int_t nStripA = AliTOFGeometry::NStripA();
+  Int_t nStripB = AliTOFGeometry::NStripB();
+  Int_t nStripC = AliTOFGeometry::NStripC();
 
   Int_t isector = cl->GetDetInd(0);
   if (isector >= nSector)
@@ -951,7 +947,7 @@ Float_t AliTOFtracker::CorrectTimeWalk( Float_t dist, Float_t tof) {
 
   //dummy, for the moment
   Float_t tofcorr=0.;
-  if(dist<fGeom->ZPad()*0.5){
+  if(dist<AliTOFGeometry::ZPad()*0.5){
     tofcorr=tof;
     //place here the actual correction
   }else{
index 02019c3e6cc167cc365740af03de7d2969a3bf0d..0d25825aa90a68c11ee9c1d6fc8a445b8dc64642 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.20  2007/10/03 18:07:22  arcelli
+right handling of l2t matrices and alignable entries in case of TOF holes (Annalisa)
+
 Revision 1.19  2007/10/03 10:41:12  arcelli
 adding tracking-to-local matrices for new AliTOFcluster
 
@@ -121,7 +124,6 @@ Revision 0.1 2004 November G. Cara Romeo and A. De Caro
 #include "AliTrackReference.h"
 
 #include "AliTOFGeometry.h"
-#include "AliTOFGeometryV5.h"
 #include "AliTOFv5T0.h"
 
 extern TDirectory *gDirectory;
@@ -172,7 +174,7 @@ AliTOFv5T0::AliTOFv5T0(const char *name, const char *title):
   } else{
     
     if (fTOFGeometry) delete fTOFGeometry;
-    fTOFGeometry = new AliTOFGeometryV5();
+    fTOFGeometry = new AliTOFGeometry();
 
     if(frame->IsVersion()==1) {
       AliDebug(1,Form("Frame version %d", frame->IsVersion())); 
index 8a0e24546acb75123a390975224d5343a3caa98e..6b335f4a64812b64cf8f16a50ae617f8368abca0 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.7  2007/10/03 18:07:26  arcelli
+right handling of l2t matrices and alignable entries in case of TOF holes (Annalisa)
+
 Revision 1.6  2007/10/03 10:41:16  arcelli
 adding tracking-to-local matrices for new AliTOFcluster
 
@@ -92,7 +95,6 @@ Revision 0.1 2007 March G. Cara Romeo and A. De Caro
 #include "AliTrackReference.h"
 
 #include "AliTOFGeometry.h"
-#include "AliTOFGeometryV5.h"
 #include "AliTOFv6T0.h"
 
 extern TDirectory *gDirectory;
@@ -143,7 +145,7 @@ AliTOFv6T0::AliTOFv6T0(const char *name, const char *title):
   } else{
     
     if (fTOFGeometry) delete fTOFGeometry;
-    fTOFGeometry = new AliTOFGeometryV5();
+    fTOFGeometry = new AliTOFGeometry();
 
     if(frame->IsVersion()==1) {
       AliDebug(1,Form("Frame version %d", frame->IsVersion()));