#include <NtupleGenerator.h>
Definition at line 15 of file NtupleGenerator.h.
◆ NtupleGenerator()
| NtupleGenerator::NtupleGenerator |
( |
| ) |
|
◆ ~NtupleGenerator()
| NtupleGenerator::~NtupleGenerator |
( |
| ) |
|
|
override |
◆ GetNevents()
| Int_t NtupleGenerator::GetNevents |
( |
| ) |
|
◆ Init() [1/2]
| Bool_t NtupleGenerator::Init |
( |
const char * |
fileName | ) |
|
|
overridevirtual |
◆ Init() [2/2]
| Bool_t NtupleGenerator::Init |
( |
const char * |
fileName, |
|
|
int |
startEvent |
|
) |
| |
|
overridevirtual |
Implements SHiP::Generator.
Definition at line 25 of file NtupleGenerator.cxx.
25 {
26 cout << "Info NtupleGenerator: Opening input file " << fileName << endl;
29 cout << "-E NtupleGenerator: Error opening the Signal file" << fileName
30 << endl;
31 }
35 fTree->SetBranchAddress(
"id", &
id);
36 if (
fTree->FindBranch(
"parentid")) {
38 }
39 if (
fTree->FindBranch(
"tof")) {
40 fTree->SetBranchAddress(
"tof", &
tof);
41 }
44 fTree->SetBranchAddress(
"w", &
w);
45 fTree->SetBranchAddress(
"x", &
vx);
46 fTree->SetBranchAddress(
"y", &
vy);
47 fTree->SetBranchAddress(
"z", &
vz);
48 fTree->SetBranchAddress(
"px", &
px);
49 fTree->SetBranchAddress(
"py", &
py);
50 fTree->SetBranchAddress(
"pz", &
pz);
53 return kTRUE;
54}
◆ ReadEvent()
| Bool_t NtupleGenerator::ReadEvent |
( |
FairPrimaryGenerator * |
cpg | ) |
|
|
override |
Definition at line 67 of file NtupleGenerator.cxx.
67 {
71 if (
fn % 10000 == 0) {
72 cout <<
"reading event " <<
fn << endl;
73 }
74
78 break;
79 }
80 }
82 cout << "No more input events" << endl;
83 return kFALSE;
84 }
85 TDatabasePDG* pdgBase = TDatabasePDG::Instance();
86 Double_t
mass = pdgBase->GetParticle(
id)->Mass();
87 Double_t e =
88 TMath::Sqrt(
px[0] *
px[0] +
py[0] *
py[0] +
pz[0] *
pz[0] + mass * mass);
90
91 cpg->AddTrack(
id,
px[0],
py[0],
pz[0],
vx[0] * 100.,
vy[0] * 100.,
92 vz[0] * 100., -1.,
false, e,
tof,
w);
94
95 Double_t zscor = 20.;
96 Double_t lam = (zscor -
vz[
i]) /
pz[i];
97 Double_t xscor =
vx[
i] + lam *
px[
i];
98 Double_t yscor =
vy[
i] + lam *
py[
i];
99 e = TMath::Sqrt(
px[i] *
px[i] +
py[i] *
py[i] +
pz[i] *
pz[i] + mass * mass);
100 cpg->AddTrack(
id,
px[i],
py[i],
pz[i], xscor * 100., yscor * 100.,
101 zscor * 100., 0,
true, e,
tof,
w);
102 return kTRUE;
103}
def mass(str|None particle)
◆ Ezero
| Float_t NtupleGenerator::Ezero |
|
protected |
◆ fInputFile
| TFile* NtupleGenerator::fInputFile |
|
protected |
◆ fLogger
| FairLogger* NtupleGenerator::fLogger |
|
protected |
◆ fn
◆ fNevents
| int NtupleGenerator::fNevents |
|
protected |
◆ fTree
| TTree* NtupleGenerator::fTree |
|
protected |
◆ id
| Int_t NtupleGenerator::id |
|
protected |
◆ Nmeas
| Int_t NtupleGenerator::Nmeas |
|
protected |
◆ parentid
| Int_t NtupleGenerator::parentid |
|
protected |
◆ procid
| Int_t NtupleGenerator::procid[500] |
|
protected |
◆ px
| Float_t NtupleGenerator::px[500] |
|
protected |
◆ py
| Float_t NtupleGenerator::py[500] |
|
protected |
◆ pz
| Float_t NtupleGenerator::pz[500] |
|
protected |
◆ tof
| Float_t NtupleGenerator::tof |
|
protected |
◆ volid
| Int_t NtupleGenerator::volid[500] |
|
protected |
◆ vx
| Float_t NtupleGenerator::vx[500] |
|
protected |
◆ vy
| Float_t NtupleGenerator::vy[500] |
|
protected |
◆ vz
| Float_t NtupleGenerator::vz[500] |
|
protected |
| Double_t NtupleGenerator::w |
|
protected |
The documentation for this class was generated from the following files: