diff --git a/StRoot/StBFChain/BigFullChain.h b/StRoot/StBFChain/BigFullChain.h index 28451b7ade8..57880357085 100644 --- a/StRoot/StBFChain/BigFullChain.h +++ b/StRoot/StBFChain/BigFullChain.h @@ -1046,6 +1046,15 @@ Bfc_st BFC[] = { // standard chains "B2023a,ITTF,BAna,iTpcIT,hitfilt,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 + {"B2024a" ,"","", + "ry2024a,in,tpcX,UseXgeom,iTpcIT,CorrY,AgML,tpcDB,TpcHitMover,Idst,tags,Tree,picoWrite,picoVtxDefault,picoCovMtxWrite", + "","", "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}, + // Other chains/Calibration {"LaserCal0","" ,"","db,detDb,tpc_daq,tpcDb,tcl,globT,laser,LaserTest","","" diff --git a/StRoot/StBTofCalibMaker/StBTofCalibMaker.cxx b/StRoot/StBTofCalibMaker/StBTofCalibMaker.cxx index afc052abba5..c82328a3523 100644 --- a/StRoot/StBTofCalibMaker/StBTofCalibMaker.cxx +++ b/StRoot/StBTofCalibMaker/StBTofCalibMaker.cxx @@ -2835,36 +2835,20 @@ void StBTofCalibMaker::writePPPAHistograms() //_____________________________________________________________________________ float StBTofCalibMaker::tofCellResolution(const Int_t itray, const Int_t iModuleChan) { + float resolution(0.013); // 0.013 by default - 1/beta resolution + if (itray<0){return resolution;} - float resolution(0.013); // 0.013 by default - 1/beta resolution - if (itray<0){return resolution;} - - int module = iModuleChan/6 + 1; - int cell = iModuleChan%6 + 1; - // mBTofRes::timeres_tof() reports in picoseconds - float stop_resolution = mBTofRes->timeres_tof(itray, module, cell)/1000.; - -float start_resolution(0); - if (mUseVpdStart){ - - // For VPD timing determine the VPD starttime by combing the resolutions of - // tray == 122 (east) - // mSimParams[singleHit.tubeId-1+19].singleTubeRes - // tray 121 (west) - // mSimParams[singleHit.tubeId-1].singleTubeRes - // - // needs to be implemented - - } - else { - // combine an average BTOF resolution based on NT0 - // more sophisticated: figure out what BTOF cells actually went into the NT0 count. - - // mBTofRes::timeres_tof() reports in picoseconds - start_resolution = mBTofRes->average_timeres_tof()/sqrt(mNTzero)/1000.; - } + int module = iModuleChan/6 + 1; + int cell = iModuleChan%6 + 1; + // mBTofRes::timeres_tof() reports in picoseconds + float stop_resolution = mBTofRes->timeres_tof(itray, module, cell)/1000.; - resolution = sqrt(stop_resolution*stop_resolution + start_resolution*start_resolution); + float start_resolution = 0.0; + if (mUseVpdStart) + start_resolution = mVpdResConfig->singleTubeRes(mVPDHitPatternEast, mVPDHitPatternWest)/1000.; + else + start_resolution = mBTofRes->average_timeres_tof()/sqrt(mNTzero)/1000.; + resolution = sqrt(stop_resolution*stop_resolution + start_resolution*start_resolution); -return resolution; + return resolution; } diff --git a/StRoot/StBTofUtil/StVpdSimConfig.h b/StRoot/StBTofUtil/StVpdSimConfig.h index 26176a355bd..69d6ee0be95 100644 --- a/StRoot/StBTofUtil/StVpdSimConfig.h +++ b/StRoot/StBTofUtil/StVpdSimConfig.h @@ -29,21 +29,35 @@ class StVpdSimConfig : public StMaker { //! structure containing tube parameters struct SingleTubeParams{ float singleTubeRes; //!< Resolution of a particular Vpd tube in ps - int tubeId; //!< Tube Id (number) [0,37] with west Vpd [0,18] and east Vpd [19,37] - int tubeStatusFlag; //!< Status flag for whether tube was active (1) or inactive (0) - int tubeTriggerFlag; //!< Status flag for whether tube was triggered on (1) or not (0) + int tubeId, //!< Tube Id (number) [0,37] with west Vpd [0,18] and east Vpd [19,37] + tubeStatusFlag, //!< Status flag for whether tube was active (1) or inactive (0) + tubeTriggerFlag; //!< Status flag for whether tube was triggered on (1) or not (0) }; -/// calculate correct resolution based on those tubes that were used -double singleTubeRes(UInt_t mVPDHitPatternEast, UInt_t mVPDHitPatternWest){ - double vpdResSumSqr(0.), vpdresolution(0.); - for (int i=0; i<19; i++){ - if (1 << i && mVPDHitPatternEast) vpdResSumSqr += (mSimParams[i].singleTubeRes)*(mSimParams[i].singleTubeRes); - if (1 << i && mVPDHitPatternWest) vpdResSumSqr += (mSimParams[i+19].singleTubeRes)*(mSimParams[i+19].singleTubeRes); + /** + * @brief Calculate correct resolution based on those tubes that were used. + * + * @param mVPDHitPatternEast 9 digit binary number specifying hit pattern of east VPD tubes. + * @param mVPDHitPatternWest 9 digit binary number specifying hit pattern of west VPD tubes. + * @return double vpd resolution. + */ + double singleTubeRes(UInt_t mVPDHitPatternEast, UInt_t mVPDHitPatternWest){ + double vpdResSumSqr(0.), + vpdresolution(0.); + int total_vpd_hits = 0; //Total number of vpd tubes used. + for (int i=0; i<19; i++){ + if (1 << i & mVPDHitPatternEast) { + vpdResSumSqr += (mSimParams[i].singleTubeRes)*(mSimParams[i].singleTubeRes); + total_vpd_hits += 1; + } + if (1 << i & mVPDHitPatternWest) { + vpdResSumSqr += (mSimParams[i+19].singleTubeRes)*(mSimParams[i+19].singleTubeRes); + total_vpd_hits += 1; + } } - vpdresolution = sqrt(vpdResSumSqr); - return vpdresolution; -} + vpdresolution = sqrt(vpdResSumSqr)/total_vpd_hits; + return vpdresolution; + } /** * Calculates the average resolution across all 38 tubes (discounts inactive tubes) diff --git a/StRoot/StChain/GeometryDbAliases.h b/StRoot/StChain/GeometryDbAliases.h index fd7c5bd7dc7..c72964d3ddf 100644 --- a/StRoot/StChain/GeometryDbAliases.h +++ b/StRoot/StChain/GeometryDbAliases.h @@ -162,8 +162,8 @@ static const DbAlias_t fDbAlias[] = {// geometry Comment old { "y2023", 20230410, 0, "y2023", "y2023 first cut geometry, AgML,xgeometry"}, { "y2023a", 20230410, 1, "y2023a", "y2023a production geometry, AgML,xgeometry"}, - { "y2023", 20231210, 0, "y2024", "y2024 first cut geometry, AgML,xgeometry"}, - { "y2023a", 20231210, 1, "y2024a", "y2024a production geometry, AgML,xgeometry"}, + { "y2024", 20231210, 0, "y2024", "y2024 first cut geometry, AgML,xgeometry"}, + { "y2024a", 20231210, 1, "y2024a", "y2024a production geometry, AgML,xgeometry"}, {"dev2021", 21201210, 1, "dev2021", "-deprecated- geometry for 2021+ forward program,AgML,xgeometry"}, {"dev2022", 21211210, 1, "dev2022", "development geometry for 2022+ forward program,AgML,xgeometry"}, diff --git a/StRoot/StETofCalibMaker/StETofCalibMaker.cxx b/StRoot/StETofCalibMaker/StETofCalibMaker.cxx index e8ab1b96049..b706e396426 100644 --- a/StRoot/StETofCalibMaker/StETofCalibMaker.cxx +++ b/StRoot/StETofCalibMaker/StETofCalibMaker.cxx @@ -1233,37 +1233,32 @@ StETofCalibMaker::processStEvent() // collect status bit information and fill good event flag for 2020+ data TClass* headerClass = etofHeader->IsA(); if( headerClass->GetClassVersion() > 2 ){ - mNStatusBitsCounter.clear(); - std::vector< Bool_t > vMissmatchVec = etofHeader->missMatchFlagVec(); - int iGet4Id = 0; - for( auto iMissMatchFlag : vMissmatchVec ){ - // From DigiMaker: - // mMissMatchFlagVec.at( 144 * ( sector - 13 ) + 48 * ( zplane -1 ) + 16 * ( counter - 1 ) + 8 * ( side - 1 ) + ( ( strip - 1 ) / 4 ) ) = true; - if (iMissMatchFlag == false) continue; - int iCounter = iGet4Id / 16; - if( mNStatusBitsCounter.count(iCounter) ){ - mNStatusBitsCounter[iCounter]++; - }else{ - mNStatusBitsCounter[iCounter] = 1; - } - } - std::vector goodEventFlagVec; - for( int iCounter = 0; iCounter < 108; iCounter++){ - if ( !(mNPulsersCounter.count(iCounter) ) ){ - goodEventFlagVec.push_back(false); - }else{ - if ( !(mNStatusBitsCounter.count(iCounter)) && mNPulsersCounter[iCounter] == 2){ - goodEventFlagVec.push_back(true); //true when 2 pulser digis and zero status bits are available on this counter - }else{ - goodEventFlagVec.push_back(false); - } - } - } - if (goodEventFlagVec.size() == 108){ - etofHeader->setGoodEventFlagVec(goodEventFlagVec); + std::vector goodEventFlagVec; + 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); + } + } + if (hasPulsersVec.size() == 108){ + //etofHeader->setHasPulsersVec(hasPulsersVec); // not working but not of relevance at the moment + } + + //fill good event flag into header + for( unsigned int iGet4 = 0; iGet4 < 1728; iGet4++){ + goodEventFlagVec.push_back(!etofHeader->missMatchFlagVec().at(iGet4)); + } + + if (goodEventFlagVec.size() == 1728){ + etofHeader->setGoodEventFlagVec(goodEventFlagVec); } - } + } + /// second loop to apply calibrations to (non-pulser) digis inside the timing window StructStuckFwDigi current = { -1, -1., -1. }; @@ -1368,6 +1363,7 @@ StETofCalibMaker::processMuDst() mResetTime = fmod( resetTime( ( StETofHeader* ) etofHeader ), eTofConst::bTofClockCycle ); std::map< unsigned int, std::vector< unsigned int >> pulserCandMap; + /// first loop over digis to apply hardware mappping and find the pulsers for( size_t i=0; iIsA(); if( headerClass->GetClassVersion() > 2 ){ - mNStatusBitsCounter.clear(); - std::vector< Bool_t > vMissmatchVec = etofHeader->missMatchFlagVec(); - int iGet4Id = 0; - for( auto iMissMatchFlag : vMissmatchVec ){ - // From DigiMaker: - // mMissMatchFlagVec.at( 144 * ( sector - 13 ) + 48 * ( zplane -1 ) + 16 * ( counter - 1 ) + 8 * ( side - 1 ) + ( ( strip - 1 ) / 4 ) ) = true; - if (iMissMatchFlag == false) continue; - int iCounter = iGet4Id / 16; - if( mNStatusBitsCounter.count(iCounter) ){ - mNStatusBitsCounter[iCounter]++; - }else{ - mNStatusBitsCounter[iCounter] = 1; - } - } + + std::vector goodEventFlagVec; + 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); + } + } + + if (hasPulsersVec.size() == 108){ + etofHeader->setHasPulsersVec(hasPulsersVec); + } + + //fill good event flag into header + for( unsigned int iGet4 = 0; iGet4 < 1728; iGet4++){ + goodEventFlagVec.push_back(!etofHeader->missMatchFlagVec().at(iGet4)); + } - std::vector goodEventFlagVec; - for( int iCounter = 0; iCounter < 108; iCounter++){ - if ( !(mNPulsersCounter.count(iCounter) ) ){ - goodEventFlagVec.push_back(false); - }else{ - if ( !(mNStatusBitsCounter.count(iCounter)) && mNPulsersCounter[iCounter] == 2){ - goodEventFlagVec.push_back(true); //true when 2 pulser digis and zero status bits are available on this counter - }else{ - goodEventFlagVec.push_back(false); - } - } + if (goodEventFlagVec.size() == 1728){ + etofHeader->setGoodEventFlagVec(goodEventFlagVec); } - if (goodEventFlagVec.size() == 108){ - etofHeader->setGoodEventFlagVec(goodEventFlagVec); - } - } + } /// second loop to apply calibrations to (non-pulser) digis inside the timing window StructStuckFwDigi current = { -1, -1., -1. }; @@ -1470,7 +1466,6 @@ StETofCalibMaker::processMuDst() prev = current; } - /// calculate calibrated time and tot for the digi /// only for digis inside the timing window applyCalibration( aDigi, etofHeader ); @@ -1569,12 +1564,16 @@ StETofCalibMaker::flagPulserDigis( StETofDigi* aDigi, unsigned int index, std::m unsigned int key = aDigi->sector() * 1000 + aDigi->zPlane() * 100 + aDigi->counter() * 10 + aDigi->side(); + // pulser channel if( ( aDigi->strip() == 1 && aDigi->side() == 1 ) || ( aDigi->strip() == 32 && aDigi->side() == 2 ) ) { float timeToTrigger = aDigi->rawTime() - mTriggerTime; + + 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; @@ -1582,9 +1581,11 @@ StETofCalibMaker::flagPulserDigis( StETofDigi* aDigi, unsigned int index, std::m } } + if( isPulserCand ) { pulserDigiMap[ key ].push_back( index ); } + } diff --git a/StRoot/StETofHitMaker/StETofHitMaker.cxx b/StRoot/StETofHitMaker/StETofHitMaker.cxx index f5c4b7cf612..f32dabff026 100644 --- a/StRoot/StETofHitMaker/StETofHitMaker.cxx +++ b/StRoot/StETofHitMaker/StETofHitMaker.cxx @@ -104,7 +104,7 @@ StETofHitMaker::StETofHitMaker( const char* name ) mMaxYPos( 15. ), mMergingRadius( 1. ), mSigVel(), - mSoftwareDeadTime( 5. ), + mSoftwareDeadTime( 150. ), mDoClockJumpShift( true ), mDoDoubleClockJumpShift( true ), mClockJumpDirection(), @@ -338,13 +338,13 @@ StETofHitMaker::InitRun( Int_t runnumber ) } // -------------------------------------------------------------------------------------------- - for( int i=0; i containedDigiIndices; // double posX = 0.0; double posY = 0.0; double time = 0.0; @@ -992,6 +992,53 @@ StETofHitMaker::matchSides() if( mDoQA && digiVec->size() == 1 ) { mHistograms.at( histNameDigisErased )->Fill( 2 ); } + + + //single sided digi hit building + if( digiVec->size() == 1 ) { + + // create the hit candidate: + StETofDigi* xDigiA = digiVec->at( 0 ); + StETofDigi* xDigiB = digiVec->at( 0 ); + + //get get4flag statistics + // StMuETofHeader* etofHeader = mMuDst->etofHeader(); + // TClass* headerClass = etofHeader->IsA(); + // std::vector< Bool_t > vMissmatchVec = etofHeader->missMatchFlagVec(); + // std::vector< bool > goodEventFlagVec = mMuDst->etofHeader()->goodEventFlagVec(); + + // the "strip" time is the mean time between each end + time = 0.5 * ( xDigiA->calibTime() + xDigiB->calibTime() ); + //TODO: Afterpulse handling: correct hit time by the time difference between the first and second digi on the same side + if(!mIsSim && mApCorr){//merge skip corrections for simulation + time += t_corr_afterpulse; + }//merge + // weight of merging of hits (later) is the total charge => sum of both ends ToT + totSum = xDigiA->calibTot() + xDigiB->calibTot(); + + if(xDigiA->side() == 1){ + posY = 1; + }else{ + posY = -1; + } + + + // use local coordinates... (0,0,0) is in the center of counter + posX = ( -1 * eTofConst::nStrips / 2. + strip - 0.5 ) * eTofConst::stripPitch; + + unsigned int clusterSize = 1000; + + StETofHit* constructedHit = new StETofHit( sector, plane, counter, time, totSum, clusterSize, posX, posY ); + + mStoreHit[ detIndex ].push_back( constructedHit ); + + containedDigiIndices.push_back( mMapDigiIndex.at( xDigiA ) ); + containedDigiIndices.push_back( mMapDigiIndex.at( xDigiB ) ); + + mMapHitDigiIndices[ constructedHit ] = containedDigiIndices; + + } + // loop over digis on the same strip while( digiVec->size() > 1 ) { @@ -1259,7 +1306,7 @@ StETofHitMaker::matchSides() int mode = mModMatrix.at(detIndex); modifyHit(mode, posX , posY , time); } - + StETofHit* constructedHit = new StETofHit( sector, plane, counter, time, totSum, clusterSize, posX, posY ); //Check for "same direction double clockjumps" and update FlagMap @@ -1311,7 +1358,7 @@ StETofHitMaker::matchSides() tof += eTofConst::coarseClockCycle; } } - } + } // push hit into intermediate collection mStoreHit[ detIndex ].push_back( constructedHit ); @@ -1571,10 +1618,15 @@ StETofHitMaker::mergeClusters( const bool isMuDst ) int highestStrip = lowestStrip; bool hasClockJump = false; - if( pHit->clusterSize() > 100 ) { + if( pHit->clusterSize() > 100 && pHit->clusterSize() < 999) { hasClockJump = true; } + bool isSingleSided = false; + if(pHit->clusterSize() > 999){ + isSingleSided = true; + } + unsigned int index = 1; while( hitVec->size() > 1 ) { if( mDebug ) { @@ -1603,10 +1655,19 @@ StETofHitMaker::mergeClusters( const bool isMuDst ) isLowerAdjacentStip = true; } + double MergingRadius = 0; + + // dont merge single sided matches here!! has to happen after matching!! + if(pMergeHit->clusterSize() > 500 || pHit->clusterSize() > 500){ + MergingRadius = 0; + }else{ + MergingRadius = mMergingRadius; + } + // check merging condition: X is not convoluted into the clusterbuilding radius // since it is not supposed to be zero --> check if X position is on a adjacent strip if( ( isHigherAdjacentStip || isLowerAdjacentStip ) && - ( sqrt( timeDiff * timeDiff + posYDiff * posYDiff ) ) < mMergingRadius ) + ( sqrt( timeDiff * timeDiff + posYDiff * posYDiff ) ) < MergingRadius ) // { if( mDebug ) { LOG_DEBUG << "mergeClusters() - merging is going on" << endm; @@ -1633,7 +1694,7 @@ StETofHitMaker::mergeClusters( const bool isMuDst ) weightsTotSum += hitWeight; clusterSize++; - if( pMergeHit->clusterSize() > 100 ) { + if( pMergeHit->clusterSize() > 100 && pMergeHit->clusterSize() < 200) { hasClockJump = true; } @@ -1710,6 +1771,10 @@ StETofHitMaker::mergeClusters( const bool isMuDst ) clusterSize += 100; } + if(isSingleSided){ + clusterSize += 1000; + } + if( mDebug ) { LOG_DEBUG << "mergeClusters() - MERGED HIT: "; LOG_DEBUG << "sector: " << sector << " plane: " << plane << " counter: " << counter << "\n"; diff --git a/StRoot/StETofMatchMaker/StETofMatchMaker.cxx b/StRoot/StETofMatchMaker/StETofMatchMaker.cxx index 7f6e1c47eb1..ac1472fcfa4 100644 --- a/StRoot/StETofMatchMaker/StETofMatchMaker.cxx +++ b/StRoot/StETofMatchMaker/StETofMatchMaker.cxx @@ -86,6 +86,7 @@ #include "StMuDSTMaker/COMMON/StMuETofHit.h" #include "StMuDSTMaker/COMMON/StMuETofPidTraits.h" #include "StMuDSTMaker/COMMON/StMuETofDigi.h" +#include "StMuDSTMaker/COMMON/StMuETofHeader.h" #include "StETofMatchMaker.h" #include "StETofHitMaker/StETofHitMaker.h" @@ -160,9 +161,13 @@ StETofMatchMaker::StETofMatchMaker( const char* name ) mLocalYmax(16.), mClockJumpCand(), mClockJumpDirection(), - mHistFileName( "" ), - mHistograms(), - mHistograms2d() + mHistFileName( "" ), + mHistograms(), + mHistograms2d(), + dx_3sig(2.5), + dy_3sig(4.0), + dt_3sig(0.22), + dy_max(5.0) { mT0corrVec.reserve( 500 ); mTrackCuts.push_back( 0. ); // nHitsFit @@ -171,6 +176,7 @@ StETofMatchMaker::StETofMatchMaker( const char* name ) } + //--------------------------------------------------------------------------- StETofMatchMaker::~StETofMatchMaker() { @@ -267,7 +273,6 @@ StETofMatchMaker::InitRun( Int_t runnumber ) // -------------------------------------------------------------------------------------------- - // -------------------------------------------------------------------------------------------- // initializie etof geometry // -------------------------------------------------------------------------------------------- @@ -498,7 +503,12 @@ StETofMatchMaker::Make() return kStOk; } + + //Single Sided Hit Matching and clustering + eTofHitVec finalMatchVec; + sortandcluster(matchCandVec , detectorHitVec , intersectionVec , finalMatchVec); + //......................................................................... // D. sort matchCand vector and deal with (discard) hits matched by multiple tracks // @@ -506,20 +516,18 @@ StETofMatchMaker::Make() eTofHitVec singleTrackMatchVec; vector< eTofHitVec > multiTrackMatchVec; - sortSingleMultipleHits( matchCandVec, singleTrackMatchVec, multiTrackMatchVec ); + //sortSingleMultipleHits( matchCandVec, singleTrackMatchVec, multiTrackMatchVec ); // old matching procedure - if( singleTrackMatchVec.size() == 0 ) { - //LOG_INFO << "Make() -- event done ... bye-bye" << endm; - - return kStOk; - } + //if( singleTrackMatchVec.size() == 0 ) { + //LOG_INFO << "Make() -- event done ... bye-bye" << endm + // return kStOk; + // } //......................................................................... // E. sort singleTrackMatchVector for multiple hits associated to single tracks and determine the best match // - eTofHitVec finalMatchVec; - - finalizeMatching( singleTrackMatchVec, finalMatchVec ); + + //finalizeMatching( singleTrackMatchVec, finalMatchVec ); // old matching procedure if( finalMatchVec.size() == 0 ) { //LOG_INFO << "Make() -- event done ... bye-bye" << endm; @@ -533,14 +541,14 @@ StETofMatchMaker::Make() //......................................................................... // F. fill ETofPidTraits for global and primary tracks and assign associated track to hits // - fillPidTraits( finalMatchVec ); + fillPidTraits( finalMatchVec ); //......................................................................... // G. calculate pid variables for primary tracks and update PidTraits // - int nPrimaryWithPid = 0; + int nPrimaryWithPid = 0; - calculatePidVariables( finalMatchVec, nPrimaryWithPid ); + calculatePidVariables( finalMatchVec, nPrimaryWithPid ); mHistograms.at( "primaryIntersect_validMatch" )->Fill( nPrimaryWithIntersection, nPrimaryWithPid ); @@ -838,6 +846,10 @@ StETofMatchMaker::readETofDetectorHits( eTofHitVec& detectorHitVec ) detectorHit.index2ETofHit = i; detectorHitVec.push_back( detectorHit ); + + + + } } @@ -1267,8 +1279,10 @@ StETofMatchMaker::matchETofHits( eTofHitVec& detectorHitVec, eTofHitVec& interse bool isMatch = false; // deltaX, deltaY (subtract offset until alignment is done properly) - float deltaX = detHitIter->localX - interIter->localX; - float deltaY = detHitIter->localY - interIter->localY; + float deltaX = detHitIter->localX - interIter->localX; + float deltaY = detHitIter->localY - interIter->localY; + double tstart = startTimeBTof(); //no eToF start time available here! + double deltaT = detHitIter->hitTime - tstart; //basic cut to reject hits far of in time int counterIndex = ( detHitIter->sector - eTofConst::sectorStart ) * eTofConst::nPlanes * eTofConst::nCounters + ( detHitIter->plane - eTofConst::zPlaneStart ) * eTofConst::nCounters @@ -1277,18 +1291,45 @@ StETofMatchMaker::matchETofHits( eTofHitVec& detectorHitVec, eTofHitVec& interse deltaX -= etofProjection::deltaXoffset[ counterIndex ]; deltaY -= etofProjection::deltaYoffset[ counterIndex ]; + bool corrTime=false; // for single sided hit time corr + if( detHitIter->sector == interIter->sector ) { - if( detHitIter->plane == interIter->plane ) { - if( detHitIter->counter == interIter->counter ) { - if( fabs( deltaX ) < mMatchDistX ) { - if( fabs( deltaY ) < mMatchDistY ) { - isMatch = true; - } - } - } - } - } + if( detHitIter->plane == interIter->plane ) { + if( detHitIter->counter == interIter->counter ) { + + if(detHitIter->clusterSize < 999){ + + // if( fabs( deltaX ) < mMatchDistX ) { + // if( fabs( deltaY ) < mMatchDistY ) { + + if( ( ( (deltaY*deltaY) / (mMatchDistY*mMatchDistY) ) + ( (deltaX*deltaX) / (mMatchDistX*mMatchDistX) ) ) < 2. ) { + if( fabs( deltaT ) < mMatchDistT ) { + isMatch = true; + } + } + }else{ + + float mMatchDistYSingleSided = 15; + + + if( fabs( deltaX ) < mMatchDistX ) { + if( fabs( deltaY ) < mMatchDistYSingleSided ) { + if( fabs( deltaT ) < mMatchDistT ) { + + + isMatch = true; + deltaY = 27; // keep SHs out of NHs way while sorting + corrTime = true; + + } + } + } + } + } + } + } + if( isMatch ) { StructETofHit matchCand; @@ -1302,12 +1343,14 @@ StETofMatchMaker::matchETofHits( eTofHitVec& detectorHitVec, eTofHitVec& interse matchCand.tot = detHitIter->tot; matchCand.clusterSize = detHitIter->clusterSize; matchCand.index2ETofHit = detHitIter->index2ETofHit; + matchCand.IdTruthHit = detHitIter->IdTruth; matchCand.globalPos = interIter->globalPos; matchCand.trackId = interIter->trackId; matchCand.theta = interIter->theta; matchCand.pathLength = interIter->pathLength; matchCand.isPrimary = interIter->isPrimary; + matchCand.IdTruth = interIter->IdTruth; matchCand.matchFlag = 0; matchCand.deltaX = deltaX; @@ -1316,6 +1359,36 @@ StETofMatchMaker::matchETofHits( eTofHitVec& detectorHitVec, eTofHitVec& interse matchCand.tof = -999.; matchCand.beta = -999.; + // correct single sided matches + if(corrTime){ + matchCand.localY = interIter->localY; + + // if side A + double corr ; + float tcorr = 0; + if(sector == 15 || sector == 17 || sector == 21 || sector == 22 ){ + tcorr = 16.49; + }else{ + tcorr = 18.23; + } + if(detHitIter->localY < 0){ + matchCand.hitTime = detHitIter->hitTime - (((13.5 + interIter->localY ) / tcorr )) + (13.5/tcorr); + // matchCand.totDiff = 1; + corr = (((13.5 - interIter->localY ) / tcorr )); + // if side B + }else{ + matchCand.hitTime = detHitIter->hitTime - (((13.5 - interIter->localY ) / tcorr )) + (13.5/tcorr); + // matchCand.totDiff = -1; + corr = (((13.5 + interIter->localY ) / tcorr )); + } + + matchCand.totDiff = matchCand.totDiff * corr; + + // cout << "interIter->localY " << interIter->localY<< endl; + // cout << "corr " << corr << endl; + // cin.get(); + + } matchCandVec.push_back( matchCand ); @@ -1954,7 +2027,9 @@ StETofMatchMaker::calculatePidVariables( eTofHitVec& finalMatchVec, int& nPrimar StMuETofPidTraits pidTraits = gTrack->etofPidTraits(); - double tof = timeOfFlight( tstart, aHit->time() ); + //double tof = timeOfFlight( tstart, aHit->time() ); + double tof = timeOfFlight( tstart, matchCand.hitTime ); + // set time-of-flight matchCand.tof = tof; @@ -2016,6 +2091,15 @@ StETofMatchMaker::calculatePidVariables( eTofHitVec& finalMatchVec, int& nPrimar // set beta matchCand.beta = beta; + + if( matchCand.clusterSize > 999 ){ + + mHistograms.at( "AAA_beta_mom_SD")->Fill( pTrack->momentum().mag() , 1/beta ); + + } + + + if( mDebug ) { LOG_INFO << "calculatePidVariables() - pathlength: " << pathLength << " time-of-flight: " << tof << " and beta: " << beta << " are set" << endm; } @@ -2434,6 +2518,7 @@ StETofMatchMaker::expectedTimeOfFlight( const double& pathLength, const double& void StETofMatchMaker::fillQaHistograms( eTofHitVec& finalMatchVec ) { + vector< int > nPidMatches( 36 ); for( auto& matchCand : finalMatchVec ) { @@ -2441,6 +2526,10 @@ StETofMatchMaker::fillQaHistograms( eTofHitVec& finalMatchVec ) int charge; float mom; + // int sector = 0; // + // int plane = 0; // + // int counter = 0; // + float dEdx = -999.; float nSigmaPion = -999; @@ -2474,6 +2563,10 @@ StETofMatchMaker::fillQaHistograms( eTofHitVec& finalMatchVec ) StMuTrack* pTrack = aHit->primaryTrack(); if( !pTrack ) continue; + //sector = aHit->sector(); + //plane = aHit->zPlane(); + //counter = aHit->counter(); + charge = pTrack->charge(); mom = pTrack->momentum().mag(); @@ -2517,6 +2610,7 @@ StETofMatchMaker::fillQaHistograms( eTofHitVec& finalMatchVec ) mHistograms.at( "matchCand_m2_mom" )->Fill( mom, m2 ); mHistograms.at( "matchCand_m2_signmom" )->Fill( sign * mom, m2 ); + // plots per counter std::string histName_beta_mom = "matchCand_beta_mom_s" + std::to_string( matchCand.sector ) + "m" + std::to_string( matchCand.plane ) + "c" + std::to_string( matchCand.counter ); @@ -2723,6 +2817,22 @@ StETofMatchMaker::bookHistograms() for( int sector = eTofConst::sectorStart; sector <= eTofConst::sectorStop; sector++ ) { for( int plane = eTofConst::zPlaneStart; plane <= eTofConst::zPlaneStop; plane++ ) { for( int counter = eTofConst::counterStart; counter <= eTofConst::counterStop; counter++ ) { + + //single sided matching qa + std::string histName_t0corr_mom_zoom = "matched_t0corr_mom_zoom_s" + std::to_string( sector ) + "m" + std::to_string( plane ) + "c" + std::to_string( counter ); + + mHistograms2d[ histName_t0corr_mom_zoom ] = new TH2F( Form( "T_matched_t0corr_mom_zoom_s%dm%dc%d", sector, plane, counter ), Form( "measured tof - tof_{#pi} vs. momentum in sector %d module %d counter %d;mom (GeV/c);#Delta time (ns)", sector, plane, counter ), 200, 0., 3., 500, -5., 5. ); + + + std::string histName_t0corr_mom_zoom_SD = "matched_t0corr_mom_zoom_SD_s" + std::to_string( sector ) + "m" + std::to_string( plane ) + "c" + std::to_string( counter ); + + mHistograms2d[ histName_t0corr_mom_zoom_SD ] = new TH2F( Form( "T_matched_t0corr_mom_zoom_SD_s%dm%dc%d", sector, plane, counter ), Form( "measured tof - tof_{#pi} vs. momentum in sector %d module %d counter %d;mom (GeV/c);#Delta time (ns)", sector, plane, counter ), 200, 0., 3., 500, -5., 5. ); + + + + + + std::string histName_hit_localXY = "eTofHits_localXY_s" + std::to_string( sector ) + "m" + std::to_string( plane ) + "c" + std::to_string( counter ); std::string histName_hit_globalXY = "eTofHits_globalXY_s" + std::to_string( sector ) + "m" + std::to_string( plane ) + "c" + std::to_string( counter ); std::string histName_hit_eta_phi = "eTofHits_phi_eta_s" + std::to_string( sector ) + "m" + std::to_string( plane ) + "c" + std::to_string( counter ); @@ -3120,3 +3230,700 @@ void StETofMatchMaker::checkClockJumps() mETofHitMaker->updateClockJumpMap( mClockJumpDirection ); } } + +//--------------------------------------------------------------------------- +void +StETofMatchMaker::sortMatchCases( eTofHitVec inputVec , std::map< Int_t, eTofHitVec >& outputMap ) +{ + + + // sort & flag Match candidates + + // define temporary vectors for iterating through matchCandVec + eTofHitVec tempVec = inputVec; + eTofHitVec erasedVec = tempVec; + eTofHitVec tempMMVec; + tempMMVec.clear(); + std::map< Int_t, eTofHitVec > MMMap; + MMMap.clear(); + + eTofHitVec ssVec; + + // get multi Hit sets + // int deltaSize = 0; + + eTofHitVecIter tempIter = tempVec.begin(); + eTofHitVecIter erasedIter = erasedVec.begin(); + + + if(tempVec.size() < 1 ) return; + + 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(); + + MMMap[tempMMVec.begin()->trackId] = tempMMVec; + tempMMVec.clear(); + + tempVec = erasedVec; + } + + + outputMap = MMMap; + + +} +//--------------------------------------------------------------------------- +void +StETofMatchMaker::sortandcluster(eTofHitVec& matchCandVec , eTofHitVec& detectorHitVec , eTofHitVec& intersectionVec , eTofHitVec& finalMatchVec){ + + + //flag Overlap-Hits ------------------------------------------------------------------- + std::map< Int_t, eTofHitVec > overlapHitMap; + eTofHitVec overlapHitVec; + eTofHitVec tempVecOL = matchCandVec; + eTofHitVecIter detHitIter; + eTofHitVecIter detHitIter2; + + for( auto detHitIter = tempVecOL.begin(); detHitIter != tempVecOL.end(); ) { + + detHitIter = tempVecOL.begin(); + detHitIter2 = tempVecOL.begin(); + + bool isOverlap = false; + int counterId1 = (detHitIter->sector*100) + (detHitIter->plane*10) + (detHitIter->counter); + + for( auto detHitIter2 = tempVecOL.begin(); detHitIter2 != tempVecOL.end(); ) { + + int counterId2 = (detHitIter2->sector*100) + (detHitIter2->plane*10) + (detHitIter2->counter); + + if(counterId1 != counterId2 && detHitIter->trackId == detHitIter2->trackId){ + + int mf2 = counterId2 ; + + detHitIter2->matchFlag = mf2; + + matchCandVec.at(detHitIter2 - tempVecOL.begin()).matchFlag = 1; + + overlapHitVec.push_back(*detHitIter2); + tempVecOL.erase(detHitIter2); + + isOverlap = true; + } + + if( tempVecOL.size() <= 0 ) break; + if( detHitIter2 == tempVecOL.end()) break; + detHitIter2++; + + } + + if(isOverlap){ + + detHitIter->matchFlag = counterId1; + + matchCandVec.at(detHitIter - tempVecOL.begin()).matchFlag = 1; + + overlapHitVec.push_back(*detHitIter); + + //fill map + overlapHitMap[overlapHitVec.begin()->trackId] = overlapHitVec; + + overlapHitVec.clear(); + + } + tempVecOL.erase(detHitIter); + + if( tempVecOL.size() <= 0 ) break; + if( detHitIter == tempVecOL.end()) break; + detHitIter++; + + } + + // fill match cand vec counter wise + std::vector< eTofHitVec > matchCandVecCounter(108); + + for(int i =0; i < 108; i++){ + + for(unsigned int n = 0; n < matchCandVec.size(); n++){ + + int sector = matchCandVec.at(n).sector; + int plane = matchCandVec.at(n).plane; + int counter = matchCandVec.at(n).counter; + + int counterId = 9*(sector - 13) + 3*(plane - 1) + (counter -1); + + if(counterId == i ) { + matchCandVecCounter.at(i).push_back(matchCandVec.at(n)); + } + }//loop over hits + }//loop over counters + + + // loop over counters + for(int counterNr = 0; counterNr < 108; counterNr++){ + + // sort & flag Match candidates + eTofHitVec tempVec = matchCandVecCounter.at(counterNr); + eTofHitVec tempVec2 = matchCandVecCounter.at(counterNr); + std::map< Int_t, eTofHitVec > MMMap; + + sortMatchCases(tempVec, MMMap); + + // final containers + std::map< Int_t, eTofHitVec > MultMultMap; + std::map< Int_t, eTofHitVec > SingleHitMap; + std::map< Int_t, eTofHitVec > SingleTrackMap; + eTofHitVec ssVec; + + map::iterator it; + + for (it = MMMap.begin(); it != MMMap.end(); it++) + { + int nTracks = 1; + int nHits = 1; + + for(unsigned int l =0; l< it->second.size(); l++){ + for(unsigned int j = l; j< it->second.size(); j++){ + + if( it->second.at(l).trackId != it->second.at(j).trackId) nTracks++; + if( it->second.at(l).index2ETofHit != it->second.at(j).index2ETofHit ) nHits++; + + } // for inner + } //for outer + + + // cases:: + // Single Hit - Single Track + if(nTracks == 1 && nHits == 1) { + + ssVec.push_back(it->second.front() ); + + int isMerged = 10; // 10 codes for normal hit + int isOl = it->second.front().matchFlag; + + if( it->second.front().clusterSize > 999 ) { + + isMerged = 20; // 20 codes for single hit + it->second.front().clusterSize = 1; + } + + it->second.front().matchFlag = 100 + isMerged + isOl; + finalMatchVec.push_back(it->second.front()); + } + + + // Single Hit - Multi Track + if( nTracks > 1 && nHits == 1) { + + double dr = 0.0; + double dr_best = 99999.0; // dy for SHs at 27 + unsigned int ind = 0; + unsigned int ind_best = 0; + + for(unsigned int l =0; l < it->second.size(); l++){ + + dr = (it->second.at(l).deltaX * it->second.at(l).deltaX) + (it->second.at(l).deltaY * it->second.at(l).deltaY); + ind = l; + + if(dr <= dr_best){ + dr_best = dr; + ind_best = ind; + } + } + + SingleHitMap[it->first] = it->second; + + //pick closest track and push to finalMatchVec + int isMerged = 10; + int isOl = it->second.at(ind_best).matchFlag; + + if( it->second.at(ind_best).clusterSize > 999 ){ + + isMerged = 20; + it->second.at(ind_best).clusterSize = 1; + } + + it->second.at(ind_best).matchFlag = 300 + isMerged + isOl; + finalMatchVec.push_back(it->second.at(ind_best)); + } + + + // Multi Hit - Single Track + if( nTracks ==1 && nHits > 1) { + + bool isN = false; + bool isS = false; + + for(unsigned int l =0; l < it->second.size(); l++){ + + if(it->second.at(l).clusterSize < 999){ + isN = true; + }else{ + isS = true; + } + } + + SingleTrackMap[it->first] = it->second; + + // sort by merge cases :: SS, NN, SN + //NN + if(isN && (!isS)){ + + std::vector< std::vector > mergeIndVec(it->second.size()); + + double dr_sum=0; + double dr_diff = 0; + double dr_mean=0; + + double dr = 0.0; + double dr_best = 99999.0; // dy for SHs at 27 + unsigned int ind = 0; + unsigned int ind_best = 0; + + for(unsigned int l =0; l < it->second.size(); l++){ + + dr = sqrt((it->second.at(l).deltaX * it->second.at(l).deltaX) + (it->second.at(l).deltaY * it->second.at(l).deltaY)); + ind = l; + + dr_sum += abs(dr); + + if(dr <= dr_best){ + dr_best = dr; + ind_best = ind; + } + } + + dr_mean = dr_sum / it->second.size(); + + for(unsigned int c =0; c < it->second.size(); c++){ + + dr = sqrt((it->second.at(c).deltaX * it->second.at(c).deltaX) + (it->second.at(c).deltaY * it->second.at(c).deltaY)); + dr_diff += abs(dr - dr_mean); + } + + // NN Hits already merged in HitMaker + + int mergedCluSz = 0; + int mergedMatchFlag = 0; + int isMerged = 0; + int isOl = it->second.at(ind_best).matchFlag; + + if(it->second.at(ind_best).clusterSize > 100 && it->second.at(ind_best).clusterSize < 200){ + + mergedCluSz = it->second.at(ind_best).clusterSize % 100; + + }else{ + + mergedCluSz = it->second.at(ind_best).clusterSize; + } + + if(mergedCluSz > 1){ isMerged = 30; // 30 codes for normal-normal-merge + }else{ + isMerged = 10; + } + + mergedMatchFlag = 200 + isMerged + isOl; // 200 codes for SingleTrackMultiHit + it->second.at(ind_best).matchFlag = mergedMatchFlag; + + finalMatchVec.push_back(it->second.at(ind_best)); + } + + //SS + if(isS && (!isN)){ + + std::vector< std::vector > mergeIndVec(it->second.size()); + + for(unsigned int l =0; l < it->second.size(); l++){ + mergeIndVec.at(l).push_back(0); + } + + double dr = 0.0; + double dr_best = 99999.0; // dy for SHs at 27 + unsigned int ind = 0; + unsigned int ind_best = 0; + + for(unsigned int l =0; l < it->second.size(); l++){ + + // localY doesnt contain any ETOF information -> not usefull for merging single sided hits + dr = it->second.at(l).deltaX; + ind = l; + + if(dr <= dr_best){ + dr_best = dr; + ind_best = ind; + } + } + + // merge MatchCands + + eTofHitVec hitVec = it->second ; + + double mergedTime = it->second.at(ind_best).hitTime; + double mergedToT = it->second.at(ind_best).tot; + double mergedPosY = it->second.at(ind_best).localY; + double mergedPosX = it->second.at(ind_best).localX; + int mergedCluSz = 1; + int mergedMatchFlag = 0; + int mergedIdTruth = it->second.at(ind_best).IdTruth; + + for(unsigned int j=0; j < hitVec.size(); j++) { + + if( j == ind_best) continue; + + double dx = it->second.at(ind_best).localX - hitVec.at(j).localX; + double dy = it->second.at(ind_best).localY - hitVec.at(j).localY; + double dt = abs( it->second.at(ind_best).hitTime - hitVec.at(j).hitTime); + + // merge + if( abs(dx) < dx_3sig && abs(dy) < dy_3sig && abs(dt) < dt_3sig ){ + + mergedTime += hitVec.at(j).hitTime; + mergedToT += hitVec.at(j).tot; + mergedPosY += hitVec.at(j).localY; + mergedPosX += hitVec.at(j).localX; + mergedCluSz++; + + if(mergedIdTruth != hitVec.at(j).IdTruth) mergedIdTruth =0; + + } + } + + // create mergend hit and MC; + mergedTime /= mergedCluSz; + mergedToT /= mergedCluSz; + mergedPosY /= mergedCluSz; + mergedPosX /= mergedCluSz; + int isMerged = 0; + int isOl = it->second.at(ind_best).matchFlag; + + if(mergedCluSz > 1){ isMerged = 40; // codes for sigle-single-merge + }else{ + isMerged = 20; + } + + mergedMatchFlag = 200 + isMerged + isOl; // 200 codes for SingleTrackMultiHit + + // use only the floating point remainder of the time with respect the the bTof clock range + mergedTime = fmod( mergedTime, eTofConst::bTofClockCycle ); + if( mergedTime < 0 ) mergedTime += eTofConst::bTofClockCycle; + + it->second.at(ind_best).hitTime = mergedTime; + it->second.at(ind_best).tot = mergedToT; + it->second.at(ind_best).localX = mergedPosX; + it->second.at(ind_best).localY = mergedPosY; + it->second.at(ind_best).IdTruth = mergedIdTruth; + it->second.at(ind_best).matchFlag = mergedMatchFlag; + it->second.at(ind_best).clusterSize = mergedCluSz; + + + finalMatchVec.push_back(it->second.at(ind_best)); + } + + //SN + if(isN && isS){ + + std::vector< std::vector > mergeIndVec(it->second.size()); + + for(unsigned int l =0; l < it->second.size(); l++){ + mergeIndVec.at(l).push_back(0); + } + + double dr = 0.0; + double dr_best = 99999.0; // dy for SHs at 27 + unsigned int ind = 0; + unsigned int ind_best = 0; + + for(unsigned int l =0; l < it->second.size(); l++){ + + if(it->second.at(l).clusterSize > 999) continue; + + // localY doesnt contain any ETOF information for singleSidedHits-> not usefull for merging later on + dr = it->second.at(l).deltaX*it->second.at(l).deltaX + it->second.at(l).deltaY*it->second.at(l).deltaY; + ind = l; + + if(dr <= dr_best){ + dr_best = dr; + ind_best = ind; + } + } + + + // merge MatchCands + eTofHitVec hitVec = it->second ; + + double mergedTime = it->second.at(ind_best).hitTime; + double mergedToT = it->second.at(ind_best).tot; + double mergedPosY = it->second.at(ind_best).localY; + double mergedPosX = it->second.at(ind_best).localX; + int mergedCluSz = 1; + int mergedMatchFlag = 0; + int mergedIdTruth = it->second.at(ind_best).IdTruth; + + for(unsigned int j=0; j < hitVec.size(); j++) { + + if( j == ind_best) continue; + + double dx = it->second.at(ind_best).localX - hitVec.at(j).localX; + double dy = it->second.at(ind_best).localY - hitVec.at(j).localY; + double dt = abs( it->second.at(ind_best).hitTime - hitVec.at(j).hitTime); + + // merge + if( abs(dx) < dx_3sig && abs(dy) < dy_3sig && abs(dt) < dt_3sig ){ + + mergedTime += hitVec.at(j).hitTime; + mergedToT += hitVec.at(j).tot; + mergedPosY += hitVec.at(j).localY; + mergedPosX += hitVec.at(j).localX; + mergedCluSz++; + + if(mergedIdTruth != hitVec.at(j).IdTruth) mergedIdTruth =0; + } + } + + // create mergend hit and MC + mergedTime /= mergedCluSz; + mergedToT /= mergedCluSz; + mergedPosY /= mergedCluSz; + mergedPosX /= mergedCluSz; + int isMerged = 0; + int isOl = it->second.at(ind_best).matchFlag; + + if(mergedCluSz > 1){ isMerged = 50; // codes for sigle-normal-merge + }else{ + isMerged = 10; + } + + mergedMatchFlag = 200 + isMerged + isOl; // 200 codes for SingleTrackMultiHit + + // use only the floating point remainder of the time with respect the the bTof clock range + mergedTime = fmod( mergedTime, eTofConst::bTofClockCycle ); + if( mergedTime < 0 ) mergedTime += eTofConst::bTofClockCycle; + + it->second.at(ind_best).hitTime = mergedTime; + it->second.at(ind_best).tot = mergedToT; + it->second.at(ind_best).localX = mergedPosX; + it->second.at(ind_best).localY = mergedPosY; + it->second.at(ind_best).IdTruth = mergedIdTruth; + it->second.at(ind_best).matchFlag = mergedMatchFlag; + it->second.at(ind_best).clusterSize = mergedCluSz ; + + finalMatchVec.push_back(it->second.at(ind_best)); + } + } // multi-hit-single-track + + + // Multi Hit - Multi Track + if(nTracks > 1 && nHits > 1) { + + // for each track pick closest hit + eTofHitVec hitVec = it->second ; + eTofHitVec bestMatchVec; + eTofHitVec mergeCandVec; + eTofHitVec ambigVec; + std::map< Int_t, StructETofHit > bestMatchMap; + std::map< Int_t, eTofHitVec > mergeCandMap; + std::map< Int_t, eTofHitVec > mergeCandMap2; + std::map< Int_t, eTofHitVec > ambigMap; + std::vector indVec; + + for(unsigned int l =0; l < it->second.size(); l++){ + + double dr = it->second.at(l).deltaX*it->second.at(l).deltaX + it->second.at(l).deltaY*it->second.at(l).deltaY; + double dr_best = 99999.0; // dy for SHs at 27 + unsigned int ind = 0; + unsigned int ind_best = l; + int trackId = it->second.at(l).trackId; + int vcnt = 0; + + if(std::find(indVec.begin(), indVec.end(), trackId) != indVec.end()) continue; + + for(unsigned int n = 0; n < it->second.size(); n++){ + + if(it->second.at(n).trackId != trackId) continue; + + // localY doesnt contain any ETOF information for sHits-> take nHit if possible + dr = it->second.at(n).deltaX*it->second.at(n).deltaX + it->second.at(n).deltaY*it->second.at(n).deltaY; + ind = n; + + if(dr < dr_best){ + + if(vcnt){ + mergeCandVec.push_back(it->second.at(ind_best)); + }else{ + vcnt++; + } + dr_best = dr; + ind_best = ind; + + }else{ + + mergeCandVec.push_back(it->second.at(n)); + } + } + + indVec.push_back(trackId); + bestMatchMap[trackId] = it->second.at(ind_best); + bestMatchVec.push_back(it->second.at(ind_best)); + } + + + std::vector indVecBMtrack; + std::vector indVecBMhit; + + for(unsigned int b =0; b < bestMatchVec.size() ; b++){ + indVecBMtrack.push_back(bestMatchVec.at(b).trackId); + indVecBMhit.push_back(bestMatchVec.at(b).index2ETofHit); + } + + std::vector indVecUsedTrack; + std::vector indVecReplaceTrack; + std::vector indVecUsedHit; + eTofHitVec MatchVecTemp = bestMatchVec; + eTofHitVec finalbestMatchVec; + + while(MatchVecTemp.size() > 0){ + + double dr = 0.0; + double dr_best = 99999.0; // dy for SHs at 27 + unsigned int ind = 0; + unsigned int ind_best = 0; + for(unsigned int b =0; b < MatchVecTemp.size() ; b++){ + + ind = b; + + dr = MatchVecTemp.at(b).deltaX * MatchVecTemp.at(b).deltaX + MatchVecTemp.at(b).deltaY * MatchVecTemp.at(b).deltaY; + if(dr <= dr_best){ + dr_best = dr; + ind_best = ind; + } + } + + finalbestMatchVec.push_back(MatchVecTemp.at(ind_best)); + indVecUsedTrack.push_back(MatchVecTemp.at(ind_best).trackId); + indVecUsedHit.push_back(MatchVecTemp.at(ind_best).index2ETofHit); + MatchVecTemp.erase(MatchVecTemp.begin() + ind_best); + + //remove all matches with same hit id + for(unsigned int b =0; b < MatchVecTemp.size() ; b++){ + + if(std::find(indVecUsedHit.begin(), indVecUsedHit.end(), MatchVecTemp.at(b).index2ETofHit) != indVecUsedHit.end()) { + + indVecReplaceTrack.push_back(MatchVecTemp.at(b).trackId); + MatchVecTemp.erase(MatchVecTemp.begin() + b); + b = -1; + } + } + + //check for replacement + std::sort( indVecReplaceTrack.begin(), indVecReplaceTrack.end() ); + indVecReplaceTrack.erase( unique( indVecReplaceTrack.begin(), indVecReplaceTrack.end() ), indVecReplaceTrack.end() ); + + bool found1 = false; + double dx1 = 0; + double dy1 = 0; + double dx_best1 = 99999.0; + double dy_best1 = 99999.0; + unsigned int ind1 = 0; + unsigned int ind_best1 = 0; + for(unsigned int i = 0; i < mergeCandVec.size();i++){ + + ind1 = i; + + if(!(std::find(indVecReplaceTrack.begin(), indVecReplaceTrack.end(), mergeCandVec.at(i).trackId) != indVecReplaceTrack.end())) continue; + if(std::find(indVecUsedTrack.begin(), indVecUsedTrack.end(), mergeCandVec.at(i).index2ETofHit) != indVecUsedTrack.end()) continue; + if(std::find(indVecUsedHit.begin(), indVecUsedHit.end(), mergeCandVec.at(i).index2ETofHit) != indVecUsedHit.end()) continue; + if(std::find(indVecBMhit.begin(), indVecBMhit.end(), mergeCandVec.at(i).index2ETofHit) != indVecBMhit.end()) continue; + + dx1 = mergeCandVec.at(i).deltaX; + dy1 = mergeCandVec.at(i).deltaY; + + if(dy1 < dy_best1){ dy_best1 = dy1;} + + if(dx1 < dx_best1){ + dx_best1 = dx1; + ind_best1 = ind1; + found1 = true; + } else if(dx1 == dx_best1){ + + if(dy1 < dy_best1 && dy1 < dy_max && dy1 != 27.0){ + ind_best1 = ind1; + found1 = true; + } else if( dy1 == 27.0){ + ind_best1 = ind1; + found1 = true; + } + } + } + + if(found1){ + + finalbestMatchVec.push_back(mergeCandVec.at(ind_best1)); + indVecUsedTrack.push_back(mergeCandVec.at(ind_best1).trackId); + indVecUsedHit.push_back(mergeCandVec.at(ind_best1).index2ETofHit); + mergeCandVec.erase(mergeCandVec.begin() + ind_best1); + } + + bestMatchVec = finalbestMatchVec; + + for(unsigned int i=0;i< bestMatchVec.size();i++){ + + if(bestMatchVec.at(i).clusterSize < 999 ){ + bestMatchVec.at(i).matchFlag = 410; + }else{ + bestMatchVec.at(i).matchFlag = 420; + bestMatchVec.at(i).clusterSize -= 1000; + } + finalMatchVec.push_back(bestMatchVec.at(i)); + } + } + } + }// loop over MMMap + }//loop over counters +} diff --git a/StRoot/StETofMatchMaker/StETofMatchMaker.h b/StRoot/StETofMatchMaker/StETofMatchMaker.h index 0a5020fbafb..ecd274085eb 100644 --- a/StRoot/StETofMatchMaker/StETofMatchMaker.h +++ b/StRoot/StETofMatchMaker/StETofMatchMaker.h @@ -87,7 +87,7 @@ class StETofMatchMaker : public StMaker { Double_t localX; Double_t localY; Double_t tot; - Double_t clusterSize; + Int_t clusterSize; Int_t index2ETofHit; StThreeVectorD globalPos; Int_t trackId; @@ -99,6 +99,10 @@ class StETofMatchMaker : public StMaker { Double_t beta; Double_t pathLength; Double_t tof; + Int_t IdTruth; + Int_t IdTruthHit; + Double_t totDiff; + }; typedef std::vector< StructETofHit > eTofHitVec; @@ -160,6 +164,9 @@ class StETofMatchMaker : public StMaker { void fillPidTraits( eTofHitVec& finalMatchVec ); void calculatePidVariables( eTofHitVec& finalMatchVec, int& nPrimaryWithPid ); + void sortandcluster(eTofHitVec& matchCandVec , eTofHitVec& detectorHitVec , eTofHitVec& intersectionVec , eTofHitVec& finalMatchVec); + void sortMatchCases( eTofHitVec inputVec , std::map< Int_t, eTofHitVec >& outputMap ); + double startTimeBTof(); double startTimeETof( const eTofHitVec& finalMatchVec, unsigned int& nCand_etofT0 ); @@ -220,9 +227,17 @@ class StETofMatchMaker : public StMaker { std::map< Int_t, Int_t > mClockJumpDirection; std::string mHistFileName; + std::map< std::string, TH1* > mHistograms; std::map< std::string, TH2* > mHistograms2d; + // used for single sided match cases + Double_t dx_3sig; + Double_t dy_3sig; + Double_t dt_3sig; + Double_t dy_max; + + virtual const Char_t *GetCVS() const { static const char cvs[]="Tag $Name: $Id: built " __DATE__ " " __TIME__ ; return cvs; } ClassDef( StETofMatchMaker, 0 ) diff --git a/StRoot/StEvent/StETofHeader.cxx b/StRoot/StEvent/StETofHeader.cxx index 2588562ef5d..6c594ffdcce 100644 --- a/StRoot/StEvent/StETofHeader.cxx +++ b/StRoot/StEvent/StETofHeader.cxx @@ -38,7 +38,8 @@ StETofHeader::StETofHeader() mStarTrgCmdIn( 0 ), mEventStatusFlag( 0 ), mMissMatchFlagVec( eTofConst::nGet4sInSystem, false ), - mGoodEventFlagVec( eTofConst::nCountersInSystem, false ) + mGoodEventFlagVec( eTofConst::nGet4sInSystem, false ), + mHasPulsersVec( eTofConst::nCountersInSystem, false ) { mRocGdpbTs.clear(); mRocStarTs.clear(); @@ -56,7 +57,8 @@ StETofHeader::StETofHeader( const double& trgGdpbTime, const double& trgStarTime mStarTrgCmdIn( starTrgCmdIn ), mEventStatusFlag( eventStatusFlag ), mMissMatchFlagVec( eTofConst::nGet4sInSystem, false ), - mGoodEventFlagVec( eTofConst::nCountersInSystem, false ) + mGoodEventFlagVec( eTofConst::nGet4sInSystem, false ), + mHasPulsersVec( eTofConst::nCountersInSystem, false ) { setRocGdpbTs( gdpbTs ); setRocStarTs( starTs ); @@ -73,7 +75,8 @@ StETofHeader::StETofHeader( const double& trgGdpbTime, const double& trgStarTime mStarTrgCmdIn( starTrgCmdIn ), mEventStatusFlag( eventStatusFlag ), mMissMatchFlagVec( MissMatchFlagVec ), - mGoodEventFlagVec( eTofConst::nCountersInSystem, false ) + mGoodEventFlagVec( eTofConst::nGet4sInSystem, false ), + mHasPulsersVec( eTofConst::nCountersInSystem, false ) { setRocGdpbTs( gdpbTs ); setRocStarTs( starTs ); @@ -82,7 +85,7 @@ StETofHeader::StETofHeader( const double& trgGdpbTime, const double& trgStarTime StETofHeader::StETofHeader( const double& trgGdpbTime, const double& trgStarTime, const map< unsigned int, uint64_t >& gdpbTs, const map< unsigned int, uint64_t >& starTs, const unsigned int& starToken, const unsigned int& starDaqCmdIn, const unsigned int& starTrgCmdIn, - const uint64_t& eventStatusFlag, const std::vector& MissMatchFlagVec, const std::vector& GoodEventFlagVec ) + const uint64_t& eventStatusFlag, const std::vector& MissMatchFlagVec, const std::vector& GoodEventFlagVec, const std::vector& HasPulsersVec ) : mTrgGdpbFullTime( trgGdpbTime ), mTrgStarFullTime( trgStarTime ), mStarToken( starToken ), @@ -90,7 +93,8 @@ StETofHeader::StETofHeader( const double& trgGdpbTime, const double& trgStarTime mStarTrgCmdIn( starTrgCmdIn ), mEventStatusFlag( eventStatusFlag ), mMissMatchFlagVec( MissMatchFlagVec ), - mGoodEventFlagVec( GoodEventFlagVec ) + mGoodEventFlagVec( GoodEventFlagVec ), + mHasPulsersVec( HasPulsersVec ) { setRocGdpbTs( gdpbTs ); setRocStarTs( starTs ); @@ -169,6 +173,11 @@ StETofHeader::goodEventFlagVec() const { return mGoodEventFlagVec; } +std::vector +StETofHeader::hasPulsersVec() const +{ + return mHasPulsersVec; +} void StETofHeader::setTrgGdpbFullTime( const double& gdpbFullTime ) @@ -230,3 +239,9 @@ StETofHeader::setGoodEventFlagVec( const std::vector& FlagVec ) { mGoodEventFlagVec = FlagVec; } + +void +StETofHeader::setHasPulsersVec( const std::vector& PulserVec ) +{ + mHasPulsersVec = PulserVec; +} diff --git a/StRoot/StEvent/StETofHeader.h b/StRoot/StEvent/StETofHeader.h index 8daaa42f7a9..c19e50d8526 100644 --- a/StRoot/StEvent/StETofHeader.h +++ b/StRoot/StEvent/StETofHeader.h @@ -55,7 +55,7 @@ class StETofHeader : public StObject { ** @brief Full constructor including goodEventFlag, which is normally set in calibrations only. **/ StETofHeader( const double&, const double&, const map< unsigned int, uint64_t >&, const map< unsigned int, uint64_t >& , - const unsigned int&, const unsigned int&, const unsigned int&, const uint64_t&, const std::vector&, const std::vector& ); + const unsigned int&, const unsigned int&, const unsigned int&, const uint64_t&, const std::vector&, const std::vector& , const std::vector& ); ~StETofHeader(); @@ -78,6 +78,8 @@ class StETofHeader : public StObject { **/ std::vector goodEventFlagVec() const; + std::vector hasPulsersVec() const; + void setTrgGdpbFullTime( const double& gdpbFullTime ); void setTrgStarFullTime( const double& starFullTime ); @@ -92,7 +94,7 @@ class StETofHeader : public StObject { void setEventStatusFlag( const uint64_t& statusFlag ); void setGoodEventFlagVec( const std::vector& FlagVec ); void setGoodEventFlagVec( int blubb ) {return;} - // void setGoodEventFlagVec( const std::vector& FlagVec ); + void setHasPulsersVec( const std::vector& PulserVec ); private: Double_t mTrgGdpbFullTime; @@ -109,8 +111,9 @@ class StETofHeader : public StObject { std::vector< Bool_t > mMissMatchFlagVec; std::vector< Bool_t > mGoodEventFlagVec; + std::vector< Bool_t > mHasPulsersVec; - ClassDef( StETofHeader, 3 ) + ClassDef( StETofHeader, 4 ) }; #endif // STETOFHEADER_H diff --git a/StRoot/StMuDSTMaker/COMMON/StMuETofHeader.cxx b/StRoot/StMuDSTMaker/COMMON/StMuETofHeader.cxx index 5f655a2a041..d100bcdb752 100644 --- a/StRoot/StMuDSTMaker/COMMON/StMuETofHeader.cxx +++ b/StRoot/StMuDSTMaker/COMMON/StMuETofHeader.cxx @@ -178,7 +178,11 @@ StMuETofHeader::goodEventFlagVec() const { return mGoodEventFlagVec; } - +std::vector +StMuETofHeader::hasPulsersVec() const +{ + return mHasPulsersVec; +} void StMuETofHeader::setTrgGdpbFullTime( const double& gdpbFullTime ) @@ -240,3 +244,8 @@ StMuETofHeader::setGoodEventFlagVec( const std::vector& FlagVec ) { mGoodEventFlagVec = FlagVec; } +void +StMuETofHeader::setHasPulsersVec( const std::vector& PulserVec ) +{ + mHasPulsersVec = PulserVec; +} diff --git a/StRoot/StMuDSTMaker/COMMON/StMuETofHeader.h b/StRoot/StMuDSTMaker/COMMON/StMuETofHeader.h index d29262cdc55..85f212e5302 100644 --- a/StRoot/StMuDSTMaker/COMMON/StMuETofHeader.h +++ b/StRoot/StMuDSTMaker/COMMON/StMuETofHeader.h @@ -87,6 +87,7 @@ class StMuETofHeader : public TObject { **/ std::vector goodEventFlagVec() const; + std::vector hasPulsersVec() const; void setTrgGdpbFullTime( const double& gdpbFullTime ); void setTrgStarFullTime( const double& starFullTime ); @@ -100,6 +101,7 @@ class StMuETofHeader : public TObject { void setEventStatusFlag( const uint64_t& statusFlag ); void setGoodEventFlagVec( const std::vector& FlagVec ); + void setHasPulsersVec( const std::vector& PulserVec ); private: Double_t mTrgGdpbFullTime; @@ -115,9 +117,10 @@ class StMuETofHeader : public TObject { ULong64_t mEventStatusFlag; std::vector< Bool_t > mMissMatchFlagVec; - std::vector< Bool_t > mGoodEventFlagVec; + std::vector< Bool_t > mGoodEventFlagVec; + std::vector< Bool_t > mHasPulsersVec; - ClassDef( StMuETofHeader, 3 ) + ClassDef( StMuETofHeader, 4 ) }; #endif // STMUETOFHEADER_H diff --git a/StRoot/StPicoEvent/StPicoEvent.cxx b/StRoot/StPicoEvent/StPicoEvent.cxx index 2913c2572ed..403a96dabf9 100644 --- a/StRoot/StPicoEvent/StPicoEvent.cxx +++ b/StRoot/StPicoEvent/StPicoEvent.cxx @@ -147,9 +147,12 @@ StPicoEvent::StPicoEvent(const StPicoEvent &event) : TObject() { mJetPatchThreshold[iIter] = event.mJetPatchThreshold[iIter]; } - for(int iIter=0; iIter<108; iIter++) { + for(int iIter=0; iIter<1728; iIter++) { mETofGoodEventFlag[iIter] = event.mETofGoodEventFlag[iIter]; } + for(int iIter=0; iIter<108; iIter++) { + mETofHasPulsersFlag[iIter] = event.mETofHasPulsersFlag[iIter]; + } } //_________________ @@ -339,7 +342,7 @@ void StPicoEvent::setBunchId(Int_t id) { } //_________________ -bool StPicoEvent::eTofGoodEventFlag( UShort_t iSector, UShort_t iModule, UShort_t iCounter ) const { +bool StPicoEvent::eTofGoodEventFlag( UShort_t iSector, UShort_t iModule, UShort_t iCounter , UShort_t iGet4) const { if( iSector < 13 || iSector > 24 ){ LOG_INFO << "StPicoEvent::eTofGoodEventFlag() - non-existing sector id " << iSector <<" -> return false"<< endm; return false; @@ -352,13 +355,17 @@ bool StPicoEvent::eTofGoodEventFlag( UShort_t iSector, UShort_t iModule, UShort LOG_INFO << "StPicoEvent::eTofGoodEventFlag() - non-existing counter id " << iCounter <<" -> return false"<< endm; return false; } + if( iGet4 < 1 || iGet4 > 16 ){ + LOG_INFO << "StPicoEvent::eTofGoodEventFlag() - non-existing Get4 id " << iGet4 <<" -> return false"<< endm; + return false; + } - return (bool) mETofGoodEventFlag[ 9*(iSector-13) + 3*(iModule-1) + (iCounter-1) ]; + return (bool) mETofGoodEventFlag[ 3*3*16*(iSector-13) + 3*16*(iModule-1) + 16*(iCounter-1)+ (iGet4 - 1) ]; } //_________________ void StPicoEvent::setETofGoodEventFlag( std::vector flagVec ) { - if( flagVec.size() != 108 ){ - LOG_INFO << "StPicoEvent::setETofGoodEventFlag() - eTof flag vector wrong size " << flagVec.size() <<" / 108"<< endm; + if( flagVec.size() != 1728 ){ + LOG_INFO << "StPicoEvent::setETofGoodEventFlag() - eTof flag vector wrong size " << flagVec.size() <<" / 1728"<< endm; }else{ std::copy(flagVec.begin(), flagVec.end(), mETofGoodEventFlag); } diff --git a/StRoot/StPicoEvent/StPicoEvent.h b/StRoot/StPicoEvent/StPicoEvent.h index 3ff0b07a231..30c6863ccdc 100644 --- a/StRoot/StPicoEvent/StPicoEvent.h +++ b/StRoot/StPicoEvent/StPicoEvent.h @@ -141,10 +141,14 @@ class StPicoEvent : public TObject { UShort_t etofHitMultiplicity() const { return mETofHitMultiplicity; } /// Return number of digis in ETOF modules UShort_t etofDigiMultiplicity() const { return mETofDigiMultiplicity; } - /// Return goodEventFlag for a specific eTOF counter - bool eTofGoodEventFlag( UShort_t iSector, UShort_t iModule, UShort_t iCounter ) const; - /// Return goodEventFlag by array entry + /// Return goodEventFlag for a specific eTOF Get4 + bool eTofGoodEventFlag( UShort_t iSector, UShort_t iModule, UShort_t iCounter , UShort_t iGet4) const; + /// Return goodEventFlag by array entry bool eTofGoodEventFlag( UShort_t iDet ) const { return (bool) mETofGoodEventFlag[ iDet ]; } + /// Return pulser status for a specific eTOF counter (true if both pulsers present) + bool eTofPulserStatus( UShort_t iSector, UShort_t iModule, UShort_t iCounter ) const; + /// Return pulser ststus by array entry + bool eTofPulserStatus( UShort_t iDet ) const { return (bool) mETofGoodEventFlag[ iDet ]; } /// Return number of primary tracks UShort_t numberOfPrimaryTracks() const { return mNumberOfPrimaryTracks; } /// Return FXT multiplicity (corresponds to the number of primary tracks) @@ -279,9 +283,11 @@ class StPicoEvent : public TObject { /// Set total number of digis in ETOF modules void setETofDigiMultiplicity(UShort_t mult) { mETofDigiMultiplicity = (UShort_t)mult; } /// Set goodEventFlag for a specific eTOF counter - void setETofGoodEventFlag( bool flag, UShort_t iSector, UShort_t iModule, UShort_t iCounter ) { mETofGoodEventFlag[ 9*(iSector-1) + 3*(iModule-1) + (iCounter-1) ] = flag; } - /// Full setter goodEventFlag all specific eTOF counter. Used to copy over MuDst data + void setETofGoodEventFlag( bool flag, UShort_t iSector, UShort_t iModule, UShort_t iCounter, UShort_t iGet4 ) { mETofGoodEventFlag[ 3*3*16*(iSector-1) + 3*16*(iModule-1) + 16*(iCounter-1) + (iGet4-1)] = flag; } + /// Full setter goodEventFlag all specific eTOF Get4. Used to copy over MuDst data void setETofGoodEventFlag( std::vector flagVec ); + /// Full setter pulserStatusFlag all specific eTOF counter. Used to copy over MuDst data + void setETofHasPulsersFlag( std::vector pulserVec ); /// Set number of primary tracks void setNumberOfPrimaryTracks(UShort_t mult) { mNumberOfPrimaryTracks = (UShort_t)mult; } @@ -609,8 +615,9 @@ class StPicoEvent : public TObject { UShort_t mETofHitMultiplicity ; /// Total digi multiplicity in ETOF modules UShort_t mETofDigiMultiplicity ; - /// Flag to mark if the event is good for physics analysis for each counter. A counter is considered good in each event when there are zero missmatch flags set and pulser digis on both sides are found. In this case, the counter should perform at its best. Counter efficiency should be constant between good events. Here: CounterNr = 9*sector + 3*module + counter. - bool mETofGoodEventFlag[108]; + /// Flag to mark if the event is good for physics analysis for each Get4. A Get4 is considered good in each event when there are zero missmatch flags set. Get4 efficiency should be constant between good events. As additional sanity check one can request that both pulsers were present for any given event and counter. Best performance to be expected with zero status bits and both pulsers. Here: CounterNr = 9*(sector-13) + 3*(module-1) + counter. Get4Nr = 3*3*16*(sector-13)+ 3*16*(module -1) + 16*(counter -1) + Get4. + bool mETofGoodEventFlag[1728]; + bool mETofHasPulsersFlag[108]; /// Number of primary tracks UShort_t mNumberOfPrimaryTracks; @@ -619,9 +626,9 @@ class StPicoEvent : public TObject { UShort_t mZdcUnAttenuated[2]; #if defined (__TFG__VERSION__) - ClassDef(StPicoEvent, 9) + ClassDef(StPicoEvent, 10) #else /* ! __TFG__VERSION__ */ - ClassDef(StPicoEvent, 7) + ClassDef(StPicoEvent, 8) #endif }; diff --git a/StarVMC/xgeometry/xgeometry.age b/StarVMC/xgeometry/xgeometry.age index a275c12c4b3..abe543f0072 100644 --- a/StarVMC/xgeometry/xgeometry.age +++ b/StarVMC/xgeometry/xgeometry.age @@ -2542,8 +2542,8 @@ If LL>0 case y2023 { y2023: y2023 first cut geometry; Geom = 'y2023 '; call geom_y2023;} case y2023a { y2023a: y2023a production tag; Geom = 'y2023a '; call geom_y2023a;} - case y2023 { y2024: y2024 first cut geometry; Geom = 'y2024 '; call geom_y2024;} - case y2023a { y2024a: y2024a production tag; Geom = 'y2024a '; call geom_y2024a;} + case y2024 { y2024: y2024 first cut geometry; Geom = 'y2024 '; call geom_y2024;} + case y2024a { y2024a: y2024a production tag; Geom = 'y2024a '; call geom_y2024a;} case dev2021 { dev2021: First cut forward upgrades; Geom = 'dev2021 '; call geom_dev2021;} case dev2022 { dev2022: First cut forward upgrades; Geom = 'dev2022 '; call geom_dev2022;}