BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Bhwide Class Reference

#include <Bhwide.h>

Inheritance diagram for Bhwide:

Public Member Functions

 Bhwide (const std::string &name, ISvcLocator *pSvcLocator)
StatusCode initialize ()
StatusCode execute ()
StatusCode finalize ()

Detailed Description

Definition at line 25 of file Bhwide.h.

Constructor & Destructor Documentation

◆ Bhwide()

Bhwide::Bhwide ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 100 of file Bhwide.cxx.

101 : Algorithm( name, pSvcLocator ) {
102 declareProperty( "CMEnergy", m_cmEnergy = 3.097 ); // 2*Ebeam [GeV]
103 declareProperty( "EleMinThetaAngle", m_ThMine = 22 ); // [deg]
104 declareProperty( "EleMaxThetaAngle", m_ThMaxe = 158 ); // [deg]
105 declareProperty( "PosMinThetaAngle", m_ThMinp = 22 ); // [deg]
106 declareProperty( "PosMaxThetaAngle", m_ThMaxp = 158 ); // [deg]
107 declareProperty( "EleMinEnergy", m_EnMine = 0.01 ); // [GeV]
108 declareProperty( "PosMinEnergy", m_EnMinp = 0.01 ); // [GeV]
109 declareProperty( "Acollinearity", m_Acolli = 10 ); // [deg]
110 declareProperty( "SoftPhotonCut",
111 m_infraredCut = 1E-5 ); // dimensionless, Ephoton > m_infraredCut*sqrt(s)/2
112 declareProperty( "VacuumPolarization",
113 m_keyPia =
114 3 ); // 0 - OFF, 1 - ON, Burkhardt et.al. 1989, as in BHLUMI 2.0x, 2 -
115 // ON, S. Eidelman, F. Jegerlehner, Z.Phys.C(1995), 3 - ON,
116 // Burkhardt and Pietrzyk 1995 (Moriond).
117 declareProperty( "KeyMod",
118 m_keyMod = 2 ); // type of MODEL subprogram and QED matrix element for hard
119 // bremsstrahlung: 1 - obtained by the authors (helicity
120 // amplitudes), 2 - from CALKUL, Nucl. Phys. B206 (1982) 61.
121 // Checked to be in a very good agreement!
122 declareProperty( "KeyLib", m_keyLib = 2 ); // option for ElectroWeak Corrections Library: 1 -
123 // ElectroWeak Corr. from BABAMC (obsolete), 2 -
124 // ElectroWeak Corr. from ALIBABA, RECOMMENDED
125 declareProperty( "EWC",
126 m_keyEwc = 1 ); // switching ON/OFF weak corrections: 0 - only QED
127 // corrections included (here both KeyLib =1,2 should be
128 // equivalent), 1 - all ElectroWeak Corrections included
129 m_initSeed.clear();
130 // m_initSeed.push_back(54217137); m_initSeed.push_back(0); m_initSeed.push_back(0);
131 // declareProperty("InitializedSeed", m_initSeed);
132}

Referenced by Bhwide().

Member Function Documentation

◆ execute()

StatusCode Bhwide::execute ( )

Definition at line 205 of file Bhwide.cxx.

