Skip to content
Snippets Groups Projects
Commit cf31b529 authored by Stephen A. Wood's avatar Stephen A. Wood
Browse files

Add some compatibility code for older root versions that don't have the

TClonesArray ConstructedAt method.
parent b66f9622
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
#include "THcHitList.h" #include "THcHitList.h"
#include "TError.h"
#include "TClass.h"
using namespace std; using namespace std;
...@@ -35,7 +37,15 @@ void THcHitList::InitHitList(THaDetMap* detmap, ...@@ -35,7 +37,15 @@ void THcHitList::InitHitList(THaDetMap* detmap,
fNMaxRawHits = maxhits; fNMaxRawHits = maxhits;
fNRawHits = 0; fNRawHits = 0;
for(Int_t i=0;i<maxhits;i++) { for(Int_t i=0;i<maxhits;i++) {
#if ROOT_VERSION_CODE >= ROOT_VERSION(5,32,0)
fRawHitList->ConstructedAt(i); fRawHitList->ConstructedAt(i);
#else
// The essence of the ConstructedAt code explictly
TObject* obj = (*fRawHitList)[i];
R__ASSERT( obj ); // should never happen ...
if( !obj->TestBit(TObject::kNotDeleted) )
fRawHitClass->New(obj);
#endif
} }
fdMap = detmap; fdMap = detmap;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment