]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- removed TObjArray for the storing of clusters
authorkkanaki <kkanaki@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 15 Mar 2010 15:31:24 +0000 (15:31 +0000)
committerkkanaki <kkanaki@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 15 Mar 2010 15:31:24 +0000 (15:31 +0000)
HLT/TPCLib/calibration/AliHLTTPCCalibSeedMakerComponent.cxx
HLT/TPCLib/calibration/AliHLTTPCCalibSeedMakerComponent.h
HLT/TPCLib/calibration/AliHLTTPCCalibTimeComponent.cxx

index 2d560ced37f032e5ce595bfa430a162257ee7e52..20cea54bd80dc5f1ef130b2b3523dca3df59d663 100644 (file)
@@ -60,7 +60,6 @@ AliHLTTPCCalibSeedMakerComponent::AliHLTTPCCalibSeedMakerComponent()
     :    
     fTPCGeomParam(0)
    ,fSeedArray(0)
-   ,fOffClusterArray(0)
 {
   // see header file for class documentation
   // or
@@ -122,11 +121,7 @@ int AliHLTTPCCalibSeedMakerComponent::DoInit( int /*argc*/, const char** /*argv*
   fTPCGeomParam = AliTPCcalibDB::Instance()->GetParameters();
   if(!fTPCGeomParam) HLTError("TPC Parameters are not loaded.");
   
-  fSeedArray = new TClonesArray("AliTPCseed");
-   
-  fOffClusterArray = new TObjArray();
-  //fOffClusterArray->SetOwner(kTRUE);
-  
+  fSeedArray = new TClonesArray("AliTPCseed");  
   return 0;
 
 } // end DoInit()
@@ -136,8 +131,7 @@ int AliHLTTPCCalibSeedMakerComponent::DoDeinit() {
   
   if(fTPCGeomParam)     delete fTPCGeomParam;     fTPCGeomParam    = NULL;          
   if(fSeedArray)        delete fSeedArray;       fSeedArray       = NULL;            
-  if(fOffClusterArray)  delete fOffClusterArray;  fOffClusterArray = NULL;           
-
+  
   return 0;
 }
 
@@ -220,15 +214,12 @@ int AliHLTTPCCalibSeedMakerComponent::DoEvent(const AliHLTComponentEventData& /*
          Double_t angle = fTPCGeomParam->GetInnerAngle();
           
          const UInt_t *hitnum = element->GetPoints(); // store the clusters on each track in an array and loop over them
-  
-//           for(Int_t i=0; i<fOffClusterArray->GetEntriesFast(); i++){      
-//               if(fOffClusterArray->At(i) != NULL) fOffClusterArray->At(i)->Delete();      
-//           }       
-          fOffClusterArray->Clear();  
-
-         for(UInt_t i=0; i<element->GetNumberOfPoints(); i++){
          
-            
+         AliTPCclusterMI* offClusterArray[element->GetNumberOfPoints()];         
+         for(UInt_t k=0; k<element->GetNumberOfPoints(); k++) offClusterArray[k] = 0x0;
+
+          for(UInt_t i=0; i<element->GetNumberOfPoints(); i++){
+                       
              // the id of the cluster contains information about the slice and partition it belongs to
              // as well as its index (pos)          
                          
@@ -262,34 +253,34 @@ int AliHLTTPCCalibSeedMakerComponent::DoEvent(const AliHLTComponentEventData& /*
              // convert the HLT clusters to AliTPCclusterMI                               
              AliHLTTPCOfflineCluster pConv; 
              AliTPCclusterMI *offClus = pConv.ConvertHLTToOffline((fClustersArray[sliceTrack][patchTrack])[pos]);
-             offClus->SetDetector(sector);
-             fOffClusterArray->Add(offClus);                 
-                     
+             offClus->SetDetector(sector);     
+             offClusterArray[i] = offClus;
+                             
              rieman.AddPoint( offClus->GetX(), offClus->GetY(), offClus->GetZ(),TMath::Sqrt(offClus->GetSigmaY2()),TMath::Sqrt(offClus->GetSigmaZ2()) );             
              alpha = 0.5*angle+angle*(sector%18); //sector rotation angle
               
-              // HLTInfo("detector: %d, row: %d, xrow[row]: %f", sector, offClus->GetRow(), xrow[offClus->GetRow()]);  
+              //HLTInfo("detector: %d, row: %d, xrow[row]: %f", sector, offClus->GetRow(), xrow[offClus->GetRow()]);  
             
              usedSpacePoints++;
-      } // end of cluster loop
+          } // end of cluster loop
 
           // creation of AliTPCseed by means of a Riemann fit
           rieman.Update();
           rieman.GetExternalParameters(xmin,param,cov);  
          
-         new((*fSeedArray)[nTracks]) AliTPCseed(xmin,alpha,param,cov,0);
-         
+         new((*fSeedArray)[nTracks]) AliTPCseed(xmin,alpha,param,cov,0);         
          dynamic_cast<AliTPCseed*>(fSeedArray->At(nTracks))->SetLabel(element->GetID());
-                  
-         // set up of the cluster pointers inside the seed
-          for( Int_t j=0; j<usedSpacePoints; j++){                    
-              AliTPCclusterMI *cl = dynamic_cast<AliTPCclusterMI*>(fOffClusterArray->At(j));
-              if(cl) dynamic_cast<AliTPCseed*>(fSeedArray->At(nTracks))->SetClusterPointer(cl->GetRow(), cl);
+         //dynamic_cast<AliTPCseed*>(fSeedArray->At(nTracks))->fClusterOwner = kTRUE;
+         
+         // set the cluster pointers for the seed          
+          for( UInt_t j=0; j<element->GetNumberOfPoints(); j++){                      
+              dynamic_cast<AliTPCseed*>(fSeedArray->At(nTracks))->SetClusterPointer(offClusterArray[j]->GetRow(), offClusterArray[j]);       
          }
-
+          
+         //printf("kelly seed number of clusters %i\n", dynamic_cast<AliTPCseed*>(fSeedArray->At(nTracks))->GetNumberOfClusters()); // not set properly, always 1
          //printf("kelly seed calib dedx: %f, P: %f\n", dynamic_cast<AliTPCseed*>(fSeedArray->At(nTracks))->CookdEdx(0.02,0.6), dynamic_cast<AliTPCseed*>(fSeedArray->At(nTracks))->P());
                   
-         HLTDebug("External track parameters: seed: 0x%08x, xmin: %f, alpha: %f, param[0]: %f, cov[0]: %f", dynamic_cast<AliTPCseed*>(fSeedArray->At(nTracks)), xmin, alpha, param[0], cov[0]);
+         HLTDebug("External track parameters: seed: 0x%08x, xmin: %f, alpha: %f, param[0]: %f, cov[0]: %f\n", dynamic_cast<AliTPCseed*>(fSeedArray->At(nTracks)), xmin, alpha, param[0], cov[0]);
          nTracks++;
 
       }// end of vector track loop           
index 8e966ab5627ad38c5cabc209abd96d2d6c17af58..21581beffd4155bf9abd62175c906c1fdd67d8a7 100644 (file)
@@ -19,7 +19,6 @@
 //forward declarations
 class AliHLTTPCSpacePointData;
 class AliTPCParam;
-class TObjArray;
 class TClonesArray;
 
 /**
@@ -77,10 +76,9 @@ class AliHLTTPCCalibSeedMakerComponent : public AliHLTProcessor {
       
       AliHLTTPCSpacePointData *fClustersArray[36][6]; //! transient
       UInt_t                   fNSpacePoints[36][6];  //! transient
-      TClonesArray *fSeedArray;
-      TObjArray    *fOffClusterArray;
-                      
-      ClassDef(AliHLTTPCCalibSeedMakerComponent, 3)
+      TClonesArray            *fSeedArray; // array of AliTPCseed objects
+                            
+      ClassDef(AliHLTTPCCalibSeedMakerComponent, 4)
     };
 
 #endif
index 58d4555608560c7046b4ae25533944a3058488a1..fe54089faeebf28c45161889bca8f7e95b85138d 100644 (file)
@@ -224,14 +224,12 @@ Int_t AliHLTTPCCalibTimeComponent::ProcessCalibration( const AliHLTComponentEven
     fESDevent->GetStdContent();
     
     //fESDevent->SetTimeStamp(1256910155);
-    //fESDevent->SetRunNumber(0);
-    //fESDevent->SetRunNumber(84714);
               
     HLTDebug("# Seeds: %i\n", fSeedArray->GetEntriesFast()); // access of the info from the previous loop over the AliTPCseed array
     
     fCal->UpdateEventInfo(fESDevent);  
         
-    for(Int_t i=0; i<fSeedArray->GetEntriesFast(); i++){  // loop over TObjArray    
+    for(Int_t i=0; i<fSeedArray->GetEntriesFast(); i++){  // loop over TClonesArray    
         
        AliTPCseed *seed = (AliTPCseed*)fSeedArray->UncheckedAt(i);                    
         fESDtrack = fESDevent->GetTrack(i);
@@ -241,7 +239,7 @@ Int_t AliHLTTPCCalibTimeComponent::ProcessCalibration( const AliHLTComponentEven
           HLTWarning("Mismatch of track id between seed and ESD track: %i, %i\n", fESDtrack->GetID(), seed->GetLabel());
           continue;            
        }
-        
+       
        //printf("kelly time calib dedx before update: %f, P: %f\n", seed->CookdEdx(0.02,0.6), seed->P());
         
        fCal->RefitTrack(fESDtrack, seed, GetBz()); // update AliESDtrack and AliTPCseed info, acccording to Marian's request