From: cblume Date: Mon, 27 Jul 2009 08:48:42 +0000 (+0000) Subject: Speed increase (mainly for offline), at least factor 2 for whole TRD offline reconstr... X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=f301a6562435d71afaf2c1bb86a7f0bb0c10dbe2 Speed increase (mainly for offline), at least factor 2 for whole TRD offline reconstruction, 10% for HLT --- diff --git a/TRD/AliTRDseedV1.cxx b/TRD/AliTRDseedV1.cxx index f9adde9d135..97237408a03 100644 --- a/TRD/AliTRDseedV1.cxx +++ b/TRD/AliTRDseedV1.cxx @@ -62,6 +62,9 @@ ClassImp(AliTRDseedV1) +TLinearFitter *AliTRDseedV1::fgFitterY = 0x0; +TLinearFitter *AliTRDseedV1::fgFitterZ = 0x0; + //____________________________________________________________________ AliTRDseedV1::AliTRDseedV1(Int_t det) :AliTRDtrackletBase() @@ -90,7 +93,7 @@ AliTRDseedV1::AliTRDseedV1(Int_t det) // // Constructor // - for(Int_t ic=kNclusters; ic--;) fIndexes[ic] = -1; + memset(fIndexes,0xFF,kNclusters*sizeof(fIndexes[0])); memset(fClusters, 0, kNclusters*sizeof(AliTRDcluster*)); memset(fPad, 0, 3*sizeof(Float_t)); fYref[0] = 0.; fYref[1] = 0.; @@ -593,10 +596,17 @@ Bool_t AliTRDseedV1::CookPID() CookdEdx(fReconstructor->GetNdEdxSlices()); // Sets the a priori probabilities - for(int ispec=0; ispecGetProbability(ispec, GetMomentum(), &fdEdx[0], length, GetPlane()); + if(fReconstructor->IsHLT()){ + // this can be done here, because in HLT we have another NN + // don't run HLT with the normal NN because here we assume that the NN was trained with only two output neurons! + memset(fProb,0,AliPID::kSPECIES*sizeof(fProb[0])); + fProb[AliPID::kElectron] = pd->GetProbability(AliPID::kElectron, GetMomentum(), &fdEdx[0], length, GetPlane()); + fProb[AliPID::kPion] = 1 - fProb[AliPID::kElectron]; } - + else + for(int ispec=0; ispecGetProbability(ispec, GetMomentum(), &fdEdx[0], length, GetPlane()); + return kTRUE; } @@ -763,6 +773,21 @@ UShort_t AliTRDseedV1::GetVolumeId() const return fClusters[ic] ? fClusters[ic]->GetVolumeId() : 0; } +//____________________________________________________________________ +TLinearFitter* AliTRDseedV1::GetFitterY() +{ + if(!fgFitterY) fgFitterY = new TLinearFitter(1, "pol1"); + fgFitterY->ClearPoints(); + return fgFitterY; +} + +//____________________________________________________________________ +TLinearFitter* AliTRDseedV1::GetFitterZ() +{ + if(!fgFitterZ) fgFitterZ = new TLinearFitter(1, "pol1"); + fgFitterZ->ClearPoints(); + return fgFitterZ; +} //____________________________________________________________________ void AliTRDseedV1::Calibrate() @@ -1219,9 +1244,9 @@ Bool_t AliTRDseedV1::Fit(Bool_t tilt, Bool_t zcorr) Double_t yt, zt; //AliTRDtrackerV1::AliTRDLeastSquare fitterZ; - TLinearFitter fitterY(1, "pol1"); - TLinearFitter fitterZ(1, "pol1"); - + TLinearFitter& fitterY=*GetFitterY(); + TLinearFitter& fitterZ=*GetFitterZ(); + // book cluster information Double_t qc[kNclusters], xc[kNclusters], yc[kNclusters], zc[kNclusters], sy[kNclusters]; diff --git a/TRD/AliTRDseedV1.h b/TRD/AliTRDseedV1.h index cf33dafaf6c..159b11b881d 100644 --- a/TRD/AliTRDseedV1.h +++ b/TRD/AliTRDseedV1.h @@ -38,6 +38,7 @@ #include "AliTRDReconstructor.h" class TTreeSRedirector; +class TLinearFitter; class AliRieman; @@ -107,6 +108,8 @@ public: void GetCalibParam(Float_t &exb, Float_t &vd, Float_t &t0, Float_t &s2, Float_t &dl, Float_t &dt) const { exb = fExB; vd = fVD; t0 = fT0; s2 = fS2PRF; dl = fDiffL; dt = fDiffT;} AliTRDcluster* GetClusters(Int_t i) const { return i<0 || i>=kNclusters ? 0x0 : fClusters[i];} + static TLinearFitter* GetFitterY(); + static TLinearFitter* GetFitterZ(); Int_t GetIndexes(Int_t i) const{ return i<0 || i>=kNclusters ? -1 : fIndexes[i];} Int_t GetLabels(Int_t i) const { return fLabels[i];} Float_t GetMomentum(Float_t *err = 0x0) const; @@ -215,6 +218,8 @@ private: Int_t fLabels[3]; // most frequent MC labels and total number of different labels Double_t fRefCov[7]; // covariance matrix of the track in the yz plane + the rest of the diagonal elements Double_t fCov[3]; // covariance matrix of the tracklet in the xy plane + static TLinearFitter *fgFitterY; + static TLinearFitter *fgFitterZ; ClassDef(AliTRDseedV1, 7) // The offline TRD tracklet };