]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - T0/AliT0Parameters.cxx
T0 Option needed for cosmic run reconstruction (Alla)
[u/mrichter/AliRoot.git] / T0 / AliT0Parameters.cxx
index f5c9fa8c21c67bf67d4fc9537f5f72dcab5bc26f..56fc3526f60a0910aa576617c64f503b5e8147e0 100644 (file)
 // Eventually, this class will use the Conditions DB to get the
 // various parameters, which code can then request from here.
 //                                                       
+#include "AliT0.h"
 #include "AliLog.h"              
 #include "AliT0Parameters.h"     
 #include "AliT0CalibData.h"   
+#include "AliT0CalibWalk.h"   
+#include "AliT0CalibTimeEq.h"   
+#include "AliT0LookUpKey.h"
 #include "AliT0LookUpValue.h"
 #include <AliCDBManager.h>        
 #include <AliCDBEntry.h>          
 #include <AliCDBStorage.h>  
 #include <TMath.h>
 #include <TSystem.h>
-#include <Riostream.h>
+//#include <Riostream.h>
 #include <TGeoManager.h>
 #include <TGeoPhysicalNode.h>
+#include <TGeoMatrix.h>
 #include <AliGeomManager.h>
 
-AliT0CalibData* AliT0Parameters::fgCalibData = 0;
+AliT0CalibTimeEq* AliT0Parameters::fgCalibData = 0;
 AliT0CalibData* AliT0Parameters::fgLookUp = 0;
-AliT0CalibData* AliT0Parameters::fgSlewCorr =0;
+AliT0CalibWalk* AliT0Parameters::fgSlewCorr =0;
 //====================================================================
 ClassImp(AliT0Parameters)
 #if 0
@@ -68,10 +73,10 @@ AliT0Parameters::AliT0Parameters()
    fAmpLEDRec(0), 
    fPMTeff(),
    fWalk(0),
-   fTimeDelayDA(0), 
    fTimeDelayCFD(0), 
+ //  fTimeV0(0), 
    fTimeDelayTVD(0),
-   fMeanT0(500),
+   fMeanT0(512),
    fLookUp(0),
    fNumberOfTRMs(2),
    fCalibentry(), fLookUpentry(),fSlewCorr()
@@ -106,7 +111,7 @@ AliT0Parameters::Init()
    //time equalizing
    fCalibentry  = stor->Get("T0/Calib/TimeDelay");
    if (fCalibentry)
-     fgCalibData  = (AliT0CalibData*)fCalibentry->GetObject();
+     fgCalibData  = (AliT0CalibTimeEq*)fCalibentry->GetObject();
    else {
          AliFatal(" ALARM !!!! No time delays in CDB "); 
      fIsInit = kFALSE;
@@ -115,7 +120,7 @@ AliT0Parameters::Init()
  //slewing correction
   fSlewCorr  = stor->Get("T0/Calib/Slewing_Walk");
   if (fSlewCorr){
-    fgSlewCorr  = (AliT0CalibData*)fSlewCorr->GetObject();
+    fgSlewCorr  = (AliT0CalibWalk*)fSlewCorr->GetObject();
   }
   else {
       AliFatal(" ALARM !!!! No slewing correction in CDB "); 
@@ -144,12 +149,15 @@ void AliT0Parameters::InitIfOnline()
 // for switching to this one should write
   // AliT0RawReader myrawreader(rawReader);
 //     myrawreader.SetOnlineMode(kTRUE);
-     
+
   if (fIsInit) return;
    //standart configuration (used for simulation)
    //Int_t trm=0; Int_t tdc=0; Int_t chain=0; Int_t channel=0;
   // configuration for test Jun07.
+   fgLookUp = new AliT0CalibData("T0");
+
   fNumberOfTRMs = 1;
+ fgLookUp-> SetNumberOfTRMs(fNumberOfTRMs);
   Int_t trm=7; Int_t tdc=0; Int_t chain=0; Int_t channel=0;
   for (Int_t ik=0; ik<105; ik++)
         {
@@ -162,32 +170,19 @@ void AliT0Parameters::InitIfOnline()
           lookvalue->SetChain(chain);
           lookvalue->SetChannel(channel);
           lookkey->SetKey(ik);
+         fgLookUp->GetMapLookup()->Add((TObject*)lookvalue,(TObject*)lookkey); 
          if (channel<6) channel +=2;
          else {channel = 0; tdc++;}
-          if(ik==57) { tdc=0; channel=0; chain = 1;}
-          //           fLookUp.Add((TObject*)lookvalue,(TObject*)lookkey);     
-         fgLookUp->GetMapLookup()->Add((TObject*)lookvalue,(TObject*)lookkey); 
+         if(ik==56) { tdc=0; channel=0; chain = 1;}
+
        }
   
   fIsInit=kTRUE;
 }
 //__________________________________________________________________
-
-Float_t
-AliT0Parameters::GetTimeDelayDA(Int_t ipmt) 
-{
-  // return time delay for LED channel
-  // 
-  if (!fCalibentry) {
-    fTimeDelayDA = 500;
-    return  fTimeDelayDA;
-  } 
-  return fgCalibData ->GetTimeDelayDA(ipmt);
-}
-//__________________________________________________________________
 Float_t
 AliT0Parameters::GetTimeDelayCFD(Int_t ipmt) 
-{
+  {
   // return time delay for CFD channel
    // 
   if (!fCalibentry) 
@@ -196,21 +191,7 @@ AliT0Parameters::GetTimeDelayCFD(Int_t ipmt)
       return fTimeDelayCFD;
     }
    
-  return fgCalibData->GetTimeDelayCFD(ipmt);
-}
-
-//__________________________________________________________________
-Int_t
-AliT0Parameters::GetMeanT0() 
-{
-  // return mean of T0 distrubution with vertex=0
-   // 
-  if (!fCalibentry) 
-    {
-      return fMeanT0;
-    }
-   
-  return fgCalibData->GetMeanT0();
+  return fgCalibData->GetTimeEq(ipmt);
 }
 //__________________________________________________________________
 
@@ -325,8 +306,6 @@ Double_t AliT0Parameters::GetZPosition(const char* symname){
 // Get the global z coordinate of the given T0 alignable volume
 //
   Double_t *tr;
-  
-  cout<<symname<<endl;
   TGeoPNEntry *pne = gGeoManager->GetAlignableEntry(symname);
   if (!pne) return 0;