88// granted to it by virtue of its status as an Intergovernmental Organization
99// or submit itself to any jurisdiction.
1010
11- #include " TClonesArray.h"
1211#include " TGeoManager.h" // for TGeoManager
1312#include " TLorentzVector.h"
1413#include " TMath.h"
@@ -32,7 +31,7 @@ Detector::Detector(Bool_t active)
3231 : o2::Base::Detector(" TOF" , active),
3332 mEventNr(0 ),
3433 mTOFHoles(kTRUE ),
35- mHitCollection (new TClonesArray(o2::Base::getTClArrTrueTypeName <HitType>().c_str()) ),
34+ mHits (new std::vector <HitType>),
3635 mMCTrackBranchId(-1 )
3736{
3837 for (Int_t i = 0 ; i < Geo::NSECTORS; i++)
@@ -76,34 +75,25 @@ Bool_t Detector::ProcessHits(FairVolume* v)
7675
7776HitType* Detector::addHit (Float_t x, Float_t y, Float_t z, Float_t time, Float_t energy, Int_t trackId, Int_t detId)
7877{
79- TClonesArray& clref = *mHitCollection ;
80-
81- Int_t size = clref.GetEntriesFast ();
82-
83- HitType* hit = new (clref[size]) HitType (x, y, z, time, energy, trackId, detId);
84-
85- if (mMCTrackBranchId > -1 )
86- hit->SetLink (FairLink (-1 , mEventNr , mMCTrackBranchId , trackId));
87-
88- return hit;
78+ mHits ->emplace_back (x, y, z, time, energy, trackId, detId);
79+ return &mHits ->back ();
8980}
9081
9182void Detector::Register ()
9283{
9384 auto * mgr = FairRootManager::Instance ();
94- mgr->Register (addNameTo (" Hit" ).data (), GetName (), mHitCollection , kTRUE );
85+ mgr->RegisterAny (addNameTo (" Hit" ).data (), mHits , kTRUE );
9586
9687 mMCTrackBranchId = mgr->GetBranchId (" MCTrack" );
9788}
9889
9990TClonesArray* Detector::GetCollection (Int_t iColl) const
10091{
101- if (iColl > 0 )
102- return nullptr ;
103- return mHitCollection ;
92+ LOG (WARNING) << " GetCollection interface no longer supported" << FairLogger::endl;
93+ return nullptr ;
10494}
10595
106- void Detector::Reset () { mHitCollection -> Clear (); }
96+ void Detector::Reset () { mHits -> clear (); }
10797void Detector::CreateMaterials ()
10898{
10999 Int_t isxfld = 2 ;
0 commit comments