]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Change TOF digit Time, Tot etc to int type
authorarcelli <arcelli@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 30 Apr 2007 15:22:31 +0000 (15:22 +0000)
committerarcelli <arcelli@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 30 Apr 2007 15:22:31 +0000 (15:22 +0000)
15 files changed:
TOF/AliTOF.cxx
TOF/AliTOF.h
TOF/AliTOFClusterFinder.cxx
TOF/AliTOFDigitizer.cxx
TOF/AliTOFRawStream.cxx
TOF/AliTOFRawStream.h
TOF/AliTOFSDigit.cxx
TOF/AliTOFSDigit.h
TOF/AliTOFSDigitizer.cxx
TOF/AliTOFcluster.cxx
TOF/AliTOFcluster.h
TOF/AliTOFdigit.cxx
TOF/AliTOFdigit.h
TOF/AliTOFrawData.cxx
TOF/AliTOFrawData.h

index a1eb62f8c407b310504e9dc056b160bdd3831e17..4a62eb2699333bd547624b12e879f73b1373380a 100644 (file)
@@ -319,7 +319,7 @@ void AliTOF::AddT0Hit(Int_t track, Int_t *vol, Float_t *hits)
 }
 
 //_____________________________________________________________________________
-void AliTOF::AddDigit(Int_t *tracks, Int_t *vol, Float_t *digits)
+void AliTOF::AddDigit(Int_t *tracks, Int_t *vol, Int_t *digits)
 {
   //
   // Add a TOF digit
@@ -330,7 +330,7 @@ void AliTOF::AddDigit(Int_t *tracks, Int_t *vol, Float_t *digits)
 }
 
 //_____________________________________________________________________________
-void AliTOF::AddSDigit(Int_t tracknum, Int_t *vol, Float_t *digits)
+void AliTOF::AddSDigit(Int_t tracknum, Int_t *vol, Int_t *digits)
 {
      
 //
@@ -630,7 +630,7 @@ AliDigitizer* AliTOF::CreateDigitizer(AliRunDigitizer* manager) const
 }
 
 //___________________________________________________________________________
-Bool_t AliTOF::CheckOverlap(Int_t* vol, Float_t* digit,Int_t Track)
+Bool_t AliTOF::CheckOverlap(Int_t* vol, Int_t* digit,Int_t Track)
 {
 //
 // Checks if 2 or more hits belong to the same pad.
@@ -654,8 +654,8 @@ Bool_t AliTOF::CheckOverlap(Int_t* vol, Float_t* digit,Int_t Track)
       if (vol[i]!=vol2[i]) idem=kFALSE;}
 
     if (idem){  // same pad fired
-      Float_t tdc2 = digit[0];
-      Float_t tdc1 = currentDigit->GetTdc();
+      Int_t tdc2 = digit[0];
+      Int_t tdc1 = currentDigit->GetTdc();
 
       // we separate two digits on the same pad if
       // they are separated in time by at least 25 ns
@@ -675,7 +675,7 @@ Bool_t AliTOF::CheckOverlap(Int_t* vol, Float_t* digit,Int_t Track)
        overlap = kTRUE;
        return overlap;
       } else 
-               overlap= kFALSE;
+       overlap= kFALSE;
 
     } // close if (idem) -> two digits on the same TOF pad
 
index aedd0821ead278dc1ffc83d9c48dfbefea29a5ec..ce331180653d938564a57bd0e140c13511b3e61e 100644 (file)
@@ -45,8 +45,8 @@ public:
   virtual void    AddHit(Int_t track, Int_t* vol, Float_t* hits);
   virtual void    AddT0Hit(Int_t track, Int_t* vol, Float_t* hits);
   virtual void    AddDigit(Int_t* /*tracks*/, Int_t* /*vol*/) {};
-  virtual void    AddDigit(Int_t* tracks, Int_t* vol, Float_t* digits);
-  virtual void    AddSDigit(Int_t tracknum, Int_t* vol, Float_t* digits);
+  virtual void    AddDigit(Int_t* tracks, Int_t* vol, Int_t* digits);
+  virtual void    AddSDigit(Int_t tracknum, Int_t* vol, Int_t* digits);
   virtual void    CreateGeometry();
   virtual void    CreateMaterials(){};
   virtual void    Init();
@@ -67,7 +67,7 @@ public:
   //virtual void   DrawDetectorModulesinFrame()=0;
   //virtual void   DrawDetectorStripsinFrame()=0;
           void    CreateTOFFolders();
-  Bool_t    CheckOverlap(Int_t* vol, Float_t* digit, Int_t Track);
+  Bool_t    CheckOverlap(Int_t* vol, Int_t* digit, Int_t Track);
   //virtual void    Hits2Digits();   
   virtual void    Hits2SDigits();
   virtual void    Hits2SDigits(Int_t evNumber1, Int_t evNumber2);
@@ -112,7 +112,7 @@ protected:
  
 private:
 
-  ClassDef(AliTOF,7)  // Time Of Flight base class
+  ClassDef(AliTOF,8)  // Time Of Flight base class
 };
  
 #endif /* ALITOF_H */
