FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairGeaneApplication.cxx
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 // -------------------------------------------------------------------------
9 // ----- FairGeaneApplication source file -----
10 // ----- Created 10/11/10 by M. Al-Turany -----
11 // -------------------------------------------------------------------------
12 
13 #include "FairGeaneApplication.h"
14 
15 #include "FairField.h" // for FairField
16 
17 #include <TVirtualMC.h> // for TVirtualMC
18 #include <stdio.h> // for printf
19 
21  : TVirtualMCApplication()
22  , fxField(0)
23  , fMcVersion(-1)
24  , fDebug(kFALSE)
25  , fTrkPos(TLorentzVector(0, 0, 0, 0))
26 {}
27 
29  : TVirtualMCApplication()
30  , fxField(0)
31  , fMcVersion(-1)
32  , fDebug(Debug)
33  , fTrkPos(TLorentzVector(0, 0, 0, 0))
34 {
35  // constructur used by Geane track propagation
36 }
37 
39 
41 {
42  TVirtualMC::GetMC()->SetRootGeometry(); // notify VMC about Root geometry
43 }
44 
45 void FairGeaneApplication::InitMC(const char*, const char*)
46 {
47  // Initialize MC.
48 
49  TVirtualMC::GetMC()->Init();
50  TVirtualMC::GetMC()->BuildPhysics();
51  fMcVersion = 3; // Geane
52 
53  TVirtualMC::GetMC()->SetMagField(fxField);
54 }
55 
57 {
58  // User actions at each step
59  // ---
60  if (fDebug) {
61  printf(" FairGeaneApplication::GeaneStepping() \n");
62  TVirtualMC::GetMC()->TrackPosition(fTrkPos);
63  printf(" Track Position: x = %f y= %f z= %f \n ", fTrkPos.X(), fTrkPos.Y(), fTrkPos.Z());
64  printf(" Current Volume name: %s \n", TVirtualMC::GetMC()->CurrentVolName());
65  Int_t copyNo;
66  Int_t id = TVirtualMC::GetMC()->CurrentVolID(copyNo);
67  printf(" Current Volume id = %i , CopyNo = %i \n", id, copyNo);
68  }
69 }
70 
71 void FairGeaneApplication::SetField(FairField* field) { fxField = field; }
72 
void SetField(FairField *field)
void InitMC(const char *setup, const char *cuts)
ClassImp(FairEventBuilder)