Skip to content

Commit 2a3c612

Browse files
authored
Merge pull request #189 from JeffersonLab/fixFMWPCwireloc
make FMWPC wire locations compatible with using cm as units
2 parents 7fe6a57 + ab6e38b commit 2a3c612

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/GlueXSensitiveDetectorFMWPC.cc

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ double GlueXSensitiveDetectorFMWPC::TWO_HIT_TIME_RESOL = 400*ns;
3030
// Minimum photoelectron count for a hit
3131
double GlueXSensitiveDetectorFMWPC::THRESH_KEV = 0.;
3232

33+
// Coordinate of wire 0, transverse to wire direction
34+
double GlueXSensitiveDetectorFMWPC::WIRE_OFFSET = -73*cm;
35+
36+
// Minimum photoelectron count for a hit
37+
double GlueXSensitiveDetectorFMWPC::WIRE_PITCH = 1.0*cm;
38+
3339
int GlueXSensitiveDetectorFMWPC::instanceCount = 0;
3440
G4Mutex GlueXSensitiveDetectorFMWPC::fMutex = G4MUTEX_INITIALIZER;
3541

@@ -184,13 +190,19 @@ G4bool GlueXSensitiveDetectorFMWPC::ProcessHits(G4Step* step,
184190
int wire = 0;
185191
if (layer % 2 != 0) {
186192
// Vertical wires
187-
wire = floor(x[0] + 73.0);
193+
wire = floor(x[0] - WIRE_OFFSET)/WIRE_PITCH;
188194
}
189195
else {
190196
// Horizontal wires
191-
wire = floor(x[1] + 73.0);
197+
wire = floor(x[1] - WIRE_OFFSET)/WIRE_PITCH;
198+
}
199+
if (layer == 6) {
200+
// Vertical wires
201+
wire = floor(x[0] - WIRE_OFFSET)/WIRE_PITCH;
192202
}
193203

204+
//cout<<"MWPC: layer/wire = "<<layer<<" / "<<wire<<endl;
205+
194206
if (wire < 1 || wire > 144)
195207
return false;
196208

src/GlueXSensitiveDetectorFMWPC.hh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ class GlueXSensitiveDetectorFMWPC : public G4VSensitiveDetector
4343
static int MAX_HITS;
4444
static double TWO_HIT_TIME_RESOL;
4545
static double THRESH_KEV;
46+
static double WIRE_OFFSET;
47+
static double WIRE_PITCH;
4648

4749
static int instanceCount;
4850
static G4Mutex fMutex;

0 commit comments

Comments
 (0)