index ad8882a4093d52014a6553be03a7fa18c1ad84b3..b06f84224751747c20bca757591b7c9809973f18 100644 (file)
@@ -15,6 +15,9 @@
 
 /* 
 $Log$
+Revision 1.24  2007/04/27 11:19:31  arcelli
+updates for the new decoder
+
 Revision 1.23  2007/04/23 16:51:39  decaro
 Digits-to-raw_data conversion: correction for a more real description (A.De Caro, R.Preghenella)
 
@@ -251,11 +254,11 @@ void AliTOFClusterFinder::Digits2RecPoints(Int_t iEvent)
   AliDebug(2,Form("Number of TOF digits: %d",nDigits));
 
   Int_t ii, jj;
-  Int_t dig[5];
-  Float_t g[3];
-  Double_t h[5];
-  Float_t tToT;
-  Double_t tTdcND;
+  Int_t dig[5]; //cluster detector indeces
+  Float_t g[3]; //cluster cartesian coord
+  Double_t h[3]; // the cluster spatial cyl. coordinates
+  Int_t  parTOF[5]; //The TOF signal parameters
+  Bool_t status=kTRUE; // assume all sim channels ok in the beginning...
   for (ii=0; ii<nDigits; ii++) {
     AliTOFdigit *d = (AliTOFdigit*)digits->UncheckedAt(ii);
     dig[0]=d->GetSector();
@@ -264,7 +267,7 @@ void AliTOFClusterFinder::Digits2RecPoints(Int_t iEvent)
     dig[3]=d->GetPadz();
     dig[4]=d->GetPadx();
 
-    //AliInfo(Form(" %2i  %1i  %2i  %1i  %2i ",dig[0],dig[1],dig[2],dig[3],dig[4]));
+    //    AliDebug(2,Form(" %2i  %1i  %2i  %1i  %2i ",dig[0],dig[1],dig[2],dig[3],dig[4]));
 
     for (jj=0; jj<3; jj++) g[jj] = 0.;
     fTOFGeometry->GetPos(dig,g);
@@ -272,13 +275,13 @@ void AliTOFClusterFinder::Digits2RecPoints(Int_t iEvent)
     h[0] = TMath::Sqrt(g[0]*g[0]+g[1]*g[1]);
     h[1] = TMath::ATan2(g[1],g[0]);
     h[2] = g[2];
-    h[3] = d->GetTdc();
-    h[4] = d->GetAdc();
-    tToT = d->GetToT();
-    tTdcND = d->GetTdcND();
 
-    AliTOFcluster *tofCluster = new AliTOFcluster(h,d->GetTracks(),dig,ii,tToT, tTdcND);
-    tofCluster->SetTDCRAW(d->GetTdc());
+    parTOF[0] = d->GetTdc(); //the TDC signal
+    parTOF[1] = d->GetToT(); //the ToT signal
+    parTOF[2] = d->GetAdc(); // the adc charge
+    parTOF[3] = d->GetTdcND(); // non decalibrated sim time
+    parTOF[4] = d->GetTdc(); // raw time, == Tdc time for the moment
+    AliTOFcluster *tofCluster = new AliTOFcluster(h,dig,parTOF,status,d->GetTracks(),ii);
     InsertCluster(tofCluster);
 
   }
@@ -325,9 +328,8 @@ void AliTOFClusterFinder::Digits2RecPoints(AliRawReader *rawReader,
 
   Int_t detectorIndex[5];
   Float_t position[3];
-  Double_t cylindricalPosition[5];
-  Float_t tToT;
-  Double_t tTdcND;
+  Double_t cylindricalPosition[3];
+  Int_t parTOF[5];
 
   ofstream ftxt;
   if (fVerbose==2) ftxt.open("TOFdigitsRead.txt",ios::app);
@@ -385,24 +387,23 @@ void AliTOFClusterFinder::Digits2RecPoints(AliRawReader *rawReader,
       cylindricalPosition[0] = TMath::Sqrt(position[0]*position[0] + position[1]*position[1]);
       cylindricalPosition[1] = TMath::ATan2(position[1], position[0]);
       cylindricalPosition[2] = position[2];
-      cylindricalPosition[3] = tofRawDatum->GetTOF();
-      cylindricalPosition[4] = tofRawDatum->GetTOT();
-      tToT = tofRawDatum->GetTOT();
-      tTdcND = -1.;
-      AliTOFcluster *tofCluster = new AliTOFcluster(cylindricalPosition, detectorIndex);
-      tofCluster->SetToT(tToT);
-      tofCluster->SetTDCND(tTdcND);
-      tofCluster->SetTDCRAW(tofRawDatum->GetTOF());
+
+      parTOF[0] = tofRawDatum->GetTOF(); //TDC
+      parTOF[1] = tofRawDatum->GetTOT(); // TOT
+      parTOF[2] = tofRawDatum->GetTOT(); //ADC==TOF
+      parTOF[3] = -1;//raw data: no track of undecalib sim time
+      parTOF[4] = tofRawDatum->GetTOF(); // RAW time
+      AliTOFcluster *tofCluster = new AliTOFcluster(cylindricalPosition, detectorIndex, parTOF);
       InsertCluster(tofCluster);
 
       if (fVerbose==2) {
-       if (cylindricalPosition[4]<10)                        ftxt << "        " << cylindricalPosition[4];
-       else if (cylindricalPosition[4]>=10 && cylindricalPosition[4]<100) ftxt << "       " << cylindricalPosition[4];
-       else                                     ftxt << "      " << cylindricalPosition[4];
-       if (cylindricalPosition[3]<10)                             ftxt << "      " << cylindricalPosition[3] << endl;
-       else if (cylindricalPosition[3]>=10 && cylindricalPosition[3]<100)   ftxt << "     " << cylindricalPosition[3] << endl;
-       else if (cylindricalPosition[3]>=100 && cylindricalPosition[3]<1000) ftxt << "    " << cylindricalPosition[3] << endl;
-       else                                             ftxt << "   " << cylindricalPosition[3] << endl;
+       if (parTOF[1]<10)ftxt << "        " << parTOF[1];
+       else if (parTOF[1]>=10 && parTOF[1]<100) ftxt << "      " << parTOF[1];
+       else ftxt << "      " << parTOF[1];
+       if (parTOF[0]<10) ftxt << "      " << parTOF[0] << endl;
+       else if (parTOF[0]>=10 && parTOF[0]<100)   ftxt << "    " << parTOF[0] << endl;
+       else if (parTOF[0]>=100 && parTOF[0]<1000) ftxt << "    " << parTOF[0] << endl;
+       else ftxt << "   " << parTOF[3] << endl;
       }
 
     } // closed loop on TOF raw data per current DDL file
@@ -411,53 +412,6 @@ void AliTOFClusterFinder::Digits2RecPoints(AliRawReader *rawReader,
 
   } // closed loop on DDL index
 
-  /*
-  Int_t indexDDL = 0;
-  for (indexDDL = 0; indexDDL < kDDL; indexDDL++) {
-
-    rawReader->Reset();
-    AliTOFRawStream tofInput(rawReader);
-    rawReader->Select("TOF", indexDDL, indexDDL);
-
-    while(tofInput.Next()) {
-
-      for (ii=0; ii<5; ii++) detectorIndex[ii] = -1;
-
-      detectorIndex[0] = tofInput.GetSector();
-      detectorIndex[1] = tofInput.GetPlate();
-      detectorIndex[2] = tofInput.GetStrip();
-      detectorIndex[3] = tofInput.GetPadZ();
-      detectorIndex[4] = tofInput.GetPadX();
-      
-      //AliInfo(Form("  %2i  %1i  %2i  %1i  %2i ",detectorIndex[0],detectorIndex[1],detectorIndex[2],detectorIndex[3],detectorIndex[4]));
-
-      if (detectorIndex[0]==-1 ||
-         detectorIndex[1]==-1 ||
-         detectorIndex[2]==-1 ||
-         detectorIndex[3]==-1 ||
-         detectorIndex[4]==-1) continue;
-
-      for (ii=0; ii<3; ii++) position[ii] =  0.;
-
-      fTOFGeometry->GetPos(detectorIndex, position);
-
-      cylindricalPosition[0] = TMath::Sqrt(position[0]*position[0] + position[1]*position[1]);
-      cylindricalPosition[1] = TMath::ATan2(position[1], position[0]);
-      cylindricalPosition[2] = position[2];
-      cylindricalPosition[3] = tofInput.GetTofBin();
-      cylindricalPosition[4] = tofInput.GetToTbin();
-      tToT = tofInput.GetToTbin();
-      tTdcND = -1.;
-      AliTOFcluster *tofCluster = new AliTOFcluster(cylindricalPosition, detectorIndex);
-      tofCluster->SetToT(tToT);
-      tofCluster->SetTDCND(tTdcND);
-      InsertCluster(tofCluster);
-
-    } // while loop
-
-  } // loop on DDL files
-  */
-
   if (fVerbose==2) ftxt.close();
 
   AliInfo(Form("Number of found clusters: %i", fNumberOfTofClusters));