205 {
206 MsgStream log( msgSvc(), name() );
207 log << MSG::INFO << "Bhwide executing" << endmsg;
208
209 BHWIDE( 0, xpar, npar );
210
211 if ( log.level() < MSG::INFO )
212 {
213 DUMPS( 6 );
214 // dump output to file
215 // DUMPS(16);
216 }
217
218 int npart = 0;
219
220 // Fill event information
221 GenEvent* evt = new GenEvent( 1, 1 );
222
223 GenVertex* prod_vtx = new GenVertex();
224 // prod_vtx->add_particle_out( p );
225 evt->add_vertex( prod_vtx );
226
227 // incoming beam e+
228 GenParticle* p = new GenParticle(
229 CLHEP::HepLorentzVector( MOMSET.p1[0], MOMSET.p1[1], MOMSET.p1[2], MOMSET.p1[3] ), -11,
230 3 );
231 p->suggest_barcode( ++npart );
232 prod_vtx->add_particle_in( p );
233
234 // incoming beam e-
235 p = new GenParticle(
236 CLHEP::HepLorentzVector( MOMSET.q1[0], MOMSET.q1[1], MOMSET.q1[2], MOMSET.q1[3] ), 11,
237 3 );
238 p->suggest_barcode( ++npart );
239 prod_vtx->add_particle_in( p );
240
241 // scattered e+
242 p = new GenParticle(
243 CLHEP::HepLorentzVector( MOMSET.p2[0], MOMSET.p2[1], MOMSET.p2[2], MOMSET.p2[3] ), -11,
244 1 );
245 p->suggest_barcode( ++npart );
246 prod_vtx->add_particle_out( p );
247
248 // scattered e-
249 p = new GenParticle(
250 CLHEP::HepLorentzVector( MOMSET.q2[0], MOMSET.q2[1], MOMSET.q2[2], MOMSET.q2[3] ), 11,
251 1 );
252 p->suggest_barcode( ++npart );
253 prod_vtx->add_particle_out( p );
254
255 int iphot = 0;
256 for ( iphot = 0; iphot < MOMSET.nphot; iphot++ )
257 {
258 // gamma
259 p = new GenParticle( CLHEP::HepLorentzVector( MOMSET.phot[0][iphot], MOMSET.phot[1][iphot],
260 MOMSET.phot[2][iphot],
261 MOMSET.phot[3][iphot] ),
262 22, 1 );
263 p->suggest_barcode( ++npart );
264 prod_vtx->add_particle_out( p );
265 }
266
267 if ( log.level() < MSG::INFO ) { evt->print(); }
268
269 // Check if the McCollection already exists
270 SmartDataPtr<McGenEventCol> anMcCol( eventSvc(), "/Event/Gen" );
271 if ( anMcCol != 0 )
272 {
273 // Add event to existing collection
274 MsgStream log( msgSvc(), name() );
275 log << MSG::INFO << "Add McGenEvent to existing collection" << endmsg;
276 McGenEvent* mcEvent = new McGenEvent( evt );
277 anMcCol->push_back( mcEvent );
278 }
279 else
280 {
281 // Create Collection and add to the transient store
282 McGenEventCol* mcColl = new McGenEventCol;
283 McGenEvent* mcEvent = new McGenEvent( evt );
284 mcColl->push_back( mcEvent );
285 StatusCode sc = eventSvc()->registerObject( "/Event/Gen", mcColl );
286 if ( sc != StatusCode::SUCCESS )
287 {
288 log << MSG::ERROR << "Could not register McGenEvent" << endmsg;
289 delete mcColl;
290 delete evt;
291 delete mcEvent;
292 return StatusCode::FAILURE;
293 }
294 else
295 {
296 log << MSG::INFO << "McGenEventCol created and " << npart
297 << " particles stored in McGenEvent" << endmsg;
298 }
299 }
300
301 return StatusCode::SUCCESS;
302}
#define MOMSET
Definition Babayaga.cxx:43
#define DUMPS(NOUT)
Definition Bhlumi.cxx:55
#define BHWIDE(MODE, XPAR, NPAR)
Definition Bhwide.cxx:56
ObjectVector< McGenEvent > McGenEventCol
IMessageSvc * msgSvc()

◆ finalize()

StatusCode Bhwide::finalize ( )

Definition at line 304 of file Bhwide.cxx.

304 {
305 MsgStream log( msgSvc(), name() );
306
307 BHWIDE( 2, xpar, npar );
308
309 log << MSG::INFO << "Bhwide finalized" << endmsg;
310
311 return StatusCode::SUCCESS;
312}

◆ initialize()

StatusCode Bhwide::initialize ( )

Input parameters for Bhwide

Try both options for KeyWgt, result should be the same

KeyWgt = 1 // ! weighted events


2*Ebeam [GeV]

