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