]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - T0/AliT0Parameters.h
for current DA
[u/mrichter/AliRoot.git] / T0 / AliT0Parameters.h
index c694cdef3c780d2cfa374433d53498afeed1f984..0dbe81da9e61e7df211b814cc9e726ff3ef3b3c5 100644 (file)
@@ -3,7 +3,7 @@
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
  * reserved. 
  *
- * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
+ * Alla Maevskaya INR RAS alla@inr.ru
  *
  * See cxx source for full Copyright notice                               
  */
 #include <TObjArray.h>
 class AliT0CalibData;
 class AliCDBEntry;
+class AliT0CalibWalk;
+class AliT0CalibTimeEq;
 
 class AliT0Parameters : public TNamed
 {
 public:
   static AliT0Parameters* Instance();
-
+  
+  AliT0Parameters();
+  virtual ~AliT0Parameters() {};
   void Init();  
+  void InitIfOnline();
+
   // Set various `Fixed' parameters 
   void SetPh2Mip(Int_t r=300)          { fPh2Mip = r; }
   void SetmV2Mip(Int_t r=50)          { fmV2Mip = r; }
-  void SetChannelWidth(Int_t s=25)   { fChannelWidth = s;}
+  void SetChannelWidth(Float_t s=24.4)   { fChannelWidth = s;}
   void SetmV2channel(Int_t size=320) { fmV2Channel = size; }
   void SetQTmin(Int_t qt=13) {fQTmin = qt;}
   void SetQTmax(Int_t qt=125) {fQTmax = qt;}
-  void SetGain(Int_t size=1) { fFixedGain = size; }
   void SetZposition( Float_t valueC=69.7, Float_t valueA=373) {
     fT0zPosition[0]=valueC, fT0zPosition[1]=valueA;}
   void SetPMTeff(Int_t ipmt);  
 
   void SetTimeDelayTVD(Float_t r=150)   { fTimeDelayTVD = r; };
-  Float_t GetTimeDelayTVD()   { return fTimeDelayTVD; }
-
-  // Set various variable parameter defaults
-  void SetTimeDelayCablesCFD(Int_t ipmt,Float_t r=150)   
-  { fTimeDelayCablesCFD[ipmt] = r;}
-  void SetTimeDelayCablesLED(Int_t ipmt,Float_t r=150)    
-  { fTimeDelayCablesLED[ipmt] = r;}
-  void SetTimeDelayPMT(Int_t ipmt,Float_t r=5)    
-  { fTimeDelayPMT[ipmt] = r;}
-  void SetTimeDelayElectronicCFD(Int_t ipmt,Float_t r=8)    
-  { fTimeDelayElectronicCFD[ipmt] = r;}
-  void SetTimeDelayElectronicLED(Int_t ipmt,Float_t r=10)  
-  { fTimeDelayElectronicLED[ipmt] = r;}
-  void SetVariableDelayLine(Int_t ipmt, Int_t v=0)  
-  { fVariableDelayLine[ipmt] = v;}
-  void SetSlewingLED(Int_t ipmt); 
-  void SetSlewingRec(Int_t ipmt); 
+  const Float_t GetTimeDelayTVD()   { return fTimeDelayTVD; }
 
   // Get `Fixed' various parameters
   Int_t GetPh2Mip()          const { return fPh2Mip; }
   Int_t GetmV2Mip()          const { return fmV2Mip; }
-  Int_t GetChannelWidth()     const { return fChannelWidth; }
+  Float_t GetChannelWidth()     const { return fChannelWidth; }
   Int_t GetmV2channel()     const { return fmV2Channel; }
   Int_t GetQTmin() const {return fQTmin;}
   Int_t GetQTmax() const {return fQTmax;}
-  Float_t  GetGain(Int_t ipmt)        const;
-  Float_t GetZposition(Int_t i) const {return fT0zPosition[i];}
+  Double_t GetZposition(Int_t i) const {return fT0zPosition[i];}
+  Double_t GetZPosition(const char* symname) ;
+  Double_t GetZPositionShift(const char* symname);
+
+
   TGraph *  GetPMTeff(Int_t ipmt) const  
   {return (TGraph*)fPMTeff.At(ipmt);}
   Float_t GetpmtEFF(Int_t ipmt, Float_t lambda) const
   {return((TGraph*)fPMTeff.At(ipmt))->Eval(lambda);} 
 
-  Float_t  GetTimeDelayCablesCFD(Int_t ipmt) const 
-  {return fTimeDelayCablesCFD[ipmt]; } 
-  Float_t  GetTimeDelayCablesLED(Int_t ipmt) const 
-  {return fTimeDelayCablesLED[ipmt]; } ; 
-
-  Float_t  GetTimeDelayElectronicLED(Int_t ipmt) const 
-  {return fTimeDelayElectronicLED[ipmt]; } ; 
-  Float_t  GetTimeDelayElectronicCFD(Int_t ipmt) const 
-  {return fTimeDelayElectronicCFD[ipmt]; } ; 
-  Int_t GetVariableDelayLine(Int_t ipmt) const 
-  {return fVariableDelayLine[ipmt];}
-
-  Float_t GetSlewingLED(Int_t ipmt, Float_t mv) const;
-  //  {return((TGraph*)fSlewingLED.At(ipmt))->Eval(mv);} 
-  TGraph *  GetSlew(Int_t ipmt) const ; 
-  //  {return (TGraph*)fSlewingLED.At(ipmt);}
-  TGraph *  GetSlewRec(Int_t ipmt) const;  
-  //  {return (TGraph*)fSlewingRec.At(ipmt);}
-  Float_t GetSlewingRec(Int_t ipmt, Float_t mv) const;
-  //  {return((TGraph*)fSlewingRec.At(ipmt))->Eval(mv);} 
 
+  TGraph *  GetAmpLEDRec(Int_t ipmt) const;  
+  TGraph *GetWalk(Int_t ipmt )  const;
+  TGraph *GetQTC(Int_t ipmt) const;
+  TGraph *GetAmpLED(Int_t ipmt) const;
+   
   Float_t GetTimeDelayCFD(Int_t ipmt);
-  Float_t GetTimeDelayLED(Int_t ipmt);
+//  Float_t GetTimeV0(Int_t ipmt = 512) {return  fTimeV0;}
 
-  //  TMap *LookupTable;
+  void SetMeanT0(Int_t mean=512) { fMeanT0 = mean; };
+  Int_t GetMeanT0 () {return fMeanT0;};
 
+  TMap * GetMapLookup();
   Int_t GetChannel(Int_t trm,  Int_t tdc, Int_t chain, Int_t channel);
-
-protected:
-  AliT0Parameters();
-  virtual ~AliT0Parameters() {}
+  Int_t GetNumberOfTRMs();
+  void SetNumberOfTRMs(Int_t ntrms=2) {fNumberOfTRMs = ntrms;}
+  
+ protected:
   static AliT0Parameters* fgInstance; // Static singleton instance
   
-  Bool_t fIsInit;                // Whether we've been initialised
-  Float_t  fT0zPosition[2] ;  // z-position of the two T0s
-  Int_t   fPh2Mip;            // # photoelectrons per MIP in radiator
-  Int_t   fmV2Mip;            // # mV per MIP in radiator
-  Int_t        fChannelWidth;          // channel width in ns   
-  Int_t        fmV2Channel;     // ADC mv  2  channel # (200000ps/(25*25).
-  Int_t fQTmin;                 //min  time for QTC
-  Int_t fQTmax;                 //max  time fro QTC 
-  Int_t         fFixedGain;       //
-  Float_t fTimeDelayCablesCFD[24];       //! time delay in cables
-  Float_t fTimeDelayCablesLED[24];       //! time delay in cables
-  Float_t fTimeDelayElectronicCFD[24];       //! time delay in electronic
-  Float_t fTimeDelayElectronicLED[24];       //! time delay in electronic
-  Float_t fTimeDelayPMT[24];       //! time delay in PMT
-  Int_t fVariableDelayLine[24];      //time delay in VDL for trigger equvalizing
-  TObjArray fSlewingLED;  //array of slewing correction for each PMT
-  TObjArray fSlewingRec;  //array of slewing correction for Reconstruction
+  Bool_t    fIsInit;                // Whether we've been initialised
+  Float_t   fT0zPosition[2] ;  // z-position of the two T0s
+  Int_t     fPh2Mip;            // # photoelectrons per MIP in radiator
+  Int_t     fmV2Mip;            // # mV per MIP in radiator
+  Float_t     fChannelWidth;          // channel width in ns   
+  Int_t     fmV2Channel;     // ADC mv  2  channel # (200000ps/(25*25).
+  Int_t     fQTmin;                 //min  time for QTC
+  Int_t     fQTmax;                 //max  time fro QTC 
+  TObjArray fAmpLEDRec;  // array of amlitude vs LED-CFD (simulation & reconstruction)
   TObjArray fPMTeff; //array PMT registration efficiency
+  TObjArray fWalk; //array time-amplitude walk
+  TObjArray fQTC; //array of TGraphs for QTC vs number of MIPs
+  TObjArray fAmpLED; //array of TGraphs for LED-CFD vs number of MIPs
+
   
-  Float_t fTimeDelayLED;  //  sum time delay for LED channel
-  Float_t fTimeDelayCFD;  // sum time delay for CFD channel
-  Float_t  fTimeDelayTVD;  //time delay for TVD (vertex trigger channel)
+  Float_t   fTimeDelayCFD;  // sum time delay for CFD channel
+ // Float_t   fTimeV0;  // sum time delay for CFD channel
+  Float_t   fTimeDelayTVD;  //time delay for TVD (vertex trigger channel)
+  Int_t     fMeanT0; //mean of T0distribution with vertex=0;
   
-  TMap fLookUp;           //lookup table
+  TMap      fLookUp;           //lookup table
+  Int_t     fNumberOfTRMs;    // number of TRMs in setup
   
-  static AliT0CalibData * fgCalibData; // singleton for Calibration data
+
+  static AliT0CalibTimeEq * fgCalibData; // singleton for Calibration data
   static AliT0CalibData * fgLookUp; // singleton for Calibration data
+  static AliT0CalibWalk * fgSlewCorr; // singleton for Calibration data
   
   AliCDBEntry*   fCalibentry ;  // pointer to T0 calibration object
   AliCDBEntry*   fLookUpentry ;  // pointer to T0 lokkup table
-  
-  ClassDef(AliT0Parameters,2)
   private:
+  AliCDBEntry*   fSlewCorr ;  // pointer to slewing correction
+
+ private:
   AliT0Parameters(const  AliT0Parameters&);
   AliT0Parameters& operator=(const AliT0Parameters&);
-
+  
+  ClassDef(AliT0Parameters,4)
 };
 
 #endif