From 36846cfdd4f62902ee0d203eecb585196ad0d368 Mon Sep 17 00:00:00 2001 From: Gene Van Buren <85305093+genevb@users.noreply.github.com> Date: Mon, 22 Jul 2024 10:45:19 -0400 Subject: [PATCH 01/19] QAallevents: fill QA hists regardless of prim vtx (#695) There is some interest in examining QA histograms for occasions when there is no primary vertex, including occasions when tracking is excluded from production (e.g. for calorimeter interests). This introduces a chain option `QAallevents` to enable bypassing the cut on primary vertex, and it is independent of the `QAalltrigs` option which is a bypass of the exclusion based on physics triggers. --- StRoot/StBFChain/BigFullChain.h | 1 + StRoot/StBFChain/StBFChain.cxx | 6 ++++-- StRoot/St_QA_Maker/StQAMakerBase.cxx | 5 ++++- StRoot/St_QA_Maker/StQAMakerBase.h | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/StRoot/StBFChain/BigFullChain.h b/StRoot/StBFChain/BigFullChain.h index 57880357085..edcbc8babfa 100644 --- a/StRoot/StBFChain/BigFullChain.h +++ b/StRoot/StBFChain/BigFullChain.h @@ -1936,6 +1936,7 @@ Bfc_st BFC[] = { // standard chains ,"St_QA_Maker","Filling Y2/Y3 Qa histo",kFALSE}, {"QAC" ,"CosmicsQA","globT","" ,"StQACosmicMaker","StQACosmicMaker","",kFALSE}, {"QAalltrigs" ,"", "","", "","","Analyze all triggers in QA",kFALSE}, + {"QAallevents" ,"", "","", "","","Analyze all events in QA",kFALSE}, {"HitFilt" ,"", "","", "StHitFilterMaker","StHitFilterMaker","Hit filter Maker",kFALSE}, {"SvtHitFilt" ,"", "","HitFilt", "","","SVT Hit filter Maker",kFALSE}, {"TpcHitFilt" ,"", "","HitFilt", "","","filter out TPC Hits not on tracks",kFALSE}, diff --git a/StRoot/StBFChain/StBFChain.cxx b/StRoot/StBFChain/StBFChain.cxx index 566db07be1f..b00ec8fe3c9 100644 --- a/StRoot/StBFChain/StBFChain.cxx +++ b/StRoot/StBFChain/StBFChain.cxx @@ -730,8 +730,10 @@ Int_t StBFChain::Instantiate() if ( GetOption("EastOff")) mk->SetAttr("EastOff",kTRUE); if ( GetOption("WestOff")) mk->SetAttr("WestOff",kTRUE); } - if (maker == "StEventQAMaker" && GetOption("QAalltrigs")) - ProcessLine(Form("((StEventQAMaker *) %p)->AllTriggers();",mk)); + if (maker == "StEventQAMaker") { + if ( GetOption("QAalltrigs")) mk->SetAttr("allTrigs",kTRUE); + if ( GetOption("QAallevents")) mk->SetAttr("allEvents",kTRUE); + } //Special options for V0s and Xis using estGlobal tracks if(maker=="StV0FinderMaker" && Key=="v0svt"){ TString cmd(Form("StV0FinderMaker *V0mk=(StV0FinderMaker*) %p;",mk)); diff --git a/StRoot/St_QA_Maker/StQAMakerBase.cxx b/StRoot/St_QA_Maker/StQAMakerBase.cxx index 4f31736be8c..de5811ecdcb 100755 --- a/StRoot/St_QA_Maker/StQAMakerBase.cxx +++ b/StRoot/St_QA_Maker/StQAMakerBase.cxx @@ -202,6 +202,7 @@ StQAMakerBase::StQAMakerBase(const char *name, const char *title, const char* ty ITTF = kFALSE; EST = -1; // -1 = unknown allTrigs = kFALSE; + allEvents = kFALSE; // - Set all the histogram booking constants @@ -309,6 +310,8 @@ StQAMakerBase::~StQAMakerBase() { Int_t StQAMakerBase::Init() { // Histogram booking must wait until first event Make() to determine event type eventCount = 0; + if (IAttr("allTrigs")) allTrigs = kTRUE; + if (IAttr("allEvents")) allEvents = kTRUE; return StMaker::Init(); } //_____________________________________________________________________________ @@ -337,7 +340,7 @@ Int_t StQAMakerBase::Make() { - if (!fillHists) return kStOk; + if (!(fillHists || allEvents)) return kStOk; // Call methods to fill histograms // Those divided by event class: diff --git a/StRoot/St_QA_Maker/StQAMakerBase.h b/StRoot/St_QA_Maker/StQAMakerBase.h index 9b577766a06..8efced122aa 100755 --- a/StRoot/St_QA_Maker/StQAMakerBase.h +++ b/StRoot/St_QA_Maker/StQAMakerBase.h @@ -271,6 +271,7 @@ class StQAMakerBase : public StMaker { Bool_t ITTF; Int_t EST; Bool_t allTrigs; + Bool_t allEvents; virtual void NewQABookHist(); virtual TH2F* MH1F(const Text_t* name, const Text_t* title, From eba182d5b42930289996412f3ffc1cfa63566a46 Mon Sep 17 00:00:00 2001 From: Daniel Brandenburg Date: Mon, 29 Jul 2024 23:03:22 -0400 Subject: [PATCH 02/19] StFwdQAMaker for optional QA of fwd systems and tracking (#694) The StFwdQAMaker provides dedicated maker for Tree generation for use in FWD calibrations and for offline QA histograms using the full FWD tracking + call matching --- StRoot/StFwdTrackMaker/StFwdQAMaker.cxx | 333 ++++++++++++++++++ StRoot/StFwdTrackMaker/StFwdQAMaker.h | 217 ++++++++++++ .../include/Tracker/ObjExporter.h | 5 +- 3 files changed, 553 insertions(+), 2 deletions(-) create mode 100644 StRoot/StFwdTrackMaker/StFwdQAMaker.cxx create mode 100644 StRoot/StFwdTrackMaker/StFwdQAMaker.h diff --git a/StRoot/StFwdTrackMaker/StFwdQAMaker.cxx b/StRoot/StFwdTrackMaker/StFwdQAMaker.cxx new file mode 100644 index 00000000000..b7ce1cd225e --- /dev/null +++ b/StRoot/StFwdTrackMaker/StFwdQAMaker.cxx @@ -0,0 +1,333 @@ +#include "StFwdTrackMaker/StFwdQAMaker.h" +#include "StFwdQAMaker.h" +#include "St_base/StMessMgr.h" +#include "StBFChain/StBFChain.h" +#include "StFwdTrackMaker/StFwdTrackMaker.h" + +#include "StFwdTrackMaker/include/Tracker/FwdTracker.h" +#include "StFwdTrackMaker/include/Tracker/ObjExporter.h" +// StEvent includes +#include "StEvent/StBTofCollection.h" +#include "StEvent/StBTofHeader.h" +#include "StEvent/StEvent.h" +#include "StEvent/StFttCluster.h" +#include "StEvent/StFttCollection.h" +#include "StEvent/StFcsCluster.h" +#include "StEvent/StFcsCollection.h" +#include "StFcsDbMaker/StFcsDb.h" +#include "StRoot/StEpdUtil/StEpdGeom.h" +#include "StEvent/StFwdTrackCollection.h" +#include "StEvent/StFwdTrack.h" + + +#include "StMuDSTMaker/COMMON/StMuDstMaker.h" +#include "StMuDSTMaker/COMMON/StMuDst.h" +#include "StMuDSTMaker/COMMON/StMuEvent.h" +#include "StMuDSTMaker/COMMON/StMuFstCollection.h" +#include "StMuDSTMaker/COMMON/StMuFstHit.h" +#include "StMuDSTMaker/COMMON/StMuPrimaryVertex.h" +#include "StMuDSTMaker/COMMON/StMuFwdTrack.h" +#include "StMuDSTMaker/COMMON/StMuFwdTrackCollection.h" +#include "StMuDSTMaker/COMMON/StMuFcsCollection.h" +#include "StMuDSTMaker/COMMON/StMuFcsCluster.h" +#include "StMuDSTMaker/COMMON/StMuFcsHit.h" +#include "StMuDSTMaker/COMMON/StMuFttCluster.h" +#include "StMuDSTMaker/COMMON/StMuFttPoint.h" +#include "StMuDSTMaker/COMMON/StMuMcTrack.h" +#include "StMuDSTMaker/COMMON/StMuFstHit.h" + +// ClassImp(FcsClusterWithStarXYZ); + +/** Clear the FwdQATreeData from one event to next */ +void FwdQATreeData::clear(){ + header.clear(); + mcTracks.reset(); + fttPoints.reset(); + fttClusters.reset(); + fstPoints.reset(); + reco.reset(); + seeds.reset(); + wcal.reset(); + hcal.reset(); + wcalHits.reset(); + hcalHits.reset(); + epdHits.reset(); +} + +FcsClusterWithStarXYZ::FcsClusterWithStarXYZ( StMuFcsCluster *clu, StFcsDb *fcsDb ) { + if ( nullptr == clu ) return; + StThreeVectorD xyz = fcsDb->getStarXYZfromColumnRow(clu->detectorId(),clu->x(),clu->y()); + float detOffset = 0.0; + if ( clu->detectorId() == kFcsEcalNorthDetId || clu->detectorId() == kFcsEcalSouthDetId ){ + detOffset = 715.0; // cm from IP + } else if ( clu->detectorId() == kFcsHcalNorthDetId || clu->detectorId() == kFcsHcalSouthDetId ){ + detOffset = 807.0; // cm from IP + } + mXYZ.SetXYZ( xyz.x(), xyz.y(), xyz.z() + detOffset ); + mClu = clu; +} + +FcsHitWithStarXYZ::FcsHitWithStarXYZ( StMuFcsHit *hit, StFcsDb *fcsDb ) { + if ( nullptr == hit ) return; + StThreeVectorD xyz = fcsDb->getStarXYZ(hit->detectorId(),hit->id()); + float detOffset = 0.0; + if ( hit->detectorId() == kFcsEcalNorthDetId || hit->detectorId() == kFcsEcalSouthDetId ){ + detOffset = 715.0; // cm from IP + } else if ( hit->detectorId() == kFcsHcalNorthDetId || hit->detectorId() == kFcsHcalSouthDetId ){ + detOffset = 807.0; // cm from IP + } else if ( hit->detectorId() == kFcsPresNorthDetId || hit->detectorId() == kFcsPresSouthDetId ){ + StEpdGeom epdgeo; + double zepd=375.0; + int pp,tt,n; + double x[5],y[5]; + fcsDb->getEPDfromId(hit->detectorId(),hit->id(),pp,tt); + epdgeo.GetCorners(100*pp+tt,&n,x,y); + double x0 = (x[0] + x[1] + x[2] + x[3]) / 4.0; + double y0 = (y[0] + y[1] + y[2] + y[3]) / 4.0; + xyz.setX(x0); + xyz.setY(y0); + xyz.setZ(zepd); + } + mXYZ.SetXYZ( xyz.x(), xyz.y(), xyz.z() + detOffset ); + mHit = hit; +} + +StFwdQAMaker::StFwdQAMaker() : StMaker("fwdQAMaker"), mTreeFile(nullptr), mTree(nullptr) { + +} + +int StFwdQAMaker::Init() { + + mTreeFile = new TFile("fwdtree.root", "RECREATE"); + mTree = new TTree("fwd", "fwd tracking tree"); + + mTree->Branch("header", &mTreeData. header, 3200, 99 ); + mTreeData.mcTracks.createBranch(mTree, "mcTracks"); + mTree->Branch("nSeedTracks", &mTreeData.nSeedTracks, "nSeedTracks/I"); + mTreeData.fstPoints.createBranch(mTree, "fstHits"); + mTreeData.fttPoints.createBranch(mTree, "fttPoints"); + mTreeData.fttClusters.createBranch(mTree, "fttClusters"); + mTreeData.fstPoints.createBranch(mTree, "fstPoints"); + mTreeData.wcal.createBranch(mTree, "wcalClusters"); + mTreeData.hcal.createBranch(mTree, "hcalClusters"); + + mTreeData.wcalHits.createBranch(mTree, "wcalHits"); + mTreeData.hcalHits.createBranch(mTree, "hcalHits"); + mTreeData.epdHits.createBranch(mTree, "epdHits"); + + mTreeData.reco.createBranch(mTree, "reco"); + mTreeData.seeds.createBranch(mTree, "seeds"); + return kStOk; +} +int StFwdQAMaker::Finish() { + + if ( mTreeFile && mTree ){ + mTreeFile->cd(); + mTree->Write(); + mTreeFile->Write(); + LOG_DEBUG << "StFwdQA File written" << endm; + } + return kStOk; +} +int StFwdQAMaker::Make() { + LOG_INFO << "FWD Report:" << endm; + StEvent *mStEvent = static_cast(GetInputDS("StEvent")); + if ( mStEvent ){ + // report number of fwd tracks + auto fwdTracks = mStEvent->fwdTrackCollection(); + LOG_INFO << "Number of FwdTracks (StFwdTrackCollection): " << fwdTracks->tracks().size() << endm; + LOG_INFO << "Number of Ftt Points (StEvent)" << mStEvent->fttCollection()->points().size() << endm; + } + LOG_INFO << "SETUP START" << endm; + // setup the datasets / makers + mMuDstMaker = (StMuDstMaker *)GetMaker("MuDst"); + if(mMuDstMaker) { + mMuDst = mMuDstMaker->muDst(); + mMuForwardTrackCollection = mMuDst->muFwdTrackCollection(); + mMuFcsCollection = mMuDst->muFcsCollection(); + if (mMuForwardTrackCollection){ + LOG_DEBUG << "Number of StMuFwdTracks: " << mMuForwardTrackCollection->numberOfFwdTracks() << endm; + } + } else { + LOG_DEBUG << "No StMuDstMaker found: " << mMuDstMaker << endm; + } + mFcsDb = static_cast(GetDataSet("fcsDb")); + + mFwdTrackMaker = (StFwdTrackMaker*) GetMaker( "fwdTrack" ); + if (!mFwdTrackMaker) { + LOG_WARN << "No StFwdTrackMaker found, skipping StFwdQAMaker" << endm; + // return kStOk; + } + + mTreeData.header.run = mMuDst->event()->runNumber(); + LOG_DEBUG << "SETUP COMPLETE" << endm; + + auto muFstCollection = mMuDst->muFstCollection(); + if ( muFstCollection ){ + LOG_DEBUG << "MuDst has #fst hits: " << muFstCollection->numberOfHits() << endm; + for ( size_t i = 0; i < muFstCollection->numberOfHits(); i++ ){ + StMuFstHit * h = muFstCollection->getHit(i); + mTreeData.fstPoints.add( h ); + } + } + FillMcTracks(); + FillTracks(); + FillFstPoints(); + FillFttClusters(); + FillFcsStMuDst(); + mTree->Fill(); + return kStOk; +} +void StFwdQAMaker::Clear(const Option_t *opts) { + mTreeData.clear(); + return; +} + +void StFwdQAMaker::FillFstPoints(){ + StMuFstCollection * fst = mMuDst->muFstCollection(); + if (!fst) { + LOG_WARN << "No StMuFstCollection ... bye-bye" << endm; + return; + } + + // size_t numFwdHitsPrior = mFwdHitsFst.size(); + LOG_INFO << "Loading " << fst->numberOfHits() << " StMuFstHits" << endm; + // TMatrixDSym hitCov3(3); + for ( unsigned int index = 0; index < fst->numberOfHits(); index++){ + StMuFstHit * muFstHit = fst->getHit( index ); + mTreeData.fstPoints.add( muFstHit ); + + + // float vR = muFstHit->localPosition(0); + // float vPhi = muFstHit->localPosition(1); + // float vZ = muFstHit->localPosition(2); + + // const float dz0 = fabs( vZ - mFstZFromGeom[0] ); + // const float dz1 = fabs( vZ - mFstZFromGeom[1] ); + // const float dz2 = fabs( vZ - mFstZFromGeom[2] ); + // static const float fstThickness = 2.0; // thickness in cm between inner and outer on sigle plane + + // // assign disk according to which z value the hit has, within the z-plane thickness + // int d = 0 * ( dz0 < fstThickness ) + 1 * ( dz1 < fstThickness ) + 2 * ( dz2 < fstThickness ); + + // float x0 = vR * cos( vPhi ); + // float y0 = vR * sin( vPhi ); + // hitCov3 = makeSiCovMat( TVector3( x0, y0, vZ ), mFwdConfig ); + + // LOG_DEBUG << "FST HIT: d = " << d << ", x=" << x0 << ", y=" << y0 << ", z=" << vZ << endm; + // mFstHits.push_back( TVector3( x0, y0, vZ) ); + + // // we use d+4 so that both FTT and FST start at 4 + // mFwdHitsFst.push_back(FwdHit(count++, x0, y0, vZ, d+4, 0, hitCov3, nullptr)); + // count++; + } // index +} + +void StFwdQAMaker::FillTracks() { + mTreeData.nSeedTracks = 0; + if ( mMuForwardTrackCollection ){ + LOG_DEBUG << "Adding " << mMuForwardTrackCollection->numberOfFwdTracks() << " FwdTracks (MuDst)" << endm; + for ( size_t iTrack = 0; iTrack < mMuForwardTrackCollection->numberOfFwdTracks(); iTrack++ ){ + auto muTrack = mMuForwardTrackCollection->getFwdTrack(iTrack); + mTreeData.reco.add( muTrack ); + + for (auto fsth : muTrack->mFSTPoints){ + mTreeData.seeds.add( fsth ); + mTreeData.nSeedTracks++; + } + for (auto ftth : muTrack->mFTTPoints){ + mTreeData.seeds.add( ftth ); + mTreeData.nSeedTracks++; + } + if ( iTrack > 5000 ) { + LOG_WARN << "Truncating to 5000 tracks" << endm; + break; + } + } + } + LOG_DEBUG << "TRACKS COMPLETE" << endm; +} + +void StFwdQAMaker::FillFcsStMuDst( ) { + + if ( !mMuDst ){ + LOG_DEBUG << "No mMuDst found, skipping StFwdQAMaker::FillFcsStEvent" << endm; + return; + } + StMuFcsCollection* fcs = mMuDst->muFcsCollection(); + if ( !fcs ){ + LOG_DEBUG << "No muFcsCollection found, skipping StFwdQAMaker::FillFcsStEvent" << endm; + return; + } + + StFcsDb* fcsDb=static_cast(GetDataSet("fcsDb")); + + // LOAD ECAL / HCAL CLUSTERS + LOG_INFO << "MuDst has #fcs clusters: " << fcs->numberOfClusters() << endm; + for( size_t i = 0; i < fcs->numberOfClusters(); i++){ + StMuFcsCluster * clu = fcs->getCluster(i); + FcsClusterWithStarXYZ *cluSTAR = new FcsClusterWithStarXYZ(clu, fcsDb); + if ( clu->detectorId() == kFcsEcalNorthDetId || clu->detectorId() == kFcsEcalSouthDetId ){ + LOG_INFO << "Adding WCAL Cluster to FwdTree" << endm; + mTreeData.wcal.add( cluSTAR ); + } else if ( clu->detectorId() == kFcsHcalNorthDetId || clu->detectorId() == kFcsHcalSouthDetId ){ + LOG_INFO << "Adding HCAL Cluster to FwdTree" << endm; + mTreeData.hcal.add( cluSTAR ); + } + + delete cluSTAR; + } + + // LOAD ECAL / HCAL CLUSTERS + LOG_INFO << "MuDst has #fcs hits: " << fcs->numberOfHits() << endm; + for( size_t i = 0; i < fcs->numberOfHits(); i++){ + StMuFcsHit * hit = fcs->getHit(i); + FcsHitWithStarXYZ *hitSTAR = new FcsHitWithStarXYZ(hit, fcsDb); + if ( hit->detectorId() == kFcsEcalNorthDetId || hit->detectorId() == kFcsEcalSouthDetId ){ + LOG_DEBUG << "Adding WCAL Cluster to FwdTree" << endm; + mTreeData.wcalHits.add( hitSTAR ); + } else if ( hit->detectorId() == kFcsHcalNorthDetId || hit->detectorId() == kFcsHcalSouthDetId ){ + LOG_DEBUG << "Adding HCAL Cluster to FwdTree" << endm; + mTreeData.hcalHits.add( hitSTAR ); + } else if ( hit->detectorId() == kFcsPresNorthDetId || hit->detectorId() == kFcsPresSouthDetId ){ + LOG_DEBUG << "Adding PRES hit to FwdTree" << endm; + mTreeData.epdHits.add( hitSTAR ); + } + delete hitSTAR; + } + + // TODO, cleanup? +} + +void StFwdQAMaker::FillMcTracks(){ + // Retrieve pointer to MC tracks + TClonesArray *mcTracks = mMuDst->mcArray(1); + LOG_INFO << "MuDst has #mc tracks: " << mcTracks->GetEntriesFast() << endm; + // Loop over MC vertices + for (Int_t iVtx=0; iVtxGetEntriesFast(); iVtx++) { + // Retrieve i-th MC vertex from MuDst + StMuMcTrack *mcTrack = (StMuMcTrack*)mcTracks->UncheckedAt(iVtx); + if ( !mcTrack ) continue; + + // Add MC track to the tree + mTreeData.mcTracks.add( mcTrack ); + } +} + + +void StFwdQAMaker::FillFttClusters(){ + + auto muFttCollection = mMuDst->muFttCollection(); + if ( muFttCollection ){ + LOG_DEBUG << "MuDst has #ftt clusters: " << muFttCollection->numberOfClusters() << endm; + for ( size_t i = 0; i < muFttCollection->numberOfClusters(); i++ ){ + StMuFttCluster * c = muFttCollection->getCluster(i); + mTreeData.fttClusters.add( c ); + } + + for ( size_t i = 0; i < muFttCollection->numberOfPoints(); i++ ){ + StMuFttPoint * c = muFttCollection->getPoint(i); + mTreeData.fttPoints.add( c ); + } + } +} diff --git a/StRoot/StFwdTrackMaker/StFwdQAMaker.h b/StRoot/StFwdTrackMaker/StFwdQAMaker.h new file mode 100644 index 00000000000..bc60f98d5b4 --- /dev/null +++ b/StRoot/StFwdTrackMaker/StFwdQAMaker.h @@ -0,0 +1,217 @@ +#ifndef ST_FWD_TREE_MAKER_H +#define ST_FWD_TREE_MAKER_H + +#include "TClonesArray.h" +#ifndef __CINT__ +#include "GenFit/Track.h" +#include "StFwdTrackMaker/include/Tracker/FwdHit.h" +#include "StMuDSTMaker/COMMON/StMuFwdTrack.h" +#endif + +#include "StChain/StMaker.h" +#include "TTree.h" +#include "TVector3.h" +#include "TLorentzVector.h" +#include "StEvent/StEnumerations.h" +#include "StThreeVectorD.hh" + +class StMuFwdTrack; +class StMuFwdTrackProjection; +class ForwardTracker; +class StFwdTrack; +class StMuMcTrack; + +/** @brief TClonesArray writer + * Helper class for writing TClonesArrays to TTree of custom class type + */ +template +class TClonesArrayWriter { + public: + TClonesArrayWriter() {} + ~TClonesArrayWriter() {} + + void createBranch( TTree *tree, const char* name, int buffSize = 256000, int splitLevel = 99){ + _tca = new TClonesArray( BranchType::Class_Name() ); + tree->Branch( name, &this->_tca, buffSize, splitLevel ); + } + + void add( BranchType &branch ){ + if ( nullptr == this->_tca ) return; + BranchType *new_branch = new ((*this->_tca)[this->_n]) BranchType( ); + *new_branch = branch; + this->_n++; + } + + void add( BranchType *branch ){ + if ( nullptr == this->_tca || nullptr == branch) return; + BranchType *new_branch = new ((*this->_tca)[this->_n]) BranchType( ); + *new_branch = *branch; + this->_n++; + } + + void reset(){ + this->_n = 0; + if( nullptr != this->_tca ) + this->_tca->Clear(); + } + + UInt_t N() const { return _n; } + BranchType *at( UInt_t i ){ + if ( nullptr == _tca ) + return nullptr; + return (BranchType*)_tca->At( i ); + } + + protected: + TClonesArray * _tca = nullptr; + UInt_t _n = 0; +}; + +class FwdTreeHeader : public TObject { + public: + FwdTreeHeader() : TObject() { + run = 0; + event = 0; + tofmult = 0; + vpdVz = -999; + pv.SetXYZ(0, 0, 0); + } + + void set( int r, int e, int t, TVector3 &p ){ + run = r; + event = e; + tofmult = t; + pv = p; + } + + void clear() { + run = 0; + event = 0; + tofmult = 0; + TVector3 pv(-999, -999, -999); + vpdVz = -999; + } + + TVector3 pv; + int run, event, tofmult; + float vpdVz; + + ClassDef(FwdTreeHeader, 1) +}; + +class StFcsDb; +class StFcsCluster; +class StFcsHit; +class StMuFcsCluster; +class StMuFcsHit; +class StMuFttCluster; +class StMuFttPoint; +class StMuFstHit; +class StMuFwdTrackSeedPoint; + + +/** + * @brief Store Cluster with STAR XYZ position + * + */ +class FcsClusterWithStarXYZ: public TObject { + public: + FcsClusterWithStarXYZ() { + mXYZ.SetXYZ(0, 0, 0); + mClu = nullptr; + } + FcsClusterWithStarXYZ( StMuFcsCluster *clu, StFcsDb *fcsDb ); + TVector3 mXYZ; + StMuFcsCluster *mClu; + ClassDef(FcsClusterWithStarXYZ, 1); +}; + +/** + * @brief Store Hit with STAR XYZ position + * + */ +class FcsHitWithStarXYZ: public TObject { + public: + FcsHitWithStarXYZ() { + mXYZ.SetXYZ(0, 0, 0); + mHit = nullptr; + } + FcsHitWithStarXYZ( StMuFcsHit *hit, StFcsDb *fcsDb ); + TVector3 mXYZ; + StMuFcsHit *mHit; + ClassDef(FcsHitWithStarXYZ, 1); +}; + + +/** @brief +* This class is a container for the data that will be written to the output tree. +*/ +struct FwdQATreeData { + + /** @brief Primary event vertex*/ + FwdTreeHeader header; + /** @brief MC tracks */ + TClonesArrayWriter mcTracks; + TClonesArrayWriter fttPoints; + TClonesArrayWriter fttClusters; + TClonesArrayWriter fstPoints; + + TClonesArrayWriter wcal; + TClonesArrayWriter wcalHits; + TClonesArrayWriter hcal; + TClonesArrayWriter hcalHits; + TClonesArrayWriter epdHits; + TClonesArrayWriter reco; + + int nSeedTracks; + TClonesArrayWriter seeds; + + + void clear(); +}; + + +class StMuDstMaker; +class StMuDst; +class StMuFwdTrackCollection; +class StMuFcsCollection; +class StFwdTrackMaker; +class StEvent; + +class StFwdQAMaker : public StMaker { + + ClassDef(StFwdQAMaker, 0); + + public: + StFwdQAMaker(); + ~StFwdQAMaker(){/* nada */}; + + int Init(); + int Finish(); + int Make(); + void Clear(const Option_t *opts = ""); + + void FillFttClusters(); + void FillFstPoints(); + void FillFcsStEvent(); + void FillFcsStMuDst(); + void FillTracks(); + void FillMcTracks(); + + protected: + TFile *mTreeFile = nullptr; + TTree *mTree = nullptr; + FwdQATreeData mTreeData; + + StEvent *mStEvent = nullptr; + StMuDstMaker *mMuDstMaker = nullptr; + StMuDst *mMuDst = nullptr; + StMuFwdTrackCollection * mMuForwardTrackCollection = nullptr; + StMuFcsCollection *mMuFcsCollection = nullptr; + StFwdTrackMaker *mFwdTrackMaker = nullptr; + StFcsDb *mFcsDb = nullptr; + +}; + + +#endif diff --git a/StRoot/StFwdTrackMaker/include/Tracker/ObjExporter.h b/StRoot/StFwdTrackMaker/include/Tracker/ObjExporter.h index 08ffda49a8e..623b0172452 100644 --- a/StRoot/StFwdTrackMaker/include/Tracker/ObjExporter.h +++ b/StRoot/StFwdTrackMaker/include/Tracker/ObjExporter.h @@ -9,8 +9,6 @@ class StEvent; -float DEGS_TO_RAD = 3.14159f/180.0f; -float SCALE = 0.1; class ObjExporter { public: @@ -33,6 +31,7 @@ class ObjExporter { int p, s, i, j; float x, y, z, out; int nPitch = nLongitude + 1; + const float DEGS_TO_RAD = 3.14159f/180.0f; float pitchInc = (180. / (float)nPitch) * DEGS_TO_RAD; float rotInc = (360. / (float)nLatitude) * DEGS_TO_RAD; @@ -209,6 +208,7 @@ class ObjExporter { fout << "usemtl stgc_hits\n" << endl; float pz[] = {280.90499, 303.70498, 326.60501, 349.40499}; TVector3 cp; + const float SCALE = 0.1; for ( size_t i = 0; i < event->fttCollection()->numberOfClusters(); i++ ){ @@ -263,6 +263,7 @@ class ObjExporter { std::vector &fcsClusterEnergy ){ + const float SCALE = 0.1; LOG_INFO << "Writing: " << filename << endm; numVertices = 0; // OPEN output From 44aaab8f8ba59101f7cd02e8b50a9f3641f1a5aa Mon Sep 17 00:00:00 2001 From: klendathu2k <56083924+klendathu2k@users.noreply.github.com> Date: Wed, 7 Aug 2024 12:02:15 -0400 Subject: [PATCH 03/19] Prevent ROOT6/CLING from loading all TROOT exposed classes twice... (#701) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … (which couldn't possibly cause any side effects, but lets be safe about it shall we?) --- StRoot/StBFChain/BFC.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/StRoot/StBFChain/BFC.C b/StRoot/StBFChain/BFC.C index 958219204d4..79b1f846d30 100644 --- a/StRoot/StBFChain/BFC.C +++ b/StRoot/StBFChain/BFC.C @@ -1,4 +1,4 @@ -#if !defined(__CINT__) +#if !defined(__CINT__) && !defined(__CLING__) #include "TROOT.h" #endif #include "Bfc.h" From 3b7a25b09c337cd6f97d814a853b6c278296190f Mon Sep 17 00:00:00 2001 From: Gene Van Buren <85305093+genevb@users.noreply.github.com> Date: Tue, 13 Aug 2024 16:03:54 -0400 Subject: [PATCH 04/19] Add EPDX to RICH scalers (#704) The EPD coincidence rate began filling element `rs14` of the RICH scaler struct in the DAQ stream and online databases at the end of March 2018. This needs to be propagated into the `trigDetSums` table in the offline database ([now done](https://www.star.bnl.gov/cgi-bin/protected/viewvc.cgi/cvsroot/online/DataBase/dbcron/macros/FillTD.C?r1=1.2&r2=1.3)), and when reading the DAQ structures (this PR). As was previously done for the no-killer ZDCs, this makes use of a no-longer needed scaler in the trigDetSums struct (TOFp in this case), while retaining backward compatibility with older data in which that now-defunct scaler was actually used. --- StRoot/StDAQMaker/StSCReader.cxx | 15 ++++++++++++--- StRoot/StDAQMaker/StSCReader.h | 4 +++- StRoot/StDaqLib/SC/SC_Reader.cxx | 4 ++++ StRoot/StDaqLib/SC/SC_Reader.hh | 1 + StRoot/StDetectorDbMaker/St_spaceChargeCorC.cxx | 1 + StRoot/StDetectorDbMaker/St_trigDetSumsC.h | 2 ++ .../StPass0CalibMaker/StSpaceChargeEbyEMaker.cxx | 10 ++++++++-- 7 files changed, 31 insertions(+), 6 deletions(-) diff --git a/StRoot/StDAQMaker/StSCReader.cxx b/StRoot/StDAQMaker/StSCReader.cxx index 18869dd0686..c397744007d 100644 --- a/StRoot/StDAQMaker/StSCReader.cxx +++ b/StRoot/StDAQMaker/StSCReader.cxx @@ -36,8 +36,9 @@ void StSCReader::FillTime( unsigned int utime) //but new DAQ reader only gets used for 2009+ anyhow time_t UTime = utime; //er->getEventInfo().UnixTime; struct tm *time=gmtime(&UTime); - flipBBCBkg = (time->tm_year > 95 && time->tm_year < 109 ? 1 : 0) ; - useNoKillers = (time->tm_year > 110 ? 1 : 0);; + flipBBCBkg = (time->tm_year > 95 && time->tm_year < 109 ? 1 : 0); + useNoKillers = (time->tm_year > 110); + useEPD = (time->tm_year > 118 || (time->tm_year == 118 && time->tm_mon > 2)); } double StSCReader::getCTBWest() { @@ -80,6 +81,10 @@ double StSCReader::getZDCXNoKiller() { return sc.rich_scalers[14]; } +double StSCReader::getEPDX() { + return sc.rich_scalers[13]; +} + double StSCReader::getMult() { return sc.rich_scalers[10]; } @@ -170,7 +175,11 @@ TDataSet* StSCReader::getSCTable(unsigned long runno) { tb->ctbEast = getCTBEast(); tb->ctbTOFp = getCTBOrTOFp(); } - tb->tofp = getTOFp(); + if (useEPD) { // use otherwise empty space + tb->tofp = getEPDX(); + } else { + tb->tofp = getTOFp(); + } tb->zdcWest = getZDCWest(); tb->zdcEast = getZDCEast(); tb->zdcX = getZDCX(); diff --git a/StRoot/StDAQMaker/StSCReader.h b/StRoot/StDAQMaker/StSCReader.h index 4d41a4b8325..b02f43a174b 100644 --- a/StRoot/StDAQMaker/StSCReader.h +++ b/StRoot/StDAQMaker/StSCReader.h @@ -36,6 +36,7 @@ class StSCReader double getZDCWestNoKiller(); double getZDCEastNoKiller(); double getZDCXNoKiller(); + double getEPDX(); double getMult(); double getL0(); double getBBCX(); @@ -56,7 +57,8 @@ class StSCReader sc_t *fSC; short flipBBCBkg; - short useNoKillers; + bool useNoKillers; + bool useEPD; }; #endif diff --git a/StRoot/StDaqLib/SC/SC_Reader.cxx b/StRoot/StDaqLib/SC/SC_Reader.cxx index 055dafbd51b..c6e1abc5354 100644 --- a/StRoot/StDaqLib/SC/SC_Reader.cxx +++ b/StRoot/StDaqLib/SC/SC_Reader.cxx @@ -57,6 +57,10 @@ int SC_Reader::ZDCXNoKiller() { return sc.rich_scalers[14]; } +int SC_Reader::EPDX() { + return sc.rich_scalers[13]; +} + int SC_Reader::PVPDEast() { return sc.rich_scalers[8]; } diff --git a/StRoot/StDaqLib/SC/SC_Reader.hh b/StRoot/StDaqLib/SC/SC_Reader.hh index a2fc99b2d16..780dffb45f3 100644 --- a/StRoot/StDaqLib/SC/SC_Reader.hh +++ b/StRoot/StDaqLib/SC/SC_Reader.hh @@ -16,6 +16,7 @@ public: int ZDCWestNoKiller(); int ZDCEastNoKiller(); int ZDCXNoKiller(); + int EPDX(); int Mult(); int L0(); int BBCX(); diff --git a/StRoot/StDetectorDbMaker/St_spaceChargeCorC.cxx b/StRoot/StDetectorDbMaker/St_spaceChargeCorC.cxx index 398c74f5d23..e561a1fd541 100644 --- a/StRoot/StDetectorDbMaker/St_spaceChargeCorC.cxx +++ b/StRoot/StDetectorDbMaker/St_spaceChargeCorC.cxx @@ -35,6 +35,7 @@ Double_t St_spaceChargeCorC::getSpaceChargeCoulombs(Double_t scaleFactor) case (13) : mult = scalers->getCTBOrTOFp(); break; // zdcx-no-killer as of 2011 case (14) : mult = scalers->getCTBEast(); break; // zdce-no-killer as of 2011 case (15) : mult = scalers->getCTBWest(); break; // zdcw-no-killer as of 2011 + case (16) : mult = scalers->getEPDX(); break; // EPD after March 2018 default : mult = 0.; } diff --git a/StRoot/StDetectorDbMaker/St_trigDetSumsC.h b/StRoot/StDetectorDbMaker/St_trigDetSumsC.h index 967739e5a45..74a223836d1 100644 --- a/StRoot/StDetectorDbMaker/St_trigDetSumsC.h +++ b/StRoot/StDetectorDbMaker/St_trigDetSumsC.h @@ -21,6 +21,7 @@ class St_trigDetSumsC : public TChair { Double_t ctbEast(Int_t i = 0) {return validity(Struct(i)->ctbEast);} Double_t ctbTOFp(Int_t i = 0) {return validity(Struct(i)->ctbTOFp);} Double_t tofp(Int_t i = 0) {return validity(Struct(i)->tofp);} + Double_t epdx(Int_t i = 0) {return validity(Struct(i)->tofp);} // re-use for EPD Double_t zdcWest(Int_t i = 0) {return validity(Struct(i)->zdcWest);} Double_t zdcEast(Int_t i = 0) {return validity(Struct(i)->zdcEast);} Double_t zdcX(Int_t i = 0) {return validity(Struct(i)->zdcX);} @@ -42,6 +43,7 @@ class St_trigDetSumsC : public TChair { Double_t getCTBEast() {return ctbEast();} Double_t getCTBOrTOFp() {return ctbTOFp();} Double_t getTOFp() {return tofp();} + Double_t getEPDX() {return epdx();} Double_t getZDCWest() {return zdcWest();} Double_t getZDCEast() {return zdcEast();} Double_t getZDCX() {return zdcX();} diff --git a/StRoot/StPass0CalibMaker/StSpaceChargeEbyEMaker.cxx b/StRoot/StPass0CalibMaker/StSpaceChargeEbyEMaker.cxx index 4719a2da08f..b877c743cce 100644 --- a/StRoot/StPass0CalibMaker/StSpaceChargeEbyEMaker.cxx +++ b/StRoot/StPass0CalibMaker/StSpaceChargeEbyEMaker.cxx @@ -684,7 +684,7 @@ Int_t StSpaceChargeEbyEMaker::Make() { if (doGaps) DetermineGaps(); if (doNtuple) { - static float X[123]; + static float X[124]; static float ntent = 0.0; static float nttrk = 0.0; @@ -771,6 +771,12 @@ Int_t StSpaceChargeEbyEMaker::Make() { X[44] = s0*X[44] + s1*St_trigDetSumsC::instance()->getCTBWest(); // ZDCWestNoKiller X[45] = s0*X[45] + s1*St_trigDetSumsC::instance()->getCTBEast(); // ZDCEastNoKiller + // EPD: + // Stored in rich scaler rs14 for 2018+ data, and available + // for the DAQ stream via otherwise empty TOFp member of + // trigDetSums starting with SL24b + X[123] = s0*X[123] + s1*St_trigDetSumsC::instance()->getEPDX(); + // StMagUtilities distortion correction parameters X[46] = s0*X[46] + s1*m_ExB->GetConst_0(); X[47] = s0*X[47] + s1*m_ExB->GetConst_1(); @@ -1036,7 +1042,7 @@ void StSpaceChargeEbyEMaker::InitQAHists() { } if (doNtuple) ntup = new TNtuple("SC","Space Charge", - "sc:dca:zdcx:zdcw:zdce:bbcx:bbcw:bbce:bbcbb:bbcyb:intb:inty:fill:mag:run:event:dcan:dcap:dcae:dcaw:gapf:gapi:gapd:gapfn:gapin:gapdn:gapfp:gapip:gapdp:gapfe:gapie:gapde:gapfw:gapiw:gapdw:usc:uscmode:ugl:zdcc:bbcc:vpdx:vpdw:vpde:zdcxnk:zdcwnk:zdcenk:const0:const1:sce:scw:usce:sc1:gapf1:gapi1:sc2:gapf2:gapi2:sc3:gapf3:gapi3:sc4:gapf4:gapi4:sc5:gapf5:gapi5:sc6:gapf6:gapi6:sc7:gapf7:gapi7:sc8:gapf8:gapi8:sc9:gapf9:gapi9:sc10:gapf10:gapi10:sc11:gapf11:gapi11:sc12:gapf12:gapi12:sc13:gapf13:gapi13:sc14:gapf14:gapi14:sc15:gapf15:gapi15:sc16:gapf16:gapi16:sc17:gapf17:gapi17:sc18:gapf18:gapi18:sc19:gapf19:gapi19:sc20:gapf20:gapi20:sc21:gapf21:gapi21:sc22:gapf22:gapi22:sc23:gapf23:gapi23:sc24:gapf24:gapi24"); + "sc:dca:zdcx:zdcw:zdce:bbcx:bbcw:bbce:bbcbb:bbcyb:intb:inty:fill:mag:run:event:dcan:dcap:dcae:dcaw:gapf:gapi:gapd:gapfn:gapin:gapdn:gapfp:gapip:gapdp:gapfe:gapie:gapde:gapfw:gapiw:gapdw:usc:uscmode:ugl:zdcc:bbcc:vpdx:vpdw:vpde:zdcxnk:zdcwnk:zdcenk:const0:const1:sce:scw:usce:sc1:gapf1:gapi1:sc2:gapf2:gapi2:sc3:gapf3:gapi3:sc4:gapf4:gapi4:sc5:gapf5:gapi5:sc6:gapf6:gapi6:sc7:gapf7:gapi7:sc8:gapf8:gapi8:sc9:gapf9:gapi9:sc10:gapf10:gapi10:sc11:gapf11:gapi11:sc12:gapf12:gapi12:sc13:gapf13:gapi13:sc14:gapf14:gapi14:sc15:gapf15:gapi15:sc16:gapf16:gapi16:sc17:gapf17:gapi17:sc18:gapf18:gapi18:sc19:gapf19:gapi19:sc20:gapf20:gapi20:sc21:gapf21:gapi21:sc22:gapf22:gapi22:sc23:gapf23:gapi23:sc24:gapf24:gapi24:epdx"); if (doGaps) { gapZhist = new TH2F("Gaps","Gaps",GZN,GZL,GZH,GN,GL,GH); From 15ad150c06dd0d77009becc7fc51cfa1cdaffdbe Mon Sep 17 00:00:00 2001 From: Daniel Brandenburg Date: Wed, 14 Aug 2024 10:37:32 -0400 Subject: [PATCH 05/19] Initial version from Amarise summer 2024 project (#697) Amarise Edge summer 2024 project creating a multi-2D view event viz for the FWD tracker and detectors. Initial version as presented on July 17th --- StRoot/StFwdTrackMaker/macro/viz.C | 598 +++++++++++++++++++++++++++++ 1 file changed, 598 insertions(+) create mode 100644 StRoot/StFwdTrackMaker/macro/viz.C diff --git a/StRoot/StFwdTrackMaker/macro/viz.C b/StRoot/StFwdTrackMaker/macro/viz.C new file mode 100644 index 00000000000..2768834e087 --- /dev/null +++ b/StRoot/StFwdTrackMaker/macro/viz.C @@ -0,0 +1,598 @@ +#include "TFile.h" +#include "TH1F.h" +#include "TH2F.h" +#include "TTree.h" + + +TFile * fData; +TTree * fwd; +TH2 * hFrame; +TCanvas *gCan; +TPad *padRZ, *padXY, *padStat; + +float LegendX, LegendY; +float lineScale = 1.5; + +enum ProjectionType { kXY, kRZ, kRZSigned, kXZ, kYZ }; + +float xx( float x, float y, float z, ProjectionType proj = kRZ ){ + + if ( proj == kRZ || proj == kRZSigned){ + return z;//(TMath::ATan2( y, x ) + 2*3.1415926 )/ (2*3.14159) * 360; + } else if ( proj == kXY ){ + return x; + } else if ( proj == kXZ ){ + return z; + } else if ( proj == kYZ ){ + return z; + } + + return x; +} + +float yy( float x, float y, float z, ProjectionType proj = kRZ ){ + + if ( proj == kRZ ){ + float r = sqrt( pow(x, 2) + pow(y, 2) ); + return r; + } else if ( proj == kXY ){ + return y; + } else if ( proj == kRZSigned ){ + float r = sqrt( pow(x, 2) + pow(y, 2) ); + if ( y == 0 ) return r; + r *= y / fabs(y); + return r; + } else if ( proj == kXZ ){ + return x; + } else if ( proj == kYZ ){ + return y; + } + + return y; +} + +void viz_points(const char* name, const char* cmd, int color, int eventIndex, ProjectionType projType, bool Legend = false ){ + + fwd->Draw( cmd, "", "goff", 1, eventIndex ); + int N = fwd->GetSelectedRows(); + printf( "%s : has %d results \n", cmd, N ); + printf( "Projection Mode : %d \n", projType ); + + auto cmdX = fwd->GetV1(); + auto cmdY = fwd->GetV2(); + auto cmdZ = fwd->GetV3(); + auto cmdE = fwd->GetV4(); + if ( cmdE != nullptr ){ + printf( "TOWERS\n" ); + } + float vizX; //change from array-AGE + float vizY; + + TText *t = new TText(.5,.5,"Hello World !"); + // t->SetTextAlign(22); + t->SetTextColor(kBlack); + t->SetTextFont(43); + t->SetTextSize(20); + + int zColorStep = 90; + int slc = color; + int zColors[50]; // fst1 fst2 fst3 ftt1 ftt2 ftt3 ftt4 epd ecal hcal + float zSizes[] = {2.5, 2.5, 2.0, 1.5, 1.5, 1.5, 1.5, 1.5, 2.5, 2.0, 1.5}; //first element is for hits that don't match any positions (only goes to ftt3--changing to allow all) + for ( int i = 0; i < 50; i++ ) + zColors[i] = TColor::GetColorPalette(i*zColorStep % 255 ); + + + bool lgZ = false; + float alpha = 0.6; + for ( int i = 0; i < N; i++ ){ + + vizX = xx( cmdX[i], cmdY[i], cmdZ[i], projType ); + vizY = yy( cmdX[i], cmdY[i], cmdZ[i], projType ); + printf( "\tpoint at (%f, %f, %f) -> (%f, %f)\n", cmdX[i], cmdY[i], cmdZ[i], vizX, vizY ); + + int zIndex = 0; + if ( fabs( cmdZ[i] - 151.75) < 2.5 ) zIndex = 1; + if ( fabs( cmdZ[i] - 165.25) < 2.5 ) zIndex = 2; + if ( fabs( cmdZ[i] - 178.75) < 2.5 ) zIndex = 3; + + //add locations of other detectors-AGE + //FTT--approximate locations + if ( fabs( cmdZ[i] - 281) < 2.5 ) zIndex = 4; + if ( fabs( cmdZ[i] - 304) < 2.5 ) zIndex = 5; + if ( fabs( cmdZ[i] - 325) < 2.5 ) zIndex = 6; + if ( fabs( cmdZ[i] - 348) < 2.5 ) zIndex = 7; + //EPD--approx. + if ( fabs( cmdZ[i] - 375) < 2.5 ) zIndex = 8; + //FCS--approx. + //if ( fabs( cmdZ[i] - 721) < 2.5 ) zIndex = 9; //wcal + //if ( fabs( cmdZ[i] - 804) < 2.5 ) zIndex = 10; //hcal + + TMarker *mk = new TMarker( vizX, vizY, 20 ); + + mk->SetMarkerSize( 2.5 ); + if (zIndex >= 1 && zIndex < 50){ //see if should be changed to zIndex < 9-AGE + slc = zColors[zIndex]; + } + mk->SetMarkerSize( zSizes[zIndex] ); + + + + + // mk->SetMarkerSize( (float)(zIndex) * 0.5 + 0.5 ); + + alpha = 0.6; + if ( zIndex != 8 && (cmdE != nullptr && projType == kRZSigned) ){ //FCS for RZ + //mk->SetMarkerStyle( 21 ); //sets marker to a square, change to use TBox instead-AGE + //mk->SetMarkerSize( 0.5 + 0.5 * cmdE[i] ); + mk->SetMarkerSize(0); + alpha = (cmdE[i] / 10.0); + if (alpha>=1) alpha = 1; + TBox *box = new TBox( vizX-0.05*cmdE[i], vizY-0.5, vizX, vizY+0.5 ); + box->SetFillColor(210); + if ( name == "WCal Clusters" || name == "HCal CLusters" ){ + box->SetFillColor(880); + mk->SetMarkerSize(1); + } + box->Draw("same"); + } + if ( name == "FTT Clusters" && projType == kXY ){ + mk->SetMarkerSize(0); + TLine XCluster; + XCluster.SetLineWidth(1); + XCluster.SetLineColor(9); //dark blue + TLine YCluster; + YCluster.SetLineWidth(1); + YCluster.SetLineColor(46); //dark red + float x0; + float x1; + float y0; + float y1; + if (vizX < 0){ + x0 = -50; + x1 = 0; + } else if(vizX >= 0){ + x0 = 0; + x1 = 50; + } + if (vizY < 0){ + y0 = -50; + y1 = 0; + } else if (vizY >= 0){ + y0 = 0; + y1 = 50; + } + + XCluster.DrawLine(vizX, y0, vizX, y1); + YCluster.DrawLine(x0, vizY, x1, vizY); + + } + + if ( cmdE != nullptr && (zIndex == 8 || projType != kRZSigned) ){ //EPD for RZ and EPD and FCS for XY + mk->SetMarkerStyle(21); + mk->SetMarkerSize( 0.005 * cmdE[i]); + } + + printf( "\tzIndex = %d -> color = %d \n", zIndex, slc ); + + mk->SetMarkerColorAlpha( slc, alpha ); + if ( zIndex >= 1 ){ + mk->SetMarkerColorAlpha( slc, alpha ); + lgZ = true; + } + + //change marker style etc. for projected points only-AGE + /*if( name == "Proj" ){ + mk->SetMarkerStyle(23); + mk->SetMarkerColor(2); + mk->SetMarkerSize(1.5); + }*/ + + mk->Draw("same"); + + } + + if ( lgZ ){ + /*for ( int i = 1; i < 4; i++){ + TMarker *mk1 = new TMarker( LegendX, LegendY, 20 ); + mk1->SetMarkerSize( 2.5 ); + mk1->SetMarkerColorAlpha( zColors[i], 0.5 ); + mk1->Draw("same"); + t->DrawText( LegendX + 2, LegendY - 0.5, TString::Format( "%s: %d", name, i ) ); + + LegendY -= 5; + }*/ + if (name == "FST"){ + for ( int i = 1; i < 4; i++ ){ + TMarker *mk1 = new TMarker( LegendX, LegendY, 20 ); + mk1->SetMarkerSize( 2.5 ); + mk1->SetMarkerColorAlpha( zColors[i], 0.5 ); + mk1->Draw("same"); + t->DrawText( LegendX + 2, LegendY - 0.5, TString::Format( "%s: %d", name, i ) ); + + LegendY -= 5; + } + } else if (name == "FTT"){ + for ( int i = 1; i < 5; i++ ){ + TMarker *mk1 = new TMarker( LegendX, LegendY, 20 ); + mk1->SetMarkerSize( 2.5 ); + mk1->SetMarkerColorAlpha( zColors[i+3], 0.5 ); + mk1->Draw("same"); + t->DrawText( LegendX + 2, LegendY - 0.5, TString::Format( "%s: %d", name, i ) ); + + LegendY -= 5; + } + } else if (name == "FCS"){ + for ( int i = 1; i < 3; i++ ){ + TMarker *mk1 = new TMarker( LegendX, LegendY, 20 ); + mk1->SetMarkerSize( 2.5 ); + mk1->SetMarkerColorAlpha( zColors[i], 0.5 ); + mk1->Draw("same"); + t->DrawText( LegendX + 2, LegendY - 0.5, TString::Format( "%s: %d", name, i ) ); + + LegendY -= 5; + } + } + + } else { + TMarker *mk1 = new TMarker( LegendX, LegendY, 20 ); + mk1->SetMarkerSize( 2.5 ); + mk1->SetMarkerColor( color ); + mk1->Draw("same"); + t->DrawText( LegendX + 2, LegendY - 0.5, TString::Format( "%s:", name ) ); + + LegendY -= 5; + } +} + +//add function for seed finding-AGE +void viz_seed( const char* name, const char* cmd, int eventIndex, ProjectionType projType = kRZSigned){ + + fwd->Draw( "reco.id", "", "goff", 1, eventIndex ); + int nTrks = fwd->GetSelectedRows(); + + TLine line; + line.SetLineWidth(2); + line.SetLineColor(1); + TLine proj; + for (int i = 0; i < nTrks; i++){ //loop over number of tracks + + fwd->Draw( TString::Format("reco[%d].projs.mXYZ.fX:reco[%d].projs.mXYZ.fY:reco[%d].projs.mXYZ.fZ", i, i, i), "", "goff", 1, eventIndex ); + auto nHits = fwd->GetSelectedRows(); + auto projX = fwd->GetV1(); + auto projY = fwd->GetV2(); + auto projZ = fwd->GetV3(); + /*std::vector projX; + std::vector projY; + std::vector projZ; + + for (int hit = 0; hit < nHits; ++hit) { + projX.push_back(fwd->GetV1()[hit]); + projY.push_back(fwd->GetV2()[hit]); + projZ.push_back(fwd->GetV3()[hit]); + }*/ + + //select only the seeds that have same track id as track number + fwd->Draw( cmd, TString::Format("seeds.trackId == %d", i), "goff", 1, eventIndex ); + //fwd->Draw( TString::Format("seeds[%d].pos.fX:seeds[%d].pos.fY:seeds[%d].pos.fZ", i, i, i), "", "goff", 1, eventIndex ); + int numSeeds = fwd->GetSelectedRows(); + auto newX = fwd->GetV1(); + auto newY = fwd->GetV2(); + auto newZ = fwd->GetV3(); + + for ( int j = 0; j < numSeeds - 1; j++){ + + float x0 = xx( newX[j], newY[j], newZ[j], projType ); + float y0 = yy( newX[j], newY[j], newZ[j], projType ); + float x1 = xx( newX[j+1], newY[j+1], newZ[j+1], projType ); + float y1 = yy( newX[j+1], newY[j+1], newZ[j+1], projType ); + + /*if ( fabs(x0 - projX[j+1]) <= 1 ){ + line.SetLineColor(1); + }*/ + + line.DrawLine(x0, y0, x1, y1); + } + + } +} + +//add function for track projection +void viz_proj( int eventIndex, ProjectionType projType = kRZSigned, bool markers = false ){ + + //get number of tracks + fwd->Draw( "reco.id", "", "goff", 1, eventIndex); //check if this is correct data to use to get nTrks + int nTrks = fwd->GetSelectedRows(); + + //create line for track + TLine trkproj; + trkproj.SetLineWidth(1.5); + trkproj.SetLineColor(24); //light green + + //loop over each track in the event + for ( int i = 0; i < nTrks; i++ ){ + + //get hits in i'th track + fwd->Draw( TString::Format("reco[%d].projs.mXYZ.fX:reco[%d].projs.mXYZ.fY:reco[%d].projs.mXYZ.fZ", i, i, i), "", "goff", 1, eventIndex ); + auto nHits = fwd->GetSelectedRows(); + auto projX = fwd->GetV1(); + auto projY = fwd->GetV2(); + auto projZ = fwd->GetV3(); + + + //loop over hits in each track + for ( int j = 0; j < nHits - 1; j++ ){ + + //assign the x and y positions of the track projection + float x0 = xx( projX[j], projY[j], projZ[j], projType ); + float y0 = yy( projX[j], projY[j], projZ[j], projType ); + float x1 = xx( projX[j+1], projY[j+1], projZ[j+1], projType ); + float y1 = yy( projX[j+1], projY[j+1], projZ[j+1], projType ); + + /*trkproj.SetLineColor(i+2); + if (i == 0 || i == 10 ){ + trkproj.SetLineColor(1); + }*/ + trkproj.DrawLine(x0, y0, x1, y1); + } + + //add markers + if (markers){ + for ( int j = 0; j < nHits; j++ ){ + + float x = xx( projX[j], projY[j], projZ[j], projType ); + float y = yy( projX[j], projY[j], projZ[j], projType ); + + TMarker *mk = new TMarker( x, y, 20); + mk->SetMarkerStyle(23); + mk->SetMarkerColor(2); + mk->SetMarkerSize(1.5); + + mk->Draw("same"); + } + } + } + if (markers){ + //add marker to the legend + TText *t = new TText(.5,.5,"Hello World !"); + t->SetTextColor(kBlack); + t->SetTextFont(43); + t->SetTextSize(20); + //make this more functional? + if ( projType == kRZSigned ){ + LegendY = 5; + } else if (projType == kXY ){ + LegendY = -15; + } + TMarker *mk1 = new TMarker( LegendX, LegendY, 23 ); + mk1->SetMarkerSize( 2.5 ); + mk1->SetMarkerColor( 2 ); + mk1->Draw("same"); + t->DrawText( LegendX + 2, LegendY - 0.5, TString::Format( "Projected Hits ") ); + } + +} //end of fn + + +//add function to compare lines +//float comp_lines() + + +float statTextY = 0.97; +void n() { statTextY -= 0.05; } +void viz_stats( int eventIndex ){ + statTextY = 0.97; + TText text; + text.SetTextFont(43); + text.SetTextSize(36); + + + /*fwd->Draw( "fstX:fstY:fstZ", "", "goff", 1, eventIndex ); + int numEpd = fwd->GetSelectedRows(); + fwd->Draw( "fttX:fttY:fttZ", "", "goff", 1, eventIndex ); + int numEpd = fwd->GetSelectedRows(); + fwd->Draw( "epdX:epdY:epdZ", "", "goff", 1, eventIndex ); + int numEpd = fwd->GetSelectedRows(); + fwd->Draw( "fcsX:fcsY:fcsZ", "", "goff", 1, eventIndex ); + int numEpd = fwd->GetSelectedRows();*/ + + fwd->Draw( "reco.id", "", "goff", 1, eventIndex ); + int numTracks = fwd->GetSelectedRows(); + fwd->Draw( "fst.pos.fX:fst.pos.fY:fst.pos.fZ", "", "goff", 1, eventIndex ); + int numFst = fwd->GetSelectedRows(); + fwd->Draw( "ftt.pos.fX:ftt.pos.fY:ftt.pos.fZ", "", "goff", 1, eventIndex ); + int numFtt = fwd->GetSelectedRows(); + //fwd->Draw( "EPD hits", "", "goff", 1, eventIndex ); + //int numEpd = fwd->GetSelectedRows(); + fwd->Draw( "wcalHits.starXYZ.fX:wcalHits.starXYZ.fY:wcalHits.starXYZ.fZ", "", "goff", 1, eventIndex ); + int numWcalHits = fwd->GetSelectedRows(); + fwd->Draw( "hcalHits.starXYZ.fX:hcalHits.starXYZ.fY:hcalHits.starXYZ.fZ", "", "goff", 1, eventIndex ); + int numHcalHits = fwd->GetSelectedRows(); + fwd->Draw( "wcalClusters.pos.fX:wcalClusters.pos.fY:wcalClusters.pos.fZ", "", "goff", 1, eventIndex ); + int numWcal = fwd->GetSelectedRows(); + fwd->Draw( "hcalClusters.pos.fX:hcalClusters.pos.fY:hcalClusters.pos.fZ", "", "goff", 1, eventIndex ); + int numHcal = fwd->GetSelectedRows(); + + text.DrawTextNDC( 0.05, statTextY, TString::Format("Event : %d", eventIndex) ); n(); + text.DrawTextNDC( 0.05, statTextY, TString::Format("Tracks : %d", numTracks) ); n(); + text.DrawTextNDC( 0.05, statTextY, TString::Format("FST Hits : %d", numFst) ); n(); + text.DrawTextNDC( 0.05, statTextY, TString::Format("FTT Hits : %d", numFtt) ); n(); + //text.DrawTextNDC( 0.05, statTextY, TString::Format("EPD Hits : %d", numEpd) ); n(); + //text.DrawTextNDC( 0.05, statTextY, TString::Format("WCal Hits : %d", numWcalHits) ); n(); + //text.DrawTextNDC( 0.05, statTextY, TString::Format("HCal Hits : %d", numHcalHits) ); n(); + text.DrawTextNDC( 0.05, statTextY, TString::Format("WCal Clusters : %d", numWcal) ); n(); + text.DrawTextNDC( 0.05, statTextY, TString::Format("HCal Clusters : %d", numHcal) ); n(); + + //print reco statistics + /*fwd->Draw( "reco.reco.projs.mXYZ:fX:reco.reco.projs.mXYZ:fY:reco.reco.projs.mXYZ:fZ", "", "goff", 1, eventIndex ); + int numReco = fwd->GetSelectedRows(); + statTextY = 0.92; + text.DrawTextNDC( 0.35, statTextY, TString::Format("Reco Hits : %d", numReco) ); n();*/ + +} + + +int viz_event( int eventIndex, ProjectionType projType = kRZSigned ){ + + if ( projType == kRZSigned || projType == kXZ || projType == kYZ ){ + hFrame = new TH2F( "hFrame", ";z;R", 520, -30, 900, 260, -130, 130 ); + hFrame->SetTitle( "Event Visualization (RZ Signed)" ); + LegendX = 10; + LegendY = 60; + } else if ( projType == kRZ ){ + hFrame = new TH2F( "hFrame", ";z;R", 500, 0, 900, 60, 0, 60 ); + hFrame->SetTitle( "Event Visualization (RZ Signed)" ); + LegendX = 10; + LegendY = 60; + } else if ( projType == kXY ){ + hFrame = new TH2F( "hFrame", ";x;y", 5, -50, 50, 5, -50, 50 ); + hFrame->SetTitle( "Event Visualization (XY)" ); + LegendX = -40; + LegendY = 40; + } + + printf( "Visualizing Event %d \n", eventIndex ); + + fwd->Draw( "reco.id", "", "", 1, eventIndex ); + int nTrk = fwd->GetSelectedRows(); //number of reco tracks + printf( "Event has %d Tracks \n", nTrk ); //changed from %lld to %d to eliminate an error that occurred-AGE + + + hFrame->Draw("colz"); + + //add detector locations + if (projType == kRZSigned){ + + TLine *fst1 = new TLine(151.75, -28.3, 151.75, 28.3); + fst1->SetLineWidth(2); + fst1->SetLineColor(12); + fst1->Draw("same"); + TLine *fst2 = new TLine(165.25, -28.3, 165.25, 28.3); + fst2->SetLineWidth(2); + fst2->SetLineColor(12); + fst2->Draw("same"); + TLine *fst3 = new TLine(178.75, -28.3, 178.75, 28.3); + fst3->SetLineWidth(2); + fst3->SetLineColor(12); + fst3->Draw("same"); + + TLine *ftt1 = new TLine(281, -60, 281, 60); + ftt1->SetLineWidth(2); + ftt1->SetLineColor(12); + ftt1->Draw("same"); + TLine *ftt2 = new TLine(304, -60, 304, 60); + ftt2->SetLineWidth(2); + ftt2->SetLineColor(12); + ftt2->Draw("same"); + TLine *ftt3 = new TLine(325, -60, 325, 60); + ftt3->SetLineWidth(2); + ftt3->SetLineColor(12); + ftt3->Draw("same"); + TLine *ftt4 = new TLine(348, -60, 348, 60); + ftt4->SetLineWidth(2); + ftt4->SetLineColor(12); + ftt4->Draw("same"); + + TLine *epd = new TLine(375, -130, 375, 130); + epd->SetLineWidth(2); + epd->SetLineColor(12); + epd->Draw("same"); + + //add tboxes for fcs + TBox *wcal = new TBox( 720, -120, 735, 120 ); + wcal->SetFillColorAlpha(4, 0.2); + wcal->Draw("same"); + TBox *hcal = new TBox( 800, -120, 815, 120 ); + hcal->SetFillColorAlpha(2, 0.2); + hcal->Draw("same"); + + } + + //viz_points( "FST", "fstX:fstY:fstZ", kGray, eventIndex, projType/*, true*/ ); + //viz_points( "EPD", "epdX:epdY:epdZ:epdE", kBlue, eventIndex, projType/*, true*/ ); //epd hits (only in fwdtree2)-AGE + //viz_points( "FCS", "fcsX:fcsY:fcsZ:fcsE", kGreen, eventIndex, projType/*, true*/ ); + viz_points( "FST", "fst.pos.fX:fst.pos.fY:fst.pos.fZ", kGray, eventIndex, projType, true ); + viz_points( "FTT", "ftt.pos.fX:ftt.pos.fY:ftt.pos.fZ", kRed, eventIndex, projType ); + viz_points( "FTT Clusters", "fttClusters.pos.fX:fttClusters.pos.fY:fttClusters.pos.fZ", kRed, eventIndex, projType ); + viz_points( "WCal Hits", "wcalHits.starXYZ.fX:wcalHits.starXYZ.fY:wcalHits.starXYZ.fZ+705:100*wcalHits.energy", kBlue, eventIndex, projType ); + viz_points( "HCal Hits", "hcalHits.starXYZ.fX:hcalHits.starXYZ.fY:hcalHits.starXYZ.fZ+785:100*wcalClusters.mEnergy", kTeal, eventIndex, projType/*, true*/ ); + viz_points( "WCal Clusters", "wcalClusters.pos.fX:wcalClusters.pos.fY:wcalClusters.pos.fZ+705:100*wcalClusters.mEnergy", kViolet, eventIndex, projType/*, true*/ ); + viz_points( "HCal Clusters", "hcalClusters.pos.fX:hcalClusters.pos.fY:hcalClusters.pos.fZ+785:100*wcalClusters.mEnergy", kGreen, eventIndex, projType/*, true*/ ); //add fcs hits-AGE + + viz_seed( "Seeds", "seeds.pos.fX:seeds.pos.fY:seeds.pos.fZ", eventIndex, projType ); + //viz_proj( eventIndex, projType, false); + //viz_points( "Proj", "reco.reco.projs.mXYZ.fX:reco.reco.projs.mXYZ.fY:reco.reco.projs.mXYZ.fZ", kRed, eventIndex, projType); + return nTrk; +} + + +//change to name of file being used-AGE +void viz( TString fn = "fwdtree5.root", int view = kXY) { + + ProjectionType pjt = (ProjectionType)view; + fData = new TFile( fn ); + fwd = (TTree*)fData->Get( "fwd" ); + + gStyle->SetOptStat(0); + + float canWidth = 19 * 100; + float canHeight = 16 * 100; + gCan = new TCanvas( "g", "", canWidth, canHeight ); + gCan->SetMargin( 0, 0, 0, 0); + gCan->cd(); + gCan->Draw(); + + padRZ = new TPad( "padRZ", "", 0.0, 0.5, 0.95, 0.99 ); + padRZ->SetMargin( .05,.01,.05,.01 ); + padRZ->Draw("same"); + padRZ->cd(); + + gCan->cd(); + padXY = new TPad( "padXY", "", 0.0, 0.0, 0.5, 0.5 ); + padXY->SetMargin( .1,.02,.05,.01 ); + padXY->Draw("same"); + padXY->cd(); + + gCan->cd(); + padStat = new TPad( "padStat", "", 0.5, 0.0, 1.0, 0.5 ); + padStat->SetMargin( .1,.02,.05,.01 ); + padStat->Draw("same"); + padStat->cd(); + + // gPad->SetMargin(0.1, 0.05, 0.15, 0.05); + + int nEvents = fwd->GetEntries(); + // nEvents = 1; + for ( int iEvent = 0; iEvent < nEvents; iEvent ++ ){ + + printf( "Event: %d\n", iEvent ); + padRZ->cd(); + + //TBox *wcal = new TBox( 720, -60, 735, 60 ); + //wcal->SetFillColor(4); + //wcal->Draw(""); + int nTrk = viz_event( iEvent, kRZSigned ); + + + padXY->cd(); + viz_event( iEvent, kXY ); + if (nTrk > -1){ + padRZ->Update(); + padXY->Update(); + + padStat->cd(); + padStat->Clear(); + viz_stats( iEvent ); //changed to provide number of tracks as well-AGE + padStat->Update(); + gCan->Update(); + gCan->Print( TString::Format( "out_event%d.pdf", iEvent ) ); + } + + + // cin.get(); + // if (viz_event( iEvent ) > 0 ) + // break; + + hFrame->Reset(); + } + +} \ No newline at end of file From f0d3492adfbb8daba95890f4213337837f52485e Mon Sep 17 00:00:00 2001 From: Daniel Brandenburg Date: Wed, 14 Aug 2024 10:38:29 -0400 Subject: [PATCH 06/19] Update StMuMcTrack with num hits to FWD detectors (#696) Update to StMuMcTrack based on members in g2t_track - specifically add the missing access to number of hits from FWD detectors (and etof, etc.) --- StRoot/StMuDSTMaker/COMMON/StMuMcTrack.cxx | 8 ++++++++ StRoot/StMuDSTMaker/COMMON/StMuMcTrack.h | 16 +++++++++++++--- StRoot/StPicoEvent/StPicoMcTrack.h | 19 ++++++++++++++++++- 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/StRoot/StMuDSTMaker/COMMON/StMuMcTrack.cxx b/StRoot/StMuDSTMaker/COMMON/StMuMcTrack.cxx index 9d2d02e0ca0..d28b138e998 100644 --- a/StRoot/StMuDSTMaker/COMMON/StMuMcTrack.cxx +++ b/StRoot/StMuDSTMaker/COMMON/StMuMcTrack.cxx @@ -30,6 +30,14 @@ StMuMcTrack::StMuMcTrack(const g2t_track_st &t) : TObject(), mGePid(t.ge_pid), m mHits[ktof] = 0xff & t.n_tof_hit; /* Nhits in tof */ mHits[ktpc] = 0xff & t.n_tpc_hit; /* Nhits in tpc */ mHits[kvpd] = 0xff & t.n_vpd_hit; /* Nhits in vpd */ + mHits[ketr] = 0xff & t.n_etr_hit; /* Nhits in etr */ + mHits[khca] = 0xff & t.n_hca_hit; /* Nhits in hca */ + mHits[kfts] = 0xff & t.n_fts_hit; /* Nhits in fts */ + mHits[keto] = 0xff & t.n_eto_hit; /* Nhits in eto */ + mHits[kstg] = 0xff & t.n_stg_hit; /* Nhits in stg */ + mHits[kwca] = 0xff & t.n_wca_hit; /* Nhits in wca */ + mHits[kpre] = 0xff & t.n_pre_hit; /* Nhits in pre */ + mHits[kepd] = 0xff & t.n_epd_hit; /* Nhits in epd */ assert(t.pt<0 || mPxyz.perp()>1e-6); diff --git a/StRoot/StMuDSTMaker/COMMON/StMuMcTrack.h b/StRoot/StMuDSTMaker/COMMON/StMuMcTrack.h index 09d8dbb2760..a7ca8e76604 100644 --- a/StRoot/StMuDSTMaker/COMMON/StMuMcTrack.h +++ b/StRoot/StMuDSTMaker/COMMON/StMuMcTrack.h @@ -7,7 +7,9 @@ class StMuMcTrack : public TObject { public: enum EHIT {ktpc, ksvt, kssd, kctb, keem, kemc, kesm, kftp, kgem, khpd, kist, kigt, kfst, - kfgt, kfpd, kmwc, kpgc, kpmd, ksmd, kpix, ktof, kvpd, ktot}; + kfgt, kfpd, kmwc, kpgc, kpmd, ksmd, kpix, ktof, kvpd, + ketr, khca, kfts, keto, kstg, kwca, kpre, kepd, + ktot}; StMuMcTrack(const g2t_track_st &t); #if 0 StMuMcTrack(const g2t_track_st &t) : TObject(), mGePid(t.ge_pid), mId(t.id), mIsShower(t.is_shower), mItrmdVertex(t.itrmd_vertex_p), @@ -65,7 +67,15 @@ class StMuMcTrack : public TObject { UChar_t No_pix_hit() const {return NoHits(kpix);} /* Nhits in pix */ UChar_t No_tof_hit() const {return NoHits(ktof);} /* Nhits in tof */ UChar_t No_tpc_hit() const {return NoHits(ktpc);} /* Nhits in tpc */ - UChar_t No_vpd_hit() const {return NoHits(kvpd);} /* Nhits in vpd */ + UChar_t No_vpd_hit() const {return NoHits(kvpd);} /* Nhits in vpd */ + UChar_t No_etr_hit() const {return NoHits(ketr);} /* Nhits in etr */ + UChar_t No_hca_hit() const {return NoHits(khca);} /* Nhits in hca */ + UChar_t No_fts_hit() const {return NoHits(kfts);} /* Nhits in fts (fst) */ + UChar_t No_eto_hit() const {return NoHits(keto);} /* Nhits in eto */ + UChar_t No_stg_hit() const {return NoHits(kstg);} /* Nhits in stgc (ftt) */ + UChar_t No_wca_hit() const {return NoHits(kwca);} /* Nhits in wca */ + UChar_t No_pre_hit() const {return NoHits(kpre);} /* Nhits in pre */ + UChar_t No_epd_hit() const {return NoHits(kepd);} /* Nhits in epd */ Int_t ItrmdVertex() const {return mItrmdVertex;} /* First intermediate vertex */ Int_t IdVx () const {return mIdVx; } /* Id of start vertex of track */ Int_t IdVxEnd () const {return mIdVxEnd; } /* Id of stop vertex of this track */ @@ -94,7 +104,7 @@ class StMuMcTrack : public TObject { Float_t mpT; /* Transverse momentum */ Float_t mPtot; /* Total momentum */ Float_t mRapidity; /* Rapidity */ - ClassDef(StMuMcTrack,1) + ClassDef(StMuMcTrack,2) }; ostream& operator<<(ostream& os, StMuMcTrack const & v); #endif diff --git a/StRoot/StPicoEvent/StPicoMcTrack.h b/StRoot/StPicoEvent/StPicoMcTrack.h index f97a04cb60b..c79c9ffd7ad 100644 --- a/StRoot/StPicoEvent/StPicoMcTrack.h +++ b/StRoot/StPicoEvent/StPicoMcTrack.h @@ -46,7 +46,8 @@ class StPicoMcTrack : public TObject { enum EHIT {ktpc, ksvt, kssd, kctb, keem, kemc, kesm, kftp, kgem, khpd, kist, kigt, kfst, kfgt, kfpd, kmwc, kpgc, kpmd, ksmd, kpix, ktof, - kvpd, ktot}; + kvpd, ketr, khca, kfts, keto, kstg, kwca, + kpre, kepd, ktot}; // // Getters @@ -131,6 +132,22 @@ class StPicoMcTrack : public TObject { UChar_t nHitsTpc() const { return mHits[ktpc]; } /// Return number of hits in VPD UChar_t nHitsVpd() const { return mHits[kvpd]; } + /// Return number of hits in ETR + UChar_t nHitsEtr() const { return mHits[ketr]; } + /// Return number of hits in HCA + UChar_t nHitsHca() const { return mHits[khca]; } + /// Return number of hits in FTS + UChar_t nHitsFts() const { return mHits[kfts]; } + /// Return number of hits in ETO + UChar_t nHitsEto() const { return mHits[keto]; } + /// Return number of hits in STG + UChar_t nHitsStg() const { return mHits[kstg]; } + /// Return number of hits in WCA + UChar_t nHitsWca() const { return mHits[kwca]; } + /// Return number of hits in PRE + UChar_t nHitsPre() const { return mHits[kpre]; } + /// Return number of hits in EPD + UChar_t nHitsEpd() const { return mHits[kepd]; } /// Return particle names (GEANT ID according to GPART) const Char_t *geName(); /// Return corrected GePid (to take embedding into account) From d993d8e70481ea28b0307eea3dc8315f0cb40c3f Mon Sep 17 00:00:00 2001 From: Daniel Brandenburg Date: Wed, 14 Aug 2024 10:38:55 -0400 Subject: [PATCH 07/19] Update StEvent structs for StFttPoint StFttCluster and update StFttFastSimMaker (#698) 1. Updates StEvent containers for Ftt data (clusters and points) to include idTruth (mirror FST and FCS) 2. Update StFttFastSimMaker to copy Ftt GEANT hits to StFttCollection as StFttPoints The Fast sim just copies GEANT hits from front modules and writes them into the StFttCollection as StFttPoints (skips the entire reco chain). The "slow" sim (still WIP) will write clusters and therefore idTruth is needed there. Removed old code based on square modules (RnD geometry) and different strip layout. This also simplifies the Fwd tracking because it no longer needs to read directly from GEANT --- StRoot/StEvent/StFttCluster.h | 5 +- StRoot/StEvent/StFttPoint.h | 6 +- StRoot/StFttSimMaker/StFttFastSimMaker.cxx | 432 ++------------------- StRoot/StFttSimMaker/StFttFastSimMaker.h | 96 +---- 4 files changed, 53 insertions(+), 486 deletions(-) diff --git a/StRoot/StEvent/StFttCluster.h b/StRoot/StEvent/StFttCluster.h index 4b1b8ce6515..d478c798f32 100644 --- a/StRoot/StEvent/StFttCluster.h +++ b/StRoot/StEvent/StFttCluster.h @@ -27,6 +27,7 @@ class StFttCluster : public StObject { 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 void setId(int cluid); void setPlane(UChar_t plane); @@ -37,6 +38,7 @@ class StFttCluster : public StObject { void setSumAdc(int theSumAdc); void setX(float x0); void setSigma(float sigma); + void setIdTruth(UShort_t id) { mIdTruth = id; } StPtrVecFttRawHit& rawHits(); const StPtrVecFttRawHit& rawHits() const; @@ -62,8 +64,9 @@ class StFttCluster : public StObject { StPtrVecFttRawHit mRawHits; // Tower hits of the current cluster StPtrVecFttCluster mNeighbors; // Neighbor clusters StPtrVecFttPoint mPoints; // Fitted points (photons) in the cluster + UShort_t mIdTruth=0; // Truth ID - ClassDef(StFttCluster, 2) + ClassDef(StFttCluster, 3) }; std::ostream& operator << ( std::ostream&, const StFttCluster& clu ); // Printing operator diff --git a/StRoot/StEvent/StFttPoint.h b/StRoot/StEvent/StFttPoint.h index 71bcbd8cd79..bab29a1971f 100644 --- a/StRoot/StEvent/StFttPoint.h +++ b/StRoot/StEvent/StFttPoint.h @@ -31,6 +31,7 @@ class StFttPoint : public StObject { int 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 void setPlane(UChar_t plane); void setQuadrant(UChar_t quad); @@ -38,7 +39,7 @@ class StFttPoint : public StObject { void setY(float y); void addCluster(StFttCluster* cluster, UChar_t dir); void setXYZ(const StThreeVectorD& p3); - + void setIdTruth(UShort_t id) { mIdTruth = id; } void print(int option=0); @@ -49,8 +50,9 @@ class StFttPoint : public StObject { Float_t mY=0.0; // y-position in local coordinate StFttCluster *mClusters[4]; StThreeVectorD mXYZ; // Photon position in STAR coordinate + UShort_t mIdTruth=0; // Truth ID - ClassDef(StFttPoint, 1) + ClassDef(StFttPoint, 2) }; inline UChar_t StFttPoint::plane() const { return mPlane; } diff --git a/StRoot/StFttSimMaker/StFttFastSimMaker.cxx b/StRoot/StFttSimMaker/StFttFastSimMaker.cxx index da9b723f741..607a0333cfd 100644 --- a/StRoot/StFttSimMaker/StFttFastSimMaker.cxx +++ b/StRoot/StFttSimMaker/StFttFastSimMaker.cxx @@ -4,46 +4,19 @@ #include "StEvent/StEvent.h" #include "St_base/StMessMgr.h" -#include "StEvent/StRnDHit.h" -#include "StEvent/StRnDHitCollection.h" #include "StThreeVectorF.hh" -#include "TCanvas.h" -#include "TCernLib.h" -#include "TH2F.h" -#include "TLine.h" -#include "TString.h" -#include "TVector3.h" #include "tables/St_g2t_fts_hit_Table.h" -#include "tables/St_g2t_track_Table.h" -#include +#include "StEvent/StFttCollection.h" +#include "StEvent/StFttPoint.h" #include "StarGenerator/UTIL/StarRandom.h" -namespace FttGlobal { - const bool verbose = false; -} StFttFastSimMaker::StFttFastSimMaker(const Char_t *name) - : StMaker{name}, - hGlobalYX(0), - hOctantYX(0), - hOctantWireYX(0), - hOctantStripYX(0), - hWireDeltasX(0), - hWireDeltasY(0), - hStripDeltasX(0), - hStripDeltasY(0), - hWirePullsX(0), - hWirePullsY(0), - hStripPullsX(0), - hStripPullsY(0), - hPointsPullsX(0), - hPointsPullsY(0) {} + : StMaker{name} {} int StFttFastSimMaker::Init() { - iEvent = 0; - return StMaker::Init(); } @@ -58,373 +31,46 @@ Int_t StFttFastSimMaker::Make() { LOG_DEBUG << "Creating StEvent" << endm; } - if (0 == event->rndHitCollection()) { - event->setRnDHitCollection(new StRnDHitCollection()); - LOG_DEBUG << "Creating StRnDHitCollection for FTS" << endm; - } - - FillThinGapChambers(event); - iEvent++; - - return kStOk; -} - -/** - * Maps a global hit to a local coordinate system for a given quadrant - * The quadrants are numbered clockwise as: - * 0 1 - * 3 2 - * Does NOT support rotations. Maybe added later if we need to - * The coordinate system is x positive to the right and y positive up (top coords are greater than bottom coords) - */ -void StFttFastSimMaker::GlobalToLocal(float x, float y, int disk, int &quad, float &localX, float &localY) { - // quad RECT - float qr = -1; - float ql = -1; - float qb = -1; - float qt = -1; - - QuadBottomLeft(disk, 0, qb, ql); - qr = ql + STGC_QUAD_WIDTH; - qt = qb + STGC_QUAD_HEIGHT; - if (x >= ql && x < qr && y >= qb && y < qt) { - quad = 0; - localX = x - ql; - localY = y - qb; - } - - QuadBottomLeft(disk, 1, qb, ql); - qr = ql + STGC_QUAD_WIDTH; - qt = qb + STGC_QUAD_HEIGHT; - if (x >= ql && x < qr && y >= qb && y < qt) { - quad = 1; - localX = x - ql; - localY = y - qb; + if ( event->fttCollection() == nullptr ){ + LOG_INFO << "Creating FttCollection" << endm; + StFttCollection *fttcollection = new StFttCollection(); + event->setFttCollection(fttcollection); } - QuadBottomLeft(disk, 2, qb, ql); - qr = ql + STGC_QUAD_WIDTH; - qt = qb + STGC_QUAD_HEIGHT; - if (x >= ql && x < qr && y >= qb && y < qt) { - quad = 2; - localX = x - ql; - localY = y - qb; - } - QuadBottomLeft(disk, 3, qb, ql); - qr = ql + STGC_QUAD_WIDTH; - qt = qb + STGC_QUAD_HEIGHT; - if (x >= ql && x < qr && y >= qb && y < qt) { - quad = 3; - localX = x - ql; - localY = y - qb; - } - - return; -} - -float StFttFastSimMaker::DiskOffset(int disk) { - assert(disk >= 9 && disk <= 12); - if (disk == 9) - return 10; - if (disk == 10) - return 11; - if (disk == 11) - return 12; - if (disk == 12) - return 13; - return 10; -} - -float StFttFastSimMaker::DiskRotation(int disk) { - assert(disk >= 9 && disk <= 12); - // these are - if (disk == 9) - return this->sTGC_disk9_theta; - if (disk == 10) - return this->sTGC_disk10_theta; - if (disk == 11) - return this->sTGC_disk11_theta; - if (disk == 12) - return this->sTGC_disk12_theta; - return 0; -} - -void StFttFastSimMaker::QuadBottomLeft(int disk, int quad, float &bottom, float &left) { - float hbp = DiskOffset(disk); - if ( FttGlobal::verbose ) {LOG_INFO << "disk: " << disk << ", offset = " << hbp << endm;} - - // quad 0 RECT - float q0l = hbp - STGC_QUAD_WIDTH; - float q0b = hbp; - - float q1l = hbp; - float q1b = -hbp; - float q2l = -hbp; - float q2b = -hbp - STGC_QUAD_HEIGHT; - - float q3l = -hbp - STGC_QUAD_WIDTH; - float q3b = hbp - STGC_QUAD_HEIGHT; - - if (0 == quad) { - bottom = q0b; - left = q0l; - } - if (1 == quad) { - bottom = q1b; - left = q1l; + St_g2t_fts_hit *g2t_stg_hits = (St_g2t_fts_hit *)GetDataSet("geant/g2t_stg_hit"); + // size_t numFwdHitsPrior = mFwdHitsFtt.size(); + if (!g2t_stg_hits){ + LOG_WARN << "geant/g2t_stg_hit is empty" << endm; + return kStOk; } - if (2 == quad) { - bottom = q2b; - left = q2l; - } - if (3 == quad) { - bottom = q3b; - left = q3l; - } - return; -} - -/** - * Map a local coordinate back to global coords - */ -void StFttFastSimMaker::LocalToGlobal(float localX, float localY, int disk, int quad, float &globalX, float &globalY) { - // quad RECT - float qb = -1; - float ql = -1; - QuadBottomLeft(disk, quad, qb, ql); - - globalX = localX + ql; - globalY = localY + qb; - return; -} - -/** - * Checks if a vertical (face=0) and horizontal (face=1) wires are overlapping - * used for determining if ghost hits can be created from the overlapped wires - * - */ -bool StFttFastSimMaker::Overlaps(StRnDHit *hitA, StRnDHit *hitB) { - // require that they are in the same disk! - if (hitA->layer() != hitB->layer()) - return false; - int disk = hitA->layer(); - // require that they are in the same quadrant of the detector - if (hitA->wafer() != hitB->wafer()) - return false; - int quad = hitA->wafer(); - - float x1 = hitA->double2(); - float y1 = hitA->double3(); - float x2 = hitB->double2(); - float y2 = hitB->double3(); - - float b = -1, l = -1; - QuadBottomLeft(disk, quad, b, l); - - float lx1 = x1 - l; - float ly1 = y1 - b; - float lx2 = x2 - l; - float ly2 = y2 - b; - - int chunkx1 = lx1 / STGC_WIRE_LENGTH; - int chunky1 = ly1 / STGC_WIRE_LENGTH; - - int chunkx2 = lx2 / STGC_WIRE_LENGTH; - int chunky2 = ly2 / STGC_WIRE_LENGTH; - - if (chunkx1 != chunkx2) - return false; - if (chunky1 != chunky2) - return false; - return true; -} - -void StFttFastSimMaker::FillThinGapChambers(StEvent *event) { - // Read the g2t table - St_g2t_fts_hit *hitTable = static_cast(GetDataSet("g2t_stg_hit")); - if (!hitTable) { - LOG_INFO << "g2t_stg_hit table is empty" << endm; - return; - } // if !hitTable - - StRnDHitCollection *ftscollection = event->rndHitCollection(); - - std::vector hits; - - // Prepare to loop over all hits - const int nhits = hitTable->GetNRows(); - const g2t_fts_hit_st *hit = hitTable->GetTable(); - - StarRandom &rand = StarRandom::Instance(); - float dx = STGC_SIGMA_X; - float dy = STGC_SIGMA_Y; - float dz = STGC_SIGMA_Z; - - int nSTGCHits = 0; - sTGCNRealPoints = 0; - sTGCNGhostPoints = 0; - - for (int i = 0; i < nhits; i++) { - hit = (g2t_fts_hit_st *)hitTable->At(i); - if (0 == hit) + const double sigXY = 0.01; + int nstg = g2t_stg_hits->GetNRows(); + LOG_DEBUG << "This event has " << nstg << " stg hits in geant/g2t_stg_hit " << endm; + for (int i = 0; i < nstg; i++) { + g2t_fts_hit_st *git = (g2t_fts_hit_st *)g2t_stg_hits->At(i); + if (0 == git) + continue; // geant hit + int track_id = git->track_p; + int volume_id = git->volume_id; + int plane_id = (volume_id - 1) / 100; // from 1 - 16. four chambers per station + + // only use the hits on the front modules + if ( volume_id % 2 ==0 ) continue; - float xhit = hit->x[0]; - float yhit = hit->x[1]; - float zhit = hit->x[2]; - int volume_id = hit->volume_id; - // volume_id = (1 front | 2 back) + 10 * (quadrant 0-3) + 100 * (station 0-4) - int disk = ((volume_id - 1) / 100) + 9 ; - LOG_DEBUG << "sTGC hit: volume_id = " << volume_id << " disk = " << disk << endm; + float x = git->x[0] + gRandom->Gaus(0, sigXY); // 100 micron blur according to approx sTGC reso + float y = git->x[1] + gRandom->Gaus(0, sigXY); // 100 micron blur according to approx sTGC reso + float z = git->x[2]; - // Now that geometry has a front and back, we skip points on the back module for fast sim - if (disk < 9 || volume_id % 2 == 0) - continue; - - float theta = DiskRotation(disk); - - float x_blurred = xhit + rand.gauss( STGC_SIGMA_X); - float y_blurred = yhit + rand.gauss( STGC_SIGMA_Y); - - float x_rot = -999, y_rot = -999; - this->rot(-theta, x_blurred, y_blurred, x_rot, y_rot); - - int quad = -1; - float localX = -999, localY = -999; - GlobalToLocal(x_rot, y_rot, disk, quad, localX, localY); - - // not in the active region - if (quad < 0 || quad > 3) - continue; - nSTGCHits++; - - StRnDHit *ahit = new StRnDHit(); - - ahit->setPosition({x_blurred, y_blurred, zhit}); - ahit->setPositionError({dx, dy, 0.1}); - - ahit->setDouble0(xhit); - ahit->setDouble1(yhit); - ahit->setDouble2(x_rot); - ahit->setDouble3(y_rot); - - ahit->setLayer(disk); // disk mapped to layer - ahit->setLadder(2); // indicates a point - ahit->setWafer(quad); // quadrant number - - ahit->setIdTruth(hit->track_p, 0); - ahit->setDetectorId(kFtsId); // TODO: use dedicated ID for Ftt when StEvent is updated - - float Ematrix[] = { - dx * dx, 0.f, 0.f, - 0.f, dy * dy, 0.f, - 0.f, 0, 0.f, dz * dz}; - - ahit->setErrorMatrix(Ematrix); - hits.push_back(ahit); - - if (!STGC_MAKE_GHOST_HITS) { - // Make this "REAL" hit. - if (FttGlobal::verbose){ - ahit->Print(); - } - ftscollection->addHit(ahit); - sTGCNRealPoints++; - } - } - - if (STGC_MAKE_GHOST_HITS) { - for (auto &hit0 : hits) { // first loop on hits - float hit0_x = hit0->double2(); - float hit0_y = hit0->double3(); - int disk0 = hit0->layer(); - int quad0 = hit0->wafer(); - float theta = DiskRotation(disk0); - - for (auto &hit1 : hits) { // second loop on hits - float hit1_x = hit1->double2(); - float hit1_y = hit1->double3(); - int disk1 = hit1->layer(); - int quad1 = hit1->wafer(); - - if (disk0 != disk1) - continue; - if (quad0 != quad1) - continue; - - // check on overlapping segments - if (false == Overlaps(hit0, hit1)) - continue; - - float x = hit0_x; - float y = hit1_y; - - int qaTruth = 0; - int idTruth = 0; - if (hit1_x == hit0_x && hit1_y == hit0_y) { - sTGCNRealPoints++; - qaTruth = 1; - idTruth = hit0->idTruth(); - } else { - sTGCNGhostPoints++; - qaTruth = 0; - } - - float rx = -999, ry = -999; - this->rot(theta, x, y, rx, ry); - // the trick here is that rotations (in 2D) will commute - // so the earlier -theta rotation and this +theta - // rotation cancel for real hits - // but not so for ghost hits - - StRnDHit *ahit = new StRnDHit(); - - ahit->setPosition({rx, ry, hit0->position().z()}); - ahit->setPositionError({dx, dy, 0.1}); - - ahit->setDouble0(hit0_x); - ahit->setDouble1(hit0_y); - ahit->setDouble2(hit1_x); - ahit->setDouble3(hit1_y); - - ahit->setLayer(disk0); // disk mapped to layer - ahit->setLadder(2); // indicates a point - ahit->setWafer(quad0); // quadrant number - - ahit->setIdTruth(idTruth, qaTruth); - ahit->setDetectorId(kFtsId); // TODO: use dedicated ID for Ftt when StEvent is updated - - float Ematrix[] = { - dx * dx, 0.f, 0.f, - 0.f, dy * dy, 0.f, - 0.f, 0, 0.f, dz * dz}; - ahit->setErrorMatrix(Ematrix); - ftscollection->addHit(ahit); - - } // loop hit1 - } // loop hit0 - - - // in this case the hits used in the original array were not saved, but copied so we need to delete them - - for ( size_t i = 0; i < hits.size(); i++ ){ - delete hits[i]; - hits[i] = nullptr; - } - } // make Ghost Hits - - if (FttGlobal::verbose) { - LOG_INFO << "nHits (all FTS) = " << nhits << endm; - } - if (FttGlobal::verbose) { - LOG_INFO << "nSTGC = " << nSTGCHits << endm; - } - if (FttGlobal::verbose) { - LOG_INFO << "nReal = " << sTGCNRealPoints << endm; - } - if (FttGlobal::verbose) { - LOG_INFO << "nGhost = " << sTGCNGhostPoints << endm; - } - -} // fillThinGap + StFttPoint *point = new StFttPoint(); + point->setPlane(plane_id); + point->setQuadrant(0); // TODO this could be improved, but it is not used in the current implementation + StThreeVectorD xyz; + xyz.set(x, y, z); + point->setXYZ( xyz ); + point->setIdTruth( track_id ); + event->fttCollection()->addPoint(point); + } // loop on hits + return kStOk; +} diff --git a/StRoot/StFttSimMaker/StFttFastSimMaker.h b/StRoot/StFttSimMaker/StFttFastSimMaker.h index 5a5fe10a7d4..7b10bfc9ccd 100644 --- a/StRoot/StFttSimMaker/StFttFastSimMaker.h +++ b/StRoot/StFttSimMaker/StFttFastSimMaker.h @@ -1,10 +1,6 @@ -#ifndef ST_FTT_FAST_SIM_MAKER_H -#define ST_FTT_FAST_SIM_MAKER_H - -class g2t_emc_hit_st; -class StFtsHit; -class StEvent; +#ifndef ST_FTT_FASTER_SIM_MAKER_H +#define ST_FTT_FASTER_SIM_MAKER_H #include "StChain/StMaker.h" #include @@ -14,99 +10,19 @@ class StEvent; #include "TH2F.h" #include "TNtuple.h" -class StRnDHit; class StFttFastSimMaker : public StMaker { public: - explicit StFttFastSimMaker(const Char_t *name = "fttSim"); - virtual ~StFttFastSimMaker() {} + StFttFastSimMaker(const Char_t *name = "fttSim"); + ~StFttFastSimMaker() {} Int_t Make(); int Init(); int Finish() { return kStOk; } - virtual const char *GetCVS() const; - - void SetDiskRotation(int disk, float degrees) { - - const float deg_to_radians = 0.017453292f; // = 3.1415926 / 180.0; - if (9 == disk) - sTGC_disk9_theta = degrees * deg_to_radians; - else if (10 == disk) - sTGC_disk10_theta = degrees * deg_to_radians; - else if (11 == disk) - sTGC_disk11_theta = degrees * deg_to_radians; - else if (12 == disk) - sTGC_disk12_theta = degrees * deg_to_radians; - return; - } - - private: - void FillThinGapChambers(StEvent *event); - - int iEvent; - - TH2F *hGlobalYX; - TH2F *hOctantYX; - - TH2F *hOctantWireYX; - TH2F *hOctantStripYX; - - TH2F *hWireDeltasX; - TH2F *hWireDeltasY; - TH2F *hStripDeltasX; - TH2F *hStripDeltasY; - - TH2F *hWirePullsX; - TH2F *hWirePullsY; - TH2F *hStripPullsX; - TH2F *hStripPullsY; - - TH2F *hPointsPullsX; - TH2F *hPointsPullsY; - - //table to keep pointer to hit for each disc, r & phi strips - - // convert x, y to quandrant and local X, Y - // quadrants are - // 0 1 - // 3 2 - void GlobalToLocal(float x, float y, int disk, int &quad, float &localX, float &localY); - void LocalToGlobal(float localX, float localY, int disk, int quad, float &globalX, float &globalY); - bool Overlaps(StRnDHit *hitA, StRnDHit *hitB); - void QuadBottomLeft(int disk, int quad, float &bottom, float &left); - float DiskOffset(int disk); - float DiskRotation(int disk); - - void rot(float theta, float x, float y, float &xp, float &yp) { - xp = x * cos(theta) - y * sin(theta); - yp = x * sin(theta) + y * cos(theta); - } - - const double STGC_BEAM_CUT_OUT = 6.0; // cm - const double STGC_QUAD_WIDTH = 60.0; // cm - const double STGC_QUAD_HEIGHT = 60.0; // cm - const double STGC_WIRE_WIDTH = 0.32; // cm - const double STGC_SIGMA_X = 0.01; // 100 microns - const double STGC_SIGMA_Y = 0.01; // 100 microns - const double STGC_SIGMA_Z = 0.001; // 10 microns - const double STGC_WIRE_LENGTH = 15.0; // cm - const bool STGC_MAKE_GHOST_HITS = true; //should be moved to run-time opt - - float sTGC_disk9_theta = 0.0f; - float sTGC_disk10_theta = 0.0f; - float sTGC_disk11_theta = 0.0f; - float sTGC_disk12_theta = 0.0f; - - int sTGCNRealPoints = 0; - int sTGCNGhostPoints = 0; - ClassDef(StFttFastSimMaker, 0) + ClassDef(StFttFastSimMaker, 0); }; -inline const char *StFttFastSimMaker::GetCVS() const { - static const char cvs[] = "Tag $Name: $ $Id: StFttFastSimMaker.h,v 1.1 2021/03/26 14:11:40 jdb Exp $ built " __DATE__ " " __TIME__; - return cvs; -} -#endif +#endif \ No newline at end of file From bb541ed45f3b1e4aef3c0a63920f45dfa25810c7 Mon Sep 17 00:00:00 2001 From: Gene Van Buren <85305093+genevb@users.noreply.github.com> Date: Fri, 16 Aug 2024 22:52:56 -0400 Subject: [PATCH 08/19] Look for local StEvent enumerations first (#705) Even though STAR is winding down, there is still some development work ongoing involving FWD detectors. I believe the parsing of StEnumerations.h within StEnumerations.cxx may be making it a little difficult for them because it does not currently allow for a local (developmental) version of enumerations. This PR modified that with a local search first, and hopefully that helps them out. Note that the parsing is done at run-time, so even with this patch, test jobs need to have not just the compiled code where the job runs, they need also have a local StRoot/StEvent/StEnumerations.h present where the job runs. p.s. I meant to include @dkapukchyan as a reviewer, but it seems he doesn't show up as someone I can add. --- StRoot/StEvent/StEnumerations.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/StRoot/StEvent/StEnumerations.cxx b/StRoot/StEvent/StEnumerations.cxx index 74d04716286..c79c958910c 100644 --- a/StRoot/StEvent/StEnumerations.cxx +++ b/StRoot/StEvent/StEnumerations.cxx @@ -19,11 +19,15 @@ void detectorId(int *ids=0, char** cds=0) memset(ids,0,sizeof(ids[0])*100); memset(cds,0,sizeof(cds[0])*100); - TString myPath("$STAR/StRoot/StEvent/StEnumerations.h"); - gSystem->ExpandPathName(myPath); - + // Look for local enumerations (when developing) before global + TString myPath("./StRoot/StEvent/StEnumerations.h"); int notExi = gSystem->AccessPathName(myPath.Data(),kFileExists); - if (notExi) { ids[0]=-1; return;} + if (notExi) { + myPath = "$STAR/StRoot/StEvent/StEnumerations.h"; + gSystem->ExpandPathName(myPath); + notExi = gSystem->AccessPathName(myPath.Data(),kFileExists); + if (notExi) { ids[0]=-1; return;} + } FILE *fp = fopen(myPath.Data(),"r"); if (!fp) { ids[0]=-1; return;} char buf[400]; From 6ceac9b54a9850a6d33eb32c94e042a95efae3b3 Mon Sep 17 00:00:00 2001 From: Yuri Fisyak Date: Thu, 22 Aug 2024 07:33:53 -0400 Subject: [PATCH 09/19] Eliminte HitFilt from production chains aas obsolete (#709) By Frank request create a separate request for eliminate obsolete option HitFilt from production chains. --- StRoot/StBFChain/BigFullChain.h | 184 ++++++++++++++++---------------- 1 file changed, 93 insertions(+), 91 deletions(-) diff --git a/StRoot/StBFChain/BigFullChain.h b/StRoot/StBFChain/BigFullChain.h index edcbc8babfa..e467550a794 100644 --- a/StRoot/StBFChain/BigFullChain.h +++ b/StRoot/StBFChain/BigFullChain.h @@ -61,10 +61,10 @@ Bfc_st BFC[] = { // standard chains {"Geometry ","-----------","-----------","------------------------------------------","","","",kFALSE}, {"------------","-----------","-----------","------------------------------------------","","","",kFALSE}, #ifdef __AgMLonFly__ - {"ideal", "", "","", "", "", "Ideal Alignment", kFALSE}, - {"misalign", "", "","", "","-AgMLideal", "Misaligned Geometry", kFALSE}, - {"AgMLutil", "", "","", "","StarAgmlUtil", "AgML support", kFALSE}, - {"AgMLlib", "", "","", "","StarAgmlUtil,StarAgmlLib", "AgML support", kFALSE}, + {"ideal", "", "","", "", "", "Ideal Alignment", kFALSE}, + {"misalign", "", "","", "","-AgMLideal", "Misaligned Geometry", kFALSE}, + {"AgMLutil", "", "","", "","StarAgmlUtil", "AgML support", kFALSE}, + {"AgMLlib", "", "","", "","StarAgmlUtil,StarAgmlLib", "AgML support", kFALSE}, {"AgML" ,"" ,"","AgMLlib,-Agi,-VmcGeo","","Geometry,StarGeometry" , "Alias VmcGeometry to AgiLGeometry",kFALSE}, #else /* __AgMLonFly__ */ @@ -100,7 +100,7 @@ Bfc_st BFC[] = { // standard chains {"Test.default.StiVMC","","","TpcRS,Simu,sss,svt,ssd,fss,bbcSim,IdTruth,MakeEvent," "miniMcMk,McAna,Test.reco.StiVMC,CMuDst" ,"","","",kFALSE}, {"Test.StiVMC","","","TpcRS,StiVMC,event,analysis,tags,EvOut,StarMagField,FieldOn,Idst,CMuDst" - , "","","",kFALSE}, + , "","","",kFALSE}, {"Test.VeryFast.StiVMC","","","TpcFastSim,Simu,sfs,ssdfast,McEvOut,GeantOut,IdTruth,miniMcMk,McAna," "SvtCL,tpc_T,globT,tls,db,tpcDB,svtDb,svtIT,ssdIT,StiVMC,Idst,event,analysis,EventQA,tags," "EvOut,StarMagField,FieldOn,IAna,CMuDst" ,"","","",kFALSE}, @@ -213,9 +213,9 @@ Bfc_st BFC[] = { // standard chains , "","","",kFALSE}, {"RC.pp.y2005" ,"","","pp2005a,tofdat,OSpaceZ2,OGridLeak3D" ,"","","",kFALSE}, {"RC.pp.y2006" ,"","","pp2006b,OSpaceZ2,OGridLeak3D" ,"","","",kFALSE}, - {"RC.y2007" ,"","","DbV20080418,B2007g,IAna,KeepSvtHit,hitfilt,VFMinuit3,emcDY2,ftpc,trgd," + {"RC.y2007" ,"","","DbV20080418,B2007g,IAna,VFMinuit3,emcDY2,ftpc,trgd," "ZDCvtx,svtIT,ssdIT,Corr4,OSpaceZ2,OGridLeak3D" ,"","","",kFALSE}, - {"RC.y2007.NoSvt" ,"","","DbV20080418,B2007g,IAna,KeepSvtHit,hitfilt,VFMinuit3,emcDY2,ftpc," + {"RC.y2007.NoSvt" ,"","","DbV20080418,B2007g,IAna,VFMinuit3,emcDY2,ftpc," "trgd,ZDCvtx,Corr4,OSpaceZ2,OGridLeak3D" ,"","","",kFALSE}, {"RC.y2008" ,"","","DbV20080712,P2008,OSpaceZ2,OGridLeak3D,beamLine" ,"","","",kFALSE}, {"RC.y2008.notof" ,"","","DbV20080712,P2008,-ToF,-tofDat,-tofrMatch,-tofpMatch,-tofCalib,OSpaceZ2," @@ -231,37 +231,37 @@ Bfc_st BFC[] = { // standard chains , "","","",kFALSE}, {"RC.y2010" ,"","","P2010a,BEmcChkStat,btof,Corr4,OSpaceZ2,OGridLeak3D,pmdReco", "","","",kFALSE}, {"RC.y2010.notof" ,"","","P2010a,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D" ,"","","",kFALSE}, - {"RC.pp.y2011.VFPPV","","","pp2011a,VFPPVnoCTB,beamline,BEmcChkStat,btof,Corr4,OSpaceZ2,OGridLeak3D," - "-hitfilt" ,"","","",kFALSE}, - {"RC.pp.y2011","","","pp2011a,VFMinuit,beamline,BEmcChkStat,btof,Corr4,OSpaceZ2,OGridLeak3D,-hitfilt" + {"RC.pp.y2011.VFPPV","","","pp2011a,VFPPVnoCTB,beamline,BEmcChkStat,btof,Corr4,OSpaceZ2,OGridLeak3D" + , "","","",kFALSE}, + {"RC.pp.y2011","","","pp2011a,VFMinuit,beamline,BEmcChkStat,btof,Corr4,OSpaceZ2,OGridLeak3D" , "","","",kFALSE}, - {"RC.y2011" ,"","","P2011a,BEmcChkStat,btof,Corr4,OSpaceZ2,OGridLeak3D,-hitfilt,pmdReco,mtdDat" + {"RC.y2011" ,"","","P2011a,BEmcChkStat,btof,Corr4,OSpaceZ2,OGridLeak3D,pmdReco,mtdDat" , "","","",kFALSE}, - {"RC.y2011.notof" ,"","","P2011a,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D,-hitfilt,pmdReco,mtdDat" + {"RC.y2011.notof" ,"","","P2011a,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D,pmdReco,mtdDat" , "","","",kFALSE}, - {"RC.y2012" ,"","","P2012a,BEmcChkStat,btof,Corr4,OSpaceZ2,OGridLeak3D,-hitfilt,mtdDat,fmsDat" + {"RC.y2012" ,"","","P2012a,BEmcChkStat,btof,Corr4,OSpaceZ2,OGridLeak3D,mtdDat,fmsDat" , "","","",kFALSE}, - {"RC.y2012.notof" ,"","","P2012a,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D,-hitfilt", "","","",kFALSE}, + {"RC.y2012.notof" ,"","","P2012a,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D", "","","",kFALSE}, {"RC.pp.y2012" ,"","","pp2012a,VFPPVnoCTB,beamline,BEmcChkStat,btof,Corr4,OSpaceZ2,OGridLeak3D," - "-hitfilt,mtdDat,fmsDat", "","","",kFALSE}, + "mtdDat,fmsDat", "","","",kFALSE}, {"RC.pp.y2012.notof","","","pp2012a,VFPPVnoCTB,beamline,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D," - "-hitfilt", "","","",kFALSE}, + "", "","","",kFALSE}, {"RC.pp.y2012.notofMin","","","pp2012a,VFMinuit,beamline,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D" - ",-hitfilt", "","","",kFALSE}, - {"RC.y2012b" ,"","","P2012b,BEmcChkStat,btof,Corr4,OSpaceZ2,OGridLeak3D,-hitfilt,mtdDat,fmsDat" + "", "","","",kFALSE}, + {"RC.y2012b" ,"","","P2012b,BEmcChkStat,btof,Corr4,OSpaceZ2,OGridLeak3D,mtdDat,fmsDat" , "","","",kFALSE}, - {"RC.y2012b.notof" ,"","","P2012b,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D,-hitfilt", "","","",kFALSE}, + {"RC.y2012b.notof" ,"","","P2012b,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D", "","","",kFALSE}, {"RC.pp.y2012b" ,"","","pp2012b,VFPPVnoCTB,beamline,BEmcChkStat,btof,Corr4,OSpaceZ2,OGridLeak3D," - "-hitfilt,mtdDat,fmsDat", "","","",kFALSE}, + "mtdDat,fmsDat", "","","",kFALSE}, {"RC.pp.y2012b.notof","","","pp2012b,VFPPVnoCTB,beamline,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D" - ",-hitfilt", "","","",kFALSE}, + "", "","","",kFALSE}, {"RC.pp.y2012b.notofMin","","","pp2012b,VFMinuit,beamline,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D" - ",-hitfilt", "","","",kFALSE}, + "", "","","",kFALSE}, {"RC.pp.y2012b.notofMin","","","pp2012b,VFMinuit,beamline,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D" - ",-hitfilt", "","","",kFALSE}, + "", "","","",kFALSE}, {"RC.pp.y2013","","","pp2013a,mtd,btof,fmsDat,fgt,fgtPoint,VFPPVnoCTB,beamline,BEmcChkStat,Corr4," - "OSpaceZ2,OGridLeak3D,-hitfilt", "","","",kFALSE}, - {"RC.y2014","","","P2014a,mtd,btof,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D,-hitfilt", "","","",kFALSE}, + "OSpaceZ2,OGridLeak3D", "","","",kFALSE}, + {"RC.y2014","","","P2014a,mtd,btof,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D", "","","",kFALSE}, {"MC nightlies and Eval","--","-----------","------------------------------------------","","","",kFALSE}, {"test_MC.stan.y2000","","","MC.y2000,Sti,fzin,MiniMcMk","","" @@ -743,18 +743,18 @@ Bfc_st BFC[] = { // standard chains {"B2007g","","","ry2007g,MakeEvent,in,tpc_daq,tpcI,fcf,svt_daq,SvtD,ssddat,sptd,Idst,tags,Tree,evout" , "","","Base chain for 2007 ITTF geo g (tpc+svt+ssd)",kFALSE}, {"P2007" ,"" ,"", - "B2007,IAna,KeepSvtHit,hitfilt,VFMinuit,emcDY2,ftpc,trgd,ZDCvtx,svtIT,ssdIT,Corr5" + "B2007,IAna,VFMinuit,emcDY2,ftpc,trgd,ZDCvtx,svtIT,ssdIT,Corr5" , "","","Production chain for 2007 data (+ l3, tof, ftpc, e/b-emc, trgd)",kFALSE}, {"P2007g" ,"" ,"", // chain was set in 2008 to account for missing material - "B2007g,IAna,KeepSvtHit,hitfilt,VFMinuit2,emcDY2,ftpc,trgd,ZDCvtx,svtIT,ssdIT,Corr5" + "B2007g,IAna,VFMinuit2,emcDY2,ftpc,trgd,ZDCvtx,svtIT,ssdIT,Corr5" , "","","Production chain for 2007 data, revised 2008 (+ l3, tof, ftpc, e/b-emc, trgd)",kFALSE}, // startup for calib {"P2007a" ,"" ,"", - "B2007,IAna,KeepSvtHit,hitfilt,VFMinuit,emcDY2,ftpc,trgd,ZDCvtx,svtIT,ssdIT,Corr3" + "B2007,IAna,VFMinuit,emcDY2,ftpc,trgd,ZDCvtx,svtIT,ssdIT,Corr3" , "","","Production chain for 2007 data Corr3 (+ l3, tof, ftpc, e/b-emc, trgd)",kFALSE}, {"P2007b" ,"" ,"", - "B2007,IAna,KeepSvtHit,hitfilt,VFMinuit,emcDY2,ftpc,trgd,ZDCvtx,svtIT,ssdIT,Corr4" + "B2007,IAna,VFMinuit,emcDY2,ftpc,trgd,ZDCvtx,svtIT,ssdIT,Corr4" , "","","Production chain for 2007 data Corr4 (+ l3, tof, ftpc, e/b-emc, trgd)",kFALSE}, {"B2008" ,"","","ry2008,in,tpc_daq,tpcI,fcf,Idst,tags,Tree,evout","","" , "Base chain for 2008 ITTF (tpc)",kFALSE}, @@ -762,27 +762,27 @@ Bfc_st BFC[] = { // standard chains , "Base chain for 2008 ITTF (tpc+tof)",kFALSE}, // startup for calib {"P2008a" ,"" ,"", - "B2008,IAna,hitfilt,VFMinuit,emcDY2,ftpc,trgd,ZDCvtx,NosvtIT,NossdIT,Corr3,analysis" + "B2008,IAna,VFMinuit,emcDY2,ftpc,trgd,ZDCvtx,NosvtIT,NossdIT,Corr3,analysis" , "","","Production chain for 2008 data Corr3 (+ l3, tof, ftpc, e/b-emc, trgd)",kFALSE}, {"P2008b" ,"" ,"", - "B2008,IAna,hitfilt,VFMinuit,emcDY2,ftpc,trgd,ZDCvtx,NosvtIT,NossdIT,Corr4,analysis" + "B2008,IAna,VFMinuit,emcDY2,ftpc,trgd,ZDCvtx,NosvtIT,NossdIT,Corr4,analysis" , "","","Production chain for 2008 data Corr4 (+ l3, tof, ftpc, e/b-emc, trgd)",kFALSE}, // or VFPPVnoCTB {"pp2008a" ,"" ,"", - "B2008,IAna,hitfilt,ppOpt,VFMinuit,emcDY2,ftpc,trgd,ZDCvtx,NosvtIT,NossdIT,Corr4,analysis" + "B2008,IAna,ppOpt,VFMinuit,emcDY2,ftpc,trgd,ZDCvtx,NosvtIT,NossdIT,Corr4,analysis" , "","","Production chain for 2008 data Corr3 (+ l3, tof, ftpc, e/b-emc, trgd)",kFALSE}, {"P2008c" ,"" ,"", // ATTENTION: the below chain was used for preliminary results on low energy - "B2008,IAna,hitfilt,VFMinuit,emcDY2,ftpc,trgd,ZDCvtx,NosvtIT,NossdIT,Corr4,analysis" + "B2008,IAna,VFMinuit,emcDY2,ftpc,trgd,ZDCvtx,NosvtIT,NossdIT,Corr4,analysis" , "","","Production chain for 2008 data (+ l3, tof, ftpc, e/b-emc, trgd)",kFALSE}, {"pp2008c" ,"" ,"", // Note: this chain was not used and may be removed - "B2008,IAna,hitfilt,ppOpt,Minuit,emcDY2,ftpc,trgd,ZDCvtx,NosvtIT,NossdIT,Corr4,analysis" + "B2008,IAna,ppOpt,Minuit,emcDY2,ftpc,trgd,ZDCvtx,NosvtIT,NossdIT,Corr4,analysis" , "","","Production chain for 2008 data Corr4 (+ l3, tof, ftpc, e/b-emc, trgd)",kFALSE}, // convergence chains {"pp2008" ,"" ,"", // VFPPV was chosen for p+p as final production chain - "B2008a,IAna,hitfilt,ppOpt,VFPPV,emcDY2,ftpc,trgd,ZDCvtx,NosvtIT,NossdIT,Corr4,analysis" + "B2008a,IAna,ppOpt,VFPPV,emcDY2,ftpc,trgd,ZDCvtx,NosvtIT,NossdIT,Corr4,analysis" , "","","Production chain for 2008 data Corr3 (+ l3, tof, ftpc, e/b-emc, trgd)",kFALSE}, {"P2008" ,"" ,"", // this one is final and official production ready, June 2008 - "B2008a,IAna,hitfilt,VFMinuit,emcDY2,ftpc,trgd,ZDCvtx,NosvtIT,NossdIT,Corr4,analysis" + "B2008a,IAna,VFMinuit,emcDY2,ftpc,trgd,ZDCvtx,NosvtIT,NossdIT,Corr4,analysis" , "","","Production chain for 2008 data (+ l3, tof, ftpc, e/b-emc, trgd)",kFALSE}, // @@ -797,16 +797,16 @@ Bfc_st BFC[] = { // standard chains , "Base chain for 2009 ITTF (tpc)",kFALSE}, {"pp2009a" ,"" ,"", - "B2009.1,IAna,hitfilt,ppOpt,VFMinuit,emcDY2,ftpc,trgd,ZDCvtx,NosvtIT,NossdIT,analysis" + "B2009.1,IAna,ppOpt,VFMinuit,emcDY2,ftpc,trgd,ZDCvtx,NosvtIT,NossdIT,analysis" , "","","Production chain for 2009 data - no Corr (+ l3, ftpc, e/b-emc, trgd)",kFALSE}, {"pp2009b" ,"" ,"", - "B2009.1,IAna,hitfilt,ppOpt,VFMinuit,emcDY2,ftpc,ZDCvtx,NosvtIT,NossdIT,analysis" + "B2009.1,IAna,ppOpt,VFMinuit,emcDY2,ftpc,ZDCvtx,NosvtIT,NossdIT,analysis" , "","","Production chain for 2009 data - no Corr (+ l3, ftpc, e/b-emc, no trigger)",kFALSE}, {"pp2009c" ,"" ,"", - "B2009.2,BAna,hitfilt,ppOpt,emcDY2,ftpc,trgd,ZDCvtx,NosvtIT,NossdIT,analysis","","" + "B2009.2,BAna,ppOpt,emcDY2,ftpc,trgd,ZDCvtx,NosvtIT,NossdIT,analysis","","" , "Production chain for 2009 data - no Corr, no VF (+l3, ftpc, e/b-emc, trig)",kFALSE}, {"pp2009d" ,"" ,"", - "B2009.3,BAna,hitfilt,ppOpt,emcDY2,ftpc,trgd,ZDCvtx,NosvtIT,NossdIT,analysis","","" + "B2009.3,BAna,ppOpt,emcDY2,ftpc,trgd,ZDCvtx,NosvtIT,NossdIT,analysis","","" , "Production chain for 2009 data - no Corr, no VF (+l3, ftpc, e/b-emc, trig)",kFALSE}, @@ -816,17 +816,17 @@ Bfc_st BFC[] = { // standard chains {"B2010c","","","ry2010c,in,tpcX,ITTF,tpcDB,TpcHitMover,Idst,tags,Tree,evout","","" , "Base chain for 2010 ITTF (tpc)",kFALSE}, - {"P2010a","" ,"", // initial chain - Add some to all of BEmcChkStat,QAalltrigs,trgd,btof,Corr3,-hitfilt - "B2010,BAna,hitfilt,VFMinuit,emcDY2,ftpc,trgd,ZDCvtx,NosvtIT,NossdIT,analysis" + {"P2010a","" ,"", // initial chain - Add some to all of BEmcChkStat,QAalltrigs,trgd,btof,Corr3 + "B2010,BAna,VFMinuit,emcDY2,ftpc,trgd,ZDCvtx,NosvtIT,NossdIT,analysis" , "","","Production chain for 2010 data - no Corr (+ l3, ftpc, e/b-emc)",kFALSE}, - {"pp2010a","" ,"", // initial chain - Add some to all of BEmcChkStat,QAalltrigs,trgd,btof,Corr3,-hitfilt,VFPPVnoCTB - "B2010,BAna,hitfilt,ppOpt,emcDY2,trgd,ftpc,ZDCvtx,NosvtIT,NossdIT,analysis" + {"pp2010a","" ,"", // initial chain - Add some to all of BEmcChkStat,QAalltrigs,trgd,btof,Corr3,VFPPVnoCTB + "B2010,BAna,ppOpt,emcDY2,trgd,ftpc,ZDCvtx,NosvtIT,NossdIT,analysis" , "","","Production chain for 2010 data - no Corr (+ l3, ftpc, e/b-emc, no VF)",kFALSE}, {"P2010c","" ,"", // use of y2010c geometry - "B2010c,BAna,hitfilt,VFMinuit,emcDY2,ftpc,trgd,ZDCvtx,NosvtIT,NossdIT,analysis" + "B2010c,BAna,VFMinuit,emcDY2,ftpc,trgd,ZDCvtx,NosvtIT,NossdIT,analysis" , "","","Production chain for 2010 data - no Corr (+ l3, ftpc, e/b-emc)",kFALSE}, {"pp2010c","" ,"", // use of y2010c geometry - "B2010c,BAna,hitfilt,ppOpt,emcDY2,trgd,ftpc,ZDCvtx,NosvtIT,NossdIT,analysis" + "B2010c,BAna,ppOpt,emcDY2,trgd,ftpc,ZDCvtx,NosvtIT,NossdIT,analysis" , "","","Production chain for 2010 data - no Corr (+ l3, ftpc, e/b-emc, no VF)",kFALSE}, @@ -834,31 +834,31 @@ Bfc_st BFC[] = { // standard chains {"B2011","","","ry2011,in,tpcX,ITTF,tpcDB,TpcHitMover,Idst,tags,Tree,evout","","" , "Base chain for 2011 ITTF (tpc)",kFALSE}, - {"P2011a","" ,"", // initial chain - Add some to all of BEmcChkStat,QAalltrigs,trgd,btof,Corr3,-hitfilt - "B2011,BAna,hitfilt,VFMinuit,emcDY2,ftpc,trgd,ZDCvtx,NosvtIT,NossdIT,analysis" + {"P2011a","" ,"", // initial chain - Add some to all of BEmcChkStat,QAalltrigs,trgd,btof,Corr3 + "B2011,BAna,VFMinuit,emcDY2,ftpc,trgd,ZDCvtx,NosvtIT,NossdIT,analysis" , "","","Production chain for 2011 data - no Corr (+ l3, ftpc, e/b-emc)",kFALSE}, - {"pp2011a","" ,"", // initial chain - Add some to all of BEmcChkStat,QAalltrigs,btof,Corr3,-hitfilt,VFPPVnoCTB - "B2011,BAna,hitfilt,ppOpt,emcDY2,trgd,ftpc,ZDCvtx,NosvtIT,NossdIT,analysis" + {"pp2011a","" ,"", // initial chain - Add some to all of BEmcChkStat,QAalltrigs,btof,Corr3,VFPPVnoCTB + "B2011,BAna,ppOpt,emcDY2,trgd,ftpc,ZDCvtx,NosvtIT,NossdIT,analysis" , "","","Production chain for 2011 data - no Corr (+ l3, ftpc, e/b-emc, no VF)",kFALSE}, // chains for year 12 {"B2012","","","ry2012,in,tpcX,ITTF,tpcDB,TpcHitMover,Idst,tags,Tree,evout","","" , "Base chain for 2012 ITTF (tpc)",kFALSE}, - {"pp2012a","" ,"","B2012,BAna,hitfilt,ppOpt,emcDY2,trgd,ZDCvtx,NosvtIT,NossdIT,analysis" + {"pp2012a","" ,"","B2012,BAna,ppOpt,emcDY2,trgd,ZDCvtx,NosvtIT,NossdIT,analysis" , "","", "Production chain for 2012 data - no Corr (+ l3, e/b-emc, no VF)",kFALSE}, {"P2012a","" ,"", - "B2012,BAna,hitfilt,VFMinuit,emcDY2,trgd,ZDCvtx,NosvtIT,NossdIT,analysis" + "B2012,BAna,VFMinuit,emcDY2,trgd,ZDCvtx,NosvtIT,NossdIT,analysis" , "","","Production chain for 2011 data - no Corr (+ l3, e/b-emc)",kFALSE}, {"B2012b","","","ry2012a,in,tpcX,ITTF,tpcDB,TpcHitMover,Idst,tags,Tree,evout","","" , "Base chain for 2012 ITTF (tpc)",kFALSE}, {"pp2012b","" ,"", - "B2012b,BAna,hitfilt,ppOpt,emcDY2,trgd,ZDCvtx,NosvtIT,NossdIT,analysis" + "B2012b,BAna,ppOpt,emcDY2,trgd,ZDCvtx,NosvtIT,NossdIT,analysis" , "","", "Production chain for 2012 data - no Corr (+ l3, e/b-emc, no VF)",kFALSE}, {"P2012b","" ,"", - "B2012b,BAna,hitfilt,VFMinuit,emcDY2,trgd,ZDCvtx,NosvtIT,NossdIT,analysis" + "B2012b,BAna,VFMinuit,emcDY2,trgd,ZDCvtx,NosvtIT,NossdIT,analysis" , "","","Production chain for 2011 data - no Corr (+ l3, e/b-emc)",kFALSE}, // Year 13 chains {"B2013","","","in,tpcX,UseXgeom,ITTF,NosvtIT,NossdIT,tpcDB,TpcHitMover,Idst,tags,Tree,evout," @@ -873,15 +873,15 @@ Bfc_st BFC[] = { // standard chains , "Base chain for 2013 ITTF (tpc)",kFALSE}, {"pp2013a","" ,"", - "B2013_c2,ITTF,UseXgeom,BAna,hitfilt,ppOpt,emcDY2,trgd,ZDCvtx,NosvtIT,NossdIT,analysis", + "B2013_c2,ITTF,UseXgeom,BAna,ppOpt,emcDY2,trgd,ZDCvtx,NosvtIT,NossdIT,analysis", "","", "Production chain for 2013 data - no Corr (+ l3, e/b-emc, no VF)",kFALSE}, {"pp2013b","" ,"", - "B2013_c1,ITTF,UseXgeom,BAna,hitfilt,ppOpt,emcDY2,trgd,ZDCvtx,NosvtIT,NossdIT,analysis" + "B2013_c1,ITTF,UseXgeom,BAna,ppOpt,emcDY2,trgd,ZDCvtx,NosvtIT,NossdIT,analysis" , "","", "Production chain for 2013 data - no Corr (+ l3, e/b-emc, no VF)",kFALSE}, // option is bare, no tracker and no Geom {"pp2013","" ,"", - "BAna,hitfilt,ppOpt,emcDY2,trgd,ZDCvtx,NosvtIT,NossdIT,analysis" + "BAna,ppOpt,emcDY2,trgd,ZDCvtx,NosvtIT,NossdIT,analysis" , "","", "Production chain for 2013 data - no Corr (+ l3, e/b-emc, no VF)",kFALSE}, // Year 14 chains {"B2014" ,"","","ry2014,in,tpcX,AgML,tpcDB,TpcHitMover,Idst,tags,Tree,evout","","" @@ -890,12 +890,12 @@ Bfc_st BFC[] = { // standard chains , "Base chain for 2014a ITTF (tpc)",kFALSE}, {"P2014","" ,"", - "B2014,ITTF,UseXgeom,BAna,hitfilt,VFMinuit,l3onl,emcDY2,fpd,trgd,ZDCvtx,analysis" + "B2014,ITTF,UseXgeom,BAna,VFMinuit,l3onl,emcDY2,fpd,trgd,ZDCvtx,analysis" , "","","Production chain for 2014 data - no Corr (+ l3, bcc/fpd, e/b-emc)",kFALSE}, // Target Chain options for BES -> P2014a,DbV20140410,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D {"P2014a","" ,"", - "B2014a,ITTF,UseXgeom,BAna,hitfilt,VFMinuit,l3onl,emcDY2,fpd,trgd,ZDCvtx,StiHftC,analysis," + "B2014a,ITTF,UseXgeom,BAna,VFMinuit,l3onl,emcDY2,fpd,trgd,ZDCvtx,StiHftC,analysis," , "","","Production chain for 2014 data - no Corr (+ l3, bcc/fpd, e/b-emc)",kFALSE}, // Year 15 chains @@ -912,36 +912,36 @@ Bfc_st BFC[] = { // standard chains , "Base chain for run 2015 with y2015c geometry",kFALSE}, {"pp2015","" ,"", - "B2015,ITTF,UseXgeom,BAna,hitfilt,ppOpt,VFPPVnoCTB,beamline,l3onl,emcDY2,fpd,trgd,ZDCvtx,StiHftC,analysis" + "B2015,ITTF,UseXgeom,BAna,ppOpt,VFPPVnoCTB,beamline,l3onl,emcDY2,fpd,trgd,ZDCvtx,StiHftC,analysis" , "","","Production chain for 2015 data - no Corr (+ l3, bcc/fpd, e/b-emc)",kFALSE}, {"pp2015a","" ,"", - "B2015a,ITTF,UseXgeom,BAna,hitfilt,ppOpt,VFPPVnoCTB,beamline,l3onl,emcDY2,fpd,trgd,ZDCvtx,StiHftC,analysis" + "B2015a,ITTF,UseXgeom,BAna,ppOpt,VFPPVnoCTB,beamline,l3onl,emcDY2,fpd,trgd,ZDCvtx,StiHftC,analysis" , "","","Production chain for year 2015a data - no Corr (+ l3, bcc/fpd, e/b-emc)",kFALSE}, {"pp2015b","" ,"", - "B2015b,ITTF,UseXgeom,BAna,hitfilt,ppOpt,VFPPVnoCTB,beamline,l3onl,emcDY2,fpd,trgd,ZDCvtx,StiHftC,analysis" + "B2015b,ITTF,UseXgeom,BAna,ppOpt,VFPPVnoCTB,beamline,l3onl,emcDY2,fpd,trgd,ZDCvtx,StiHftC,analysis" , "","","Production chain for year 2015b data - no Corr (+ l3, bcc/fpd, e/b-emc)",kFALSE}, {"pp2015c","" ,"", - "B2015c,ITTF,UseXgeom,BAna,hitfilt,ppOpt,VFPPVnoCTB,beamline,l3onl,emcDY2,fpd,trgd,ZDCvtx,StiHftC,analysis" + "B2015c,ITTF,UseXgeom,BAna,ppOpt,VFPPVnoCTB,beamline,l3onl,emcDY2,fpd,trgd,ZDCvtx,StiHftC,analysis" , "","","Production chain for year 2015c data - no Corr (+ l3, bcc/fpd, e/b-emc)",kFALSE}, {"P2015","" ,"", - "B2015,ITTF,UseXgeom,BAna,hitfilt,VFMinuit,l3onl,emcDY2,fpd,trgd,ZDCvtx,StiHftC,analysis" + "B2015,ITTF,UseXgeom,BAna,VFMinuit,l3onl,emcDY2,fpd,trgd,ZDCvtx,StiHftC,analysis" , "","","Production chain for 2015 data - no Corr (+ l3, bcc/fpd, e/b-emc)",kFALSE}, {"P2015a","" ,"", - "B2015a,ITTF,UseXgeom,BAna,hitfilt,VFMinuit,l3onl,emcDY2,fpd,trgd,ZDCvtx,StiHftC,analysis" + "B2015a,ITTF,UseXgeom,BAna,VFMinuit,l3onl,emcDY2,fpd,trgd,ZDCvtx,StiHftC,analysis" , "","","Production chain for year 2015a data - no Corr (+ l3, bcc/fpd, e/b-emc)",kFALSE}, {"P2015b","" ,"", - "B2015b,ITTF,UseXgeom,BAna,hitfilt,VFMinuit,l3onl,emcDY2,fpd,trgd,ZDCvtx,StiHftC,analysis" + "B2015b,ITTF,UseXgeom,BAna,VFMinuit,l3onl,emcDY2,fpd,trgd,ZDCvtx,StiHftC,analysis" , "","","Production chain for year 2015b data - no Corr (+ l3, bcc/fpd, e/b-emc)",kFALSE}, {"P2015c","" ,"", - "B2015c,ITTF,UseXgeom,BAna,hitfilt,VFMinuit,l3onl,emcDY2,fpd,trgd,ZDCvtx,StiHftC,analysis" + "B2015c,ITTF,UseXgeom,BAna,VFMinuit,l3onl,emcDY2,fpd,trgd,ZDCvtx,StiHftC,analysis" , "","","Production chain for year 2015c data - no Corr (+ l3, bcc/fpd, e/b-emc)",kFALSE}, @@ -950,13 +950,13 @@ Bfc_st BFC[] = { // standard chains {"B2016" ,"","","ry2016,in,tpcX,AgML,tpcDB,TpcHitMover,Idst,tags,Tree,evout","","" , "Base chain for 2016 ITTF (tpc)",kFALSE}, {"P2016","" ,"", - "B2016,ITTF,UseXgeom,BAna,hitfilt,VFMinuit,l3onl,emcDY2,fpd,trgd,ZDCvtx,StiHftC,analysis" + "B2016,ITTF,UseXgeom,BAna,VFMinuit,l3onl,emcDY2,fpd,trgd,ZDCvtx,StiHftC,analysis" , "","","Production chain for 2016 data - no Corr (+ l3, bcc/fpd, e/b-emc)",kFALSE}, {"B2016a" ,"","","ry2016a,in,tpcX,AgML,tpcDB,TpcHitMover,Idst,tags,Tree,evout","","" , "Production chain for 2016 data (tpc)",kFALSE}, {"P2016a","" ,"", - "B2016a,ITTF,UseXgeom,BAna,hitfilt,VFMinuit,l3onl,emcDY2,fpd,trgd,ZDCvtx,StiHftC,analysis" + "B2016a,ITTF,UseXgeom,BAna,VFMinuit,l3onl,emcDY2,fpd,trgd,ZDCvtx,StiHftC,analysis" , "","","Production chain for 2016 data - no Corr (+ l3, bcc/fpd, e/b-emc)",kFALSE}, // @@ -966,10 +966,10 @@ Bfc_st BFC[] = { // standard chains , "Base chain for run 2017 data (tpc)",kFALSE}, {"pp2017","" ,"", - "B2017,Sti,UseXgeom,BAna,hitfilt,ppOpt,VFPPVnoCTB,beamline,l3onl,emcDY2,fpd,trgd,ZDCvtx,analysis" + "B2017,Sti,UseXgeom,BAna,ppOpt,VFPPVnoCTB,beamline,l3onl,emcDY2,fpd,trgd,ZDCvtx,analysis" , "","","Base chain for year 2017 pp data - no Corr (+ l3, bcc/fpd, e/b-emc)",kFALSE}, {"P2017","" ,"", - "B2017,Sti,UseXgeom,BAna,hitfilt,VFMinuit,l3onl,emcDY2,fpd,trgd,ZDCvtx,analysis" + "B2017,Sti,UseXgeom,BAna,VFMinuit,l3onl,emcDY2,fpd,trgd,ZDCvtx,analysis" , "","","Base chain for year 2017 AA data - no Corr (+ l3, bcc/fpd, e/b-emc)",kFALSE}, @@ -977,11 +977,11 @@ Bfc_st BFC[] = { // standard chains , "Production chain for run 2017 data (tpc)",kFALSE}, {"pp2017a","" ,"", - "B2017a,ITTF,UseXgeom,BAna,hitfilt,ppOpt,VFPPVnoCTB,beamline3D,l3onl,emcDY2,fpd,trgd,ZDCvtx,analysis" + "B2017a,ITTF,UseXgeom,BAna,ppOpt,VFPPVnoCTB,beamline3D,l3onl,emcDY2,fpd,trgd,ZDCvtx,analysis" , "","","Production chain for year 2017 pp data - no Corr (+ l3, bcc/fpd, e/b-emc)",kFALSE}, {"P2017a","" ,"", - "B2017a,ITTF,UseXgeom,BAna,hitfilt,VFMinuit,beamline3D,l3onl,emcDY2,fpd,trgd,ZDCvtx,analysis" + "B2017a,ITTF,UseXgeom,BAna,VFMinuit,beamline3D,l3onl,emcDY2,fpd,trgd,ZDCvtx,analysis" , "","","Production chain for year 2017 AA data - no Corr (+ l3, bcc/fpd, e/b-emc)",kFALSE}, @@ -990,7 +990,7 @@ Bfc_st BFC[] = { // standard chains , "Base chain for run 2018 data (tpc)",kFALSE}, {"P2018a","" ,"", - "B2018a,ITTF,UseXgeom,BAna,hitfilt,VFMinuit,beamline3D,l3onl,emcDY2,epdHit,fpd,trgd,ZDCvtx,analysis" + "B2018a,ITTF,UseXgeom,BAna,VFMinuit,beamline3D,l3onl,emcDY2,epdHit,fpd,trgd,ZDCvtx,analysis" , "","","Base chain for year 2018 AA data - no Corr (+ l3, bcc/fpd, e/b-emc)",kFALSE}, // 2019 chains, BES @@ -998,7 +998,7 @@ Bfc_st BFC[] = { // standard chains "","", "Base chain for run 2019 data (tpc)",kFALSE}, {"P2019a","" ,"", - "B2019a,ITTF,BAna,iTpcIT,hitfilt,VFMinuit,beamline3D,etofa,btof,mtd,l3onl,emcDY2,epdHit,trgd,ZDCvtx,analysis" + "B2019a,ITTF,BAna,iTpcIT,VFMinuit,beamline3D,etofa,btof,mtd,l3onl,emcDY2,epdHit,trgd,ZDCvtx,analysis" , "","", "Base chain for year 2019 AA data - no Corr (+ l3, epd, mtd, b/etof, b-emc)",kFALSE}, @@ -1008,7 +1008,7 @@ Bfc_st BFC[] = { // standard chains "","", "Base chain for run 2020 data (tpc)",kFALSE}, {"P2020a","" ,"", - "B2020a,ITTF,BAna,iTpcIT,hitfilt,VFMinuit,etofa,btof,mtd,l3onl,emcDY2,epdHit,trgd,ZDCvtx,analysis" + "B2020a,ITTF,BAna,iTpcIT,VFMinuit,etofa,btof,mtd,l3onl,emcDY2,epdHit,trgd,ZDCvtx,analysis" , "","", "Base chain for year 2020 AA data - no Corr (+ l3, epd, mtd, b/etof, b-emc)",kFALSE}, // 2021 initial chains @@ -1017,7 +1017,7 @@ Bfc_st BFC[] = { // standard chains "","", "Base chain for run 2020 data (tpc)",kFALSE}, {"P2021a","" ,"", - "B2021a,ITTF,BAna,iTpcIT,hitfilt,VFMinuit,etofa,btof,mtd,l3onl,emcDY2,epdHit,trgd,ZDCvtx,analysis" + "B2021a,ITTF,BAna,iTpcIT,VFMinuit,etofa,btof,mtd,l3onl,emcDY2,epdHit,trgd,ZDCvtx,analysis" , "","", "Base chain for year 2020 AA data - no Corr (+ l3, epd, mtd, b/etof, b-emc)",kFALSE}, // 2022 initial chains @@ -1026,7 +1026,7 @@ Bfc_st BFC[] = { // standard chains "","", "Base chain for run 2022 data (tpc)",kFALSE}, {"pp2022","" ,"", - "B2022,ITTF,BAna,hitfilt,ppOpt,ImpBToFt0Mode,VFPPVnoCTB,beamline3D,l3onl,etofa,btof,mtd,emcDY2,FttDat,fcs,trgd,ZDCvtx,analysis", + "B2022,ITTF,BAna,ppOpt,ImpBToFt0Mode,VFPPVnoCTB,beamline3D,l3onl,etofa,btof,mtd,emcDY2,FttDat,fcs,trgd,ZDCvtx,analysis", "","","Production chain for year 2022 pp data - no Corr (+ l3, epd, mtf, b/etof, fcs, e/b-emc)",kFALSE}, {"B2022a" ,"","", @@ -1034,7 +1034,7 @@ Bfc_st BFC[] = { // standard chains "","", "Base chain for run 2022 data (tpc)",kFALSE}, {"pp2022a","" ,"", - "B2022a,ITTF,BAna,hitfilt,ppOpt,ImpBToFt0Mode,VFPPVnoCTB,beamline3D,l3onl,etofa,btof,mtd,emcDY2,FttDat,fcs,trgd,ZDCvtx,analysis", + "B2022a,ITTF,BAna,ppOpt,ImpBToFt0Mode,VFPPVnoCTB,beamline3D,l3onl,etofa,btof,mtd,emcDY2,FttDat,fcs,trgd,ZDCvtx,analysis", "","","Production chain for year 2022 pp data - CorrY (+ l3, epd, mtf, b/etof, fcs, e/b-emc)",kFALSE}, // 2023 initial chains @@ -1043,7 +1043,7 @@ Bfc_st BFC[] = { // standard chains "","", "Base chain for run 2023 data (tpc)",kFALSE}, {"P2023a","" ,"", - "B2023a,ITTF,BAna,iTpcIT,hitfilt,VFMinuit,etofa,btof,mtd,l3onl,emcDY2,epdHit,trgd,ZDCvtx,analysis", + "B2023a,ITTF,BAna,iTpcIT,VFMinuit,etofa,btof,mtd,l3onl,emcDY2,epdHit,trgd,ZDCvtx,analysis", "","", "Base chain for year 2023 AA data - CorrY (+ l3, epd, mtd, b/etof, b-emc)",kFALSE}, // 2024 initial chains @@ -1052,8 +1052,8 @@ Bfc_st BFC[] = { // standard chains "","", "Base chain for run 2024 data (tpc)",kFALSE}, {"pp2024a","" ,"", - "B2024a,ITTF,BAna,hitfilt,ppOpt,ImpBToFt0Mode,VFPPVnoCTB,beamline3D,l3onl,epdhit,btof,mtd,emcDY2,ftt,fcs,trgd,ZDCvtx,analysis", - "","","Production chain for year 2024 pp data - CorrY (+ l3, epd, mtd, btof, fcs, ftt, e/b-emc)",kFALSE}, + "B2024a,ITTF,BAna,ppOpt,ImpBToFt0Mode,VFPPVnoCTB,beamline3D,l3onl,epdhit,btof,mtd,emcDY2,ftt,fcs,trgd,ZDCvtx,analysis", + "","","Production chain for year 2024 pp data - CorrY (+ l3, epd, mtd, btof, fcs, ftt, e/b-emc)",kFALSE}, // Other chains/Calibration @@ -1223,7 +1223,7 @@ Bfc_st BFC[] = { // standard chains {"libPhysics" ,"" ,"","","" ,"libPhysics","TVector",kFALSE}, {"geant3vmc" ,"" ,"","-usexgeom,-xgeometry","", "libGeom,libVMC,libgeant3", "VMC geant3",kFALSE}, {"geant3" ,"" ,"","geant3vmc","" ,"EG,Pythia6,EGPythia6","VMC geant3 plus ROOT EG,pythia6",kFALSE}, - {"geometry" ,"" ,"","","" ,"geometry","geometry+Mag.Field",kFALSE}, + {"geometry" ,"" ,"","","" ,"geometry","geometry+Mag.Field",kFALSE}, {"StarMagField","", "","magF" ,"","VMC,StarMagField","Load StarMagField",kFALSE}, {"geomNoField" ,"" ,"","-geometry,StarMagField" ,"","geometryNoField","geometry-Mag.Field",kFALSE}, {"xgeometry" ,"" ,"","-geometry,-geomNoField" ,"","xgeometry","AgML geometry-Mag.Field",kFALSE}, @@ -1514,7 +1514,7 @@ Bfc_st BFC[] = { // standard chains {"ssddat" ,"","","ssd_daq" ,"","","SSD full chain for Real Data",kFALSE}, {"sstdat" ,"","","sst_daq" ,"","","SST full chain for Real Data",kFALSE}, {"ssd_daq","","","ssdCalDb,svt_T,-sls,-spa,ssdUtil","StSsdDaqMaker","StSsdDaqMaker","... SSD Daq",kFALSE}, - {"sst_daq","","","sstCalDb,svt_T,-sls,-spa,sstUtil","StSstDaqMaker","StSstDaqMaker","... SSDT Daq",kFALSE}, + {"sst_daq","","","sstCalDb,svt_T,-sls,-spa,sstUtil","StSstDaqMaker","StSstDaqMaker","... SST Daq",kFALSE}, {"ssdfast" ,"","","ssdDb,StMcEvent,StEvent","StSsdFastSimMaker","StSsdFastSimMaker", "... SSD fast simulator" ,kFALSE}, @@ -1589,8 +1589,10 @@ Bfc_st BFC[] = { // standard chains // Time Of Flight related options - {"ToF" ,"TofChain","","tofDat,tofrMatch,tofpMatch,tofCalib,geant","StMaker","StChain","ToF Chain",kFALSE}, - {"ToFx" ,"TofChain","","tofXDat,tofrMatch,tofCalib,geant" ,"StMaker","StChain","ToFx Chain",kFALSE}, + {"ToF" ,"TofChain","","tofDat,tofrMatch,tofpMatch,tofCalib,geant","StMaker","StChain" + , "ToF Chain",kFALSE}, + {"ToFx" ,"TofChain","","tofXDat,tofrMatch,tofCalib,geant" ,"StMaker","StChain" + , "ToFx Chain",kFALSE}, {"tofDat" ,"tof_raw","TofChain","db,Tofutil","StTofMaker","StEvent,StTofMaker", "TOF Data base chain", kFALSE}, {"tofXDat" ,"tof_raw","TofChain","db,Tofutil","StTofHitMaker","StEvent,StTofMaker,StTofHitMaker", @@ -1743,12 +1745,12 @@ Bfc_st BFC[] = { // standard chains {"HpdIT" ,"" ,"","ITTF","" ,"Sti,StiRnD","Sti tracking: Hpd geom",kFALSE}, {"PixelIT","" ,"","PxlIT","" ,"","Alias for PxlIT",kFALSE}, - {"PxlIT" ,"" ,"","ITTF","" ,"","Sti tracking: Pixel geom",kFALSE}, - {"IstIT" ,"" ,"","ITTF","" ,"","Sti tracking: Ist geom",kFALSE}, - {"SstIT" ,"" ,"","ITTF","" ,"","Sti tracking: Sst geom",kFALSE}, - {"iTpcIT" ,"" ,"","ITTF","" ,"","Sti tracking: iTpc geom + hits",kFALSE}, + {"PxlIT" ,"" ,"","ITTF","" ,"","Sti tracking: Pixel geom",kFALSE}, + {"IstIT" ,"" ,"","ITTF","" ,"","Sti tracking: Ist geom",kFALSE}, + {"SstIT" ,"" ,"","ITTF","" ,"","Sti tracking: Sst geom",kFALSE}, + {"iTpcIT" ,"" ,"","ITTF","" ,"","Sti tracking: iTpc geom + hits",kFALSE}, - {"BTofIT" ,"" ,"","ITTF","" ,"","Sti tracking: BTof geom",kFALSE}, + {"BTofIT" ,"" ,"","ITTF","" ,"","Sti tracking: BTof geom",kFALSE}, {"NoSvtIT" ,"" ,"","-SvtIT","" ,"","ITTF: track with switch off SVT geom",kFALSE}, {"NoSsdIT" ,"" ,"","-SsdIT","" ,"","ITTF: track with switch off SSD geom",kFALSE}, {"NoSstIT" ,"" ,"","-SstIT","" ,"","ITTF: track with switch off SST geom",kFALSE}, From 7551fb9c4d1fe597cd274cd6546ff50009495633 Mon Sep 17 00:00:00 2001 From: Daniel Brandenburg Date: Thu, 22 Aug 2024 11:52:20 -0400 Subject: [PATCH 10/19] Update Stgm geometry z-plane locations according to survey data (#707) Move sTGC planes to match the z-locations measured as part of the precision position survey. Use the z coord for quadrant A on each plane as the z-location for the entire plane --- StarVMC/Geometry/StgmGeo/StgmGeo1.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/StarVMC/Geometry/StgmGeo/StgmGeo1.xml b/StarVMC/Geometry/StgmGeo/StgmGeo1.xml index decc23be73b..f773b423ec1 100644 --- a/StarVMC/Geometry/StgmGeo/StgmGeo1.xml +++ b/StarVMC/Geometry/StgmGeo/StgmGeo1.xml @@ -215,20 +215,20 @@ - + - + - zplane = -26.75; + zplane = -26.4965; @@ -255,7 +255,7 @@ station - zplane = -3.95; + zplane = -8.8855; @@ -281,7 +281,7 @@ station = 2; station - zplane = +18.95; + zplane = +8.7985; @@ -307,7 +307,7 @@ station = 3; station - zplane = +41.75; + zplane = +26.5835; From b06b780de6384f87c15282d7b1a139c8cbf7a0ff Mon Sep 17 00:00:00 2001 From: Daniel Brandenburg Date: Thu, 22 Aug 2024 17:33:49 -0400 Subject: [PATCH 11/19] Add idTruth and qaTruth to StEvent and MuDst FttPoint, FttCluster, and FttRawHit (#699) Adds idTruth member to StMuFttPoint (used by StFttFastSimMaker) and StMuFttCluster (to be used by "slow" simulator) mirrors updates to StEvent in #698 --- StRoot/StEvent/StFttCluster.cxx | 7 ++++++- StRoot/StEvent/StFttCluster.h | 5 ++++- StRoot/StEvent/StFttPoint.cxx | 4 ++-- StRoot/StEvent/StFttPoint.h | 7 +++++-- StRoot/StEvent/StFttRawHit.cxx | 9 +++++++-- StRoot/StEvent/StFttRawHit.h | 12 ++++++++---- StRoot/StMuDSTMaker/COMMON/StMuFttCluster.cxx | 7 ++++++- StRoot/StMuDSTMaker/COMMON/StMuFttCluster.h | 8 +++++++- StRoot/StMuDSTMaker/COMMON/StMuFttPoint.cxx | 2 ++ StRoot/StMuDSTMaker/COMMON/StMuFttPoint.h | 8 +++++++- StRoot/StMuDSTMaker/COMMON/StMuFttRawHit.cxx | 11 +++++++++-- StRoot/StMuDSTMaker/COMMON/StMuFttRawHit.h | 11 +++++++---- 12 files changed, 70 insertions(+), 21 deletions(-) diff --git a/StRoot/StEvent/StFttCluster.cxx b/StRoot/StEvent/StFttCluster.cxx index 932a78f6380..8fb507c13b5 100644 --- a/StRoot/StEvent/StFttCluster.cxx +++ b/StRoot/StEvent/StFttCluster.cxx @@ -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) { } @@ -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; } diff --git a/StRoot/StEvent/StFttCluster.h b/StRoot/StEvent/StFttCluster.h index d478c798f32..8fcc4341901 100644 --- a/StRoot/StEvent/StFttCluster.h +++ b/StRoot/StEvent/StFttCluster.h @@ -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); @@ -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; @@ -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 diff --git a/StRoot/StEvent/StFttPoint.cxx b/StRoot/StEvent/StFttPoint.cxx index c9441860543..a06d4f8e72a 100644 --- a/StRoot/StEvent/StFttPoint.cxx +++ b/StRoot/StEvent/StFttPoint.cxx @@ -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++; diff --git a/StRoot/StEvent/StFttPoint.h b/StRoot/StEvent/StFttPoint.h index bab29a1971f..4add9090ef0 100644 --- a/StRoot/StEvent/StFttPoint.h +++ b/StRoot/StEvent/StFttPoint.h @@ -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); @@ -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); @@ -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; } diff --git a/StRoot/StEvent/StFttRawHit.cxx b/StRoot/StEvent/StFttRawHit.cxx index b92f3a08f1c..d32f4018c8e 100644 --- a/StRoot/StEvent/StFttRawHit.cxx +++ b/StRoot/StEvent/StFttRawHit.cxx @@ -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, @@ -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; diff --git a/StRoot/StEvent/StFttRawHit.h b/StRoot/StEvent/StFttRawHit.h index 8d7e2820254..12928994fd0 100644 --- a/StRoot/StEvent/StFttRawHit.h +++ b/StRoot/StEvent/StFttRawHit.h @@ -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; @@ -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; @@ -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 diff --git a/StRoot/StMuDSTMaker/COMMON/StMuFttCluster.cxx b/StRoot/StMuDSTMaker/COMMON/StMuFttCluster.cxx index 05bdc6992fb..720d045095f 100644 --- a/StRoot/StMuDSTMaker/COMMON/StMuFttCluster.cxx +++ b/StRoot/StMuDSTMaker/COMMON/StMuFttCluster.cxx @@ -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) { } @@ -53,4 +56,6 @@ void StMuFttCluster::set( StFttCluster * clu ){ mSumAdc = clu->sumAdc(); mX = clu->x(); mSigma = clu->sigma(); + mIdTruth = clu->idTruth(); + mQaTruth = clu->qaTruth(); } \ No newline at end of file diff --git a/StRoot/StMuDSTMaker/COMMON/StMuFttCluster.h b/StRoot/StMuDSTMaker/COMMON/StMuFttCluster.h index 7780afc9c8f..5288024131b 100644 --- a/StRoot/StMuDSTMaker/COMMON/StMuFttCluster.h +++ b/StRoot/StMuDSTMaker/COMMON/StMuFttCluster.h @@ -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); @@ -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; @@ -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) }; diff --git a/StRoot/StMuDSTMaker/COMMON/StMuFttPoint.cxx b/StRoot/StMuDSTMaker/COMMON/StMuFttPoint.cxx index 99657086170..8e6685b62fd 100644 --- a/StRoot/StMuDSTMaker/COMMON/StMuFttPoint.cxx +++ b/StRoot/StMuDSTMaker/COMMON/StMuFttPoint.cxx @@ -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 \ No newline at end of file diff --git a/StRoot/StMuDSTMaker/COMMON/StMuFttPoint.h b/StRoot/StMuDSTMaker/COMMON/StMuFttPoint.h index d5c10651ad8..88703f29ae6 100644 --- a/StRoot/StMuDSTMaker/COMMON/StMuFttPoint.h +++ b/StRoot/StMuDSTMaker/COMMON/StMuFttPoint.h @@ -32,6 +32,8 @@ 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); @@ -39,6 +41,8 @@ class StMuFttPoint : public TObject { 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); @@ -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; } diff --git a/StRoot/StMuDSTMaker/COMMON/StMuFttRawHit.cxx b/StRoot/StMuDSTMaker/COMMON/StMuFttRawHit.cxx index 980b2a335f7..89be88c5aef 100644 --- a/StRoot/StMuDSTMaker/COMMON/StMuFttRawHit.cxx +++ b/StRoot/StMuDSTMaker/COMMON/StMuFttRawHit.cxx @@ -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 ){ @@ -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 @@ -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 \ No newline at end of file diff --git a/StRoot/StMuDSTMaker/COMMON/StMuFttRawHit.h b/StRoot/StMuDSTMaker/COMMON/StMuFttRawHit.h index 7d049fb66ee..c15e562aa49 100644 --- a/StRoot/StMuDSTMaker/COMMON/StMuFttRawHit.h +++ b/StRoot/StMuDSTMaker/COMMON/StMuFttRawHit.h @@ -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; @@ -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; @@ -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 From 2fa4c619b4e041c2020c56fc712dc29e426809ea Mon Sep 17 00:00:00 2001 From: Daniel Brandenburg Date: Tue, 27 Aug 2024 14:12:01 -0400 Subject: [PATCH 12/19] Update StFstFastSimMaker to write hits into the StFstHitCollection (#700) as is done for the real data reco chain. I continue to write hits into the StRnDCollection, but this is no longer used by downstream code. Also add a function to StFstHit to allow setting the disk, wedge, and sensor for sim hits. Does not change the StFstHit data structure. --- StRoot/StEvent/StFstHit.h | 3 + StRoot/StFstSimMaker/StFstFastSimMaker.cxx | 86 +++++++++++----------- StRoot/StFstSimMaker/StFstFastSimMaker.h | 13 +--- 3 files changed, 50 insertions(+), 52 deletions(-) diff --git a/StRoot/StEvent/StFstHit.h b/StRoot/StEvent/StFstHit.h index c4120a9e5eb..d991c86cd0b 100644 --- a/StRoot/StEvent/StFstHit.h +++ b/StRoot/StEvent/StFstHit.h @@ -42,6 +42,7 @@ class StFstHit : public StHit unsigned char getNRawHitsPhi() const; float localPosition(unsigned int ) const; + void setDiskWedgeSensor(unsigned char disk, unsigned char wedge, unsigned char sensor); void setDisk(unsigned char disk); void setWedge(unsigned char wedge); void setSensor(unsigned char sensor); @@ -90,6 +91,8 @@ inline unsigned char StFstHit::getNRawHits() const { return mNRawHits; inline unsigned char StFstHit::getNRawHitsR() const { return mNRawHitsR; }; inline unsigned char StFstHit::getNRawHitsPhi() const { return mNRawHitsPhi; }; +inline void StFstHit::setDiskWedgeSensor(unsigned char disk, unsigned char wedge, unsigned char sensor) { setHardwarePosition( + (1+disk)*kFstNumWedgePerDisk * kFstNumSensorsPerWedge*0 + (1 + (wedge - 1)*kFstNumSensorsPerWedge + sensor) ); } inline void StFstHit::setApv(unsigned char apv) { mApv = apv; }; inline void StFstHit::setMaxTimeBin(unsigned char tb) { mMaxTimeBin = tb; }; inline void StFstHit::setMeanPhiStrip(float meanPhiStrip) { mMeanPhiStrip = meanPhiStrip; }; diff --git a/StRoot/StFstSimMaker/StFstFastSimMaker.cxx b/StRoot/StFstSimMaker/StFstFastSimMaker.cxx index bf9034ccfd3..27814923bc6 100644 --- a/StRoot/StFstSimMaker/StFstFastSimMaker.cxx +++ b/StRoot/StFstSimMaker/StFstFastSimMaker.cxx @@ -4,6 +4,8 @@ #include "StEvent/StEvent.h" #include "StEvent/StRnDHit.h" +#include "StEvent/StFstHit.h" +#include "StEvent/StFstHitCollection.h" #include "StEvent/StRnDHitCollection.h" #include "tables/St_g2t_fts_hit_Table.h" @@ -57,9 +59,9 @@ StFstFastSimMaker::StFstFastSimMaker(const Char_t *name) mNumR{8}, mNumPHI{128}, mNumSEC{12}, - mRaster{0}, mInEff{0}, mHist{false}, + mGEANTPassthrough{false}, mQAFileName(0), hTrutHitYXDisk(0), hTrutHitRDisk(0), @@ -125,6 +127,15 @@ Int_t StFstFastSimMaker::Make() { LOG_DEBUG << "Creating StRnDHitCollection for FTS" << endm; } + // Get pointer to an existing StFstHitCollection if any + StFstHitCollection *fstHitCollection = event->fstHitCollection(); + // If no fst hit collection, create one + if (!fstHitCollection) { + fstHitCollection = new StFstHitCollection(); + event->setFstHitCollection(fstHitCollection); + LOG_DEBUG << "Make() - Added new StFstHitCollection to this StEvent" << endm; + } + // Digitize GEANT FTS hits FillSilicon(event); @@ -142,15 +153,9 @@ void StFstFastSimMaker::FillSilicon(StEvent *event) { const int MAXR = mNumR; const int MAXPHI = mNumPHI * mNumSEC; - float X0[] = {0, 0, 0, 0, 0, 0}; - float Y0[] = {0, 0, 0, 0, 0, 0}; - - if (mRaster > 0) - for (int i = 0; i < 6; i++) { - X0[i] = mRaster * TMath::Cos(i * 60 * TMath::DegToRad()); - Y0[i] = mRaster * TMath::Sin(i * 60 * TMath::DegToRad()); - } - + if ( mGEANTPassthrough ){ + LOG_INFO << "FST Hits using GEANT xyz directly (no raster etc.)" << endm; + } // maps for hit and energy for each disk's r-phi strip std::map< FstGlobal::FstKeyTriple, StRnDHit* > hitMap; @@ -217,30 +222,20 @@ void StFstFastSimMaker::FillSilicon(StEvent *event) { if (trk) isShower = trk->is_shower; - // raster coordinate offsets - double xc = X0[disk_index]; - double yc = Y0[disk_index]; - + // This z-offset is used to shift the hits + // to the center of the FST where the tracking planes are defined + const double z_delta = 1.755; // hit coordinates double x = hit->x[0]; double y = hit->x[1]; - double z = hit->x[2]; + double z = hit->x[2] + z_delta; if (z > 200) continue; // skip large disks - // rastered - double rastered_x = x - xc; - double rastered_y = y - yc; - double r = sqrt(x * x + y * y); double p = atan2(y, x); - // rastered - double rr = sqrt(rastered_x * rastered_x + rastered_y * rastered_y); - double pp = atan2(rastered_y, rastered_x); - - // wrap an angle between 0 and 2pi auto wrapAngle = [&]( double angle ) { angle = fmod( angle, 2.0 * M_PI ); @@ -250,27 +245,22 @@ void StFstFastSimMaker::FillSilicon(StEvent *event) { }; p = wrapAngle( p ); - pp = wrapAngle( pp ); - LOG_DEBUG << "rr = " << rr << " pp=" << pp << endm; + LOG_DEBUG << "r = " << r << " p=" << p << endm; LOG_DEBUG << "RMIN = " << FstGlobal::RMIN[disk_index] << " RMAX= " << FstGlobal::RMAX[disk_index] << endm; - // Cuts made on rastered value to require the r value is within limits - if (rr < FstGlobal::RMIN[disk_index] || rr > FstGlobal::RMAX[disk_index]) + // Cuts made on the r value to ensure it is within limits + if (r < FstGlobal::RMIN[disk_index] || r > FstGlobal::RMAX[disk_index]) continue; - LOG_DEBUG << "rr = " << rr << endm; - // Strip numbers on rastered value - int r_index = floor(MAXR * (rr - FstGlobal::RMIN[disk_index]) / (FstGlobal::RMAX[disk_index] - FstGlobal::RMIN[disk_index])); - - // this gives a different conflicting answer for r_index and does not handle r outside of range + int r_index = floor(MAXR * (r - FstGlobal::RMIN[disk_index]) / (FstGlobal::RMAX[disk_index] - FstGlobal::RMIN[disk_index])); for (int ii = 0; ii < MAXR; ii++) - if (rr > FstGlobal::RSegment[ii] && rr <= FstGlobal::RSegment[ii + 1]) + if (r > FstGlobal::RSegment[ii] && r <= FstGlobal::RSegment[ii + 1]) r_index = ii; // Phi number - int phi_index = int(MAXPHI * pp / 2.0 / M_PI); + int phi_index = int(MAXPHI * p / 2.0 / M_PI); if (r_index >= 8) continue; @@ -297,7 +287,8 @@ void StFstFastSimMaker::FillSilicon(StEvent *event) { fsihit = new StRnDHit(); fsihit->setDetectorId(kFtsId); fsihit->setLayer(disk); - + fsihit->setLadder(wedge); + fsihit->setWafer(sensor); // // Set position and position error based on radius-constant bins // @@ -308,12 +299,16 @@ void StFstFastSimMaker::FillSilicon(StEvent *event) { double r0 = (FstGlobal::RSegment[r_index] + FstGlobal::RSegment[r_index + 1]) * 0.5; double dr = FstGlobal::RSegment[r_index + 1] - FstGlobal::RSegment[r_index]; - double x0 = r0 * cos(p0) + xc; - double y0 = r0 * sin(p0) + yc; + double x0 = r0 * cos(p0); + double y0 = r0 * sin(p0); assert(TMath::Abs(x0) + TMath::Abs(y0) > 0); double dz = 0.03 / FstGlobal::SQRT12; double er = dr / FstGlobal::SQRT12; fsihit->setPosition(StThreeVectorF(x0, y0, z)); + // pass the GEANT hits through without modification + if ( mGEANTPassthrough ){ + fsihit->setPosition(StThreeVectorF(x, y, z)); + } fsihit->setPositionError(StThreeVectorF(er, dp, dz)); // set covariance matrix @@ -384,16 +379,25 @@ void StFstFastSimMaker::FillSilicon(StEvent *event) { int nfsihit = hits.size(); StarRandom &rand = StarRandom::Instance(); - + LOG_INFO << "FST Fast simulator is using mInEff = " << mInEff << endm; // NOW run back through the hits and add them if they pass an efficiency roll for (int i = 0; i < nfsihit; i++) { double rnd_save = rand.flat(); - if (rnd_save > mInEff){ + if (rnd_save > mInEff || mGEANTPassthrough){ fsicollection->addHit(hits[i]); + + StFstHit *fHit = new StFstHit(hits[i]->position(), hits[i]->positionError(), 0, hits[i]->charge(), 0); + fHit->setIdTruth(hits[i]->idTruth()); + float r = sqrt(hits[i]->position().x() * hits[i]->position().x() + hits[i]->position().y() * hits[i]->position().y()); + float phi = atan2(hits[i]->position().y(), hits[i]->position().x()); + fHit->setLocalPosition( r, phi, hits[i]->position().z() ); + fHit->setDiskWedgeSensor(hits[i]->layer(), hits[i]->ladder(), hits[i]->wafer()); + event->fstHitCollection()->addHit(fHit); + } else { } } if (FstGlobal::verbose) { - LOG_DEBUG << Form("Found %d/%d g2t hits in %d cells, created %d hits with ADC>0", count, nHits, nfsihit, fsicollection->numberOfHits()) << endm; + LOG_DEBUG << Form("Found %d/%d g2t hits in %d cells, created %d hits with ADC>0 and put %d into StFstHitCollection", count, nHits, nfsihit, fsicollection->numberOfHits(), event->fstHitCollection()->numberOfHits()) << endm; } } diff --git a/StRoot/StFstSimMaker/StFstFastSimMaker.h b/StRoot/StFstSimMaker/StFstFastSimMaker.h index 03e8633e075..6e374d7cfbc 100644 --- a/StRoot/StFstSimMaker/StFstFastSimMaker.h +++ b/StRoot/StFstSimMaker/StFstFastSimMaker.h @@ -21,17 +21,13 @@ class StFstFastSimMaker : public StMaker { int Make(); int Init(); int Finish(); - virtual const char *GetCVS() const; - - /// Set offset for each disk ( x=R*cos(idisk*60 degrees), y=R*sin(...) ) - void SetRaster(float R = 1.0) { mRaster = R; } /// Set min/max active radii for each disk void SetDisk(const int i, const float rmn, const float rmx); void SetInEfficiency(float ineff = 0.1) { mInEff = ineff; } void SetQAFileName(TString filename = 0.1) { mQAFileName = filename; } void SetFillHist(const bool hist = false) { mHist = hist; } - + void setGEANTPassthrough(bool passthrough = false) { mGEANTPassthrough = passthrough; } private: void FillSilicon(StEvent *event); @@ -40,9 +36,9 @@ class StFstFastSimMaker : public StMaker { int mNumR; int mNumPHI; int mNumSEC; - float mRaster; float mInEff; bool mHist; + bool mGEANTPassthrough; TString mQAFileName; TH3F *hTrutHitYXDisk; @@ -67,9 +63,4 @@ class StFstFastSimMaker : public StMaker { ClassDef(StFstFastSimMaker, 0) }; -inline const char *StFstFastSimMaker::GetCVS() const { - static const char cvs[] = "Tag $Name: $ $Id: StFstFastSimMaker.h,v 1.1 2021/03/26 13:58:21 jdb Exp $ built " __DATE__ " " __TIME__; - return cvs; -} - #endif From 50de45374bc11586edd3f771e2c962895b544688 Mon Sep 17 00:00:00 2001 From: Gene Van Buren <85305093+genevb@users.noreply.github.com> Date: Thu, 29 Aug 2024 14:28:09 -0400 Subject: [PATCH 13/19] Setup new BSMD histograms for QA (Saskia M.) (#708) This PR provides additional QA histograms with more detailed QA of the BSMD. Code updates provided by Saskia Mioduszewski. I have also compiled and tested that it all works. Additional tweaks may come later as accumulated statistics from FastOffline provide feedback on the efficacy of these plots. --- StRoot/StAnalysisUtilities/StHistUtil.cxx | 11 +++++++ StRoot/St_QA_Maker/QAhlist_logy.h | 2 ++ StRoot/St_QA_Maker/QAhlist_subsystems.h | 30 +++++++++-------- StRoot/St_QA_Maker/StEventQAMaker.cxx | 21 +++++++++++- StRoot/St_QA_Maker/StQABookHist.cxx | 40 ++++++++++++++++++++++- StRoot/St_QA_Maker/StQABookHist.h | 4 +++ 6 files changed, 92 insertions(+), 16 deletions(-) diff --git a/StRoot/StAnalysisUtilities/StHistUtil.cxx b/StRoot/StAnalysisUtilities/StHistUtil.cxx index 3d12eda3d6c..586a9a6ac15 100644 --- a/StRoot/StAnalysisUtilities/StHistUtil.cxx +++ b/StRoot/StAnalysisUtilities/StHistUtil.cxx @@ -960,11 +960,17 @@ Int_t StHistUtil::DrawHists(const Char_t *dirName) { } else graphPad->cd(m_QAShiftMode ? 0 : curPad); // set x & y grid off by default + TRegexp bsmdPerModule("bsmd.*PerModule"); gPad->SetGridy(0); if (oName.Contains("H_matchCand")) { gPad->SetGridx(1); gStyle->SetGridStyle(6); gStyle->SetGridColor(kOrange); + } else if (oName.Contains(bsmdPerModule)) { + hobj->GetXaxis()->SetNdivisions(15); + hobj->GetXaxis()->SetLabelSize(0.03); + hobj->GetXaxis()->SetTitle("Module Number"); + gPad->SetGridx(); } else { gPad->SetGridx(0); gStyle->SetGridStyle(3); @@ -972,6 +978,7 @@ Int_t StHistUtil::DrawHists(const Char_t *dirName) { } // set stats to draw + TRegexp bsmd2DPerModule("bsmd.*Strip.*PerModule"); if (oName.Contains("TpcSector") || oName.Contains("PointRPTpc") || oName.Contains("PointXYTpc") || @@ -979,6 +986,10 @@ Int_t StHistUtil::DrawHists(const Char_t *dirName) { gStyle->SetOptStat(11); } else if (oName.Contains("NullPrim")) { gStyle->SetOptStat(1111); + } else if (oName.Contains(bsmd2DPerModule)) { + gStyle->SetOptStat(0); + hobj->GetYaxis()->SetTitle("Strip Within Module"); + hobj->GetYaxis()->SetTitleOffset(1.4); } else { gStyle->SetOptStat(111111); } diff --git a/StRoot/St_QA_Maker/QAhlist_logy.h b/StRoot/St_QA_Maker/QAhlist_logy.h index e97516d24f6..eceb4f200cc 100644 --- a/StRoot/St_QA_Maker/QAhlist_logy.h +++ b/StRoot/St_QA_Maker/QAhlist_logy.h @@ -299,6 +299,8 @@ "bemcAdc", "bsmdeAdc", "bsmdpAdc", + "bsmdeEnergy", + "bsmdpEnergy", "bemcClNum", "bemcClEnergy", "EmcCat4_Point_Energy", diff --git a/StRoot/St_QA_Maker/QAhlist_subsystems.h b/StRoot/St_QA_Maker/QAhlist_subsystems.h index 293969651bb..fec9da22bf7 100644 --- a/StRoot/St_QA_Maker/QAhlist_subsystems.h +++ b/StRoot/St_QA_Maker/QAhlist_subsystems.h @@ -75,12 +75,26 @@ ":emc:bprsEnergy2D", ":emc:bprsAdc", ":emc:bprsEnergy", + ":bsmd:bsmdeWest1HitsPerModule", + ":bsmd:bsmdeWest1StripHitsPerModule", + ":bsmd:bsmdeWest2HitsPerModule", + ":bsmd:bsmdeWest2StripHitsPerModule", + ":bsmd:bsmdeEast1HitsPerModule", + ":bsmd:bsmdeEast1StripHitsPerModule", + ":bsmd:bsmdeEast2HitsPerModule", + ":bsmd:bsmdeEast2StripHitsPerModule", + ":bsmd:bsmdpWest1HitsPerModule", + ":bsmd:bsmdpWest1StripHitsPerModule", + ":bsmd:bsmdpWest2HitsPerModule", + ":bsmd:bsmdpWest2StripHitsPerModule", + ":bsmd:bsmdpEast1HitsPerModule", + ":bsmd:bsmdpEast1StripHitsPerModule", + ":bsmd:bsmdpEast2HitsPerModule", + ":bsmd:bsmdpEast2StripHitsPerModule", ":bsmd:bsmdeHits", - ":bsmd:bsmdeEnergy2D", ":bsmd:bsmdeAdc", ":bsmd:bsmdeEnergy", ":bsmd:bsmdpHits", - ":bsmd:bsmdpEnergy2D", ":bsmd:bsmdpAdc", ":bsmd:bsmdpEnergy", ":emc:EmcNcluster", @@ -99,18 +113,6 @@ ":emc:bprsClEnergy", ":emc:bprsEta", ":emc:bprsPhi", - ":bsmd:bsmde_cluster", - ":bsmd:bsmde_cluster_energy", - ":bsmd:bsmdeClNum", - ":bsmd:bsmdeClEnergy", - ":bsmd:bsmdeEta", - ":bsmd:bsmdePhi", - ":bsmd:bsmdp_cluster", - ":bsmd:bsmdp_cluster_energy", - ":bsmd:bsmdpClNum", - ":bsmd:bsmdpClEnergy", - ":bsmd:bsmdpEta", - ":bsmd:bsmdpPhi", ":emc:EmcCat1_Point_Energy", ":emc:EmcCat1_Point_Eta", ":emc:EmcCat1_Point_Phi", diff --git a/StRoot/St_QA_Maker/StEventQAMaker.cxx b/StRoot/St_QA_Maker/StEventQAMaker.cxx index b25f8942723..b053f2346ea 100644 --- a/StRoot/St_QA_Maker/StEventQAMaker.cxx +++ b/StRoot/St_QA_Maker/StEventQAMaker.cxx @@ -2059,13 +2059,17 @@ void StEventQAMaker::MakeHistEMC() { if(module) { StSPtrVecEmcRawHit& rawHit=module->hits(); - Int_t m,e,s,adc; + Int_t m,e,s,adc,sId,stripInMod; Float_t eta(0),phi(0),E(0); nh += rawHit.size(); for(UInt_t k=0;kmodule(); e = rawHit[k]->eta(); s = rawHit[k]->sub(); + emcGeom[i]->getId(m, e, s, sId); + stripInMod = sId % 150; // only used for BSMD + if (stripInMod==0) stripInMod=150; + // cout << "strip Id = " << sId << ", strip in Module = " << stripInMod << endl; if (s == -1) s = 1; // case of smde adc = rawHit[k]->adc(); E = rawHit[k]->energy(); @@ -2075,6 +2079,21 @@ void StEventQAMaker::MakeHistEMC() { hists->m_emc_energy2D[i]->Fill(eta,phi,E); hists->m_emc_adc[i]->Fill(float(adc)); hists->m_emc_energy[i]->Fill(E); + + if (i>1) { // BSMD module hists + + Int_t modIndex = (m-1)/30; + Int_t histIndex = modIndex; + if (i>2) histIndex = modIndex + 4; + + hists->m_emc_hits_per_module[histIndex]->Fill(m); + hists->m_emc_energy_per_module[histIndex]->Fill(m,E); + hists->m_emc_strip_hits_per_module[histIndex]->Fill(m,stripInMod); + hists->m_emc_strip_energy_per_module[histIndex]->Fill(m,stripInMod,E); + + } + + energy += E; } } diff --git a/StRoot/St_QA_Maker/StQABookHist.cxx b/StRoot/St_QA_Maker/StQABookHist.cxx index 042f1ae8cdf..0581c446b85 100644 --- a/StRoot/St_QA_Maker/StQABookHist.cxx +++ b/StRoot/St_QA_Maker/StQABookHist.cxx @@ -771,6 +771,14 @@ StQABookHist::StQABookHist(const char* type) : QAHistType(type) { m_emc_energy[i]=0; //! } +// for EMC-BSMD hits + for (i=0; i<8; i++) { + m_emc_hits_per_module[i]=0; //! + m_emc_energy_per_module[i]=0; //! + m_emc_strip_hits_per_module[i]=0; //! + m_emc_strip_energy_per_module[i]=0; //! + } + // for EMC cluster finder m_emc_ncl=0; //! m_emc_etotCl=0; //! @@ -2014,6 +2022,12 @@ void StQABookHist::BookHistEMC(){ const Char_t* tit={"Barrel"}; const Int_t nx[4] = {40,40,300,20}; const Int_t ny[4] = {120, 120, 60, 900}; + + // for BSMD per-module histos + Axis_t ModNumLo[4] = {1.,31.,61.,91.}; + Axis_t ModNumHi[4] = {31.,61.,91.,121.}; + const TString PerModuleHistName[4] = {"West1","West2","East1","East2"}; + Float_t rpi = M_PI + 0.00001; TString name, title; TArrayD *xb = StEmcMath::binForSmde(); @@ -2025,7 +2039,7 @@ void StQABookHist::BookHistEMC(){ else m_emc_hits[i] = QAH::H2F(name,title, nx[i],-1.,+1., ny[i],-rpi, rpi); name = detname[i] + "Energy2D"; - title = tit + detname[i] + " energy dist. in eta&phi"; + title = tit + detname[i] + " energy dist. in eta-phi"; if(i==2) m_emc_energy2D[i] = QAH::H2F(name,title, xb->GetSize()-1,xb->GetArray(), ny[i],-rpi,rpi); else m_emc_energy2D[i] = QAH::H2F(name,title, nx[i],-1.,+1., ny[i],-rpi, rpi); @@ -2039,6 +2053,30 @@ void StQABookHist::BookHistEMC(){ } delete xb; + for(Int_t i=2; i<4; i++){ // Detector ID for BSMDE and BSMDP (BSMD eta and phi) + for (Int_t j=0; j<4; j++){ // split 120 modules into 4 histos + + Int_t k = j; + if (i>2) k = j + 4; + + name = detname[i] + PerModuleHistName[j] + "HitsPerModule"; + title = tit + detname[i] + " " + PerModuleHistName[j] + " - hits per module"; + m_emc_hits_per_module[k] = QAH::H1F(name,title, 30, ModNumLo[j], ModNumHi[j]); + + name = detname[i] + PerModuleHistName[j] + "EnergyPerModule"; + title = tit + detname[i] + " " + PerModuleHistName[j] + " - energy-weighted hits per module"; + m_emc_energy_per_module[k] = QAH::H1F(name,title, 30, ModNumLo[j], ModNumHi[j]); + + name = detname[i] + PerModuleHistName[j] + "StripHitsPerModule"; + title = tit + detname[i] + " " + PerModuleHistName[j] + " - hits in strip (within mod) vs. mod"; + m_emc_strip_hits_per_module[k] = QAH::H2F(name,title, 30, ModNumLo[j], ModNumHi[j], 150, 1., 151.); + + name = detname[i] + PerModuleHistName[j] + "StripEnergyPerModule"; + title = tit + detname[i] + " " + PerModuleHistName[j] + " - energy in strip (within mod) vs. mod"; + m_emc_strip_energy_per_module[k] = QAH::H2F(name,title, 30, ModNumLo[j], ModNumHi[j], 150, 1., 151.); + } + } + // Book the hists for cluster finder Int_t greta[4]={40,40,300,20}; // eta bins Int_t grphi[4]={120,120,60,900}; // phi bins => 16-apr by PAI diff --git a/StRoot/St_QA_Maker/StQABookHist.h b/StRoot/St_QA_Maker/StQABookHist.h index 552d33b0794..f151c6055dc 100644 --- a/StRoot/St_QA_Maker/StQABookHist.h +++ b/StRoot/St_QA_Maker/StQABookHist.h @@ -658,6 +658,10 @@ class StQABookHist : public TObject { TH2F *m_emc_energy2D[4]; //! TH1F *m_emc_adc[4]; //! TH1F *m_emc_energy[4]; //! + TH1F *m_emc_hits_per_module[8]; // SM added for BSMD eta and phi, West and East Barrels, split into 30 modules each + TH1F *m_emc_energy_per_module[8]; // SM added for BSMD eta and phi, West and East Barrels, split into 30 modules each + TH2F *m_emc_strip_hits_per_module[8]; // SM added for BSMD eta and phi, West and East Barrels, split into 30 modules each + TH2F *m_emc_strip_energy_per_module[8]; // SM added for BSMD eta and phi, West and East Barrels, split into 30 modules each // Hists for EMC cluster finder TH2F *m_emc_ncl; //! From 4a77f5c6d96e9ba2898c7e7b97f7c26c1de81f29 Mon Sep 17 00:00:00 2001 From: YannickSoehngen <60179883+YannickSoehngen@users.noreply.github.com> Date: Thu, 12 Sep 2024 17:19:58 +0200 Subject: [PATCH 14/19] Fix match flag and efficiency (#703) New match flag scheme for picoDsts and fix of overlap matching Comments regarding functionality were addressed, changes addressing style will be taken care of in full scale in follow up PR. --------- Co-authored-by: Yannick Soehngen Co-authored-by: Yannick Soehngen Co-authored-by: Dmitri Smirnov Co-authored-by: Yannick Soehngen Co-authored-by: Yannick Soehngen Co-authored-by: Yannick Soehngen Co-authored-by: Yannick Soehngen Co-authored-by: Yannick Soehngen Co-authored-by: Yannick Soehngen Co-authored-by: Gene Van Buren <85305093+genevb@users.noreply.github.com> --- StRoot/StETofMatchMaker/StETofMatchMaker.cxx | 238 ++++++++++++++----- StRoot/StETofMatchMaker/StETofMatchMaker.h | 1 + 2 files changed, 175 insertions(+), 64 deletions(-) diff --git a/StRoot/StETofMatchMaker/StETofMatchMaker.cxx b/StRoot/StETofMatchMaker/StETofMatchMaker.cxx index ac1472fcfa4..f497589bf49 100644 --- a/StRoot/StETofMatchMaker/StETofMatchMaker.cxx +++ b/StRoot/StETofMatchMaker/StETofMatchMaker.cxx @@ -3234,8 +3234,7 @@ void StETofMatchMaker::checkClockJumps() //--------------------------------------------------------------------------- void StETofMatchMaker::sortMatchCases( eTofHitVec inputVec , std::map< Int_t, eTofHitVec >& outputMap ) -{ - +{ // sort & flag Match candidates @@ -3248,77 +3247,59 @@ StETofMatchMaker::sortMatchCases( eTofHitVec inputVec , std::map< Int_t, eTofHi MMMap.clear(); eTofHitVec ssVec; - - // get multi Hit sets - // int deltaSize = 0; + // get multi Hit sets eTofHitVecIter tempIter = tempVec.begin(); - eTofHitVecIter erasedIter = erasedVec.begin(); - if(tempVec.size() < 1 ) return; + + eTofHitVec storeVecTmp; + + while(tempVec.size() > 0){ + + std::vector< int > trackIdVec; + std::vector< int > hitIdVec; + trackIdVec.clear(); + hitIdVec.clear(); + tempIter = tempVec.begin(); + storeVecTmp.push_back(tempVec.at(0)); + trackIdVec.push_back(tempVec.at(0).trackId); + hitIdVec.push_back(tempVec.at(0).index2ETofHit); + tempVec.erase(tempVec.begin()); + bool done = false; + + while(!done){ + + unsigned int sizeOld = storeVecTmp.size(); + unsigned int size = tempVec.size(); + tempIter= tempVec.begin(); + + for(unsigned int i=0; i < size; i++){ + + if( (std::find(trackIdVec.begin(), trackIdVec.end(), tempVec.at(i).trackId) != trackIdVec.end()) || (std::find(hitIdVec.begin(), hitIdVec.end(), tempVec.at(i).index2ETofHit) != hitIdVec.end()) ){ + + storeVecTmp.push_back(tempVec.at(i)); + trackIdVec.push_back(tempVec.at(i).trackId); + hitIdVec.push_back(tempVec.at(i).index2ETofHit); + tempVec.erase(tempIter); + + i = 0; + size = tempVec.size(); + tempIter = tempVec.begin(); + }else{ + tempIter++; + } + } + done = ( sizeOld == storeVecTmp.size() ); - while( tempVec.size() != 0 ) { - - tempIter = tempVec.begin(); - erasedIter = erasedVec.begin(); - - - tempMMVec.push_back(*tempIter); - erasedVec.erase( erasedIter ); - - // int sizeOld = tempMMVec.size(); - int count =0; - int countwhile = 0; - - for(unsigned int s =0; s < tempMMVec.size(); s++){ - - count++; - - erasedIter = erasedVec.begin(); - - if(erasedVec.size() <= 0 ) continue; - - countwhile = 0; - - while( erasedIter != erasedVec.end() ) { - - countwhile++; - - if(tempMMVec.at(s).trackId == erasedIter->trackId && tempMMVec.at(s).index2ETofHit == erasedIter->index2ETofHit){ - - erasedVec.erase( erasedIter ); - erasedIter++; - continue;} - if(tempMMVec.at(s).trackId == erasedIter->trackId || tempMMVec.at(s).index2ETofHit == erasedIter->index2ETofHit){ - if(!mIsSim){ - // erasedIter->matchFlag = 0; - } - tempMMVec.push_back(*erasedIter); - - erasedVec.erase( erasedIter ); - - } - if( erasedVec.size() <= 0 ) break; - if( erasedIter == erasedVec.end()) break; - erasedIter++; - - } //while inner - - }// for - - // deltaSize = sizeOld - tempMMVec.size(); + }// while done - MMMap[tempMMVec.begin()->trackId] = tempMMVec; - tempMMVec.clear(); + MMMap[storeVecTmp.begin()->trackId] = storeVecTmp; + storeVecTmp.clear(); - tempVec = erasedVec; - } - + }// while all hits on counter outputMap = MMMap; - - } //--------------------------------------------------------------------------- void @@ -3926,4 +3907,133 @@ StETofMatchMaker::sortandcluster(eTofHitVec& matchCandVec , eTofHitVec& detector } }// loop over MMMap }//loop over counters + + sortOutOlDoubles(finalMatchVec); +} + +void +StETofMatchMaker::sortOutOlDoubles(eTofHitVec& finalMatchVec){ + + eTofHitVec overlapHitVec; + + eTofHitVec tempVecOL = finalMatchVec; + + std::vector trackIdVec; + + for(unsigned int i =0; i< finalMatchVec.size(); i++){ + + if( !(std::find(trackIdVec.begin(), trackIdVec.end(), finalMatchVec.at(i).trackId) != trackIdVec.end())){ + + trackIdVec.push_back(finalMatchVec.at(i).trackId); + + int counterId1 = (finalMatchVec.at(i).sector*100) + (finalMatchVec.at(i).plane*10) + (finalMatchVec.at(i).counter); + + for(unsigned int j =0; j< finalMatchVec.size(); j++){ + + int counterId2 = (finalMatchVec.at(j).sector*100) + (finalMatchVec.at(j).plane*10) + (finalMatchVec.at(j).counter); + + if(counterId1 != counterId2 && finalMatchVec.at(i).trackId == finalMatchVec.at(j).trackId){ + + if(!(finalMatchVec.at(j).matchFlag % 2)) finalMatchVec.at(j).matchFlag++; + if(!(finalMatchVec.at(i).matchFlag % 2)) finalMatchVec.at(i).matchFlag++; + + } + } + } + } + + eTofHitVec tmpVec; + eTofHitVec OlVec; + std::map< int , eTofHitVec > overlapHitMap; + + tmpVec = finalMatchVec; + finalMatchVec.clear(); + finalMatchVec.resize(0); + + for(unsigned int i=0; i< tmpVec.size(); i++){ + + if(tmpVec.at(i).matchFlag%2 == 0){ + finalMatchVec.push_back(tmpVec.at(i)); + }else{ + OlVec.push_back(tmpVec.at(i)); + } + } + + // sort out OlVec + for(unsigned int i =0; i < OlVec.size(); i++){ + overlapHitMap[OlVec.at(i).trackId].push_back(OlVec.at(i)); + } + + map::iterator it; + + for (it = overlapHitMap.begin(); it != overlapHitMap.end(); it++){ + + eTofHitVec trackVec = it->second; + int ind_best = 0; + int dr_best = 9999; + + for(unsigned int n=0; n< trackVec.size();n++){ + + float dr = sqrt((trackVec.at(n).deltaX * trackVec.at(n).deltaX ) + (trackVec.at(n).deltaY * trackVec.at(n).deltaY )); + + if(dr < dr_best){ + dr_best=dr; + ind_best=n; + } + } + finalMatchVec.push_back(trackVec.at(ind_best)); + } + + //fix matchFlags + // New match-flag scheme provides information on hit-type, match case, and overlap + // 0: no valid match, otherwise 3 digits encode at first position hit type , at second position overlap info and at third position match type + // hit types : 0 = single sided hits only (time resolution about 25 ps lower than for normal hits) + // hit types : 1 = single sided and normal hits got merged into "mixed hit" for matching + // hit types : 2 = normal hits only (best quality , most common case) + // overlap info : 0 = hit has no contribution from overlap + // overlap info : 1 = hit has only contributions from overlap + // overlap info : 2 = hit has contributions from inside and outside of overlap region + // match case : 0 = no match + // match case : 1 = match from cluster of multiple hits and multiple tracks close in space ( ambiguities leave room for missmatches -> frequent case for most central events!!) + // match case : 2 = single hit could have been matched to multiple tracks + // match case : 3 = single track could have been matched to multiple hits + // match case : 4 = single track matched to single hit ( no ambiguity -> best quality) + // example :: matchFlag = 204 -> 2 = only normal hits, 0 = not in overlap, 4 = single track single hit match + + for(unsigned int i =0; i< finalMatchVec.size(); i++){ + + char singlemixdouble = 9; + char matchcase = 9; + char isOl = 9; + + switch (finalMatchVec.at(i).matchFlag / 100) { + case 1 : matchcase = 4; break; + case 2 : matchcase = 3; break; + case 3 : matchcase = 2; break; + case 4 : matchcase = 1; break; + default : { LOG_WARN << "Errant ETOF match flag for matchcase!" << endm; } + } + + isOl = 1 - ( finalMatchVec.at(i).matchFlag % 2 ); + + switch (finalMatchVec.at(i).matchFlag % 100) { + case 10 : + case 11 : + case 30 : + case 31 : singlemixdouble = 2; break; + case 20 : + case 21 : + case 40 : + case 41 : singlemixdouble = 0; break; + case 50 : + case 51 : singlemixdouble = 1; break; + default : { LOG_WARN << "Errant ETOF match flag for singlemixdouble!" << endm; } + } + + char newFlag = (singlemixdouble*100) + (isOl*10) + (matchcase); + + if(singlemixdouble == 9 || isOl == 9 || matchcase == 9) newFlag = 0; + + finalMatchVec.at(i).matchFlag = newFlag; + } } diff --git a/StRoot/StETofMatchMaker/StETofMatchMaker.h b/StRoot/StETofMatchMaker/StETofMatchMaker.h index ecd274085eb..df198ab880a 100644 --- a/StRoot/StETofMatchMaker/StETofMatchMaker.h +++ b/StRoot/StETofMatchMaker/StETofMatchMaker.h @@ -166,6 +166,7 @@ class StETofMatchMaker : public StMaker { void sortandcluster(eTofHitVec& matchCandVec , eTofHitVec& detectorHitVec , eTofHitVec& intersectionVec , eTofHitVec& finalMatchVec); void sortMatchCases( eTofHitVec inputVec , std::map< Int_t, eTofHitVec >& outputMap ); + void sortOutOlDoubles( eTofHitVec& finalMatchVec); double startTimeBTof(); double startTimeETof( const eTofHitVec& finalMatchVec, unsigned int& nCand_etofT0 ); From ef11af1532270f70464acb32bf95081fead2eafd Mon Sep 17 00:00:00 2001 From: dkapukchyan Date: Wed, 2 Oct 2024 09:40:50 -0700 Subject: [PATCH 15/19] Modify StEpdHitMaker to read EpdHits from MuDst trigger data (#710) Modified and added ability to StEpdHitMaker to make EPD hit collection by reading trigger data from MuDst trees. --- StRoot/StEpdHitMaker/StEpdHitMaker.cxx | 39 ++++++++++++++++++-------- StRoot/StEpdHitMaker/StEpdHitMaker.h | 11 ++++++-- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/StRoot/StEpdHitMaker/StEpdHitMaker.cxx b/StRoot/StEpdHitMaker/StEpdHitMaker.cxx index c17a34d4d86..2c0b37a07bd 100644 --- a/StRoot/StEpdHitMaker/StEpdHitMaker.cxx +++ b/StRoot/StEpdHitMaker/StEpdHitMaker.cxx @@ -23,6 +23,7 @@ #include "StEvent/StEpdCollection.h" #include "StEpdDbMaker/StEpdDbMaker.h" +#include "StMuDSTMaker/COMMON/StMuTypes.hh" #include #include @@ -47,6 +48,13 @@ int StEpdHitMaker::Init(){ int StEpdHitMaker::Make(){ mEventCounter++ ; mTriggerEventCounter++; + if( mReadMuDst ){ + StMuDst* mudst = (StMuDst*)GetInputDS("MuDst"); + if(!mudst){LOG_ERROR<<"StEpdHitMaker::GetEpdCollection found no StMuDst"<epdHits(); + if( epdhits!=0 && epdhits->GetEntriesFast()!=0 ){ return kStOk; } //If processing MuDsts and non-zero hits exist in MuDst then stop and just use those hits otherwise fill StEvent + } + mTriggerData = this->GetTriggerData(); if (!mTriggerData){ LOG_ERROR << "StEpdHitMaker::Make - no TriggerData object" << endm; @@ -81,13 +89,22 @@ int StEpdHitMaker::Finish(){ } //---------------------------------------------- -StTriggerData* StEpdHitMaker::GetTriggerData(){ - StTriggerData* trg=0; - mStEvent = dynamic_cast (GetInputDS("StEvent")); // this is how the StBtofHitMaker does it. - if (mStEvent){ - trg = mStEvent->triggerData(); +const StTriggerData* StEpdHitMaker::GetTriggerData(){ + const StTriggerData* trg=0; + if( mReadMuDst ){ + StMuDst* mudst = (StMuDst*)GetInputDS("MuDst"); + if( mudst==0 ){ LOG_ERROR << "StEpdHitMaker::GetTriggerData - !StMuDst" << endm; return 0; } + StMuEvent* muevent = mudst->event(); + if( muevent==0 ){ LOG_ERROR <<"StEpdHitMaker::GetTriggerData - !StMuEvent" <triggerData(); } + } + else{ + mStEvent = dynamic_cast (GetInputDS("StEvent")); // this is how the StBtofHitMaker does it. + if (mStEvent){ + trg = mStEvent->triggerData(); + } + else {LOG_WARN << "No StEvent found by StEpdHitMaker::GetTriggerData" << endm;} } - else {LOG_WARN << "No StEvent found by StEpdHitMaker::GetTriggerData" << endm;} return trg; } @@ -95,6 +112,7 @@ StTriggerData* StEpdHitMaker::GetTriggerData(){ // this is patterned after the StBTofHitMaker StEpdCollection* StEpdHitMaker::GetEpdCollection(){ StEpdCollection* epdCollection = 0; + //This will get executed if no epdhits from mudsts. This way it will still generate the epd collection mStEvent = dynamic_cast (GetInputDS("StEvent")); // this is how the StBtofHitMaker does it. if (mStEvent){ epdCollection = mStEvent->epdCollection(); @@ -104,20 +122,17 @@ StEpdCollection* StEpdHitMaker::GetEpdCollection(){ epdCollection = new StEpdCollection(); mStEvent->setEpdCollection(epdCollection); } - else { + else { LOG_INFO << "StEpdHitMaker::GetEpdCollection - StEvent already has a StEpdCollection - not making a new one" << endm; } } - else { - LOG_WARN << "No StEvent found by StEpdHitMaker::GetEpdCollection" << endm; - } - + else{ LOG_WARN << "No StEvent found by StEpdHitMaker::GetEpdCollection" << endm; } return epdCollection; } void StEpdHitMaker::FillStEpdData(){ - StTriggerData* trg=mTriggerData; + const StTriggerData* trg=mTriggerData; // This is for BBC. We can do this if we ever have a StBbc class. // for (Int_t ew=0; ew<2; ew++){ diff --git a/StRoot/StEpdHitMaker/StEpdHitMaker.h b/StRoot/StEpdHitMaker/StEpdHitMaker.h index 5a0c6ceefc9..bad26f3aa48 100644 --- a/StRoot/StEpdHitMaker/StEpdHitMaker.h +++ b/StRoot/StEpdHitMaker/StEpdHitMaker.h @@ -13,6 +13,10 @@ If it is not there, it creates one and fills it from the StTriggerData object and info from the StEpdDbMaker (database) + \author David Kapukchyan + \date 10 July 2024 + It can also process trigger data from Mudst data by calling #setReadMuDst(). Need to call StEventMaker to make it work right though since this maker will still fill into StEvent. This was done so StEvent will clean the collection from event to event. + */ @@ -39,11 +43,13 @@ class StEpdHitMaker : public StMaker { /// Finish does nothing right now virtual int Finish(); + void setReadMuDst(bool value=true){ mReadMuDst=value; } + /// Returns the collection of StEpdHits in the event StEpdCollection* GetEpdCollection(); // collection of StEpdHit objects /// Returns a pointer to the StTriggerData object - StTriggerData* GetTriggerData(); + const StTriggerData* GetTriggerData(); /// Returns a pointer to the StEpdDbMaker StEpdDbMaker* GetEpdDbMaker(); @@ -62,10 +68,11 @@ class StEpdHitMaker : public StMaker { int mEventCounter; /// simple event counter int mTriggerEventCounter; /// another event counter. At the moment, it is redundant with mEventCounter StEpdCollection* mEpdCollection; - StTriggerData* mTriggerData; + const StTriggerData* mTriggerData; StEpdDbMaker* mEpdDbMaker; StEvent* mStEvent; + bool mReadMuDst = false; // static const int mNPREPOST=2; From 5e764be71087349708972e08bf0c35d8b45c413a Mon Sep 17 00:00:00 2001 From: Dmitry Arkhipkin Date: Wed, 2 Oct 2024 15:09:29 -0400 Subject: [PATCH 16/19] new ETOF table for Yannick (#712) Subj. A new Offline DB table was created for Yannick. Let's see if 4MB records are manageable... https://drupal.star.bnl.gov/STAR/subsys/etof/etof-database-tables/etof-get4state --- StDb/idl/etofGet4State.idl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 StDb/idl/etofGet4State.idl diff --git a/StDb/idl/etofGet4State.idl b/StDb/idl/etofGet4State.idl new file mode 100644 index 00000000000..4df5fd33fd3 --- /dev/null +++ b/StDb/idl/etofGet4State.idl @@ -0,0 +1,16 @@ +/* etofGet4State.idl +* +* table: etofGet4State +* +* description:Get4States and state changes dealing with "Clock-Jumps" +* 0 - good, 1 - too early by 6.25ns ,2 too late by 6.25 ns,3 - bad +* +* author: Yannick Söhngen ( PI Heidelberg ) +* +*/ + +struct etofGet4State { + + unsigned long etofGet4State[1000000]; /* state of get4s, changes & event id */ + +}; \ No newline at end of file From f9b81a7b672da271be2d04430719e7969e59266a Mon Sep 17 00:00:00 2001 From: Gene Van Buren <85305093+genevb@users.noreply.github.com> Date: Mon, 7 Oct 2024 19:04:04 -0400 Subject: [PATCH 17/19] Setup AA chain for Run 24 (#713) Introduce `P2024a`, a copy of `P2023a` modified for the 2024 geometry, for the AuAu data taken at the end of Run 24. This is needed promptly for FastOffline. --- StRoot/StBFChain/BigFullChain.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/StRoot/StBFChain/BigFullChain.h b/StRoot/StBFChain/BigFullChain.h index e467550a794..a11ea2a7361 100644 --- a/StRoot/StBFChain/BigFullChain.h +++ b/StRoot/StBFChain/BigFullChain.h @@ -1055,6 +1055,10 @@ Bfc_st BFC[] = { // standard chains "B2024a,ITTF,BAna,ppOpt,ImpBToFt0Mode,VFPPVnoCTB,beamline3D,l3onl,epdhit,btof,mtd,emcDY2,ftt,fcs,trgd,ZDCvtx,analysis", "","","Production chain for year 2024 pp data - CorrY (+ l3, epd, mtd, btof, fcs, ftt, e/b-emc)",kFALSE}, + {"P2024a","" ,"", + "B2024a,ITTF,BAna,iTpcIT,VFMinuit,etofa,btof,mtd,l3onl,emcDY2,epdHit,trgd,ZDCvtx,analysis", + "","", "Base chain for year 2024 AA data - CorrY (+ l3, epd, mtd, b/etof, b-emc)",kFALSE}, + // Other chains/Calibration {"LaserCal0","" ,"","db,detDb,tpc_daq,tpcDb,tcl,globT,laser,LaserTest","","" From 3271996398d2017671e5edea596f9b660fc37a1c Mon Sep 17 00:00:00 2001 From: YannickSoehngen <60179883+YannickSoehngen@users.noreply.github.com> Date: Thu, 17 Oct 2024 16:42:45 +0200 Subject: [PATCH 18/19] Clock jump calibration (#711) Methods for retrieving get4 state from db and flagging calibrated hits --------- Co-authored-by: Yannick Soehngen Co-authored-by: Yannick Soehngen Co-authored-by: Dmitri Smirnov Co-authored-by: Yannick Soehngen Co-authored-by: Yannick Soehngen Co-authored-by: Yannick Soehngen Co-authored-by: Yannick Soehngen Co-authored-by: Yannick Soehngen Co-authored-by: Yannick Soehngen Co-authored-by: Gene Van Buren <85305093+genevb@users.noreply.github.com> --- StRoot/StETofCalibMaker/StETofCalibMaker.cxx | 388 +++++++++++++++++-- StRoot/StETofCalibMaker/StETofCalibMaker.h | 23 +- StRoot/StETofMatchMaker/StETofMatchMaker.cxx | 37 +- 3 files changed, 416 insertions(+), 32 deletions(-) diff --git a/StRoot/StETofCalibMaker/StETofCalibMaker.cxx b/StRoot/StETofCalibMaker/StETofCalibMaker.cxx index b706e396426..528d9a47d3e 100644 --- a/StRoot/StETofCalibMaker/StETofCalibMaker.cxx +++ b/StRoot/StETofCalibMaker/StETofCalibMaker.cxx @@ -80,6 +80,7 @@ #include "tables/St_etofResetTimeCorr_Table.h" #include "tables/St_etofPulserTotPeak_Table.h" #include "tables/St_etofPulserTimeDiffGbtx_Table.h" +#include "tables/St_etofGet4State_Table.h" namespace etofSlewing { const unsigned int nTotBins = 30; @@ -117,7 +118,17 @@ StETofCalibMaker::StETofCalibMaker( const char* name ) mUsePulserGbtxDiff( true ), mDoQA( false ), mDebug( false ), - mHistFileName( "" ) + mHistFileName( "" ), + mFileNameGet4State(""), + mStateVec(), + mStartVec(), + mGet4StateMap(), + mStateMapStart(0), + mStateMapStop(0), + mDbEntryStart(0), + mDbEntryStop(0), + mGlobalCounter(1) + { /// default constructor LOG_DEBUG << "StETofCalibMaker::ctor" << endm; @@ -132,9 +143,9 @@ StETofCalibMaker::StETofCalibMaker( const char* name ) mPulserPeakTot.clear(); mPulserTimeDiff.clear(); mPulserTimeDiffGbtx.clear(); - mNPulsersCounter.clear(); - mNStatusBitsCounter.clear(); - mPulserPresent.clear(); + mNPulsersCounter.clear(); + mNStatusBitsCounter.clear(); + mPulserPresent.clear(); mJumpingPulsers.clear(); @@ -177,6 +188,7 @@ StETofCalibMaker::InitRun( Int_t runnumber ) // -------------------------------------------------------------------------------------------- // initialize calibration parameters from parameter file (if filename is provided) or database: + // -- Get4 status map (Clock-Jump-Correction) // -- electronics-to-hardware map // -- status map // -- timing window @@ -188,6 +200,10 @@ StETofCalibMaker::InitRun( Int_t runnumber ) // -- reset time correction // -------------------------------------------------------------------------------------------- + //Get4 status map + + readGet4State(mGlobalCounter , 0); + // electronics-to-hardware map if( mFileNameElectronicsMap.empty() ) { LOG_INFO << "etofElectronicsMap: no filename provided --> load database table" << endm; @@ -1080,6 +1096,11 @@ StETofCalibMaker::FinishRun( Int_t runnumber ) mJumpingPulsers.clear(); + mGet4StateMap.clear(); + mGet4ZeroStateMap.clear(); + mMasterStartVec.clear(); + + return kStOk; } @@ -1106,6 +1127,35 @@ StETofCalibMaker::Make() mEvent = ( StEvent* ) GetInputDS( "StEvent" ); //mEvent = NULL; //don't check for StEvent for genDst.C testing. PW + //check if get4 state map is still valid for this event + + unsigned long int evtNr = GetEventNumber(); + if(mFileNameGet4State.empty()){ + //read from db + + if( evtNr > mDbEntryStop || evtNr < mDbEntryStart) readGet4State(mGlobalCounter , 99); + + }else{ + //read from file + short cnt = 0; + while( evtNr > mDbEntryStop || evtNr < mDbEntryStart){ + + cnt++; + if(cnt > 99){ + LOG_ERROR << " Get4 State File for event Nr:" << GetEventNumber() << "not found" << endm; + return kStFatal; + } + + short forward = 1; + if(evtNr < mDbEntryStart) forward = -1; + readGet4State(mGlobalCounter , forward); + } + + + } + checkGet4State( evtNr ); + + if ( mEvent ) { LOG_DEBUG << "Make(): running on StEvent" << endm; @@ -1238,12 +1288,8 @@ StETofCalibMaker::processStEvent() std::vector hasPulsersVec; //drag along pulser information - for( unsigned int iCounter = 0; iCounter < 108; iCounter++){ - if ( !(mNPulsersCounter.count(iCounter) ) ){ - hasPulsersVec.push_back(false); - }else{ - hasPulsersVec.push_back(mNPulsersCounter[iCounter] == 2); - } + for( unsigned int iCounter = 0; iCounter < 108; iCounter++){ + hasPulsersVec.push_back((mNPulsersCounter.count(iCounter) > 0) && (mNPulsersCounter[iCounter] == 2)); } if (hasPulsersVec.size() == 108){ //etofHeader->setHasPulsersVec(hasPulsersVec); // not working but not of relevance at the moment @@ -1406,12 +1452,8 @@ StETofCalibMaker::processMuDst() std::vector hasPulsersVec;// //drag along pulser information - for( unsigned int iCounter = 0; iCounter < 108; iCounter++){ - if ( !(mNPulsersCounter.count(iCounter) ) ){ - hasPulsersVec.push_back(false); - }else{ - hasPulsersVec.push_back(mNPulsersCounter[iCounter] == 2); - } + for( unsigned int iCounter = 0; iCounter < 108; iCounter++){ + hasPulsersVec.push_back((mNPulsersCounter.count(iCounter) > 0) && (mNPulsersCounter[iCounter] == 2)); } if (hasPulsersVec.size() == 108){ @@ -1421,6 +1463,11 @@ StETofCalibMaker::processMuDst() //fill good event flag into header for( unsigned int iGet4 = 0; iGet4 < 1728; iGet4++){ goodEventFlagVec.push_back(!etofHeader->missMatchFlagVec().at(iGet4)); + + //flag jumpwise inconsistent events/get4s + if(mGet4StateMap[iGet4] == 3){ + goodEventFlagVec.at(iGet4) = false; + } } if (goodEventFlagVec.size() == 1728){ @@ -1573,15 +1620,12 @@ StETofCalibMaker::flagPulserDigis( StETofDigi* aDigi, unsigned int index, std::m float totToPeak = aDigi->rawTot() - mPulserPeakTot.at( key ); float totToHalfPeak = aDigi->rawTot() - mPulserPeakTot.at( key ) * 0.5; - - if( timeToTrigger > mPulserWindow.at( aDigi->rocId() ).first && timeToTrigger < mPulserWindow.at( aDigi->rocId() ).second ) { - if( fabs( totToPeak ) < 25 || fabs( totToHalfPeak ) < 10 ) { - isPulserCand = true; - } - } + isPulserCand = ( timeToTrigger > mPulserWindow.at( aDigi->rocId() ).first && + timeToTrigger < mPulserWindow.at( aDigi->rocId() ).second && + ( fabs( totToPeak ) < 25 || fabs( totToHalfPeak ) < 10 ) ); + } - if( isPulserCand ) { pulserDigiMap[ key ].push_back( index ); } @@ -2119,14 +2163,28 @@ StETofCalibMaker::applyCalibration( StETofDigi* aDigi, StETofHeader* etofHeader aDigi->setCalibTot( calibTot ); + int get4Id = 144 * ( aDigi->sector() - 13 ) + 48 * ( aDigi->zPlane() -1 ) + 16 * ( aDigi->counter() - 1 ) + 8 * ( aDigi->side() - 1 ) + ( ( aDigi->strip() - 1 ) / 4 ); + + double stateCorr =0; + if(mGet4StateMap[get4Id] == 1) stateCorr = 6.25; + else if(mGet4StateMap[get4Id] == 2) stateCorr = -6.25; + // else if(mGet4StateMap[get4Id] == 3) stateCorr = 0.0; + double calibTime = aDigi->rawTime() - mResetTime - resetTimeCorr() - calibTimeOffset( aDigi ) - slewingTimeOffset( aDigi ) - - applyPulserOffset( aDigi ); - - aDigi->setCalibTime( calibTime ); - + - applyPulserOffset( aDigi ) + + stateCorr; + + + if(mGet4StateMap[get4Id] == 3){ + calibTime = 0; // mask digis with undefined state (e.g. one hit with jump and one without in same event) + + } + + aDigi->setCalibTime( calibTime ); + if( mDebug ) { // print out the new information LOG_DEBUG << "raw Time, ToT: " << aDigi->rawTime() << ", " << aDigi->rawTot() << endm; @@ -2609,3 +2667,279 @@ StETofCalibMaker::writeHistograms() LOG_INFO << "histogram file name is empty string --> cannot write histograms" << endm; } } + +//-------------------------------------------------------------------------------------------------------------------- + +void StETofCalibMaker::readGet4State(int fileNr, short forward){ + + bool fileZero = false; + + //Clean up last entry first + for(int i =0; i< eTofConst::nGet4sInSystem; i++){ + mStateVec[i].clear(); + mStartVec[i].clear(); + mGet4StateMap[i] = 0; + } + mStateMapStart=0; + mStateMapStop=0; + mDbEntryStop=0; + mMasterStartVec.clear(); + mMasterStartVec.resize(0); + + std::vector< unsigned long int > intVec; + + //first read + if(forward == 0) mGlobalCounter = 1; + //jump forward + else if(forward > 0) mGlobalCounter++; + //jump backward + else mGlobalCounter--; // forward < 0 + + if(mGlobalCounter == 0){ + mGlobalCounter++; + fileZero = true; + } + + if(mFileNameGet4State.empty()){ + + TDataSet* dbDataSet = GetDataBase( "Calibrations/etof/etofGet4State" ); + if( ! dbDataSet ) { + LOG_ERROR << "unable to get the get4 state map database" << endm; + return; + } + const int intsPerEntry = 1000000; + + St_etofGet4State* etofStateMap = static_cast< St_etofGet4State* > ( dbDataSet->Find( "etofGet4State" ) ); + if( !etofStateMap ) { + LOG_ERROR << "unable to get the get4 state map from the database" << endm; + return; + } + + etofGet4State_st* stateMapTable = etofStateMap->GetTable(); + + for( size_t i=0; i< intsPerEntry; i++ ) { + if(stateMapTable->etofGet4State[ i ] <= 0) break; + intVec.push_back( stateMapTable->etofGet4State[ i ]); + } + + }else{ + + std::ifstream paramFile; + + paramFile.open( mFileNameGet4State.c_str() ); + + if( !paramFile.is_open() ) { + LOG_ERROR << "unable to get the 'Get4State' parameters from file --> file does not exist" << endm; + return; + } + + unsigned long int temp; + while( paramFile >> temp ) { + intVec.push_back( temp ); + } + } + + std::vector startVec; + std::map> stateVec; + std::map> get4IdVec; + + decodeInt(intVec , mGet4StateMap , mGet4ZeroStateMap , startVec , mMasterStartVec , stateVec , get4IdVec); + + // fill stateMap & steering vecs with EvtZero entries: read in first 1728 states & times + for(int i = 0; i< eTofConst::nGet4sInSystem;i++){ + + for(unsigned int j=0; j< startVec.size(); j++){ + + unsigned long int key = startVec.at(j); + + for(unsigned int n =0; n < get4IdVec.at(key).size(); n++){ + + //steering vecs + if(i == get4IdVec.at(key).at(n)){ + mStateVec[i].push_back(stateVec.at(key).at(n)); + mStartVec[i].push_back(startVec.at(j)); + } + } + } + } + + //set map validity check evtids ... EvtZero states only valid to first change of state on any get4 + mStateMapStart = 0 ; + mStateMapStop = startVec.at(0); + mDbEntryStart = startVec.at(0); + mDbEntryStop = startVec.at((startVec.size()-1)); + + + if(fileZero){ + mDbEntryStart = 0; + } + + sort( mMasterStartVec.begin(), mMasterStartVec.end() ); + mMasterStartVec.erase( unique( mMasterStartVec.begin(), mMasterStartVec.end() ), mMasterStartVec.end() ); + + } + +// ------------------------------------------------------------------------------- + +void StETofCalibMaker::checkGet4State(unsigned long int eventNr){ + + if(eventNr >= mStateMapStart && eventNr < mStateMapStop) { + return; // stateMap still valid + } + + unsigned long int closestStop = 99999999; + unsigned long int closestStart = 0; + + //loop over stateMap + + for(unsigned int i =0; i< eTofConst::nGet4sInSystem; i++){ + + std::vector tmpStart = mStartVec[i]; + std::vector tmpState = mStateVec[i]; + + //find closest evtNr & state for each Get4 + unsigned int indexStart = 0; + short newState = 0; + + if (tmpStart.empty()) continue; + + auto lower = std::lower_bound(tmpStart.begin(), tmpStart.end(), eventNr); + indexStart = std::distance(tmpStart.begin(), lower); + if(indexStart > 0) indexStart--; + + //event past last change on get4 in entry -> keep last state in line + if(eventNr > tmpStart.at((tmpStart.size() -1))){ + indexStart = (tmpStart.size() -1); + } + + //if state change happens in this very event increase index by one to hit proper state + if((indexStart < (tmpStart.size() -1 )) && eventNr == tmpStart.at(indexStart + 1)){ + indexStart++; + } + + //get new state and push to map + newState = tmpState.at(indexStart); + + if(tmpStart.at(indexStart) > eventNr ) newState = mGet4ZeroStateMap[i]; + + mGet4StateMap[i] = newState; + + } //Get4 Loop + + // bool Found=false; + for(unsigned int z=0; z< mMasterStartVec.size();z++){ + + if(z == 0){ // first interval + closestStart = 0; + closestStop = mMasterStartVec.at(z); + + } else if(z == (mMasterStartVec.size()-1)){ // last interval + closestStart = mMasterStartVec.at(z); + closestStop = 99999999; + // Found = true; + + } else if(eventNr == mMasterStartVec.at(z) || + (eventNr < mMasterStartVec.at(z+1) && eventNr > mMasterStartVec.at(z))){ + closestStart = mMasterStartVec.at(z); + closestStop = mMasterStartVec.at(z+1); + // Found = true; + break; + } + + } + + mStateMapStart = closestStart; + mStateMapStop = closestStop; + + if(mStateMapStart == mDbEntryStop) { + + mStateMapStop = 99999999; + } + +} +//----------------------------------------------------- +void StETofCalibMaker::decodeInt( std::vector intVec ,std::map& mGet4StateMap ,std::map& mGet4ZeroStateMap ,std::vector& startVec ,std::vector& mMasterStartVec ,std::map>& stateVec ,std::map>& get4IdVec){ + + unsigned long int lastEvtId =0; + + for(unsigned int i = 0; i < intVec.size(); i++){ + + int tmp; + int stateInt1; + int stateInt2; + unsigned long int EvtId; + int Get4Id1; + int get4state1; + int Get4Id2; + int get4state2; + + // decode nonZero/stateChange ints ( int = 42.xxx.xxx.xxx = 2 states only) + switch (intVec.at(i) / 100000000) { + + case 42 : + tmp = intVec.at(i) % 4200000000; + stateInt1 = tmp / 10000; + stateInt2 = tmp % 10000; + + Get4Id1 = -1; + get4state1 = -1; + Get4Id2 = -1; + get4state2 = -1; + + if(stateInt1 < 6912){ + Get4Id1 = stateInt1 % eTofConst::nGet4sInSystem; + get4state1 = stateInt1 / eTofConst::nGet4sInSystem; + } + if(stateInt2 < 6912){ + Get4Id2 = stateInt2 % eTofConst::nGet4sInSystem; + get4state2 = stateInt2 / eTofConst::nGet4sInSystem; + } + + if(i < 864){ + mGet4StateMap[Get4Id1] = get4state1; + mGet4StateMap[Get4Id2] = get4state2; + mGet4ZeroStateMap[Get4Id1] = get4state1; + mGet4ZeroStateMap[Get4Id2] = get4state2; + } + stateVec[lastEvtId].push_back(get4state1); + get4IdVec[lastEvtId].push_back(Get4Id1); + stateVec[lastEvtId].push_back(get4state2); + get4IdVec[lastEvtId].push_back(Get4Id2); + + break; + + //decode eventnumber ( int = 40.xxx.xxx.xxx = event number ) + case 40: + + EvtId = intVec.at(i) % 4000000000; + + startVec.push_back(EvtId); + mMasterStartVec.push_back(EvtId); + + lastEvtId = EvtId; + + break; + + // decode nonZero/stateChange ints ( int = 41.xxx.x00.000 = 1 states only) + case 41: + + tmp = intVec.at(i) % 4100000000; + stateInt1 = tmp / 10000; + Get4Id1 = -1; + get4state1 = -1; + + if(stateInt1 < 6912) { + Get4Id1 = stateInt1 % eTofConst::nGet4sInSystem; + get4state1 = stateInt1 / eTofConst::nGet4sInSystem; + } + + stateVec[lastEvtId].push_back(get4state1); + get4IdVec[lastEvtId].push_back(Get4Id1); + + break; + + default: + LOG_ERROR << "Get4 state not well defined -> Check db / state file !" << endm; + } + } +} diff --git a/StRoot/StETofCalibMaker/StETofCalibMaker.h b/StRoot/StETofCalibMaker/StETofCalibMaker.h index 1b7b0d0eaca..bfab902152e 100644 --- a/StRoot/StETofCalibMaker/StETofCalibMaker.h +++ b/StRoot/StETofCalibMaker/StETofCalibMaker.h @@ -1,4 +1,4 @@ - /*************************************************************************** +/*************************************************************************** * * $Id: StETofCalibMaker.h,v 1.6 2019/12/19 02:19:13 fseck Exp $ * @@ -90,6 +90,8 @@ class StETofCalibMaker: public StMaker { void setStrictPulserHandling( const bool debug ); void setReferencePulserIndex( const int index ); + short GetState(int); + //moved to public to avoid problem with root6 struct StructStuckFwDigi{ Int_t geomId; @@ -138,6 +140,8 @@ class StETofCalibMaker: public StMaker { void setHistFileName(); void writeHistograms(); + void readGet4State(int fileNr, short forward); + void checkGet4State( unsigned long int eventNr); StEvent* mEvent; StMuDst* mMuDst; @@ -188,7 +192,7 @@ class StETofCalibMaker: public StMaker { std::vector< StructStuckFwDigi > mStuckFwDigi; // list of digis to ignore for the rest of the run due to stuck firmware - Bool_t mStrictPulserHandling; + Bool_t mStrictPulserHandling; Bool_t mUsePulserGbtxDiff; Bool_t mDoQA; Bool_t mDebug; @@ -196,14 +200,25 @@ class StETofCalibMaker: public StMaker { std::map< std::string, TH1* > mHistograms; + std::string mFileNameGet4State; + std::vector mStateVec[1728]; + std::vector mStartVec[1728]; + std::vector mMasterStartVec; + std::map mGet4StateMap; + std::map mGet4ZeroStateMap; + unsigned long int mStateMapStart; + unsigned long int mStateMapStop; + unsigned long int mDbEntryStart; + unsigned long int mDbEntryStop; + int mGlobalCounter; - + void decodeInt( std::vector intVec ,std::map& mGet4StateMap ,std::map& mGet4ZeroStateMap ,std::vector& startVec ,std::vector& mMasterStartVec ,std::map>& stateVec ,std::map>& get4IdVec); virtual const Char_t *GetCVS() const { static const char cvs[]="Tag $Name: $Id: built " __DATE__ " " __TIME__ ; return cvs; } ClassDef( StETofCalibMaker, 0 ) }; - +inline short StETofCalibMaker::GetState( int get4 ) { return mGet4StateMap.at(get4); } inline void StETofCalibMaker::setFileNameCalibParam( const char* fileName ) { mFileNameCalibParam = fileName; } inline void StETofCalibMaker::setFileNameElectronicsMap( const char* fileName ) { mFileNameElectronicsMap = fileName; } inline void StETofCalibMaker::setFileNameStatusMap( const char* fileName ) { mFileNameStatusMap = fileName; } diff --git a/StRoot/StETofMatchMaker/StETofMatchMaker.cxx b/StRoot/StETofMatchMaker/StETofMatchMaker.cxx index f497589bf49..70bb202e807 100644 --- a/StRoot/StETofMatchMaker/StETofMatchMaker.cxx +++ b/StRoot/StETofMatchMaker/StETofMatchMaker.cxx @@ -90,6 +90,7 @@ #include "StETofMatchMaker.h" #include "StETofHitMaker/StETofHitMaker.h" +#include "StETofCalibMaker/StETofCalibMaker.h" #include "StETofUtil/StETofGeometry.h" #include "StETofUtil/StETofConstants.h" @@ -3305,13 +3306,24 @@ StETofMatchMaker::sortMatchCases( eTofHitVec inputVec , std::map< Int_t, eTofHi void StETofMatchMaker::sortandcluster(eTofHitVec& matchCandVec , eTofHitVec& detectorHitVec , eTofHitVec& intersectionVec , eTofHitVec& finalMatchVec){ + + //flag Overlap-Hits & jumped Hits ------------------------------------------------------------------- - //flag Overlap-Hits ------------------------------------------------------------------- std::map< Int_t, eTofHitVec > overlapHitMap; eTofHitVec overlapHitVec; eTofHitVec tempVecOL = matchCandVec; eTofHitVecIter detHitIter; eTofHitVecIter detHitIter2; + + std::map< int, bool > jumpHitMap; + + for(unsigned int i=0; i 100){ + jumpHitMap[matchCandVec.at(i).index2ETofHit] = true; + }else{ + jumpHitMap[matchCandVec.at(i).index2ETofHit] = false; + } + } for( auto detHitIter = tempVecOL.begin(); detHitIter != tempVecOL.end(); ) { @@ -3908,6 +3920,28 @@ StETofMatchMaker::sortandcluster(eTofHitVec& matchCandVec , eTofHitVec& detector }// loop over MMMap }//loop over counters + //set clustersize for jumped hits: +100 if early , +200 if late, + 300 if still jumped + + for(unsigned int i=0;iGetState(keyGet4up) == 1 || mETofCalibMaker->GetState(keyGet4down) == 1){ + finalMatchVec.at(i).clusterSize += 100; + } + if(mETofCalibMaker->GetState(keyGet4up) == 2 || mETofCalibMaker->GetState(keyGet4down) == 2 ){ + finalMatchVec.at(i).clusterSize += 200; + } + } + sortOutOlDoubles(finalMatchVec); } @@ -4035,5 +4069,6 @@ StETofMatchMaker::sortOutOlDoubles(eTofHitVec& finalMatchVec){ if(singlemixdouble == 9 || isOl == 9 || matchcase == 9) newFlag = 0; finalMatchVec.at(i).matchFlag = newFlag; + } } From a34894eced1af8b404a25be5a5ea30dabd078ece Mon Sep 17 00:00:00 2001 From: Gene Van Buren <85305093+genevb@users.noreply.github.com> Date: Tue, 12 Nov 2024 22:00:51 -0500 Subject: [PATCH 19/19] No StMaker functions if no StMaker loaded (#693) In ROOT6, it isn't enough to just hide a class's functions inside an `if` clause checking the corresponding TClass's existence when the class isn't loaded. This can be demonstrated currently in SL24x by simply executing: ``` root4star -b -l -q ``` ...which produces an error when executing `rootlogoff.C` at quit. Maybe there are other solutions, but this simple proposal breaks `rootlogoff.C` into two parts, not even loading the second part unless the first part is true - test the existence of the StMaker class - execution of StMaker functions I welcome other proposals. --- StRoot/macros/rootlogoff.C | 5 +---- StRoot/macros/rootlogoff2.C | 6 ++++++ 2 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 StRoot/macros/rootlogoff2.C diff --git a/StRoot/macros/rootlogoff.C b/StRoot/macros/rootlogoff.C index 661712dcac2..6fa2c7632d9 100644 --- a/StRoot/macros/rootlogoff.C +++ b/StRoot/macros/rootlogoff.C @@ -1,10 +1,7 @@ { if (TClassTable::GetDict("StMaker")) { - StMaker* mk = StMaker::GetChain(); - if (mk) { - mk->Finish(); - } + gROOT->Macro("rootlogoff2.C"); } std::cout << "\nThis is the end of STAR ROOT -- Goodbye\n" << std::endl; diff --git a/StRoot/macros/rootlogoff2.C b/StRoot/macros/rootlogoff2.C new file mode 100644 index 00000000000..1440421a1ea --- /dev/null +++ b/StRoot/macros/rootlogoff2.C @@ -0,0 +1,6 @@ +{ + StMaker* mk = StMaker::GetChain(); + if (mk) { + mk->Finish(); + } +}