FairShip
Loading...
Searching...
No Matches
TEvtGenDecayer.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// SPDX-FileCopyrightText: Copyright CERN for the benefit of the SHiP
3// Collaboration
4
5#ifndef SHIPGEN_TEVTGENDECAYER_H_
6#define SHIPGEN_TEVTGENDECAYER_H_
7
8// Custom external decayer that uses EvtGen for specific particles (like J/psi)
9// and falls back to TPythia8Decayer for others
10
11#include <vector>
12
13#include "TPythia8Decayer.h"
14#include "TString.h"
15#include "TVirtualMCDecayer.h"
16
17class TClonesArray;
18class TLorentzVector;
19class EvtGen;
20class EvtParticle;
21
22class TEvtGenDecayer : public TVirtualMCDecayer {
23 public:
25 ~TEvtGenDecayer() override;
26
27 void Init() override;
28 void Decay(Int_t pdg, TLorentzVector* p) override;
29 Int_t ImportParticles(TClonesArray* particles) override;
30 void SetForceDecay(Int_t type) override;
31 void ForceDecay() override;
32 Float_t GetPartialBranchingRatio(Int_t ipart) override;
33 Float_t GetLifetime(Int_t kf) override;
34 void ReadDecayTable() override;
35
36 // EvtGen-specific methods
37 void SetEvtGenDecayFile(const char* decayFile);
38 void SetEvtGenParticleFile(const char* particleFile);
39 void AddEvtGenParticle(Int_t pdg); // Add particle to be handled by EvtGen
40
41 // Access methods
42 TPythia8Decayer* GetPythia8Decayer() { return fPythia8Decayer; }
43
44 protected:
45 Bool_t UseEvtGenForParticle(Int_t pdg);
46 void DecayWithEvtGen(Int_t pdg, TLorentzVector* p);
47 void DecayWithPythia8(Int_t pdg, TLorentzVector* p);
48 void ConvertEvtGenDecay(EvtParticle* parent);
49
50 private:
51 TPythia8Decayer*
52 fPythia8Decayer; // Fallback decayer for non-EvtGen particles
53 EvtGen* fEvtGen; // EvtGen instance
54 TString fDecayFile; // EvtGen DECAY.DEC file
55 TString fParticleFile; // EvtGen particle data file
56 std::vector<Int_t>
57 fEvtGenParticles; // List of PDG codes to handle with EvtGen
58
59 // Storage for EvtGen decay products
60 TClonesArray* fEvtGenProducts; // Array to store converted EvtGen particles
61 Bool_t fHasEvtGenDecay; // Flag indicating if last decay was from EvtGen
62};
63
64#endif // SHIPGEN_TEVTGENDECAYER_H_
std::vector< Int_t > fEvtGenParticles
void ReadDecayTable() override
TPythia8Decayer * GetPythia8Decayer()
Bool_t fHasEvtGenDecay
Int_t ImportParticles(TClonesArray *particles) override
void SetForceDecay(Int_t type) override
EvtGen * fEvtGen
void DecayWithPythia8(Int_t pdg, TLorentzVector *p)
TString fParticleFile
void AddEvtGenParticle(Int_t pdg)
void SetEvtGenParticleFile(const char *particleFile)
Float_t GetLifetime(Int_t kf) override
TString fDecayFile
TClonesArray * fEvtGenProducts
void Decay(Int_t pdg, TLorentzVector *p) override
void Init() override
void ForceDecay() override
Float_t GetPartialBranchingRatio(Int_t ipart) override
void ConvertEvtGenDecay(EvtParticle *parent)
void SetEvtGenDecayFile(const char *decayFile)
~TEvtGenDecayer() override
void DecayWithEvtGen(Int_t pdg, TLorentzVector *p)
TPythia8Decayer * fPythia8Decayer
Bool_t UseEvtGenForParticle(Int_t pdg)