reconstruction for both cases: cosmic and PDC08
authoralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 22 Feb 2008 13:40:40 +0000 (13:40 +0000)
committeralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 22 Feb 2008 13:40:40 +0000 (13:40 +0000)
T0/AliT0Calibrator.cxx
T0/AliT0Calibrator.h
T0/AliT0Reconstructor.cxx

index bc44f3817d0becbdbac422f0caf037d1df1be61f..b714d6b31770c97adb52d70d035a654c66f656d1 100644 (file)
@@ -84,7 +84,7 @@ AliT0Calibrator &AliT0Calibrator::operator=(const AliT0Calibrator &r)
 
 
 //____________________________________________________________________
-Int_t  AliT0Calibrator::WalkCorrection(Int_t ipmt, Int_t qt, Int_t time) 
+Int_t  AliT0Calibrator::WalkCorrection(Int_t ipmt, Int_t qt, Int_t time, TString option
 {
   //slewing correcion and equalizing channels
 
@@ -93,7 +93,10 @@ Int_t  AliT0Calibrator::WalkCorrection(Int_t ipmt, Int_t qt, Int_t time)
   Float_t walk=fu1->Eval(Float_t(qt));
   TH1F*hr=fu1->GetHistogram();
   Float_t maxValue=hr->GetMaximum(50);
-  timeWalk = time + Int_t((maxValue-walk)/fChannelWidth) ;
+  if (option == "pdc")
+    timeWalk = time + Int_t((maxValue-walk)/fChannelWidth) ;
+  if (option == "cosmic")
+    timeWalk = time + Int_t((maxValue-walk)) ;
   timeEq= timeWalk - (fTimeDelayCFD[ipmt]-fTimeDelayCFD[0]);
   AliDebug(10,Form(" time before %i timeWalk %i ,  qt %i timeEq %i \n ",
                  time,timeWalk, qt, timeEq ));
index 7abd9ff184e349187b02f71752464285eb3b8b8e..125428c8d7263c4995f00f64af30f1dde5397db1 100644 (file)
@@ -22,7 +22,7 @@ class AliT0Calibrator: public TNamed
   virtual ~AliT0Calibrator() {};
   
 
-  Int_t WalkCorrection(Int_t ipmt, Int_t qt, Int_t time) ;
+  Int_t WalkCorrection(Int_t ipmt, Int_t qt, Int_t time, TString option="pdc") ;
   //  Int_t EquivalizeChannel(Int_t ipmt)  ;
  protected:
 
index 59e00822a3aa3850e304d448d0f2c82ac5855587..e04c1d157c05d49c1b40cdc3692e782c43aed2f1 100644 (file)
@@ -67,7 +67,7 @@ AliT0Reconstructor::AliT0Reconstructor(const AliT0Reconstructor &r):
                                             fdZonC(0),
                                             fZposition(0),
                                             fParam(NULL),
-                                            fAmpLEDrec()
+  fAmpLEDrec()
  {
   //
   // AliT0Reconstructor copy constructor
@@ -147,7 +147,7 @@ void AliT0Reconstructor::Reconstruct(TTree*digitsTree, TTree*clustersTree) const
       Double_t qt0 = Double_t(chargeQT0->At(ipmt));
       Double_t qt1 = Double_t(chargeQT1->At(ipmt));
       if((qt1-qt0)>0)  adc[ipmt] = TMath::Exp( Double_t (channelWidth*(qt1-qt0)/1000));
-      time[ipmt] = calib-> WalkCorrection( ipmt,Int_t(qt1) , timeCFD->At(ipmt) ) ;
+      time[ipmt] = calib-> WalkCorrection( ipmt,Int_t(qt1) , timeCFD->At(ipmt), "pdc" ) ;
       
       //LED
       Double_t sl = (timeLED->At(ipmt) - time[ipmt])*channelWidth;
@@ -223,6 +223,9 @@ void AliT0Reconstructor::Reconstruct(AliRawReader* rawReader, TTree*recTree) con
   TArrayI * chargeQT0 = new TArrayI(24); 
   TArrayI * chargeQT1 = new TArrayI(24); 
 
+  TString option = GetOption(); 
+  printf(" !!!!!!!!! option %s\n", option.Data());
+
   for (Int_t i0=0; i0<105; i0++)
     {
       for (Int_t j0=0; j0<50; j0++) allData[i0][j0]=0;         
@@ -272,37 +275,41 @@ void AliT0Reconstructor::Reconstruct(AliRawReader* rawReader, TTree*recTree) con
   Float_t time[24], adc[24];
   for (Int_t ipmt=0; ipmt<24; ipmt++) {
     if(timeCFD->At(ipmt)>0 ){
-      /* 
-     Double_t qt0 = Double_t(chargeQT0->At(ipmt));
-      Double_t qt1 = Double_t(chargeQT1->At(ipmt));
-      if((qt1-qt0)>0)  adc[ipmt] = TMath::Exp( Double_t (channelWidth*(qt1-qt0)/1000));
-      //      time[ipmt] = channelWidth * (calib-> WalkCorrection( ipmt,qt1 , timeCFD->At(ipmt) ) ) ;
-      time[ipmt] = calib-> WalkCorrection( ipmt,Int_t(qt1) , timeCFD->At(ipmt) ) ;
-      Double_t sl = (timeLED->At(ipmt) - time[ipmt])*channelWidth;
-      Double_t qt=((TGraph*)fAmpLEDrec.At(ipmt))->Eval(sl/1000.);
-      frecpoints->SetTime(ipmt,time[ipmt]);
-      frecpoints->SetAmp(ipmt,adc[ipmt]);
-      frecpoints->SetAmpLED(ipmt,qt);
-    AliDebug(1,Form(" QTC %f mv,  QTC  %f MIPS time in chann %f time %f ",adc[ipmt], adc[ipmt]/50.,time[ipmt], time[ipmt]*channelWidth));
-      */
-      Float_t qt0 = Float_t(chargeQT0->At(ipmt));
-      Float_t qt1 = Float_t(chargeQT1->At(ipmt));
-      if((qt0-qt1)>0)  adc[ipmt] = qt0-qt1;
-      time[ipmt] = calib-> WalkCorrection( ipmt, adc[ipmt], timeCFD->At(ipmt) ) ;
-      Double_t sl = timeLED->At(ipmt) - time[ipmt];
-      Double_t qt=((TGraph*)fAmpLEDrec.At(ipmt))->Eval(sl);
-      frecpoints->SetTime(ipmt,time[ipmt]);
-      frecpoints->SetAmp(ipmt,adc[ipmt]);
-      frecpoints->SetAmpLED(ipmt,qt);
-      AliDebug(10,Form(" QTC %f , time in chann %f ",adc[ipmt] ,time[ipmt]));
      
+      if(option == "pdc"){
+       Double_t qt0 = Double_t(chargeQT0->At(ipmt));
+       Double_t qt1 = Double_t(chargeQT1->At(ipmt));
+       if((qt1-qt0)>0)  adc[ipmt] = TMath::Exp( Double_t (channelWidth*(qt1-qt0)/1000));
+       //      time[ipmt] = channelWidth * (calib-> WalkCorrection( ipmt,qt1 , timeCFD->At(ipmt) ) ) ;
+       time[ipmt] = calib-> WalkCorrection( ipmt,Int_t(qt1) , timeCFD->At(ipmt) ) ;
+       Double_t sl = (timeLED->At(ipmt) - time[ipmt])*channelWidth;
+       Double_t qt=((TGraph*)fAmpLEDrec.At(ipmt))->Eval(sl/1000.);
+       frecpoints->SetTime(ipmt,time[ipmt]);
+       frecpoints->SetAmp(ipmt,adc[ipmt]);
+       frecpoints->SetAmpLED(ipmt,qt);
+       AliDebug(1,Form(" QTC %f mv,  QTC  %f MIPS time in chann %f time %f ",adc[ipmt], adc[ipmt]/50.,time[ipmt], time[ipmt]*channelWidth));
+      }
+      if(option == "cosmic") {
+       Float_t qt0 = Float_t(chargeQT0->At(ipmt));
+       Float_t qt1 = Float_t(chargeQT1->At(ipmt));
+       if((qt0-qt1)>0)  adc[ipmt] = qt0-qt1;
+       time[ipmt] = calib-> WalkCorrection( ipmt, Int_t(adc[ipmt]), timeCFD->At(ipmt) ) ;
+       Double_t sl = timeLED->At(ipmt) - time[ipmt];
+       Double_t qt=((TGraph*)fAmpLEDrec.At(ipmt))->Eval(sl);
+       frecpoints->SetTime(ipmt,time[ipmt]);
+       frecpoints->SetAmp(ipmt,adc[ipmt]);
+       frecpoints->SetAmpLED(ipmt,qt);
+       AliDebug(10,Form(" QTC %i , time in chann %i led %i ",
+                        Int_t(adc[ipmt]) ,Int_t(time[ipmt]),Int_t( qt)));
+      }
+      
     }
     else {
       time[ipmt] = 0;
       adc[ipmt] = 0;
     }
   }
-
+  
   for (Int_t ipmt=0; ipmt<12; ipmt++){
     if(time[ipmt] > 1 ) {
       if(time[ipmt]<besttimeC){
@@ -324,9 +331,10 @@ void AliT0Reconstructor::Reconstruct(AliRawReader* rawReader, TTree*recTree) con
   Float_t c = 0.0299792; // cm/ps
   Float_t vertex = 99999;
   if(besttimeA <9999999 && besttimeC < 9999999 ){
-    timeDiff = besttimeC - besttimeA;
-    //    meanTime = (meanT0 - (besttimeA + besttimeC)/2) * channelWidth;
-    meanTime =  (besttimeA + besttimeC)/2;  
+    timeDiff =( besttimeC - besttimeA) *channelWidth;
+    if(option == "pdc") 
+      meanTime = (meanT0 - (besttimeA + besttimeC)/2) * channelWidth;
+    if(option == "cosmic")   meanTime =  (besttimeA + besttimeC)/2;  
     vertex = c*(timeDiff)/2. + (fdZonA - fdZonC)/2; 
     AliDebug(1,Form("  timeDiff %f ps,  meanTime %f ps, vertex %f cm",timeDiff, meanTime,vertex ));
     frecpoints->SetVertex(vertex);