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 FST raw hits in StEvent and StMuDst #378

Merged
merged 37 commits into from
Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
7edea64
Add FST raw hits in StMuDst
techuan-huang Jul 18, 2022
0f449a9
Add chain option for FST raw hits in MuDst
techuan-huang Aug 3, 2022
ec86462
Remove not used headers
techuan-huang Aug 9, 2022
e8f264e
Reduce LOG_INFO
techuan-huang Aug 9, 2022
85c7d8f
Fixed a possible null pointer issue in StMuDstMaker
techuan-huang Aug 10, 2022
fdddc9b
fstMuRawHit no need to be included in fstChain
techuan-huang Aug 10, 2022
4774a31
Merge branch 'star-bnl:main' into main
techuan-huang Aug 30, 2022
77f0375
Add FST raw hits in StEvent and the relevant chain option
techuan-huang Aug 30, 2022
18811d1
Remove StFstRawHit.cxx and StFstRawHit.h from StFstUtil
techuan-huang Aug 30, 2022
7b1302c
Fixed include path for StFstRawHit.h in StMuFstRawHit.cxx
techuan-huang Aug 30, 2022
139cea7
Merge branch 'main' into main
techuan-huang Aug 31, 2022
7a09c3b
Merge branch 'main' into main
techuan-huang Sep 2, 2022
ea99262
Merge branch 'main' into main
techuan-huang Sep 7, 2022
e4bdc34
Merge branch 'main' into main
techuan-huang Sep 8, 2022
509e4d4
Merge branch 'main' into main
techuan-huang Sep 16, 2022
4cd7a65
Merge branch 'main' into main
techuan-huang Sep 23, 2022
991fdc2
Merge branch 'main' into main
techuan-huang Sep 27, 2022
cc663cb
Merge branch 'main' into main
techuan-huang Oct 20, 2022
f5f4c27
Fill FST raw hits from StEvent to StMuDst
techuan-huang Oct 22, 2022
a6aff66
Merge branch 'main' into main
techuan-huang Oct 22, 2022
a67757b
Merge branch 'main' into main
techuan-huang Oct 27, 2022
022a2a6
Implement Dmitri's comments
techuan-huang Oct 27, 2022
caa4852
Merge branch 'main' into main
techuan-huang Oct 31, 2022
2114308
Implement Dmitri's comments
techuan-huang Oct 31, 2022
f969296
Fixed wrong include path
techuan-huang Nov 1, 2022
d05c891
Merge branch 'main' into main
techuan-huang Nov 3, 2022
aae5c57
Merge branch 'main' into main
techuan-huang Nov 4, 2022
1954b0e
Implement Dmitri's comments
techuan-huang Nov 4, 2022
3c6c2fd
Implement Dmitri's comments
techuan-huang Nov 5, 2022
88d9879
StFstEvtCollection: Define an empty virtual destructor
plexoos Nov 5, 2022
6cccf09
StArray: Expose object type observed by the container
plexoos Nov 5, 2022
2b99165
Copy StFstRawHit's from StFstRawHitCollection to StFstEvtCollection
plexoos Nov 5, 2022
bb6b4aa
Revert "Copy StFstRawHit's from StFstRawHitCollection to StFstEvtColl…
plexoos Nov 5, 2022
2aae86e
Revert "StArray: Expose object type observed by the container"
plexoos Nov 5, 2022
a6a6b72
Merge branch 'main' into main
techuan-huang Nov 8, 2022
a7020e3
Merge branch 'main' into main
techuan-huang Nov 9, 2022
b0ce45e
Merge branch 'main' into main
techuan-huang Nov 12, 2022
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
2 changes: 2 additions & 0 deletions StRoot/StBFChain/BigFullChain.h
Original file line number Diff line number Diff line change
Expand Up @@ -1587,6 +1587,8 @@ Bfc_st BFC[] = { // standard chains
kFALSE},
{"fstHit", "", "fstChain", "event,fstCluster", "StFstHitMaker", "StFstHitMaker","FST Hit Maker",
kFALSE},
{"fstEvtRawHit", "", "", "fstRawHit", "","","Store FST Raw Hit in StEvent", kFALSE},
{"fstMuRawHit", "", "", "CMuDST,fstEvtRawHit", "","","Store FST Raw Hit in MuDst", kFALSE},

