]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - T0/AliT0Parameters.cxx
warnings fixed
[u/mrichter/AliRoot.git] / T0 / AliT0Parameters.cxx
index a7524296ff3b99476c4e40c34475328e86b66fcc..d6070c141f18d3deb31bbe45a22abd2c7a6fa879 100644 (file)
 #include "AliT0CalibData.h"   
 #include "AliT0CalibWalk.h"   
 #include "AliT0CalibTimeEq.h"   
-#include "AliT0LookUpValue.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 <TGeoManager.h>
 #include <TGeoPhysicalNode.h>
+#include <TGeoMatrix.h>
 #include <AliGeomManager.h>
 
 AliT0CalibTimeEq* AliT0Parameters::fgCalibData = 0;
@@ -69,10 +73,13 @@ AliT0Parameters::AliT0Parameters()
    fAmpLEDRec(0), 
    fPMTeff(),
    fWalk(0),
+   fQTC(0),
+   fAmpLED(0),
    fTimeDelayCFD(0), 
  //  fTimeV0(0), 
    fTimeDelayTVD(0),
    fMeanT0(512),
+   fMeanVertex(0),
    fLookUp(0),
    fNumberOfTRMs(2),
    fCalibentry(), fLookUpentry(),fSlewCorr()
@@ -145,8 +152,8 @@ void AliT0Parameters::InitIfOnline()
 // for switching to this one should write
   // AliT0RawReader myrawreader(rawReader);
 //     myrawreader.SetOnlineMode(kTRUE);
- if (fIsInit) return;
+
 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.
@@ -166,11 +173,11 @@ 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;}
+         if(ik==56) { tdc=0; channel=0; chain = 1;}
 
-         fgLookUp->GetMapLookup()->Add((TObject*)lookvalue,(TObject*)lookkey); 
        }
   
   fIsInit=kTRUE;
@@ -191,9 +198,21 @@ AliT0Parameters::GetTimeDelayCFD(Int_t ipmt)
 }
 //__________________________________________________________________
 
+Float_t
+AliT0Parameters:: GetMeanVertex()
+{ 
+  if (!fCalibentry) 
+    {
+      fMeanVertex=0;
+      return fMeanVertex;
+    }
+   
+  return fgCalibData->GetMeanVertex();
+}
+//__________________________________________________________________
+
 TGraph *AliT0Parameters::GetAmpLEDRec(Int_t ipmt) const
 {
- // get walk correction by LED-CFD vs CFD graph
    if (!fSlewCorr) {
      AliError("No slewing correction is available!");
      return  (TGraph*)fAmpLEDRec.At(ipmt); 
@@ -205,7 +224,6 @@ TGraph *AliT0Parameters::GetAmpLEDRec(Int_t ipmt) const
 
 TGraph *AliT0Parameters::GetWalk(Int_t ipmt) const
 {
-  // get walk correction by QTC vs CFD
   if (!fSlewCorr) {
     AliError("No walk correction is available!");
     return  (TGraph*)fWalk.At(ipmt); 
@@ -215,21 +233,31 @@ TGraph *AliT0Parameters::GetWalk(Int_t ipmt) const
 
 //__________________________________________________________________
 
-Float_t AliT0Parameters::GetWalkVal(Int_t ipmt, Float_t mv) const
+TGraph *AliT0Parameters::GetQTC(Int_t ipmt) const
 {
- // get walk correction by QTC vs CFD
-   if (!fSlewCorr) {
-    return ((TGraph*)fWalk.At(ipmt))->Eval(mv); 
+  if (!fSlewCorr) {
+    AliError("No walk correction is available!");
+    //    return  (TGraph*)fQTC.At(ipmt); 
+   return  0; 
   } 
-  return fgSlewCorr -> GetWalkVal(ipmt, mv) ;
+  return fgSlewCorr -> GetQTC(ipmt) ;
 }
 
+//__________________________________________________________________
+TGraph *AliT0Parameters::GetAmpLED(Int_t ipmt) const
+{
+  if (!fSlewCorr) {
+    AliError("No walk correction is available!");
+    //    return  (TGraph*)fQTC.At(ipmt); 
+   return  0; 
+  } 
+  return fgSlewCorr -> GetAmpLED(ipmt) ;
+}
 
 //__________________________________________________________________
 void 
 AliT0Parameters::SetPMTeff(Int_t ipmt)
 {
-  // PMT quantum efficiency
   Float_t lambda[50];
   Float_t eff[50 ] = {0,        0,       0.23619,  0.202909, 0.177913, 
                    0.175667, 0.17856, 0.190769, 0.206667, 0.230286,
@@ -251,7 +279,6 @@ AliT0Parameters::SetPMTeff(Int_t ipmt)
 Int_t 
 AliT0Parameters::GetChannel(Int_t trm,  Int_t tdc, Int_t chain, Int_t channel)
 {
-    // get logical number of channel according physical address
 
   if (fgLookUp) {
     AliT0LookUpValue key(trm,tdc,chain,channel);
@@ -273,8 +300,6 @@ AliT0Parameters::GetChannel(Int_t trm,  Int_t tdc, Int_t chain, Int_t channel)
 //__________________________________________________________________
 TMap *AliT0Parameters::GetMapLookup()
 {
-  // get LookUp Table
-
   if (!fgLookUp){
     cout<<" No look up table in OCDB";
     return 0;