diff --git a/src/THcAerogel.cxx b/src/THcAerogel.cxx index af259a3c8790da16f1c2705809f3daca92587225..4b2559c09c97219713b22f2b8e59655667d31b68 100644 --- a/src/THcAerogel.cxx +++ b/src/THcAerogel.cxx @@ -140,15 +140,8 @@ void THcAerogel::DeleteArrays() //_____________________________________________________________________________ THaAnalysisObject::EStatus THcAerogel::Init( const TDatime& date ) { - cout << "THcAerogel::Init " << GetName() << endl; - - // Should probably put this in ReadDatabase as we will know the - // maximum number of hits after setting up the detector map - InitHitList(fDetMap, "THcAerogelHit", 100); - EStatus status; - if( (status = THaNonTrackingDetector::Init( date )) ) - return fStatus=status; + cout << "THcAerogel::Init " << GetName() << endl; char EngineDID[] = "xAERO"; EngineDID[0] = toupper(GetApparatus()->GetName()[0]); @@ -158,6 +151,14 @@ THaAnalysisObject::EStatus THcAerogel::Init( const TDatime& date ) return kInitError; } + // Should probably put this in ReadDatabase as we will know the + // maximum number of hits after setting up the detector map + InitHitList(fDetMap, "THcAerogelHit", fDetMap->GetTotNumChan()+1); + + EStatus status; + if( (status = THaNonTrackingDetector::Init( date )) ) + return fStatus=status; + return fStatus = kOK; } diff --git a/src/THcCherenkov.cxx b/src/THcCherenkov.cxx index 44531d9aa529a6471f45f33d869451705ed766d1..6fc3c9d04d91d46d0d926fa23368d512fbe6b060 100644 --- a/src/THcCherenkov.cxx +++ b/src/THcCherenkov.cxx @@ -115,14 +115,6 @@ THaAnalysisObject::EStatus THcCherenkov::Init( const TDatime& date ) cout << "THcCherenkov::Init " << GetName() << endl; - // Should probably put this in ReadDatabase as we will know the - // maximum number of hits after setting up the detector map - InitHitList(fDetMap, "THcCherenkovHit", 100); // 100 is max hits - - EStatus status; - if( (status = THaNonTrackingDetector::Init( date )) ) - return fStatus=status; - char EngineDID[] = "xCER"; EngineDID[0] = toupper(GetApparatus()->GetName()[0]); if( gHcDetectorMap->FillMap(fDetMap, EngineDID) < 0 ) { @@ -131,6 +123,14 @@ THaAnalysisObject::EStatus THcCherenkov::Init( const TDatime& date ) return kInitError; } + // Should probably put this in ReadDatabase as we will know the + // maximum number of hits after setting up the detector map + InitHitList(fDetMap, "THcCherenkovHit", fDetMap->GetTotNumChan()+1); + + EStatus status; + if( (status = THaNonTrackingDetector::Init( date )) ) + return fStatus=status; + return fStatus = kOK; } diff --git a/src/THcDC.cxx b/src/THcDC.cxx index 3bdbda02b2345abe114ff98515d0c55387e97872..1c686ca57067a214cb2b140b1b4c4d264c7820a5 100644 --- a/src/THcDC.cxx +++ b/src/THcDC.cxx @@ -178,9 +178,17 @@ THaAnalysisObject::EStatus THcDC::Init( const TDatime& date ) Setup(GetName(), GetTitle()); // Create the subdetectors here EffInit(); + char EngineDID[] = "xDC"; + EngineDID[0] = toupper(GetApparatus()->GetName()[0]); + if( gHcDetectorMap->FillMap(fDetMap, EngineDID) < 0 ) { + static const char* const here = "Init()"; + Error( Here(here), "Error filling detectormap for %s.", EngineDID ); + return kInitError; + } + // Should probably put this in ReadDatabase as we will know the // maximum number of hits after setting up the detector map - InitHitList(fDetMap, "THcRawDCHit", 1000); + InitHitList(fDetMap, "THcRawDCHit", fDetMap->GetTotNumChan()+1); EStatus status; // This triggers call of ReadDatabase and DefineVariables @@ -217,14 +225,6 @@ THaAnalysisObject::EStatus THcDC::Init( const TDatime& date ) // }; // memcpy( fDataDest, tmp, NDEST*sizeof(DataDest) ); - char EngineDID[] = "xDC"; - EngineDID[0] = toupper(GetApparatus()->GetName()[0]); - if( gHcDetectorMap->FillMap(fDetMap, EngineDID) < 0 ) { - static const char* const here = "Init()"; - Error( Here(here), "Error filling detectormap for %s.", EngineDID ); - return kInitError; - } - return fStatus = kOK; } diff --git a/src/THcHodoscope.cxx b/src/THcHodoscope.cxx index ed72787a6949fad63ed49e82c9d65f1932bdfd1b..c22b1d97ed74d44ae273f9b37548e6900ffeb247 100644 --- a/src/THcHodoscope.cxx +++ b/src/THcHodoscope.cxx @@ -173,13 +173,20 @@ THaAnalysisObject::EStatus THcHodoscope::Init( const TDatime& date ) cout << "In THcHodoscope::Init()" << endl; Setup(GetName(), GetTitle()); + char EngineDID[] = "xSCIN"; + EngineDID[0] = toupper(GetApparatus()->GetName()[0]); + if( gHcDetectorMap->FillMap(fDetMap, EngineDID) < 0 ) { + static const char* const here = "Init()"; + Error( Here(here), "Error filling detectormap for %s.", EngineDID ); + return kInitError; + } + // Should probably put this in ReadDatabase as we will know the // maximum number of hits after setting up the detector map // But it needs to happen before the sub detectors are initialized // so that they can get the pointer to the hitlist. - - InitHitList(fDetMap, "THcRawHodoHit", 100); + InitHitList(fDetMap, "THcRawHodoHit", fDetMap->GetTotNumChan()+1); EStatus status; // This triggers call of ReadDatabase and DefineVariables @@ -199,14 +206,6 @@ THaAnalysisObject::EStatus THcHodoscope::Init( const TDatime& date ) // }; // memcpy( fDataDest, tmp, NDEST*sizeof(DataDest) ); - char EngineDID[] = "xSCIN"; - EngineDID[0] = toupper(GetApparatus()->GetName()[0]); - if( gHcDetectorMap->FillMap(fDetMap, EngineDID) < 0 ) { - static const char* const here = "Init()"; - Error( Here(here), "Error filling detectormap for %s.", EngineDID ); - return kInitError; - } - fNScinHits = new Int_t [fNPlanes]; fGoodPlaneTime = new Bool_t [fNPlanes]; fNPlaneTime = new Int_t [fNPlanes]; diff --git a/src/THcRaster.cxx b/src/THcRaster.cxx index ca6649090cafbcc1596d5a14ed404faa407e148c..03bc550d3217866bafb1ff65337c135825b4cfb3 100644 --- a/src/THcRaster.cxx +++ b/src/THcRaster.cxx @@ -139,12 +139,6 @@ THaAnalysisObject::EStatus THcRaster::Init( const TDatime& date ) { cout << "THcRaster::Init()" << endl; - THcHitList::InitHitList(fDetMap,"THcRasterRawHit",4); - - EStatus status; - if( (status = THaBeamDet::Init( date )) ) - return fStatus=status; - // Fill detector map with RASTER type channels if( gHcDetectorMap->FillMap(fDetMap, "RASTER") < 0 ) { static const char* const here = "Init()"; @@ -153,6 +147,12 @@ THaAnalysisObject::EStatus THcRaster::Init( const TDatime& date ) return kInitError; } + THcHitList::InitHitList(fDetMap,"THcRasterRawHit",fDetMap->GetTotNumChan()+1); + + EStatus status; + if( (status = THaBeamDet::Init( date )) ) + return fStatus=status; + return fStatus = kOK; } diff --git a/src/THcShower.cxx b/src/THcShower.cxx index 61cd8d2591e4f5cb0a55873439a5038684281e8b..1c7e447628e0b74e68f00db8a064bcb523357fa0 100644 --- a/src/THcShower.cxx +++ b/src/THcShower.cxx @@ -130,10 +130,18 @@ THaAnalysisObject::EStatus THcShower::Init( const TDatime& date ) { Setup(GetName(), GetTitle()); + char EngineDID[] = "xCAL"; + EngineDID[0] = toupper(GetApparatus()->GetName()[0]); + if( gHcDetectorMap->FillMap(fDetMap, EngineDID) < 0 ) { + static const char* const here = "Init()"; + Error( Here(here), "Error filling detectormap for %s.", EngineDID ); + return kInitError; + } + // Should probably put this in ReadDatabase as we will know the // maximum number of hits after setting up the detector map - InitHitList(fDetMap, "THcRawShowerHit", 100); + InitHitList(fDetMap, "THcRawShowerHit", fDetMap->GetTotNumChan()+1); EStatus status; if( (status = THaNonTrackingDetector::Init( date )) ) @@ -150,14 +158,6 @@ THaAnalysisObject::EStatus THcShower::Init( const TDatime& date ) } } - char EngineDID[] = "xCAL"; - EngineDID[0] = toupper(GetApparatus()->GetName()[0]); - if( gHcDetectorMap->FillMap(fDetMap, EngineDID) < 0 ) { - static const char* const here = "Init()"; - Error( Here(here), "Error filling detectormap for %s.", EngineDID ); - return kInitError; - } - if(fHasArray) { cout << "THcShower::Init: adjustment of fiducial volume limits to the fly's eye part." << endl; cout << " Old limits:" << endl;