Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fxt offset vtx #720

Merged
merged 6 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading