EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairGeaneApplication.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FairGeaneApplication.cxx
1 // -------------------------------------------------------------------------
2 // ----- FairGeaneApplication source file -----
3 // ----- Created 10/11/10 by M. Al-Turany -----
4 // -------------------------------------------------------------------------
5 
6 
7 #include "FairGeaneApplication.h"
8 #include "FairField.h"
9 
10 #include "TVirtualMC.h"
11 #include "TGeoManager.h"
12 
13 #include <iostream>
14 
15 using std::cout;
16 using std::endl;
17 
18 //_____________________________________________________________________________
20  : TVirtualMCApplication(),
21  fxField(0),
22  fMcVersion(-1),
23  fDebug(kFALSE),
24  fTrkPos(TLorentzVector(0,0,0,0))
25 {
26 // Default constructor
27 }
28 //_____________________________________________________________________________
30  : TVirtualMCApplication(),
31  fxField(0),
32  fMcVersion(-1),
33  fDebug(Debug),
34  fTrkPos(TLorentzVector(0,0,0,0))
35 {
36  //constructur used by Geane track propagation
37 }
38 
39 //_____________________________________________________________________________
41 {
42 // Destructor
43  delete gMC;
44  //@W@gMC=0;
45 }
46 //_____________________________________________________________________________
47 
48 //_____________________________________________________________________________
50 {
51  gMC->SetRootGeometry(); // notify VMC about Root geometry
52 }
53 
54 void FairGeaneApplication::InitMC(const char* setup, const char* cuts)
55 {
56 // Initialize MC.
57 
58  gMC->Init();
59  gMC->BuildPhysics();
60  fMcVersion = 3; //Geane
61 
62  gMC->SetMagField(fxField);
63 }
64 //_____________________________________________________________________________
66 {
67 // User actions at each step
68 // ---
69  if (fDebug) {
70  printf(" FairGeaneApplication::GeaneStepping() \n");
71  gMC->TrackPosition(fTrkPos);
72  printf(" Track Position: x = %f y= %f z= %f \n ", fTrkPos.X(), fTrkPos.Y(), fTrkPos.Z());
73  printf(" Current Volume name: %s \n", gMC->CurrentVolName());
74  Int_t copyNo;
75  Int_t id = gMC->CurrentVolID(copyNo);
76  printf(" Current Volume id = %i , CopyNo = %i \n", id, copyNo);
77  }
78 }
79 //_____________________________________________________________________________
80 void FairGeaneApplication::SetField(FairField* field)
81 {
82  fxField=field;
83 }
84 
86 
87