@@ -509,9 +463,7 @@ void AliTOFClusterFinder::Digits2RecPoints(Int_t iEvent, AliRawReader *rawReader
   Int_t detectorIndex[5] = {-1, -1, -1, -1, -1};
   Float_t position[3];
   Double_t cylindricalPosition[5];
-  Float_t tToT;
-  Double_t tTdcND;
-
+  Int_t parTOF[5];
   ofstream ftxt;
   if (fVerbose==2) ftxt.open("TOFdigitsRead.txt",ios::app);
 
@@ -568,24 +520,22 @@ void AliTOFClusterFinder::Digits2RecPoints(Int_t iEvent, AliRawReader *rawReader
       cylindricalPosition[0] = TMath::Sqrt(position[0]*position[0] + position[1]*position[1]);
       cylindricalPosition[1] = TMath::ATan2(position[1], position[0]);
       cylindricalPosition[2] = position[2];
-      cylindricalPosition[3] = tofRawDatum->GetTOF();
-      cylindricalPosition[4] = tofRawDatum->GetTOT();
-      tToT = tofRawDatum->GetTOT();
-      tTdcND = -1.;
-      AliTOFcluster *tofCluster = new AliTOFcluster(cylindricalPosition, detectorIndex);
-      tofCluster->SetToT(tToT);
-      tofCluster->SetTDCND(tTdcND);
-      tofCluster->SetTDCRAW(tofRawDatum->GetTOF());
+      parTOF[0] = tofRawDatum->GetTOF(); // TDC
+      parTOF[1] = tofRawDatum->GetTOT(); // TOT
+      parTOF[2] = tofRawDatum->GetTOT(); // raw data have ADC=TOT
+      parTOF[3] = -1; //raw data: no track of the undecalib sim time
+      parTOF[4] = tofRawDatum->GetTOF(); // Raw time == TDC
+      AliTOFcluster *tofCluster = new AliTOFcluster(cylindricalPosition, detectorIndex, parTOF);
       InsertCluster(tofCluster);
 
       if (fVerbose==2) {
-       if (cylindricalPosition[4]<10)                        ftxt << "        " << cylindricalPosition[4];
-       else if (cylindricalPosition[4]>=10 && cylindricalPosition[4]<100) ftxt << "       " << cylindricalPosition[4];
-       else                                     ftxt << "      " << cylindricalPosition[4];
-       if (cylindricalPosition[3]<10)                             ftxt << "      " << cylindricalPosition[3] << endl;
-       else if (cylindricalPosition[3]>=10 && cylindricalPosition[3]<100)   ftxt << "     " << cylindricalPosition[3] << endl;
-       else if (cylindricalPosition[3]>=100 && cylindricalPosition[3]<1000) ftxt << "    " << cylindricalPosition[3] << endl;
-       else                                             ftxt << "   " << cylindricalPosition[3] << endl;
+       if (parTOF[1]<10)ftxt << "        " << parTOF[1];
+       else if (parTOF[1]>=10 && parTOF[1]<100) ftxt << "      " << parTOF[1];
+       else ftxt << "      " << parTOF[1];
+       if (parTOF[0]<10) ftxt << "      " << parTOF[0] << endl;
+       else if (parTOF[0]>=10 && parTOF[0]<100)   ftxt << "    " << parTOF[0] << endl;
+       else if (parTOF[0]>=100 && parTOF[0]<1000) ftxt << "    " << parTOF[0] << endl;
+       else ftxt << "   " << parTOF[3] << endl;
       }
 
     } // closed loop on TOF raw data per current DDL file
@@ -651,7 +601,7 @@ void AliTOFClusterFinder::Raw2Digits(Int_t iEvent, AliRawReader *rawReader)
   Int_t dummy = -1;
 
   Int_t detectorIndex[5];
-  Float_t digit[4];
+  Int_t digit[4];
 
   Int_t indexDDL = 0;
   for (indexDDL = 0; indexDDL < kDDL; indexDDL++) {
@@ -678,10 +628,10 @@ void AliTOFClusterFinder::Raw2Digits(Int_t iEvent, AliRawReader *rawReader)
       detectorIndex[3] = detectorIndex[4];
       detectorIndex[4] = dummy;
 
-      digit[0] = (Float_t)tofInput.GetTofBin();
-      digit[1] = (Float_t)tofInput.GetToTbin();
-      digit[2] = (Float_t)tofInput.GetToTbin();
-      digit[3] = -1.;
+      digit[0] = tofInput.GetTofBin();
+      digit[1] = tofInput.GetToTbin();
+      digit[2] = tofInput.GetToTbin();
+      digit[3] = -1;
 
       Int_t tracknum[3]={-1,-1,-1};
 
@@ -759,13 +709,11 @@ void AliTOFClusterFinder::FillRecPoint()
   Int_t ii, jj;
 
   Int_t detectorIndex[5];
-  Double_t cylindricalPosition[5];
+  Double_t cylindricalPosition[3];
+  Int_t parTOF[5];
   Int_t trackLabels[3];
   Int_t digitIndex = -1;
-  Float_t tToT=0.;
-  Double_t tTdcND=0.;
-  Double_t tTdcRAW=0.;
-  Bool_t cStatus = kTRUE;
+  Bool_t status=kTRUE;
 
   TClonesArray &lRecPoints = *fRecPoints;
   
@@ -777,15 +725,13 @@ void AliTOFClusterFinder::FillRecPoint()
     cylindricalPosition[0] = fTofClusters[ii]->GetR();
     cylindricalPosition[1] = fTofClusters[ii]->GetPhi();
     cylindricalPosition[2] = fTofClusters[ii]->GetZ();
-    cylindricalPosition[3] = fTofClusters[ii]->GetTDC();
-    cylindricalPosition[4] = fTofClusters[ii]->GetADC();
-    tToT = fTofClusters[ii]->GetToT();
-    tTdcND = fTofClusters[ii]->GetTDCND();
-    cStatus=fTofClusters[ii]->GetStatus();
-    tTdcRAW=fTofClusters[ii]->GetTDCRAW();
-    new(lRecPoints[ii]) AliTOFcluster(cylindricalPosition, trackLabels, detectorIndex, digitIndex, tToT, tTdcND, tTdcRAW,cStatus);
-
-    //AliInfo(Form("%3i  %3i  %f %f %f %f %f  %2i %2i %2i %1i %2i",ii,digitIndex, cylindricalPosition[2],cylindricalPosition[0],cylindricalPosition[1],cylindricalPosition[3],cylindricalPosition[4],detectorIndex[0],detectorIndex[1],detectorIndex[2],detectorIndex[3],detectorIndex[4]));
+    parTOF[0] = fTofClusters[ii]->GetTDC(); // TDC
+    parTOF[1] = fTofClusters[ii]->GetToT(); // TOT
+    parTOF[2] = fTofClusters[ii]->GetADC(); // ADC=TOT
+    parTOF[3] = fTofClusters[ii]->GetTDCND(); // TDCND
+    parTOF[4] = fTofClusters[ii]->GetTDCRAW();//RAW
+    status=fTofClusters[ii]->GetStatus();
+    new(lRecPoints[ii]) AliTOFcluster(cylindricalPosition, detectorIndex, parTOF,status,trackLabels,digitIndex);
 
   } // loop on clusters
 
@@ -805,7 +751,8 @@ void AliTOFClusterFinder::CalibrateRecPoint()
   Int_t detectorIndex[5];
   Int_t digitIndex = -1;
   Float_t tToT;
-  Float_t tdcCorr;
+  Float_t timeCorr;
+  Int_t   tdcCorr;
   AliInfo(" Calibrating TOF Clusters: ")
   AliTOFcalib *calib = new AliTOFcalib(fTOFGeometry);
   if(!calib->ReadParFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);}  
@@ -823,7 +770,6 @@ void AliTOFClusterFinder::CalibrateRecPoint()
     // Get channel status 
     Bool_t status=calChannel->GetStatus();
     if(status)fTofClusters[ii]->SetStatus(!status); //odd convention, to avoid conflict with calibration objects currently in the db (temporary solution).
-
     // Get Rough channel online equalization 
     Float_t roughDelay=calChannel->GetDelay();
     AliDebug(2,Form(" channel delay = %f", roughDelay));
@@ -831,15 +777,18 @@ void AliTOFClusterFinder::CalibrateRecPoint()
     Float_t par[6];
     for (Int_t j = 0; j<6; j++){
       par[j]=calChannel->GetSlewPar(j);
-    }
-    tToT = fTofClusters[ii]->GetToT()*AliTOFGeometry::ToTBinWidth()*1.E-3;
-    Float_t timeCorr=par[0]+par[1]*tToT+par[2]*tToT*tToT+par[3]*tToT*tToT*tToT+par[4]*tToT*tToT*tToT*tToT+par[5]*tToT*tToT*tToT*tToT*tToT+roughDelay;
-    AliDebug(2,Form(" time correction (ns) = %f", timeCorr));
-    AliDebug(2,Form(" channel time, uncorr (ns)= %f",fTofClusters[ii]->GetTDC()*AliTOFGeometry::TdcBinWidth()*1.E-3 ));
-    tdcCorr=(fTofClusters[ii]->GetTDC()*AliTOFGeometry::TdcBinWidth()+32)*1.E-3-timeCorr;
-    tdcCorr=(tdcCorr*1E3-32)/AliTOFGeometry::TdcBinWidth();
+      AliDebug(2,Form(" Calib Pars = %f, %f, %f, %f, %f, %f ",par[0],par[1],par[2],par[3],par[4],par[5]));
+     }
+    AliDebug(2,Form(" The ToT and Time, uncorr (counts) = %i , %i", fTofClusters[ii]->GetToT(),fTofClusters[ii]->GetTDC()));
+    tToT = (Float_t)(fTofClusters[ii]->GetToT())*AliTOFGeometry::ToTBinWidth()*1.E-3; //ToT in ns
+    AliDebug(2,Form(" The ToT and Time, uncorr (ns)= %f, %f",fTofClusters[ii]->GetTDC()*AliTOFGeometry::TdcBinWidth()*1.E-3,tToT));
+    timeCorr=par[0]+par[1]*tToT+par[2]*tToT*tToT+par[3]*tToT*tToT*tToT+par[4]*tToT*tToT*tToT*tToT+par[5]*tToT*tToT*tToT*tToT*tToT+roughDelay; // the time correction
+    AliDebug(2,Form(" The time correction (ns) = %f", timeCorr));
+    timeCorr=((Float_t)(fTofClusters[ii]->GetTDC())*AliTOFGeometry::TdcBinWidth()+32)*1.E-3-timeCorr;//redefine the time
+    AliDebug(2,Form(" The channel time, corr (ns)= %f",timeCorr ));
+    tdcCorr=(Int_t)((timeCorr*1E3-32)/AliTOFGeometry::TdcBinWidth()); //the corrected time (tdc counts)
     fTofClusters[ii]->SetTDC(tdcCorr);
