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

Correct hit times for signal propagation along wire for hits in space points.

parent b519f00b
Branches
Tags
No related merge requests found
......@@ -404,6 +404,7 @@ Int_t THcDC::CoarseTrack( TClonesArray& /* tracks */ )
for(Int_t i=0;i<fNChambers;i++) {
fChambers[i]->FindSpacePoints();
fChambers[i]->CorrectHitTimes();
}
ApplyCorrections();
......
......@@ -52,6 +52,8 @@ public:
Int_t GetMaxHits(Int_t chamber) const { return fMaxHits[chamber-1];}
Int_t GetMinCombos(Int_t chamber) const { return fMinCombos[chamber-1];}
Double_t GetSpacePointCriterion(Int_t chamber) const { return TMath::Sqrt(fSpace_Point_Criterion2[chamber-1]);}
Double_t GetCentralTime(Int_t plane) const { return fCentralTime[plane-1];}
Int_t GetDriftTimeSign(Int_t plane) const { return fDriftTimeSign[plane-1];}
Double_t GetPlaneTimeZero(Int_t plane) const { return fPlaneTimeZero[plane-1];}
......
......@@ -119,6 +119,7 @@ Int_t THcDriftChamber::ReadDatabase( const TDatime& date )
prefix[1]='\0';
DBRequest list[]={
{"_remove_sppt_if_one_y_plane",&fRemove_Sppt_If_One_YPlane, kInt},
{"dc_wire_velocity", &fWireVelocity, kDouble},
{0}
};
gHcParms->LoadParmValues((DBRequest*)&list,prefix);
......@@ -709,20 +710,36 @@ void THcDriftChamber::SelectSpacePoints()
fNSpacePoints = sp_count;
}
/*
*
* Now we know rough hit positions in the chambers so we can make
* wire velocity drift time corrections for each hit in the space point
*
* Assume all wires for a plane are read out on the same side (l/r or t/b).
* If the wire is closer to horizontal, read out left/right. If nearer
* vertical, assume top/bottom. (Note, this is not always true for the
* SOS u and v planes. They have 1 card each on the side, but the overall
* time offset per card will cancel much of the error caused by this. The
* alternative is to check by card, rather than by plane and this is harder.
*/
void THcDriftChamber::CorrectHitTimes()
{
// Use the rough hit positions in the chambers to correct the drift time
// for hits in the space points.
// Assume all wires for a plane are read out on the same side (l/r or t/b).
// If the wire is closer to horizontal, read out left/right. If nearer
// vertical, assume top/bottom. (Note, this is not always true for the
// SOS u and v planes. They have 1 card each on the side, but the overall
// time offset per card will cancel much of the error caused by this. The
// alternative is to check by card, rather than by plane and this is harder.
for(Int_t isp=0;isp<fNSpacePoints;isp++) {
Double_t x = fSpacePoints[isp].x;
Double_t y = fSpacePoints[isp].y;
for(Int_t ihit=0;ihit<fSpacePoints[isp].nhits;ihit++) {
THcDCHit* hit = fSpacePoints[isp].hits[ihit];
THcDriftChamberPlane* plane=hit->GetWirePlane();
// How do we know this correction only gets applied once? Is
// it determined that a given hit can only belong to one space point?
Double_t time_corr = plane->GetReadoutX() ?
fSpacePoints[isp].y*plane->GetReadoutCorr()/fWireVelocity :
fSpacePoints[isp].x*plane->GetReadoutCorr()/fWireVelocity;
hit->SetTime(hit->GetTime()
- plane->GetCentralTime() + plane->GetDriftTimeSign()*time_corr);
hit->ConvertTimeToDist();
}
}
}
//_____________________________________________________________________________
THcDriftChamber::~THcDriftChamber()
{
......
......@@ -33,6 +33,7 @@ public:
virtual Int_t ApplyCorrections( void );
virtual void ProcessHits( void );
virtual Int_t FindSpacePoints( void ) ;
virtual void CorrectHitTimes( void ) ;
virtual void Clear( Option_t* opt="" );
......@@ -66,6 +67,7 @@ protected:
Int_t fMaxHits; // Maximum required to do something
Int_t fMinCombos; // Minimum # pairs in a space point
Int_t fRemove_Sppt_If_One_YPlane;
Double_t fWireVelocity;
Double_t fXCenter;
Double_t fYCenter;
......
......@@ -110,6 +110,8 @@ Int_t THcDriftChamberPlane::ReadDatabase( const TDatime& date )
fTdcWinMax = fParent->GetTdcWinMax(fPlaneNum);
fPlaneTimeZero = fParent->GetPlaneTimeZero(fPlaneNum);
fCenter = fParent->GetCenter(fPlaneNum);
fCentralTime = fParent->GetCentralTime(fPlaneNum);
fDriftTimeSign = fParent->GetDriftTimeSign(fPlaneNum);
fNSperChan = fParent->GetNSperChan();
......@@ -133,6 +135,14 @@ Int_t THcDriftChamberPlane::ReadDatabase( const TDatime& date )
Double_t hychi = sinalpha*cosgamma;
Double_t hypsi = cosalpha*cosgamma;
if(cosalpha <= 0.707) { // x-like wire, need dist from x=0 line
fReadoutX = 1;
fReadoutCorr = 1/sinalpha;
} else {
fReadoutX = 0;
fReadoutCorr = 1/cosalpha;
}
Double_t sumsqupsi = hzpsi*hzpsi+hxpsi*hxpsi+hypsi*hypsi;
Double_t sumsquchi = hzchi*hzchi+hxchi*hxchi+hychi*hychi;
Double_t sumcross = hzpsi*hzchi + hxpsi*hxchi + hypsi*hychi;
......
......@@ -57,6 +57,10 @@ class THcDriftChamberPlane : public THaSubDetector {
Int_t GetPlaneIndex() { return fPlaneIndex; }
Double_t GetXsp() const { return fXsp; }
Double_t GetYsp() const { return fYsp; }
Int_t GetReadoutX() { return fReadoutX; }
Double_t GetReadoutCorr() { return fReadoutCorr; }
Double_t GetCentralTime() { return fCentralTime; }
Int_t GetDriftTimeSign() { return fDriftTimeSign; }
protected:
......@@ -78,6 +82,11 @@ class THcDriftChamberPlane : public THaSubDetector {
Double_t fXsp;
Double_t fYsp;
Int_t fReadoutX;
Double_t fReadoutCorr;
Double_t fCentralTime;
Int_t fDriftTimeSign;
Double_t fCenter;
Double_t fNSperChan; /* TDC bin size */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment