new T0 calibration
authoralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 31 Oct 2011 14:29:49 +0000 (14:29 +0000)
committeralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 31 Oct 2011 14:29:49 +0000 (14:29 +0000)
T0/AliT0CalibOffsetChannelsTask.cxx
T0/AliT0Calibrator.cxx
T0/AliT0Calibrator.h
T0/AliT0RecPoint.cxx
T0/AliT0RecPoint.h
T0/AliT0RecoParam.cxx
T0/AliT0RecoParam.h
T0/MakeT0RecoParam.C

index fa48544..3b36281 100644 (file)
@@ -122,10 +122,10 @@ void AliT0CalibOffsetChannelsTask::UserCreateOutputObjects()
     //    fCFD[i]        = new TH1F(Form("CFD%d",i+1),"CFD",250, -1000, 1000);//6000, 7000);\r
   }\r
 \r
-  fTzeroORAplusORC = new TH1F("fTzeroORAplusORC","ORA+ORC /2",200,-2500,2500);   //or A plus or C \r
+  fTzeroORAplusORC = new TH1F("fTzeroORAplusORC","ORA+ORC /2",400,-4000,4000);   //or A plus or C \r
   fResolution      = new TH1F("fResolution","fResolution",400,-2500,2500);// or A minus or C spectrum\r
-  fTzeroORA        = new TH1F("fTzeroORA","fTzeroORA",200,-2500,2500);// or A spectrum\r
-  fTzeroORC        = new TH1F("fTzeroORC","fTzeroORC",200,-2500,2500);// or C spectrum\r
+  fTzeroORA        = new TH1F("fTzeroORA","fTzeroORA",200,-4000,4000);// or A spectrum\r
+  fTzeroORC        = new TH1F("fTzeroORC","fTzeroORC",200,-4000,4000);// or C spectrum\r
 \r
   \r
   fTzeroObject     = new TObjArray(0);\r
index 17afd8f..ed58a87 100644 (file)
@@ -32,6 +32,9 @@
 #include "AliT0Calibrator.h"
 #include "AliT0Reconstructor.h"
 #include "AliT0RecoParam.h"
+#include "AliCDBEntry.h"
+#include "AliCDBManager.h"
+
 #include <TGraph.h>
 #include <TH1F.h>
 #include <TMath.h>
@@ -42,10 +45,12 @@ ClassImp(AliT0Calibrator)
 //____________________________________________________________________
   AliT0Calibrator::AliT0Calibrator():TNamed(),
                                     fChannelWidth(0),  
-                                    fWalk(0)
+                                    fWalk(0),
+                                    fEqualized(0)
                                     
 {
   //constructor
+   printf(" AliT0Calibrator ::: AliT0RecoParam GetEq() %i\n", fEqualized);
    AliT0Parameters* param = AliT0Parameters::Instance();
    param->Init();
    //slewing correcion and equalizing channels
@@ -59,15 +64,15 @@ ClassImp(AliT0Calibrator)
     // fWalk.AddAtAndExpand(fu,i);
     //TGraph* fu = param ->GetAmpLEDRec(i);
     fWalk.AddAtAndExpand(fu,i);
-     
   }
   
 }
 //_____________________________________________________________________________
 
 AliT0Calibrator::AliT0Calibrator(const AliT0Calibrator &r): TNamed(),
