Skip to content
Snippets Groups Projects
Commit 7354c92b authored by Stephen A. Wood's avatar Stephen A. Wood
Browse files

Don't do hit position along wire time correction more than once.

In the ENGINE, this can happen if a hit belongs to more than one space point.
parent 357f1189
No related branches found
No related tags found
No related merge requests found
...@@ -21,6 +21,7 @@ public: ...@@ -21,6 +21,7 @@ public:
fWire(wire), fRawTime(rawtime), fTime(time), fWirePlane(wp), fWire(wire), fRawTime(rawtime), fTime(time), fWirePlane(wp),
fDist(0.0), ftrDist(kBig) { fDist(0.0), ftrDist(kBig) {
ConvertTimeToDist(); ConvertTimeToDist();
fCorrected = 0;
} }
virtual ~THcDCHit() {} virtual ~THcDCHit() {}
...@@ -37,6 +38,7 @@ public: ...@@ -37,6 +38,7 @@ public:
Double_t GetDist() const { return fDist; } Double_t GetDist() const { return fDist; }
Double_t GetPos() const { return fWire->GetPos(); } //Position of hit wire Double_t GetPos() const { return fWire->GetPos(); } //Position of hit wire
Double_t GetdDist() const { return fdDist; } Double_t GetdDist() const { return fdDist; }
Int_t GetCorrectedStatus() const { return fCorrected; }
THcDriftChamberPlane* GetWirePlane() const { return fWirePlane; } THcDriftChamberPlane* GetWirePlane() const { return fWirePlane; }
...@@ -50,6 +52,7 @@ public: ...@@ -50,6 +52,7 @@ public:
Int_t GetPlaneNum() const { return fWirePlane->GetPlaneNum(); } Int_t GetPlaneNum() const { return fWirePlane->GetPlaneNum(); }
Int_t GetPlaneIndex() const { return fWirePlane->GetPlaneIndex(); } Int_t GetPlaneIndex() const { return fWirePlane->GetPlaneIndex(); }
Int_t GetChamberNum() const { return fWirePlane->GetChamberNum(); } Int_t GetChamberNum() const { return fWirePlane->GetChamberNum(); }
void SetCorrectedStatus(Int_t c) { fCorrected = c; }
protected: protected:
static const Double_t kBig; //! static const Double_t kBig; //!
...@@ -61,6 +64,7 @@ protected: ...@@ -61,6 +64,7 @@ protected:
Double_t fDist; // (Perpendicular) Drift Distance Double_t fDist; // (Perpendicular) Drift Distance
Double_t fdDist; // uncertainty in fDist (for chi2 calc) Double_t fdDist; // uncertainty in fDist (for chi2 calc)
Double_t ftrDist; // (Perpendicular) distance from the track Double_t ftrDist; // (Perpendicular) distance from the track
Int_t fCorrected; // Has this hit been corrected?
THcDriftChamber* fChamber; //! Pointer to parent wire plane THcDriftChamber* fChamber; //! Pointer to parent wire plane
......
...@@ -241,7 +241,7 @@ Int_t THcDriftChamber::FindSpacePoints( void ) ...@@ -241,7 +241,7 @@ Int_t THcDriftChamber::FindSpacePoints( void )
SelectSpacePoints(); SelectSpacePoints();
if(fNSpacePoints == 0) cout << "SelectSpacePoints() killed SP" << endl; if(fNSpacePoints == 0) cout << "SelectSpacePoints() killed SP" << endl;
} }
//cout << fNSpacePoints << " Space Points remain" << endl; cout << fNSpacePoints << " Space Points remain" << endl;
// Add these space points to the total list of space points for the // Add these space points to the total list of space points for the
// the DC package. Do this in THcDC.cxx. // the DC package. Do this in THcDC.cxx.
#if 0 #if 0
...@@ -731,12 +731,19 @@ void THcDriftChamber::CorrectHitTimes() ...@@ -731,12 +731,19 @@ void THcDriftChamber::CorrectHitTimes()
// How do we know this correction only gets applied once? Is // How do we know this correction only gets applied once? Is
// it determined that a given hit can only belong to one space point? // it determined that a given hit can only belong to one space point?
Double_t time_corr = plane->GetReadoutX() ? Double_t time_corr = plane->GetReadoutX() ?
fSpacePoints[isp].y*plane->GetReadoutCorr()/fWireVelocity : y*plane->GetReadoutCorr()/fWireVelocity :
fSpacePoints[isp].x*plane->GetReadoutCorr()/fWireVelocity; x*plane->GetReadoutCorr()/fWireVelocity;
hit->SetTime(hit->GetTime() // cout << "Correcting hit " << hit << " " << plane->GetPlaneNum() << " " << isp << "/" << ihit << " " << x << "," << y << endl;
- plane->GetCentralTime() + plane->GetDriftTimeSign()*time_corr); // Fortran ENGINE does not do this check, so hits can get "corrected"
hit->ConvertTimeToDist(); // multiple times if they belong to multiple space points.
// To reproduce the precise ENGINE behavior, remove this if condition.
if(! hit->GetCorrectedStatus()) {
hit->SetTime(hit->GetTime() - plane->GetCentralTime()
+ plane->GetDriftTimeSign()*time_corr);
hit->ConvertTimeToDist();
hit->SetCorrectedStatus(1);
}
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment