CGEM BOSS 6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtDecay.h
Go to the documentation of this file.
1//*****************************************************************************
2//
3// Generators/EvtGen_i/EvtDecay.h
4//
5// This module takes HepMC events from the transient store and decays
6// particles including the secondaries unstable particles
7// in EvtGen.
8// It is a TopAlg can be used in conjunction Pythia KKMC
9// and SingleParticleGun
10//
11// October 2005 adapted to be used in BES3 by A.Zhemchugov
12// November 2003: Maria Smizanska
13// August 2002: Malte Muller, [email protected]
14// Original LHCb code by Witold Pokorski
15//
16//*****************************************************************************
17
18#ifndef GENERATORMODULESEVTDECAY_H
19#define GENERATORMODULESEVTDECAY_H
20
21#include "HepMC/GenEvent.h"
22#include "HepMC/GenParticle.h"
23
27#include "EvtGen.hh"
29
30#include "GaudiKernel/Algorithm.h"
31#include "GaudiKernel/ISvcLocator.h"
32#include "GaudiKernel/NTuple.h"
33
34#include "CLHEP/Random/Ranlux64Engine.h"
35#include <stdio.h>
36#include <vector>
39#include "EvtGenBase/EvtId.hh"
40
43
44//#include "TFile.h"
45//#include "TTree.h"
46//#include "GaudiKernel/NTuple.h"
47
48class IBesRndmGenSvc;
49
50using namespace std;
51using namespace CLHEP;
52
54{
55public:
56 EvtBesRandom(HepRandomEngine* engine);
57 double random();
58 virtual ~EvtBesRandom();
59
60private:
61 HepRandomEngine* m_engine;
62};
63
64class EvtDecay:public Algorithm
65{
66public:
67 EvtDecay(const string& name, ISvcLocator* pSvcLocator);
68
69 StatusCode initialize();
70 StatusCode execute();
71 StatusCode finalize();
72 //--
75private:
76 StatusCode callEvtGen( HepMC::GenEvent* hepMCevt );
77 StatusCode callBesEvtGen( HepMC::GenEvent* hepMCevt );
78 StatusCode makeHepMC(EvtParticle*, HepMC::GenEvent*, HepMC::GenParticle*);
79
80 double CalAmpsMax( EvtParticle* part );
81 double CalAmpsMDIY(EvtParticle* part );
82
83 void MeVToGeV(HepMC::GenEvent* hepMCevt);
84 void GeVToMeV(HepMC::GenEvent* hepMCevt);
85
86 // data members
87 int m_targetID;
88
89//for EvtGen interface
90 EvtGen* m_Gen;
91 EvtBesRandom* m_RandomEngine;
92
93// Local Member Data:-
94 IBesRndmGenSvc* p_BesRndmGenSvc;
95 vector<long int> m_seeds;
96
97
98// jobOption params
99string m_DecayDec, m_PdtTable, userDecFileName,m_DecayTop,m_DecayRec, m_ParentPart;
100
101 std::ofstream outfile,outfile2,truth;
102 std::vector<int> m_InSeeds;
103
104 bool _mDIY;
105 bool m_ampscalflag;
106 bool m_Ncharge,m_NtupleFile, m_Psi4040OpenCharm, m_Psi2openCharm, m_statDecays;
107 int m_numberEvent;
108 int AllTrk_index,Trk_index[500];
109 double px_trk[500];
110 double py_trk[500];
111 double pz_trk[500];
112 double en_trk[500];
113// --- SuperBody3decay
114 void SuperBody3decay_make(EvtId ppid, EvtVector4R p_init);
115 bool SuperBody3decay_judge(EvtParticle* part);
116 string m_SB3File, m_SB3HT;
117 EvtHis2F SuperBody3decay;
118 bool first;
119 int parentPDGcode;
120 double parentMass;
121
122 int pdg0,pdg1,pdg2,pdg,multi;
123 EvtVector4R son0,son1,son2,son;
124 void FinalState_make(EvtId ppid, EvtVector4R p_init);
125 void FinalState_sort(EvtParticle* part);
126 void assign_momentum(int pdx, EvtVector4R pv4);
127 void assign_momentum2(int pdx, EvtVector4R pv4); // for two identical particle
128 bool identical_flag;
129 string m_FDPparticle;
130 EvtVector4R FDP_init;
131 EvtId FDP_id;
132 EvtParticle* FDP_part;
133 void findPart(EvtParticle* part);
134 void countChannel(EvtParticle* part);
135 int br[500],vbr[500];
136 int totalChannels;
137 bool isCharmonium(EvtId xid);
138 bool isCharm(EvtId xid);
139 bool isRadecay(EvtParticle* par);
140 int decayType(EvtParticle *par);
141 std::string getModel(EvtParticle* par, int mode);
142 std::string getModel(EvtParticle* par);
143 bool m_tagLundModel;
144
145 int writeFlag;
146 EvtId m_KKMCRes;
147 std::vector<double> m_polarization;
148 std::string m_truthFile,m_truthPart;
149// for Ntuple
150NTuple::Tuple* m_tuple;
151NTuple::Item<int> TotNumTrk;
152NTuple::Item<int> m_nchr;
153NTuple::Item<int> m_nchr_e;
154NTuple::Item<int> m_nchr_mu;
155NTuple::Item<int> m_nchr_pi;
156NTuple::Item<int> m_nchr_k;
157NTuple::Item<int> m_nchr_p;
158NTuple::Item<int> m_gamma;
159NTuple::Item<int> m_gammaFSR;
160
161NTuple::Array<int> m_Trk_index;
162NTuple::Array<int> m_fst;
163NTuple::Array<double> m_px_trk;
164NTuple::Array<double> m_py_trk;
165NTuple::Array<double> m_pz_trk;
166NTuple::Array<double> m_en_trk;
167
168NTuple::Tuple* mass_tuple;
169NTuple::Item<double> m_m12;
170NTuple::Item<double> m_m13;
171NTuple::Item<double> m_m23;
172NTuple::Item<double> m_m1;
173NTuple::Item<double> m_m2;
174NTuple::Item<double> m_m3;
175NTuple::Item<double> m_cos1;
176NTuple::Item<double> m_cos2;
177NTuple::Item<double> m_cos3;
178NTuple::Item<int> m_ich;
179NTuple::Tuple* massgen_tuple;
180NTuple::Item<double> _m12;
181NTuple::Item<double> _m13;
182NTuple::Item<double> _m23;
183NTuple::Item<double> _m1;
184NTuple::Item<double> _m2;
185NTuple::Item<double> _m3;
186NTuple::Item<double> _cos1;
187NTuple::Item<double> _cos2;
188NTuple::Item<double> _cos3;
189NTuple::Item<int> _ich;
190/////////////
191};
192
193#endif
double random()
Definition EvtDecay.cxx:964
EvtBesRandom(HepRandomEngine *engine)
Definition EvtDecay.cxx:955
virtual ~EvtBesRandom()
Definition EvtDecay.cxx:961
EvtDecay(const string &name, ISvcLocator *pSvcLocator)
Definition EvtDecay.cxx:75
DataInfoSvc * dataInfoSvc
Definition EvtDecay.h:74
IDataInfoSvc * tmpInfoSvc
Definition EvtDecay.h:73
StatusCode initialize()
Definition EvtDecay.cxx:107
StatusCode finalize()
Definition EvtDecay.cxx:811
StatusCode execute()
Definition EvtDecay.cxx:265
Definition EvtId.hh:27
manage multiple CLHEP random engines as named streams