Class Reference for E1039 Core & Analysis Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SQG4DipoleMagnetSubsystem.cc
Go to the documentation of this file.
4 #include "PHG4BlockGeomv1.h"
6 
7 #include <phparameter/PHParameters.h>
9 #include <g4main/PHG4Utils.h>
10 #include <phool/getClass.h>
11 
12 #include <Geant4/globals.hh>
13 #include <sstream>
14 
15 //_______________________________________________________________________
16 SQG4DipoleMagnetSubsystem::SQG4DipoleMagnetSubsystem(const std::string& name, const int lyr)
17  : PHG4DetectorSubsystem(name, lyr)
18  , _detector(nullptr)
19  , _steppingAction(nullptr)
20 {
22 }
23 
24 //_______________________________________________________________________
26 {
27  PHNodeIterator iter(topNode);
28  PHCompositeNode *dstNode = dynamic_cast<PHCompositeNode *>(iter.findFirst("PHCompositeNode", "DST"));
29 
30  // create detector
31  _detector = new SQG4DipoleMagnetDetector(topNode, GetParams(), Name(), GetLayer());
32  _detector->SuperDetector(SuperDetector());
33  _detector->OverlapCheck(CheckOverlap());
34  if(GetParams()->get_int_param("enable_track_filter"))
35  {
36  _steppingAction = new SQG4DipoleMagnetSteppingAction(_detector, GetParams());
37  }
38 
39  return 0;
40 }
41 
42 //_______________________________________________________________________
44 {
45  // pass top node to stepping action so that it gets
46  // relevant nodes needed internally
47  if(_steppingAction != nullptr)
48  {
49  _steppingAction->SetInterfacePointers(topNode);
50  }
51  return 0;
52 }
53 
54 //_______________________________________________________________________
56 {
57  return _detector;
58 }
59 
60 void SQG4DipoleMagnetSubsystem::SetDefaultParameters()
61 {
62  set_default_double_param("place_x", 0.);
63  set_default_double_param("place_y", 0.);
64  set_default_double_param("place_z", 0.);
65  set_default_double_param("rot_x", 0.);
66  set_default_double_param("rot_y", 0.);
67  set_default_double_param("rot_z", 0.);
68  set_default_double_param("steplimits", NAN);
69  set_default_double_param("size_x", 10.);
70  set_default_double_param("size_y", 10.);
71  set_default_double_param("size_z", 10.);
72  set_default_int_param("use_g4steps", 0);
73  set_default_string_param("material", "G4_Galactic");
74 
75  set_default_string_param("geomdb", "");
76  set_default_string_param("magname", "");
77  set_default_int_param("enable_track_filter", 0);
78  set_default_double_param("filter_max_slope", 10.);
79  set_default_double_param("filter_min_energy", 0.);
80 }
virtual const std::string Name() const
Returns the name of this module.
Definition: Fun4AllBase.h:23
const std::string SuperDetector() const
void set_default_double_param(const std::string &name, const double dval)
void set_default_string_param(const std::string &name, const std::string &sval)
PHParameters * GetParams() const
int get_int_param(const std::string &name) const
void set_default_int_param(const std::string &name, const int ival)
base class for phenix detector creation
Definition: PHG4Detector.h:14
virtual void OverlapCheck(const bool chk=true)
Definition: PHG4Detector.h:53
virtual void SetInterfacePointers(PHCompositeNode *)
PHNode * findFirst(const std::string &, const std::string &)
void SuperDetector(const std::string &name)
PHG4Detector * GetDetector(void) const
accessors (reimplemented)
int process_event(PHCompositeNode *)
event processing
int InitRunSubsystem(PHCompositeNode *)
InitRunSubsystem.
SQG4DipoleMagnetSubsystem(const std::string &name="BLOCK", const int layer=0)
constructor