Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/THcLADGEM.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,13 @@ Int_t THcLADGEM::DefineVariables(EMode mode) {
{"trk.d0", "Track dist from vertex", "fGEMTracks.THcLADGEMTrack.GetD0()"},
{"trk.d0_good", "Track dist from true vertex", "fGEMTracks.THcLADGEMTrack.GetGoodD0()"},
{"trk.projz", "Projected z-vertex", "fGEMTracks.THcLADGEMTrack.GetProjVz()"},
{"trk.projx", "Projected x-vertex", "fGEMTracks.THcLADGEMTrack.GetProjVx()"},
{"trk.projy", "Projected y-vertex", "fGEMTracks.THcLADGEMTrack.GetProjVy()"},
{"trk.has_hodo_hit", "Track has hodoscope hit", "fGEMTracks.THcLADGEMTrack.GetHasHodoHit()"},
// {"trk.theta", "Track theta", "fGEMTracks.THcLADGEMTrack.GetTheta()"},
// {"trk.phi", "Track phi", "fGEMTracks.THcLADGEMTrack.GetPhi()"},
{"trk.chisq", "Track chi-squared", "fGEMTracks.THcLADGEMTrack.GetChisq()"},
{"trk.theta", "Track theta", "fGEMTracks.THcLADGEMTrack.GetTheta()"},
{"trk.phi", "Track phi", "fGEMTracks.THcLADGEMTrack.GetPhi()"},
{"trk.is_good", "Track is good", "fGEMTracks.THcLADGEMTrack.IsGoodTrack()"},
{0}};
DefineVarsFromList(vars_trk, mode);
}
Expand Down
4 changes: 4 additions & 0 deletions src/THcLADGEMTrack.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ THcLADGEMTrack::THcLADGEMTrack(Int_t nlayers)
{
fProjVz = -999.;
fProjVy = -999.;
fProjVx = -999.;
fNSp = 0;
fD0 = -999;
fhasGoodD0 = kFALSE;
fSp = new GEM2DHits[nlayers];
chisq = -999.;
ftheta = -999.;
fphi = -999.;

}

Expand Down
39 changes: 34 additions & 5 deletions src/THcLADGEMTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "THcLADGEM.h"
#include "TObject.h"
#include "TVector3.h"
#include "THcGoodLADHit.h"

