10#include "FairPrimaryGenerator.h"
12#include "TDatabasePDG.h"
21 return Init(fileName, 0);
25 fInputFile = std::unique_ptr<TFile>(TFile::Open(fileName,
"read"));
26 LOGF(info,
"Info EvtCalcGenerator: Opening input file %s", fileName);
29 std::unique_ptr<TTree>(
dynamic_cast<TTree*
>(
fInputFile->Get(
"LLP_tree")));
33 auto* branches =
fTree->GetListOfBranches();
38 auto* branch =
dynamic_cast<TBranch*
>(branches->At(i));
39 if (
fTree->FindBranch(branch->GetName())) {
51 unsigned index)
const {
55 throw std::out_of_range(
"Branch index out of range");
60 int dauID,
int offset)
const {
61 int baseIndex = 10 + (dauID * 6);
68 const std::unique_ptr<TTree>& tree)
const {
74 const std::unique_ptr<TTree>& tree)
const {
78 const std::unique_ptr<TTree>& tree)
const {
82 const std::unique_ptr<TTree>& tree)
const {
86 const std::unique_ptr<TTree>& tree)
const {
103 const std::unique_ptr<TTree>& tree)
const {
132 LOG(warning) <<
"End of input file. Rewind.";
138 if (
fn % 100 == 0) LOGF(info,
"Info EvtCalcGenerator: event nr %d",
fn);
142 Double_t space_unit_conv = 100.;
144 Double_t vx_transf =
GetVx(
fTree) * space_unit_conv;
145 Double_t vy_transf =
GetVy(
fTree) * space_unit_conv;
147 (
GetVz(
fTree) - coord_shift) * space_unit_conv;
149 Double_t c = 2.99792458e+10;
150 Double_t tof = TMath::Sqrt(vx_transf * vx_transf + vy_transf * vy_transf +
151 vz_transf * vz_transf) /
154 Double_t pdg_dau = 0;
157 Bool_t wanttracking =
false;
158 Double_t pdg_llp = 999;
167 for (
int iPart = 0; iPart <
Ndau; ++iPart) {
169 if (pdg_dau != -999) {
std::unique_ptr< TFile > fInputFile
Bool_t Init(const char *, int) override
Double_t GetDauPDG(const std::unique_ptr< TTree > &, int) const
Double_t GetNdaughters(const std::unique_ptr< TTree > &) const
Double_t GetDauE(const std::unique_ptr< TTree > &, int) const
Double_t GetMotherE(const std::unique_ptr< TTree > &) const
Double_t GetBranchValue(const std::unique_ptr< TTree > &, unsigned) const
Double_t GetDauPx(const std::unique_ptr< TTree > &, int) const
std::unique_ptr< TTree > fTree
Double_t GetDecayProb(const std::unique_ptr< TTree > &) const
Bool_t ReadEvent(FairPrimaryGenerator *) override
std::vector< double > branchVars
Double_t GetDauPz(const std::unique_ptr< TTree > &, int) const
Double_t GetMotherPy(const std::unique_ptr< TTree > &) const
Double_t GetMotherPz(const std::unique_ptr< TTree > &) const
Double_t GetMotherPx(const std::unique_ptr< TTree > &) const
Double_t GetVz(const std::unique_ptr< TTree > &) const
Double_t GetDauPy(const std::unique_ptr< TTree > &, int) const
Double_t GetVx(const std::unique_ptr< TTree > &) const
Double_t GetVy(const std::unique_ptr< TTree > &) const
~EvtCalcGenerator() override
Double_t GetDaughterValue(const std::unique_ptr< TTree > &tree, int, int) const