/** * @file * @author Christian Simon * @since 2018-05-08 */ #include "CbmTofPointCluster.h" #include "TMath.h" // --------------------------------------------------------------------------- CbmTofPointCluster::CbmTofPointCluster() : fbCharged(kTRUE), fbDirect(kFALSE), fiNPoints(0), fdEarliestPointTime(0.), fEarliestPoint(-1, -1, -1), fDirectPoint(-1, -1, -1) { } // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- const std::tuple& CbmTofPointCluster::GetReferencePoint() const { if(fbCharged) { // The charged external track which entered the counter box did not create // an MC point in the active counter volume itself but can be detected only // via MC points created by internal tracks descending from the external one. if(!fbDirect) { return fEarliestPoint; } else { return fDirectPoint; } } else { return fEarliestPoint; } } // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- void CbmTofPointCluster::AddPoint(Int_t iFile, Int_t iEvent, Int_t iIndex, Double_t dTime, Bool_t bDirect) { if(0. == fdEarliestPointTime || dTime < fdEarliestPointTime) { fdEarliestPointTime = dTime; std::get<0>(fEarliestPoint) = iFile; std::get<1>(fEarliestPoint) = iEvent; std::get<2>(fEarliestPoint) = iIndex; } if(bDirect) { std::get<0>(fDirectPoint) = iFile; std::get<1>(fDirectPoint) = iEvent; std::get<2>(fDirectPoint) = iIndex; fbDirect = bDirect; } fiNPoints++; } // --------------------------------------------------------------------------- ClassImp(CbmTofPointCluster)