class GEM2DHits {
public:
Expand Down Expand Up @@ -95,23 +96,47 @@ class THcLADGEMTrack : public TObject {
// Track quantities
Double_t GetProjVz() const { return fProjVz; } // projected z-vertex
Double_t GetProjVy() const { return fProjVy; } // projected y-vertex
Double_t GetProjVx() const { return fProjVx; } // projected x-vertex
Double_t GetD0() const { return fD0; }
Bool_t GetGoodD0() const { return fhasGoodD0; }
Double_t GetT() const { return fT; }
Double_t GetdT() const { return fTdiff; }
bool GetHasHodoHit() const { return fHasHodoHit; }
short GetHasHodoHit() const { return fHasHodoHit; }
THcGoodLADHit *GetBestHodoHit() const { return fBestHodoHit; }
void SetBestHodoHit(THcGoodLADHit *hit) { fBestHodoHit = hit; }

void SetHasHodoHit(bool hasHodoHit) { fHasHodoHit = hasHodoHit; }
void SetHasHodoHit(short hasHodoHit) { fHasHodoHit = hasHodoHit; }
void SetTrackID(int itrk) { fTrackID = itrk; }
void SetD0(Double_t d0) { fD0 = d0; }
void SetGoodD0(Bool_t good) { fhasGoodD0 = good; }
void SetZVertex(Double_t vz) { fProjVz = vz; }
void SetYVertex(Double_t vy) { fProjVy = vy; }
void SetXVertex(Double_t vx) { fProjVx = vx; }
void SetProjVertex(Double_t vx, Double_t vy, Double_t vz) {
fProjVx = vx;
fProjVy = vy;
fProjVz = vz;
}
void SetAngles(Double_t theta, Double_t phi) {
ftheta = theta;
fphi = phi;
}
void GetAngles(Double_t &theta, Double_t &phi) const {
theta = ftheta;
phi = fphi;
}
Double_t GetTheta() const { return ftheta; }
Double_t GetPhi() const { return fphi; }
void SetChisq(Double_t c) { chisq = c; }
Double_t GetChisq() const { return chisq; }
void SetTime(Double_t t, Double_t dt) {
fT = t;
fTdiff = dt;
}

bool IsGoodTrack() const { return fIsGoodTrack; }
void SetIsGoodTrack(bool isGood) { fIsGoodTrack = isGood; }

GEM2DHits GetSpacePoint(int isp) { return fSp[isp]; }
virtual void AddSpacePoint(GEM2DHits sp);
Int_t GetSpID_0() const {return fSp[0].spID;};
Expand All @@ -120,21 +145,25 @@ class THcLADGEMTrack : public TObject {
int GetSpacePointID_0V() { return fSp[0].clusID[1]; }
int GetSpacePointID_1U() { return fSp[1].clusID[0]; }
int GetSpacePointID_1V() { return fSp[1].clusID[1]; }

protected:
Int_t fNSp;
Double_t fProjVz;
Double_t fProjVy;
Double_t fProjVx;
Double_t fD0;
Bool_t fhasGoodD0;
Int_t fTrackID;
Int_t fClustID0;
Int_t fClustID1;
Double_t fT;
Double_t fTdiff;
bool fHasHodoHit;

short fHasHodoHit;
Double_t chisq;
Double_t ftheta; // track angle between the track and z-azis in radians
Double_t fphi; // track angle between the track and x-azis in radians
bool fIsGoodTrack;
GEM2DHits *fSp;
THcGoodLADHit *fBestHodoHit; // pointer to the best hodoscope hit associated with this track, if any

private:
THcLADGEMTrack(const THcLADGEMTrack &);
Expand Down
4 changes: 2 additions & 2 deletions src/THcLADHodoPlane.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1601,8 +1601,8 @@ Int_t THcLADHodoPlane::ProcessHits(TClonesArray *rawhits, Int_t nexthit) {
((THcLADHodoHit *)fHodoHits->At(fNScinHits))->SetCorrectedTimes_FADC(adc_timec_top, adc_timec_btm, adc_time_corrected);
((THcLADHodoHit *)fHodoHits->At(fNScinHits))->SetTopADCpeak(adcamp_top[i_good_top_adc_elem]);
((THcLADHodoHit *)fHodoHits->At(fNScinHits))->SetBtmADCpeak(adcamp_btm[i_good_btm_adc_elem]);
((THcLADHodoHit *)fHodoHits->At(fNScinHits))->SetCalcPosition(fHitDistCorr);
((THcLADHodoHit *)fHodoHits->At(fNScinHits))->SetCalcPosition_FADC(fHitDistCorr_FADC);
((THcLADHodoHit *)fHodoHits->At(fNScinHits))->SetCalcPosition(fHitDistCorr+fPosOffset);//add yposition offset to match LAD geometry
((THcLADHodoHit *)fHodoHits->At(fNScinHits))->SetCalcPosition_FADC(fHitDistCorr_FADC+fPosOffset);

fGoodTopTdcTimeCorr.at(padnum - 1) = timec_top;
fGoodBtmTdcTimeCorr.at(padnum - 1) = timec_btm;
Expand Down
18 changes: 18 additions & 0 deletions src/THcLADHodoscope.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -594,4 +594,22 @@ Int_t THcLADHodoscope::FineProcess(TClonesArray &tracks) {
return 0;
}

TVector3 THcLADHodoscope::GetHitPositionLab(int plane, int paddle, double ypos) {
// Get the position of a hit in the hodoscope, given the plane and paddle number
// This is a placeholder function and should be implemented based on the actual geometry of the hodoscope
if (plane < 0 || plane >= fNPlanes) {
cout << "[THcLADHodoscope] Error: Invalid plane number" << endl;
return TVector3(0, 0, 0);
}
if (paddle < 0 || paddle >= fNPaddle[plane]) {
cout << "[THcLADHodoscope] Error: Invalid paddle number" << endl;
return TVector3(0, 0, 0);
}
Double_t offset = fPlanes[plane]->GetPosCenter(paddle);
TVector3 hit = TVector3(offset, ypos , fPlanes[plane]->GetZpos());
hit.RotateY(fPlanes[plane]->GetTheta());
return hit;
}


ClassImp(THcLADHodoscope)
2 changes: 1 addition & 1 deletion src/THcLADHodoscope.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class THcLADHodoscope : public THaNonTrackingDetector, public THcHitList {
Double_t GetTDCThrs() const { return fTdc_Thrs; }
Double_t GetEdep2MeV_int(Int_t iii) const { return fEdep2MeV_int[iii]; }
Double_t GetEdep2MeV_amp(Int_t iii) const { return fEdep2MeV_amp[iii]; }

TVector3 GetHitPositionLab(Int_t iplane, Int_t ipaddle, Double_t ypos );
TClonesArray *GetLADGoodHits() { return fGoodLADHits; }
TClonesArray *GetLADHits(Int_t plane) { return fPlanes[plane]->GetHits(); }

Expand Down
Loading