From: shahoian Date: Thu, 24 Jan 2013 00:19:20 +0000 (+0000) Subject: MC labeling added X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=dd2117a258b9cae733f3123e1031189e3300cd98;hp=daf7dbf5d6e81c63f6846a28fadbcdfb732a0271 MC labeling added --- diff --git a/ITS/UPGRADE/AliITSUTrackHyp.cxx b/ITS/UPGRADE/AliITSUTrackHyp.cxx index b8d3de53de6..a95f4dc13ee 100644 --- a/ITS/UPGRADE/AliITSUTrackHyp.cxx +++ b/ITS/UPGRADE/AliITSUTrackHyp.cxx @@ -1,6 +1,7 @@ #include "AliITSUTrackHyp.h" #include "AliESDtrack.h" #include "AliCluster.h" +#include "AliITSUAux.h" ClassImp(AliITSUTrackHyp) @@ -9,6 +10,7 @@ ClassImp(AliITSUTrackHyp) //__________________________________________________________________ AliITSUTrackHyp::AliITSUTrackHyp(Int_t nlr) : fNLayers(nlr) + ,fITSLabel(0) ,fESDTrack(0) ,fLayerSeeds(0) { @@ -134,4 +136,3 @@ void AliITSUTrackHyp::FetchClusterInfo(Int_t *clIDarr) const seed = (AliITSUSeed*)seed->GetParent(); } } - diff --git a/ITS/UPGRADE/AliITSUTrackHyp.h b/ITS/UPGRADE/AliITSUTrackHyp.h index fd0036c8e10..66dc81562d3 100644 --- a/ITS/UPGRADE/AliITSUTrackHyp.h +++ b/ITS/UPGRADE/AliITSUTrackHyp.h @@ -23,10 +23,12 @@ class AliITSUTrackHyp: public AliKalmanTrack AliITSUSeed* GetSeed(Int_t lr, Int_t id) const {return (AliITSUSeed*)fLayerSeeds[lr].UncheckedAt(id);} AliITSUSeed* GetWinner() const; AliESDtrack* GetESDTrack() const {return fESDTrack;} + Int_t GetITSLabel() const {return fITSLabel;} void DefineWinner(Int_t lr=0, Int_t id=0); const TObjArray* GetLayerSeeds(Int_t lr) const {return lrAliExternalTrackParam::Print(); return kTRUE; } + +//__________________________________________________________________ +void AliITSUTrackerGlo::CookMCLabel(AliITSUTrackHyp* hyp) +{ + // build MC label + // + const int kMaxLbPerCl = 3; + int lbID[kMaxLayers*6],lbStat[kMaxLayers*6]; + Int_t lr,nLab=0,nCl=0; + AliITSUSeed *seed = hyp->GetWinner(); + while(seed) { + int clID = seed->GetLrCluster(lr); + if (clID>=0) { + AliCluster *cl = fITS->GetLayerActive(lr)->GetCluster(clID); + nCl++; + for (int imc=0;imcGetLabel(imc); + if (imc<0) break; + // search this mc track in already accounted ones + int iLab; + for (iLab=0;iLabGetParent(); + } // loop over clusters + // + if (nCl) { + int maxLab=0,nTPCok=0; + AliESDtrack* esdTr = hyp->GetESDTrack(); + int tpcLab = esdTr ? Abs(esdTr->GetTPCLabel()) : -kDummyLabel; + for (int ilb=nLab;ilb--;) { + int st = lbStat[ilb]; + if (lbStat[maxLab]SetFakeRatio(1.-float(nTPCok)/nCl); + hyp->SetLabel( nTPCok==nCl ? tpcLab : -tpcLab); + hyp->SetITSLabel( lbStat[maxLab]==nCl ? lbStat[maxLab] : -lbStat[maxLab]); // winner label + return; + } + // + hyp->SetFakeRatio(-1.); + hyp->SetLabel( kDummyLabel ); + hyp->SetITSLabel( kDummyLabel ); +} diff --git a/ITS/UPGRADE/AliITSUTrackerGlo.h b/ITS/UPGRADE/AliITSUTrackerGlo.h index b98d280dfbf..7112f3bdb6f 100644 --- a/ITS/UPGRADE/AliITSUTrackerGlo.h +++ b/ITS/UPGRADE/AliITSUTrackerGlo.h @@ -37,7 +37,8 @@ class AliITSUTrackerGlo : public AliTracker { ,kRWCheckFailed =2 // failed to rotate the seed to frame of the layer impact point }; enum {kStopSearchOnSensor,kClusterNotMatching,kClusterMatching}; // flags for track-to-cluster checks - + // + enum {kDummyLabel=-3141593}; AliITSUTrackerGlo(AliITSUReconstructor* rec); virtual ~AliITSUTrackerGlo(); @@ -81,6 +82,7 @@ class AliITSUTrackerGlo : public AliTracker { void SaveCurrentTrackHypotheses(); void FinalizeHypotheses(); void UpdateESDTrack(AliITSUTrackHyp* hyp); + void CookMCLabel(AliITSUTrackHyp* hyp); // protected: TObject*& NextFreeSeed();