]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
reco update
authorshahoian <shahoian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 27 Nov 2012 16:55:30 +0000 (16:55 +0000)
committershahoian <shahoian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 27 Nov 2012 16:55:30 +0000 (16:55 +0000)
ITS/UPGRADE/AliITSUClusterizer.cxx
ITS/UPGRADE/AliITSUSeed.cxx
ITS/UPGRADE/AliITSUSeed.h
ITS/UPGRADE/AliITSUTrackCond.cxx
ITS/UPGRADE/AliITSUTrackCond.h
ITS/UPGRADE/AliITSUTrackerGlo.cxx
ITS/UPGRADE/AliITSUTrackerGlo.h
ITS/UPGRADE/readHit.C
ITS/UPGRADE/testITSU/Config.C
ITS/UPGRADE/testITSU/rec.C

index eb4a551bc88385d7a02d6e42e3a56fff6c98b976..7d274f67fadb47464be1fe0af5527b573c33b45f 100644 (file)
@@ -194,8 +194,8 @@ void AliITSUClusterizer::Transform(AliITSUClusterPix *cluster,AliITSUClusterizer
   cluster->SetX(x);
   cluster->SetZ(z);
   cluster->SetY(0);
-  cluster->SetSigmaZ2(dz*dz*k1to12);
-  cluster->SetSigmaY2(dx*dx*k1to12);
+  cluster->SetSigmaZ2(nz>1 ? dz*dz*k1to12 : pz*pz*k1to12);
+  cluster->SetSigmaY2(nx>1 ? dx*dx*k1to12 : px*px*k1to12);
   cluster->SetSigmaYZ(0);
   cluster->SetFrameLoc();
   cluster->SetNxNz(nx,nz);
index 40a5c03240cb66d08ebafbab3be2d6d6f09ee04c..2f522395c2fdcd12f0920908e8f47d987f5fcad7 100644 (file)
@@ -53,8 +53,8 @@ void AliITSUSeed::Print(Option_t* opt) const
 {
   // print seed info
   int lr,cl = GetLrCluster(lr);
-  printf("Lr%d Cl:%4d Chi2Glo:%6.3f Chi2Cl:",lr,cl,GetChi2Glo());
-  cl<0 ? printf("  NA  ") : printf("%6.3f",GetChi2Cl());
+  printf("Lr%d Cl:%4d Chi2Glo:%7.2f Chi2Cl:",lr,cl,GetChi2Glo());
+  cl<0 ? printf("  NA  ") : printf("%7.2f",GetChi2Cl());
   printf(" |"); 
   for (int i=0;i<=12;i++) printf("%c",HasClusterOnLayer(i) ? '+':'-'); printf("|\n");
   TString opts = opt; opts.ToLower();
index c52338c09de648dc8400b3b72f95457aeda76d32..35f61c79e4d7a4dcb9982111d345f561e7e828de 100644 (file)
@@ -27,6 +27,7 @@ class AliITSUSeed: public AliExternalTrackParam
   Int_t           GetClusterID()                   const {return UnpackCluster(fClID);}
   Bool_t          HasClusterOnLayer(Int_t lr)      const {return fHitsPattern&(0x1<<lr);}
   Int_t           GetNLayersHit()                  const {return NumberOfBitsSet(fHitsPattern);}
+  UShort_t        GetHitsPattern()                 const {return fHitsPattern;}
   Float_t         GetChi2Cl()                      const {return fChi2Cl;}
   Float_t         GetChi2Glo()                     const {return fChi2Glo;}
   //
index 031e27229cbae15af2d9fff5dd0258821857d425..5e30043c36007b25720efe76ea6854ae9986075f 100644 (file)
@@ -62,11 +62,12 @@ void AliITSUTrackCond::AddNewCondition(Int_t minClusters)
 }
 
 //______________________________________________________________
-Bool_t AliITSUTrackCond::CheckPattern(Int_t ncl,UShort_t patt) const
+Bool_t AliITSUTrackCond::CheckPattern(UShort_t patt) const
 {
   // check if the pattern matches to some condition
   Short_t *arrAux = (Short_t*)fAuxData.GetArray();
   Short_t *arrGrp = (Short_t*)fConditions.GetArray();  
+  int ncl = NumberOfBitsSet(patt);
   int cntCond = 0;
   for (int ic=0;ic<fNConditions;ic++) {
     if (arrAux[cntCond+kMinClus]>ncl) {cntCond+=kNAuxSz; continue;} // check number of clusters
index 756d01b242454d01111918d9f8d02430f4924530..027d9bcf99936798e48420825b6bc7e0a495af05 100644 (file)
@@ -39,7 +39,7 @@ class AliITSUTrackCond : public TObject
   Int_t       GetID()                                  const {return GetUniqueID();}
   Int_t       GetNConditions()                         const {return fNConditions;}
   UShort_t    GetGroup(Int_t condID,Int_t grID)        const {return fConditions[fAuxData[condID*kNAuxSz+kCondStart]+grID];}
-  Bool_t      CheckPattern(Int_t ncl,UShort_t patt)    const;
+  Bool_t      CheckPattern(UShort_t patt)    const;
   //
   virtual void  Print(Option_t* option = "")           const;
 
index eed99b691523f9b31b821389644e40a366db5bff..f4ad0ecd8ed8c2a68dec91e485bd2af15b744b74 100644 (file)
@@ -40,6 +40,10 @@ using namespace AliITSUAux;
 using namespace TMath;
 
 
+//----------------- tmp stuff -----------------
+Int_t currLabel=-1;
+
+
 ClassImp(AliITSUTrackerGlo)
 //_________________________________________________________________________
 AliITSUTrackerGlo::AliITSUTrackerGlo(AliITSUReconstructor* rec)
@@ -49,6 +53,7 @@ AliITSUTrackerGlo::AliITSUTrackerGlo(AliITSUReconstructor* rec)
   ,fCurrMass(kPionMass)
   ,fSeedsLr(0)
   ,fSeedsPool("AliITSUSeed",0)
+  ,fTrCond()
 {
   // Default constructor
   if (rec) Init(rec);
@@ -78,7 +83,24 @@ void AliITSUTrackerGlo::Init(AliITSUReconstructor* rec)
   int n = fITS->GetNLayersActive()+1;
   fSeedsLr = new TObjArray[n];
   //
-
+  fTrCond.SetNLayers(fITS->GetNLayersActive());
+  fTrCond.AddNewCondition(5);
+  fTrCond.AddGroupPattern( (0x1<<0)|(0x1<<1) );
+  fTrCond.AddGroupPattern( (0x1<<3)|(0x1<<4) );
+  fTrCond.AddGroupPattern( (0x1<<5)|(0x1<<6) );
+  //
+  fTrCond.AddNewCondition(5);
+  fTrCond.AddGroupPattern( (0x1<<0)|(0x1<<2) );
+  fTrCond.AddGroupPattern( (0x1<<3)|(0x1<<4) );
+  fTrCond.AddGroupPattern( (0x1<<5)|(0x1<<6) );
+  //
+  fTrCond.AddNewCondition(5);
+  fTrCond.AddGroupPattern( (0x1<<1)|(0x1<<2) );
+  fTrCond.AddGroupPattern( (0x1<<3)|(0x1<<4) );
+  fTrCond.AddGroupPattern( (0x1<<5)|(0x1<<6) );
+  //
+  printf("Tracking Conditions: ");
+  fTrCond.Print();
 }
 
 //_________________________________________________________________________
@@ -94,6 +116,7 @@ Int_t AliITSUTrackerGlo::Clusters2Tracks(AliESDEvent *esdEv)
   for (int itr=0;itr<nTrESD;itr++) {
     AliESDtrack *esdTr = esdEv->GetTrack(itr);
     AliInfo(Form("Processing track %d | MCLabel: %d",itr,esdTr->GetTPCLabel()));
+    currLabel = Abs(esdTr->GetTPCLabel());
     FindTrack(esdTr);
   }
 
@@ -195,7 +218,7 @@ void AliITSUTrackerGlo::FindTrack(AliESDtrack* esdTr)
       seedUC = *seedU;
       seedUC.SetParent(seedU);
       // go till next active layer
-      AliInfo(Form("Lr:%d Seed:%d of %d",ila,isd,nSeedsUp));
+      AliInfo(Form("working on Lr:%d Seed:%d of %d",ila,isd,nSeedsUp));
       if (!TransportToLayer(&seedUC, fITS->GetLrIDActive(ilaUp), fITS->GetLrIDActive(ila)) ) {
        //
        AliInfo("Transport failed");
@@ -229,6 +252,10 @@ void AliITSUTrackerGlo::FindTrack(AliESDtrack* esdTr)
       seedT.SetLr(ila);
       if (!NeedToKill(&seedT,kMissingCluster)) AddProlongationHypothesis(NewSeedFromPool(&seedT) ,ila);      
     }
+    printf(">>> All hypotheses on lr %d: \n",ila);
+    for (int ih=0;ih<GetNSeeds(ila);ih++) {
+      printf(" #%3d ",ih); GetSeed(ila,ih)->Print();
+    }
   }
   //
   ResetSeedTree();
@@ -242,6 +269,7 @@ Bool_t AliITSUTrackerGlo::InitSeed(AliESDtrack *esdTr)
   fCurrESDtrack = esdTr;
   if (fCurrMass<kPionMass*0.9) fCurrMass = kPionMass; // don't trust to mu, e identification from TPCin
   //
+  //
   AliITSUSeed* seed = NewSeedFromPool();
   seed->SetLr(fITS->GetNLayersActive());   // fake layer
   seed->AliExternalTrackParam::operator=(*esdTr);
@@ -255,7 +283,7 @@ Bool_t AliITSUTrackerGlo::InitSeed(AliESDtrack *esdTr)
 void AliITSUTrackerGlo::ResetSeedTree()
 {
   // reset current hypotheses tree
-  for (int i=fITS->GetNLayersActive()+1;i--;) fSeedsLr[fITS->GetNLayersActive()].Clear();
+  for (int i=fITS->GetNLayersActive()+1;i--;) fSeedsLr[i].Clear();
 }
 
 //_________________________________________________________________________
@@ -361,40 +389,70 @@ Int_t AliITSUTrackerGlo::CheckCluster(AliITSUSeed* track, Int_t lr, Int_t clID)
   const double kTolerX = 5e-4;
   AliCluster *cl = fITS->GetLayerActive(lr)->GetCluster(clID);
   //
+  Bool_t goodCl = kFALSE;
+  for (int i=0;i<3;i++) if (cl->GetLabel(i)>=0 && cl->GetLabel(i)==currLabel) goodCl = kTRUE;
+  //
   if (TMath::Abs(cl->GetX())>kTolerX) { // if due to the misalingment X is large, propagate track only
-    if (!track->PropagateParamOnlyTo(track->GetX()+cl->GetX(),GetBz())) return kStopSearchOnSensor; // propagation failed, seedT is intact
+    if (!track->PropagateParamOnlyTo(track->GetX()+cl->GetX(),GetBz())) {
+      if (goodCl) printf("Loose good cl: Failed propagation\n");
+      return kStopSearchOnSensor; // propagation failed, seedT is intact
+    }
   }
   double dy = cl->GetY() - track->GetY();
-  double dz2 = cl->GetZ()-track->GetZ();
-  //
-  AliInfo(Form("Cl%d lr:%d: dY:%+8.4f dZ:%+8.4f (MC: %5d %5d %5d)",clID,lr,dy,dz2,cl->GetLabel(0),cl->GetLabel(1),cl->GetLabel(2)));
+  double dz = cl->GetZ()-track->GetZ();
   //
   double dy2 = dy*dy;
   double tol2 = (track->GetSigmaY2() + AliITSUReconstructor::GetRecoParam()->GetSigmaY2(lr))*
     AliITSUReconstructor::GetRecoParam()->GetNSigmaRoadY()*AliITSUReconstructor::GetRecoParam()->GetNSigmaRoadY(); // RS TOOPTIMIZE
   if (dy2>tol2) {                          // the clusters are sorted in Z(col) then in Y(row). 
+    if (goodCl) printf("Loose good cl: dy2=%e > tol2=%e\n",dy2,tol2);
     if (dy>0) return kStopSearchOnSensor;  // No chance that other cluster of this sensor will match (all Y's will be even larger)
     else      return kClusterNotMatching;   // Other clusters may match
   }
-  dz2 *= dz2;
+  double dz2 = dz*dz;
   tol2 = (track->GetSigmaZ2() + AliITSUReconstructor::GetRecoParam()->GetSigmaZ2(lr))*
     AliITSUReconstructor::GetRecoParam()->GetNSigmaRoadZ()*AliITSUReconstructor::GetRecoParam()->GetNSigmaRoadZ(); // RS TOOPTIMIZE
-  if (dz2>tol2) return kClusterNotMatching; // Other clusters may match
+  if (dz2>tol2) {
+    if (goodCl) printf("Loose good cl: dz2=%e > tol2=%e\n",dz2,tol2);
+    return kClusterNotMatching; // Other clusters may match
+  }
   //
   // check chi2
   Double_t p[2]={cl->GetY(), cl->GetZ()};
   Double_t cov[3]={cl->GetSigmaY2(), cl->GetSigmaYZ(), cl->GetSigmaZ2()};
   double chi2 = track->GetPredictedChi2(p,cov);
-  AliInfo(Form("Chi2=%f",chi2));
-  if (chi2>AliITSUReconstructor::GetRecoParam()->GetMaxTr2ClChi2(lr)) return kClusterNotMatching;
+  if (chi2>AliITSUReconstructor::GetRecoParam()->GetMaxTr2ClChi2(lr)) {
+    if (goodCl) printf("Loose good cl: Chi2=%e > Chi2Max=%e\n",chi2,AliITSUReconstructor::GetRecoParam()->GetMaxTr2ClChi2(lr));
+    return kClusterNotMatching;
+  }
   //
   track = NewSeedFromPool(track);  // input track will be reused, use its clone for updates
-  if (!track->Update(p,cov)) return kClusterNotMatching;
+  if (!track->Update(p,cov)) {
+    if (goodCl) printf("Loose good cl: Failed update\n");
+    return kClusterNotMatching;
+  }
   track->SetChi2Cl(chi2);
   track->SetLrClusterID(lr,clID);
   cl->IncreaseClusterUsage();
   //
+  AliInfo(Form("AddCl Cl%d lr:%d: dY:%+8.4f dZ:%+8.4f (MC: %5d %5d %5d) |Chi2=%f",clID,lr,dy,dz2,cl->GetLabel(0),cl->GetLabel(1),cl->GetLabel(2), chi2));
+  //
   AddProlongationHypothesis(track,lr);
   //
   return kClusterMatching;
 }
+
+//_________________________________________________________________________
+Bool_t AliITSUTrackerGlo::NeedToKill(AliITSUSeed *seed, Int_t flag)
+{
+  // check if the seed should not be discarded
+  const UShort_t kMask = 0xffff;
+  if (flag==kMissingCluster) {
+    int lastChecked = seed->GetLayerID();
+    UShort_t patt = seed->GetHitsPattern();
+    if (lastChecked) patt |= ~(kMask<<lastChecked); // not all layers were checked, complete unchecked once by potential hits
+    Bool_t seedOK = fTrCond.CheckPattern(patt);
+    return !seedOK;
+  }
+  return kTRUE;
+}
index a60af812762af5a15a12dda5ae3f892c65b5af43..f59d4b50ac16aafc97fe4853c183b9dbf71af148 100644 (file)
@@ -10,6 +10,7 @@
 #include "AliTracker.h"
 #include "AliESDEvent.h"
 #include "AliITSUSeed.h"
+#include "AliITSUTrackCond.h"
 
 class AliITSUReconstructor;
 class AliITSURecoDet;
@@ -55,7 +56,7 @@ class AliITSUTrackerGlo : public AliTracker {
   Int_t                  GetNSeeds(Int_t lr)              const {return fSeedsLr[lr].GetEntriesFast();} //RS TOCHECK
   AliITSUSeed*           GetSeed(Int_t lr, Int_t sID)     const {return (AliITSUSeed*)fSeedsLr[lr].UncheckedAt(sID);} //RS TOCHECK
   Bool_t                 TransportToLayer(AliITSUSeed* seed, Int_t lFrom, Int_t lTo);
-  Bool_t                 NeedToKill(AliITSUSeed* seed, Int_t flag) {return kFALSE;} // todo
+  Bool_t                 NeedToKill(AliITSUSeed* seed, Int_t flag);
   void                   KillSeed(Int_t ilr, Int_t id) {} // todo
   Bool_t                 GetRoadWidth(AliITSUSeed* seed, int ilrA);
   Int_t                  CheckCluster(AliITSUSeed* seed, Int_t lr, Int_t clID);
@@ -80,7 +81,9 @@ class AliITSUTrackerGlo : public AliTracker {
   // the seeds management to be optimized
   TObjArray*                      fSeedsLr;        // seeds at each layer
   TClonesArray                    fSeedsPool;      // pool for seeds
-
+  //
+  AliITSUTrackCond                fTrCond;         // tmp, to be moved to recoparam
+  //
   ClassDef(AliITSUTrackerGlo,1)   //ITS upgrade tracker
     
 };
@@ -90,7 +93,7 @@ inline void AliITSUTrackerGlo::AddProlongationHypothesis(AliITSUSeed* seed, Int_
 {
   // add new seed prolongation hypothesis 
   fSeedsLr[lr].AddLast(seed);
-  seed->Print("par");
+  printf("*** Adding: "); seed->Print();
 }
 
 
index 8786e52213378914db1ab0ab3e6b481c362a490d..f179aa8141974da3cfc8ded29b414e901900e62e 100644 (file)
@@ -69,7 +69,7 @@ void readHit(){
        pHit->GetPositionG0(xg0,yg0,zg0,tg0);
        xyGlob->Fill(xg,yg);
        zGlob->Fill(zg);
-       printf("Module %d | Lr:%d Ladder: %d, X:[%+.3e:%+.3e] Y:[%+.3e:%+.3e] Z:[%+.3e %+.3e] TrackID: %d\n",id,lr,ld,
+       printf("Module %5d | Lr:%2d Ladder: %3d, X:[%+.5e:%+.5e] Y:[%+.5e:%+.5e] Z:[%+.5e %+.5e] TrackID: %d\n",id,lr,ld,
               xg0,xg,yg0,yg,zg0,zg,pHit->GetTrack());
        hDeLoss[lr]->Fill(pHit->GetIonization());
        //      } // is primary
index 4bfaf77ce23e3b09aba10d4805c080fe0a17c342..449bd979c8bec7f3088be833dcfbb4908add922a 100644 (file)
@@ -70,7 +70,7 @@ void Config()
   // Theta range given through pseudorapidity limits 22/6/2001
 
   // Set Random Number seed
-  gRandom->SetSeed(0); // Set 0 to use the currecnt time
+  gRandom->SetSeed(1); // Set 0 to use the currecnt time
 
 
   // libraries required by geant321
@@ -299,7 +299,7 @@ void Config()
                                                                750,  //835,  // nrows
                                                                20.e-4,  // default row pitch in cm
                                                                20.e-4,  // default col pitch in cm
-                                                               300.e-4  // sensor thickness in cm
+                                                               20.e-4  // sensor thickness in cm
                                                                );    // see AliITSUSegmentationPix.h for extra options
       seg0->Store(AliITSUGeomTGeo::GetITSsegmentationFileName());
       AliITSUSegmentationPix* seg1 = new AliITSUSegmentationPix(1,    // segID (0:9)
@@ -308,7 +308,7 @@ void Config()
                                                                750*2,//835,  // nrows
                                                                20.e-4,  // default row pitch in cm
                                                                20.e-4,  // default col pitch in cm
-                                                               300.e-4  // sensor thickness in cm
+                                                               20.e-4  // sensor thickness in cm
                                                                );    // see AliITSUSegmentationPix.h for extra options
       seg1->Store(AliITSUGeomTGeo::GetITSsegmentationFileName());
       AliITSUSegmentationPix* seg2 = new AliITSUSegmentationPix(2,    // segID (0:9)
@@ -317,7 +317,7 @@ void Config()
                                                                750*2,//835,  // nrows
                                                                20.e-4,  // default row pitch in cm
                                                                20.e-4,  // default col pitch in cm
-                                                               300.e-4   // sensor thickness in cm
+                                                               20.e-4   // sensor thickness in cm
                                                                );    // see AliITSUSegmentationPix.h for extra options
       seg2->Store(AliITSUGeomTGeo::GetITSsegmentationFileName());
       //
index 09fea3235987596841c295d6c22251b94da94796..f4f719ee6e957e21b57d72734b919fdcb52ebcbb 100644 (file)
@@ -17,13 +17,13 @@ void rec() {
   
   AliReconstruction rec;
 
-    rec.SetRunReconstruction("ITS TPC"); // run cluster finder
-    rec.SetRunTracking(""); // Turn on with ITS when tracker is implemented
+  //rec.SetRunReconstruction("ITS TPC"); // run cluster finder
+  //rec.SetRunTracking(""); // Turn on with ITS when tracker is implemented
 
-    /*
+  
   rec.SetRunReconstruction("");//ITS TPC"); // run cluster finder
   rec.SetRunTracking("ITS TPC"); // Turn on with ITS when tracker is implemented
-    */
+  
 
   rec.SetRunVertexFinder(kFALSE); // to be implemented - CreateVertexer
   rec.SetRunMultFinder(kFALSE);   // to be implemented - CreateMultFinder