Changes to set the number of layers in trackerUpgrade and trackU from the reconstructor.
authoramastros <amastros@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 10 Feb 2011 11:53:19 +0000 (11:53 +0000)
committeramastros <amastros@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 10 Feb 2011 11:53:19 +0000 (11:53 +0000)
ITS/UPGRADE/AliITSUpgradeReconstructor.cxx
ITS/UPGRADE/AliITSUpgradeReconstructor.h
ITS/UPGRADE/AliITStrackU.cxx
ITS/UPGRADE/AliITStrackU.h
ITS/UPGRADE/AliITStrackerUpgrade.cxx
ITS/UPGRADE/AliITStrackerUpgrade.h

index c591605..5ece2d1 100644 (file)
@@ -42,14 +42,20 @@ ClassImp(AliITSUpgradeReconstructor)
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   AliITSUpgradeReconstructor::AliITSUpgradeReconstructor():
     AliReconstructor(), 
-    fDigits(0x0)
+    fDigits(0x0),
+    fNlayers(0)
 {
   //
   //ctor
   //
-  fDigits = new TObjArray(kNLayers);
+  
+  AliITSsegmentationUpgrade *s = new AliITSsegmentationUpgrade();
+  fNlayers = s->GetNLayers();
+  delete s;
+  
+  fDigits = new TObjArray(fNlayers);
   fDigits->SetOwner(kTRUE);
-  for(Int_t iLay =0; iLay<kNLayers; iLay++) fDigits->AddAt(new TClonesArray("AliITSDigitUpgrade",5000),iLay);
+  for(Int_t iLay =0; iLay<fNlayers; iLay++) fDigits->AddAt(new TClonesArray("AliITSDigitUpgrade",5000),iLay);
   AliInfo("    ************* Using the upgrade reconstructor! ****** ");
 
 
@@ -123,7 +129,7 @@ void AliITSUpgradeReconstructor::Reconstruct(TTree* digitsTree, TTree* clustersT
   //
   // Clustering
   //
-  for(Int_t iLay=0;iLay<kNLayers;iLay++) {
+  for(Int_t iLay=0;iLay<fNlayers;iLay++) {
     digitsTree->SetBranchAddress(Form("Layer%d",iLay),&(*fDigits)[iLay]);
   }
  
@@ -134,7 +140,7 @@ void AliITSUpgradeReconstructor::Reconstruct(TTree* digitsTree, TTree* clustersT
   clf->DigitsToRecPoints(fDigits);     //cluster finder
   clustersTree->Fill();                //fill tree for current event
   delete clf;
-  for(Int_t iLay=0;iLay<kNLayers;iLay++){
+  for(Int_t iLay=0;iLay<fNlayers;iLay++){
     fDigits->At(iLay)->Clear();
   }
 
@@ -148,7 +154,7 @@ AliTracker* AliITSUpgradeReconstructor::CreateTracker() const
   // 
 
   if(GetRecoParam()->GetTrackerSAOnly()){
-  AliITStrackerUpgrade *trackUp = new AliITStrackerUpgrade();
+  AliITStrackerUpgrade *trackUp = new AliITStrackerUpgrade(fNlayers);
   if(GetRecoParam()->GetTrackerSAOnly()) trackUp->SetSAFlag(kTRUE);
   if(trackUp->GetSAFlag())AliDebug(1,"Tracking Performed in ITS only\n");
   if(GetRecoParam()->GetInwardFindingSA()){
index fe56fcd..2b2613c 100644 (file)
@@ -38,18 +38,16 @@ class AliITSUpgradeReconstructor: public AliReconstructor
 
   virtual void  Reconstruct(TTree* digitsTree, TTree* clustersTree) const; 
   virtual void  Reconstruct(AliRawReader * /*rawdata*/, TTree* /*clustersTree*/) const {AliInfo("Not implemented");} 
-  enum {kNLayers=6};
 
   static const AliITSRecoParam* GetRecoParam() { return dynamic_cast<const AliITSRecoParam*>(AliReconstructor::GetRecoParam(0)); }
 
  private:
   AliITSUpgradeReconstructor(const AliITSUpgradeReconstructor&);              //Not implemented
   AliITSUpgradeReconstructor &operator=(const AliITSUpgradeReconstructor&);   //Not implemented
-  TObjArray    *fDigits;     
+  TObjArray  *fDigits;     
+  Int_t      fNlayers;
 
-
-  //TString fmemberToWriteLater;
-  //  
   ClassDef(AliITSUpgradeReconstructor, 1)        // class for the ITS reconstruction
     };
 
index 40eba0c..f8ea96c 100755 (executable)
 ////////////////////////////////////////////////////////
 
 #include "AliITStrackU.h"
-
+#include "AliITSsegmentationUpgrade.cxx"
 
 ClassImp(AliITStrackU)
 
 //_____________________________________
 AliITStrackU:: AliITStrackU() : AliITStrackMI(),
-fNU(0)
+fNU(0),
+fNLayers(0)
 {
 // Default constructor  
   SetNumberOfClusters(0);
   SetNumberOfClustersU(0);
   ResetIndexU();
-  for(Int_t nlay=0;nlay<AliITSsegmentationUpgrade::GetNLayers();nlay++){ 
+  for(Int_t nlay=0;nlay<fNLayers;nlay++){ 
     SetNumberOfMarked(nlay,0);
   }
   ResetMarked();
 }
-
+//_____________________________________
+AliITStrackU:: AliITStrackU(Int_t nlay) : AliITStrackMI(),
+fNU(0),
+fNLayers(nlay)
+{
+// Constructor
+  SetNumberOfClusters(0);
+  SetNumberOfClustersU(0);
+  ResetIndexU();
+  for(Int_t nl=0;nl<fNLayers;nl++){
+    SetNumberOfMarked(nl,0);
+  }
+  ResetMarked();
+}
 
 //___________________________________________________
 AliITStrackU::AliITStrackU(const AliITStrackMI& t) : 
 AliITStrackMI(t),
-fNU(0){
+fNU(0),
+fNLayers(0)
+{
+//
 // Copy a V2 track into a U track
+// -> to be checked
+
   SetNumberOfClustersU(0);
   ResetIndexU();
-  for(Int_t nlay=0;nlay<AliITSsegmentationUpgrade::GetNLayers();nlay++){ 
+  for(Int_t nlay=0;nlay<fNLayers;nlay++){ 
     SetNumberOfMarked(nlay,0);
   }
   ResetMarked();
@@ -58,32 +77,34 @@ fNU(0){
 //___________________________________________________
 AliITStrackU::AliITStrackU(const AliITStrackU& t) : 
 AliITStrackMI(t),
-fNU(t.fNU){
+fNU(t.fNU),
+fNLayers(t.fNLayers)
+{
+//
 // Copy constructor
-
+// to be checked
 
   ResetIndexU();
   ResetMarked();
   Int_t number = t.GetNumberOfClustersU();
   SetNumberOfClustersU(number);
-  for(Int_t nlay=0;nlay<AliITSsegmentationUpgrade::GetNLayers();nlay++){
+  for(Int_t nlay=0;nlay<fNLayers;nlay++){
     SetNumberOfMarked(nlay,t.GetNumberOfMarked(nlay));
   }
   for(Int_t i=0;i<number;i++){
     fSain[i]=t.fSain[i];
   }
-  for(Int_t nlay=0;nlay<AliITSsegmentationUpgrade::GetNLayers();nlay++){
+  for(Int_t nlay=0;nlay<fNLayers;nlay++){
     for(Int_t i=0;i<t.GetNumberOfMarked(nlay);i++){
       fCluMark[nlay][i]=t.fCluMark[nlay][i];
     }
   }
 }
 //____________________________________________________
-AliITStrackU::AliITStrackU(Double_t alpha, Double_t radius, Double_t Ycoor, Double_t Zcoor, Double_t phi, Double_t tanlambda, Double_t curv, Int_t lab ):
-fNU(0) 
+AliITStrackU::AliITStrackU(Double_t alpha, Double_t radius, Double_t Ycoor, Double_t Zcoor, Double_t phi, Double_t tanlambda, Double_t curv, Int_t lab, Int_t nlay ):
+fNU(0), fNLayers(nlay)
 {
   // standard constructor. Used for ITSUpgrade standalone tracking
-
   // get the azimuthal angle of the detector containing the innermost
   // cluster of this track (data member fAlpha)
 
@@ -130,13 +151,13 @@ fNU(0)
                                                                               
   Set(radius,alpha,sP,sC);
 
-  for(Int_t i=0; i<AliITSsegmentationUpgrade::GetNLayers(); i++) fIndex[i] = 0;  // to be set explicitely
+  for(Int_t i=0; i<fNLayers; i++) fIndex[i] = 0;  // to be set explicitely
 
   for(Int_t i=0; i<4; i++) fdEdxSample[i] = 0; 
 
   SetNumberOfClusters(0);
   SetNumberOfClustersU(0);
-  for(Int_t nlay=0;nlay<AliITSsegmentationUpgrade::GetNLayers();nlay++) SetNumberOfMarked(nlay,0);
+  for(Int_t nlay=0;nlay<fNLayers;nlay++) SetNumberOfMarked(nlay,0);
   ResetIndexU();
   ResetMarked();
   SetChi2(0);
@@ -178,7 +199,7 @@ void AliITStrackU::AddClusterMark(Int_t layer, Int_t clnumb) {
 void AliITStrackU::AddClusterV2(Int_t layer,Int_t clnumb) {
   // add one clusters to the list (maximum number=6)
   Int_t presnum = GetNumberOfClusters();
-  if(presnum>=AliITSsegmentationUpgrade::GetNLayers()){
+  if(presnum>=fNLayers){
     Warning("AddClusterV2","Maximum number of clusters already reached. Nothing is done\n");
     return;
    }    
@@ -192,7 +213,7 @@ void AliITStrackU::AddClusterV2(Int_t layer,Int_t clnumb) {
 void AliITStrackU::ResetMarked(){
 
   //Reset array of marked clusters
-  for(Int_t nlay=0;nlay<AliITSsegmentationUpgrade::GetNLayers();nlay++){
+  for(Int_t nlay=0;nlay<fNLayers;nlay++){
     for(Int_t k=0; k<kMaxNumberOfClustersL; k++) fCluMark[nlay][k]=0;
   }
 }
index d6b0632..e2a64d8 100755 (executable)
@@ -10,7 +10,6 @@
 //           cristina.terrevoli@ba.infn.it            //                                                    
 ////////////////////////////////////////////////////////
 
-#include "AliITSsegmentationUpgrade.h"
 #include "AliITStrackMI.h"
 
 class AliITStrackU : public AliITStrackMI {
@@ -19,11 +18,12 @@ class AliITStrackU : public AliITStrackMI {
  public:
 
   AliITStrackU();
+  AliITStrackU(Int_t nlay);
   AliITStrackU(const AliITStrackMI& t);
   AliITStrackU(const AliITStrackU& t);
   AliITStrackU(Double_t alpha, Double_t radius,
                 Double_t Ycoor, Double_t Zcoor, Double_t phi, 
-                Double_t tanlambda, Double_t curv, Int_t lab);
+                Double_t tanlambda, Double_t curv, Int_t lab, Int_t nlay);
 
   Int_t GetClusterIndexU(Int_t i) const {return fSain[i];}
   Int_t GetClusterMark(Int_t layer,Int_t i) const {return fCluMark[layer][i];}
@@ -49,8 +49,10 @@ class AliITStrackU : public AliITStrackMI {
   void ResetMarked(); 
 
   static const Int_t fgMaxNLayer = 8; //max number of layers in ITSUpgrade
-  UInt_t  fSain[kMaxNumberOfClusters];   // cluster index (Stand Alone Upgrade)
   Int_t fNU;          // number of clusters Stand Alone Upgrade 
+  Int_t fNLayers;    // number of layers
+
+  UInt_t  fSain[kMaxNumberOfClusters];   // cluster index (Stand Alone Upgrade)
 
   Int_t fCluMark[fgMaxNLayer][kMaxNumberOfClustersL]; //indices for cluster used
   Int_t fNM[fgMaxNLayer]; //number of marked clusters
index fe3611a..9aaaa3a 100644 (file)
@@ -49,79 +49,70 @@ ClassImp(AliITStrackerUpgrade)
 
 //____________________________________________________________________________
   AliITStrackerUpgrade::AliITStrackerUpgrade():AliITStrackerMI(),
-                                              fNLayer(AliITSsegmentationUpgrade::GetNLayers()),
-                                              fPhiEstimate(0),
-                                              fITSStandAlone(0),
-                                              fLambdac(0),
-                                              fPhic(0),
-                                              fCoef1(0),
-                                              fCoef2(0),
-                                              fCoef3(0),
-                                              fNloop(0),
-                                              fPhiWin(0),
-                                              fLambdaWin(0),
-                                              fVert(0),
-                                              fVertexer(0),
-                                              fListOfTracks(0),
-                                              fListOfUTracks(0),
-                                              fITSclusters(0),
-                                              fInwardFlag(0),
-                                              fOuterStartLayer(0),
-                                              fInnerStartLayer(AliITSsegmentationUpgrade::GetNLayers()),
-                                              fMinNPoints(0),
-                                              fMinQ(0.),
-                                              fLayers(0),
-                                               fSegmentation(0x0),
-                                              fCluLayer(0),
-                                              fCluCoord(0){
+   fNLayers(), fPhiEstimate(0), fITSStandAlone(0), fLambdac(0),
+   fPhic(0), fCoef1(0), fCoef2(0), fCoef3(0), fNloop(0), 
+   fPhiWin(0),  fLambdaWin(0), fVert(0), fVertexer(0),
+   fListOfTracks(0), fListOfUTracks(0), fITSclusters(0),
+   fInwardFlag(0), fOuterStartLayer(0),  fInnerStartLayer(0),
+   fMinNPoints(0),  fMinQ(0),  fLayers(0), fSegmentation(0x0),
+   fCluLayer(0), fCluCoord(0)
+   {
+    //
     // Default constructor
+    //
+    Init();
+  }
+  
+  //____________________________________________________________________________
+  AliITStrackerUpgrade::AliITStrackerUpgrade(Int_t nLay):AliITStrackerMI(),
+   fNLayers(nLay), fPhiEstimate(0), fITSStandAlone(0), fLambdac(0),
+   fPhic(0), fCoef1(0), fCoef2(0), fCoef3(0), fNloop(0), 
+   fPhiWin(0),  fLambdaWin(0), fVert(0), fVertexer(0),
+   fListOfTracks(0), fListOfUTracks(0), fITSclusters(0),
+   fInwardFlag(0), fOuterStartLayer(0),  fInnerStartLayer(nLay),
+   fMinNPoints(0),  fMinQ(0),  fLayers(0), fSegmentation(0x0),
+   fCluLayer(0), fCluCoord(0)
+   {
+    //
+    // constructor
+    //
     Init();
  
   }
+  
 //________________________________________________________________________
 AliITStrackerUpgrade::AliITStrackerUpgrade(const AliITStrackerUpgrade& tracker):AliITStrackerMI(),
-                                                                               fNLayer(tracker.fNLayer),
-                                                                               fPhiEstimate(tracker.fPhiEstimate),
-                                                                               fITSStandAlone(tracker.fITSStandAlone),
-                                                                               fLambdac(tracker.fLambdac),
-                                                                               fPhic(tracker.fPhic),
-                                                                               fCoef1(tracker.fCoef1),
-                                                                               fCoef2(tracker.fCoef2),
-                                                                               fCoef3(tracker.fCoef3),
-                                                                               fNloop(tracker.fNloop),
-                                                                               fPhiWin(tracker.fPhiWin),
-                                                                               fLambdaWin(tracker.fLambdaWin),
-                                                                               fVert(tracker.fVert),
-                                                                               fVertexer(tracker.fVertexer),
-                                                                               fListOfTracks(tracker.fListOfTracks),
-                                                                               fListOfUTracks(tracker.fListOfUTracks),
-                                                                               fITSclusters(tracker.fITSclusters),
-                                                                               fInwardFlag(tracker.fInwardFlag),
-                                                                               fOuterStartLayer(tracker.fOuterStartLayer),
-                                                                               fInnerStartLayer(tracker.fInnerStartLayer),
-                                                                               fMinNPoints(tracker.fMinNPoints),
-                                                                               fMinQ(tracker.fMinQ),
-                                                                               fLayers(tracker.fLayers),
-                                                                               fSegmentation(tracker.fSegmentation),
-                                                                               fCluLayer(tracker.fCluLayer),
-                                                                               fCluCoord(tracker.fCluCoord) {
-  // Copy constructor
-  for(Int_t i=0;i<2;i++){
-    fPoint1[i]=tracker.fPoint1[i];
-    fPoint2[i]=tracker.fPoint2[i];
-    fPoint3[i]=tracker.fPoint3[i];
-    fPointc[i]=tracker.fPointc[i];
-  }
-  if(tracker.fVertexer && tracker.fVert){
-    fVert = new AliESDVertex(*tracker.fVert);
-  }
-  else {
-    fVert = tracker.fVert;
-  }
-  for(Int_t i=0;i<AliITSsegmentationUpgrade::GetNLayers();i++){
-    fCluLayer[i] = tracker.fCluLayer[i];
-    fCluCoord[i] = tracker.fCluCoord[i];
-  }
+    fNLayers(tracker.fNLayers), fPhiEstimate(tracker.fPhiEstimate),
+    fITSStandAlone(tracker.fITSStandAlone), fLambdac(tracker.fLambdac),
+    fPhic(tracker.fPhic), fCoef1(tracker.fCoef1), fCoef2(tracker.fCoef2),
+    fCoef3(tracker.fCoef3), fNloop(tracker.fNloop), fPhiWin(tracker.fPhiWin),
+    fLambdaWin(tracker.fLambdaWin), fVert(tracker.fVert), fVertexer(tracker.fVertexer),
+    fListOfTracks(tracker.fListOfTracks), fListOfUTracks(tracker.fListOfUTracks),
+    fITSclusters(tracker.fITSclusters), fInwardFlag(tracker.fInwardFlag),
+    fOuterStartLayer(tracker.fOuterStartLayer), fInnerStartLayer(tracker.fInnerStartLayer),
+    fMinNPoints(tracker.fMinNPoints), fMinQ(tracker.fMinQ), fLayers(tracker.fLayers),
+    fSegmentation(tracker.fSegmentation), fCluLayer(tracker.fCluLayer), fCluCoord(tracker.fCluCoord) 
+    {
+    //                                                                 
+    // Copy constructor
+    for(Int_t i=0;i<2;i++){
+     fPoint1[i]=tracker.fPoint1[i];
+     fPoint2[i]=tracker.fPoint2[i];
+     fPoint3[i]=tracker.fPoint3[i];
+     fPointc[i]=tracker.fPointc[i];
+    }
+    if(tracker.fVertexer && tracker.fVert){
+      fVert = new AliESDVertex(*tracker.fVert);
+    }
+     else {
+     fVert = tracker.fVert;
+    }
+    
+    for(Int_t i=0;i<fNLayers;i++){
+     fCluLayer[i] = tracker.fCluLayer[i];
+     fCluCoord[i] = tracker.fCluCoord[i];
+    }
 }
 //______________________________________________________________________
 AliITStrackerUpgrade& AliITStrackerUpgrade::operator=(const AliITStrackerUpgrade& source){
@@ -150,7 +141,7 @@ AliITStrackerUpgrade::~AliITStrackerUpgrade(){
   fListOfUTracks->Delete();
   delete fListOfUTracks;
   if(fCluLayer){
-    for(Int_t i=0;i<AliITSsegmentationUpgrade::GetNLayers();i++){
+    for(Int_t i=0;i<fNLayers;i++){
       if(fCluLayer[i]){
        fCluLayer[i]->Delete();
        delete fCluLayer[i];
@@ -159,7 +150,7 @@ AliITStrackerUpgrade::~AliITStrackerUpgrade(){
     delete [] fCluLayer;
   }
   if(fCluCoord){
-    for(Int_t i=0;i<AliITSsegmentationUpgrade::GetNLayers();i++){
+    for(Int_t i=0;i<fNLayers;i++){
       if(fCluCoord[i]){
        fCluCoord[i]->Delete();
        delete fCluCoord[i];
@@ -196,6 +187,7 @@ Int_t AliITStrackerUpgrade::Clusters2Tracks(AliESDEvent *event){
 //_________________________________________________-
 void AliITStrackerUpgrade::Init(){
   //  Reset all data members
+  const Int_t nL = fNLayers;
   fPhiEstimate=0;
   for(Int_t i=0;i<3;i++){fPoint1[i]=0;fPoint2[i]=0;fPoint3[i]=0;}
   fLambdac=0;
@@ -223,11 +215,11 @@ void AliITStrackerUpgrade::Init(){
   SetSAFlag(kFALSE);
   fListOfTracks=new TClonesArray("AliITStrackMI",100);
   fListOfUTracks=new TClonesArray("AliITStrackU",100);
-  fLayers=new AliITSlayerUpgrade*[AliITSsegmentationUpgrade::GetNLayers()];//to be fixed
+  fLayers=new AliITSlayerUpgrade*[nL];//to be fixed
   fCluLayer = 0;
   fCluCoord = 0;
   fMinNPoints = 3;
-  for(Int_t layer=0; layer<AliITSsegmentationUpgrade::GetNLayers(); layer++){
+  for(Int_t layer=0; layer<fNLayers; layer++){
     Double_t p=0.;
     Double_t zC= 0.;
     fLayers[layer] = new AliITSlayerUpgrade(p,zC);
@@ -321,25 +313,25 @@ Int_t AliITStrackerUpgrade::FindTracks(AliESDEvent* event,Bool_t useAllClusters)
   //Get primary vertex
   Double_t primaryVertex[3];
   event->GetVertex()->GetXYZ(primaryVertex);
-  Int_t nclusters[AliITSsegmentationUpgrade::GetNLayers()];//={0,0,0,0,0,0};
-  for(Int_t i=0; i<AliITSsegmentationUpgrade::GetNLayers(); i++){
+  Int_t nclusters[fNLayers];//={0,0,0,0,0,0};
+  for(Int_t i=0; i<fNLayers; i++){
     nclusters[i]=0;
   }
   
-  Int_t dmar[AliITSsegmentationUpgrade::GetNLayers()];//={0,0,0,0,0,0};
-  for(Int_t i=0; i<AliITSsegmentationUpgrade::GetNLayers(); i++){ 
+  Int_t dmar[fNLayers];//={0,0,0,0,0,0};
+  for(Int_t i=0; i<fNLayers; i++){ 
     dmar[i]=0;
   }
 
   if (fCluLayer == 0) {
-    fCluLayer = new TClonesArray*[AliITSsegmentationUpgrade::GetNLayers()];
-    fCluCoord = new TClonesArray*[AliITSsegmentationUpgrade::GetNLayers()];
-    for(Int_t i=0;i<AliITSsegmentationUpgrade::GetNLayers();i++) {
+    fCluLayer = new TClonesArray*[fNLayers];
+    fCluCoord = new TClonesArray*[fNLayers];
+    for(Int_t i=0;i<fNLayers;i++) {
       fCluLayer[i]=0;
       fCluCoord[i]=0;
     }
   }
-  for(Int_t i=0;i<AliITSsegmentationUpgrade::GetNLayers();i++){
+  for(Int_t i=0;i<fNLayers;i++){
     if (!ForceSkippingOfLayer(i)) {
       for(Int_t cli=0;cli<fLayers[i]->GetNumberOfClusters();cli++){
         AliITSRecPoint* cls = (AliITSRecPoint*)fLayers[i]->GetCluster(cli);
@@ -363,7 +355,7 @@ Int_t AliITStrackerUpgrade::FindTracks(AliESDEvent* event,Bool_t useAllClusters)
       fCluCoord[i]->Expand(nclusters[i]);
     }
   }
-  for(Int_t ilay=0;ilay<AliITSsegmentationUpgrade::GetNLayers();ilay++){
+  for(Int_t ilay=0;ilay<fNLayers;ilay++){
     TClonesArray &clulay = *fCluLayer[ilay];
     TClonesArray &clucoo = *fCluCoord[ilay];
     if (!ForceSkippingOfLayer(ilay)){
@@ -394,20 +386,20 @@ Int_t AliITStrackerUpgrade::FindTracks(AliESDEvent* event,Bool_t useAllClusters)
   Int_t nSeedSteps=lastLayForSeed-startLayForSeed;
   Int_t seedStep=1;
   if(fInwardFlag){
-    startLayForSeed=AliITSsegmentationUpgrade::GetNLayers()-1;
+    startLayForSeed=fNLayers-1;
     lastLayForSeed=fInnerStartLayer;
     nSeedSteps=startLayForSeed-lastLayForSeed;
     seedStep=-1;
   }
   // loop on minimum number of points
-  for(Int_t iMinNPoints=AliITSsegmentationUpgrade::GetNLayers(); iMinNPoints>=fMinNPoints; iMinNPoints--) {
+  for(Int_t iMinNPoints=fNLayers; iMinNPoints>=fMinNPoints; iMinNPoints--) {
     // loop on starting layer for track finding
     for(Int_t iSeedLay=0; iSeedLay<=nSeedSteps; iSeedLay++) {
       Int_t theLay=startLayForSeed+iSeedLay*seedStep;
       if(ForceSkippingOfLayer(theLay)) continue;
       Int_t minNPoints=iMinNPoints-theLay;
-      if(fInwardFlag) minNPoints=iMinNPoints-(AliITSsegmentationUpgrade::GetNLayers()-1-theLay);
-      for(Int_t i=theLay+1;i<AliITSsegmentationUpgrade::GetNLayers();i++)
+      if(fInwardFlag) minNPoints=iMinNPoints-(fNLayers-1-theLay);
+      for(Int_t i=theLay+1;i<fNLayers;i++)
         if(ForceSkippingOfLayer(i))
           minNPoints--;
       if(minNPoints<fMinNPoints) continue;
@@ -419,11 +411,11 @@ Int_t AliITStrackerUpgrade::FindTracks(AliESDEvent* event,Bool_t useAllClusters)
           ResetForFinding();
           Bool_t useRP=SetFirstPoint(theLay,nclTheLay,primaryVertex);
           if(!useRP) continue;
-          AliITStrackU trs;
+          AliITStrackU trs(fNLayers);
 
           Int_t pflag=0;
           Int_t kk;
-          for(kk=0;kk<AliITSsegmentationUpgrade::GetNLayers();kk++) nClusLay[kk] = 0;
+          for(kk=0;kk<fNLayers;kk++) nClusLay[kk] = 0;
 
           kk=0;
           nClusLay[kk] = SearchClusters(theLay,fPhiWin[nloop],fLambdaWin[nloop],
@@ -446,13 +438,13 @@ Int_t AliITStrackerUpgrade::FindTracks(AliESDEvent* event,Bool_t useAllClusters)
               }
             }
             nextLay+=seedStep;
-            if(nextLay<0 || nextLay==AliITSsegmentationUpgrade::GetNLayers()) goon=kFALSE;
+            if(nextLay<0 || nextLay==fNLayers) goon=kFALSE;
           }
 
 
           Int_t layOK=0;
           if(!fInwardFlag){
-            for(Int_t nnp=0;nnp<AliITSsegmentationUpgrade::GetNLayers()-theLay;nnp++){
+            for(Int_t nnp=0;nnp<fNLayers-theLay;nnp++){
               if(nClusLay[nnp]!=0) layOK+=1;
             }
           }else{
@@ -499,7 +491,7 @@ AliITStrackV2* AliITStrackerUpgrade::FitTrack(AliITStrackU* tr,Double_t *primary
   static Int_t end[6];
   static AliITSRecPoint *listlayer[6][kMaxClu];
 
-  for(Int_t i=0;i<AliITSsegmentationUpgrade::GetNLayers();i++) {
+  for(Int_t i=0;i<fNLayers;i++) {
     end[i]=0;
     for(Int_t j=0;j<kMaxClu; j++){
       clind[i][j]=0;
@@ -507,8 +499,8 @@ AliITStrackV2* AliITStrackerUpgrade::FitTrack(AliITStrackU* tr,Double_t *primary
       listlayer[i][j]=0;
     }
   }
-  Int_t inx[AliITSsegmentationUpgrade::GetNLayers()]; 
-  for (Int_t k=0; k<AliITSsegmentationUpgrade::GetNLayers(); k++) inx[k]=-1;
+  Int_t inx[fNLayers]; 
+  for (Int_t k=0; k<fNLayers; k++) inx[k]=-1;
   Int_t nclusters = tr->GetNumberOfClustersU();
   for(Int_t ncl=0;ncl<nclusters;ncl++){
     Int_t index = tr->GetClusterIndexU(ncl); 
@@ -525,7 +517,7 @@ AliITStrackV2* AliITStrackerUpgrade::FitTrack(AliITStrackU* tr,Double_t *primary
     end[lay]++;
   }
 
-  for(Int_t nlay=0;nlay<AliITSsegmentationUpgrade::GetNLayers();nlay++){
+  for(Int_t nlay=0;nlay<fNLayers;nlay++){
     for(Int_t ncl=0;ncl<tr->GetNumberOfMarked(nlay);ncl++){
       Int_t mark = tr->GetClusterMark(nlay,ncl);
       clmark[nlay][ncl]=mark;
@@ -534,7 +526,7 @@ AliITStrackV2* AliITStrackerUpgrade::FitTrack(AliITStrackU* tr,Double_t *primary
 
 
   Int_t firstLay=-1,secondLay=-1;
-  for(Int_t i=0;i<AliITSsegmentationUpgrade::GetNLayers();i++) {
+  for(Int_t i=0;i<fNLayers;i++) {
     if(end[i]==0) {
       end[i]=1;
     }else{
@@ -669,7 +661,7 @@ AliITStrackV2* AliITStrackerUpgrade::FitTrack(AliITStrackU* tr,Double_t *primary
               Double_t alpha= (ladder*18.+9.)*TMath::Pi()/180.;
 
 
-              AliITStrackU trac(alpha,radius,yclu1,zclu1,phi2,tgl2,cv,1);
+              AliITStrackU trac(alpha,radius,yclu1,zclu1,phi2,tgl2,cv,1,fNLayers);
 
 
               if(cl5!=0) {
@@ -743,14 +735,14 @@ AliITStrackV2* AliITStrackerUpgrade::FitTrack(AliITStrackU* tr,Double_t *primary
   otrack->SetLabel(label);
 
 
-  Int_t indexc[AliITSsegmentationUpgrade::GetNLayers()];
-  for(Int_t i=0;i<AliITSsegmentationUpgrade::GetNLayers();i++) indexc[i]=0;
+  Int_t indexc[fNLayers];
+  for(Int_t i=0;i<fNLayers;i++) indexc[i]=0;
   for(Int_t nind=0;nind<otrack->GetNumberOfClusters();nind++){
     indexc[nind] = otrack->GetClusterIndex(nind);
   }      
  
   //remove clusters of found track
-  for(Int_t nlay=0;nlay<AliITSsegmentationUpgrade::GetNLayers();nlay++){
+  for(Int_t nlay=0;nlay<fNLayers;nlay++){
     for(Int_t cln=0;cln<trsa->GetNumberOfMarked(nlay);cln++){
       Int_t index = trsa->GetClusterMark(nlay,cln);
       fCluLayer[nlay]->RemoveAt(index);
@@ -972,9 +964,9 @@ Int_t AliITStrackerUpgrade::FindTrackLowChiSquare() const {
 Int_t AliITStrackerUpgrade::FindLabel(AliITStrackV2* track) const {
   //
 
-  Int_t labl[AliITSsegmentationUpgrade::GetNLayers()][3];
-  Int_t cnts[AliITSsegmentationUpgrade::GetNLayers()][3];
-  for(Int_t j=0;j<AliITSsegmentationUpgrade::GetNLayers();j++){
+  Int_t labl[fNLayers][3];
+  Int_t cnts[fNLayers][3];
+  for(Int_t j=0;j<fNLayers;j++){
     for(Int_t k=0;k<3;k++){
       labl[j][k]=-2;
       cnts[j][k]=1;
@@ -993,7 +985,7 @@ Int_t AliITStrackerUpgrade::FindLabel(AliITStrackV2* track) const {
   }
   if(iNotLabel==3*track->GetNumberOfClusters()) return -2;
 
-  for(Int_t j1=0;j1<AliITSsegmentationUpgrade::GetNLayers(); j1++) {
+  for(Int_t j1=0;j1<fNLayers; j1++) {
     for(Int_t j2=0; j2<j1;  j2++){
       for(Int_t k1=0; k1<3; k1++){
         for(Int_t k2=0; k2<3; k2++){
@@ -1009,7 +1001,7 @@ Int_t AliITStrackerUpgrade::FindLabel(AliITStrackV2* track) const {
 
   Int_t cntMax=0;
   Int_t label=-1;
-  for(Int_t j=0;j<AliITSsegmentationUpgrade::GetNLayers();j++){
+  for(Int_t j=0;j<fNLayers;j++){
     for(Int_t k=0;k<3;k++){
       if(cnts[j][k]>cntMax && labl[j][k]>=0){
         cntMax=cnts[j][k];
@@ -1019,7 +1011,7 @@ Int_t AliITStrackerUpgrade::FindLabel(AliITStrackV2* track) const {
   }
 
   Int_t lflag=0;
-  for(Int_t i=0;i<AliITSsegmentationUpgrade::GetNLayers();i++)
+  for(Int_t i=0;i<fNLayers;i++)
     if(labl[i][0]==label || labl[i][1]==label || labl[i][2]==label) lflag++;
   if(lflag<track->GetNumberOfClusters()) label = -label;
   return label;
@@ -1180,7 +1172,7 @@ void AliITStrackerUpgrade::UnloadClusters() {
   //--------------------------------------------------------------------
   //This function unloads ITS clusters
   //--------------------------------------------------------------------
-  for (Int_t i=0; i<AliITSsegmentationUpgrade::GetNLayers(); i++) fLayers[i]->ResetClusters();
+  for (Int_t i=0; i<fNLayers; i++) fLayers[i]->ResetClusters();
 }
 //______________________________________________________________________
 Bool_t AliITStrackerUpgrade::RefitAtBase(Double_t xx,AliITStrackMI *track,
@@ -1189,11 +1181,11 @@ Bool_t AliITStrackerUpgrade::RefitAtBase(Double_t xx,AliITStrackMI *track,
   //--------------------------------------------------------------------
   // Simplified version for ITS upgrade studies -- does not use module info
   //--------------------------------------------------------------------
-  Int_t index[AliITSsegmentationUpgrade::GetNLayers()];
+  Int_t index[fNLayers];
   Int_t k;
-  for (k=0; k<AliITSsegmentationUpgrade::GetNLayers(); k++) index[k]=-1;
+  for (k=0; k<fNLayers; k++) index[k]=-1;
   //
-  for (k=0; k<AliITSsegmentationUpgrade::GetNLayers(); k++) {
+  for (k=0; k<fNLayers; k++) {
     index[k]=clusters[k];
   }
 
@@ -1201,9 +1193,9 @@ Bool_t AliITStrackerUpgrade::RefitAtBase(Double_t xx,AliITStrackMI *track,
   if(track->GetESDtrack()) trStatus=track->GetStatus();
   Int_t innermostlayer=0;
   if(trStatus&AliESDtrack::kTPCin)  {
-    innermostlayer=AliITSsegmentationUpgrade::GetNLayers()-1;
+    innermostlayer=fNLayers-1;
     Double_t drphi = TMath::Abs(track->GetD(0.,0.));
-    for(innermostlayer=0; innermostlayer<AliITSsegmentationUpgrade::GetNLayers(); innermostlayer++) {
+    for(innermostlayer=0; innermostlayer<fNLayers; innermostlayer++) {
       if( (drphi < (fSegmentation->GetRadius(innermostlayer)+1.)) ||
           index[innermostlayer] >= 0 ) break;
     }
@@ -1212,10 +1204,10 @@ Bool_t AliITStrackerUpgrade::RefitAtBase(Double_t xx,AliITStrackMI *track,
 
   Int_t from, to, step;
   if (xx > track->GetX()) {
-    from=innermostlayer; to=AliITSsegmentationUpgrade::GetNLayers();
+    from=innermostlayer; to=fNLayers;
     step=+1;
   } else {
-    from=AliITSsegmentationUpgrade::GetNLayers()-1; to=innermostlayer-1;
+    from=fNLayers-1; to=innermostlayer-1;
     step=-1;
   }
   TString dir = (step>0 ? "outward" : "inward");
@@ -1397,7 +1389,7 @@ Int_t AliITStrackerUpgrade::CorrectForLayerMaterial(AliITStrackMI *t,
   if (!t->GetLocalXat(rToGo,xToGo)) {
     return 0;
   }
-  Int_t index=AliITSsegmentationUpgrade::GetNLayers()*fCurrentEsdTrack+layerindex;
+  Int_t index=fNLayers*fCurrentEsdTrack+layerindex;
 
 
   Double_t xOverX0=0.0,x0=0.0,lengthTimesMeanDensity=0.0;
@@ -1433,7 +1425,7 @@ Int_t AliITStrackerUpgrade::CorrectForLayerMaterial(AliITStrackMI *t,
     if (!t->PropagateTo(xToGo,xOverX0,lengthTimesMeanDensity/xOverX0)) return 0;
     break;
   case 3:
-    if(!fxOverX0LayerTrks || index<0 || index>=AliITSsegmentationUpgrade::GetNLayers()*fNtracks) Error("CorrectForLayerMaterial","Incorrect usage of UseTGeo option!\n");
+    if(!fxOverX0LayerTrks || index<0 || index>=fNLayers*fNtracks) Error("CorrectForLayerMaterial","Incorrect usage of UseTGeo option!\n");
     if(fxOverX0LayerTrks[index]<0) {
       nsteps = (Int_t)(TMath::Abs(xOld-xToGo)/AliITSReconstructor::GetRecoParam()->GetStepSizeTGeo())+1;
       if (!t->PropagateToTGeo(xToGo,nsteps,xOverX0,lengthTimesMeanDensity)) return 0;
@@ -1614,8 +1606,8 @@ Int_t AliITStrackerUpgrade::PropagateBack(AliESDEvent *event) {
     fTrackToFollow.ResetCovariance(10.); 
     fTrackToFollow.ResetClusters();
     //
-    Int_t inx[AliITSsegmentationUpgrade::GetNLayers()];
-    for (Int_t k=0; k<AliITSsegmentationUpgrade::GetNLayers(); k++) inx[k]=-1;
+    Int_t inx[fNLayers];
+    for (Int_t k=0; k<fNLayers; k++) inx[k]=-1;
     Int_t nclusters = t->GetNumberOfClusters();
     for(Int_t ncl=0;ncl<nclusters;ncl++){
       Int_t index = t-> GetClIndex(ncl);
@@ -1623,7 +1615,7 @@ Int_t AliITStrackerUpgrade::PropagateBack(AliESDEvent *event) {
       inx[lay]=index;
     }
     //   
-    if (RefitAtBase(fSegmentation->GetRadius(AliITSsegmentationUpgrade::GetNLayers()-1),&fTrackToFollow,inx)) {
+    if (RefitAtBase(fSegmentation->GetRadius(fNLayers-1),&fTrackToFollow,inx)) {
       //fTrackToFollow.SetLabel(t->GetLabel());//
       //fTrackToFollow.CookdEdx();
       //CookLabel(&fTrackToFollow,0.); //For comparison only
index 600508f..b7baea4 100644 (file)
@@ -36,6 +36,7 @@ class AliITStrackerUpgrade : public AliITStrackerMI {
  public:
 
   AliITStrackerUpgrade();
+  AliITStrackerUpgrade(Int_t nLay);
   AliITStrackerUpgrade(const AliITStrackerUpgrade& tracker);
   AliITStrackerUpgrade& operator=(const AliITStrackerUpgrade& source);
   virtual ~AliITStrackerUpgrade();  
@@ -56,8 +57,8 @@ class AliITStrackerUpgrade : public AliITStrackerMI {
   void SetOutwardFinding() {fInwardFlag=kFALSE;}
   void SetInwardFinding() {fInwardFlag=kTRUE;}
   void SetOuterStartLayer(Int_t osl = 0) {
-    if(osl>(fNLayer-2)) AliWarning("Minimum Number of layers is 2. OuterStartLayer set to Nlayers-2");
-    fOuterStartLayer = TMath::Min(fNLayer-2,osl);
+    if(osl>(fNLayers-2)) AliWarning("Minimum Number of layers is 2. OuterStartLayer set to Nlayers-2");
+    fOuterStartLayer = TMath::Min(fNLayers-2,osl);
   }
   Int_t GetOuterStartLayer() const {return fOuterStartLayer;}
   void SetInnerStartLayer(Int_t isl = 5) {
@@ -75,6 +76,8 @@ class AliITStrackerUpgrade : public AliITStrackerMI {
   void SetMinimumChargeSDDSSD(Float_t minq=0.){fMinQ=minq;}
   enum {kSAflag=0x8000}; //flag to mark clusters used in the SA tracker
 
+  void SetNlayers(Int_t nlay) {fNLayers = nlay;}
+  
  protected:
 
   //Initialization
@@ -119,7 +122,7 @@ class AliITStrackerUpgrade : public AliITStrackerMI {
                        Float_t tgl,Float_t tgphitr,
                        Float_t &ny,Float_t &nz);
   static const Int_t fgMaxNLayer = 8; //max number of layers in ITSUpgrade
-  Int_t fNLayer;//number of layer in ITSUpgrade
+  Int_t fNLayers;//number of layer in ITSUpgrade
   Double_t fPhiEstimate; //Estimation of phi angle on next layer
   Bool_t fITSStandAlone; //Tracking is performed in the ITS alone if kTRUE
   Float_t fPoint1[2];   //! coord. of 1-st point to evaluate the curvature