diff --git a/src/THcDC.cxx b/src/THcDC.cxx index 02c864687d650ab66af4bb6d9c156b2fb3553bc4..227becfc686559739e0ebfd680d078121ed03bb3 100644 --- a/src/THcDC.cxx +++ b/src/THcDC.cxx @@ -71,6 +71,9 @@ THcDC::THcDC( fProjectToChamber = 0; // Use 1 for SOS chambers fDCTracks = new TClonesArray( "THcDCTrack", 20 ); + + fNChamHits = 0; + fPlaneEvents = 0; } //_____________________________________________________________________________ @@ -404,6 +407,10 @@ void THcDC::DeleteArrays() delete [] fPlaneTimeZero; fPlaneTimeZero = NULL; delete [] fSigma; fSigma = NULL; + // Efficiency arrays + delete [] fNChamHits; fNChamHits = NULL; + delete [] fPlaneEvents; fPlaneEvents = NULL; + } //_____________________________________________________________________________ @@ -1083,7 +1090,7 @@ void THcDC::EffInit() // efficiencies. Register the counters in gHcParms so that the // variables can be used in end of run reports. - delete [] fNChamHits; fNChamHits = new Int_t [fNChambers]; + delete [] fNChamHits; fNChamHits = new Int_t [fNChambers]; delete [] fPlaneEvents; fPlaneEvents = new Int_t [fNPlanes]; fTotEvents = 0; diff --git a/src/THcDriftChamber.cxx b/src/THcDriftChamber.cxx index 2dc7b0621a03d9308447a96e4b0f6b880fe38328..e7d6a894f35287094b3af401064d7b52cf1cb098 100644 --- a/src/THcDriftChamber.cxx +++ b/src/THcDriftChamber.cxx @@ -41,6 +41,7 @@ THcDriftChamber::THcDriftChamber( // Constructor // fTrackProj = new TClonesArray( "THaTrackProj", 5 ); + fTrackProj = NULL; fNPlanes = 0; // No planes until we make them fChamberNum = chambernum; @@ -56,14 +57,6 @@ void THcDriftChamber::Setup(const char* name, const char* description) } -//_____________________________________________________________________________ -THcDriftChamber::THcDriftChamber( ) : - THaSubDetector() -{ - // Constructor - fPlanes.clear(); - fSpacePoints = NULL; -} //_____________________________________________________________________________ Int_t THcDriftChamber::Decode( const THaEvData& evdata ) { @@ -1242,6 +1235,14 @@ THcDriftChamber::~THcDriftChamber() void THcDriftChamber::DeleteArrays() { // Delete member arrays. Used by destructor. + delete fCosBeta; fCosBeta = NULL; + delete fSinBeta; fSinBeta = NULL; + delete fTanBeta; fTanBeta = NULL; + delete fSigma; fSigma = NULL; + delete fPsi0; fPsi0 = NULL; + delete fStubCoefs; fStubCoefs = NULL; + + // Need to delete each element of the fAA3Inv map } diff --git a/src/THcDriftChamber.h b/src/THcDriftChamber.h index 0fc61167e08ec365f7103a7c9ccd1a3c795f0a49..7cb2f5e66fac030ec7a28f13780034970caa5c48 100644 --- a/src/THcDriftChamber.h +++ b/src/THcDriftChamber.h @@ -55,7 +55,6 @@ public: // friend class THaScCalib; void SetHMSStyleFlag(Int_t flag) {fHMSStyleChambers = flag;} - THcDriftChamber(); // for ROOT I/O // Why do we need this? protected: Int_t f; diff --git a/src/THcDriftChamberPlane.cxx b/src/THcDriftChamberPlane.cxx index ec36cf933c9784485a1d458656b6839888e68cdf..b1828ddb2b8e4d0a852e0f301ba817f150b145ad 100644 --- a/src/THcDriftChamberPlane.cxx +++ b/src/THcDriftChamberPlane.cxx @@ -37,6 +37,7 @@ THcDriftChamberPlane::THcDriftChamberPlane( const char* name, // Normal constructor with name and description fHits = new TClonesArray("THcDCHit",100); fWires = new TClonesArray("THcDCWire", 100); + fTTDConv = NULL; fPlaneNum = planenum; } @@ -46,6 +47,9 @@ THcDriftChamberPlane::THcDriftChamberPlane() : THaSubDetector() { // Constructor + fHits = NULL; + fWires = NULL; + fTTDConv = NULL; } //______________________________________________________________________________ THcDriftChamberPlane::~THcDriftChamberPlane()