some viol fixed
authoralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 20 Nov 2007 07:53:24 +0000 (07:53 +0000)
committeralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 20 Nov 2007 07:53:24 +0000 (07:53 +0000)
T0/AliT0CalibLaserData.cxx
T0/AliT0CalibLaserData.h
T0/AliT0Parameters.h
T0/AliT0RawReader.cxx
T0/AliT0RawReader.h
T0/AliT0Reconstructor.cxx
T0/AliT0Reconstructor.h

index f08997f..015eeb6 100644 (file)
@@ -1,3 +1,27 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id:  */
+
+//____________________________________________________________________
+//                                                                          
+// T0 - T0. 
+//
+// This class privides GIU service for reading RAW data from Laser
+// during electronics test 
+//                                                       
 #include "TH1F.h"
 #include "TH2F.h"
 #include "TMap.h"
@@ -51,6 +75,10 @@ AliT0CalibLaserData::~AliT0CalibLaserData()
 
 void AliT0CalibLaserData::ReadHistSize(Int_t rNumber)
 {
+  //build GUI frame for reading:
+  // - run number
+  // - histograms rates
+
     fRunNumber = rNumber;
     
     TGMainFrame* fMain = new TGMainFrame(0,1500,1500);
@@ -138,21 +166,25 @@ void AliT0CalibLaserData::ReadHistSize(Int_t rNumber)
     
 void AliT0CalibLaserData::DoOk()
 {
-    printf("it worked !\n");
     //    delete fMain;
     fRunNumber = Int_t (fEntries[18]->GetNumber());
-    cout<<" RUN NUMBER "<<fRunNumber<<endl;
-    for( int i=0; i<18; i++ ) fHistLimits[i] = fEntries[i]->GetNumber();
-    for( int i=0; i<18; i++ ) cout<<fHistLimits[i]<<" ";
-    cout<<endl;
+    printf(" RUN NUMBER %i\n",fRunNumber);
+    for( int i=0; i<18; i++ ) 
+      fHistLimits[i] = fEntries[i]->GetNumber();
     ReadData();
 }
 
 void AliT0CalibLaserData::ReadData()
 {
+  // reading RAW data from test LCS
+  // filling histograms
+  // fillinf tree
+
 
       TH1F *hChannel[105];  TH1F *hQTC[12];  
-      TH2F *hCFD_QTC[12]; TH2F *hCFD_LED[12]; TH1F *h1CFD_LED[12];
+      TH2F *hCFDvsQTC[12]; TH2F *hCFDvsLED[12]; TH1F *h1CFDminLED[12];
       TH1F *hmpd[12];
       Int_t allData[110][5];
       Int_t numberOfHits[105];
@@ -189,7 +221,7 @@ void AliT0CalibLaserData::ReadData()
            b[key]=digitsTree->Branch(names[key].Data(),&channels[key], type);
           }
          else
-           {cout<<iline<<" no such value "<<endl;}
+           {printf(" no such value %i \n", iline);}
 
        } 
       for(Int_t ic=0; ic<12; ic++) {
@@ -197,18 +229,17 @@ void AliT0CalibLaserData::ReadData()
          sprintf(buf1,"QTC%i",ic+1);
          sprintf(buf2,"CFDvsQTC%i",ic+1);
          sprintf(buf3,"CFDvsLED%i",ic+1);
-         sprintf(buf4,"LED_CFD%i",ic+1);
+         sprintf(buf4,"LEDminCFD%i",ic+1);
          sprintf(buf7,"mpd%i",ic+1);
 
          hQTC[ic] = new TH1F(buf1,"QTC",(Int_t)fHistLimits[2],fHistLimits[0],fHistLimits[1]);
-         cout<<" hQTC "<<fHistLimits[2]<<" "<<fHistLimits[0]<<" "<<fHistLimits[1]<<endl;
-         h1CFD_LED[ic] = new TH1F(buf4,"LED - CFD",(Int_t)fHistLimits[5],fHistLimits[3],fHistLimits[4]);
-         cout<<" hLED-CFD  "<<fHistLimits[5]<<" "<<fHistLimits[3]<<" "<<fHistLimits[4]<<endl;
+         h1CFDminLED[ic] = new TH1F(buf4,"LED - CFD",(Int_t)fHistLimits[5],fHistLimits[3],fHistLimits[4]);
+
          hmpd[ic] = new TH1F(buf7,"mpd",20000,-10000.0,10000.0);
-         hCFD_QTC[ic] = new TH2F(buf2,"CFD vs  QTC",
+         hCFDvsQTC[ic] = new TH2F(buf2,"CFD vs QTC",
                                 (Int_t)fHistLimits[8],fHistLimits[6],fHistLimits[7],
                                 (Int_t)fHistLimits[11],fHistLimits[9],fHistLimits[10]);
-         hCFD_LED[ic] = new TH2F(buf3,"CFD vs LED-CFD",
+         hCFDvsLED[ic] = new TH2F(buf3,"CFD vs LED-CFD",
                                 (Int_t)fHistLimits[14],fHistLimits[12],fHistLimits[13],
                                 (Int_t)fHistLimits[17],fHistLimits[15],fHistLimits[16]);
 
@@ -217,7 +248,6 @@ void AliT0CalibLaserData::ReadData()
 
 
       }
-      //   cout<<" hist created "<<endl;
 
       TH1F*hEffCFD= new TH1F("hEffCFD","Effeciency",50,-0.25,24.25);
       TH1F*hEffLED= new TH1F("hEffLED","Effeciency",50,-0.25,24.25);
@@ -252,8 +282,7 @@ void AliT0CalibLaserData::ReadData()
       
        if(event%1000 == 0) printf("Event:%d\n",event);
 
-          if(event > 200000) break;
-       //  cout<<"!!!!  Event Number "<< event-2<<endl;
+       //          if(event > 200000) break;
 
            for (Int_t it = 0; it<24; it=it+2)
              {
@@ -262,17 +291,14 @@ void AliT0CalibLaserData::ReadData()
                if(allData[it+25][iHit] != 0 && allData[it+26][iHit] !=0)
                  {
                    Int_t cc=it/2;
-                   // if( allData[56][0]-allData[0][0] > 0) 
                    hQTC[cc]->Fill(allData[it+25][iHit]-allData[it+26][iHit]);
-//                 if( allData[55][0]-allData[0][0] > 0) hQTCc[cc]->Fill(allData[it+26][iHit]-allData[it+25][iHit]);
                    hmpd[cc]->Fill(allData[it+26][iHit]-allData[it+25][iHit]);
-                   if(allData[cc+1][iHit] != 0 ) hCFD_QTC[cc]->Fill(allData[it+25][iHit]-allData[it+26][iHit],allData[cc+1][iHit]-allData[0][0]);
+                   if(allData[cc+1][iHit] != 0 ) hCFDvsQTC[cc]->Fill(allData[it+25][iHit]-allData[it+26][iHit],allData[cc+1][iHit]-allData[0][0]);
                    if(allData[cc+1][iHit] != 0 && allData[cc+13][iHit]!=0 ) 
                      {
-                       hCFD_LED[cc]->Fill(allData[cc+13][iHit]-allData[cc+1][iHit],allData[cc+1][iHit]-allData[0][0]);  
-                       h1CFD_LED[cc]->Fill(allData[cc+13][iHit]-allData[cc+1][iHit]);
+                       hCFDvsLED[cc]->Fill(allData[cc+13][iHit]-allData[cc+1][iHit],allData[cc+1][iHit]-allData[0][0]);  
+                       h1CFDminLED[cc]->Fill(allData[cc+13][iHit]-allData[cc+1][iHit]);
                      }
-                   //  cout<<allData[cc+1][iHit]-allData[0][0]<<" "<<cc<<endl;
                  }
              }
          }
@@ -300,21 +326,20 @@ void AliT0CalibLaserData::ReadData()
 
      if (event>1)
        {
-         cout<<"efficiency for "<<event<<" events"<<endl;
+         printf("efficiency for %i events \n",event);
          for (Int_t i0=1; i0<13;  i0++)
            {
-
-             cout<<names[i0].Data()<<" "<<Float_t(numberOfHits[i0])/Float_t(event)<<" ";
-             cout<<names[i0+13].Data()<<" "<<Float_t(numberOfHits[i0])/Float_t(event)<<" ";
-             cout<<names[i0+57].Data()<<" "<<Float_t(numberOfHits[i0])/Float_t(event)<<" ";
-             cout<<names[i0+69].Data()<<" "<<Float_t(numberOfHits[i0])/Float_t(event)<<endl;
+             printf("%s  %f  %s  %f %s  %f  %s  %f \n",
+                    names[i0].Data(), Float_t(numberOfHits[i0])/Float_t(event),
+                    names[i0+13].Data(),Float_t(numberOfHits[i0+13])/Float_t(event),
+                    names[i0+57].Data(),Float_t(numberOfHits[i0+57])/Float_t(event),
+                    names[i0+69].Data(),Float_t(numberOfHits[i0+69])/Float_t(event));
 
              hEffCFD->Fill(i0,Float_t(numberOfHits[i0])  / Float_t(event));
              hEffLED->Fill(i0,Float_t(numberOfHits[i0+13]) / Float_t(event));
              hEffCFD->Fill(i0+12,Float_t(numberOfHits[i0+57]) /Float_t(event));
              hEffLED->Fill(i0+12,Float_t(numberOfHits[i0+69]) /Float_t(event));
            }
-         cout<<endl;
 
          for (Int_t i0=0; i0<24;  i0=i0+2)
            {
@@ -322,12 +347,12 @@ void AliT0CalibLaserData::ReadData()
              hEffQT0->Fill(i0, Float_t (numberOfHits[i0]+26) / Float_t(event));
              hEffQT1->Fill((i0+12), Float_t (numberOfHits[i0]+81) /  Float_t(event));
              hEffQT0->Fill((i0+12), Float_t (numberOfHits[i0]+82) /  Float_t(event));
-             cout<<names[i0+25].Data()<<" "<<Float_t(numberOfHits[i0+25])/Float_t(event)<<" ";
-             cout<<names[i0+26].Data()<<" "<<Float_t(numberOfHits[i0+26])/Float_t(event)<<" ";
-             cout<<names[i0+81].Data()<<" "<<Float_t(numberOfHits[i0]+81)/Float_t(event)<<" ";
-             cout<<names[i0+82].Data()<<" "<<Float_t(numberOfHits[i0]+82)/Float_t(event)<<endl;
-
 
+             printf("%s  %f  %s  %f %s  %f  %s  %f \n",
+                    names[i0+25].Data(), Float_t(numberOfHits[i0+25])/Float_t(event),
+                    names[i0+26].Data(),Float_t(numberOfHits[i0+26])/Float_t(event),
+                    names[i0+81].Data(),Float_t(numberOfHits[i0+81])/Float_t(event),
+                    names[i0+82].Data(),Float_t(numberOfHits[i0+82])/Float_t(event));
            }
        }             
 
@@ -336,8 +361,7 @@ void AliT0CalibLaserData::ReadData()
      sprintf(filehist,"t0tree%i.root",fRunNumber);
      //  sprintf(filehist,"test.root",runNumber);
      TFile *hist = new TFile(filehist,"RECREATE");
-      cout<<" writing hist in file "<<filehist<<endl;
-      hist->cd();
+       hist->cd();
       //  digitsTree->Write("",TObject::kOverwrite);
 
       hEffCFD->Write();
@@ -351,11 +375,9 @@ void AliT0CalibLaserData::ReadData()
        {
          hQTC[i]->Write();
          hmpd[i]->Write();
-         hCFD_QTC[i]->Write();
-         hCFD_LED[i]->Write();
-         h1CFD_LED[i]->Write();
+         hCFDvsQTC[i]->Write();
+         hCFDvsLED[i]->Write();
+         h1CFDminLED[i]->Write();
        }
-     
-      cout<<" hist in file"<<endl;
-
+      
 }
