]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCclustererMI.cxx
bugfix (Matthias)
[u/mrichter/AliRoot.git] / TPC / AliTPCclustererMI.cxx
index 46ba14a843e5f0830b98a8bde440e2b69d02ce9a..f16cebcccc6e8386557a11c724c77c1d0714b6f0 100644 (file)
@@ -118,10 +118,11 @@ AliTPCclustererMI::AliTPCclustererMI(const AliTPCParam* par, const AliTPCRecoPar
   fRecoParam(0),
   fBDumpSignal(kFALSE),
   fBClonesArray(kFALSE),
-  fUseHLTClusters(1),
+  fUseHLTClusters(4),
   fAllBins(NULL),
   fAllSigBins(NULL),
-  fAllNSigBins(NULL)
+  fAllNSigBins(NULL),
+  fHLTClusterAccess(NULL)
 {
   //
   // COSNTRUCTOR
@@ -165,59 +166,7 @@ AliTPCclustererMI::AliTPCclustererMI(const AliTPCParam* par, const AliTPCRecoPar
     fAllNSigBins[iRow]=0;
   }
 }
-//______________________________________________________________
-AliTPCclustererMI::AliTPCclustererMI(const AliTPCclustererMI &param)
-              :TObject(param),
-  fBins(0),
-  fSigBins(0),
-  fNSigBins(0),
-  fLoop(0),
-  fMaxBin(0),
-  fMaxTime(0),
-  fMaxPad(0),
-  fSector(-1),
-  fRow(-1),
-  fSign(0),
-  fRx(0),
-  fPadWidth(0),
-  fPadLength(0),
-  fZWidth(0),
-  fPedSubtraction(kFALSE),
-  fEventHeader(0),
-  fTimeStamp(0),
-  fEventType(0),
-  fInput(0),
-  fOutput(0),
-  fOutputArray(0),
-  fOutputClonesArray(0),
-  fRowCl(0),
-  fRowDig(0),
-  fParam(0),
-  fNcluster(0),
-  fNclusters(0),
-  fDebugStreamer(0),
-  fRecoParam(0),
-  fBDumpSignal(kFALSE),
-  fBClonesArray(kFALSE),
-  fUseHLTClusters(1),
-  fAllBins(NULL),
-  fAllSigBins(NULL),
-  fAllNSigBins(NULL)
-{
-  //
-  // dummy
-  //
-  fMaxBin = param.fMaxBin;
-}
-//______________________________________________________________
-AliTPCclustererMI & AliTPCclustererMI::operator =(const AliTPCclustererMI & param)
-{
-  //
-  // assignment operator - dummy
-  //
-  fMaxBin=param.fMaxBin;
-  return (*this);
-}
+
 //______________________________________________________________
 AliTPCclustererMI::~AliTPCclustererMI(){
   //
@@ -247,6 +196,7 @@ AliTPCclustererMI::~AliTPCclustererMI(){
   delete [] fAllBins;
   delete [] fAllSigBins;
   delete [] fAllNSigBins;
+  if (fHLTClusterAccess) delete fHLTClusterAccess;
 }
 
 void AliTPCclustererMI::SetInput(TTree * tree)
@@ -720,14 +670,11 @@ void AliTPCclustererMI::Digits2Clusters()
     fParam->Dump();
     fRecoParam->Dump();
   }
+  fRowDig = NULL;
 
   //-----------------------------------------------------------------
   // Use HLT clusters
   //-----------------------------------------------------------------
-  fUseHLTClusters = fRecoParam->GetUseHLTClusters();
-
-  AliInfo(Form("Usage of HLT clusters in TPC reconstruction : %d",fUseHLTClusters));
-
   if (fUseHLTClusters == 3 || fUseHLTClusters == 4) {
     AliInfo("Using HLT clusters for TPC off-line reconstruction");
     fZWidth = fParam->GetZWidth();
@@ -744,7 +691,7 @@ void AliTPCclustererMI::Digits2Clusters()
        return;
       }
       else {
-       AliInfo("Now trying to read TPC RAW");
+       AliInfo("Now trying to read from TPC RAW");
       }
     }
     // Some other problem during cluster reading
@@ -996,10 +943,6 @@ void AliTPCclustererMI::Digits2Clusters(AliRawReader* rawReader)
   //-----------------------------------------------------------------
   // Use HLT clusters
   //-----------------------------------------------------------------
-  fUseHLTClusters = fRecoParam->GetUseHLTClusters();
-
-  AliInfo(Form("Usage of HLT clusters in TPC reconstruction : %d",fUseHLTClusters));
-
   if (fUseHLTClusters == 3 || fUseHLTClusters == 4) {
     AliInfo("Using HLT clusters for TPC off-line reconstruction");
     fZWidth = fParam->GetZWidth();
@@ -1632,7 +1575,7 @@ Int_t AliTPCclustererMI::ReadHLTClusters()
   // used in Digits2Clusters
   //
 
-  TObject* pClusterAccess=NULL;
+  if (!fHLTClusterAccess) {
   TClass* pCl=NULL;
   ROOT::NewFunc_t pNewFunc=NULL;
   do {
@@ -1648,22 +1591,24 @@ Int_t AliTPCclustererMI::ReadHLTClusters()
     AliError("unable to create instance of AliHLTTPCClusterAccessHLTOUT");
     return -2;
   }
-  pClusterAccess=reinterpret_cast<TObject*>(p);
-  if (!pClusterAccess) {
-    AliError("instance not of type TObject");
-    return -3 ;
+  fHLTClusterAccess=reinterpret_cast<TObject*>(p);
   }
 
+  TObject* pClusterAccess=fHLTClusterAccess;
+
   const Int_t kNIS = fParam->GetNInnerSector();
   const Int_t kNOS = fParam->GetNOuterSector();
   const Int_t kNS = kNIS + kNOS;
   fNclusters  = 0;
   
+  // make sure that all clusters from the previous event are cleared
+  pClusterAccess->Clear("event");
   for(fSector = 0; fSector < kNS; fSector++) {
 
     Int_t iResult = 1;
     TString param("sector="); param+=fSector;
-    pClusterAccess->Clear();
+    // prepare for next sector
+    pClusterAccess->Clear("sector");
     pClusterAccess->Execute("read", param, &iResult);
     if (iResult < 0) {
       return iResult;
@@ -1724,7 +1669,7 @@ Int_t AliTPCclustererMI::ReadHLTClusters()
     fNclusters+=nClusterSector;
   } // for(fSector = 0; fSector < kNS; fSector++) {
 
-  delete pClusterAccess;
+  pClusterAccess->Clear("event");
 
   Info("Digits2Clusters", "Number of converted HLT clusters : %d", fNclusters);