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
51 changes: 23 additions & 28 deletions src/THcGoodLADHit.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ class THcGoodLADHit : public TObject {
public:
THcGoodLADHit() {
for (int i = 0; i < 2; ++i) {
plane[i] = paddle[i] = track_id[i] = -1;
hit_tof[i] = hit_tof_rfcorr[i] = dTrk_horiz[i] = dTrk_vert[i] = hit_time[i] = hit_theta[i] = hit_phi[i] = hit_edep[i] =
hit_edep_amp[i] = hit_yPos[i] = hit_alpha[i] = hit_beta[i] = 1e30;
plane[i] = paddle[i] = -1;
hit_tof[i] = hit_tof_rfcorr[i] = hit_time[i] = hit_theta[i] = hit_phi[i] = hit_edep[i] = hit_edep_amp[i] =
hit_yPos[i] = hit_alpha[i] = hit_beta[i] = 1e30;
is_proton[i] = false;
}
trk_chiSqr = 1e30;
track_id = -1;
};
virtual ~THcGoodLADHit() = default;

Expand All @@ -28,17 +31,11 @@ class THcGoodLADHit : public TObject {
CheckHitIndex(hit);
paddle[hit] = value;
}
void SetTrackID(Int_t hit, Int_t value) {
void SetTrackID(Int_t value) { track_id = value; }
void SetTrkChiSqr(Double_t value) { trk_chiSqr = value; }
void SetIsProton(Int_t hit, Bool_t value) {
CheckHitIndex(hit);
track_id[hit] = value;
}
void SetdTrkHoriz(Int_t hit, Double_t value) {
CheckHitIndex(hit);
dTrk_horiz[hit] = value;
}
void SetdTrkVert(Int_t hit, Double_t value) {
CheckHitIndex(hit);
dTrk_vert[hit] = value;
is_proton[hit] = value;
}
void SetHitTime(Int_t hit, Double_t value) {
CheckHitIndex(hit);
Expand Down Expand Up @@ -86,9 +83,9 @@ class THcGoodLADHit : public TObject {
if (copy_plane == 0) {
SetPlane(this_plane, copyhit->GetPlaneHit0());
SetPaddle(this_plane, copyhit->GetPaddleHit0());
SetTrackID(this_plane, copyhit->GetTrackIDHit0());
SetdTrkHoriz(this_plane, copyhit->GetdTrkHorizHit0());
SetdTrkVert(this_plane, copyhit->GetdTrkVertHit0());
SetTrackID(copyhit->GetTrackID());
SetTrkChiSqr(copyhit->GetTrkChiSqr());
SetIsProton(this_plane, copyhit->GetIsProtonHit0());
SetHitTime(this_plane, copyhit->GetHitTimeHit0());
SetHitTheta(this_plane, copyhit->GetHitThetaHit0());
SetHitPhi(this_plane, copyhit->GetHitPhiHit0());
Expand All @@ -101,9 +98,9 @@ class THcGoodLADHit : public TObject {
} else if (copy_plane == 1) {
SetPlane(this_plane, copyhit->GetPlaneHit1());
SetPaddle(this_plane, copyhit->GetPaddleHit1());
SetTrackID(this_plane, copyhit->GetTrackIDHit1());
SetdTrkHoriz(this_plane, copyhit->GetdTrkHorizHit1());
SetdTrkVert(this_plane, copyhit->GetdTrkVertHit1());
SetTrackID(copyhit->GetTrackID());
SetTrkChiSqr(copyhit->GetTrkChiSqr());
SetIsProton(this_plane, copyhit->GetIsProtonHit1());
SetHitTime(this_plane, copyhit->GetHitTimeHit1());
SetHitTheta(this_plane, copyhit->GetHitThetaHit1());
SetHitPhi(this_plane, copyhit->GetHitPhiHit1());
Expand All @@ -127,17 +124,15 @@ class THcGoodLADHit : public TObject {
Int_t GetPaddleHit0() const { return paddle[0]; }
Int_t GetPaddleHit1() const { return paddle[1]; }

Int_t GetTrackIDHit0() const { return track_id[0]; }
Int_t GetTrackIDHit1() const { return track_id[1]; }
Int_t GetTrackID() const { return track_id; }

Double_t GetBetaHit0() const { return hit_beta[0]; }
Double_t GetBetaHit1() const { return hit_beta[1]; }

Double_t GetdTrkHorizHit0() const { return dTrk_horiz[0]; }
Double_t GetdTrkHorizHit1() const { return dTrk_horiz[1]; }
Double_t GetTrkChiSqr() const { return trk_chiSqr; }

Double_t GetdTrkVertHit0() const { return dTrk_vert[0]; }
Double_t GetdTrkVertHit1() const { return dTrk_vert[1]; }
Double_t GetIsProtonHit0() const { return is_proton[0]; }
Double_t GetIsProtonHit1() const { return is_proton[1]; }

Double_t GetHitTimeHit0() const { return hit_time[0]; }
Double_t GetHitTimeHit1() const { return hit_time[1]; }
Expand Down Expand Up @@ -169,9 +164,9 @@ class THcGoodLADHit : public TObject {
protected:
Int_t plane[2];
Int_t paddle[2];
Int_t track_id[2];
Double_t dTrk_horiz[2];
Double_t dTrk_vert[2];
Int_t track_id;
Double_t trk_chiSqr;
Double_t is_proton[2];
Double_t hit_time[2];
Double_t hit_beta[2];
Double_t hit_theta[2];
Expand Down
31 changes: 18 additions & 13 deletions src/THcLADHodoscope.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -217,30 +217,36 @@ Int_t THcLADHodoscope::DefineVariables(EMode mode) {
{"goodhit_n", "Number of good hits", "goodhit_n"},
{"goodhit_plane_0", "Good hit plane", "fGoodLADHits.THcGoodLADHit.GetPlaneHit0()"},
{"goodhit_paddle_0", "Good hit paddle", "fGoodLADHits.THcGoodLADHit.GetPaddleHit0()"},
{"goodhit_trackid_0", "Good hit track ID", "fGoodLADHits.THcGoodLADHit.GetTrackIDHit0()"},
{"goodhit_beta_0", "Good hit beta", "fGoodLADHits.THcGoodLADHit.GetBetaHit0()"},
{"goodhit_dTrkHoriz_0", "Good hit horizontal trk proj - hit position",
"fGoodLADHits.THcGoodLADHit.GetdTrkHorizHit0()"},
{"goodhit_dTrkVert_0", "Good hit vertical trk proj - hit position",
"fGoodLADHits.THcGoodLADHit.GetdTrkVertHit0()"},
{"goodhit_isProton_0", "Good hit is proton", "fGoodLADHits.THcGoodLADHit.GetIsProtonHit0()"},
{"goodhit_hittime_0", "Good hit time", "fGoodLADHits.THcGoodLADHit.GetHitTimeHit0()"},
{"goodhit_hittheta_0", "Good hit theta", "fGoodLADHits.THcGoodLADHit.GetHitThetaHit0()"},
{"goodhit_hitphi_0", "Good hit phi", "fGoodLADHits.THcGoodLADHit.GetHitPhiHit0()"},
{"goodhit_hitedep_0", "Good hit energy deposition", "fGoodLADHits.THcGoodLADHit.GetHitEdepHit0()"},
{"goodhit_hitedep_amp_0", "Good hit energy deposition (amplitude)",
"fGoodLADHits.THcGoodLADHit.GetHitEdepAmpHit0()"},
{"goodhit_hit_alpha_0", "Good hit alpha", "fGoodLADHits.THcGoodLADHit.GetHitAlphaHit0()"},
{"goodhit_hit_ypos_0", "Good hit y position", "fGoodLADHits.THcGoodLADHit.GetHitYPosHit0()"},
{"goodhit_hit_tof_0", "Good hit time-of-flight", "fGoodLADHits.THcGoodLADHit.GetHitTOFHit0()"},
{"goodhit_hit_tof_rfcorr_0", "Good hit time-of-flight (RF corrected)",
"fGoodLADHits.THcGoodLADHit.GetHitTOFRFcorrHit0()"},
{"goodhit_plane_1", "Good hit plane (second plane)", "fGoodLADHits.THcGoodLADHit.GetPlaneHit1()"},
{"goodhit_paddle_1", "Good hit paddle (second plane)", "fGoodLADHits.THcGoodLADHit.GetPaddleHit1()"},
{"goodhit_trackid_1", "Good hit track ID (second plane)", "fGoodLADHits.THcGoodLADHit.GetTrackIDHit1()"},
{"goodhit_beta_1", "Good hit beta (second plane)", "fGoodLADHits.THcGoodLADHit.GetBetaHit1()"},
{"goodhit_dTrkHoriz_1", "Good hit horizontal trk proj - hit position (second plane)",
"fGoodLADHits.THcGoodLADHit.GetdTrkHorizHit1()"},
{"goodhit_dTrkVert_1", "Good hit vertical trk proj - hit position (second plane)",
"fGoodLADHits.THcGoodLADHit.GetdTrkVertHit1()"},
{"goodhit_isProton_1", "Good hit is proton (second plane)", "fGoodLADHits.THcGoodLADHit.GetIsProtonHit1()"},
{"goodhit_hittime_1", "Good hit time (second plane)", "fGoodLADHits.THcGoodLADHit.GetHitTimeHit1()"},
{"goodhit_hittheta_1", "Good hit theta (second plane)", "fGoodLADHits.THcGoodLADHit.GetHitThetaHit1()"},
{"goodhit_hitphi_1", "Good hit phi (second plane)", "fGoodLADHits.THcGoodLADHit.GetHitPhiHit1()"},
{"goodhit_hitedep_1", "Good hit energy deposition (second plane)", "fGoodLADHits.THcGoodLADHit.GetHitEdepHit1()"},
{"goodhit_hitedep_amp_1", "Good hit energy deposition (amplitude, second plane)",
"fGoodLADHits.THcGoodLADHit.GetHitEdepAmpHit1()"},
{"goodhit_hit_alpha_1", "Good hit alpha (second plane)", "fGoodLADHits.THcGoodLADHit.GetHitAlphaHit1()"},
{"goodhit_hit_ypos_1", "Good hit y position (second plane)", "fGoodLADHits.THcGoodLADHit.GetHitYPosHit1()"},
{"goodhit_hit_tof_1", "Good hit time-of-flight (second plane)", "fGoodLADHits.THcGoodLADHit.GetHitTOFHit1()"},
{"goodhit_hit_tof_rfcorr_1", "Good hit time-of-flight (RF corrected, second plane)",
"fGoodLADHits.THcGoodLADHit.GetHitTOFRFcorrHit1()"},
{"goodhit_trackid", "Good hit track ID", "fGoodLADHits.THcGoodLADHit.GetTrackID()"},
{"goodhit_chiSquare", "Good hit chi-square", "fGoodLADHits.THcGoodLADHit.GetTrkChiSqr()"},
{"good_hit_n_unique", "Number of unique good hits", "num_unique_good_hits"},
{"all_hits_n_unique", "Number of all hits, not just with tracks", "num_unique_hits"},
{0}};
Expand Down Expand Up @@ -579,11 +585,10 @@ TVector3 THcLADHodoscope::GetHitPositionLab(int plane, int paddle, double ypos)
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());
Double_t offset = fPlanes[plane]->GetPosCenter(paddle);
TVector3 hit = TVector3(offset, ypos, fPlanes[plane]->GetZpos());
hit.RotateY(fPlanes[plane]->GetTheta());
return hit;
}


ClassImp(THcLADHodoscope)
Loading