From cf31b529cdce18b59471ba0a135e3cda5c4ce523 Mon Sep 17 00:00:00 2001
From: "Stephen A. Wood" <saw@jlab.org>
Date: Tue, 1 May 2012 15:15:02 -0400
Subject: [PATCH] Add some compatibility code for older root versions that
 don't have the TClonesArray ConstructedAt method.

---
 src/THcHitList.cxx | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/THcHitList.cxx b/src/THcHitList.cxx
index 9a1303b..81464d6 100644
--- a/src/THcHitList.cxx
+++ b/src/THcHitList.cxx
@@ -11,6 +11,8 @@
 //////////////////////////////////////////////////////////////////////////
 
 #include "THcHitList.h"
+#include "TError.h"
+#include "TClass.h"
 
 using namespace std;
 
@@ -35,7 +37,15 @@ void THcHitList::InitHitList(THaDetMap* detmap,
   fNMaxRawHits = maxhits;
   fNRawHits = 0;
   for(Int_t i=0;i<maxhits;i++) {
+#if ROOT_VERSION_CODE >= ROOT_VERSION(5,32,0)
     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;
-- 
GitLab