index 31f3097..a920dac 100644 (file)
@@ -1,9 +1,13 @@
 #ifndef AliT0CalibLaserData_H
 #define AliT0CalibLaserData_H
-
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
+/***************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
+ * reserved. 
+ *
+ * Alla Maevskaya INR RAS alla@inr.ru
+ *
+ * See cxx source for full Copyright notice                               
+ ***************************************************************************/
 #include "TGNumberEntry.h"
 #include "TObject.h"
 
@@ -20,10 +24,9 @@ class AliT0CalibLaserData : public TObject
   void            ReadData();
 
  private:
- // void            ReadData();
-  Int_t           fRunNumber;
-  TGNumberEntry * fEntries[30];
-  double          fHistLimits[30];
+  Int_t           fRunNumber;       // run number
+  TGNumberEntry * fEntries[30];     //for GUI
+  double          fHistLimits[30];  // histogram limits
 
   ClassDef(AliT0CalibLaserData,1)
 };
index f51a59f..b9d7221 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                               
  */
index dbdff01..9b2b01f 100644 (file)
@@ -1,3 +1,25 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id:  */
+
+//____________________________________________________________________
+//                                                                          
+// T0 
+// Class for reading T0 RAW data in TOF data format
+//
 #include "AliT0RawReader.h"
 #include "AliT0Parameters.h"
 #include "AliBitPacking.h"