-    AliDebug(2,Form(" channel time, corr (ns)= %f",fTofClusters[ii]->GetTDC()*AliTOFGeometry::TdcBinWidth()*1.E-3 ));
+    AliDebug(2,Form(" The channel time, corr (counts) counts= %i",fTofClusters[ii]->GetTDC()));
 
   } // loop on clusters
 
index 90b9adc2a9d47b6b0659a01f290fe03ec2965d0f..c937854cd065110a7fc90873c6d4b123612b552b 100644 (file)
@@ -263,11 +263,11 @@ void AliTOFDigitizer::CreateDigits()
     
     // start loop on number of slots for current sdigit
     for (Int_t islot = 0; islot < nslot; islot++) {
-      Float_t  digit[4] = {-1.,-1.,-1.,-1.};     // TOF digit variables
+      Int_t  digit[4] = {-1,-1,-1,-1};     // TOF digit variables
       Int_t tracknum[AliTOFSDigit::kMAXDIGITS];     // contributing tracks for the current slot
       
-      Float_t tdc=tofsdigit->GetTdc(islot); digit[0]=tdc;
-      Float_t adc=tofsdigit->GetAdc(islot); digit[1]=adc;
+      Int_t tdc=tofsdigit->GetTdc(islot); digit[0]=tdc;
+      Int_t adc=tofsdigit->GetAdc(islot); digit[1]=adc;
       
       tracknum[0]=tofsdigit->GetTrack(islot,0);
       tracknum[1]=tofsdigit->GetTrack(islot,1);
@@ -442,7 +442,12 @@ void AliTOFDigitizer::DecalibrateTOFSignal( AliTOFcalib *calib){
 
   Float_t maxToT=max;
   Float_t minToT=min;
   Float_t maxToTDistr=hToT->GetMaximum();
+
+  AliDebug (1, Form(" The minimum ToT = %f", minToT)); 
+  AliDebug (1, Form(" The maximum ToT = %f", maxToT)); 
+  AliDebug (1, Form(" The maximum peak in ToT = %f", maxToTDistr)); 
   
   // Loop on TOF Digits
 
@@ -492,26 +497,36 @@ void AliTOFDigitizer::DecalibrateTOFSignal( AliTOFcalib *calib){
        simToT=hToT->GetBinContent(binx);
       }
       // the generated ToT (ns)
-      Float_t tToT= trix; // to apply slewing need to go back to ns..
+      Float_t tToT= trix; // to apply slewing we start from ns..
       // transform TOF signal in ns, factor 1E-3 as bin width is in ps.
-      Float_t tdc = ((dig->GetTdc())*AliTOFGeometry::TdcBinWidth()+32)*1.E-3; 
-      AliDebug(2,Form(" Time before miscalibration (ns) %f: ",tdc));
+      AliDebug(2,Form(" Initial Time (counts): %i: ",dig->GetTdc()));
+      Float_t time = ((dig->GetTdc())*AliTOFGeometry::TdcBinWidth()+32)*1.E-3; 
+      AliDebug(2,Form(" Time before miscalibration (ns) %f: ",time));
       // add slewing effect
       Float_t timeoffset=par[0] + tToT*(par[1] +tToT*(par[2] +tToT*(par[3] +tToT*(par[4] +tToT*par[5])))); 
-      Float_t timeSlewed = tdc+timeoffset;
+      Float_t timeSlewed = time+timeoffset;
       AliDebug(2,Form(" Time after applying slewing (ns): %f: ",timeSlewed));
       // add global time shift
       timeSlewed = timeSlewed + timedelay;
-      AliDebug(2,Form(" Time after applying global delay (ns): %f: ",timeSlewed));
+      AliDebug(2,Form(" Time after applying delay (ns): %f: ",timeSlewed));
+      Int_t tdc= (Int_t)((timeSlewed*1E3-32)/AliTOFGeometry::TdcBinWidth());
       // Setting Decalibrated Time signal (TDC counts)    
-      dig->SetTdc((timeSlewed*1E3-32)/AliTOFGeometry::TdcBinWidth());   
+      dig->SetTdc(tdc);   
+      AliDebug(2,Form(" Final Time (counts): %i: ",dig->GetTdc()));
       // Setting realistic ToT signal (TDC counts)   
-      dig->SetToT(trix/AliTOFGeometry::ToTBinWidth()*1.E3); //(factor 1E3 as input ToT is in ns)
+      // Setting Decalibrated Time signal (TDC counts)    
+      Int_t tot=(Int_t)(trix/AliTOFGeometry::ToTBinWidth()*1.E3);//(factor 1E3 as input ToT is in ns)
+      dig->SetToT(tot); 
+      AliDebug(2,Form(" Final Tot (counts): %i: ",dig->GetToT()));
+      if(tdc<0){
+       AliWarning (Form(" The bad Slewed Time(TDC counts)= %i ", tdc)); 
+       AliWarning(Form(" The bad ToT (TDC counts)= %i ", tot)); 
+      }
     }
     else{
     // For Data with no Miscalibration, set ToT signal == Adc
       //    dig->SetToT(dig->GetAdc()/AliTOFGeometry::ToTBinWidth()*1.E3); 
-      dig->SetToT(dig->GetAdc()/AliTOFGeometry::ToTBinWidth()); //remove the factor 10^3 just to have a reasonable ToT range for raw data simulation even in the case of non-realistic ToT distribution (n.b. fAdc is practically an arbitrary quantity, and ToT has no impact on the TOF reco for non-miscalibrated digits)
+      dig->SetToT((Int_t)(dig->GetAdc()/AliTOFGeometry::ToTBinWidth())); //remove the factor 10^3 just to have a reasonable ToT range for raw data simulation even in the case of non-realistic ToT distribution (n.b. fAdc is practically an arbitrary quantity, and ToT has no impact on the TOF reco for non-miscalibrated digits)
     }
   }
 
index 29b94e8576d57c8c8e638dd5a70e3ad64eebe336..00f2bc4f8180fd130b200be0434951d38a486b5e 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.14  2007/04/27 11:11:53  arcelli
+updates for the new decoder
+
 Revision 1.12  2007/02/22 09:43:45  decaro
 Added AliTOFRawStream::GetIndex method for online calibration (C.Zampolli)
 
@@ -1277,17 +1280,15 @@ AliTOFRawStream::LoadRawDataBuffers(Int_t indexDDL, Int_t verbose)
     Int_t   hitChain = hitData->GetChain();
     Int_t   hitTDC = hitData->GetTDC();
     Int_t   hitChan = hitData->GetChan();
-    //    Float_t hitTime = hitData->GetTime();
     Int_t   hitTimeBin = hitData->GetTimeBin();
-    //    Float_t hitTOT = hitData->GetTOT();
     Int_t   hitTOTBin = hitData->GetTOTBin();
     
-    Float_t hitLeading = -1.;
-    Float_t hitTrailing = -1.;
-    Int_t   hitError = -1;
+    Int_t hitLeading = -1;
+    Int_t hitTrailing = -1;
+    Int_t hitError = -1;
     
     TClonesArray &arrayTofRawData =  *fTOFrawData;
-    new (arrayTofRawData[fPackedDigits++]) AliTOFrawData(hitSlotID, hitChain, hitTDC, hitChan, (Float_t)hitTimeBin, (Float_t)hitTOTBin, hitLeading, hitTrailing, hitPS, hitACQ, hitError);
+    new (arrayTofRawData[fPackedDigits++]) AliTOFrawData(hitSlotID, hitChain, hitTDC, hitChan, hitTimeBin, hitTOTBin, hitLeading, hitTrailing, hitPS, hitACQ, hitError);
   }
 
   if (verbose > 0)
index 81d9add511e361e02bab5285ae87b4f19e2c4d9f..00992199ee6bf58560ecfca61da602a28f51d1f7 100644 (file)
@@ -433,8 +433,8 @@ class AliTOFRawStream: public TObject {
   Int_t         fTDCchannel;   // TDC channel number [0;7]
   Int_t         fTime;         // time-of-flight measurement [0;8191]
   Int_t         fToT;          // time-over-threshould measurement [0;255]
-  Float_t       fLeadingEdge;  // leading edge measurement
-  Float_t       fTrailingEdge; // trailing edge measurement
+  Int_t         fLeadingEdge;  // leading edge measurement
+  Int_t         fTrailingEdge; // trailing edge measurement
   Int_t         fErrorFlag;    // error flag
   
   Int_t         fSector;     // sector number [0;17]
@@ -461,7 +461,7 @@ class AliTOFRawStream: public TObject {
   AliTOFHitDataBuffer *fDataBuffer[72];
   AliTOFHitDataBuffer *fPackedDataBuffer[72];
 
-  ClassDef(AliTOFRawStream, 1)  // class for reading TOF raw digits
+  ClassDef(AliTOFRawStream, 2)  // class for reading TOF raw digits
 };
 
 #endif
index 5ed787dffee9acad4c2b9807f0f1e92994457fd4..f9c4776b99c94d7ce6b0e144c9f0e9244f580a6d 100644 (file)
 //  fStrip   : strips number                                               //
 //  fPadx    : pad number along x                                          //
 //  fPadz    : pad number along z                                          //
-//  fTdc     : TArrayF of TDC values                                       //
-//  fAdc     : TArrayF of ADC values                                       //
+//  fTdc     : TArrayI of TDC values                                       //
+//  fAdc     : TArrayI of ADC values                                       //
 //                                                                         //
 //  Getters, setters and member functions  defined here                    //
 //                                                                         //
 // -- Authors: F. Pierella, A. Seganti, D. Vicinanza                       //
 //_________________________________________________________________________//
 
-#include "TArrayF.h"
 #include "TArrayI.h"
 
 #include "AliLog.h"
@@ -59,7 +58,7 @@ AliTOFSDigit::AliTOFSDigit():
 }
 
 ////////////////////////////////////////////////////////////////////////
-AliTOFSDigit::AliTOFSDigit(Int_t tracknum, Int_t *vol,Float_t *digit):
+AliTOFSDigit::AliTOFSDigit(Int_t tracknum, Int_t *vol,Int_t *digit):
   TObject(),
   fSector(-1),
   fPlate(-1),
@@ -81,9 +80,9 @@ AliTOFSDigit::AliTOFSDigit(Int_t tracknum, Int_t *vol,Float_t *digit):
   fPadx   = vol[3];
   fPadz   = vol[4];
   fNDigits = 1;
-  fTdc = new TArrayF(fNDigits);
+  fTdc = new TArrayI(fNDigits);
   (*fTdc)[0] = digit[0];
-  fAdc = new TArrayF(fNDigits);
+  fAdc = new TArrayI(fNDigits);
   (*fAdc)[0] = digit[1];
   fTracks = new TArrayI(kMAXDIGITS*fNDigits);
   (*fTracks)[0] = tracknum;
@@ -114,8 +113,8 @@ AliTOFSDigit::AliTOFSDigit(const AliTOFSDigit & digit):
   fPadx   = digit.fPadx;
   fPadz   = digit.fPadz;
   fNDigits = digit.fNDigits;
-  fTdc = new TArrayF(*digit.fTdc);  
-  fAdc = new TArrayF(*digit.fAdc);
+  fTdc = new TArrayI(*digit.fTdc);  
+  fAdc = new TArrayI(*digit.fAdc);
   fTracks = new TArrayI(*digit.fTracks);
 }
 
@@ -140,7 +139,7 @@ AliTOFSDigit& AliTOFSDigit::operator=(const AliTOFSDigit & digit)
 
 ////////////////////////////////////////////////////////////////////////
 AliTOFSDigit::AliTOFSDigit(Int_t sector, Int_t plate, Int_t strip, Int_t padx,
-                          Int_t padz, Float_t tdc, Float_t adc):
+                          Int_t padz, Int_t tdc, Int_t adc):
   fSector(sector),
   fPlate(plate),
   fStrip(strip),
