From bb286affa094600748a249dd8442c6e7b3c656cf Mon Sep 17 00:00:00 2001 From: "Stephen A. Wood" <saw@jlab.org> Date: Thu, 5 Dec 2013 15:53:49 -0500 Subject: [PATCH] Small Drift chamber code fixes so it won't crash with with SOS data. --- src/THcDC.cxx | 4 ++-- src/THcDC.h | 2 +- src/THcDriftChamber.cxx | 8 +++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/THcDC.cxx b/src/THcDC.cxx index 3fba8bc..2342ead 100644 --- a/src/THcDC.cxx +++ b/src/THcDC.cxx @@ -256,7 +256,7 @@ Int_t THcDC::ReadDatabase( const TDatime& date ) delete [] fTdcWinMin; fTdcWinMin = new Int_t [fNPlanes]; delete [] fTdcWinMax; fTdcWinMax = new Int_t [fNPlanes]; - delete [] fCentralTime; fCentralTime = new Int_t [fNPlanes]; + delete [] fCentralTime; fCentralTime = new Double_t [fNPlanes]; delete [] fNWires; fNWires = new Int_t [fNPlanes]; delete [] fNChamber; fNChamber = new Int_t [fNPlanes]; // Which chamber is this plane delete [] fWireOrder; fWireOrder = new Int_t [fNPlanes]; // Wire readout order @@ -284,7 +284,7 @@ Int_t THcDC::ReadDatabase( const TDatime& date ) {"dc_tdc_min_win", fTdcWinMin, kInt, fNPlanes}, {"dc_tdc_max_win", fTdcWinMax, kInt, fNPlanes}, - {"dc_central_time", fCentralTime, kInt, fNPlanes}, + {"dc_central_time", fCentralTime, kDouble, fNPlanes}, {"dc_nrwire", fNWires, kInt, fNPlanes}, {"dc_chamber_planes", fNChamber, kInt, fNPlanes}, {"dc_wire_counting", fWireOrder, kInt, fNPlanes}, diff --git a/src/THcDC.h b/src/THcDC.h index f383816..a8d0bfb 100644 --- a/src/THcDC.h +++ b/src/THcDC.h @@ -126,7 +126,7 @@ protected: // its plane number. Should we have a Get method for each or Int_t* fTdcWinMin; Int_t* fTdcWinMax; - Int_t* fCentralTime; + Double_t* fCentralTime; Int_t* fNWires; // Number of wires per plane Int_t* fNChamber; Int_t* fWireOrder; diff --git a/src/THcDriftChamber.cxx b/src/THcDriftChamber.cxx index 909dd7a..1140b38 100644 --- a/src/THcDriftChamber.cxx +++ b/src/THcDriftChamber.cxx @@ -140,14 +140,16 @@ Int_t THcDriftChamber::ReadDatabase( const TDatime& date ) prefix[0]=tolower(GetApparatus()->GetName()[0]); prefix[1]='\0'; DBRequest list[]={ - {"_remove_sppt_if_one_y_plane",&fRemove_Sppt_If_One_YPlane, kInt}, + {"_remove_sppt_if_one_y_plane",&fRemove_Sppt_If_One_YPlane, kInt,0,1}, {"dc_wire_velocity", &fWireVelocity, kDouble}, {"SmallAngleApprox", &fSmallAngleApprox, kInt}, - {"stub_max_xpdiff", &fStubMaxXPDiff, kDouble}, + {"stub_max_xpdiff", &fStubMaxXPDiff, kDouble,0,1}, {"debugflagpr", &fhdebugflagpr, kDouble}, {Form("dc_%d_zpos",fChamberNum), &fZPos, kDouble}, {0} }; + fRemove_Sppt_If_One_YPlane = 0; // Default + fStubMaxXPDiff = 0.05; // The HMS default. Not used for SOS. gHcParms->LoadParmValues((DBRequest*)&list,prefix); // Get parameters parent knows about @@ -1043,8 +1045,8 @@ void THcDriftChamber::LeftRight() plusminusknown[ihit1] = 1; plusminusknown[ihit2] = -1; } + npaired+=2; } - npaired+=2; } } } -- GitLab