From 1ee4ad19aa52e8a17c152e19642d01b785d15241 Mon Sep 17 00:00:00 2001 From: zihlmann Date: Tue, 13 Apr 2021 08:44:35 -0400 Subject: [PATCH 1/2] make FMWPC wire locations compatible with using cm as units for their location. Note these are still hard coded and will need a proper treatement using ccdb in the near future. --- src/GlueXSensitiveDetectorFMWPC.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/GlueXSensitiveDetectorFMWPC.cc b/src/GlueXSensitiveDetectorFMWPC.cc index eff2fab..a4b709f 100644 --- a/src/GlueXSensitiveDetectorFMWPC.cc +++ b/src/GlueXSensitiveDetectorFMWPC.cc @@ -184,13 +184,19 @@ G4bool GlueXSensitiveDetectorFMWPC::ProcessHits(G4Step* step, int wire = 0; if (layer % 2 != 0) { // Vertical wires - wire = floor(x[0] + 73.0); + wire = floor(x[0]/cm + 73.0); } else { // Horizontal wires - wire = floor(x[1] + 73.0); + wire = floor(x[1]/cm + 73.0); + } + if (layer == 6) { + // Vertical wires + wire = floor(x[0]/cm + 73.0); } + //cout<<"MWPC: layer/wire = "< 144) return false; From ab6e38bdbcaacfc031ad1320c61b004046465ba2 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Tue, 13 Apr 2021 09:40:41 -0400 Subject: [PATCH 2/2] * convert hard-wired mwpc wire offset and pitch into named static constants, and convert to internal units. [rtj] --- src/GlueXSensitiveDetectorFMWPC.cc | 12 +++++++++--- src/GlueXSensitiveDetectorFMWPC.hh | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/GlueXSensitiveDetectorFMWPC.cc b/src/GlueXSensitiveDetectorFMWPC.cc index a4b709f..1e42eec 100644 --- a/src/GlueXSensitiveDetectorFMWPC.cc +++ b/src/GlueXSensitiveDetectorFMWPC.cc @@ -30,6 +30,12 @@ double GlueXSensitiveDetectorFMWPC::TWO_HIT_TIME_RESOL = 400*ns; // Minimum photoelectron count for a hit double GlueXSensitiveDetectorFMWPC::THRESH_KEV = 0.; +// Coordinate of wire 0, transverse to wire direction +double GlueXSensitiveDetectorFMWPC::WIRE_OFFSET = -73*cm; + +// Minimum photoelectron count for a hit +double GlueXSensitiveDetectorFMWPC::WIRE_PITCH = 1.0*cm; + int GlueXSensitiveDetectorFMWPC::instanceCount = 0; G4Mutex GlueXSensitiveDetectorFMWPC::fMutex = G4MUTEX_INITIALIZER; @@ -184,15 +190,15 @@ G4bool GlueXSensitiveDetectorFMWPC::ProcessHits(G4Step* step, int wire = 0; if (layer % 2 != 0) { // Vertical wires - wire = floor(x[0]/cm + 73.0); + wire = floor(x[0] - WIRE_OFFSET)/WIRE_PITCH; } else { // Horizontal wires - wire = floor(x[1]/cm + 73.0); + wire = floor(x[1] - WIRE_OFFSET)/WIRE_PITCH; } if (layer == 6) { // Vertical wires - wire = floor(x[0]/cm + 73.0); + wire = floor(x[0] - WIRE_OFFSET)/WIRE_PITCH; } //cout<<"MWPC: layer/wire = "<