#include <NtupleGenerator.h>
Definition at line 11 of file NtupleGenerator.h.
◆ NtupleGenerator()
NtupleGenerator::NtupleGenerator |
( |
| ) |
|
◆ ~NtupleGenerator()
NtupleGenerator::~NtupleGenerator |
( |
| ) |
|
|
virtual |
◆ ClassDef()
◆ GetNevents()
Int_t NtupleGenerator::GetNevents |
( |
| ) |
|
Definition at line 92 of file NtupleGenerator.cxx.
93{
95}
int fNevents
don't make it persistent, magic ROOT command
◆ Init() [1/2]
Bool_t NtupleGenerator::Init |
( |
const char * |
fileName | ) |
|
|
virtual |
Definition at line 17 of file NtupleGenerator.cxx.
17 {
18 return Init(fileName, 0);
19}
virtual Bool_t Init(const char *, int)
◆ Init() [2/2]
Bool_t NtupleGenerator::Init |
( |
const char * |
fileName, |
|
|
int |
firstEvent |
|
) |
| |
|
virtual |
Definition at line 21 of file NtupleGenerator.cxx.
21 {
22 cout << "Info NtupleGenerator: Opening input file " << fileName << endl;
25 cout << "-E NtupleGenerator: Error opening the Signal file" << fileName << endl;
26 }
30 fTree->SetBranchAddress(
"id",&
id);
32 if (
fTree->FindBranch(
"tof") ){
fTree->SetBranchAddress(
"tof",&
tof);}
35 fTree->SetBranchAddress(
"w",&
w);
36 fTree->SetBranchAddress(
"x",&
vx);
37 fTree->SetBranchAddress(
"y",&
vy);
38 fTree->SetBranchAddress(
"z",&
vz);
39 fTree->SetBranchAddress(
"px",&
px);
40 fTree->SetBranchAddress(
"py",&
py);
41 fTree->SetBranchAddress(
"pz",&
pz);
44 return kTRUE;
45}
◆ ReadEvent()
Bool_t NtupleGenerator::ReadEvent |
( |
FairPrimaryGenerator * |
cpg | ) |
|
public method ReadEvent
Definition at line 60 of file NtupleGenerator.cxx.
61{
65 if (
fn %10000==0) {cout <<
"reading event "<<
fn<<endl;}
66
70 }
72 cout << "No more input events"<<endl;
73 return kFALSE; }
74 TDatabasePDG* pdgBase = TDatabasePDG::Instance();
75 Double_t
mass = pdgBase->GetParticle(
id)->Mass();
76 Double_t e = TMath::Sqrt(
px[0]*
px[0]+
py[0]*
py[0]+
pz[0]*
pz[0]+ mass*mass );
78
79 cpg->AddTrack(
id,
px[0],
py[0],
pz[0],
vx[0]*100.,
vy[0]*100.,
vz[0]*100.,-1.,
false,e,
tof,
w);
81
82 Double_t zscor = 20.;
83 Double_t lam = (zscor-
vz[
i])/
pz[i];
84 Double_t xscor =
vx[
i]+lam*
px[
i];
85 Double_t yscor =
vy[
i]+lam*
py[
i];
86 e = TMath::Sqrt(
px[i]*
px[i]+
py[i]*
py[i]+
pz[i]*
pz[i]+ mass*mass );
87 cpg->AddTrack(
id,
px[i],
py[i],
pz[i],xscor*100.,yscor*100.,zscor*100.,0,
true,e,
tof,
w);
88 return kTRUE;
89}
◆ 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: