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
12 changes: 11 additions & 1 deletion app/utilities/WCRootData/src/WCRootData.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,11 @@ void WCRootData::AddTrueHitsToMDT(HitTubeCollection *hc, PMTResponse *pr, float
for(int k=0; k<3; k++){ th->SetPosition(k, aHitTime->GetPhotonEndPos(k)); }
for(int k=0; k<3; k++){ th->SetDirection(k, aHitTime->GetPhotonEndDir(k)); }
for(int k=0; k<3; k++){ th->SetStartDirection(k, aHitTime->GetPhotonStartDir(k)); }

th->SetStartTime(aHitTime->GetPhotonStartTime()+intTime);
for(int k=0; k<3; k++){ th->SetStartPosition(k, aHitTime->GetPhotonStartPos(k)); }
th->SetStartEnergy(aHitTime->GetPhotonStartEnergy());
th->SetEnergy(aHitTime->GetPhotonEndEnergy());
th->SetCreatorProcess((int)(aHitTime->GetPhotonCreatorProcess()));
if( !pr->ApplyDE(th,&(*hc)[tubeID]) ){ continue; }

Expand Down Expand Up @@ -239,6 +241,8 @@ void WCRootData::AddDigiHits(HitTubeCollection *hc, TriggerInfo *ti, int eventID
std::vector<double> truetime;
std::vector<int> primaryParentID;
std::vector<float> photonStartTime;
std::vector<float> photonStartEnergy;
std::vector<float> photonEndEnergy;
std::vector<TVector3> photonStartPos;
std::vector<TVector3> photonEndPos;
std::vector<TVector3> photonStartDir;
Expand All @@ -260,6 +264,8 @@ void WCRootData::AddDigiHits(HitTubeCollection *hc, TriggerInfo *ti, int eventID
truetime.push_back(PEs[iPE]->GetTime());
primaryParentID.push_back(PEs[iPE]->GetParentId());
photonStartTime.push_back(PEs[iPE]->GetStartTime());
photonStartEnergy.push_back(PEs[iPE]->GetStartEnergy());
photonEndEnergy.push_back(PEs[iPE]->GetEnergy());
photonStartPos.push_back(TVector3(PEs[iPE]->GetStartPosition(0),PEs[iPE]->GetStartPosition(1),PEs[iPE]->GetStartPosition(2)));
photonEndPos.push_back(TVector3(PEs[iPE]->GetPosition(0),PEs[iPE]->GetPosition(1),PEs[iPE]->GetPosition(2)));
photonStartDir.push_back(TVector3(PEs[iPE]->GetStartDirection(0),PEs[iPE]->GetStartDirection(1),PEs[iPE]->GetStartDirection(2)));
Expand All @@ -273,6 +279,8 @@ void WCRootData::AddDigiHits(HitTubeCollection *hc, TriggerInfo *ti, int eventID
truetime,
primaryParentID,
photonStartTime,
photonStartEnergy,
photonEndEnergy,
photonStartPos,
photonEndPos,
photonStartDir,
Expand All @@ -282,6 +290,8 @@ void WCRootData::AddDigiHits(HitTubeCollection *hc, TriggerInfo *ti, int eventID
truetime.clear();
primaryParentID.clear();
photonStartTime.clear();
photonStartEnergy.clear();
photonEndEnergy.clear();
photonStartPos.clear();
photonEndPos.clear();
photonStartDir.clear();
Expand Down
6 changes: 6 additions & 0 deletions cpp/include/TrueHit.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,33 @@ class TrueHit
float GetParentId() const { return fParentId; }
float GetPosition(int i) const { return fPosition[i]; }
float GetDirection(int i) const { return fDirection[i]; }
float GetEnergy() const { return fEnergy; }
float GetStartTime() const {return fStartTime; }
float GetStartPosition(int i) const { return fStartPosition[i]; }
float GetStartDirection(int i) const { return fStartDirection[i]; }
float GetStartEnergy() const { return fStartEnergy; }
int GetPosBin(int i) const { return fBin[i]; }
int GetCreatorProcess() const { return fCreatorProcess; }

void SetPosition(int i, float f) { fPosition[i] = f; }
void SetDirection(int i, float f) { fDirection[i] = f; }
void SetEnergy(float f) { fEnergy = f; }
void SetStartTime(float f) { fStartTime = f; }
void SetStartPosition(int i, float f) { fStartPosition[i] = f; }
void SetStartDirection(int i, float f) { fStartDirection[i] = f; }
void SetStartEnergy(float f) { fStartEnergy = f; }
void SetPosBin(int i, int b){ fBin[i] = b; }
void SetCreatorProcess(int i){ fCreatorProcess = i; }

private:
double fTime;
float fPosition[3]; // Hit position on photocade
float fDirection[3]; // Direction of photon hitting photocathode
float fEnergy;
float fStartTime; // Photon track initial time
float fStartPosition[3]; // Photon track initial position
float fStartDirection[3]; // Photon track initial direction
float fStartEnergy;
int fParentId;
int fBin[3];
int fCreatorProcess;
Expand Down