@@ -154,9 +153,9 @@ AliTOFSDigit::AliTOFSDigit(Int_t sector, Int_t plate, Int_t strip, Int_t padx,
   //
   // Constructor for sdigit
   //
-  fTdc = new TArrayF(fNDigits);
+  fTdc = new TArrayI(fNDigits);
   (*fTdc)[0] = tdc;   
-  fAdc = new TArrayF(fNDigits);
+  fAdc = new TArrayI(fNDigits);
   (*fAdc)[0] = adc;   
   // no tracks were specified, set them to -1
   fTracks = new TArrayI(kMAXDIGITS*fNDigits);
@@ -256,7 +255,7 @@ void AliTOFSDigit::Update(AliTOFSDigit* sdig)
     }
     
     if (sameTime >= 0) {
-      (*fAdc)[sameTime] += static_cast<Float_t>(adc);
+      (*fAdc)[sameTime] += adc;
       // update track - find the first -1  value and replace it by the
       // track number
       for (Int_t iTrack=0; iTrack<kMAXDIGITS; iTrack++) {
index d99a1e5e74dc6274d9ae0ca686d3b2393373f936..46fedfac626a223e48e537b9cb1f3e58f61e889f 100644 (file)
@@ -25,9 +25,9 @@ class AliTOFSDigit : public TObject {
 
  public:
   AliTOFSDigit();
-  AliTOFSDigit(Int_t tracknum, Int_t* vol, Float_t* digit);
+  AliTOFSDigit(Int_t tracknum, Int_t* vol, Int_t* digit);
 // new ctor for sdigits
-  AliTOFSDigit(Int_t sector, Int_t plate, Int_t strip, Int_t padx, Int_t padz, Float_t tdc, Float_t adc);
+  AliTOFSDigit(Int_t sector, Int_t plate, Int_t strip, Int_t padx, Int_t padz, Int_t tdc, Int_t adc);
 // copy ctor
   AliTOFSDigit(const AliTOFSDigit & digit) ;
   AliTOFSDigit& operator=(const AliTOFSDigit & digit) ;
@@ -40,8 +40,8 @@ class AliTOFSDigit : public TObject {
 
 // getters for AliTOFSDigit object 
   Int_t   GetNDigits() const    {return fNDigits;}
-  Float_t GetTdc(Int_t i) const {return fTdc->At(i);}
-  Float_t GetAdc(Int_t i) const {return fAdc->At(i);}
+  Int_t GetTdc(Int_t i) const {return fTdc->At(i);}
+  Int_t GetAdc(Int_t i) const {return fAdc->At(i);}
 //  Int_t   GetNTracks(Int_t i) const {return fTracks[i]->GetSize();}
   Int_t   GetTrack(Int_t i, Int_t j) const {return fTracks->At(i*kMAXDIGITS+j);}
   Int_t   GetSector() const     {return fSector;}
@@ -62,17 +62,11 @@ protected:
   Int_t   fPadx;    // number of pad along x
   Int_t   fPadz;    // number of pad along z
   Int_t   fNDigits;  // dimension of fTdc array
-  TArrayF *fTdc;     // tdc values for sdigit
-  TArrayF *fAdc;     // adc values for sdigit
+  TArrayI *fTdc;     // tdc values for sdigit
+  TArrayI *fAdc;     // adc values for sdigit
   TArrayI *fTracks;  // contributing tracks, kMAXDIGITS entries per
                      // 1 tdc value
-
-//  Float_t *fTdc;    //[fNDigits] tdc values for sdigit
-//  Float_t *fAdc;    //[fNDigits] adc values for sdigit
-//  Int_t **fTracks;  //[fNDigits] contributing tracks, pointers to
-                     //arrays with track indices
-
-  ClassDef(AliTOFSDigit,1)  // SDigit for Time Of Flight
+  ClassDef(AliTOFSDigit,2)  // SDigit for Time Of Flight
 };
 
 #endif /* ALITOFSDIGIT_H */
index f12a2c860eb28a5ffc4ab7d0aa7019e8cf9be60c..a149a61fc908fce88841c6fb2c9488d15011d274 100644 (file)
@@ -427,7 +427,7 @@ void AliTOFSDigitizer::Exec(Option_t *verboseOption) {
 
       for (Int_t hit = 0; hit < nhits; hit++) {
        Int_t    vol[5];       // location for a digit
-       Float_t  digit[2];     // TOF digit variables
+       Int_t  digit[2];     // TOF digit variables
        Int_t tracknum;
        Float_t dxPad;
        Float_t dzPad;
index ab2faa0ce9ca8368be679840a364f32c87a1c02e..571064633d4bd444bd9654c9796bba30b380a4e3 100644 (file)
@@ -39,10 +39,10 @@ AliTOFcluster::AliTOFcluster():
   fR(0),
   fPhi(0),
   fZ(0),
-  fTDC(0),
-  fADC(0),
   fQuality(-100), 
+  fTDC(0),
   fToT(0),
+  fADC(0),
   fTdcND(0),
   fTdcRAW(0),
   fStatus(kTRUE) 
@@ -57,77 +57,18 @@ AliTOFcluster::AliTOFcluster():
 }
 //-------------------------------------------------------------------------
 
-AliTOFcluster::AliTOFcluster(Double_t *h, Int_t *l, Int_t *ind, Int_t idx, Float_t ToT, Double_t TdcND, Bool_t status):
-  TObject(),
-  fIdx(idx),
-  fR(0),
-  fPhi(0),
-  fZ(0),
-  fTDC(0),
-  fADC(0),
-  fQuality(-100), 
-  fToT(ToT),
-  fTdcND(TdcND),
-  fTdcRAW(0),
-  fStatus(status) 
- {
-  //
-  // constructor
-  //
-
-  Int_t ii;
-  fR   = h[0];
-  fPhi = h[1];
-  fZ   = h[2];
-  fTDC = h[3];
-  fADC = h[4];
-  for (ii=0; ii<3; ii++) fLab[ii]      = l[ii];
-  for (ii=0; ii<5; ii++) fdetIndex[ii] = ind[ii];
-}
-//-------------------------------------------------------------------------
-
-AliTOFcluster::AliTOFcluster(Double_t *h, Int_t *l, Int_t *ind, Int_t idx, Float_t ToT, Double_t TdcND):
-  TObject(),
-  fIdx(idx),
-  fR(0),
-  fPhi(0),
-  fZ(0),
-  fTDC(0),
-  fADC(0),
-  fQuality(-100), 
-  fToT(ToT),
-  fTdcND(TdcND),
-  fTdcRAW(0),
-  fStatus(kTRUE) 
- {
-  //
-  // constructor
-  //
-
-  Int_t ii;
-  fR   = h[0];
-  fPhi = h[1];
-  fZ   = h[2];
-  fTDC = h[3];
-  fADC = h[4];
-  for (ii=0; ii<3; ii++) fLab[ii]      = l[ii];
-  for (ii=0; ii<5; ii++) fdetIndex[ii] = ind[ii];
-}
-
-//-------------------------------------------------------------------------
-
-AliTOFcluster::AliTOFcluster(Double_t *h, Int_t *l, Int_t *ind, Int_t idx, Float_t ToT, Double_t TdcND, Double_t TdcRAW, Bool_t status):
+AliTOFcluster::AliTOFcluster(Double_t *h,  Int_t *ind, Int_t *par, Bool_t status,Int_t *l, Int_t idx):
   TObject(),
   fIdx(idx),
-  fR(0),
-  fPhi(0),
-  fZ(0),
-  fTDC(0),
-  fADC(0),
+  fR(h[0]),
+  fPhi(h[1]),
+  fZ(h[2]),
   fQuality(-100), 
-  fToT(ToT),
-  fTdcND(TdcND),
-  fTdcRAW(TdcRAW),
+  fTDC(par[0]),
+  fToT(par[1]),
+  fADC(par[2]),
+  fTdcND(par[3]),
+  fTdcRAW(par[4]),
   fStatus(status) 
  {
   //
@@ -135,69 +76,30 @@ AliTOFcluster::AliTOFcluster(Double_t *h, Int_t *l, Int_t *ind, Int_t idx, Float
   //
 
   Int_t ii;
-  fR   = h[0];
-  fPhi = h[1];
-  fZ   = h[2];
-  fTDC = h[3];
-  fADC = h[4];
   for (ii=0; ii<3; ii++) fLab[ii]      = l[ii];
   for (ii=0; ii<5; ii++) fdetIndex[ii] = ind[ii];
 }
 //-------------------------------------------------------------------------
 
-AliTOFcluster::AliTOFcluster(Double_t *h, Int_t *l, Int_t *ind, Int_t idx, Float_t ToT, Double_t TdcND, Double_t TdcRAW):
+AliTOFcluster::AliTOFcluster(Double_t *h, Int_t *ind, Int_t *par):
   TObject(),
-  fIdx(idx),
-  fR(0),
-  fPhi(0),
-  fZ(0),
-  fTDC(0),
-  fADC(0),
-  fQuality(-100), 
-  fToT(ToT),
-  fTdcND(TdcND),
-  fTdcRAW(TdcRAW),
-  fStatus(kTRUE) 
- {
-  //
-  // constructor
-  //
-
-  Int_t ii;
-  fR   = h[0];
-  fPhi = h[1];
-  fZ   = h[2];
-  fTDC = h[3];
-  fADC = h[4];
-  for (ii=0; ii<3; ii++) fLab[ii]      = l[ii];
-  for (ii=0; ii<5; ii++) fdetIndex[ii] = ind[ii];
-}
-//-------------------------------------------------------------------------
-
-AliTOFcluster::AliTOFcluster(Double_t *h, Int_t *ind):
-  TObject(), 
   fIdx(-1),
-  fR(0),
-  fPhi(0),
-  fZ(0),
-  fTDC(0),
-  fADC(0),
+  fR(h[0]),
+  fPhi(h[1]),
+  fZ(h[2]),
   fQuality(-100), 
-  fToT(0),
-  fTdcND(0),
-  fTdcRAW(0),
+  fTDC(par[0]),
+  fToT(par[1]),
+  fADC(par[2]),
+  fTdcND(par[3]),
+  fTdcRAW(par[4]),
   fStatus(kTRUE) 
-{
+ {
   //
   // constructor
   //
 
   Int_t ii;
-  fR   = h[0];
-  fPhi = h[1];
-  fZ   = h[2];
-  fTDC = h[3];
-  fADC = h[4];
   for (ii=0; ii<3; ii++) fLab[ii]      = -1;
   for (ii=0; ii<5; ii++) fdetIndex[ii] = ind[ii];
 }
@@ -209,10 +111,10 @@ AliTOFcluster::AliTOFcluster(const AliTOFcluster & cluster):
   fR(0),
   fPhi(0),
   fZ(0),
-  fTDC(0),
-  fADC(0),
   fQuality(-100), 
+  fTDC(0),
   fToT(0),
+  fADC(0),
   fTdcND(0),
   fTdcRAW(0),
   fStatus(kTRUE) 
@@ -225,15 +127,16 @@ AliTOFcluster::AliTOFcluster(const AliTOFcluster & cluster):
   fR        = cluster.fR;
   fPhi      = cluster.fPhi;
   fZ        = cluster.fZ;
-  fTDC      = cluster.fTDC;
-  fADC      = cluster.fADC;
+  fQuality    = cluster.fQuality; 
   for (ii=0; ii<3; ii++) fLab[ii]      = cluster.fLab[ii];
   fIdx      = cluster.fIdx;
   for (ii=0; ii<5; ii++) fdetIndex[ii] = cluster.fdetIndex[ii];
-  fQuality    = cluster.fQuality; 
+  fTDC      = cluster.fTDC;
   fToT    = cluster.fToT; 
+  fADC      = cluster.fADC;
   fTdcND    = cluster.fTdcND; 
   fTdcRAW    = cluster.fTdcRAW; 
+  fStatus    = cluster.fStatus; 
 }
 //-------------------------------------------------------------------------
 
index 37aec14343f55aeeb8fc8a81b546aabe41596ea1..7a3838c0821003b8fcf410033fb360f15f04fba3 100644 (file)
 class AliTOFcluster : public TObject {
  public:
   AliTOFcluster(); // default ctor
-  AliTOFcluster(Double_t *h, Int_t *l, Int_t *ind, Int_t idx, Float_t ToT, Double_t TdcND, Bool_t status); // ctor
-  AliTOFcluster(Double_t *h, Int_t *l, Int_t *ind, Int_t idx, Float_t ToT, Double_t TdcND); // ctor
-  AliTOFcluster(Double_t *h, Int_t *l, Int_t *ind, Int_t idx, Float_t ToT, Double_t TdcND, Double_t TdcRAW, Bool_t status); // ctor
-  AliTOFcluster(Double_t *h, Int_t *l, Int_t *ind, Int_t idx, Float_t ToT, Double_t TdcND, Double_t TdcRAW); // ctor
-  AliTOFcluster(Double_t *h, Int_t *ind); // new ctor
+  AliTOFcluster(Double_t *h, Int_t *ind, Int_t *par, Bool_t status,Int_t *l, Int_t idx); // ctor
+  AliTOFcluster(Double_t *h, Int_t *ind, Int_t *par); // ctor
   AliTOFcluster(const AliTOFcluster & cluster); // copy ctor
   virtual ~AliTOFcluster(); // dtor
 
   Double_t GetR() const   {return fR;}   // Cluster Radius
   Double_t GetPhi() const {return fPhi;} // Cluster Phi
   Double_t GetZ()   const {return fZ;}   // Cluster Z
-  Double_t GetTDC() const {return fTDC;} // Cluster ToF
-  Double_t GetTDCND() const {return fTdcND;} // Cluster ToF
-  Double_t GetTDCRAW() const {return fTdcRAW;} // Cluster Raw time
-  Double_t GetADC() const {return TMath::Abs(fADC);}  // Cluster Charge
-  Double_t GetToT() const {return fToT;}  // Cluster Charge
-  Int_t    IsUsed() const {return (fADC<0) ? 1 : 0;}  // Flagging
-  Int_t    GetLabel(Int_t n) const  {return fLab[n];} // Labels of tracks in Cluster
-  Int_t    GetDetInd(Int_t n) const {return fdetIndex[n];} // Cluster Detector Indeces
-  Int_t    GetIndex() const         {return fIdx;}         // Cluster Index
+  Int_t GetTDC() const {return fTDC;} // Cluster ToF
+  Int_t GetTDCND() const {return fTdcND;} // Cluster ToF
+  Int_t GetTDCRAW() const {return fTdcRAW;} // Cluster Raw time
+  Int_t GetADC() const {return TMath::Abs(fADC);}  // Cluster Charge
+  Int_t GetToT() const {return fToT;}  // Cluster Charge
+  Int_t IsUsed() const {return (fADC<0) ? 1 : 0;}  // Flagging
+  Int_t GetLabel(Int_t n) const  {return fLab[n];} // Labels of tracks in Cluster
+  Int_t GetDetInd(Int_t n) const {return fdetIndex[n];} // Cluster Detector Indeces
+  Int_t GetIndex() const         {return fIdx;}         // Cluster Index
   void     Use() {fADC=-fADC;}
   Double_t GetQuality() const {return fQuality;}
   void     SetQuality(Double_t quality) {fQuality = quality;}
   Bool_t   GetStatus() const {return fStatus;}
   void     SetStatus(Bool_t status) {fStatus = status;}
-  void     SetToT(Float_t ToT) {fToT = ToT;}
-  void     SetTDC(Float_t Tdc) {fTDC = Tdc;}
-  void     SetTDCND(Float_t Tdc) {fTdcND = Tdc;}
-  void     SetTDCRAW(Float_t Tdc) {fTdcRAW = Tdc;}
+  void     SetToT(Int_t ToT) {fToT = ToT;}
+  void     SetTDC(Int_t Tdc) {fTDC = Tdc;}
+  void     SetTDCND(Int_t Tdc) {fTdcND = Tdc;}
+  void     SetTDCRAW(Int_t Tdc) {fTdcRAW = Tdc;}
+
  private:
 
   Int_t fLab[3];      // track labels
   Int_t fIdx;         // index of this cluster
   Int_t fdetIndex[5]; // Cluster detector Indeces (sector,plate,strip,padz,padx)
+  // Cluster Position
   Double_t fR;        // r-coordinate
   Double_t fPhi;      // phi-coordinate
   Double_t fZ;        // z-coordinate
-  Double_t fTDC;      // TDC count
-  Double_t fADC;      // ADC count
   Double_t fQuality;  // quality of the best track 
-  Float_t  fToT;       // ToT
-  Double_t fTdcND;      // TDC count
-  Double_t fTdcRAW;      // RAW TDC count
-  Bool_t   fStatus;      // cluster online status 
 
-  ClassDef(AliTOFcluster, 4) // TOF cluster
+  // TOF Signal parameters
+  Int_t  fTDC;      // TDC count
+  Int_t  fToT;       // ToT
+  Int_t  fADC;      // ADC count
+  Int_t  fTdcND;      // TDC count
+  Int_t  fTdcRAW;      // RAW TDC count
+  Bool_t fStatus;      // cluster online status 
+
+  ClassDef(AliTOFcluster, 5) // TOF cluster
 };
 
 #endif
index e1d42d1644c2d85fea48754006a78e90a0723e29..0fea1b6cfbc3fc7a322452a319a659e45269a3b9 100644 (file)
@@ -54,7 +54,7 @@ AliTOFdigit::AliTOFdigit()
 {
 }
 //______________________________________________________________________________
-AliTOFdigit::AliTOFdigit(Int_t *tracks, Int_t *vol,Float_t *digit)
+AliTOFdigit::AliTOFdigit(Int_t *tracks, Int_t *vol,Int_t *digit)
   :AliDigit(tracks),
    fSector(-1),
    fPlate(-1),
@@ -76,9 +76,9 @@ AliTOFdigit::AliTOFdigit(Int_t *tracks, Int_t *vol,Float_t *digit)
   fPadx   = vol[3];
   fPadz   = vol[4];
   fTdc    = digit[0];
-  fTdcND  = digit[3];
   fAdc    = digit[1];
   fToT    = digit[2];
+  fTdcND  = digit[3];
 
 }
 
@@ -116,7 +116,7 @@ AliTOFdigit::AliTOFdigit(const AliTOFdigit & digit)
 
 //______________________________________________________________________________
 AliTOFdigit::AliTOFdigit(Int_t sector, Int_t plate, Int_t strip, Int_t padx,
-                        Int_t padz, Float_t tdc, Float_t adc):
+                        Int_t padz, Int_t tdc, Int_t adc):
    fSector(-1),
    fPlate(-1),
    fStrip(-1),
index 09675056ec260956314aeb431ae28a52dbbc320a..ea4d6dd59356e085ba4ee53eba5028cb1efe2ca4 100644 (file)
@@ -25,9 +25,9 @@ friend ostream& operator << ( ostream& , const AliTOFdigit&) ;
 
  public:
  AliTOFdigit();
-  AliTOFdigit(Int_t* tracks, Int_t* vol, Float_t* digit);
+  AliTOFdigit(Int_t* tracks, Int_t* vol, Int_t* digit);
 // new ctor for sdigits
-  AliTOFdigit(Int_t sector, Int_t plate, Int_t strip, Int_t padx, Int_t padz, Float_t tdc, Float_t adc);
+  AliTOFdigit(Int_t sector, Int_t plate, Int_t strip, Int_t padx, Int_t padz, Int_t tdc, Int_t adc);
 // copy ctor
   AliTOFdigit(const AliTOFdigit & digit) ;
   virtual ~AliTOFdigit(){}
@@ -35,21 +35,21 @@ friend ostream& operator << ( ostream& , const AliTOFdigit&) ;
   Int_t           GetTotPad(AliTOFGeometry *tofGeom) const;
   void            AddTrack(Int_t track);
   // getters for AliTOFdigit object 
-  Float_t GetTdc()    const     {return fTdc;}
-  Float_t GetTdcND()  const     {return fTdcND;}
-  Float_t GetAdc()    const     {return fAdc;}
+  Int_t   GetTdc()    const     {return fTdc;}
+  Int_t   GetTdcND()  const     {return fTdcND;}
+  Int_t   GetAdc()    const     {return fAdc;}
+  Int_t   GetToT()    const     {return fToT;}  //Time Over Threshold
   Int_t   GetSector() const     {return fSector;}
   Int_t   GetPlate()  const     {return fPlate;}
   Int_t   GetStrip()  const     {return fStrip;}
   Int_t   GetPadx()   const     {return fPadx;}
   Int_t   GetPadz()   const     {return fPadz;}
-  Float_t GetToT() const{return fToT;}         //Time Over Threshold
 
   // setters for AliTOFdigit object
-  void    SetTdc(Float_t TDC){fTdc = TDC;}
-  void    SetTdcND(Float_t TDCND){fTdcND = TDCND;}
-  void    SetAdc(Float_t ADC){fAdc = ADC;}
-  void    SetToT(Float_t ToT) {fToT=ToT;}
+  void    SetTdc(Int_t TDC){fTdc = TDC;}
+  void    SetTdcND(Int_t TDCND){fTdcND = TDCND;}
+  void    SetAdc(Int_t ADC){fAdc = ADC;}
+  void    SetToT(Int_t ToT) {fToT=ToT;}
 
   //overloading of ==, + operators (summable digits)
   
@@ -63,16 +63,16 @@ protected:
   Int_t   fStrip;   // number of strip
   Int_t   fPadx;    // number of pad along x
   Int_t   fPadz;    // number of pad along z
-  Float_t fTdc;     // tdc channel value, to be multiplied by
+  Int_t   fTdc;     // tdc channel value, to be multiplied by
                    // AliTOFGeometry::TdcBinWidth() to have the
                    // time-of-flight measurement
-  Float_t fTdcND;   // simulated (non slewed) time signal
-  Float_t fAdc;     // adc channel value, to be multiplie by
+  Int_t   fTdcND;   // simulated (non slewed) time signal
+  Int_t   fAdc;     // adc channel value, to be multiplie by
                    // AliTOFSDigitizer::GetAdcBin() to have the
                    // 'charge' measurement
-  Float_t  fToT;    // simulated ToT
+  Int_t   fToT;     // simulated ToT
 
-  ClassDef(AliTOFdigit,3)  // Digit for Time Of Flight
+  ClassDef(AliTOFdigit,4)  // Digit for Time Of Flight
 };
 
 #endif /* ALITOFDIGIT_H */
index b22ce03fd538cf62b5efea5738b2c8390c58ae0e..fb153af187c88d0015e4477dc0638fed6f088417 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.2  2007/03/28 10:50:33  decaro
+Rounding off problem in rawData coding/decoding: solved
+
 Revision 1.1  2007/02/20 15:57:00  decaro
 Raw data update: to read the TOF raw data defined in UNPACKED mode
 
@@ -56,8 +59,8 @@ AliTOFrawData::AliTOFrawData() :
 }
 
 //_____________________________________________________________________________
-AliTOFrawData::AliTOFrawData(Int_t a, Int_t b, Int_t c, Int_t d, Float_t e,
-                            Float_t f, Int_t g, Int_t h, Int_t l) :
+AliTOFrawData::AliTOFrawData(Int_t a, Int_t b, Int_t c, Int_t d, Int_t e,
+                            Int_t f, Int_t g, Int_t h, Int_t l) :
   TObject(),
   fACQflag(h),
   fPSbit(g),
@@ -77,8 +80,8 @@ AliTOFrawData::AliTOFrawData(Int_t a, Int_t b, Int_t c, Int_t d, Float_t e,
 }
 
 //_____________________________________________________________________________
-AliTOFrawData::AliTOFrawData(Int_t a, Int_t b, Int_t c, Int_t d, Float_t e,
-                            Float_t f, Float_t ee, Float_t ff, Int_t g, Int_t h, Int_t l) :
+AliTOFrawData::AliTOFrawData(Int_t a, Int_t b, Int_t c, Int_t d, Int_t e,
+                            Int_t f, Int_t ee, Int_t ff, Int_t g, Int_t h, Int_t l) :
   TObject(),
   fACQflag(h),
   fPSbit(g),
@@ -151,7 +154,7 @@ AliTOFrawData& AliTOFrawData::operator=(const AliTOFrawData& r)
 }
 
 //_____________________________________________________________________________