-  fChannelWidth(0),  
-  fWalk(0)
+                                                           fChannelWidth(0),  
+                                                           fWalk(0), 
+                                                           fEqualized(0)
 
 {
   //
@@ -106,12 +111,15 @@ Int_t  AliT0Calibrator::WalkCorrection(Int_t refAmp,  Int_t ipmt, Int_t qt, Int_
     walk = Int_t(fu1->Eval(Double_t(qt)));
   }
   
-  timeWalk = time - walk   ;
-  timeEq= timeWalk - fTimeDelayCFD[ipmt];
+  if (fEqualized == 0)
+    timeEq= time - fTimeDelayCFD[ipmt]-walk;
+  else 
+    timeEq = time - walk -  refAmp;
+
   //   printf(" ipmt %i time before %i timeWalk %i , walk %i  qt %i fTimeDelayCFD[ipmt] %i timeEq %i \n ",
   //    ipmt, time,timeWalk, walk, qt,fTimeDelayCFD[ipmt], timeEq );
-     AliDebug(10,Form(" ipmt %i refAmp %i time before %i timeWalk %i , walk %i  qt %i timeEq %i \n ",
-                     ipmt, refAmp, time,timeWalk, walk, qt, timeEq ));
+     AliDebug(2,Form(" fEqualized %i ipmt %i refAmp %i time before %i timeWalk %i , walk %i  qt %i timeEq %i \n ",
+                    fEqualized,   ipmt, refAmp, time,timeWalk, walk, qt, timeEq ));
   
    return timeEq;
 }
index 55c6159..7322406 100644 (file)
@@ -26,16 +26,18 @@ class AliT0Calibrator: public TNamed
 
 
   Int_t WalkCorrection(Int_t refAmp, Int_t ipmt, Int_t qt, Int_t time) ;
-  //  Int_t EquivalizeChannel(Int_t ipmt)  ;
+  void SetEq(Int_t eq) { fEqualized= eq; };
  protected:
 
   Int_t           fTimeDelayCFD[24];  //CFD[i]-CFD[0]
   Float_t           fMaxValue[24];  //CFD[i]-CFD[0]
   Float_t         fChannelWidth  ;   //channel width
   TObjArray       fWalk;             //walk correction function
-  // const AliT0RecoParam* fRecoParam; ///< reference to reco parameters
+  Int_t           fEqualized;        //if != 0 time centered around 0
+      
+ // const AliT0RecoParam* fRecoParam; ///< reference to reco parameters
    
-  ClassDef(AliT0Calibrator, 1)   // class for the T0 reconstruction
+  ClassDef(AliT0Calibrator, 2)   // class for the T0 reconstruction
 
 };
 
index dba983a..1744244 100644 (file)
@@ -39,53 +39,106 @@ ClassImp(AliT0RecPoint)
                                   fTimeAverage(99999),
                                   fTimeOnlineMean(99999),
                                   fVertexPosition(999999),
-                                  fTimeBestA(0),fTimeBestC(0),
+                                  fTimeBestA(99999),
+                                  fTimeBestC(99999),
                                    fMultC(0),fMultA(0),
                                    fT0clock(9999999),
                                   fT0trig(0),
                                   fPileup(kFALSE),
-                                  fSattelite(kFALSE)
-
+                                  fSattelite(kFALSE),
+                                  fTime1stA(99999),
+                                  fTime1stC(99999)
+    
 
 {
   //ctor
-  // fTimeAverage=99999;
-  fTimeBestA=99999;
-  fTimeBestC=99999;
-  //  fVertexPosition=99999;
-  fMultA=0;
-  fMultC=0;
   for (Int_t i=0; i<24; i++) { fTime[i]=0; fADC[i]=0; fADCLED[i]=0;
     for(Int_t iHit=0; iHit<5; iHit++) {
-     fTimeFull[i][iHit] = 0;   
-     fOrA[iHit] = 0; 
-     fOrC[iHit] = 0;  
-     fTVDC[iHit] = 0; 
+      fTimeFull[i][iHit] = 0;   
+      fOrA[iHit] = 0; 
+      fOrC[iHit] = 0;  
+      fTVDC[iHit] = 0; 
     }
  }
 }
 //_____________________________________________________________________________
 
 AliT0RecPoint::AliT0RecPoint(const AliT0RecPoint &r):TObject(),