{"ssddat" ,"","","ssd_daq" ,"","","SSD full chain for Real Data",kFALSE},
{"sstdat" ,"","","sst_daq" ,"","","SST full chain for Real Data",kFALSE},
Expand Down
10 changes: 10 additions & 0 deletions StRoot/StBFChain/StBFChain.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,16 @@ Int_t StBFChain::Instantiate()
ProcessLine(cmd);
}

// FST Raw hits in StEvent
if (maker == "StFstRawHitMaker" && GetOption("fstEvtRawHit") ){
mk->SetAttr("fstEvtRawHit", kTRUE);
}

// FST Raw hits in MuDST
if (maker == "StMuDstMaker" && GetOption("fstMuRawHit") ){
mk->SetAttr("fstMuRawHit", kTRUE);
}

if ( maker == "StPicoDstMaker"){
if ( GetOption("picoWrite") ) mk->SetMode(1);
if ( GetOption("picoRead") ) mk->SetMode(2); // possibly more magic
Expand Down
2 changes: 2 additions & 0 deletions StRoot/StEvent/StContainers.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
#include "StHltTriggerReason.h"
#include "StHltVpdHit.h"
#include "StIstHit.h"
#include "StFstRawHit.h"
#include "StFstHit.h"
#include "StKinkVertex.h"
#include "StL3AlgorithmInfo.h"
Expand Down Expand Up @@ -228,6 +229,7 @@ StCollectionImp(HltTrackNode)
StCollectionImp(HltTriggerReason)
StCollectionImp(HltVpdHit)
StCollectionImp(IstHit)
StCollectionImp(FstRawHit)
StCollectionImp(FstHit)
StCollectionImp(KinkVertex)
StCollectionImp(L3AlgorithmInfo)
Expand Down
2 changes: 2 additions & 0 deletions StRoot/StEvent/StContainers.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ class StHltTrackNode;
class StHltTriggerReason;
class StHltVpdHit;
class StIstHit;
class StFstRawHit;
class StFstHit;
class StKinkVertex;
class StL3AlgorithmInfo;
Expand Down Expand Up @@ -244,6 +245,7 @@ StCollectionDef(HltTrackNode)
StCollectionDef(HltTriggerReason)
StCollectionDef(HltVpdHit)
StCollectionDef(IstHit)
StCollectionDef(FstRawHit)
StCollectionDef(FstHit)
StCollectionDef(KinkVertex)
StCollectionDef(L3AlgorithmInfo)
Expand Down
24 changes: 24 additions & 0 deletions StRoot/StEvent/StEvent.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@
#include "StFgtCollection.h"
#include "StPxlHitCollection.h"
#include "StIstHitCollection.h"
#include "StFstEvtCollection.h"
#include "StFstHitCollection.h"
#include "StTrackNode.h"
#include "StTrack.h"
Expand Down Expand Up @@ -922,6 +923,22 @@ StEvent::istHitCollection() const
return istHitCollection;
}

StFstEvtCollection*
StEvent::fstEvtCollection()
{
StFstEvtCollection *fstEvtCollection = 0;
_lookup(fstEvtCollection, mContent);
return fstEvtCollection;
}

const StFstEvtCollection*
StEvent::fstEvtCollection() const
{
StFstEvtCollection *fstEvtCollection = 0;
_lookup(fstEvtCollection, mContent);
return fstEvtCollection;
}

StFstHitCollection*
StEvent::fstHitCollection()
{
Expand Down Expand Up @@ -1428,6 +1445,12 @@ StEvent::setIstHitCollection(StIstHitCollection* val)
_lookupAndSet(val, mContent);
}

void
StEvent::setFstEvtCollection(StFstEvtCollection* val)
{
_lookupAndSet(val, mContent);
}

