Skip to content

Commit

Permalink
Fix of the missing FXT vertex selection mode due to the version missm…
Browse files Browse the repository at this point in the history
…atch.
  • Loading branch information
nigmatkulov authored and plexoos committed May 10, 2023
1 parent 4d048ed commit b401ce6
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 4 deletions.
34 changes: 33 additions & 1 deletion StRoot/StPicoDstMaker/StPicoDstMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,18 @@ Int_t StPicoDstMaker::setVtxModeAttr(){
LOG_INFO << " PicoVtxVpdOrDefault is being used " << endm;
return kStOK;
}
else if (strcasecmp(SAttr("PicoVtxMode"), "PicoVtxFXT") == 0) {
setVtxMode( PicoVtxMode::FXT );
LOG_INFO << " PicoVtxFXT is being used " << endm;
return kStOK;
}
#if !defined (__TFG__VERSION__)
else if (strcasecmp(SAttr("PicoVtxMode"), "PicoVtxMtd") == 0) {
setVtxMode( PicoVtxMode::Mtd );
LOG_INFO << " PicoVtxMtd is being used " << endm;
return kStOK;
}
#endif /* !__TFG__VERSION__ */

return kStErr;
}
Expand Down Expand Up @@ -2369,7 +2381,27 @@ bool StPicoDstMaker::selectVertex() {
mMuDst->setVertexIndex(0);
selectedVertex = mMuDst->primaryVertex();
}
else if (mVtxMode == PicoVtxMode::Vpd || mVtxMode == PicoVtxMode::VpdOrDefault) {
else if ( mVtxMode == PicoVtxMode::FXT ) {

// Loop over primary vertices
for (unsigned int iVtx = 0; iVtx < mMuDst->numberOfPrimaryVertices(); ++iVtx) {

// Return pointer to i-th primary vertex
StMuPrimaryVertex* vtx = mMuDst->primaryVertex(iVtx);
if (!vtx) continue;

// Check TpcVz and VpdVz difference
if (vtx->position().z() > 198. && vtx->position().z() < 202.) {
// Reset vertex index
mMuDst->setVertexIndex( iVtx );
// Reset pointer to the primary vertex
selectedVertex = mMuDst->primaryVertex();
// Quit vertex loop
break;
}
}
}
else if ( mVtxMode == PicoVtxMode::Vpd || mVtxMode == PicoVtxMode::VpdOrDefault ) {

// For VpdOrDefault option one will take the first primary
// vertex if no TOF or VPD information is available
Expand Down
17 changes: 14 additions & 3 deletions StRoot/StPicoDstMaker/StPicoDstMaker.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
* c) Vpd - checks if BTof info is available then loops over primary
* vertices and checks if |Vz - VpdVz|<mTpcVpdVzDiffCut. The first
* vertex that satisfies the cut is selected.
* d) Mtd - sets the first primary vertex as a default and then loops
* over all primary vertices. The first one that has at least
* 2 MTD-matched primary tracks is selected.
* e) FXT - set the first vertex that was reconstructed in z
* from 198 to 202 cm along z axis.
* Default is NotSet. In this case the program execution will be terminated.
* Has to be explicitly set.
*
Expand Down Expand Up @@ -74,8 +79,14 @@ class StPicoDstMaker : public StMaker {
/// Write/Read mode: 1-write, 2-read
enum PicoIoMode {IoWrite=1, IoRead=2};
#if !defined (__TFG__VERSION__)
/// Primary vertex selection mode: 0-NotSet, 1-Default, 2-Vpd, 3-VpdOrDefault
enum PicoVtxMode {NotSet=0, Default=1, Vpd=2, VpdOrDefault=3};
/// Primary vertex selection mode
/// \par 0 NotSet
/// \par 1 Default
/// \par 2 Vpd
/// \par 3 VpdOrDefault
/// \par 4 Mtd
/// \par 5 FXT
enum PicoVtxMode {NotSet=0, Default=1, Vpd=2, VpdOrDefault=3, Mtd=4, FXT=5};
#endif /* ! __TFG__VERSION__ */
/// Write or not write covariance matrix: 0-skip, 1-write
enum PicoCovMtxMode {Skip=0, Write=1};
Expand Down Expand Up @@ -320,7 +331,7 @@ class StPicoDstMaker : public StMaker {

/// Get CVS status
virtual const char *GetCVS() const {
static const char cvs[]="Tag $Name: $ $Id: StPicoDstMaker.h,v 1.26 2020/02/14 17:05:53 gnigmat Exp $ built " __DATE__ " " __TIME__ ;
static const char cvs[]="Tag $Name: $ $Id: StPicoDstMaker.h,v 1.30 2021/02/23 17:27:01 gnigmat Exp $ built " __DATE__ " " __TIME__ ;
return cvs;
}

Expand Down

0 comments on commit b401ce6

Please sign in to comment.