Skip to content

Commit 082b9f4

Browse files
committed
Moving files into the trunk.
1 parent b32bafe commit 082b9f4

25 files changed

+1986
-0
lines changed

Diff for: include/WCSimDetectorConstruction.hh

+240
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
#ifndef WCSimDetectorConstruction_H
2+
#define WCSimDetectorConstruction_H 1
3+
4+
#include "G4Transform3D.hh"
5+
#include "G4VUserDetectorConstruction.hh"
6+
#include "G4LogicalVolume.hh"
7+
#include "G4VPhysicalVolume.hh"
8+
#include "G4OpticalSurface.hh"
9+
#include "globals.hh"
10+
11+
#include <fstream>
12+
#include <map>
13+
//#include <hash_map.h>
14+
// warning : hash_map is not part of the standard
15+
#include <ext/hash_map>
16+
17+
18+
using __gnu_cxx::hash;
19+
using __gnu_cxx::hashtable;
20+
using __gnu_cxx::hash_map;
21+
using __gnu_cxx::hash_multimap;
22+
23+
// (JF) We don't need this distinction for DUSEL
24+
//enum cyl_location {endcap1,wall,endcap2};
25+
26+
class G4Box;
27+
class G4Tubs;
28+
class G4Material;
29+
class G4LogicalVolume;
30+
class G4AssemblyVolume;
31+
class G4VPhysicalVolume;
32+
class WCSimTuningParameters;
33+
class WCSimDetectorMessenger;
34+
class WCSimWCSD;
35+
36+
namespace __gnu_cxx {
37+
template<> struct hash< std::string >
38+
{
39+
size_t operator()( const std::string& x ) const
40+
{
41+
return hash< const char* >()( x.c_str() );
42+
}
43+
};
44+
}
45+
46+
class WCSimDetectorConstruction : public G4VUserDetectorConstruction
47+
{
48+
public:
49+
50+
WCSimDetectorConstruction(G4int DetConfig,WCSimTuningParameters* WCSimTuningPars);
51+
~WCSimDetectorConstruction();
52+
53+
G4VPhysicalVolume* Construct();
54+
55+
// Related to the WC geometry
56+
void SetSuperKGeometry();
57+
void DUSEL_100kton_10inch_40perCent();
58+
void DUSEL_100kton_10inch_HQE_30perCent();
59+
void DUSEL_100kton_10inch_HQE_30perCent_Gd();
60+
void DUSEL_150kton_10inch_HQE_30perCent();
61+
void UpdateGeometry();
62+
63+
//Related to MailBox Geometry aah
64+
void SetMailBox100kTGeometry();
65+
void SetMailBox150kTGeometry_10inch_HQE_30perCent();
66+
void SetMailBox150kTGeometry_10inch_40perCent();
67+
void SetMailBox300kTGeometry();
68+
G4double WC_MB_Fid_Length,WC_MB_Fid_Width,WC_MB_Fid_Depth; //Fiducial Volume sizes--note, this "fiducial" should probably be called the "active volume". The PMT's are just outside.
69+
G4double WC_MB_Tank_Airgap, WC_MB_Dome_Height_fraction,WC_MB_Veto_Thickness,WC_MB_Buffer_Thickness;// Dimensions to determine WaterTank and Cavern Sizes (Veto may or may not be actual veto detector),WC_MB_Buffer_Thickness is distance between wall to PMT top
70+
//End of Mailbox Variables
71+
72+
73+
G4double GetWaterTubeLength() {return WCLength;}
74+
G4double GetWaterTubePosition() {return WCPosition;}
75+
G4double GetPMTSize() {return WCPMTRadius;}
76+
G4String GetPMTName() {return WCPMTName;}
77+
G4int GetMyConfiguration() {return myConfiguration;}
78+
79+
// Related to the WC tube IDs
80+
static G4int GetTubeID(std::string tubeTag){return tubeLocationMap[tubeTag];}
81+
static G4Transform3D GetTubeTransform(int tubeNo){return tubeIDMap[tubeNo];}
82+
83+
// Related to Pi0 analysis
84+
G4bool SavePi0Info() {return pi0Info_isSaved;}
85+
void SavePi0Info(G4bool choice) {pi0Info_isSaved=choice;}
86+
87+
// Geometry options
88+
void SetIsUpright(G4bool choice) {isUpright = choice;}
89+
void SetIsMailbox(G4bool choice) {isMailbox = choice;}
90+
G4bool GetIsMailbox() {return isMailbox;}
91+
92+
private:
93+
94+
// Tuning parameters
95+
96+
WCSimTuningParameters* WCSimTuningParams;
97+
98+
// Sensitive Detectors. We declare the pointers here because we need
99+
// to check their state if we change the geometry.
100+
101+
WCSimWCSD* aWCPMT;
102+
103+
//Water, Blacksheet surface
104+
G4OpticalSurface * OpWaterBSSurface;
105+
106+
//Glass, Cathode surface in PMTs
107+
108+
G4OpticalSurface * OpGlassCathodeSurface;
109+
110+
111+
// The messenger we use to change the geometry.
112+
113+
WCSimDetectorMessenger* messenger;
114+
115+
// The Construction routines
116+
G4LogicalVolume* ConstructMailboxWC();
117+
G4LogicalVolume* ConstructWC();
118+
void ConstructPMT();
119+
120+
void ConstructMaterials();
121+
122+
G4bool WCAddGd;
123+
124+
// Code for traversing the geometry and assigning tubeIDs.
125+
126+
// First make a typedef for the pointer to the member fcn. The
127+
// syntax is too wacked out to be using all over.
128+
129+
typedef void (WCSimDetectorConstruction::*DescriptionFcnPtr)
130+
(G4VPhysicalVolume*, int, int, const G4Transform3D&);
131+
132+
// Now Funcs for traversing the geometry
133+
void TraverseReplicas(G4VPhysicalVolume*, int, const G4Transform3D&,
134+
DescriptionFcnPtr);
135+
136+
void DescribeAndDescendGeometry(G4VPhysicalVolume*, int, int,
137+
const G4Transform3D&, DescriptionFcnPtr);
138+
139+
// Functions that the traversal routines call or we use to manipulate the
140+
// data we accumulate.
141+
void DumpGeometryTableToFile();
142+
143+
void PrintGeometryTree(G4VPhysicalVolume*, int, int, const G4Transform3D&);
144+
void DescribeAndRegisterPMT(G4VPhysicalVolume*, int, int,
145+
const G4Transform3D&);
146+
void DescribeAndRegisterPMT_1KT(G4VPhysicalVolume*, int, int,
147+
const G4Transform3D&);
148+
void GetWCGeom(G4VPhysicalVolume*, int, int,
149+
const G4Transform3D&);
150+
151+
//---Volume lengths
152+
153+
// These are shared between the different member functions
154+
// constructWC, constructFGD, constructlArD, constuctMRD
155+
// toggle between FGD(0) and lArD(1)
156+
// toggle between lArD readout types
157+
// toggle between MRDScint and MRDk2k
158+
159+
G4bool pi0Info_isSaved;
160+
161+
G4double WCLength;
162+
163+
G4double WCPosition;
164+
165+
// WC PMT parameters
166+
G4String WCPMTName;
167+
G4double sphereRadius;
168+
G4double PMTOffset;
169+
G4LogicalVolume* logicWCPMT;
170+
G4LogicalVolume* logicGlassFaceWCPMT;
171+
172+
// WC geometry parameters
173+
174+
G4double WCPMTRadius;
175+
G4double WCPMTExposeHeight;
176+
G4double WCPMTGlassThickness;
177+
G4double WCBarrelPMTOffset;
178+
179+
G4double WCIDDiameter;
180+
181+
G4double WCCapLength;
182+
G4double WCBackODLength;
183+
G4double WCFrontODLength;
184+
G4double WCIDHeight;
185+
186+
G4double WCBarrelRingRadius;
187+
188+
G4double WCBarrelRingNPhi;
189+
G4double WCBarrelNRings;
190+
G4double WCPMTperCellHorizontal;
191+
G4double WCPMTperCellVertical;
192+
193+
G4double WCPMTPercentCoverage;
194+
195+
G4double WCBarrelNumPMTHorizontal;
196+
G4double WCCapPMTSpacing;
197+
G4double WCCapEdgeWidth;//jh TODO: not used
198+
199+
G4double WCCapEdgeLimit;
200+
G4double WCBlackSheetThickness;
201+
202+
//for 1kt
203+
G4double WCDiameter;
204+
G4double WCRadius;
205+
G4double WCBarrelPMTRadius;
206+
G4double WCBarrelRingdPhi;
207+
G4double WCBarrelCellLength;
208+
G4double WCCapNCell;
209+
G4double WCBarrelLength;
210+
211+
// amb79: to universally make changes in structure and geometry
212+
bool isUpright, isMailbox;
213+
214+
215+
// amb79: debug to display all parts
216+
bool debugMode;
217+
218+
// Variables related to the geometry
219+
220+
std::ofstream geoFile; // File for text output
221+
222+
G4int totalNumPMTs; // The number of PMTs for this configuration
223+
G4double WCCylInfo[2]; // Info for the geometry tree: radius & length
224+
G4double WCPMTSize; // Info for the geometry tree: pmt size
225+
G4ThreeVector WCOffset; // Info for the geometry tree: WC center offset
226+
227+
// Tube map information
228+
229+
static std::map<int, G4Transform3D> tubeIDMap;
230+
// static std::map<int, cyl_location> tubeCylLocation;
231+
static hash_map<std::string, int, hash<std::string> > tubeLocationMap;
232+
233+
// Variables related to configuration
234+
235+
G4int myConfiguration; // Detector Config Parameter
236+
237+
};
238+
239+
#endif
240+

