]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
The number of clusters per layer is stored in the RP container. This modification...
authormasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 13 Dec 2009 09:45:43 +0000 (09:45 +0000)
committermasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 13 Dec 2009 09:45:43 +0000 (09:45 +0000)
ITS/AliITSRecPointContainer.cxx
ITS/AliITSRecPointContainer.h
ITS/AliITSVertexer3D.cxx
ITS/AliITSVertexerZ.cxx

index 4be2cf1e0cb79ea2c620fdfadfebf7c59c72f050..e4b8143ef644a9fd850cc7420b5818726a3e594f 100644 (file)
@@ -33,6 +33,7 @@ fDet(""),
 fStatusOK(kTRUE){
   // Default constructor
 
+  for(Int_t i=0;i<6;i++)fNClusters[i]=0;
   if(fgkNModules != AliITSgeomTGeo::GetNModules())AliError(Form("The total number of modules is not %d, but %d",fgkNModules,AliITSgeomTGeo::GetNModules()));
 
   Int_t modperlay[6];
@@ -140,34 +141,54 @@ TClonesArray* AliITSRecPointContainer::FetchClusters(Int_t mod, TTree* tR,Int_t
     fActualSize = branch->GetEntries();
     CookEntries();
     if(fDet.IsNull())return NULL;
-
     // it is assumed that the filling order of the tree is SPD, SDD, SSD
     // even if one or two subdetector are missing
+    Int_t modL1=AliITSgeomTGeo::GetNDetectors(1)*AliITSgeomTGeo::GetNLadders(1);
     if(IsSPDActive()){
       for(Int_t i=0;i<fSPDNModules;i++){
        branch->SetAddress(&fArray[i]);
        branch->GetEvent(i);
+       if(i<modL1){
+         fNClusters[0]+=fArray[i]->GetEntries();
+       }
+       else {
+         fNClusters[1]+=fArray[i]->GetEntries();
+       }
       }
     }
     if(IsSDDActive()){
       Int_t start=0;
       if(IsSPDActive())start+=fSPDNModules;
+      Int_t modL3=AliITSgeomTGeo::GetNDetectors(3)*AliITSgeomTGeo::GetNLadders(3);
       Int_t counter = fSPDNModules;
       for(Int_t i=start;i<start+fSDDNModules;i++){
        branch->SetAddress(&fArray[counter]);
        ++counter;
        branch->GetEvent(i);
+       if((i-start)<modL3){
+         fNClusters[2]+=fArray[i]->GetEntries();
+       }
+       else {
+         fNClusters[3]+=fArray[i]->GetEntries();
+       }
       }
     }
     if(IsSSDActive()){
       Int_t start=0;
       if(IsSPDActive())start+=fSPDNModules;
       if(IsSDDActive())start+=fSDDNModules;
+      Int_t modL5=AliITSgeomTGeo::GetNDetectors(5)*AliITSgeomTGeo::GetNLadders(5);
       Int_t counter = fSPDNModules+fSDDNModules;
       for(Int_t i=start;i<start+fSSDNModules;i++){
        branch->SetAddress(&fArray[counter]);
        ++counter;
        branch->GetEvent(i);
+       if((i-start)<modL5){
+         fNClusters[4]+=fArray[i]->GetEntries();
+       }
+       else {
+         fNClusters[5]+=fArray[i]->GetEntries();
+       }
       }
     }
   }
@@ -181,7 +202,34 @@ TClonesArray* AliITSRecPointContainer::FetchClusters(Int_t mod, TTree* tR,Int_t
   }
   
 }
-
+//______________________________________________________________________
+UInt_t AliITSRecPointContainer::GetNClustersInLayer(Int_t lay, TTree* tR, Int_t eventN){
+  // returns the number of clusters for laier lay
+  // layers are numbered from 1 to 6
+  if(lay<1 || lay >6){
+    AliError(Form("Layer %d is out of range",lay));
+    return 0;
+  }
+  if(eventN>=0){
+    FetchClusters(0,tR,eventN);
+  }
+  else {
+    FetchClusters(0,tR);
+  }
+  return fNClusters[lay-1];
+}
+//______________________________________________________________________
+UInt_t AliITSRecPointContainer::GetNClustersInLayerFast(Int_t lay) const {
+  // returns the number of clusters for laier lay
+  // layers are numbered from 1 to 6
+  // No checks are done on the event number: the numer of clusters 
+  // for the event stored in memory is returned
+  if(lay<1 || lay >6){
+    AliError(Form("Layer %d is out of range",lay));
+    return 0;
+  }
+  return fNClusters[lay-1];
+}
 //______________________________________________________________________
 AliITSRecPointContainer* AliITSRecPointContainer::Instance(const AliITSRecoParam* kptr){
   // returns AliITSRecPointContainer instance (singleton)
@@ -203,4 +251,5 @@ void AliITSRecPointContainer::Reset(){
     (fArray[i])->Clear();
   }
   fDet="";
+  for(Int_t i=0;i<6;i++)fNClusters[i]=0;
 }