void
StEvent::setFstHitCollection(StFstHitCollection* val)
{
Expand Down Expand Up @@ -1543,6 +1566,7 @@ void StEvent::statistics()
cout << "\tStSsdHitCollection: " << static_cast<void*>(ssdHitCollection()) << endl;
cout << "\tStSstHitCollection: " << static_cast<void*>(sstHitCollection()) << endl;
cout << "\tStIstHitCollection: " << static_cast<void*>(istHitCollection()) << endl;
cout << "\tStFstEvtCollection: " << static_cast<void*>(fstEvtCollection()) << endl;
cout << "\tStFstHitCollection: " << static_cast<void*>(fstHitCollection()) << endl;
cout << "\tStPxlHitCollection: " << static_cast<void*>(pxlHitCollection()) << endl;
cout << "\tStEmcCollection: " << static_cast<void*>(emcCollection()) << endl;
Expand Down
4 changes: 4 additions & 0 deletions StRoot/StEvent/StEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ class StHltEvent;
class StFgtCollection;
class StPxlHitCollection;
class StIstHitCollection;
class StFstEvtCollection;
class StFstHitCollection;

class StEvent : public StXRefMain {
Expand Down Expand Up @@ -298,6 +299,8 @@ class StEvent : public StXRefMain {
const StPxlHitCollection* pxlHitCollection() const;
StIstHitCollection* istHitCollection();
const StIstHitCollection* istHitCollection() const;
StFstEvtCollection* fstEvtCollection();
const StFstEvtCollection* fstEvtCollection() const;
StFstHitCollection* fstHitCollection();
const StFstHitCollection* fstHitCollection() const;
StEpdCollection* epdCollection();
Expand Down Expand Up @@ -373,6 +376,7 @@ class StEvent : public StXRefMain {
void setSstHitCollection(StSstHitCollection*);
void setPxlHitCollection(StPxlHitCollection*);
void setIstHitCollection(StIstHitCollection*);
void setFstEvtCollection(StFstEvtCollection*);
void setFstHitCollection(StFstHitCollection*);
void setEmcCollection(StEmcCollection*);
void setEpdCollection(StEpdCollection*);
Expand Down
2 changes: 2 additions & 0 deletions StRoot/StEvent/StEventClusteringHints.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ StEventClusteringHints::StEventClusteringHints()
setBranch("StPhmdCollection", "evt_aux", 7);
setBranch("StRpsCollection", "evt_aux", 7);
setBranch("StFttCollection", "evt_aux", 7);
setBranch("StFstEvtCollection", "evt_aux", 7);
setBranch("StSsdHitCollection", "evt_hits", 8);
setBranch("StSstHitCollection", "evt_hits", 8);
setBranch("StSvtHitCollection", "evt_hits", 8);
Expand Down Expand Up @@ -235,6 +236,7 @@ StEventClusteringHints::StEventClusteringHints()
setBranch("StSstHitCollection", "event", 1);
setBranch("StSvtHitCollection", "event", 1);
setBranch("StIstHitCollection", "event", 1);
setBranch("StFstEvtCollection", "event", 1);
setBranch("StFstHitCollection", "event", 1);
setBranch("StPxlHitCollection", "event", 1);
setBranch("StTpcHitCollection", "event", 1);
Expand Down
52 changes: 52 additions & 0 deletions StRoot/StEvent/StFstEvtCollection.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/***************************************************************************
* $Id: StFstEvtCollection.cxx$
*
* Author: Te-Chuan Huang, Aug. 2022
****************************************************************************
* Description:
* See header file.
***************************************************************************/

#include "StFstEvtCollection.h"
#include "StFstRawHit.h"

ClassImp(StFstEvtCollection)

StFstEvtCollection::StFstEvtCollection() {/* no operation*/}
StFstEvtCollection::~StFstEvtCollection()
{
// Usually this wouldn't be necessary but mRawHits is a polymorphic container and StFstRawHit provides
// its own new/delete operator
for (unsigned int i=0; i<mRawHits.size(); i++) {
delete mRawHits[i];
mRawHits[i] = 0;
}
plexoos marked this conversation as resolved.
Show resolved Hide resolved
}

void StFstEvtCollection::addRawHit(StFstRawHit *hit)
{
if (!hit) return;

int elecId = hit->getChannelId();
if (elecId < 0 || elecId >= kFstNumElecIds) return;

unsigned int w = (unsigned int)hit->getWedge() - 1;
if (w >= kFstNumWedges) return;

mRawHits.push_back(hit);
}

unsigned int StFstEvtCollection::numberOfRawHits() const { return mRawHits.size(); }

const StSPtrVecFstRawHit & StFstEvtCollection::rawHits() const { return mRawHits; }
StSPtrVecFstRawHit & StFstEvtCollection::rawHits() { return mRawHits; }

void StFstEvtCollection::print(int option) {
cout << " *** Print FST raw hit collection *** " << endl;
}

/***************************************************************************
* StFstEvtCollection.cxx,v 1.0
* Revision 1.0 2022/08/25 Te-Chuan Huang
* Initial version
****************************************************************************/
48 changes: 48 additions & 0 deletions StRoot/StEvent/StFstEvtCollection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/***************************************************************************
*
* $Id: StFstEvtCollection.h $
*
* Author: Te-Chuan Huang, Aug. 2022
****************************************************************************
* Description:
* Data collection for FST raw hits, and is saved to StEvent.
***************************************************************************/

#ifndef StFstEvtCollection_hh
#define StFstEvtCollection_hh

#include "Stiostream.h"
#include "StObject.h"
#include "StContainers.h"
#include "StEvent/StEnumerations.h"
#include "StEvent/StFstConsts.h"

class StFstRawHit;

class StFstEvtCollection : public StObject
{
public:
StFstEvtCollection();
~StFstEvtCollection();

void addRawHit(StFstRawHit *);
unsigned int numberOfRawHits() const;

StSPtrVecFstRawHit &rawHits();
const StSPtrVecFstRawHit &rawHits() const;

void print(int option=1);

private:
StSPtrVecFstRawHit mRawHits; ///< Inherits from StStrArray which takes care of deleting the objects
///< pointed by the pointers in this array. This is different from the std::vector

ClassDef(StFstEvtCollection, 1)
};
#endif

/***************************************************************************
* StFstEvtCollection.h,v 1.0
* Revision 1.0 2022/08/25 Te-Chuan Huang
* Initial version
****************************************************************************/
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion StRoot/StFstCalibrationMaker/StFstCalibrationMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "StFstCalibrationMaker.h"
#include "StRoot/StFstUtil/StFstCollection.h"
#include "StRoot/StFstUtil/StFstRawHitCollection.h"
#include "StRoot/StFstUtil/StFstRawHit.h"
#include "StEvent/StFstRawHit.h"
#include "StRoot/StFstDbMaker/StFstDb.h"

#include "tables/St_fstMapping_Table.h"
Expand Down
2 changes: 1 addition & 1 deletion StRoot/StFstClusterMaker/StFstClusterMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "StEvent.h"
#include "StEvent/StEnumerations.h"
#include "StFstUtil/StFstCollection.h"
#include "StFstUtil/StFstRawHit.h"
#include "StEvent/StFstRawHit.h"
#include "StFstUtil/StFstRawHitCollection.h"
#include "StFstUtil/StFstCluster.h"
#include "StFstUtil/StFstClusterCollection.h"
Expand Down
2 changes: 1 addition & 1 deletion StRoot/StFstClusterMaker/StFstScanRadiusClusterAlgo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "StFstScanRadiusClusterAlgo.h"
#include "StFstUtil/StFstCollection.h"
#include "StFstUtil/StFstRawHitCollection.h"
#include "StFstUtil/StFstRawHit.h"
#include "StEvent/StFstRawHit.h"
#include "StFstUtil/StFstClusterCollection.h"
#include "StFstUtil/StFstCluster.h"
#include "StEvent/StFstConsts.h"
Expand Down
2 changes: 1 addition & 1 deletion StRoot/StFstQAMaker/StFstQAMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "StFstHit.h"
#include "StRoot/StFstUtil/StFstCollection.h"
#include "StRoot/StFstUtil/StFstRawHitCollection.h"
#include "StRoot/StFstUtil/StFstRawHit.h"
#include "StEvent/StFstRawHit.h"
#include "StIOMaker/StIOMaker.h"
#include "StEvent.h"
#include "StTrack.h"
Expand Down
57 changes: 56 additions & 1 deletion StRoot/StFstRawHitMaker/StFstRawHitMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

#include "StFstUtil/StFstCollection.h"
#include "StFstUtil/StFstRawHitCollection.h"
#include "StFstUtil/StFstRawHit.h"
#include "StEvent/StFstRawHit.h"
#include "StEvent/StFstEvtCollection.h"
#include "StFstDbMaker/StFstDb.h"
#include "StEvent/StFstConsts.h"

Expand Down Expand Up @@ -390,6 +391,60 @@ Int_t StFstRawHitMaker::Make()

LOG_INFO << " Total number of FST Raw Hits - Step II = " << mFstCollectionPtr->getNumRawHits() << " w/ idTruth = " << nIdTruth_Fst << endm;

// Fill Fst raw hits we got so far into StEvent if the chain option is called
if(IAttr("fstEvtRawHit")) {//True for storing FST Raw hits
LOG_INFO << " Filling FST Raw Hits into StEvent" << endm;

//prepare for StEvent
mEvent = (StEvent *) GetInputDS("StEvent");

if(mEvent) {
LOG_DEBUG<<"Found StEvent"<<endm;
} else {
mEvent = new StEvent();
AddData(mEvent);
LOG_DEBUG <<"Added StEvent"<<endm;
}

// Get pointer to an existing StFstEvtCollection if any
mFstEvtCollection = mEvent->fstEvtCollection();

// If no fst raw hit collection, create one
if (!mFstEvtCollection) {
mFstEvtCollection = new StFstEvtCollection();
mEvent->setFstEvtCollection(mFstEvtCollection);
LOG_DEBUG << "Make() - Added new StFstEvtCollection to this StEvent" << endm;
}

if(mFstCollectionPtr->getNumRawHits() > 0) {
for(int wedgeIdx=0; wedgeIdx<kFstNumWedges; ++wedgeIdx ){
StFstRawHitCollection *rawHitCollectionPtr = mFstCollectionPtr->getRawHitCollection( wedgeIdx );
if( rawHitCollectionPtr ){
std::vector<StFstRawHit*>& rawHitVec = rawHitCollectionPtr->getRawHitVec();
std::vector< StFstRawHit* >::iterator rawHitIter;

for( rawHitIter = rawHitVec.begin(); rawHitIter != rawHitVec.end(); ++rawHitIter ){
StFstRawHit* rawHit = *rawHitIter;

StFstRawHit* newRawHit = new StFstRawHit();
newRawHit->setChannelId( rawHit->getChannelId() );
newRawHit->setGeoId( rawHit->getGeoId() );
newRawHit->setSeedhitflag( rawHit->getSeedhitflag() );
for(int itb=0; itb<kFstNumTimeBins; itb++){
newRawHit->setCharge( rawHit->getCharge(itb), itb );
newRawHit->setChargeErr( rawHit->getChargeErr(itb), itb );
}
newRawHit->setMaxTimeBin( (int)rawHit->getMaxTimeBin() );
newRawHit->setDefaultTimeBin( (int)rawHit->getDefaultTimeBin() );
newRawHit->setIdTruth( rawHit->getIdTruth() );
plexoos marked this conversation as resolved.
Show resolved Hide resolved

mFstEvtCollection->addRawHit(newRawHit);
}
}
}
}
}

return ierr;
}

Expand Down
5 changes: 5 additions & 0 deletions StRoot/StFstRawHitMaker/StFstRawHitMaker.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
#include "StEvent/StFstConsts.h"


class StEvent;
class StFstCollection;
class StFstEvtCollection;


/**
Expand Down Expand Up @@ -84,6 +86,9 @@ class StFstRawHitMaker : public StRTSBaseMaker

int FillRawHitCollectionFromSimData();

StEvent* mEvent;
StFstEvtCollection* mFstEvtCollection;

Int_t mDataType; ///< 0=all, 1=adc only, 2=zs only

ClassDef(StFstRawHitMaker, 1);
Expand Down
Loading