EDepSimRooTrackerKinematicsFactory.cc
Go to the documentation of this file.
1 #include <TFile.h>
2 #include <TTree.h>
3 #include <TBits.h>
4 #include <TObjString.h>
5 
8 
11  : EDepSim::VKinematicsFactory("rooTracker",parent),
12  fInputFile("not-open"), fTreeName("gRooTracker"),
13  fGeneratorName("GENIE"), fOrder("consecutive"), fFirstEvent(0) {
14 
15  fInputFileCMD = new G4UIcmdWithAString(CommandName("input"),this);
16  fInputFileCMD->SetGuidance("Set the input file.");
17  fInputFileCMD->SetParameterName("name",false);
18 
19  fTreeNameCMD = new G4UIcmdWithAString(CommandName("tree"),this);
20  fTreeNameCMD->SetGuidance("Set the tree path in the input file.");
21  fTreeNameCMD->SetParameterName("tree",false);
22 
23  fGeneratorNameCMD = new G4UIcmdWithAString(CommandName("generator"),this);
24  fGeneratorNameCMD->SetGuidance("Set the name of the kinematics source.");
25  fGeneratorNameCMD->SetParameterName("generator",false);
26 
27  fOrderCMD = new G4UIcmdWithAString(CommandName("order"),this);
28  fOrderCMD->SetGuidance("Set order that events in the file are used.");
29  fOrderCMD->SetParameterName("order",false);
30  fOrderCMD->SetCandidates("consecutive stride random");
31 
32  fFirstEventCMD = new G4UIcmdWithAnInteger(CommandName("first"),this);
33  fFirstEventCMD->SetGuidance("Set the first event to generate.");
34  fFirstEventCMD->SetParameterName("number",false);
35 }
36 
38  delete fInputFileCMD;
39  delete fTreeNameCMD;
40  delete fGeneratorNameCMD;
41  delete fOrderCMD;
42  delete fFirstEventCMD;
43 }
44 
46  G4String newValue) {
47  if (command == fInputFileCMD) {
48  SetInputFile(newValue);
49  }
50  else if (command == fTreeNameCMD) {
51  SetTreeName(newValue);
52  }
53  else if (command == fGeneratorNameCMD) {
54  SetGeneratorName(newValue);
55  }
56  else if (command == fOrderCMD) {
57  SetOrder(newValue);
58  }
59  else if (command == fFirstEventCMD) {
60  SetFirstEvent(fFirstEventCMD->GetNewIntValue(newValue));
61  }
62 }
63 
67  GetInputFile(),
68  GetTreeName(),
69  GetOrder(),
70  GetFirstEvent());
71  return kine;
72 }
virtual void SetNewValue(G4UIcommand *command, G4String newValue)
Handle messages from the UI processor.
RooTrackerKinematicsFactory(EDepSim::UserPrimaryGeneratorMessenger *fParent)
int command
virtual const G4String & GetInputFile() const
Get the input file to read.
virtual void SetInputFile(const G4String &name)
Set the input file to read.
Construct a module from components.
Definition: TG4HitSegment.h:10
virtual const G4String & GetGeneratorName() const
Get the generator name.
virtual const G4String & GetTreeName() const
Get the tree name.
G4String CommandName(G4String cmd)
Build a command name with the directory prefix.
virtual int GetFirstEvent() const
Get the first event to read.
virtual void SetFirstEvent(int f)
Set the first event to read.
virtual EDepSim::VKinematicsGenerator * GetGenerator()
virtual G4String GetOrder()
Get the order that events in the input file will be used.
virtual void SetGeneratorName(const G4String &name)
virtual void SetOrder(const G4String &order)
Set the order that events in the input file will be used.
def parent(G, child, parent_type)
Definition: graph.py:67