Skip to content

Commit

Permalink
Revert changes made to THaTrackProj in commit 679be62
Browse files Browse the repository at this point in the history
The TRANSPORT x/y coordinates are currently not used anywhere and
aren't useful anyway. If anything, we should record a TVector3 of the
crossing point in the TRANSPORT system. The track projections are
intended to study the local detector response (position in the plane,
channel number, time of flight).
  • Loading branch information
hansenjo committed Jan 23, 2018
1 parent c6ca74e commit a0f8dc0
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 21 deletions.
1 change: 0 additions & 1 deletion src/THaScintillator.C
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,6 @@ Int_t THaScintillator::FineProcess( TClonesArray& tracks )
assert( pad >= 0 || fNhit == 0 ); // Must find a pad unless no hits
if( pad >= 0 ) {
proj->SetdX(dx);
proj->SetdY(proj->GetY());
proj->SetChannel(pad);
}
}
Expand Down
25 changes: 25 additions & 0 deletions src/THaTrackProj.C
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,34 @@
//////////////////////////////////////////////////////////////////////////////

#include "THaTrackProj.h"
#include <iostream>

using namespace std;

const Double_t THaTrackProj::kBig = 1.e38;

//_____________________________________________________________________________
void THaTrackProj::Clear( Option_t* )
{
// Reset per-event data.

fX = fY = fPathl = fdX = kBig;
fChannel = -1;
fIsOK = false;
}

//_____________________________________________________________________________
void THaTrackProj::Print( Option_t* opt )
{
// Print track projection info

TObject::Print(opt);
cout << "X/Y/dX = " << fX << "/" << fY << "/" << fdX << " m"
<< endl
<< "pathl/chan/good = " << fPathl << "/" << fChannel << "/" << fIsOK
<< endl;
}

//_____________________________________________________________________________
ClassImp(THaTrackProj)

29 changes: 9 additions & 20 deletions src/THaTrackProj.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
//////////////////////////////////////////////////////////////////////////

#include "TObject.h"
#include "TVector3.h"

class THaTrackProj : public TObject {

Expand All @@ -17,46 +16,36 @@ class THaTrackProj : public TObject {

THaTrackProj( Double_t x=kBig, Double_t y=kBig, Double_t pathl=kBig,
Double_t dx=kBig, Int_t ch=-1 )
: fX(x), fY(y), fXAbs(kBig), fYAbs(kBig), fPathl(pathl), fdX(dx), fdY(kBig),
fChannel(ch), fIsOK(false) {}
: fX(x), fY(y), fPathl(pathl), fdX(dx), fChannel(ch),
fIsOK(x<0.5*kBig&&y<0.5*kBig) {}
virtual ~THaTrackProj() {}

virtual void Clear( Option_t* opt="" );
virtual void Print( Option_t* opt="" );

Double_t GetX() const { return fX; }
Double_t GetY() const { return fY; }
Double_t GetXAbs() const { return fXAbs; }
Double_t GetYAbs() const { return fYAbs; }
Double_t GetdX() const { return fdX; }
Double_t GetdY() const { return fdY; }
Double_t GetPathLen() const { return fPathl; }
Int_t GetChannel() const { return fChannel; }
Bool_t IsOK() const { return fIsOK; }

void Set( Double_t x, Double_t y, Double_t pathl, Double_t dx, Int_t ch )
{ fX = x; fY = y; fPathl = pathl; fdX = dx; fChannel = ch; fIsOK = true; }
void Set( Double_t x, Double_t y, Double_t xabs, Double_t yabs,
Double_t pathl, Double_t dx, Double_t dy, Int_t ch )
{ fX = x; fY = y; fXAbs = xabs; fYAbs = yabs; fPathl = pathl;
fdX = dx; fdY = dy, fChannel = ch; fIsOK = true; }
void SetdX( Double_t dx ) { fdX = dx; }
void SetdY( Double_t dy ) { fdY = dy; }
void SetChannel( Int_t ch ) { fChannel = ch; }
void SetOK( Bool_t ok ) { fIsOK = ok; }
void SetOffset( const TVector3& origin )
{ fXAbs = fX+origin.X(); fYAbs = fY+origin.Y(); }

protected:
Double_t fX; // Track x at plane relative to plane origin (m)
Double_t fY; // Track y at plane relative to plane origin (m)
Double_t fXAbs; // Track x at plane in tracking system coords (m)
Double_t fYAbs; // Track y at plane in tracking system coords (m)
Double_t fX; // x-coord of track crossing in detector coords (m)
Double_t fY; // y-coord of track crossing in detector coords (m)
Double_t fPathl; // Pathlength from tracking reference plane (m)
Double_t fdX; // x-pos diff betw det elem center and track (m)
Double_t fdY; // y-pos diff betw det elem center and track (m)
Double_t fdX; // x-pos diff betw hit and and track proj (m)
Int_t fChannel; // Detector element number (starting at 0)
Bool_t fIsOK; // True if data valid (within defined detector area)

public:
ClassDef(THaTrackProj,3) // Track coordinates projected to detector plane
ClassDef(THaTrackProj,2) // Track coordinates projected to detector plane
};

#endif

0 comments on commit a0f8dc0

Please sign in to comment.