Class Reference for E1039 Core & Analysis Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4_Target.C
Go to the documentation of this file.
1 #pragma once
2 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0)
6 class SubsysReco;
7 R__LOAD_LIBRARY(libg4detectors)
8 #endif
9 
11  PHG4Reco* g4Reco,
12  const double target_coil_pos_z = -300,
13  const double target_l = 7.9,
14  const double target_z = 0.,
15  const int use_g4steps = 1,
16  const int register_hits = 0)
17 {
19  coil_0->SuperDetector("Coil");
20  coil_0->set_double_param("rot_x", 90.);
21  coil_0->set_double_param("rot_y", 0.);
22  coil_0->set_double_param("rot_z", 0.);
23  coil_0->set_double_param("place_x", 0.);
24  coil_0->set_double_param("place_y", (22.7+4.)/2);
25  coil_0->set_double_param("place_z", target_coil_pos_z);
26  coil_0->set_int_param("use_g4steps", use_g4steps);
27  coil_0->SetActive(register_hits);
28  g4Reco->registerSubsystem(coil_0);
29 
31  coil_1->SuperDetector("Coil");
32  coil_1->set_double_param("rot_x", -90.);
33  coil_1->set_double_param("rot_y", 0.);
34  coil_1->set_double_param("rot_z", 0.);
35  coil_1->set_double_param("place_x", 0.);
36  coil_1->set_double_param("place_y", -(22.7+4.)/2);
37  coil_1->set_double_param("place_z", target_coil_pos_z);
38  coil_1->set_int_param("use_g4steps", use_g4steps);
39  coil_1->SetActive(register_hits);
40  g4Reco->registerSubsystem(coil_1);
41 
42  PHG4CylinderSubsystem* target = new PHG4CylinderSubsystem("Target", 0);
43  target->SuperDetector("Target");
44  target->set_double_param("length", target_l);
45  target->set_double_param("rot_x", 0.);
46  target->set_double_param("rot_y", 0.);
47  target->set_double_param("rot_z", 0.);
48  target->set_double_param("place_x", 0.);
49  target->set_double_param("place_y", 0.);
50  target->set_double_param("place_z", target_coil_pos_z + target_z);
51  target->set_double_param("radius", 0.);
52  target->set_double_param("thickness", (2.)/2);
53  target->set_string_param("material", "Target"); // material of target
54  target->set_int_param("lengthviarapidity", 0);
55  target->set_int_param("use_g4steps", use_g4steps);
56  target->SetActive(register_hits);
57  g4Reco->registerSubsystem(target);
58 
59  return;
60 }
61 
Runs G4 as a subsystem.
Definition: PHG4Reco.h:38
void set_int_param(const std::string &name, const int ival)
void SuperDetector(const std::string &name)
void set_double_param(const std::string &name, const double dval)
void SetupTarget(PHG4Reco *g4Reco, const double target_coil_pos_z=-300, const double target_l=7.9, const double target_z=0., const int use_g4steps=1, const int register_hits=0)
Definition: G4_Target.C:10
void set_string_param(const std::string &name, const std::string &sval)
void SetActive(const int i=1)
void registerSubsystem(PHG4Subsystem *subsystem)
register subsystem
Definition: PHG4Reco.h:65