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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ build*/
include/
lib64/
CMakeFiles/
install/
CMakeCache.txt
71 changes: 43 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_mev[i] = hit_edep_amp[i] =
hit_edep_amp_mev[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 All @@ -56,10 +53,18 @@ class THcGoodLADHit : public TObject {
CheckHitIndex(hit);
hit_edep[hit] = value;
}
void SetHitEdepMeV(Int_t hit, Double_t value) {
CheckHitIndex(hit);
hit_edep_mev[hit] = value;
}
void SetHitEdepAmp(Int_t hit, Double_t value) {
CheckHitIndex(hit);
hit_edep_amp[hit] = value;
}
void SetHitEdepAmpMeV(Int_t hit, Double_t value) {
CheckHitIndex(hit);
hit_edep_amp_mev[hit] = value;
}
void SetHitAlpha(Int_t hit, Double_t value) {
CheckHitIndex(hit);
hit_alpha[hit] = value;
Expand All @@ -86,29 +91,33 @@ 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());
SetHitEdep(this_plane, copyhit->GetHitEdepHit0());
SetHitEdepMeV(this_plane, copyhit->GetHitEdepMeVHit0());
SetHitEdepAmp(this_plane, copyhit->GetHitEdepAmpHit0());
SetHitEdepAmpMeV(this_plane, copyhit->GetHitEdepAmpMeVHit0());
SetHitAlpha(this_plane, copyhit->GetHitAlphaHit0());
SetHitYPos(this_plane, copyhit->GetHitYPosHit0());
SetHitTOF(this_plane, copyhit->GetHitTOFHit0());
SetHitTOFRFcorr(this_plane, copyhit->GetHitTOFRFcorrHit0());
} 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());
SetHitEdep(this_plane, copyhit->GetHitEdepHit1());
SetHitEdepMeV(this_plane, copyhit->GetHitEdepMeVHit1());
SetHitEdepAmp(this_plane, copyhit->GetHitEdepAmpHit1());
SetHitEdepAmpMeV(this_plane, copyhit->GetHitEdepAmpMeVHit1());
SetHitAlpha(this_plane, copyhit->GetHitAlphaHit1());
SetHitYPos(this_plane, copyhit->GetHitYPosHit1());
SetHitTOF(this_plane, copyhit->GetHitTOFHit1());
Expand All @@ -127,17 +136,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 All @@ -151,9 +158,15 @@ class THcGoodLADHit : public TObject {
Double_t GetHitEdepHit0() const { return hit_edep[0]; }
Double_t GetHitEdepHit1() const { return hit_edep[1]; }

Double_t GetHitEdepMeVHit0() const { return hit_edep_mev[0]; }
Double_t GetHitEdepMeVHit1() const { return hit_edep_mev[1]; }

Double_t GetHitEdepAmpHit0() const { return hit_edep_amp[0]; }
Double_t GetHitEdepAmpHit1() const { return hit_edep_amp[1]; }

Double_t GetHitEdepAmpMeVHit0() const { return hit_edep_amp_mev[0]; }
Double_t GetHitEdepAmpMeVHit1() const { return hit_edep_amp_mev[1]; }

Double_t GetHitAlphaHit0() const { return hit_alpha[0]; }
Double_t GetHitAlphaHit1() const { return hit_alpha[1]; }

Expand All @@ -169,15 +182,17 @@ 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];
Double_t hit_phi[2];
Double_t hit_edep[2];
Double_t hit_edep_mev[2];
Double_t hit_edep_amp[2];
Double_t hit_edep_amp_mev[2];
Double_t hit_tof[2];
Double_t hit_tof_rfcorr[2];
Double_t hit_yPos[2];
Expand Down
1 change: 1 addition & 0 deletions src/THcLADGEM.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "THcLADGEM.h"
#include <sstream>
#include "THaApparatus.h"
#include "THaCutList.h"
#include "THaEvData.h"
Expand Down
2 changes: 1 addition & 1 deletion src/THcLADGEMTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// LAD GEM Track Object

