Digitizatiion and Reconstruction for calibration with DA data
authoralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 23 Nov 2007 17:20:19 +0000 (17:20 +0000)
committeralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 23 Nov 2007 17:20:19 +0000 (17:20 +0000)
T0/AliT0CalibData.cxx
T0/AliT0CalibData.h
T0/AliT0Reconstructor.cxx

index 2dff0ca..0d322fe 100644 (file)
 #include "AliT0LookUpValue.h"
 #include "AliLog.h"
 
-#include <TCanvas.h>
-#include <TObjString.h>
-#include <TObjArray.h>
-#include <TGraph.h>
-#include <TFile.h>
-#include <TAxis.h>
-#include <TH2F.h>
-#include <TMath.h>
-#include <TSystem.h>
 #include <Riostream.h>
 
 #include <string>
@@ -42,10 +33,6 @@ ClassImp(AliT0CalibData)
 
 //________________________________________________________________
   AliT0CalibData::AliT0CalibData():   TNamed(),
-                                     fTimeDelayTVD(0),
-                                     fMeanT0(0),
-                                     fWalk(0),
-                                     fAmpLEDRec(0),
                                      fLookup(0),
                                      fNumberOfTRMs(0)
 
@@ -55,10 +42,6 @@ ClassImp(AliT0CalibData)
 
 //________________________________________________________________
 AliT0CalibData::AliT0CalibData(const char* name):TNamed(),
-                                     fTimeDelayTVD(0),
-                                     fMeanT0(0),
-                                     fWalk(0),
-                                     fAmpLEDRec(0),
                                      fLookup(0),
                                      fNumberOfTRMs(0)
 {
@@ -72,11 +55,6 @@ AliT0CalibData::AliT0CalibData(const char* name):TNamed(),
 //________________________________________________________________
 AliT0CalibData::AliT0CalibData(const AliT0CalibData& calibda) :
   TNamed(calibda),             
-  fTimeDelayTVD(0),
-  fMeanT0(0),
-  fWalk(0),
-  //  fAmpLED(0),
-  fAmpLEDRec(0),
   fLookup(0),
   fNumberOfTRMs(0)
 
@@ -104,23 +82,6 @@ AliT0CalibData::~AliT0CalibData()
   //
 }
 //________________________________________________________________
-void AliT0CalibData::Reset()
-{
-    memset(fTimeDelayCFD,1,24*sizeof(Float_t));
-    memset(fTimeDelayDA,1,24*sizeof(Float_t));
-}
-
-
-//________________________________________________________________
-void  AliT0CalibData::Print(Option_t*) const
-{
-
-  printf("\n   ----    PM Arrays       ----\n\n");
-  printf(" Time delay CFD & DA\n");
-  for (Int_t i=0; i<24; i++) printf(" CFD  %f DA %f ",fTimeDelayCFD[i], fTimeDelayDA[i]);
-} 
-
-//________________________________________________________________
 void  AliT0CalibData::PrintLookup(Option_t*, Int_t iTRM, Int_t iTDC, Int_t iChannel) const
 {
   
@@ -156,130 +117,6 @@ void  AliT0CalibData::PrintLookup(Option_t*, Int_t iTRM, Int_t iTDC, Int_t iChan
   }
   
 }
