BOSS 7.0.8
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 110 of file Bhwide.cxx.

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

Member Function Documentation

◆ execute()

StatusCode Bhwide::execute ( )

Definition at line 201 of file Bhwide.cxx.

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

◆ finalize()

StatusCode Bhwide::finalize ( )

Definition at line 301 of file Bhwide.cxx.

302{
303 MsgStream log(messageService(), name());
304
305 BHWIDE( 2,xpar,npar);
306
307 log << MSG::INFO << "Bhwide finalized" << endreq;
308
309 return StatusCode::SUCCESS;
310}

◆ 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 130 of file Bhwide.cxx.

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

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