diff --git a/src/THcDCHit.h b/src/THcDCHit.h index c63e1386881f50113beaf2f5998f05d1433ab98c..fd40831f0e2e562a5fc523ddf4c2ee41715b88c3 100644 --- a/src/THcDCHit.h +++ b/src/THcDCHit.h @@ -17,12 +17,12 @@ class THcDCHit : public TObject { public: THcDCHit( THcDCWire* wire=NULL, Int_t rawtime=0, Double_t time=0.0, - THcDriftChamberPlane* wp=0) : + THcDriftChamberPlane* wp=0) : fWire(wire), fRawTime(rawtime), fTime(time), fWirePlane(wp), fDist(0.0), ftrDist(kBig) { - ConvertTimeToDist(); - fCorrected = 0; - } + if (wire) ConvertTimeToDist(); + fCorrected = 0; + } virtual ~THcDCHit() {} virtual Double_t ConvertTimeToDist(); @@ -44,7 +44,7 @@ public: THcDriftChamberPlane* GetWirePlane() const { return fWirePlane; } - void SetWire(THcDCWire * wire) { fWire = wire; } + void SetWire(THcDCWire * wire) { fWire = wire; ConvertTimeToDist(); } void SetRawTime(Int_t time) { fRawTime = time; } void SetTime(Double_t time) { fTime = time; } void SetDist(Double_t dist) { fDist = dist; }