- include option to avoid multiple reconstruction of tracklets in the
authormasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 16 Sep 2008 16:16:32 +0000 (16:16 +0000)
committermasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 16 Sep 2008 16:16:32 +0000 (16:16 +0000)
SPD overlaps (default to FALSE)

- allow relevant tracklet reconstruction params to be set via ITSRecoParam:

Concerning the last point, here are the params:

 Bool_t  fTrackleterOnlyOneTrackletPerC2;         // Allow only one tracklet per cluster in the outer layer
 Float_t fTrackleterPhiWindow;                    // Search window in phi
 Float_t fTrackleterZetaWindow;                   // Search window in eta
 Bool_t  fTrackleterRemoveClustersFromOverlaps;   // Option to skip clusters in the overlaps
 Float_t fTrackleterPhiOverlapCut;                // Fiducial window in phi for overlap cut
 Float_t fTrackleterZetaOverlapCut;               // Fiducial window in eta for overlap cut

and the usual scheme for setting them different wrt default:

 // ITS settings
   AliITSRecoParam* itsRecoParam = AliITSRecoParam::GetLowFluxParam();
   itsRecoParam->SetTrackleterOnlyOneTrackletPerC2(kTRUE);
   itsRecoParam->SetTrackleterPhiWindow(0.08);
   itsRecoParam->SetTrackleterZetaWindow(1.00);
   itsRecoParam->SetTrackleterRemoveClustersFromOverlaps(kFALSE);
   itsRecoParam->SetTrackleterPhiOverlapCut(0.005);
   itsRecoParam->SetTrackleterZetaOverlapCut(0.05);
   reco.SetRecoParam("ITS",itsRecoParam);

Domenico Elia

ITS/AliITSMultReconstructor.cxx
ITS/AliITSMultReconstructor.h
ITS/AliITSRecoParam.cxx
ITS/AliITSRecoParam.h

index cb87601..398a25e 100644 (file)
@@ -48,6 +48,8 @@
 //     - cluster coordinates taken with GetGlobalXYZ()
 //     - fGeometry removed
 //     - number of fired chips on the two layers
+//     - option to avoid duplicates in the overlaps (fRemoveClustersFromOverlaps)
+//     - options and fiducial cuts via AliITSRecoParam
 //
 //____________________________________________________________________
 
@@ -57,6 +59,7 @@
 #include <TTree.h>
 
 #include "AliITSMultReconstructor.h"
+#include "AliITSReconstructor.h"
 #include "AliITSsegmentationSPD.h"
 #include "AliITSRecPoint.h"
 #include "AliITSgeom.h"
@@ -70,6 +73,10 @@ ClassImp(AliITSMultReconstructor)
 AliITSMultReconstructor::AliITSMultReconstructor():
 fClustersLay1(0),
 fClustersLay2(0),
+fDetectorIndexClustersLay1(0),
+fDetectorIndexClustersLay2(0),
+fOverlapFlagClustersLay1(0),
+fOverlapFlagClustersLay2(0),
 fTracklets(0),
 fSClusters(0),
 fAssociationFlag(0),
@@ -77,9 +84,12 @@ fNClustersLay1(0),
 fNClustersLay2(0),
 fNTracklets(0),
 fNSingleCluster(0),
+fOnlyOneTrackletPerC2(0),
 fPhiWindow(0),
 fZetaWindow(0),
-fOnlyOneTrackletPerC2(0),
+fRemoveClustersFromOverlaps(0),
+fPhiOverlapCut(0),
+fZetaOverlapCut(0),
 fHistOn(0),
 fhClustersDPhiAcc(0),
 fhClustersDThetaAcc(0),
