]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFClusterFinder.cxx
Do not get main runloader from gAlice
[u/mrichter/AliRoot.git] / TOF / AliTOFClusterFinder.cxx
index 347c9a18ea0368c5b5b7510ff17a53ee1f6f6fa2..29506ecb942a41af3d6e0172f0ab6b69ea88763c 100644 (file)
@@ -28,7 +28,9 @@ Revision 1.28  2007/05/31 16:06:05  arcelli
 move instance of AliRawStream outside loop on DDL
 
 Revision 1.27  2007/05/02 16:31:49  arcelli
-Add methods to handle single event reconstruction. retrieval of Calib info moved to AliTOFReconstructor ctor, and passed via a pointer to AliTOFcalib
+Add methods to handle single event reconstruction.  retrieval of Calib
+info moved to AliTOFReconstructor ctor, and passed via a pointer to
+AliTOFcalib
 
 Revision 1.26  2007/04/30 19:02:24  arcelli
 hopefully the last refinements for correct type conversion in calibration
@@ -40,7 +42,8 @@ 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)
+Digits-to-raw_data conversion: correction for a more real description
+(A.De Caro, R.Preghenella)
 
 Revision 1.22  2007/04/19 17:26:32  arcelli
 Fix a bug (add some debug printout
@@ -58,7 +61,8 @@ Revision 1.18  2007/03/06 16:31:20  arcelli
 Add Uncorrected TOF Time signal
 
 Revision 1.17  2007/02/28 18:09:11  arcelli
-Add protection against failed retrieval of the CDB cal object, now Reconstruction exits with AliFatal
+Add protection against failed retrieval of the CDB cal object,
+now Reconstruction exits with AliFatal
 
 Revision 1.16  2007/02/20 15:57:00  decaro
 Raw data update: to read the TOF raw data defined in UNPACKED mode
@@ -170,35 +174,35 @@ AliTOFClusterFinder::AliTOFClusterFinder(AliRunLoader* runLoader, AliTOFcalib *c
 
 //------------------------------------------------------------------------
 AliTOFClusterFinder::AliTOFClusterFinder(const AliTOFClusterFinder &source)
-  :TObject(),
+  :TObject(source),
   fRunLoader(0),
   fTOFLoader(0),
   fTreeD(0),
   fTreeR(0),
-  fDigits(new TClonesArray("AliTOFdigit", 4000)),
-  fRecPoints(new TClonesArray("AliTOFcluster", 4000)),
+  fDigits(source.fDigits),
+  fRecPoints(source.fRecPoints),
   fNumberOfTofClusters(0),
   fVerbose(0),
-  fDecoderVersion(0),
-  fTOFcalib(0)
+  fDecoderVersion(source.fDecoderVersion),
+  fTOFcalib(source.fTOFcalib)
 {
   // copy constructor
-  this->fDigits=source.fDigits;
-  this->fRecPoints=source.fRecPoints;
-  this->fDecoderVersion=source.fDecoderVersion;
-  this->fTOFcalib=source.fTOFcalib;
-
 }
 
 //------------------------------------------------------------------------
 AliTOFClusterFinder& AliTOFClusterFinder::operator=(const AliTOFClusterFinder &source)
 {
   // ass. op.
-  this->fDigits=source.fDigits;
-  this->fRecPoints=source.fRecPoints;
-  this->fVerbose=source.fVerbose;
-  this->fDecoderVersion=source.fDecoderVersion;
-  this->fTOFcalib=source.fTOFcalib;
+
+  if (this == &source)
+    return *this;
+
+  TObject::operator=(source);  
+  fDigits=source.fDigits;
+  fRecPoints=source.fRecPoints;
+  fVerbose=source.fVerbose;
+  fDecoderVersion=source.fDecoderVersion;
+  fTOFcalib=source.fTOFcalib;
   return *this;
 
 }
@@ -236,6 +240,8 @@ void AliTOFClusterFinder::Digits2RecPoints(Int_t iEvent)
   TStopwatch stopwatch;
   stopwatch.Start();
 
+  Int_t inholes = 0;
+
   fRunLoader->GetEvent(iEvent);
 
   fTreeD = fTOFLoader->TreeD();
@@ -283,6 +289,14 @@ void AliTOFClusterFinder::Digits2RecPoints(Int_t iEvent)
     dig[3]=d->GetPadz();
     dig[4]=d->GetPadx();
 
+    // Do not reconstruct anything in the holes
+    if (dig[0]==13 || dig[0]==14 || dig[0]==15 ) { // sectors with holes
+      if (dig[1]==2) { // plate with holes
+       inholes++;
+       continue;
+      }
+    }
+
     //    AliDebug(2,Form(" %2i  %1i  %2i  %1i  %2i ",dig[0],dig[1],dig[2],dig[3],dig[4]));
 
     parTOF[0] = d->GetTdc(); //the TDC signal
@@ -312,6 +326,7 @@ void AliTOFClusterFinder::Digits2RecPoints(Int_t iEvent)
 
   AliInfo(Form("Execution time to read TOF digits and to write TOF clusters : R:%.4fs C:%.4fs",
               stopwatch.RealTime(),stopwatch.CpuTime()));
+  if (inholes) AliWarning(Form("Clusters in the TOF holes: %d",inholes));
 
 }
 
@@ -326,6 +341,8 @@ void AliTOFClusterFinder::Digits2RecPoints(TTree* digitsTree, TTree* clusterTree
   TStopwatch stopwatch;
   stopwatch.Start();
 
+  Int_t inholes = 0;
+
   ///  fRunLoader->GetEvent(iEvent);
 
   if (digitsTree == 0x0)
@@ -366,6 +383,14 @@ void AliTOFClusterFinder::Digits2RecPoints(TTree* digitsTree, TTree* clusterTree
     dig[3]=d->GetPadz();
     dig[4]=d->GetPadx();
 
+    // Do not reconstruct anything in the holes
+    if (dig[0]==13 || dig[0]==14 || dig[0]==15 ) { // sectors with holes
+      if (dig[1]==2) { // plate with holes
+       inholes++;
+       continue;
+      }
+    }
+
     //    AliDebug(2,Form(" %2i  %1i  %2i  %1i  %2i ",dig[0],dig[1],dig[2],dig[3],dig[4]));
 
     parTOF[0] = d->GetTdc(); //the TDC signal
@@ -393,6 +418,7 @@ void AliTOFClusterFinder::Digits2RecPoints(TTree* digitsTree, TTree* clusterTree
 
   AliInfo(Form("Execution time to read TOF digits and to write TOF clusters : R:%.4fs C:%.4fs",
               stopwatch.RealTime(),stopwatch.CpuTime()));
+  if (inholes) AliWarning(Form("Clusters in the TOF holes: %d",inholes));
 
 }
 //______________________________________________________________________________
@@ -407,6 +433,8 @@ void AliTOFClusterFinder::Digits2RecPoints(AliRawReader *rawReader,
   TStopwatch stopwatch;
   stopwatch.Start();
 
+  Int_t inholes = 0;
+
   //const Int_t kDDL = fTOFGeometry->NDDL()*fTOFGeometry->NSectors();
   const Int_t kDDL = AliDAQ::NumberOfDdls("TOF");
 
@@ -443,7 +471,8 @@ void AliTOFClusterFinder::Digits2RecPoints(AliRawReader *rawReader,
 
       AliTOFrawData *tofRawDatum = (AliTOFrawData*)clonesRawData->UncheckedAt(iRawData);
 
-      if (tofRawDatum->GetTOT()==-1 || tofRawDatum->GetTOF()==-1) continue;
+      //if (tofRawDatum->GetTOT()==-1 || tofRawDatum->GetTOF()==-1) continue;
+      if (tofRawDatum->GetTOF()==-1) continue;
 
       if (fVerbose==2) {
        if (indexDDL<10) ftxt << "  " << indexDDL;
@@ -473,6 +502,14 @@ void AliTOFClusterFinder::Digits2RecPoints(AliRawReader *rawReader,
        else              ftxt << " " << detectorIndex[4];
       }
 
+      // Do not reconstruct anything in the holes
+      if (detectorIndex[0]==13 || detectorIndex[0]==14 || detectorIndex[0]==15 ) { // sectors with holes
+       if (detectorIndex[1]==2) { // plate with holes
+         inholes++;
+         continue;
+       }
+      }
+
       parTOF[0] = tofRawDatum->GetTOF(); //TDC
       parTOF[1] = tofRawDatum->GetTOT(); // TOT
       parTOF[2] = tofRawDatum->GetTOT(); //ADC==TOF
@@ -516,6 +553,7 @@ void AliTOFClusterFinder::Digits2RecPoints(AliRawReader *rawReader,
 
   AliDebug(1, Form("Execution time to read TOF raw data and to write TOF clusters : R:%.4fs C:%.4fs",
                   stopwatch.RealTime(),stopwatch.CpuTime()));
+  if (inholes) AliWarning(Form("Clusters in the TOF holes: %d",inholes));
 
 }
 //______________________________________________________________________________
@@ -529,6 +567,8 @@ void AliTOFClusterFinder::Digits2RecPoints(Int_t iEvent, AliRawReader *rawReader
   TStopwatch stopwatch;
   stopwatch.Start();
 
+  Int_t inholes = 0;
+
   //const Int_t kDDL = fTOFGeometry->NDDL()*fTOFGeometry->NSectors();
   const Int_t kDDL = AliDAQ::NumberOfDdls("TOF");
 
@@ -573,7 +613,8 @@ void AliTOFClusterFinder::Digits2RecPoints(Int_t iEvent, AliRawReader *rawReader
 
       AliTOFrawData *tofRawDatum = (AliTOFrawData*)clonesRawData->UncheckedAt(iRawData);
 
-      if (tofRawDatum->GetTOT()==-1 || tofRawDatum->GetTOF()==-1) continue;
+      //if (tofRawDatum->GetTOT()==-1 || tofRawDatum->GetTOF()==-1) continue;
+      if (tofRawDatum->GetTOF()==-1) continue;
 
       if (fVerbose==2) {
        if (indexDDL<10) ftxt << "  " << indexDDL;
@@ -603,6 +644,14 @@ void AliTOFClusterFinder::Digits2RecPoints(Int_t iEvent, AliRawReader *rawReader
        else              ftxt << " " << detectorIndex[4];
       }
 
+      // Do not reconstruct anything in the holes
+      if (detectorIndex[0]==13 || detectorIndex[0]==14 || detectorIndex[0]==15 ) { // sectors with holes
+       if (detectorIndex[1]==2) { // plate with holes
+         inholes++;
+         continue;
+       }
+      }
+
       parTOF[0] = tofRawDatum->GetTOF(); // TDC
       parTOF[1] = tofRawDatum->GetTOT(); // TOT
       parTOF[2] = tofRawDatum->GetTOT(); // raw data have ADC=TOT
@@ -648,6 +697,7 @@ void AliTOFClusterFinder::Digits2RecPoints(Int_t iEvent, AliRawReader *rawReader
   
   AliDebug(1, Form("Execution time to read TOF raw data and to write TOF clusters : R:%.4fs C:%.4fs",
               stopwatch.RealTime(),stopwatch.CpuTime()));
+  if (inholes) AliWarning(Form("Clusters in the TOF holes: %d",inholes));
 
 }
 //______________________________________________________________________________
@@ -710,7 +760,8 @@ void AliTOFClusterFinder::Raw2Digits(Int_t iEvent, AliRawReader *rawReader)
 
       AliTOFrawData *tofRawDatum = (AliTOFrawData*)clonesRawData->UncheckedAt(iRawData);
 
-      if (!tofRawDatum->GetTOT() || !tofRawDatum->GetTOF()) continue;
+      //if (!tofRawDatum->GetTOT() || !tofRawDatum->GetTOF()) continue;
+      if (tofRawDatum->GetTOF()==-1) continue;
 
       tofInput.EquipmentId2VolumeId(indexDDL, tofRawDatum->GetTRM(), tofRawDatum->GetTRMchain(),
                                    tofRawDatum->GetTDC(), tofRawDatum->GetTDCchannel(), detectorIndex);
@@ -798,7 +849,8 @@ void AliTOFClusterFinder::Raw2Digits(AliRawReader *rawReader, TTree* digitsTree)
 
       AliTOFrawData *tofRawDatum = (AliTOFrawData*)clonesRawData->UncheckedAt(iRawData);
 
-      if (!tofRawDatum->GetTOT() || !tofRawDatum->GetTOF()) continue;
+      //if (!tofRawDatum->GetTOT() || !tofRawDatum->GetTOF()) continue;
+      if (tofRawDatum->GetTOF()==-1) continue;
 
       tofInput.EquipmentId2VolumeId(indexDDL, tofRawDatum->GetTRM(), tofRawDatum->GetTRMchain(),
                                    tofRawDatum->GetTDC(), tofRawDatum->GetTDCchannel(), detectorIndex);
@@ -909,6 +961,19 @@ void AliTOFClusterFinder::FillRecPoint()
     GetClusterPars(detectorIndex,posClus,covClus);
     new(lRecPoints[ii]) AliTOFcluster(volIdClus,posClus[0],posClus[1],posClus[2],covClus[0],covClus[1],covClus[2],covClus[3],covClus[4],covClus[5],trackLabels,detectorIndex, parTOF,status,digitIndex);
 
+    AliDebug(2, Form(" %4i  %4i  %f %f %f  %f %f %f %f %f %f  %3i %3i %3i  %2i %1i %2i %1i %2i  %4i %3i %3i %4i %4i  %1i  %4i", 
+                    ii, volIdClus, posClus[0], posClus[1], posClus[2],
+                    fTofClusters[ii]->GetSigmaX2(),
+                    fTofClusters[ii]->GetSigmaXY(),
+                    fTofClusters[ii]->GetSigmaXZ(),
+                    fTofClusters[ii]->GetSigmaY2(),
+                    fTofClusters[ii]->GetSigmaYZ(),
+                    fTofClusters[ii]->GetSigmaZ2(),
+                    trackLabels[0], trackLabels[1], trackLabels[2],
+                    detectorIndex[0], detectorIndex[1], detectorIndex[2], detectorIndex[3], detectorIndex[4],
+                    parTOF[0], parTOF[1], parTOF[2], parTOF[3], parTOF[4],
+                    status, digitIndex));
+
   } // loop on clusters
 
 }