-                                                    fTimeAverage(999999),
-                                                    fTimeOnlineMean(999999),
-                                                    fVertexPosition(999999),
-                                                    fTimeBestA(0),fTimeBestC(0),
-                                                    fMultC(0),fMultA(0),
-                                                     fT0clock(9999999),
-                                                    fT0trig(0),
-                                                    fPileup(kFALSE),
-                                                    fSattelite(kFALSE)
+                                                    fTimeAverage(r.fTimeAverage),
+                                                    fTimeOnlineMean(r.fTimeOnlineMean),
+                                                    fVertexPosition(r.fVertexPosition),
+                                                    fTimeBestA(r.fTimeBestA),
+                                                    fTimeBestC(r.fTimeBestC),
+                                                    fMultC(r.fMultC),
+                                                    fMultA(r.fMultA),
+                                                     fT0clock(r.fT0clock),
+                                                    fT0trig(r.fT0trig),
+                                                    fPileup(r.fPileup),
+                                                    fSattelite(r.fSattelite),
+                                                    fTime1stA(r.fTime1stA),
+                                                    fTime1stC(r.fTime1stC)
+
 {
   //
   // AliT0RecPoint copy constructor
   //
-
-  ((AliT0RecPoint &) r).Copy(*this);
+  for (Int_t i=0; i<24; i++) {
+    fTime[i] = r. fTime[i];
+    fADC[i] = r.fADC[i]; 
+    fADCLED[i] = r. fADCLED[i];
+    for(Int_t iHit=0; iHit<5; iHit++) {
+      fTimeFull[i][iHit] = r.fTimeFull[i][iHit];   
+      fOrA[iHit] = r.fOrA[iHit]; 
+      fOrC[iHit] = r.fOrC[iHit];  
+      fTVDC[iHit] = r.fTVDC[iHit]; 
+    }
+  }
+  //  ((AliT0RecPoint &) r).Copy(*this);
 
 }
 //_____________________________________________________________________________
 
