Skip to content

Commit

Permalink
* add comments to document the change in how leading edge pulse times
Browse files Browse the repository at this point in the history
* are calculated [rtj]
  • Loading branch information
rjones30 committed Mar 22, 2024
1 parent d2f88e9 commit 9d522f3
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 38 deletions.
27 changes: 18 additions & 9 deletions src/GlueXSensitiveDetectorCTOF.cc
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,15 @@ G4bool GlueXSensitiveDetectorCTOF::ProcessHits(G4Step* step,
}

if (merge_hit) {
// Use the time from the earlier hit but add the charge
hiter->dE_GeV += dEtop/GeV;
if (hiter->t_ns*ns > ttop) {
hiter->t_ns = ttop/ns;
}
// sum the charge, do energy weighting of the time --disabled for bad behavior --rtj
//hiter->t_ns = (hiter->dE_GeV * hiter->t_ns + dEtop/GeV * ttop/ns) /
//(hiter->dE_GeV += dEtop/GeV);

// Use the time from the earlier hit but add the charge
hiter->dE_GeV += dEtop/GeV;
if (hiter->t_ns*ns > ttop) {
hiter->t_ns = ttop/ns;
}
}
else {
// create new hit
Expand Down Expand Up @@ -266,11 +270,16 @@ G4bool GlueXSensitiveDetectorCTOF::ProcessHits(G4Step* step,
}
}
if (merge_hit) {
// sum the charge, do energy weighting of the time --disabled for bad behavior --rtj
// hiter->t_ns = (hiter->dE_GeV * hiter->t_ns +
// dEbottom/GeV * tbottom/ns) /
//(hiter->dE_GeV += dEbottom/GeV);

// Use the time from the earlier hit but add the charge
hiter->dE_GeV += dEbottom/GeV;
if (hiter->t_ns*ns > tbottom) {
hiter->t_ns = tbottom/ns;
}
hiter->dE_GeV += dEbottom/GeV;
if (hiter->t_ns*ns > tbottom) {
hiter->t_ns = tbottom/ns;
}
}
else {
// create new hit
Expand Down
48 changes: 29 additions & 19 deletions src/GlueXSensitiveDetectorFTOF.cc
Original file line number Diff line number Diff line change
Expand Up @@ -222,22 +222,22 @@ G4bool GlueXSensitiveDetectorFTOF::ProcessHits(G4Step* step,
// column=0 is a full bar, column=1,2 are half paddles
if (plane == 0) {
if (column == 1) {
tnorth = 0;
dEnorth = 0;
tnorth = 0;
dEnorth = 0;
}
else if (column == 2) {
tsouth = 0;
dEsouth =0;
else if (column == 2) {
tsouth = 0;
dEsouth =0;
}
}
else {
if (column == 2) {
tnorth = 0;
dEnorth = 0;
tnorth = 0;
dEnorth = 0;
}
else if (column == 1) {
tsouth = 0;
dEsouth = 0;
tsouth = 0;
dEsouth = 0;
}
}

Expand All @@ -262,11 +262,16 @@ G4bool GlueXSensitiveDetectorFTOF::ProcessHits(G4Step* step,
}

if (merge_hit) {
// Use the time from the earlier hit but add the charge
hiter->dE_GeV += dEnorth/GeV;
if (hiter->t_ns*ns > tnorth) {
hiter->t_ns = tnorth/ns;
}
// sum the charge, do energy weighting of the time --disabled for bad behavior, rtj--
//hiter->t_ns = (hiter->dE_GeV * hiter->t_ns +
// dEnorth/GeV * tnorth/ns) /
//(hiter->dE_GeV += dEnorth/GeV);

// Use the time from the earlier hit but add the charge
hiter->dE_GeV += dEnorth/GeV;
if (hiter->t_ns*ns > tnorth) {
hiter->t_ns = tnorth/ns;
}

std::vector<GlueXHitFTOFbar::hitextra_t>::reverse_iterator xiter;
xiter = hiter->extra.rbegin();
Expand Down Expand Up @@ -328,11 +333,16 @@ G4bool GlueXSensitiveDetectorFTOF::ProcessHits(G4Step* step,
}
}
if (merge_hit) {
// Use the time from the earlier hit but add the charge
hiter->dE_GeV += dEsouth/GeV;
if (hiter->t_ns*ns > tsouth) {
hiter->t_ns = tsouth/ns;
}
// sum the charge, do energy weighting of the time --disabled for bad behavior, rtj--
//hiter->t_ns = (hiter->dE_GeV * hiter->t_ns +
// dEsouth/GeV * tsouth/ns) /
//(hiter->dE_GeV += dEsouth/GeV);

// Use the time from the earlier hit but add the charge
hiter->dE_GeV += dEsouth/GeV;
if (hiter->t_ns*ns > tsouth) {
hiter->t_ns = tsouth/ns;
}

std::vector<GlueXHitFTOFbar::hitextra_t>::reverse_iterator xiter;
xiter = hiter->extra.rbegin();
Expand Down
15 changes: 10 additions & 5 deletions src/GlueXSensitiveDetectorPS.cc
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,16 @@ G4bool GlueXSensitiveDetectorPS::ProcessHits(G4Step* step,
}
}
if (merge_hit) {
// Use the time from the earlier hit but add the charge
hiter->dE_GeV += dEsum/GeV;
if (hiter->t_ns*ns > t) {
hiter->t_ns = t/ns;
}
// Add the charge, do energy-weighted time averaging --disabled for bad behavior --rtj
//hiter->t_ns = (hiter->t_ns * hiter->dE_GeV + t/ns * dEsum/GeV) /
// (hiter->dE_GeV + dEsum/GeV);
//hiter->dE_GeV += dEsum/GeV;

// Use the time from the earlier hit but add the charge
hiter->dE_GeV += dEsum/GeV;
if (hiter->t_ns*ns > t) {
hiter->t_ns = t/ns;
}
}
else {
// create new hit
Expand Down
15 changes: 10 additions & 5 deletions src/GlueXSensitiveDetectorPSC.cc
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,16 @@ G4bool GlueXSensitiveDetectorPSC::ProcessHits(G4Step* step,
}
}
if (merge_hit) {
// Use the time from the earlier hit but add the charge
hiter->dE_GeV += dEsum/GeV;
if (hiter->t_ns*ns > t) {
hiter->t_ns = t/ns;
}
// Add the charge, do energy-weighted time averaging --disabled for bad behavior
//hiter->t_ns = (hiter->t_ns * hiter->dE_GeV + t/ns * dEsum/GeV) /
// (hiter->dE_GeV + dEsum/GeV);
//hiter->dE_GeV += dEsum/GeV;

// Use the time from the earlier hit but add the charge
hiter->dE_GeV += dEsum/GeV;
if (hiter->t_ns*ns > t) {
hiter->t_ns = t/ns;
}
}
else {
// create new hit
Expand Down

0 comments on commit 9d522f3

Please sign in to comment.