]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALTracker.cxx
Scipt to run/submit laser runs analysis
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALTracker.cxx
index eea5888a210cf3d1161d741dc749754a46c12a91..99ec18eb52316efdcb324839f7c2b13da0b0b86f 100644 (file)
@@ -72,6 +72,8 @@ AliEMCALTracker::AliEMCALTracker()
     fCutAlphaMax(200.0),
     fCutAngle(100.0),
     fMaxDist(10.0),
+    fCutNITS(3.0),
+    fCutNTPC(20.0),
     fRho(1.0),
     fX0(1.0),
     fTracks(0),
@@ -85,8 +87,7 @@ AliEMCALTracker::AliEMCALTracker()
        // and all collections to NULL.
        // Output file name is set to a default value.
        //
-       
-       InitParameters();
+  InitParameters();
 }
 //
 //------------------------------------------------------------------------------
@@ -102,6 +103,8 @@ AliEMCALTracker::AliEMCALTracker(const AliEMCALTracker& copy)
     fCutAlphaMax(copy.fCutAlphaMax),
     fCutAngle(copy.fCutAngle),
     fMaxDist(copy.fMaxDist),
+    fCutNITS(copy.fCutNITS),
+    fCutNTPC(copy.fCutNTPC),
     fRho(copy.fRho),
     fX0(copy.fX0),
     fTracks((TObjArray*)copy.fTracks->Clone()),
@@ -131,6 +134,8 @@ AliEMCALTracker& AliEMCALTracker::operator=(const AliEMCALTracker& copy)
        fCutAlphaMax = copy.fCutAlphaMax;
        fCutAngle = copy.fCutAngle;
        fMaxDist = copy.fMaxDist;
+       fCutNITS = copy.fCutNITS;
+       fCutNTPC = copy.fCutNTPC;
        
        fTracks = (TObjArray*)copy.fTracks->Clone();
        fClusters = (TObjArray*)copy.fClusters->Clone();
@@ -150,7 +155,8 @@ void AliEMCALTracker::InitParameters()
        //
        
   // Check if the instance of AliEMCALRecParam exists, 
-  const AliEMCALRecParam* recParam = AliEMCALReconstructor::GetRecParam();
+  const AliEMCALRecParam* recParam = new AliEMCALRecParam();
+
   if(!recParam){
     AliFatal("Reconstruction parameters for EMCAL not set!");
   }
@@ -162,7 +168,9 @@ void AliEMCALTracker::InitParameters()
   fCutAngle =  recParam->GetTrkCutAngle();
   fCutAlphaMin =  recParam->GetTrkCutAlphaMin();
   fCutAlphaMax =  recParam->GetTrkCutAlphaMax();
-  
+  fCutNITS = recParam->GetTrkCutNITS();
+  fCutNTPC = recParam->GetTrkCutNTPC();
+
 }
 //
 //------------------------------------------------------------------------------
@@ -298,8 +306,8 @@ Int_t AliEMCALTracker::LoadClusters(AliESDEvent *esd)
        // make sure that tracks/clusters collections are empty
        Clear("CLUSTERS");
        
-       Int_t start = esd->GetFirstEMCALCluster();
-       Int_t nClustersEMC = esd->GetNumberOfEMCALClusters();
+       Int_t start = 0;
+       Int_t nClustersEMC = esd->GetNumberOfCaloClusters();
        Int_t end = start + nClustersEMC;
        
        fClusters = new TObjArray(0);
@@ -308,7 +316,7 @@ Int_t AliEMCALTracker::LoadClusters(AliESDEvent *esd)
        for (i = start; i < end; i++) {
                AliESDCaloCluster *cluster = esd->GetCaloCluster(i);
                if (!cluster) continue;
-               if (cluster->GetClusterType() != AliESDCaloCluster::kEMCALClusterv1) continue;
+        if (!cluster->IsEMCAL()) continue ; 
                AliEMCALMatchCluster *matchCluster = new AliEMCALMatchCluster(i, cluster);
                fClusters->AddLast(matchCluster);
        }
@@ -440,6 +448,11 @@ Int_t AliEMCALTracker::PropagateBack(AliESDEvent* esd)
                trackID = track->GetSeedIndex();
                AliESDtrack *esdTrack = esd->GetTrack(trackID);
                if (!esdTrack) continue;
+
+               // cut on its and tpc track hits
+               if(esdTrack->GetNcls(0)<=fCutNITS)continue;
+               if(esdTrack->GetNcls(1)<=fCutNTPC)continue;
+
                if (TMath::Abs(esdTrack->GetLabel()) == cluster->Label()) {
                        esdTrack->SetEMCALcluster(cluster->Index());
                        nGood++;
@@ -1055,7 +1068,7 @@ void AliEMCALTracker::UnloadClusters()
 //
 AliEMCALTracker::AliEMCALMatchCluster::AliEMCALMatchCluster(Int_t index, AliEMCALRecPoint *recPoint)
   : fIndex(index),
-    fLabel(recPoint->GetPrimaryIndex()),
+    fLabel(recPoint->GetPrimaryIndex()), //wrong!  fixed below
     fX(0.),
     fY(0.),
     fZ(0.)
@@ -1070,6 +1083,17 @@ AliEMCALTracker::AliEMCALMatchCluster::AliEMCALMatchCluster(Int_t index, AliEMCA
        fX = clpos.X();
        fY = clpos.Y();
        fZ = clpos.Z();
+
+       //AliEMCALRecPoint stores the track labels in the parents
+       //list, sorted according to the fractional contribution to the
+       //RecPoint.  The zeroth parent gave the highest contribution
+       Int_t multparent = 0;
+        Int_t *parents = recPoint->GetParents(multparent);
+        if(multparent > 0)
+          fLabel = parents[0];
+        else
+          fLabel = -1;
+
 }
 //
 //------------------------------------------------------------------------------