Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MyHitTTree.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file MyHitTTree.C
1 #ifndef MACRO_MYHITTTREE_C
2 #define MACRO_MYHITTTREE_C
3 
4 #include <fun4all/SubsysReco.h>
10 #include <g4histos/G4HitTTree.h>
11 
12 R__LOAD_LIBRARY(libg4histos.so)
13 
14 void MyHitTTree(const char *fname, const int nevnt = 0, const char *outfile="hits.root")
15 {
16  gSystem->Load("libg4dst.so");
18  char detector[100];
19  char outnode[100];
20  sprintf(detector,"%s","SVTX");
21  sprintf(outnode,"G4RootHit_%s",detector);
22  // se->Verbosity(10);
23  G4HitTTree *tt = new G4HitTTree();
24  tt->Detector(detector);
25  se->registerSubsystem(tt);
26 
28  in->fileopen(fname);
29  se->registerInputManager(in);
31  out->AddNode(outnode);
32  se->registerOutputManager(out);
33 
34  se->run(nevnt);
35  se->End();
36  delete se;
37 }
38 
39 #endif