@@ -81,10 +103,10 @@ Bool_t  AliT0RawReader::Next()
   Int_t numberOfWordsInTRM=0, iTRM=0;
   Int_t tdcTime, koef,hit=0;
   Int_t koefhits[110];
-    Int_t  TRM_CHAIN_0_HEADER =  0x00000000;
-  Int_t  TRM_CHAIN_0_TRAILER =  0x10000000;
+  Int_t trm_chain_header =  0x00000000;
+  Int_t  trm_chain_trailer =  0x10000000;
   
-  Int_t  FILLER =  0x70000000;
+  Int_t  filler =  0x70000000;
   Bool_t correct=kTRUE;
   Int_t header;
 
@@ -105,6 +127,7 @@ Bool_t  AliT0RawReader::Next()
     //DRM header
     for (Int_t i=0; i<6; i++) {
       word = GetNextWord();
+      //      cout<<" DRM header "<<word<<endl;
       header = AliBitPacking::UnpackWord(word,28,31);
       if( header !=4 )
        {
@@ -113,13 +136,13 @@ Bool_t  AliT0RawReader::Next()
          break;
        }
     }
-    
+    //    cout<<"   fNTRM "<<fNTRM<<endl;
     for (Int_t ntrm=0; ntrm< fNTRM; ntrm++)
       {
        //TRMheader  
        word = GetNextWord();
        header = AliBitPacking::UnpackWord(word,28,31);
-//     cout<<" TRM header "<<word<<endl;
+       //      cout<<" TRM header "<<word<<endl;
        if ( header != 4 )
          {
            AliWarning(Form(" !!!! wrong TRM header  %x!!!!", word));
@@ -127,15 +150,15 @@ Bool_t  AliT0RawReader::Next()
            break;
          }
        numberOfWordsInTRM=AliBitPacking::UnpackWord(word,4,16);
-//     cout<<" numberOfWordsInTRM "<<numberOfWordsInTRM<<endl;
+       //      cout<<" numberOfWordsInTRM "<<numberOfWordsInTRM<<endl;
        iTRM=AliBitPacking::UnpackWord(word,0,3);
        for( Int_t ichain=0; ichain<2; ichain++)
          {
            //chain header
            word = GetNextWord();
-//         cout<<" chain header "<<word<<endl;
-           uu = word & TRM_CHAIN_0_HEADER;
-           if(uu != TRM_CHAIN_0_HEADER) 
+           //      cout<<" chain header "<<word<<endl;
+           uu = word & trm_chain_header;
+           if(uu != trm_chain_header) 
              {
                AliWarning(Form(" !!!! wrong CHAIN  0  header %x!!!!", word));
                fRawReader->AddMajorErrorLog(kWrongChain0Header,Form("w=%x",word));
@@ -144,19 +167,19 @@ Bool_t  AliT0RawReader::Next()
            word = GetNextWord();
 //         cout<<" next "<<word<<endl;
            tdcTime =  AliBitPacking::UnpackWord(word,31,31);   
-//         for (; tdcTime==1; tdcTime) 
-       while(tdcTime==1)
+           //      for (; tdcTime==1; tdcTime) 
+           while(tdcTime==1)
              {
-//                     cout<<" packed "<<word<<endl;
+               //                      cout<<" packed "<<word<<endl;
                itdc=AliBitPacking::UnpackWord(word,24,27);
                ichannel=AliBitPacking::UnpackWord(word,21,23);
                time=AliBitPacking::UnpackWord(word,0,20);
                
                koef = fParam->GetChannel(iTRM,itdc,ichain,ichannel);
-                       if (koef != 0 ) 
-//               cout<<"RawReader>> "<<"koef "<<koef<<" trm "<<iTRM<<
-//                 " tdc "<<itdc<<" chain "<<ichain<<
-//                 " channel "<<ichannel<<" time "<<time<<endl;
+               if (koef != 0 ) 
+                 //              cout<<"RawReader>> "<<"koef "<<koef<<" trm "<<iTRM<<
+                 //                " tdc "<<itdc<<" chain "<<ichain<<
+                 //                " channel "<<ichannel<<" time "<<time<<endl;
                if (koef ==-1 ){
                  AliWarning(Form("Incorrect lookup table ! "));
                  fRawReader->AddMajorErrorLog(kIncorrectLUT);
@@ -171,24 +194,24 @@ Bool_t  AliT0RawReader::Next()
                  fAllData[koef][hit]=time; 
                  koefhits[koef]++;
                }
-                 word = GetNextWord();
-//               cout<<" next word in cycle "<<word<<endl;
-                 tdcTime =  AliBitPacking::UnpackWord(word,31,31);   
+               word = GetNextWord();
+               //              cout<<" next word in cycle "<<word<<endl;
+               tdcTime =  AliBitPacking::UnpackWord(word,31,31);   
                
-           }
+             }
            
-//         cout<<" chain trailer "<<word<<endl;
-           uu = word&TRM_CHAIN_0_TRAILER;
-           if(uu != TRM_CHAIN_0_TRAILER )
+           //      cout<<" chain trailer "<<word<<endl;
+           uu = word&trm_chain_trailer;
+           if(uu != trm_chain_trailer )
              {
                AliWarning(Form(" !!!! wrong CHAIN 0 trailer %x !!!!", word));
-                 fRawReader->AddMajorErrorLog(kWrongChain0Trailer,Form("w=%x",word));
+               fRawReader->AddMajorErrorLog(kWrongChain0Trailer,Form("w=%x",word));
                break;
              }
          }
             
        word = GetNextWord(); //TRM trailer
-//     cout<<" TRM trailer "<<word<<endl;
+       //      cout<<" TRM trailer "<<word<<endl;
        header = AliBitPacking::UnpackWord(word,28,31);
        if( header !=5 )
          {
@@ -198,7 +221,8 @@ Bool_t  AliT0RawReader::Next()
          }
       } //TRM loop
     word = GetNextWord(); //
