diff --git a/StRoot/StBFChain/StBFChain.cxx b/StRoot/StBFChain/StBFChain.cxx index b00ec8fe3c9..3fbf49397b9 100644 --- a/StRoot/StBFChain/StBFChain.cxx +++ b/StRoot/StBFChain/StBFChain.cxx @@ -580,6 +580,7 @@ Int_t StBFChain::Instantiate() if (GetOption("usePct4Vtx" ) ) mk->SetAttr("PCT" , kTRUE); if (GetOption("useBTOF4Vtx") ) mk->SetAttr("BTOF" , kTRUE); if (GetOption("useBTOFmatchOnly") ) mk->SetAttr("useBTOFmatchOnly", kTRUE); + if (GetOption("FXT" ) ) mk->SetAttr("FXT" , kTRUE); // X-tended works only for VFPPV, VFPPVnoCTB, VFPPVev for now but could be re-used // However, we will change this to a more flexible arbitrarry setting later diff --git a/StRoot/StGenericVertexMaker/Minuit/StMinuitVertexFinder.cxx b/StRoot/StGenericVertexMaker/Minuit/StMinuitVertexFinder.cxx index f5cfe9c28f9..4bc8f10ca8d 100644 --- a/StRoot/StGenericVertexMaker/Minuit/StMinuitVertexFinder.cxx +++ b/StRoot/StGenericVertexMaker/Minuit/StMinuitVertexFinder.cxx @@ -55,6 +55,7 @@ StMinuitVertexFinder::StMinuitVertexFinder(VertexFit_t fitMode) : mExternalSeedPresent = kFALSE; mRequireCTB = kFALSE; requireCTB = kFALSE; + mFXT = kFALSE; mUseITTF = kFALSE; mUseOldBEMCRank = kFALSE; mLowerSplitVtxRank = kFALSE; @@ -407,19 +408,29 @@ int StMinuitVertexFinder::fit(StEvent* event) Int_t n_bemc_match_tot = 0; Int_t n_cross_tot = 0; + // In FXT mode, we want to have a bias = -2 cm below the z-axis + // for the approximate physical target location. This could + // potentially be a database table (PrimaryVertexCuts) parameter, + // but the bias is approximate and highly unlikely to change/finetune. + StThreeVectorD beamAxis(0.0, mFXT ? -2.0 : 0.0, 0.0); + double RImpactMax2 = mRImpactMax*mRImpactMax; + for (const StTrackNode* stTrack : event->trackNodes()) { StGlobalTrack* g = ( StGlobalTrack*) stTrack->track(global); if (!accept(g)) continue; StDcaGeometry* gDCA = g->dcaGeometry(); if (! gDCA) continue; - if (TMath::Abs(gDCA->impact()) > mRImpactMax) continue; + StPhysicalHelixD gHelix = gDCA->helix(); + StThreeVectorD DCAPosition = gHelix.at(gHelix.pathLength(beamAxis.x(),beamAxis.y())) - beamAxis; + double RImpact2 = DCAPosition.perp2(); + if (RImpact2 > RImpactMax2) continue; // calculate square once instead of sqrt N times mDCAs.push_back(gDCA); // StPhysicalHelixD helix = gDCA->helix(); // mHelices.push_back(helix); mHelices.push_back(g->geometry()->helix()); mHelixFlags.push_back(1); - Double_t z_lin = gDCA->z(); + Double_t z_lin = DCAPosition.z(); mZImpact.push_back(z_lin); Bool_t shouldHitCTB = kFALSE; diff --git a/StRoot/StGenericVertexMaker/Minuit/StMinuitVertexFinder.h b/StRoot/StGenericVertexMaker/Minuit/StMinuitVertexFinder.h index 6841a15f29e..bb92cfe4fc7 100644 --- a/StRoot/StGenericVertexMaker/Minuit/StMinuitVertexFinder.h +++ b/StRoot/StGenericVertexMaker/Minuit/StMinuitVertexFinder.h @@ -130,6 +130,7 @@ class StMinuitVertexFinder: public StGenericVertexFinder void setFlagBase(); void SetFitPointsCut(Int_t fitpoints) {mMinNumberOfFitPointsOnTrack = fitpoints;} void SetMinimumTracks(Int_t n) {mMinTrack = n;} + void SetFXT(bool fxt=kTRUE) { mFXT = fxt; } private: @@ -151,6 +152,7 @@ class StMinuitVertexFinder: public StGenericVertexFinder bool mLowerSplitVtxRank;// Use lower rank for split vertices UInt_t mFlagBase; // ITTF track flag bool mRequireCTB; // Set maker to use CTB + bool mFXT; // Switch on FXT mode UInt_t mMinNumberOfFitPointsOnTrack; Float_t mDcaZMax; Double_t mRImpactMax; // Max distance between helix and nominal beamline (0,0,z) diff --git a/StRoot/StGenericVertexMaker/StGenericVertexMaker.cxx b/StRoot/StGenericVertexMaker/StGenericVertexMaker.cxx index 17c81fdc73d..64b8c35f7fb 100644 --- a/StRoot/StGenericVertexMaker/StGenericVertexMaker.cxx +++ b/StRoot/StGenericVertexMaker/StGenericVertexMaker.cxx @@ -112,6 +112,7 @@ Int_t StGenericVertexMaker::Init() if (IAttr("VFMinuit") ) ((StMinuitVertexFinder*) theFinder)->useOldBEMCRank(); if (IAttr("VFMinuit3") ) ((StMinuitVertexFinder*) theFinder)->lowerSplitVtxRank(); + if (IAttr("FXT") ) ((StMinuitVertexFinder*) theFinder)->SetFXT(); if (minTracks > 0) ((StMinuitVertexFinder*) theFinder)->SetMinimumTracks(minTracks); } else if ( IAttr("VFppLMV")){