Skip to content

Commit

Permalink
Fxt offset vtx (#720)
Browse files Browse the repository at this point in the history
This PR adjusts the selection of candidate tracks for use in Minuit
vertex-finding to be offset vertically by -2 cm (downward in y) from
the z-axis when processing with the `FXT` chain option. The z-axis
is otherwise the default for the Minuit vertex-finding `RImpact` cut.
  • Loading branch information
genevb authored Dec 10, 2024
1 parent 252a596 commit 640288b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions StRoot/StBFChain/StBFChain.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 13 additions & 2 deletions StRoot/StGenericVertexMaker/Minuit/StMinuitVertexFinder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ StMinuitVertexFinder::StMinuitVertexFinder(VertexFit_t fitMode) :
mExternalSeedPresent = kFALSE;
mRequireCTB = kFALSE;
requireCTB = kFALSE;
mFXT = kFALSE;
mUseITTF = kFALSE;
mUseOldBEMCRank = kFALSE;
mLowerSplitVtxRank = kFALSE;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions StRoot/StGenericVertexMaker/Minuit/StMinuitVertexFinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions StRoot/StGenericVertexMaker/StGenericVertexMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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")){
Expand Down

0 comments on commit 640288b

Please sign in to comment.