-void AliTOFrawData::Update(Float_t tof, Float_t tot, Float_t leading, Float_t trailing, Int_t psBit, Int_t acq, Int_t errorFlag)
+void AliTOFrawData::Update(Int_t tof, Int_t tot, Int_t leading, Int_t trailing, Int_t psBit, Int_t acq, Int_t errorFlag)
 {
   //
   // To update a raw data object:
index 9d5a9110487ae951b3968f58c6fa311e6e26e890..87a378b56a06eda7f652cd3463387e572a30476a 100644 (file)
@@ -17,22 +17,22 @@ class AliTOFrawData : public TObject {
   // TOF rawData class
  public:
   AliTOFrawData(); // default ctr
-  AliTOFrawData(Int_t a, Int_t b, Int_t c, Int_t d, Float_t e, Float_t f, Int_t g, Int_t h, Int_t l); // ctr
-  AliTOFrawData(Int_t a, Int_t b, Int_t c, Int_t d, Float_t e, Float_t f, Float_t ee, Float_t ff, Int_t g, Int_t h, Int_t l); // ctr
+  AliTOFrawData(Int_t a, Int_t b, Int_t c, Int_t d, Int_t e, Int_t f, Int_t g, Int_t h, Int_t l); // ctr
+  AliTOFrawData(Int_t a, Int_t b, Int_t c, Int_t d, Int_t e, Int_t f, Int_t ee, Int_t ff, Int_t g, Int_t h, Int_t l); // ctr
   ~AliTOFrawData() {}; // default dtr
   AliTOFrawData(const AliTOFrawData& r);     // dummy copy constructor
   AliTOFrawData& operator=(const AliTOFrawData& r); // dummy assignment operator
-  void Update(Float_t tof, Float_t tot, Float_t leading, Float_t trailing, Int_t psBit, Int_t acq, Int_t errorFlag);
+  void Update(Int_t tof, Int_t tot, Int_t leading, Int_t trailing, Int_t psBit, Int_t acq, Int_t errorFlag);
 
   Int_t GetTRM()        const {return fTRM;};
   Int_t GetTRMchain()   const {return fTRMchain;};
   Int_t GetTDC()        const {return fTDC;};
   Int_t GetTDCchannel() const {return fTDCchannel;};
   
-  Float_t GetTOF() const {return fTime;};
-  Float_t GetTOT() const {return fToT;};
-  Float_t GetLeading() const {return fLeading;};
-  Float_t GetTrailing() const {return fTrailing;};
+  Int_t GetTOF() const {return fTime;};
+  Int_t GetTOT() const {return fToT;};
+  Int_t GetLeading() const {return fLeading;};
+  Int_t GetTrailing() const {return fTrailing;};
   
  private:
   Int_t fACQflag;    // ACQ flag
@@ -43,10 +43,10 @@ class AliTOFrawData : public TObject {
   Int_t fTDC;        // TDC number 
   Int_t fTDCchannel; // TDC channel number
   
-  Float_t fLeading;  // Leading Edge
-  Float_t fTrailing; // Trailing Edge
-  Float_t fToT;      // Time-Over-Threashould
-  Float_t fTime;     // Time
+  Int_t fLeading;  // Leading Edge
+  Int_t fTrailing; // Trailing Edge
+  Int_t fToT;      // Time-Over-Threashould
+  Int_t fTime;     // Time
   
   Int_t fError;      // Error flag