-
-//________________________________________________________________
-void AliT0CalibData::SetTimeDelayCFD(Float_t* TimeDelay)
-{
-  if(TimeDelay) for(int t=0; t<24; t++) fTimeDelayCFD[t] = TimeDelay[t];
-}  
-  //________________________________________________________________
-  void AliT0CalibData::SetTimeDelayDA(Float_t* TimeDelay)
-{
-  if(TimeDelay) for(int t=0; t<24; t++) fTimeDelayDA[t] = TimeDelay[t];
-}
-
-
-//________________________________________________________________
-void AliT0CalibData::SetWalk(Int_t ipmt)
-{
-
-  Int_t mv, ps; 
-  Int_t x[70000], y[70000], index[70000];
-  Float_t time[10000],amplitude[10000];
-  string buffer;
-  Bool_t down=false;
-  
-  const char * filename = gSystem->ExpandPathName("$ALICE_ROOT/T0/data/CFD-Amp.txt");
-  ifstream inFile(filename);
-  if(!inFile) AliError(Form("Cannot open file %s !",filename));
-  
-  Int_t i=0;
-  while(getline(inFile,buffer)){
-    inFile >> ps >> mv;
-
-    x[i]=ps; y[i]=mv;
-    i++;
-  }
-  inFile.close();
-  cout<<" number of data "<<i<<endl;
-  TMath::Sort(i, y, index,down);
-  Int_t amp=0, iin=0, isum=0, sum=0;
-  Int_t ind=0;
-  for (Int_t ii=0; ii<i; ii++)
-    {
-      ind=index[ii];
-      if(y[ind] == amp)
-       {
-         sum +=x[ind];
-         iin++;
-       }
-      else
-       {
-         if(iin>0)
-           time[isum] = Float_t (sum/(iin));
-         else
-           time[isum] =Float_t (x[ind]);
-         amplitude[isum] = Float_t (amp);
-         amp=y[ind];
-         iin=0;
-         isum++;
-         sum=0;
-       }
-    }
-
-  inFile.close();
-
-  TGraph* gr = new TGraph(isum, amplitude, time);
-  fWalk.AddAtAndExpand(gr,ipmt);
-}
-
-
-//________________________________________________________________
-/*
-void AliT0CalibData::SetAmpLED(Int_t ipmt)
-{
-  Float_t mv, ps; 
-  Float_t x[100], y[100];
-  string buffer;
-  
-  const char * filename = gSystem->ExpandPathName("$ALICE_ROOT/T0/data/CFD-LED.txt");
-  ifstream inFile(filename);
-  if(!inFile) {AliError(Form("Cannot open file %s !",filename));}
-  
-  inFile >> mv>>ps;
-  Int_t i=0;
-  
-  while(getline(inFile,buffer)){
-    x[i]=mv; y[i]=ps;  
-    inFile >> mv >> ps;
-    i++;
-  }
-  inFile.close();
-  TGraph* gr = new TGraph(i,x,y);
-  fAmpLED.AddAtAndExpand(gr,ipmt);
-   
-}
-*/
-//________________________________________________________________
-
-void AliT0CalibData::SetAmpLEDRec(Int_t ipmt)
-{
-  Float_t mv, ps; 
-  Float_t x[100], y[100];
-  string buffer;
-  
- const char * filename = gSystem->ExpandPathName("$ALICE_ROOT/T0/data/CFD-LED.txt");
-   ifstream inFile(filename);
-  if(!inFile) {AliError(Form("Cannot open file %s !",filename));}
-  
-  inFile >> mv>>ps;
-  Int_t i=0;
-  
-  while(getline(inFile,buffer)){
-    x[i]=mv; y[i]=ps;  
-    inFile >> mv >> ps;
-    i++;
-  }
-  inFile.close();
-  Float_t y1[100], x1[100];
-  for (Int_t ir=0; ir<i; ir++){
-    y1[ir]=y[i-ir]; x1[ir]=x[i-ir];}
-  TGraph* gr = new TGraph(i,y1,x1);
-  fAmpLEDRec.AddAtAndExpand(gr,ipmt);
-  
-}
-
 //________________________________________________________________
 
 void AliT0CalibData::ReadAsciiLookup(const Char_t *filename)
