diff --git a/reco/detectors/trd/CbmTrdClusterFinder.cxx b/reco/detectors/trd/CbmTrdClusterFinder.cxx index 5e07540503181353201f9b14c08c6b45c14c9464..68ae9497d99eb722c861307d86850da5df102f11 100644 --- a/reco/detectors/trd/CbmTrdClusterFinder.cxx +++ b/reco/detectors/trd/CbmTrdClusterFinder.cxx @@ -61,10 +61,6 @@ CbmTrdClusterFinder::~CbmTrdClusterFinder() fClusters->clear(); delete fClusters; } - // if (fGeoPar) { delete fGeoPar; } - // if(fModuleInfo){ - // delete fModuleInfo; - // } } //_____________________________________________________________________ diff --git a/reco/detectors/trd/CbmTrdHitProducer.cxx b/reco/detectors/trd/CbmTrdHitProducer.cxx index 8ab1405b1a55542858d2ae7815611e6eb026cfe9..d659dac69317f139abd171da7fdaf9a660bbfc8f 100644 --- a/reco/detectors/trd/CbmTrdHitProducer.cxx +++ b/reco/detectors/trd/CbmTrdHitProducer.cxx @@ -152,7 +152,7 @@ CbmTrdModuleRec* CbmTrdHitProducer::AddModule(Int_t address, const CbmTrdParModG // ---- processCluster ---- UInt_t CbmTrdHitProducer::processClusters() { - Int_t nclusters = fClusters->GetEntriesFast(); + Int_t nclusters = fClusters->size(); for (Int_t icluster = 0; icluster < nclusters; icluster++) { processCluster(icluster); @@ -191,7 +191,7 @@ UInt_t CbmTrdHitProducer::processClusters(CbmEvent* event) // ---- processCluster ---- void CbmTrdHitProducer::processCluster(const Int_t clusterIdx) { - auto cluster = static_cast<const CbmTrdCluster*>(fClusters->At(clusterIdx)); + const CbmTrdCluster* cluster = &fClusters->at(clusterIdx); if (!cluster) return; // get/build module for current cluster @@ -241,7 +241,7 @@ InitStatus CbmTrdHitProducer::Init() CbmDigiManager::Instance()->Init(); if (!CbmDigiManager::Instance()->IsPresent(ECbmModuleId::kTrd)) LOG(fatal) << GetName() << "Missing Trd digi branch."; - fClusters = (TClonesArray*) ioman->GetObject("TrdCluster"); + fClusters = ioman->InitObjectAs<std::vector<CbmTrdCluster> const*>("TrdCluster"); if (!fClusters) { LOG(error) << GetName() << "::Init: " << "no TrdCluster array!"; @@ -254,7 +254,9 @@ InitStatus CbmTrdHitProducer::Init() // If not deactivated by the user, the hitproducer will look for the CbmEvent branch, to only use Digis connected to a CbmEvent. If no CbmEvent branch is found all digis in the TrdDigi branch are automatically used. if (CbmTrdClusterFinder::UseOnlyEventDigis()) { fEvents = dynamic_cast<TClonesArray*>(ioman->GetObject("CbmEvent")); - if (fEvents == nullptr) { CbmTrdClusterFinder::SetUseOnlyEventDigis(kFALSE); } + if (fEvents == nullptr) { + CbmTrdClusterFinder::SetUseOnlyEventDigis(kFALSE); + } } // Get the full geometry information of the detector gas layers and store @@ -288,9 +290,9 @@ void CbmTrdHitProducer::Exec(Option_t*) TStopwatch timerTs; timerTs.Start(); - Long64_t nClusters = fClusters->GetEntriesFast(); - UInt_t nEvents = 0; - fNrHitsCall = 0; + Long64_t nClusters = fClusters->size(); + UInt_t nEvents = 0; + fNrHitsCall = 0; if (CbmTrdClusterFinder::UseOnlyEventDigis()) { for (auto eventobj : *fEvents) { diff --git a/reco/detectors/trd/CbmTrdHitProducer.h b/reco/detectors/trd/CbmTrdHitProducer.h index 0a67b777e9ad5d89160661d6d1da8f6ebeeeb08d..a5a0912332cb5fa9adeb5dd33d147a5af42fae45 100644 --- a/reco/detectors/trd/CbmTrdHitProducer.h +++ b/reco/detectors/trd/CbmTrdHitProducer.h @@ -34,7 +34,7 @@ class CbmTrdParSetGain; class CbmTrdParSetGeo; class CbmTrdModuleRec; class CbmTrdHitProducer : public FairTask { -public: + public: /** * \brief Constructor. */ @@ -63,7 +63,7 @@ public: /** \brief Correction of hit time in TRD2D due to different processes */ void SetHitTimeOffset(int dt) { fHitTimeOffset = dt; } -private: + private: CbmTrdHitProducer(const CbmTrdHitProducer&); CbmTrdHitProducer& operator=(const CbmTrdHitProducer&); @@ -110,7 +110,7 @@ private: /** @brief Input array of CbmTrdCluster */ - TClonesArray* fClusters = nullptr; + const std::vector<CbmTrdCluster>* fClusters = nullptr; /** @brief Output array of CbmTrdHit */ TClonesArray* fHits = nullptr; /** @brief Array connected to the CbmEvent branch */