Definition at line 134 of file Bhwide.cxx.

134 {
135
136 MsgStream log( msgSvc(), name() );
137
138 log << MSG::INFO << "Bhwide initialize" << endmsg;
139
140 static const bool CREATEIFNOTTHERE( true );
141 StatusCode RndmStatus = service( "BesRndmGenSvc", p_BesRndmGenSvc, CREATEIFNOTTHERE );
142 if ( !RndmStatus.isSuccess() || 0 == p_BesRndmGenSvc )
143 {
144 log << MSG::ERROR << " Could not initialize Random Number Service" << endmsg;
145 return RndmStatus;
146 }
147 CLHEP::HepRandomEngine* engine = p_BesRndmGenSvc->GetEngine( "Bhwide" );
148 engine->showStatus();
150
151 GLIMIT( 50000 );
152
153 //!---------------------------------------------------------------------------
154 //! Input parameters for Bhwide
155 //!----------------------------------------------------------------------
156 double WTMAX = 3.0; // ! Maximum Weight for rejection
157 double AMAZ = 91.1882; // ! Z mass
158 double GAMMZ = 2.4952; // ! Z width (may be recalculated by EW library)
159 double SINW2 = 0.22225; // ! sin^2(theta_W) (may be recalculated by EW library)
160 double AMTOP = 174.3; // ! top quark mass
161 double AMHIG = 115.0; // ! Higgs mass
162 //! Try both options for KeyWgt, result should be the same
163 int KeyWgt = 0; // ! unweighted (WT=1) events, for detector simulation
164 //! # KeyWgt = 1 // ! weighted events
165 int KeyRnd = 1; // ! RANMAR random numbers
166 int KeyCha = 0; // ! Channel choice: all/s-only/t-only: =0/1/2
167 int KeyZof = 0; // ! Z-contribution ON/OFF: =0/1
168 int KeyOpt = 1000 * KeyZof + 100 * KeyCha + 10 * KeyWgt + KeyRnd;
169 // !# KeyEWC = 0 ! QED corrections only
170 int KeyEWC = m_keyEwc; // ! Total O(alpha) ElectroWeak corr. included
171 // !# KeyLib = 1 ! ElectroWeak corrections from BABAMC (obsolete!)
172 int KeyLib = m_keyLib; // ! ElectroWeak corrections from ALIBABA
173 // !# KeyMod = 1 ! Hard bremsstr. matrix element from MODEL1
174 int KeyMod = m_keyMod; // ! Hard bremsstr. matrix alement from MODEL2
175 int KeyPia = m_keyPia; // ! Vacuum polarization option (0/1/2/3)
176 int KeyRad = 1000 * KeyEWC + 100 * KeyLib + 10 * KeyMod + KeyPia;
177
178 //!--------------------------------------
179 npar[0] = KeyOpt;
180 npar[1] = KeyRad;
181
182 xpar[0] = m_cmEnergy; //! 2*Ebeam [GeV]
183 xpar[1] = m_ThMinp;
184 xpar[2] = m_ThMaxp;
185 xpar[3] = m_ThMine;
186 xpar[4] = m_ThMaxe;
187 xpar[5] = m_EnMinp;
188 xpar[6] = m_EnMine;
189 xpar[7] = m_Acolli;
190 xpar[8] = m_infraredCut; // ! Infrared cut on photon energy
191 xpar[9] = WTMAX;
192 xpar[10] = AMAZ;
193 xpar[11] = GAMMZ;
194 xpar[12] = SINW2;
195 xpar[13] = AMTOP;
196 xpar[14] = AMHIG;
197
198 // MARINI(m_initSeed[0], m_initSeed[1], m_initSeed[2]);
199
200 BHWIDE( -1, xpar, npar );
201
202 return StatusCode::SUCCESS;
203}
#define GLIMIT(LENMX)
Definition Bhlumi.cxx:52
static void setRandomEngine(CLHEP::HepRandomEngine *randomEngine)

The documentation for this class was generated from the following files: