Skip to content

Commit

Permalink
Merge pull request #83 from JeffersonLab/new_dirc_functionality_rtj
Browse files Browse the repository at this point in the history
New dirc functionality rtj
  • Loading branch information
jrstevenjlab authored Jan 14, 2019
2 parents 27ffc45 + 08dcbb2 commit 3be5c38
Show file tree
Hide file tree
Showing 14 changed files with 508 additions and 193 deletions.
3 changes: 3 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ CPPFLAGS += -DG4MULTITHREADED
#CPPFLAGS += -DDEBUG_SECTIONPLANE
#CPPFLAGS += -DDEBUG_SECTIONPLANE_ZAVE
#CPPFLAGS += -DG4VERSION_10_04_OR_LATER=1
ifneq (, $(wildcard $(HALLD_RECON_HOME)/src/libraries/DIRC/DDIRCPmtHit.*))
CPPFLAGS += -DDIRCTRUTHEXTRA
endif

# If you want to build against Geant4.10.03 or greater, you will need this line uncommented
#CPPFLAGS += -DG4VUSERPHYSICSLIST_HAS_GETPARTICLEITERATOR
Expand Down
18 changes: 17 additions & 1 deletion src/GlueXDetectorConstruction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -368,13 +368,29 @@ void GlueXDetectorConstruction::ConstructSDandField()
}
iter->second->SetSensitiveDetector(ftofHandler);
}
else if (volname == "QZBL" || volname == "PIXV") {
// radiator volume: BNNM (NN = bar number 0-47 and M is sub-bar character A-D)
else if (volname == "PIXV" ||
(volname(0,1)(0) == 'B' &&
10*((int)volname(1,1)(0)-48)+(int)volname(2,1)(0)-48 >= 0 &&
10*((int)volname(1,1)(0)-48)+(int)volname(2,1)(0)-48 < 48))
{ // this is nasty, but it works
if (dircHandler == 0) {
dircHandler = new GlueXSensitiveDetectorDIRC("dirc");
SDman->AddNewDetector(dircHandler);
}
iter->second->SetSensitiveDetector(dircHandler);
}
else if (volname == "FWM1" || volname == "FWM2" || volname == "FTMR" ||
volname == "TSM1" || volname == "TSM2" || volname == "TSM3" ||
volname == "FSM1" || volname == "FSM2" || volname == "OWDG" ||
(volname(0,1)(0) == 'A' && volname(0,1)(1) == 'G') )
{
if (dircHandler == 0) {
dircHandler = new GlueXSensitiveDetectorDIRC("dirc");
SDman->AddNewDetector(dircHandler);
}
iter->second->SetSensitiveDetector(dircHandler);
}
else if (volname == "CERW" || volname == "CPPC") {
if (cereHandler == 0) {
cereHandler = new GlueXSensitiveDetectorCERE("cere");
Expand Down
8 changes: 8 additions & 0 deletions src/GlueXHitDIRCPmt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ GlueXHitDIRCPmt::GlueXHitDIRCPmt(const GlueXHitDIRCPmt &src)
{
E_GeV = src.E_GeV;
t_ns = src.t_ns;
t_fixed_ns = src.t_fixed_ns;
x_cm = src.x_cm;
y_cm = src.y_cm;
z_cm = src.z_cm;
ch = src.ch;
key_bar = src.key_bar;
path = src.path;
refl = src.refl;
bbrefl = src.bbrefl;
}

void GlueXHitDIRCPmt::Draw() const
Expand All @@ -29,9 +33,13 @@ void GlueXHitDIRCPmt::Print() const
{
G4cout << " E = " << E_GeV << " GeV" << G4endl
<< " t = " << t_ns << " ns" << G4endl
<< " t_fixed = " << t_fixed_ns << " ns" << G4endl
<< " x = " << x_cm << " cm" << G4endl
<< " y = " << y_cm << " cm" << G4endl
<< " z = " << z_cm << " cm" << G4endl
<< " path = " << path << " " << G4endl
<< " refl = " << refl << " " << G4endl
<< " bbrefl = " << bbrefl << " " << G4endl
<< " ch = " << ch << " " << G4endl
<< " key_bar = " << key_bar << " " << G4endl
<< G4endl;
Expand Down
5 changes: 5 additions & 0 deletions src/GlueXHitDIRCPmt.hh
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@ public:

G4double E_GeV; // photon energy [GeV]
G4double t_ns; // detection time [ns]
G4double t_fixed_ns; // fixed pathlength time [ns]
G4double x_cm; // x coordinate where hit was created
G4double y_cm; // y coordinate where hit was created
G4double z_cm; // z coordinate where hit was created
int64_t path; // photon's path id in the optical box
G4int refl; // number of reflections in the oprical box
G4bool bbrefl; // reflected off far end mirror of bar box
G4int ch; // PMT channel of the hit
G4int key_bar; // key of the corresponding bar hit
G4int track; // index of the MC track
};

typedef G4THitsMap<GlueXHitDIRCPmt> GlueXHitsMapDIRCPmt;
Expand Down
26 changes: 26 additions & 0 deletions src/GlueXHitDIRCWob.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// GlueXHitDIRCWob - class implementation
//
// created on: 05.04.2017
// original author: r.dzhygadlo at gsi.de

#include "GlueXHitDIRCWob.hh"

G4ThreadLocal G4Allocator<GlueXHitDIRCWob>* GlueXHitDIRCWobAllocator = 0;

GlueXHitDIRCWob::GlueXHitDIRCWob():G4VHit()
{
}

void GlueXHitDIRCWob::Draw() const
{
// not yet implemented
}

void GlueXHitDIRCWob::Print() const
{
G4cout << "GlueXHitDIRCWob:" << G4endl
<< " track = " << track << G4endl
<< " normalId = " << normalId << " " << G4endl
<< G4endl;
}
45 changes: 45 additions & 0 deletions src/GlueXHitDIRCWob.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
//
// GlueXHitDIRCWob - class implementation
//
// created on: 05.04.2017
// original author: r.dzhygadlo at gsi.de

#ifndef GlueXHitDIRCWob_h
#define GlueXHitDIRCWob_h 1

#include "G4VHit.hh"
#include "G4THitsMap.hh"
#include "G4Allocator.hh"

class GlueXHitDIRCWob : public G4VHit
{
public:
GlueXHitDIRCWob();

void *operator new(size_t);
void operator delete(void *aHit);

void Draw() const;
void Print() const;

G4double normalId; // uniq identifier of the normal
G4int track; // index of the MC track
};

typedef G4THitsMap<GlueXHitDIRCWob> GlueXHitsMapDIRCWob;

extern G4ThreadLocal G4Allocator<GlueXHitDIRCWob>* GlueXHitDIRCWobAllocator;

inline void* GlueXHitDIRCWob::operator new(size_t)
{
if (!GlueXHitDIRCWobAllocator)
GlueXHitDIRCWobAllocator = new G4Allocator<GlueXHitDIRCWob>;
return (void *) GlueXHitDIRCWobAllocator->MallocSingle();
}

inline void GlueXHitDIRCWob::operator delete(void *aHit)
{
GlueXHitDIRCWobAllocator->FreeSingle((GlueXHitDIRCWob*) aHit);
}

#endif
88 changes: 0 additions & 88 deletions src/GlueXHitDIRCpoint.cc

This file was deleted.

67 changes: 0 additions & 67 deletions src/GlueXHitDIRCpoint.hh

This file was deleted.

Loading

0 comments on commit 3be5c38

Please sign in to comment.