index 937c553..e2573fd 100644 (file)
@@ -26,37 +26,7 @@ class AliT0CalibData: public TNamed {
   AliT0CalibData(const AliT0CalibData &calibda);
   AliT0CalibData& operator= (const AliT0CalibData &calibda);
   virtual ~AliT0CalibData();
-  void Reset();
-  
-  virtual void  Print(Option_t* option= "") const; 
-  Float_t  GetTimeDelayCFD(Int_t channel) const {return fTimeDelayCFD[channel];}
-  Float_t* GetTimeDelayCFD()  const  {return(float*) fTimeDelayCFD;}
-  Float_t  GetTimeDelayDA(Int_t channel) const {return fTimeDelayDA[channel];}
-  Float_t* GetTimeDelayDA()  const  {return(float*) fTimeDelayDA;}
-
-  
-  TGraph *GetWalk(Int_t ipmt )  const {return ((TGraph*)fWalk.At(ipmt));}
-  Float_t  GetWalkVal(Int_t ipmt, Float_t mv )  const {return ((TGraph*)fWalk.At(ipmt))->Eval(mv);}
-  void SetWalk(Int_t ipmt) ;
-
-  //   TGraph *  GetAmpLED(Int_t ipmt) const   {return (TGraph*)fAmpLED.At(ipmt);}
-  //  Float_t  GetAmpLEDVal(Int_t ipmt, Float_t mv)  const 
-  //  {return((TGraph*)fAmpLED.At(ipmt))->Eval(mv);}
-   TGraph *  GetAmpLEDRec(Int_t ipmt) const   {return (TGraph*)fAmpLEDRec.At(ipmt);}
-  Float_t  GetAmpLEDRecVal(Int_t ipmt, Float_t mv)  const 
-      {return((TGraph*)fAmpLEDRec.At(ipmt))->Eval(mv);}
-
-  //  void SetAmpLED(Int_t ipmt) ;
-  void     SetAmpLEDRec(Int_t ipmt) ;
-
-  void     SetTimeDelayCFD(Float_t val, Int_t channel) {fTimeDelayCFD[channel]=val;}
-  void     SetTimeDelayCFD(Float_t* TimeDelay);
-  void     SetTimeDelayDA(Float_t val, Int_t channel) {fTimeDelayDA[channel]=val;}
-  void     SetTimeDelayDA(Float_t* TimeDelay);
-
-  void     SetTimeDelayTVD(Int_t r=150)   { fTimeDelayTVD = r; };
-  Float_t  GetTimeDelayTVD()   { return fTimeDelayTVD; }
-
   void     ReadAsciiLookup(const Char_t *filename);
   Int_t    GetChannel(Int_t trm,  Int_t tdc, Int_t chain, Int_t channel);
   void     PrintLookup(Option_t* option= "", Int_t iTRM=0, Int_t iTDC=0, Int_t iChannel=0) const;
@@ -64,22 +34,14 @@ class AliT0CalibData: public TNamed {
   Int_t    GetNumberOfTRMs() const {return fNumberOfTRMs;}
   void     SetNumberOfTRMs(Int_t ntrms=2) {fNumberOfTRMs = ntrms;}
 
-  void     SetMeanT0(Int_t mean=500) { fMeanT0 = mean; };
-  Int_t    GetMeanT0 () {return fMeanT0;};
 
  protected:
 
-  Float_t     fTimeDelayCFD[24]; // Coeff. for time delay (24 different cables & CFD )
-  Float_t     fTimeDelayDA[24]; // number of channel with mean time+delay if vertex=0 )
-  Float_t     fTimeDelayTVD; //time delay for TVD (vertex trigger channel)
-  Int_t       fMeanT0; //mean of T0distribution with vertex=0;
-  TObjArray   fWalk;  //time - amp. walk
-  TObjArray fAmpLEDRec;  //time - amp. LED-CFD for reconstruction
   TMap fLookup;           //lookup table
   Int_t fNumberOfTRMs;    // number of TRMs in setup
 
   //
-  ClassDef(AliT0CalibData,7)    // T0 Sensor Calibration data
+  ClassDef(AliT0CalibData,8)    // T0 Sensor Calibration data
 };
 
 typedef AliT0CalibData AliSTARTCalibData; // for backward compatibility
index 411ffd9..897f615 100644 (file)
@@ -55,7 +55,7 @@ ClassImp(AliT0Reconstructor)
   for (Int_t i=0; i<24; i++){
     TGraph* gr = fParam ->GetAmpLEDRec(i);
     fAmpLEDrec.AddAtAndExpand(gr,i) ;  
-    fTime0vertex[i]= fParam->GetTimeDelayDA(i);
+//    fTime0vertex[i]= fParam->GetTimeV0(i);
   }
   fdZonC = TMath::Abs(fParam->GetZPositionShift("T0/C/PMT1"));
   fdZonA = TMath::Abs(fParam->GetZPositionShift("T0/A/PMT15"));
@@ -130,6 +130,8 @@ void AliT0Reconstructor::Reconstruct(TTree*digitsTree, TTree*clustersTree) const
   fDigits->GetTimeLED(*timeLED);
   fDigits->GetQT0(*chargeQT0);
   fDigits->GetQT1(*chargeQT1);
+
+  cout<<"!!!! AliT0Reconstructor::Reconstruct RefPoint "<<fDigits->RefPoint()<<endl;
   
   Float_t besttimeA=999999;
   Float_t besttimeC=999999;
@@ -195,7 +197,8 @@ void AliT0Reconstructor::Reconstruct(TTree*digitsTree, TTree*clustersTree) const
   //time in each channel as time[ipmt]-MeanTimeinThisChannel(with vertex=0)
   for (Int_t ipmt=0; ipmt<24; ipmt++) {
     if(time[ipmt]>1) {
-      time[ipmt] = (time[ipmt] - fTime0vertex[ipmt])*channelWidth;
+//      time[ipmt] = (time[ipmt] - fTime0vertex[ipmt])*channelWidth;
+      time[ipmt] = time[ipmt] * channelWidth;
       frecpoints->SetTime(ipmt,time[ipmt]);
     }
   }