@@ -104,21 +114,41 @@ fhphiClustersLay1(0){
 
 
   SetHistOn();
-  SetPhiWindow();
-  SetZetaWindow();
-  SetOnlyOneTrackletPerC2();
 
-  fClustersLay1       = new Float_t*[300000];
-  fClustersLay2       = new Float_t*[300000];
-  fTracklets          = new Float_t*[300000];
-  fSClusters          = new Float_t*[300000];
-  fAssociationFlag    = new Bool_t[300000];
+  if(AliITSReconstructor::GetRecoParam()) { 
+    SetOnlyOneTrackletPerC2(AliITSReconstructor::GetRecoParam()->GetTrackleterOnlyOneTrackletPerC2());
+    SetPhiWindow(AliITSReconstructor::GetRecoParam()->GetTrackleterPhiWindow());
+    SetZetaWindow(AliITSReconstructor::GetRecoParam()->GetTrackleterZetaWindow());
+    SetRemoveClustersFromOverlaps(AliITSReconstructor::GetRecoParam()->GetTrackleterRemoveClustersFromOverlaps());
+    SetPhiOverlapCut(AliITSReconstructor::GetRecoParam()->GetTrackleterPhiOverlapCut());
+    SetZetaOverlapCut(AliITSReconstructor::GetRecoParam()->GetTrackleterZetaOverlapCut());
+  } else {
+    SetOnlyOneTrackletPerC2();
+    SetPhiWindow();
+    SetZetaWindow();
+    SetRemoveClustersFromOverlaps();
+    SetPhiOverlapCut();
+    SetZetaOverlapCut();
+  } 
+  
+
+  fClustersLay1              = new Float_t*[300000];
+  fClustersLay2              = new Float_t*[300000];
+  fDetectorIndexClustersLay1 = new Int_t[300000];
+  fDetectorIndexClustersLay2 = new Int_t[300000];
+  fOverlapFlagClustersLay1   = new Bool_t[300000];
+  fOverlapFlagClustersLay2   = new Bool_t[300000];
+  fTracklets                 = new Float_t*[300000];
+  fSClusters                 = new Float_t*[300000];
+  fAssociationFlag           = new Bool_t[300000];
 
   for(Int_t i=0; i<300000; i++) {
     fClustersLay1[i]       = new Float_t[6];
     fClustersLay2[i]       = new Float_t[6];
     fTracklets[i]          = new Float_t[5];
     fSClusters[i]           = new Float_t[2];
+    fOverlapFlagClustersLay1[i]   = kFALSE;
+    fOverlapFlagClustersLay2[i]   = kFALSE;
     fAssociationFlag[i]    = kFALSE;
   }
 
@@ -161,6 +191,10 @@ fhphiClustersLay1(0){
 AliITSMultReconstructor::AliITSMultReconstructor(const AliITSMultReconstructor &mr) : TObject(mr),
 fClustersLay1(mr.fClustersLay1),
 fClustersLay2(mr.fClustersLay2),
+fDetectorIndexClustersLay1(mr.fDetectorIndexClustersLay1),
+fDetectorIndexClustersLay2(mr.fDetectorIndexClustersLay2),
+fOverlapFlagClustersLay1(mr.fOverlapFlagClustersLay1),
+fOverlapFlagClustersLay2(mr.fOverlapFlagClustersLay2),
 fTracklets(mr.fTracklets),
 fSClusters(mr.fSClusters),
 fAssociationFlag(mr.fAssociationFlag),
@@ -168,9 +202,12 @@ fNClustersLay1(mr.fNClustersLay1),
 fNClustersLay2(mr.fNClustersLay2),
 fNTracklets(mr.fNTracklets),
 fNSingleCluster(mr.fNSingleCluster),
+fOnlyOneTrackletPerC2(mr.fOnlyOneTrackletPerC2),
 fPhiWindow(mr.fPhiWindow),
 fZetaWindow(mr.fZetaWindow),
-fOnlyOneTrackletPerC2(mr.fOnlyOneTrackletPerC2),
+fRemoveClustersFromOverlaps(mr.fRemoveClustersFromOverlaps),
+fPhiOverlapCut(mr.fPhiOverlapCut),
+fZetaOverlapCut(mr.fZetaOverlapCut),
 fHistOn(mr.fHistOn),
 fhClustersDPhiAcc(mr.fhClustersDPhiAcc),
 fhClustersDThetaAcc(mr.fhClustersDThetaAcc),
@@ -227,6 +264,10 @@ AliITSMultReconstructor::~AliITSMultReconstructor(){
   }
   delete [] fClustersLay1;
   delete [] fClustersLay2;
+  delete [] fDetectorIndexClustersLay1;
+  delete [] fDetectorIndexClustersLay2;
+  delete [] fOverlapFlagClustersLay1;
+  delete [] fOverlapFlagClustersLay2;
   delete [] fTracklets;
   delete [] fSClusters;
 
@@ -308,10 +349,12 @@ AliITSMultReconstructor::Reconstruct(TTree* clusterTree, Float_t* vtx, Float_t*
     Float_t dPhimin        = 0.;  // Used for histograms only! 
     Float_t dThetamin      = 0.;  // Used for histograms only! 
     Float_t dZetamin       = 0.;  // Used for histograms only! 
-    
+     
+    if (fOverlapFlagClustersLay1[iC1]) continue;
     // Loop on layer 2 
     for (Int_t iC2=0; iC2<fNClustersLay2; iC2++) {      
-      
+      if (fOverlapFlagClustersLay2[iC2]) continue;
       // The following excludes double associations
       if (!fAssociationFlag[iC2]) {
        
@@ -418,6 +461,9 @@ AliITSMultReconstructor::Reconstruct(TTree* clusterTree, Float_t* vtx, Float_t*
       AliDebug(1,Form(" Cl. %d of Layer 1 and %d of Layer 2", iC1, 
                      iC2WithBestDist));
       fNTracklets++;
+
+      if (fRemoveClustersFromOverlaps) FlagClustersInOverlapRegions (iC1,iC2WithBestDist);
+
     }
 
     // Delete the following else if you do not want to save Clusters! 
@@ -497,6 +543,9 @@ AliITSMultReconstructor::LoadClusterArrays(TTree* itsClusterTree) {
        fClustersLay1[fNClustersLay1][0] = x;
        fClustersLay1[fNClustersLay1][1] = y;
        fClustersLay1[fNClustersLay1][2] = z;
+        fDetectorIndexClustersLay1[fNClustersLay1]=iIts;  
+
        for (Int_t i=0; i<3; i++)
                fClustersLay1[fNClustersLay1][3+i] = cluster->GetLabel(i);
        fNClustersLay1++;
@@ -505,6 +554,9 @@ AliITSMultReconstructor::LoadClusterArrays(TTree* itsClusterTree) {
        fClustersLay2[fNClustersLay2][0] = x;
        fClustersLay2[fNClustersLay2][1] = y;
        fClustersLay2[fNClustersLay2][2] = z;
+
+        fDetectorIndexClustersLay2[fNClustersLay2]=iIts;
        for (Int_t i=0; i<3; i++)
                fClustersLay2[fNClustersLay2][3+i] = cluster->GetLabel(i);
        fNClustersLay2++;
@@ -618,3 +670,82 @@ AliITSMultReconstructor::SaveHists() {
   fhetaClustersLay1->Write();
   fhphiClustersLay1->Write();
 }
+
+//____________________________________________________________________
+void 
+AliITSMultReconstructor::FlagClustersInOverlapRegions (Int_t iC1, Int_t iC2WithBestDist) {
+
+  Float_t distClSameMod=0.;
+  Float_t distClSameModMin=0.;
+  Int_t   iClOverlap =0;
+  Float_t meanRadiusLay1 = 3.99335; // average radius inner layer
+  Float_t meanRadiusLay2 = 7.37935; // average radius outer layer;
+
+  Float_t zproj1=0.;
+  Float_t zproj2=0.;
+  Float_t deZproj=0.;
+
+  // Loop on inner layer clusters
+  for (Int_t iiC1=0; iiC1<fNClustersLay1; iiC1++) {
+    if (!fOverlapFlagClustersLay1[iiC1]) {
+      // only for adjacent modules
+      if ((TMath::Abs(fDetectorIndexClustersLay1[iC1]-fDetectorIndexClustersLay1[iiC1])==4)||
+         (TMath::Abs(fDetectorIndexClustersLay1[iC1]-fDetectorIndexClustersLay1[iiC1])==76)) {
+        Float_t dePhi=TMath::Abs(fClustersLay1[iiC1][1]-fClustersLay1[iC1][1]);
+        if (dePhi>TMath::Pi()) dePhi=2.*TMath::Pi()-dePhi;
+
+        zproj1=meanRadiusLay1/TMath::Tan(fClustersLay1[iC1][0]);
+        zproj2=meanRadiusLay1/TMath::Tan(fClustersLay1[iiC1][0]);
+
+        deZproj=TMath::Abs(zproj1-zproj2);
+
+        distClSameMod = TMath::Sqrt(TMath::Power(deZproj/fZetaOverlapCut,2)+TMath::Power(dePhi/fPhiOverlapCut,2));
+        if (distClSameMod<=1.) fOverlapFlagClustersLay1[iiC1]=kTRUE;
+
+//        if (distClSameMod<=1.) {
+//          if (distClSameModMin==0. || distClSameMod<distClSameModMin) {
+//            distClSameModMin=distClSameMod;
+//            iClOverlap=iiC1;
+//          } 
+//        }
+
+
+      } // end adjacent modules
+    } 
+  } // end Loop on inner layer clusters
+
+//  if (distClSameModMin!=0.) fOverlapFlagClustersLay1[iClOverlap]=kTRUE;
+
+  distClSameMod=0.;
+  distClSameModMin=0.;
+  iClOverlap =0;
+  // Loop on outer layer clusters
+  for (Int_t iiC2=0; iiC2<fNClustersLay2; iiC2++) {
+    if (!fOverlapFlagClustersLay2[iiC2]) {
+      // only for adjacent modules
+      if ((TMath::Abs(fDetectorIndexClustersLay2[iC2WithBestDist]-fDetectorIndexClustersLay2[iiC2])==4) ||
+         (TMath::Abs(fDetectorIndexClustersLay2[iC2WithBestDist]-fDetectorIndexClustersLay2[iiC2])==156)) {
+        Float_t dePhi=TMath::Abs(fClustersLay2[iiC2][1]-fClustersLay2[iC2WithBestDist][1]);
+        if (dePhi>TMath::Pi()) dePhi=2.*TMath::Pi()-dePhi;
+
+        zproj1=meanRadiusLay2/TMath::Tan(fClustersLay2[iC2WithBestDist][0]);
+        zproj2=meanRadiusLay2/TMath::Tan(fClustersLay2[iiC2][0]);
+
+        deZproj=TMath::Abs(zproj1-zproj2);
+        distClSameMod = TMath::Sqrt(TMath::Power(deZproj/fZetaOverlapCut,2)+TMath::Power(dePhi/fPhiOverlapCut,2));
+        if (distClSameMod<=1.) fOverlapFlagClustersLay2[iiC2]=kTRUE;
+
+//        if (distClSameMod<=1.) {
+//          if (distClSameModMin==0. || distClSameMod<distClSameModMin) {
+//            distClSameModMin=distClSameMod;
+//            iClOverlap=iiC2;
+//          }
+//        }
+
+      } // end adjacent modules
+    }
+  } // end Loop on outer layer clusters
+
+//  if (distClSameModMin!=0.) fOverlapFlagClustersLay2[iClOverlap]=kTRUE;
+
+}
index 7699c0a..fccf2f0 100644 (file)
@@ -38,11 +38,16 @@ public:
 
   void Reconstruct(TTree* tree, Float_t* vtx, Float_t* vtxRes);
   void LoadClusterFiredChips(TTree* tree);
+  void FlagClustersInOverlapRegions(Int_t ic1,Int_t ic2);
 
+  // Following members are set via AliITSRecoParam
+  void SetOnlyOneTrackletPerC2(Bool_t b = kTRUE) {fOnlyOneTrackletPerC2 = b;}
   void SetPhiWindow(Float_t w=0.08) {fPhiWindow=w;}
   void SetZetaWindow(Float_t w=1.) {fZetaWindow=w;}
-  void SetOnlyOneTrackletPerC2(Bool_t b = kTRUE) {fOnlyOneTrackletPerC2 = b;}
-  
+  void SetRemoveClustersFromOverlaps(Bool_t b = kFALSE) {fRemoveClustersFromOverlaps = b;}
+  void SetPhiOverlapCut(Float_t w=0.005) {fPhiOverlapCut=w;}
+  void SetZetaOverlapCut(Float_t w=0.05) {fZetaOverlapCut=w;}
+
   Int_t GetNClustersLayer1() const {return fNClustersLay1;}
   Int_t GetNClustersLayer2() const {return fNClustersLay2;}
   Int_t GetNTracklets() const {return fNTracklets;}
@@ -62,8 +67,14 @@ protected:
   AliITSMultReconstructor& operator=(const AliITSMultReconstructor& mr);
 
   
-  Float_t**     fClustersLay1;         // clusters in the 1st layer of ITS 
-  Float_t**     fClustersLay2;         // clusters in the 2nd layer of ITS 
+  Float_t**     fClustersLay1;               // clusters in the 1st layer of ITS 
+  Float_t**     fClustersLay2;               // clusters in the 2nd layer of ITS 
+  Int_t*        fDetectorIndexClustersLay1;  // module index for clusters 1st ITS layer
+  Int_t*        fDetectorIndexClustersLay2;  // module index for clusters 2nd ITS layer
+  Bool_t*       fOverlapFlagClustersLay1;    // flag for clusters in the overlap regions 1st ITS layer
+  Bool_t*       fOverlapFlagClustersLay2;    // flag for clusters in the overlap regions 2nd ITS layer 
+
+
   Float_t**     fTracklets;            // tracklets 
   Float_t**     fSClusters;            // single clusters (unassociated)
   Bool_t*       fAssociationFlag;      // flag for the associations 
@@ -74,14 +85,16 @@ protected:
   Int_t         fNSingleCluster;       // Number of unassociated clusters
   Short_t       fNFiredChips[2];       // Number of fired chips in the two SPD layers
  
-  Float_t       fPhiWindow;            // Search window in phi
-  Float_t       fZetaWindow;           // SEarch window in eta
+  // Following members are set via AliITSRecoParam
+  Bool_t        fOnlyOneTrackletPerC2;         // Allow only one tracklet per cluster in the outer layer
+  Float_t       fPhiWindow;                    // Search window in phi
+  Float_t       fZetaWindow;                   // Search window in eta
+  Bool_t        fRemoveClustersFromOverlaps;   // Option to skip clusters in the overlaps
+  Float_t       fPhiOverlapCut;                // Fiducial window in phi for overlap cut
+  Float_t       fZetaOverlapCut;               // Fiducial window in eta for overlap cut
 
-  Bool_t        fOnlyOneTrackletPerC2; // only one tracklet per cluster in L. 2
-  
   Bool_t        fHistOn;               // Option to define and fill the histograms 
 
-
   TH1F*         fhClustersDPhiAcc;     // Phi2 - Phi1 for tracklets 
   TH1F*         fhClustersDThetaAcc;   // Theta2 - Theta1 for tracklets 
   TH1F*         fhClustersDZetaAcc;    // z2 - z1projected for tracklets 
index 6292e93..d1268cb 100644 (file)
@@ -137,7 +137,13 @@ fFindV0s(kTRUE),
 fUseUnfoldingInClusterFinderSPD(kFALSE),
 fUseUnfoldingInClusterFinderSDD(kTRUE),
 fUseUnfoldingInClusterFinderSSD(kTRUE),
-fUseChargeMatchingInClusterFinderSSD(kTRUE)
+fUseChargeMatchingInClusterFinderSSD(kTRUE),
+fTrackleterOnlyOneTrackletPerC2(kTRUE),
+fTrackleterPhiWindow(0.08),
+fTrackleterZetaWindow(1.00),
+fTrackleterRemoveClustersFromOverlaps(kFALSE),
+fTrackleterPhiOverlapCut(0.005),
+fTrackleterZetaOverlapCut(0.05)
 {
   //
   // constructor
index c9fabeb..5467783 100644 (file)
@@ -268,6 +268,20 @@ class AliITSRecoParam : public AliDetectorRecoParam
   void   SetUseChargeMatchingInClusterFinderSSD(Bool_t use=kTRUE) { fUseChargeMatchingInClusterFinderSSD=use; return; }
   Bool_t GetUseChargeMatchingInClusterFinderSSD() const { return fUseChargeMatchingInClusterFinderSSD; }
 
+  // SPD Tracklets (D. Elia)
+  void    SetTrackleterOnlyOneTrackletPerC2(Bool_t use= kTRUE) {fTrackleterOnlyOneTrackletPerC2=use; return; }
+  Bool_t  GetTrackleterOnlyOneTrackletPerC2() const { return fTrackleterOnlyOneTrackletPerC2; }
+  void    SetTrackleterPhiWindow(Float_t w=0.08) {fTrackleterPhiWindow=w;}
+  void    SetTrackleterZetaWindow(Float_t w=1.) {fTrackleterZetaWindow=w;}
+  Float_t GetTrackleterPhiWindow() const {return fTrackleterPhiWindow;}
+  Float_t GetTrackleterZetaWindow() const {return fTrackleterZetaWindow;}
+  void    SetTrackleterRemoveClustersFromOverlaps(Bool_t use=kTRUE) { fTrackleterRemoveClustersFromOverlaps=use; return; }
+  Bool_t  GetTrackleterRemoveClustersFromOverlaps() const { return fTrackleterRemoveClustersFromOverlaps; }
+  void    SetTrackleterPhiOverlapCut(Float_t w=0.005) {fTrackleterPhiOverlapCut=w;}
+  void    SetTrackleterZetaOverlapCut(Float_t w=0.05) {fTrackleterZetaOverlapCut=w;}
+  Float_t GetTrackleterPhiOverlapCut() const {return fTrackleterPhiOverlapCut;}
+  Float_t GetTrackleterZetaOverlapCut() const {return fTrackleterZetaOverlapCut;}
+
   //
 
   enum {fgkMaxClusterPerLayer=70000}; //7000*10;   // max clusters per layer
@@ -431,6 +445,14 @@ class AliITSRecoParam : public AliDetectorRecoParam
 
   Bool_t fUseChargeMatchingInClusterFinderSSD; // SSD
 
+  // SPD Tracklets (D. Elia)
+  Bool_t  fTrackleterOnlyOneTrackletPerC2;         // Allow only one tracklet per cluster in the outer layer
+  Float_t fTrackleterPhiWindow;                    // Search window in phi
+  Float_t fTrackleterZetaWindow;                   // Search window in eta
+  Bool_t  fTrackleterRemoveClustersFromOverlaps;   // Option to skip clusters in the overlaps
+  Float_t fTrackleterPhiOverlapCut;                // Fiducial window in phi for overlap cut
+  Float_t fTrackleterZetaOverlapCut;               // Fiducial window in eta for overlap cut
+
   ClassDef(AliITSRecoParam,10) // ITS reco parameters
 };