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

Add idTruth and qaTruth to StEvent and MuDst FttPoint, FttCluster, and FttRawHit #699

Merged
merged 3 commits into from
Aug 22, 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
7 changes: 6 additions & 1 deletion StRoot/StEvent/StFttCluster.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ mSumAdc(0.0),
mX(0.0),
mSigma(0.0),
mRawHits(0),
mNeighbors(0)
mNeighbors(0),
mPoints(0),
mIdTruth(0),
mQaTruth(0)
{

}
Expand Down Expand Up @@ -58,6 +61,8 @@ operator<<( std::ostream &os, const StFttCluster& rh )
os << "\tsumAdc = " << rh.sumAdc() << endl;
os << "\tx = " << rh.x() << endl;
os << "\tsigma = " << rh.sigma() << endl;
os << "\tidTruth = " << rh.idTruth() << endl;
os << "\tqaTruth = " << rh.qaTruth() << endl;
os << ")" << endl;
return os;
}
5 changes: 4 additions & 1 deletion StRoot/StEvent/StFttCluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class StFttCluster : public StObject {
float x() const; // Mean x ("center of gravity") in local grid coordinate (1st moment).
float sigma() const; // Maximum 2nd moment (along major axis).
UShort_t idTruth() const { return mIdTruth; } // Get the truth ID
UShort_t qaTruth() const { return mQaTruth; } // Get the truth quality

void setId(int cluid);
void setPlane(UChar_t plane);
Expand All @@ -39,6 +40,7 @@ class StFttCluster : public StObject {
void setX(float x0);
void setSigma(float sigma);
void setIdTruth(UShort_t id) { mIdTruth = id; }
void setQaTruth(UShort_t qa) { mQaTruth = qa; }

StPtrVecFttRawHit& rawHits();
const StPtrVecFttRawHit& rawHits() const;
Expand All @@ -65,8 +67,9 @@ class StFttCluster : public StObject {
StPtrVecFttCluster mNeighbors; // Neighbor clusters
StPtrVecFttPoint mPoints; // Fitted points (photons) in the cluster
UShort_t mIdTruth=0; // Truth ID
UShort_t mQaTruth=0; // Truth Quality

ClassDef(StFttCluster, 3)
ClassDef(StFttCluster, 4)
};

std::ostream& operator << ( std::ostream&, const StFttCluster& clu ); // Printing operator
Expand Down
4 changes: 2 additions & 2 deletions StRoot/StEvent/StFttPoint.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ void StFttPoint::print(int opt) {
}


int StFttPoint::nClusters() const {
int n = 0;
size_t StFttPoint::nClusters() const {
size_t n = 0;
for ( size_t i = 0; i < 4; i++ ){
if ( mClusters[i] != nullptr )
n++;
Expand Down
7 changes: 5 additions & 2 deletions StRoot/StEvent/StFttPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ class StFttPoint : public StObject {
UChar_t quadrant() const; // detector quadrant.
float x() const; // x position in cell unit at which point intersects the sub-detector in local coordinate
float y() const; // y position in cell unit at which point intersects the sub-detector in local coordinate
int nClusters() const; // Number of points in the parent cluster.
size_t nClusters() const; // Number of points in the parent cluster.
StFttCluster* cluster( size_t i); // Parent cluster of the photon.
const StThreeVectorD& xyz() const; // XYZ position in global STAR coordinate
UShort_t idTruth() const { return mIdTruth; } // Get the truth ID
UShort_t qaTruth() const { return mQaTruth; } // Get the truth quality

void setPlane(UChar_t plane);
void setQuadrant(UChar_t quad);
Expand All @@ -40,6 +41,7 @@ class StFttPoint : public StObject {
void addCluster(StFttCluster* cluster, UChar_t dir);
void setXYZ(const StThreeVectorD& p3);
void setIdTruth(UShort_t id) { mIdTruth = id; }
void setQaTruth(UShort_t qa) { mQaTruth = qa; }

void print(int option=0);

Expand All @@ -51,8 +53,9 @@ class StFttPoint : public StObject {
StFttCluster *mClusters[4];
StThreeVectorD mXYZ; // Photon position in STAR coordinate
UShort_t mIdTruth=0; // Truth ID
UShort_t mQaTruth=0; // Truth quality

ClassDef(StFttPoint, 2)
ClassDef(StFttPoint, 3)
};

inline UChar_t StFttPoint::plane() const { return mPlane; }
Expand Down
9 changes: 7 additions & 2 deletions StRoot/StEvent/StFttRawHit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ mPlane(255),
mQuadrant(kFttUnknownQuadrant),
mRow(255),
mStrip(255),
mOrientation(kFttUnknownOrientation)
mOrientation(kFttUnknownOrientation),
mIdTruth(0),
mQaTruth(0)
{ /*noop*/ }

StFttRawHit::StFttRawHit( UChar_t mSector, UChar_t mRDO, UChar_t mFEB,
Expand Down Expand Up @@ -79,7 +81,10 @@ operator<<( ostream &os, const StFttRawHit& rh )
os << "\tmQuadrant = " << (int)rh.quadrant() << endl;
os << "\tmRow = " << (int)rh.row() << endl;
os << "\tmStrip = " << (int)rh.strip() << endl;
os << "\tmOrientation = " << (int)rh.orientation() << " ) " << endl;
os << "\tmOrientation = " << (int)rh.orientation() << endl;
os << "\tidTruth = " << (int)rh.idTruth() << endl;
os << "\tqaTruth = " << (int)rh.qaTruth() << endl;
os << " ) " << endl;


return os;
Expand Down
12 changes: 8 additions & 4 deletions StRoot/StEvent/StFttRawHit.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ class StFttRawHit : public StObject {
void setMapping( UChar_t mPlane, UChar_t mQuadrant, UChar_t mRow, UChar_t mStrip, UChar_t mOrientation );

void setTime( Short_t mTime ) { this->mTime = mTime; }
// consant getters
void setIdTruth( UShort_t id ) { mIdTruth = id; }
void setQaTruth( UShort_t qa ) { mQaTruth = qa; }

// consant getters
UChar_t sector() const;
UChar_t rdo() const;
UChar_t feb() const;
Expand All @@ -54,6 +56,8 @@ class StFttRawHit : public StObject {
UChar_t row() const;
UChar_t strip() const;
UChar_t orientation() const;
UShort_t idTruth() const { return mIdTruth; }
UShort_t qaTruth() const { return mQaTruth; }

protected:
UChar_t mSector;
Expand All @@ -74,10 +78,10 @@ class StFttRawHit : public StObject {
UChar_t mStrip;
UChar_t mOrientation;

// StFttCluster *mCluster;
// StFttPoint *mPoint;
UShort_t mIdTruth=0; // Truth ID
UShort_t mQaTruth=0; // Truth Quality

ClassDef( StFttRawHit, 3 );
ClassDef( StFttRawHit, 4 );
};

ostream& operator << ( ostream&, const StFttRawHit& digi ); // Printing operator
Expand Down
7 changes: 6 additions & 1 deletion StRoot/StMuDSTMaker/COMMON/StMuFttCluster.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ mSumAdc(0.0),
mX(0.0),
mSigma(0.0),
mRawHits(0),
mNeighbors(0)
mNeighbors(0),
mPoints(0),
mIdTruth(0),
mQaTruth(0)
{

}
Expand Down Expand Up @@ -53,4 +56,6 @@ void StMuFttCluster::set( StFttCluster * clu ){
mSumAdc = clu->sumAdc();
mX = clu->x();
mSigma = clu->sigma();
mIdTruth = clu->idTruth();
mQaTruth = clu->qaTruth();
}
8 changes: 7 additions & 1 deletion StRoot/StMuDSTMaker/COMMON/StMuFttCluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class StMuFttCluster : public TObject {
float sumAdc() const;
float x() const; // Mean x ("center of gravity") in local grid coordinate (1st moment).
float sigma() const; // Maximum 2nd moment (along major axis).
UShort_t idTruth() const { return mIdTruth; } // Get the truth ID
UShort_t qaTruth() const { return 0; } // Get the truth quality

void setId(int cluid);
void setPlane(UChar_t plane);
Expand All @@ -34,6 +36,8 @@ class StMuFttCluster : public TObject {
void setSumAdc(int theSumAdc);
void setX(float x0);
void setSigma(float sigma);
void setIdTruth(UShort_t id) { mIdTruth = id; }
void setQaTruth(UShort_t qa) { mQaTruth = qa; }

TRefArray* rawHits();
const TRefArray* rawHits() const;
Expand All @@ -60,8 +64,10 @@ class StMuFttCluster : public TObject {
TRefArray mRawHits; // Tower hits of the current cluster
TRefArray mNeighbors; // Neighbor clusters
TRefArray mPoints; // Fitted points (photons) in the cluster
UShort_t mIdTruth=0; // Truth ID
UShort_t mQaTruth=0; // Truth quality

ClassDef(StMuFttCluster, 1)
ClassDef(StMuFttCluster, 3)
};


Expand Down
2 changes: 2 additions & 0 deletions StRoot/StMuDSTMaker/COMMON/StMuFttPoint.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ void StMuFttPoint::set( StFttPoint *point ){
mX = point->x();
mY = point->y();
mXYZ = TVector3( point->xyz().x(), point->xyz().y(), point->xyz().z() );
mIdTruth = point->idTruth();
mQaTruth = point->qaTruth();
} // set from StEvent
8 changes: 7 additions & 1 deletion StRoot/StMuDSTMaker/COMMON/StMuFttPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,17 @@ class StMuFttPoint : public TObject {
int nParentClusters() const; // Number of points in the parent cluster.
// StMuFttCluster* cluster( size_t i); // Parent cluster of the photon.
const TVector3& xyz() const; // XYZ position in global STAR coordinate
UShort_t idTruth() const { return mIdTruth; } // Get the truth ID
UShort_t qaTruth() const { return mQaTruth; } // Get the truth quality

void setPlane(UChar_t plane);
void setQuadrant(UChar_t quad);
void setX(float x);
void setY(float y);
// void addCluster(StMuFttCluster* cluster);
void setXYZ(const TVector3& p3);
void setIdTruth(UShort_t id) { mIdTruth = id; }
void setQaTruth(UShort_t qa) { mQaTruth = qa; }


void print(int option=0);
Expand All @@ -52,8 +56,10 @@ class StMuFttPoint : public TObject {
Float_t mY=0.0; // y-position in local coordinate
TRefArray mClusters=0; // parent clusters (could be up to 3?)
TVector3 mXYZ; // Photon position in STAR coordinate
UShort_t mIdTruth=0; // Truth ID
UShort_t mQaTruth=0; // Truth quality

ClassDef(StMuFttPoint, 1)
ClassDef(StMuFttPoint, 3)
};

inline UChar_t StMuFttPoint::plane() const { return mPlane; }
Expand Down
11 changes: 9 additions & 2 deletions StRoot/StMuDSTMaker/COMMON/StMuFttRawHit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ mPlane(255),
mQuadrant(kFttUnknownQuadrant),
mRow(255),
mStrip(255),
mOrientation(kFttUnknownOrientation)
mOrientation(kFttUnknownOrientation),
mIdTruth(0),
mQaTruth(0)
{ /*noop*/ }

StMuFttRawHit::StMuFttRawHit( StFttRawHit * stHit ){
Expand Down Expand Up @@ -66,6 +68,8 @@ void StMuFttRawHit::setMapping( UChar_t mPlane, UChar_t mQuadrant,
void StMuFttRawHit::set( StFttRawHit * stHit ){
setRaw( stHit->sector(), stHit->rdo(), stHit->feb(), stHit->vmm(), stHit->channel(), stHit->adc(), stHit->bcid(), stHit->tb(), stHit->dbcid());
setMapping( stHit->plane(), stHit->quadrant(), stHit->row(), stHit->strip(), stHit->orientation() );
setIdTruth( stHit->idTruth() );
setQaTruth( stHit->qaTruth() );
} // set from StEvent object


Expand All @@ -88,6 +92,9 @@ operator<<( ostream &os, const StMuFttRawHit& rh )
os << "\tmQuadrant = " << (int)rh.quadrant() << endl;
os << "\tmRow = " << (int)rh.row() << endl;
os << "\tmStrip = " << (int)rh.strip() << endl;
os << "\tmOrientation = " << (int)rh.orientation() << " ) " << endl;
os << "\tmOrientation = " << (int)rh.orientation() << endl;
os << "\tidTruth = " << (int)rh.idTruth() << endl;
os << "\tqaTruth = " << (int)rh.qaTruth() << endl;
os << " ) " << endl;
return os;
} // operator<< ostream
11 changes: 7 additions & 4 deletions StRoot/StMuDSTMaker/COMMON/StMuFttRawHit.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ class StMuFttRawHit : public TObject {

void setMapping( UChar_t mPlane, UChar_t mQuadrant, UChar_t mRow, UChar_t mStrip, UChar_t mOrientation );
void set( StFttRawHit * stHit );
void setIdTruth( UShort_t id ) { mIdTruth = id; }
void setQaTruth( UShort_t qa ) { mQaTruth = qa; }

// consant getters

UChar_t sector() const;
UChar_t rdo() const;
UChar_t feb() const;
Expand All @@ -55,6 +56,8 @@ class StMuFttRawHit : public TObject {
UChar_t row() const;
UChar_t strip() const;
UChar_t orientation() const;
UShort_t idTruth() const { return mIdTruth; }
UShort_t qaTruth() const { return mQaTruth; }

protected:
UChar_t mSector;
Expand All @@ -74,10 +77,10 @@ class StMuFttRawHit : public TObject {
UChar_t mStrip;
UChar_t mOrientation;

// StFttCluster *mCluster;
// StFttPoint *mPoint;
UShort_t mIdTruth;
UShort_t mQaTruth;

ClassDef( StMuFttRawHit, 2 );
ClassDef( StMuFttRawHit, 3 );
};

std::ostream& operator << ( std::ostream&, const StMuFttRawHit& hit ); // Printing operator
Expand Down
Loading