index 9b21b0cbfa0f7d1e3288e9078553a00f0204f0bf..1a493ef03baee1d98822ca4e612ebafadfa9a7b2 100644 (file)
@@ -33,6 +33,10 @@ class AliITSRecPointContainer : public TObject {
   TClonesArray* FetchClusters(Int_t mod, TTree* tR,Int_t cureve);
   TClonesArray* UncheckedGetClusters(Int_t mod) const {return fArray[mod];}
 
+  // In the following two methods: 1<=lay<=6  (i.e. layers numbered from 1) 
+  UInt_t GetNClustersInLayer(Int_t lay, TTree* tR, Int_t eventN=-1);
+  UInt_t GetNClustersInLayerFast(Int_t lay) const;
+
  private:
   // methods
   AliITSRecPointContainer(const AliITSRecoParam* krp=NULL);   // Default constructor
@@ -57,6 +61,7 @@ class AliITSRecPointContainer : public TObject {
   TString fDet; //! ITS subdetectors active for the current run 
   Bool_t fStatusOK; //! kFALSE is RP branch is absent or if there are anomalies
                     //! in the number of active modules
+  UInt_t fNClusters[6]; //! Number of clusters per layer
 
   ClassDef(AliITSRecPointContainer,0)
 };
index a7def28657b4b59a4e685758910549a89e3a9830..1ee1bf60182f97122845ef36201208c7ffe6f276 100644 (file)
@@ -515,21 +515,8 @@ Int_t AliITSVertexer3D::FindTracklets(TTree *itsClusterTree, Int_t optCuts){
 
   Int_t nrpL1 = 0;    // number of rec points on layer 1
   Int_t nrpL2 = 0;    // number of rec points on layer 2
-
-  // By default irstL1=0 and lastL1=79
-  Int_t firstL1 = AliITSgeomTGeo::GetModuleIndex(1,1,1);
-  Int_t lastL1 = AliITSgeomTGeo::GetModuleIndex(2,1,1)-1;
-  for(Int_t module= firstL1; module<=lastL1;module++){  // count number of recopints on layer 1
-    itsRec=rpcont->UncheckedGetClusters(module);
-    nrpL1+= itsRec->GetEntries();
-  }
-  //By default firstL2=80 and lastL2=239
-  Int_t firstL2 = AliITSgeomTGeo::GetModuleIndex(2,1,1);
-  Int_t lastL2 = AliITSgeomTGeo::GetModuleIndex(3,1,1)-1;
-  for(Int_t module= firstL2; module<=lastL2;module++){  // count number of recopints on layer 2
-    itsRec=rpcont->UncheckedGetClusters(module);
-    nrpL2+= itsRec->GetEntries();
-  }
+  nrpL1=rpcont->GetNClustersInLayerFast(1);
+  nrpL2=rpcont->GetNClustersInLayerFast(2);
   if(nrpL1 == 0 || nrpL2 == 0){
     AliDebug(1,Form("No RecPoints in at least one SPD layer (%d %d)",nrpL1,nrpL2));
     return -1;
@@ -548,6 +535,8 @@ Int_t AliITSVertexer3D::FindTracklets(TTree *itsClusterTree, Int_t optCuts){
 
   Int_t nolines = 0;
   // Loop on modules of layer 1
+  Int_t firstL1 = AliITSgeomTGeo::GetModuleIndex(1,1,1);
+  Int_t lastL1 = AliITSgeomTGeo::GetModuleIndex(2,1,1)-1;
   for(Int_t modul1= firstL1; modul1<=lastL1;modul1++){   // Loop on modules of layer 1
     if(!fUseModule[modul1]) continue;
     UShort_t ladder=int(modul1/4)+1; // ladders are numbered starting from 1
index 81c1a5bb819f08aced093670f64d9c4cb9f594d6..a1051a270ac543592290e10b81442ad84170bbf9 100644 (file)
@@ -207,17 +207,9 @@ void AliITSVertexerZ::VertexZFinder(TTree *itsClusterTree){
 
   Int_t nrpL1 = 0;
   Int_t nrpL2 = 0;
+  nrpL1=rpcont->GetNClustersInLayerFast(1);
+  nrpL2=rpcont->GetNClustersInLayerFast(2);
 
-  // By default fFirstL1=0 and fLastL1=79
-  for(Int_t module= fFirstL1; module<=fLastL1;module++){
-    itsRec=rpcont->UncheckedGetClusters(module);
-    nrpL1+= itsRec->GetEntries();
-  }
-  //By default fFirstL2=80 and fLastL2=239
-  for(Int_t module= fFirstL2; module<=fLastL2;module++){
-    itsRec=rpcont->UncheckedGetClusters(module);
-    nrpL2+= itsRec->GetEntries();
-  }
   if(nrpL1 == 0 || nrpL2 == 0){
     AliDebug(1,Form("No RecPoints in at least one SPD layer (%d %d)",nrpL1,nrpL2));
     ResetHistograms();