]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Changes to study the unused SPD clusters excess in data wrt MC (Ruben)
authormasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 6 Mar 2012 22:40:12 +0000 (22:40 +0000)
committermasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 6 Mar 2012 22:40:12 +0000 (22:40 +0000)
ITS/AliITSMultReconstructor.cxx
ITS/AliITSMultReconstructor.h

index 61bc00778aeccb02363702f49baf5909e7e29268..93f036950258755e1088c53ccdb797e6ad37ab9f 100644 (file)
@@ -164,6 +164,7 @@ fhphiClustersLay1(0),
     fClArr[i] = 0;
     for (int j=0;j<2;j++) fUsedClusLay[i][j] = 0;
     fDetectorIndexClustersLay[i] = 0;
+    fClusterCopyIndex[2] = 0;
     fOverlapFlagClustersLay[i] = 0;
     fNClustersLay[i] = 0;
     fClustersLay[i] = 0;
@@ -367,6 +368,7 @@ AliITSMultReconstructor::~AliITSMultReconstructor(){
   for (int i=0;i<2;i++) {
     delete[] fClustersLay[i];
     delete[] fDetectorIndexClustersLay[i];
+    delete[] fClusterCopyIndex[2];
     delete[] fOverlapFlagClustersLay[i];
     delete   fClArr[i];
     for (int j=0;j<2;j++) delete fUsedClusLay[i][j];
@@ -648,6 +650,7 @@ void AliITSMultReconstructor::LoadClusterArrays(TTree* itsClusterTree, int il)
     branch = itsClusterTree->GetBranch("ITSRecPoints");
     branch->SetAddress(&itsClusters);
     if (!fClArr[il]) fClArr[il] = new TClonesArray("AliITSRecPoint",100);
+    delete[] fClusterCopyIndex[il];
   }    
   //
   // count clusters
@@ -679,6 +682,7 @@ void AliITSMultReconstructor::LoadClusterArrays(TTree* itsClusterTree, int il)
   Float_t*   clustersLay              = new Float_t[nclLayer*kClNPar];
   Int_t*     detectorIndexClustersLay = new Int_t[nclLayer];
   Bool_t*    overlapFlagClustersLay   = new Bool_t[nclLayer];
+  if (fCreateClustersCopy) fClusterCopyIndex[il] = new Int_t[nclLayer];
   //
   for (int ic=0;ic<nclLayer;ic++) {
     AliITSRecPoint* cluster = (AliITSRecPoint*)clArr[index[ic]];
@@ -688,6 +692,7 @@ void AliITSMultReconstructor::LoadClusterArrays(TTree* itsClusterTree, int il)
     detectorIndexClustersLay[ic] = cluster->GetDetectorIndex(); 
     overlapFlagClustersLay[ic]   = kFALSE;
     for (Int_t i=3;i--;) clPar[kClMC0+i] = cluster->GetLabel(i);
+    if (fCreateClustersCopy) fClusterCopyIndex[il][ic] = index[ic];
   }
   clArr.Clear();
   delete[] z;
@@ -1261,3 +1266,15 @@ Bool_t AliITSMultReconstructor::CanBeElectron(const AliESDtrack* trc) const
     pid[AliPID::kElectron]>fCutMinElectronProbESD;
   //
 }
+
+//____________________________________________________________________
+AliITSRecPoint* AliITSMultReconstructor::GetRecPoint(Int_t lr, Int_t n) const
+{
+  // return a cluster of lr corresponding to orderer cluster index n
+  if (fClArr[lr] && fClusterCopyIndex[lr] && n<fNClustersLay[lr]) 
+    return (AliITSRecPoint*) fClArr[lr]->At(fClusterCopyIndex[lr][n]);
+  else {
+    AliError("To access the clusters SetCreateClustersCopy should have been called");
+    return 0;
+  }
+}
index a228e8eb9cee11c8664a2f711c2d922be6a9c2e6..ad54e0ff538cf4adffa2e7dd47b5524e857348c8 100644 (file)
@@ -32,6 +32,7 @@ class AliVertex;
 class AliESDVertex;
 class AliMultiplicity;
 class AliRefArray;
+class AliITSRecPoint;
 
 class AliITSMultReconstructor : public AliTrackleter
 {
@@ -74,12 +75,14 @@ public:
   Int_t GetNSingleClusters() const {return fNSingleCluster;}
   Short_t GetNFiredChips(Int_t layer) const {return fNFiredChips[layer];}
 
-  Float_t* GetClusterLayer1(Int_t n) {return &fClustersLay[0][n*kClNPar];}
-  Float_t* GetClusterLayer2(Int_t n) {return &fClustersLay[1][n*kClNPar];}
-  Float_t* GetClusterOfLayer(Int_t lr,Int_t n) {return &fClustersLay[lr][n*kClNPar];}
+  Float_t* GetClusterLayer1(Int_t n) const {return &fClustersLay[0][n*kClNPar];}
+  Float_t* GetClusterLayer2(Int_t n) const {return &fClustersLay[1][n*kClNPar];}
+  Float_t* GetClusterOfLayer(Int_t lr,Int_t n) const {return &fClustersLay[lr][n*kClNPar];}
+  Int_t    GetClusterCopyIndex(Int_t lr,Int_t n) const {return fClusterCopyIndex[lr] ? fClusterCopyIndex[lr][n] : -1;}
+  AliITSRecPoint* GetRecPoint(Int_t lr, Int_t n) const;
   
-  Float_t* GetTracklet(Int_t n) {return fTracklets[n];}
-  Float_t* GetCluster(Int_t n) {return fSClusters[n];}
+  Float_t* GetTracklet(Int_t n) const {return fTracklets[n];}
+  Float_t* GetCluster(Int_t n) const {return fSClusters[n];}
 
   void     SetScaleDThetaBySin2T(Bool_t v=kTRUE)         {fScaleDTBySin2T = v;}
   Bool_t   GetScaleDThetaBySin2T()               const   {return fScaleDTBySin2T;}
@@ -176,6 +179,7 @@ public:
   //
   Float_t*      fClustersLay[2];            //! clusters in the SPD layers of ITS 
   Int_t*        fDetectorIndexClustersLay[2];  //! module index for clusters in ITS layers
+  Int_t*        fClusterCopyIndex[2];         //! when clusters copy is requested, store here the reference on the index
   Bool_t*       fOverlapFlagClustersLay[2];  //! flag for clusters in the overlap regions in ITS layers
 
   Float_t**     fTracklets;            //! tracklets