+/*
+//_____________________________________________________________________________
+
+AliT0RecPoint& AliT0RecPoint:: operator=(const AliT0RecPoint &r)
+{
+  //
+  // assign. operator
+  //
+
+  if (this == &r)
+    return *this;
+  
+  fTimeAverage = r.fTimeAverage;
+  fTimeOnlineMean = r.fTimeOnlineMean;
+  fVertexPosition = r.fVertexPosition;
+  fTimeBestA =  r.fTimeBestA;
+  fTimeBestC = r.fTimeBestC;
+  fMultC = r.fMultC;
+  fMultA = r.fMultA;
+  fT0clock = r.fT0clock;
+  fT0trig = r.fT0trig;
+  fPileup = r.fPileup;
+  fSattelite = r.fSattelite;
+  fTime1stA = r.fTime1stA;
+  fTime1stC = r.fTime1stC;
+  for (Int_t i=0; i<24; i++) {
+    fTime[i] = r. fTime[i];
+    fADC[i] = r.fADC[i]; 
+    fADCLED[i] = r. fADCLED[i];
+    for(Int_t iHit=0; iHit<5; iHit++) {
+      fTimeFull[i][iHit] = r.fTimeFull[i][iHit];   
+      fOrA[iHit] = r.fOrA[iHit]; 
+      fOrC[iHit] = r.fOrC[iHit];  
+      fTVDC[iHit] = r.fTVDC[iHit]; 
+    }
+  }
+  
+  return *this;
+}
+*/
+//_____________________________________________________________________________
 void AliT0RecPoint::SetT0Trig(Bool_t *tr)
 {
   fT0trig=0;
index 7d392d8..f54aba6 100644 (file)
@@ -13,7 +13,7 @@ class AliT0RecPoint: public TObject  {
  public:
     AliT0RecPoint();
     AliT0RecPoint(const AliT0RecPoint &o);
-    AliT0RecPoint& operator= (const AliT0RecPoint &)  { return *this;}
+    AliT0RecPoint& operator= (const AliT0RecPoint &) { return *this;}
     virtual ~AliT0RecPoint() {}
 
     Double32_t  GetMeanTime()   const {return fTimeAverage;}
@@ -21,6 +21,8 @@ class AliT0RecPoint: public TObject  {
     Double32_t  GetBestTimeA()  const {return fTimeBestA ;}
     Double32_t  GetBestTimeC()  const {return fTimeBestC ;}
     Float_t GetMultC()       const {return fMultC;}
+    Double32_t  Get1stTimeA()  const {return fTime1stA ;}
+    Double32_t  Get1stTimeC()  const {return fTime1stC ;}
     Float_t GetMultA()       const {return fMultA;}
     Double32_t  GetVertex()   const {return fVertexPosition;}
 
@@ -29,6 +31,8 @@ class AliT0RecPoint: public TObject  {
     void SetOnlineMean(Int_t time) {fTimeOnlineMean=time;}
     void SetTimeBestA( Double32_t time) {fTimeBestA = time;}
     void SetTimeBestC( Double32_t time) {fTimeBestC = time;}
+    void SetTime1stA( Double32_t time) {fTime1stA = time;}
+    void SetTime1stC( Double32_t time) {fTime1stC = time;}
     void SetVertex( Double32_t vertex) {fVertexPosition= vertex;}
     void SetMultC(Float_t mult) {fMultC = mult;}
     void SetMultA(Float_t mult) {fMultA = mult;}
@@ -59,14 +63,14 @@ class AliT0RecPoint: public TObject  {
     void SetTVDC(Int_t hit, Float_t time) { fTVDC[hit] = time;}
 
   private: 
-    Double32_t fTimeAverage;     // Average time
+    Double32_t fTimeAverage;     // Average time with best particles
     Int_t   fTimeOnlineMean; // online mean signal
     Double32_t fVertexPosition;     // Diffrence time between C and A
     Double32_t fTimeBestA;   //TOF first particle on the A
     Double32_t fTimeBestC;    //TOF first particle on the C
     Float_t fMultC; // multiplicity on the 
     Float_t fMultA; // multiplicity on the 
-    Double32_t fT0clock; // T0 with reference point in ns
+    Double32_t fT0clock; // T0 with best particles
     Int_t   fT0trig;    // T0 trigger signals
  
     Double32_t fTime[24];    // array's TDC
@@ -80,8 +84,10 @@ class AliT0RecPoint: public TObject  {
     Float_t fTVDC[5]; //hardware TVDC centred around 0
     Bool_t fPileup;
     Bool_t fSattelite;
+    Double32_t fTime1stA;   //TOF first particle on the A
+    Double32_t fTime1stC;    //TOF first particle on the C
 
-    ClassDef(AliT0RecPoint,7)  // RecPoints (Header) object for set:T0
+    ClassDef(AliT0RecPoint,8)  // RecPoints (Header) object for set:T0
 };
 
 typedef AliT0RecPoint AliSTARTRecPoint; // for backward compatibility
index 82734d8..d4b3d5b 100644 (file)
@@ -47,13 +47,17 @@ AliT0RecoParam::AliT0RecoParam():
    fLatencyL1A(0),  
    fLatencyL1C(0),  
    fLatencyHPTDC(0),      
-   fVertexShift(0)   
+  fVertexShift(0),
+  fEqualised(0)
 {
   //
   // constructor
-  //
   SetName("T0");
   SetTitle("T0");
+
+  fSatelliteThresholds[0] =  -15;
+  fSatelliteThresholds[1] =  -1.5;
+
 }
 
 //_____________________________________________________________________________
@@ -73,11 +77,13 @@ AliT0RecoParam::AliT0RecoParam(const AliT0RecoParam &p):
   fLatencyL1(p.fLatencyL1),  
   fLatencyL1A(p.fLatencyL1A),  
   fLatencyL1C(p.fLatencyL1C),  
- fLatencyHPTDC(p.fLatencyHPTDC),      
-  fVertexShift(p.fVertexShift)   
-{
+  fLatencyHPTDC(p.fLatencyHPTDC),      
+  fVertexShift(p.fVertexShift), 
+  fEqualised( p.fEqualised)
+{ 
  //copy constructor
+  fSatelliteThresholds[0] = (p.fSatelliteThresholds[0]);
+  fSatelliteThresholds[1] = (p.fSatelliteThresholds[1]);
 
 }
 //_____________________________________________________________________________
@@ -100,6 +106,11 @@ AliT0RecoParam& AliT0RecoParam:: operator=(const AliT0RecoParam &p)
 
   fLatencyHPTDC = p.fLatencyHPTDC;
   fVertexShift = p.fVertexShift;
+
+  fSatelliteThresholds[0] = (p.fSatelliteThresholds[0]);
+  fSatelliteThresholds[1] = (p.fSatelliteThresholds[1]);
+  fEqualised = p.fEqualised;
+
   return *this;
 
 }
@@ -125,6 +136,8 @@ AliT0RecoParam *AliT0RecoParam::GetLowFluxParam()
     }
   param->SetName("Low Flux");
   param->SetTitle("Low Flux");
+  param->SetSatelliteThresholds(-15, -1.5);
+  param->SetEq(0);
   return param;
 }
 
@@ -150,7 +163,10 @@ AliT0RecoParam *AliT0RecoParam::GetHighFluxParam()
       param-> fHigh[i]=20000.;
     }
   //
-  param->SetName("High Flux");
+  param->SetSatelliteThresholds(-15, -1.5);
+  param->SetEq(0);
+
+   param->SetName("High Flux");
   param->SetTitle("High Flux");
   return param;
 }
@@ -171,7 +187,9 @@ AliT0RecoParam *AliT0RecoParam::GetLaserTestParam()
   param->fLatencyL1C =  7782.19;
   param->fLatencyHPTDC = 22000;
   param->fVertexShift = 0;
-
+  param->SetSatelliteThresholds(-15, -1.5);
+  param->SetEq(0);
+  
   for (Int_t i=0; i<500; i++)
     {
      param-> fLow[i]=0.;
@@ -190,9 +208,7 @@ void AliT0RecoParam::PrintParameters() const
   // Printing of the used T0 reconstruction parameters
   //
   AliInfo(Form(" Reference amplitude for walk corerection : %f", fRefAmp));
-  AliInfo(Form(" Reference point in channel  : %i", fRefPoint));
-  AliInfo(Form(" Current latency  : %f ns", fLatencyL1));
-  AliInfo(Form(" HPTDC latency  : %f ns", fLatencyHPTDC));
-  //  cout<<" AliT0RecoParam::PrintParameters() "<<endl;
-  //  for (Int_t i=0; i<500; i++) cout<<i<<" "<<fLow[i]<<" "<<fHigh[i]<<endl; 
+  AliInfo(Form(" Bad channel in channel  : %i", fRefPoint));
+  cout<<" AliT0RecoParam::PrintParameters() "<<endl;
+  for (Int_t i=0; i<105; i++) cout<<i<<" "<<fLow[i]<<" "<<fHigh[i]<<endl; 
 }
index 4c6f241..d0dcf9c 100644 (file)
@@ -29,9 +29,11 @@ class AliT0RecoParam : public AliDetectorRecoParam
   //old staff  
   Float_t GetRefAmp()  const  {return fRefAmp;}
   void    SetRefAmp(Float_t amp)   { fRefAmp = amp;}
+  //now number of bad channel
   Int_t   GetRefPoint() const {return fRefPoint;}
   void    SetRefPoint(Int_t ref) {fRefPoint = ref;}
   
+  //now low and high limit for multi-bunch recontruction
   Float_t   GetLow(Int_t numhist) const {return fLow[numhist];}
   //  Float_t   GetLow() {return *fLow;}
   void      SetLow(Int_t numhist, Float_t low) {fLow[numhist] = low;}
@@ -56,7 +58,13 @@ class AliT0RecoParam : public AliDetectorRecoParam
   Float_t GetAmpLowThreshold() const {return fLow[200];}
   Float_t GetAmpHighThreshold() const {return fHigh[200];}
   
-  
+  void SetSatelliteThresholds(Float_t low, Float_t high) 
+  {fSatelliteThresholds[0]=low;  fSatelliteThresholds[1]=high;}
+  Float_t GetLowSatelliteThreshold() const {return fSatelliteThresholds[0];}
+  Float_t GetHighSatelliteThreshold() const {return fSatelliteThresholds[1];}
+  void SetEq (Int_t eq) {fEqualised = eq; };
+  Int_t GetEq () const { return fEqualised;}
+
   void PrintParameters() const;
   
  protected:
@@ -70,8 +78,10 @@ class AliT0RecoParam : public AliDetectorRecoParam
   Float_t   fLatencyHPTDC;      //Latency HPTDC
   Float_t   fVertexShift;       // for slewing correcton
   Int_t  fBadChannels[24];   // bad channels map
+  Float_t  fSatelliteThresholds[2];   // what we call satellite
+  Int_t fEqualised;                   // do we write pure CFD or equalized 
   
-  ClassDef(AliT0RecoParam, 5);
+  ClassDef(AliT0RecoParam, 6);
  
 };
 #endif