-    if (word == FILLER )  word = GetNextWord(); 
+    //    cout<<" after TRM trailer "<<word<<endl;
+    if (word == filler )  word = GetNextWord(); 
      header = AliBitPacking::UnpackWord(word,28,31);
      if( header !=5 )
        {
index e74d704..b1e2a5c 100644 (file)
@@ -1,15 +1,25 @@
 #ifndef ALIT0RAWREADER_H
 #define ALIT0RAWREADER_H
+/***************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
+ * reserved. 
+ *
+ * Alla Maevskaya INR RAS alla@inr.ru
+ *
+ * See cxx source for full Copyright notice                               
+ ***************************************************************************/
+
  
 #include <TTask.h>
-#include <Riostream.h>
 #include "AliRawReader.h"
 #include "AliT0Parameters.h"
+
+  
 class AliT0RawReader : public TTask {
   public :
 
-  AliT0RawReader(AliRawReader *rawReader,Bool_t isOnline = kFALSE) ;
+    //  AliT0RawReader(AliRawReader *rawReader,Bool_t isOnline = kFALSE) ;
+  AliT0RawReader(AliRawReader *rawReader,Bool_t isOnline = kTRUE) ;
 
   virtual  ~AliT0RawReader();
   AliT0RawReader(const AliT0RawReader& o): TTask(o),
@@ -26,8 +36,8 @@ class AliT0RawReader : public TTask {
   Bool_t  Next(); //read next raw digit
   Int_t            GetPosition();
   UInt_t         GetNextWord();
-  Int_t GetData(Int_t channel, Int_t hit) {return fAllData[channel][hit];}
-  //  void SetNumberOfTRM(Int_t trm=2) {fNTRM=trm;}
+  Int_t GetData( Int_t channel, Int_t hit) {return fAllData[channel][hit];}
+
 
   enum ET0RawReaderError {
     kIncorrectDataSize = 1,
@@ -49,11 +59,10 @@ class AliT0RawReader : public TTask {
   AliRawReader*    fRawReader;    // object for reading the raw data
   UChar_t*         fData;         // raw data
   Int_t            fPosition;     // current (32 bit) position in fData
-  AliT0Parameters *fParam;
-//  Int_t            fNTRM; //number of TRMs, 1 - testbeam; 2 - simulation
-  Bool_t           fIsOnline;
+  AliT0Parameters *fParam;       // instanse of  Parameters class
+  Bool_t           fIsOnline;     // for case online DA usage
   
-  Int_t fAllData[110][5];
+  Int_t            fAllData[110][5]; // container for raw data
   
  ClassDef(AliT0RawReader,2) //class for reading T0 Raw data
 };
index de8c0d1..411ffd9 100644 (file)
 #include <TArrayI.h>
 #include <TGraph.h>
 #include <TMath.h>
-//#include <TGeoManager.h>
-//#include <TClonesArray.h>
-//#include <TString.h>
-//#include <TGeoPNEntry.h>
-//#include <TGeoPhysicalNode.h>
-//#include  <TGeoHMatrix.h>
 
 ClassImp(AliT0Reconstructor)
 
   AliT0Reconstructor:: AliT0Reconstructor(): AliReconstructor(),
-  fZposition(0),
-  fParam(NULL),
-  fAmpLEDrec(),
-  fdZ_A(0),
-  fdZ_C(0)
+                                            fdZonA(0),
+                                            fdZonC(0),
+                                            fZposition(0),
+                                            fParam(NULL),
+                                            fAmpLEDrec()
 {
  AliDebug(1,"Start reconstructor ");
   
@@ -63,20 +57,20 @@ ClassImp(AliT0Reconstructor)
     fAmpLEDrec.AddAtAndExpand(gr,i) ;  
     fTime0vertex[i]= fParam->GetTimeDelayDA(i);
   }
-  fdZ_C = TMath::Abs(fParam->GetZPositionShift("T0/C/PMT1"));
-  fdZ_A = TMath::Abs(fParam->GetZPositionShift("T0/A/PMT15"));
+  fdZonC = TMath::Abs(fParam->GetZPositionShift("T0/C/PMT1"));
+  fdZonA = TMath::Abs(fParam->GetZPositionShift("T0/A/PMT15"));
 
 }
 //____________________________________________________________________
 
 AliT0Reconstructor::AliT0Reconstructor(const AliT0Reconstructor &r):
   AliReconstructor(r),
-  fZposition(0),
-  fParam(NULL),
-  fAmpLEDrec(),
-  fdZ_A(0),
-  fdZ_C(0)
-{
+                                            fdZonA(0),
+                                            fdZonC(0),
+                                            fZposition(0),
+                                            fParam(NULL),
+                                            fAmpLEDrec()
+ {
   //
   // AliT0Reconstructor copy constructor
   //
@@ -125,8 +119,8 @@ void AliT0Reconstructor::Reconstruct(TTree*digitsTree, TTree*clustersTree) const
   if (brDigits) {
     brDigits->SetAddress(&fDigits);
   }else{
-    cerr<<"EXEC Branch T0 digits not found"<<endl;
-    return;
+    AliError(Form("EXEC Branch T0 digits not found"));
+     return;
   }
   
   digitsTree->GetEvent(0);
@@ -192,7 +186,7 @@ void AliT0Reconstructor::Reconstruct(TTree*digitsTree, TTree*clustersTree) const
   if(besttimeA !=999999 && besttimeC != 999999 ){
     timeDiff =(besttimeC - besttimeA)*channelWidth;
     meanTime = (meanT0 - (besttimeA + besttimeC)/2) * channelWidth;
-    vertex = c*(timeDiff)/2. + (fdZ_A - fdZ_C)/2; //-(lenr-lenl))/2;
+    vertex = c*(timeDiff)/2. + (fdZonA - fdZonC)/2; //-(lenr-lenl))/2;
     AliDebug(1,Form("  timeDiff %f ps,  meanTime %f ps, vertex %f cm",timeDiff, meanTime,vertex ));
     frecpoints->SetVertex(vertex);
     frecpoints->SetMeanTime(Int_t(meanTime));
@@ -313,7 +307,7 @@ void AliT0Reconstructor::Reconstruct(AliRawReader* rawReader, TTree*recTree) con
   if(besttimeA !=999999 && besttimeC != 999999 ){
     timeDiff = (besttimeC - besttimeA)*channelWidth;
     meanTime = (meanT0 - (besttimeA + besttimeC)/2) * channelWidth;   
-    vertex = c*(timeDiff)/2. + (fdZ_A - fdZ_C)/2; //-(lenr-lenl))/2;
+    vertex = c*(timeDiff)/2. + (fdZonA - fdZonC)/2; //-(lenr-lenl))/2;
     AliDebug(1,Form("  timeDiff %f ps,  meanTime %f ps, vertex %f cm",timeDiff, meanTime,vertex ));
     frecpoints->SetVertex(vertex);
     frecpoints->SetMeanTime(Int_t(meanTime));
@@ -361,26 +355,24 @@ void AliT0Reconstructor::FillESD(TTree */*digitsTree*/, TTree *clustersTree, Ali
   if (brRec) {
     brRec->SetAddress(&frecpoints);
   }else{
-    cerr<<"EXEC Branch T0 rec not found"<<endl;
-    // exit(111);
+    AliError(Form("EXEC Branch T0 rec not found"));
     return;
   } 
     
     brRec->GetEntry(0);
-    Float_t timeStart, Zposition, amp[24], time[24];
-    Int_t i;
-    Zposition = frecpoints -> GetVertex();
-    timeStart = frecpoints -> GetMeanTime() ;
-    for ( i=0; i<24; i++) {
+    Float_t amp[24], time[24];
+    Float_t  zPosition = frecpoints -> GetVertex();
+    Float_t timeStart = frecpoints -> GetMeanTime() ;
+    for ( Int_t i=0; i<24; i++) {
       time[i] = Float_t (frecpoints -> GetTime(i)); // ps to ns
       amp[i] = frecpoints -> GetAmp(i);
     }
-    pESD->SetT0zVertex(Zposition); //vertex Z position 
+    pESD->SetT0zVertex(zPosition); //vertex Z position 
     pESD->SetT0(timeStart);        // interaction time 
     pESD->SetT0time(time);         // best TOF on each PMT 
     pESD->SetT0amplitude(amp);     // number of particles(MIPs) on each PMT
  
-    AliDebug(1,Form(" Z position %f cm,  T0  %f ps",Zposition , timeStart));
+    AliDebug(1,Form(" Z position %f cm,  T0  %f ps",zPosition , timeStart));
 
 } // vertex in 3 sigma
 
index 5737da8..1f696d5 100644 (file)
@@ -2,42 +2,40 @@
 #define ALIT0RECONSTRUCTOR_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
-
+/*  Alla Maevskaya INR RAS alla@inr.ru */
 /* $Id$ */
 
+
 #include "AliReconstructor.h"
-#include "AliT0digit.h"
+#include "AliT0Parameters.h"
 #include "AliT0.h"
 
 class AliT0Reconstructor: public AliReconstructor {
  public:
   AliT0Reconstructor();
   virtual ~AliT0Reconstructor() {};
-  AliT0Reconstructor( const AliT0Reconstructor& );
-  AliT0Reconstructor& operator=(const AliT0Reconstructor&); 
+  AliT0Reconstructor( const AliT0Reconstructor&r );
+  AliT0Reconstructor& operator=(const AliT0Reconstructor&r); 
 
 
   virtual  void   Reconstruct(TTree* fdigits, TTree * frecpoints) const;
   virtual  void   Reconstruct(AliRawReader*rawReader , TTree* recTree) const;
   
-  virtual void         FillESD( AliRawReader*,  TTree*clustersTree, AliESDEvent*esd ) const
+  virtual void     FillESD( AliRawReader*/*rawReader*/,  TTree*clustersTree, AliESDEvent*esd ) const
   {FillESD((TTree*)NULL,clustersTree,esd);}
-  virtual void         FillESD( TTree*,  TTree*, AliESDEvent* ) const;
+  virtual void     FillESD( TTree* digitsTree,  TTree*clustersTree, AliESDEvent*esd ) const;
 
-  virtual Bool_t       HasDigitConversion() const {return kFALSE;}
- public:
-  Float_t              fZposition; // vertex position
-  
+  virtual Bool_t   HasDigitConversion() const {return kFALSE;}
+   
  protected:
+  Float_t             fdZonA;             // Zideal - Zreal side A 
+  Float_t             fdZonC;             // Zideal - Zreal side C
+  Float_t             fZposition;        // vertex position
+  Float_t             fTime0vertex[24];  // time position if Zvertex=0
   AliT0Parameters     *fParam;           //pointer to T0 parameters class     
   TObjArray           fAmpLEDrec;        // amp LED-CFD 
-  Float_t             fTime0vertex[24];  // time position if Zvertex=0
-  Float_t             fdZ_A;   // Zideal - Zreal side A 
-  Float_t             fdZ_C; // Zideal - Zreal side C
-
 
-  ClassDef(AliT0Reconstructor, 0)   // class for the T0 reconstruction
+  ClassDef(AliT0Reconstructor, 1)   // class for the T0 reconstruction
 
 };