#include "THcLADGEM.h"
#include "DataType.h"
#include "TObject.h"
#include "TVector3.h"
#include "THcGoodLADHit.h"
Expand Down
6 changes: 3 additions & 3 deletions src/THcLADHodoPlane.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -433,10 +433,10 @@ Int_t THcLADHodoPlane::ReadDatabase(const TDatime &date) {
{Form("ladhodo_%s_theta", GetName()), &fTheta, kDouble},
{Form("ladhodo_%s_size", GetName()), &fSize, kDouble},
{Form("ladhodo_%s_spacing", GetName()), &fSpacing, kDouble},
{Form("ladhodo_%s_%s", GetName(), "btm"), fPosBtm, kDouble, fNelem},
{Form("ladhodo_%s_%s", GetName(), "top"), fPosTop, kDouble, fNelem},
{Form("ladhodo_%s_%s", GetName(), "btm"), fPosBtm, kDouble, static_cast<UInt_t>(fNelem)},
{Form("ladhodo_%s_%s", GetName(), "top"), fPosTop, kDouble, static_cast<UInt_t>(fNelem)},
{Form("ladhodo_%s_offset", GetName()), &fPosOffset, kDouble},
{Form("ladhodo_%s_center", GetName()), fPosCenter, kDouble, fNelem},
{Form("ladhodo_%s_center", GetName()), fPosCenter, kDouble, static_cast<UInt_t>(fNelem)},
{"ladhodo_adc_mode", &fADCMode, kInt, 0, 1},
{"ladhodo_adc_diag_cut", &fADCDiagCut, kInt, 0, 1},
{"cosmicflag", &fCosmicFlag, kInt, 0, 1},
Expand Down
43 changes: 30 additions & 13 deletions src/THcLADHodoscope.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -217,30 +217,42 @@ 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_MeV_0", "Good hit energy deposition (calibrated to MeV)", "fGoodLADHits.THcGoodLADHit.GetHitEdepMeVHit0()"},
{"goodhit_hitedep_amp_0", "Good hit energy deposition (amplitude)",
"fGoodLADHits.THcGoodLADHit.GetHitEdepAmpHit0()"},
{"goodhit_hitedep_ampM_MeV_0", "Good hit energy deposition (amplitude calibrated to MeV)",
"fGoodLADHits.THcGoodLADHit.GetHitEdepAmpMeVHit0()"},
{"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_MeV_1", "Good hit energy deposition (calibrated to MeV, second plane)", "fGoodLADHits.THcGoodLADHit.GetHitEdepMeVHit1()"},
{"goodhit_hitedep_amp_1", "Good hit energy deposition (amplitude, second plane)",
"fGoodLADHits.THcGoodLADHit.GetHitEdepAmpHit1()"},
{"goodhit_hitedep_ampM_MeV_1", "Good hit energy deposition (amplitude calibrated to MeV, second plane)",
"fGoodLADHits.THcGoodLADHit.GetHitEdepAmpMeVHit1()"},
{"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 @@ -516,13 +528,17 @@ Int_t THcLADHodoscope::FineProcess(TClonesArray &tracks) {
goodhit->SetPaddle(0, hit->GetPaddleNumber() - 1);
goodhit->SetHitTime(0, hit->GetScinCorrectedTime());
goodhit->SetHitEdep(0, hit->GetPaddleADC());
goodhit->SetHitEdepMeV(0, hit->GetPaddleADC_MeV());
goodhit->SetHitEdepAmp(0, hit->GetPaddleADCpeak());
goodhit->SetHitEdepAmpMeV(0, hit->GetPaddleADCpeak_MeV());
goodhit->SetHitYPos(0, hit->GetCalcPosition());
goodhit->SetPlane(1, ip + 1);
goodhit->SetPaddle(1, hit2->GetPaddleNumber() - 1);
goodhit->SetHitTime(1, hit2->GetScinCorrectedTime());
goodhit->SetHitEdep(1, hit2->GetPaddleADC());
goodhit->SetHitEdepMeV(1, hit2->GetPaddleADC_MeV());
goodhit->SetHitEdepAmp(1, hit2->GetPaddleADCpeak());
goodhit->SetHitEdepAmpMeV(1, hit2->GetPaddleADCpeak_MeV());
goodhit->SetHitYPos(1, hit2->GetCalcPosition());
break; // front hit is now used; stop looking for more back matches for it
}
Expand Down Expand Up @@ -553,7 +569,9 @@ Int_t THcLADHodoscope::FineProcess(TClonesArray &tracks) {
goodhit->SetPaddle(hitIndex, hit->GetPaddleNumber() - 1);
goodhit->SetHitTime(hitIndex, hit->GetScinCorrectedTime());
goodhit->SetHitEdep(hitIndex, hit->GetPaddleADC());
goodhit->SetHitEdepMeV(hitIndex, hit->GetPaddleADC_MeV());
goodhit->SetHitEdepAmp(hitIndex, hit->GetPaddleADCpeak());
goodhit->SetHitEdepAmpMeV(hitIndex, hit->GetPaddleADCpeak_MeV());
goodhit->SetHitYPos(hitIndex, hit->GetCalcPosition());
}
}
Expand All @@ -579,11 +597,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