index 92250e3..06c8798 100644 (file)
@@ -5,7 +5,7 @@ void MakeT0RecoParam(Int_t startRun = 0, Int_t endRun = AliCDBRunRange::Infinity
   // write it on CDB
   AliCDBManager *man = AliCDBManager::Instance();
   //  man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
-   man->SetDefaultStorage("local:///home/alla/alice/Feb11/TestCDB");
+  man->SetDefaultStorage("local:///scratch/alla/alice/Oct11/TestCDBf");
   man->SetRun(startRun);
   
   TObjArray *recoParamArray = new TObjArray();
@@ -29,7 +29,7 @@ void MakeT0RecoParam(Int_t startRun = 0, Int_t endRun = AliCDBRunRange::Infinity
   // bad PMT
   t0RecoParam->SetRefPoint(-1);
   // amplitude range for recontruction
-  low[200]=0.5;
+  low[200]=0.8;
   high[200]=80;
   for (Int_t i=0; i<24; i++) t0RecoParam-> SetBadChannels(i,0);
   
@@ -37,6 +37,9 @@ void MakeT0RecoParam(Int_t startRun = 0, Int_t endRun = AliCDBRunRange::Infinity
     t0RecoParam->SetLow(i,low[i]);
     t0RecoParam->SetHigh(i,high[i]);
   }
+  t0RecoParam->SetEq(1);
+  t0RecoParam->SetSatelliteThresholds(-15, -1.7);
+
   t0RecoParam->PrintParameters();
   recoParamArray->AddLast(t0RecoParam);
   
@@ -60,13 +63,14 @@ void MakeT0RecoParam(Int_t startRun = 0, Int_t endRun = AliCDBRunRange::Infinity
     for (Int_t i=0; i<24; i++) t0RecoParam->SetBadChannels(i,0);
   t0RecoParam->SetRefPoint(-1);
   // amplitude range for recontruction
-  low[200]=0.8;
+   t0RecoParam->SetEq(1);
+ low[200]=0.8;
   high[200]=80;
   for (Int_t i=0; i<500; i++) {
     t0RecoParam->SetLow(i,low[i]);
     t0RecoParam->SetHigh(i,high[i]);
   }
-  t0RecoParam->PrintParameters();
+  //  t0RecoParam->PrintParameters();
   recoParamArray->AddLast(t0RecoParam);
   //--------------------------------------
   t0RecoParam = AliT0RecoParam::GetLaserTestParam();
@@ -77,9 +81,11 @@ void MakeT0RecoParam(Int_t startRun = 0, Int_t endRun = AliCDBRunRange::Infinity
     t0RecoParam->SetLow(i, 0);
     t0RecoParam->SetHigh(i, 50000);
   }
+  t0RecoParam->SetEq(1);
+  t0RecoParam->SetSatelliteThresholds(-15, -1.7);
   //  t0RecoParam->Dump();
   t0RecoParam->SetRefPoint(1);
-  t0RecoParam->PrintParameters();
+  //  t0RecoParam->PrintParameters();
   recoParamArray->AddLast(t0RecoParam);