Diff for: include/WCSimDetectorMessenger.hh

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#ifndef WCSimDetectorMessenger_h
2+
#define WCSimDetectorMessenger_h 1
3+
4+
class WCSimDetectorConstruction;
5+
class G4UIdirectory;
6+
class G4UIcmdWithAString;
7+
8+
#include "G4UImessenger.hh"
9+
#include "globals.hh"
10+
#include "G4ios.hh"
11+
#include "G4UImessenger.hh"
12+
#include "G4UIdirectory.hh"
13+
#include "G4UIcmdWithADouble.hh"
14+
#include "G4UIcmdWithoutParameter.hh"
15+
16+
class WCSimDetectorMessenger: public G4UImessenger
17+
{
18+
public:
19+
WCSimDetectorMessenger(WCSimDetectorConstruction* mpga);
20+
~WCSimDetectorMessenger();
21+
22+
public:
23+
void SetNewValue(G4UIcommand* command, G4String newValues);
24+
25+
private:
26+
WCSimDetectorConstruction* WCSimDetector;
27+
28+
private: //commands
29+
30+
G4UIdirectory* WCSimDir;
31+
G4UIcmdWithAString* PMTConfig;
32+
G4UIcmdWithAString* PMTGeomDetails;
33+
G4UIcmdWithAString* PMTSize;
34+
G4UIcmdWithAString* tubeCmd;
35+
G4UIcmdWithAString* distortionCmd;
36+
G4UIcmdWithoutParameter* WCConstruct;
37+
38+
};
39+
40+
#endif
41+
42+

Diff for: include/WCSimEventAction.hh

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#ifndef WCSimEventAction_h
2+
#define WCSimEventAction_h 1
3+
4+
5+
#include "G4UserEventAction.hh"
6+
#include "G4ThreeVector.hh"
7+
#include "G4Types.hh"
8+
#include "G4ios.hh"
9+
10+
#include "WCSimDetectorConstruction.hh"
11+
#include "G4TrajectoryContainer.hh"
12+
#include "WCSimWCHit.hh"
13+
#include "WCSimWCDigi.hh"
14+
15+
class WCSimRunAction;
16+
class WCSimPrimaryGeneratorAction;
17+
class G4Event;
18+
19+
class WCSimEventAction : public G4UserEventAction
20+
{
21+
private:
22+
WCSimRunAction* runAction;
23+
WCSimPrimaryGeneratorAction* generatorAction;
24+
WCSimDetectorConstruction* detectorConstructor;
25+
26+
public:
27+
WCSimEventAction(WCSimRunAction*, WCSimDetectorConstruction*,
28+
WCSimPrimaryGeneratorAction*);
29+
~WCSimEventAction();
30+
31+
public:
32+
void BeginOfEventAction(const G4Event*);
33+
void EndOfEventAction(const G4Event*);
34+
void FillRootEvent(G4int,
35+
const struct ntupleStruct&,
36+
G4TrajectoryContainer*,
37+
WCSimWCHitsCollection*,
38+
WCSimWCDigitsCollection*);
39+
WCSimRunAction* GetRunAction(){return runAction;}
40+
41+
private:
42+
G4int WCSimEventFindStartingVolume( G4ThreeVector vtx);
43+
G4int WCSimEventFindStoppingVolume( G4String stopVolumeName);
44+
45+
};
46+
47+
48+
#endif
49+
50+

Diff for: include/WCSimPhysicsList.hh

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
2+
#ifndef WCSimPhysicsList_h
3+
#define WCSimPhysicsList_h 1
4+
#include "G4VUserPhysicsList.hh"
5+
#include "WCSimPhysicsMessenger.hh"
6+
#include "globals.hh"
7+
8+
class WCSimPhysicsList: public G4VUserPhysicsList
9+
{
10+
public:
11+
WCSimPhysicsList();
12+
~WCSimPhysicsList();
13+
14+
//=================================
15+
// Added by JLR 2005-07-05
16+
//=================================
17+
// This method sets the model for
18+
// hadronic secondary interactions
19+
void SetSecondaryHad(G4String hadval);
20+
21+
private:
22+
WCSimPhysicsMessenger* PhysicsMessenger;
23+
24+
G4String SecondaryHadModel;
25+
26+
G4bool gheishahad;
27+
G4bool bertinihad;
28+
G4bool binaryhad;
29+
30+
protected:
31+
// Construct particle and physics process
32+
void ConstructParticle();
33+
void ConstructProcess();
34+
void SetCuts();
35+
36+
protected:
37+
// these methods Construct particles
38+
void ConstructBosons();
39+
void ConstructLeptons();
40+
void ConstructMesons();
41+
void ConstructBaryons();
42+
43+
protected:
44+
// these methods Construct physics processes and register them
45+
void ConstructGeneral();
46+
void ConstructEM();
47+
void ConstructOp();
48+
void ConstructHad();
49+
void ConstructlArStepLimiter();
50+
51+
52+
};
53+
54+
#endif
55+
56+
57+
58+
59+
60+
61+

0 commit comments

Comments
 (0)