BOSS 8.0.0
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, maltemlr@yahoo.co.uk
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
24#include "EvtGen/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"
38#include <stdio.h>
39#include <vector>
40
41#include "DataInfoSvc/IDataInfoSvc.h"
42// #include "DataInfoSvc/DataInfoSvc.h"
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
54public:
55 EvtBesRandom( HepRandomEngine* engine );
56 double random();
57 virtual ~EvtBesRandom();
58
59private:
60 HepRandomEngine* m_engine;
61};
62
63class EvtDecay : public Algorithm {
64public:
65 EvtDecay( const string& name, ISvcLocator* pSvcLocator );
66
67 StatusCode initialize();
68 StatusCode execute();
69 StatusCode finalize();
70 //--
73
74 double ampsLenu( vector<double> Vexp, std::vector<double> vpars );
75 double ampsLbenu( vector<double> Vexp, std::vector<double> vpars );
76 double HV( double i, double j, vector<double> Vexp, std::vector<double> vpars );
77 double HA( double i, double j, vector<double> Vexp, std::vector<double> vpars );
78 double getObsXsection( double mhds, int mode );
79 double energySpread( double mu, double sigma );
80
81private:
82 StatusCode callEvtGen( HepMC::GenEvent* hepMCevt );
83 StatusCode callBesEvtGen( HepMC::GenEvent* hepMCevt );
84 StatusCode makeHepMC( EvtParticle*, HepMC::GenEvent*, HepMC::GenParticle* );
85
86 double CalAmpsMax( EvtParticle* part );
87 double CalAmpsMDIY( EvtParticle* part );
88
89 void MeVToGeV( HepMC::GenEvent* hepMCevt );
90 void GeVToMeV( HepMC::GenEvent* hepMCevt );
91
92 void ReadTruth( EvtParticle* part, std::vector<std::vector<string>> mylist );
93 // data members
94 int m_targetID;
95 int isNumber( double d );
96 double m_SetMthr;
97 // for EvtGen interface
98 EvtGen* m_Gen;
99 EvtBesRandom* m_RandomEngine;
100
101 // Local Member Data:-
102 IBesRndmGenSvc* p_BesRndmGenSvc;
103 vector<long int> m_seeds;
104
105 // jobOption params
106 string m_DecayDec, m_PdtTable, userDecFileName, m_DecayTop, m_DecayRec, m_ParentPart,
107 m_printfs;
108
109 std::ofstream outfile, outfile2, truth;
110 std::vector<int> m_InSeeds;
111
112 bool _mDIY, m_RdMeasuredEcms, _truthAtCM;
113 double dbEcms, m_beamEnergySpread;
114 bool m_ampscalflag;
115 bool m_Ncharge, m_NtupleFile, m_Psi4040OpenCharm, m_Psi2openCharm, m_statDecays;
116 int m_numberEvent;
117 int AllTrk_index, Trk_index[500];
118 double px_trk[500];
119 double py_trk[500];
120 double pz_trk[500];
121 double en_trk[500];
122 // --- SuperBody3decay
123 void SuperBody3decay_make( EvtId ppid, EvtVector4R p_init );
124 bool SuperBody3decay_judge( EvtParticle* part );
125 string m_SB3File, m_SB3HT;
126 EvtHis2F SuperBody3decay;
127 bool first;
128 int parentPDGcode;
129 double parentMass;
130
131 int pdg0, pdg1, pdg2, pdg, multi;
132 EvtVector4R son0, son1, son2, son;
133 void FinalState_make( EvtId ppid, EvtVector4R p_init );
134 void FinalState_sort( EvtParticle* part );
135 void assign_momentum( int pdx, EvtVector4R pv4 );
136 void assign_momentum2( int pdx, EvtVector4R pv4 ); // for two identical particle
137 bool identical_flag;
138 string m_FDPparticle;
139 EvtVector4R FDP_init;
140 EvtId FDP_id;
141 EvtParticle* FDP_part;
142 void findPart( EvtParticle* part );
143 void countChannel( EvtParticle* part );
144 int br[500], vbr[500];
145 int totalChannels;
146 bool isCharmonium( EvtId xid );
147 bool isCharm( EvtId xid );
148 bool isRadecay( EvtParticle* par );
149 string m_outputp4;
150 int decayType( EvtParticle* par );
151 std::string getModel( EvtParticle* par, int mode );
152 std::string getModel( EvtParticle* par );
153 bool m_tagLundModel, _RvalueTag;
154
155 std::vector<std::string> m_mystring;
156 std::vector<double> m_wind0, m_wind1, m_wind2, m_vangs;
157 std::vector<int> m_cluster0, m_cluster1, m_cluster2;
158 static int m_runNo;
159 std::vector<std::vector<std::string>> m_ReadTruth;
160
161 double m_eBeamPolarization;
162 int writeFlag;
163 EvtId m_KKMCRes;
164 std::vector<double> m_polarization;
165 std::string m_truthFile, m_truthPart;
166 // for Ntuple
167 NTuple::Tuple* m_tuple;
168 NTuple::Item<int> TotNumTrk;
169 NTuple::Item<int> m_nchr;
170 NTuple::Item<int> m_nchr_e;
171 NTuple::Item<int> m_nchr_mu;
172 NTuple::Item<int> m_nchr_pi;
173 NTuple::Item<int> m_nchr_k;
174 NTuple::Item<int> m_nchr_p;
175 NTuple::Item<int> m_gamma;
176 NTuple::Item<int> m_gammaFSR;
177 NTuple::Item<int> m_flag1;
178
179 NTuple::Array<int> m_Trk_index;
180 NTuple::Array<int> m_fst;
181 NTuple::Array<double> m_px_trk;
182 NTuple::Array<double> m_py_trk;
183 NTuple::Array<double> m_pz_trk;
184 NTuple::Array<double> m_en_trk;
185
186 NTuple::Tuple* mass_tuple;
187 NTuple::Item<double> m_m12;
188 NTuple::Item<double> m_m13;
189 NTuple::Item<double> m_m23;
190 NTuple::Item<double> m_m1;
191 NTuple::Item<double> m_m2;
192 NTuple::Item<double> m_m3;
193 NTuple::Item<double> m_cos1;
194 NTuple::Item<double> m_cos2;
195 NTuple::Item<double> m_cos3;
196 NTuple::Item<int> m_ich;
197 NTuple::Tuple* massgen_tuple;
198 NTuple::Item<double> _m12;
199 NTuple::Item<double> _m13;
200 NTuple::Item<double> _m23;
201 NTuple::Item<double> _m1;
202 NTuple::Item<double> _m2;
203 NTuple::Item<double> _m3;
204 NTuple::Item<double> _cos1;
205 NTuple::Item<double> _cos2;
206 NTuple::Item<double> _cos3;
207 NTuple::Item<int> _ich;
208 /////////////
209};
210
211#endif
double random()
EvtBesRandom(HepRandomEngine *engine)
virtual ~EvtBesRandom()
EvtDecay(const string &name, ISvcLocator *pSvcLocator)
Definition EvtDecay.cxx:90
IDataInfoSvc * dataInfoSvc
Definition EvtDecay.h:72
double ampsLenu(vector< double > Vexp, std::vector< double > vpars)
IDataInfoSvc * tmpInfoSvc
Definition EvtDecay.h:71
double energySpread(double mu, double sigma)
StatusCode initialize()
Definition EvtDecay.cxx:153
StatusCode finalize()
double getObsXsection(double mhds, int mode)
double ampsLbenu(vector< double > Vexp, std::vector< double > vpars)
StatusCode execute()
Definition EvtDecay.cxx:375
double HV(double i, double j, vector< double > Vexp, std::vector< double > vpars)
double HA(double i, double j, vector< double > Vexp, std::vector< double > vpars)
Definition EvtId.hh:27
manage multiple CLHEP random engines as named streams