#include <Bhwide.h>
Public Member Functions | |
Bhwide (const std::string &name, ISvcLocator *pSvcLocator) | |
StatusCode | initialize () |
StatusCode | execute () |
StatusCode | finalize () |
Private Attributes | |
double | xpar [100] |
int | npar [100] |
double | m_cmEnergy |
double | m_infraredCut |
double | m_Acolli |
double | m_ThMine |
double | m_ThMaxe |
double | m_EnMine |
double | m_ThMinp |
double | m_ThMaxp |
double | m_EnMinp |
int | m_keyPia |
int | m_keyMod |
int | m_keyLib |
int | m_keyEwc |
IBesRndmGenSvc * | p_BesRndmGenSvc |
std::vector< int > | m_initSeed |
Definition at line 25 of file Bhwide.h.
Bhwide::Bhwide | ( | const std::string & | name, | |
ISvcLocator * | pSvcLocator | |||
) |
StatusCode Bhwide::execute | ( | ) |
Definition at line 201 of file Bhwide.cxx.
References BHWIDE, DUMPS, calibUtil::ERROR, Bes_Common::INFO, MOMSET, npar, and xpar.
00202 { 00203 MsgStream log(messageService(), name()); 00204 log << MSG::INFO << "Bhwide executing" << endreq; 00205 00206 00207 BHWIDE( 0,xpar,npar); 00208 00209 if( log.level() < MSG::INFO ) 00210 { 00211 DUMPS(6); 00212 // dump output to file 00213 // DUMPS(16); 00214 } 00215 00216 int npart = 0; 00217 00218 // Fill event information 00219 GenEvent* evt = new GenEvent(1,1); 00220 00221 GenVertex* prod_vtx = new GenVertex(); 00222 // prod_vtx->add_particle_out( p ); 00223 evt->add_vertex( prod_vtx ); 00224 00225 // incoming beam e+ 00226 GenParticle* p = new GenParticle( CLHEP::HepLorentzVector( MOMSET.p1[0], MOMSET.p1[1], 00227 MOMSET.p1[2], MOMSET.p1[3]), 00228 -11, 3); 00229 p->suggest_barcode( ++npart ); 00230 prod_vtx->add_particle_in(p); 00231 00232 // incoming beam e- 00233 p = new GenParticle( CLHEP::HepLorentzVector( MOMSET.q1[0], MOMSET.q1[1], MOMSET.q1[2], MOMSET.q1[3]), 00234 11, 3); 00235 p->suggest_barcode( ++npart ); 00236 prod_vtx->add_particle_in(p); 00237 00238 // scattered e+ 00239 p = new GenParticle( CLHEP::HepLorentzVector( MOMSET.p2[0], MOMSET.p2[1], 00240 MOMSET.p2[2], MOMSET.p2[3]), 00241 -11, 1); 00242 p->suggest_barcode( ++npart ); 00243 prod_vtx->add_particle_out(p); 00244 00245 // scattered e- 00246 p = new GenParticle( CLHEP::HepLorentzVector( MOMSET.q2[0], MOMSET.q2[1], MOMSET.q2[2], MOMSET.q2[3]), 00247 11, 1); 00248 p->suggest_barcode( ++npart ); 00249 prod_vtx->add_particle_out(p); 00250 00251 int iphot=0; 00252 for (iphot=0; iphot<MOMSET.nphot; iphot++) 00253 { 00254 // gamma 00255 p = new GenParticle( CLHEP::HepLorentzVector( MOMSET.phot[0][iphot], MOMSET.phot[1][iphot], 00256 MOMSET.phot[2][iphot], MOMSET.phot[3][iphot]), 00257 22, 1); 00258 p->suggest_barcode( ++npart ); 00259 prod_vtx->add_particle_out(p); 00260 } 00261 00262 if( log.level() < MSG::INFO ) 00263 { 00264 evt->print(); 00265 } 00266 00267 // Check if the McCollection already exists 00268 SmartDataPtr<McGenEventCol> anMcCol(eventSvc(), "/Event/Gen"); 00269 if (anMcCol!=0) 00270 { 00271 // Add event to existing collection 00272 MsgStream log(messageService(), name()); 00273 log << MSG::INFO << "Add McGenEvent to existing collection" << endreq; 00274 McGenEvent* mcEvent = new McGenEvent(evt); 00275 anMcCol->push_back(mcEvent); 00276 } 00277 else 00278 { 00279 // Create Collection and add to the transient store 00280 McGenEventCol *mcColl = new McGenEventCol; 00281 McGenEvent* mcEvent = new McGenEvent(evt); 00282 mcColl->push_back(mcEvent); 00283 StatusCode sc = eventSvc()->registerObject("/Event/Gen",mcColl); 00284 if (sc != StatusCode::SUCCESS) 00285 { 00286 log << MSG::ERROR << "Could not register McGenEvent" << endreq; 00287 delete mcColl; 00288 delete evt; 00289 delete mcEvent; 00290 return StatusCode::FAILURE; 00291 } 00292 else 00293 { 00294 log << MSG::INFO << "McGenEventCol created and " << npart <<" particles stored in McGenEvent" << endreq; 00295 } 00296 } 00297 00298 return StatusCode::SUCCESS; 00299 }
StatusCode Bhwide::finalize | ( | ) |
Definition at line 301 of file Bhwide.cxx.
References BHWIDE, Bes_Common::INFO, npar, and xpar.
00302 { 00303 MsgStream log(messageService(), name()); 00304 00305 BHWIDE( 2,xpar,npar); 00306 00307 log << MSG::INFO << "Bhwide finalized" << endreq; 00308 00309 return StatusCode::SUCCESS; 00310 }
StatusCode Bhwide::initialize | ( | ) |
Definition at line 130 of file Bhwide.cxx.
References BHWIDE, calibUtil::ERROR, IBesRndmGenSvc::GetEngine(), GLIMIT, Bes_Common::INFO, m_Acolli, m_cmEnergy, m_EnMine, m_EnMinp, m_infraredCut, m_keyEwc, m_keyLib, m_keyMod, m_keyPia, m_ThMaxe, m_ThMaxp, m_ThMine, m_ThMinp, npar, p_BesRndmGenSvc, BhwideRandom::setRandomEngine(), and xpar.
00130 { 00131 00132 MsgStream log(messageService(), name()); 00133 00134 log << MSG::INFO << "Bhwide initialize" << endreq; 00135 00136 static const bool CREATEIFNOTTHERE(true); 00137 StatusCode RndmStatus = service("BesRndmGenSvc", p_BesRndmGenSvc, CREATEIFNOTTHERE); 00138 if (!RndmStatus.isSuccess() || 0 == p_BesRndmGenSvc) 00139 { 00140 log << MSG::ERROR << " Could not initialize Random Number Service" << endreq; 00141 return RndmStatus; 00142 } 00143 CLHEP::HepRandomEngine* engine = p_BesRndmGenSvc->GetEngine("Bhwide"); 00144 engine->showStatus(); 00145 BhwideRandom::setRandomEngine(engine); 00146 00147 GLIMIT(50000); 00148 00152 double WTMAX = 3.0; // ! Maximum Weight for rejection 00153 double AMAZ = 91.1882; // ! Z mass 00154 double GAMMZ = 2.4952; // ! Z width (may be recalculated by EW library) 00155 double SINW2 = 0.22225; // ! sin^2(theta_W) (may be recalculated by EW library) 00156 double AMTOP = 174.3; // ! top quark mass 00157 double AMHIG = 115.0; // ! Higgs mass 00159 int KeyWgt = 0; // ! unweighted (WT=1) events, for detector simulation 00161 int KeyRnd = 1; // ! RANMAR random numbers 00162 int KeyCha = 0; // ! Channel choice: all/s-only/t-only: =0/1/2 00163 int KeyZof = 0; // ! Z-contribution ON/OFF: =0/1 00164 int KeyOpt = 1000*KeyZof +100*KeyCha +10*KeyWgt + KeyRnd; 00165 // !# KeyEWC = 0 ! QED corrections only 00166 int KeyEWC = m_keyEwc; // ! Total O(alpha) ElectroWeak corr. included 00167 // !# KeyLib = 1 ! ElectroWeak corrections from BABAMC (obsolete!) 00168 int KeyLib = m_keyLib; // ! ElectroWeak corrections from ALIBABA 00169 // !# KeyMod = 1 ! Hard bremsstr. matrix element from MODEL1 00170 int KeyMod = m_keyMod; // ! Hard bremsstr. matrix alement from MODEL2 00171 int KeyPia = m_keyPia; // ! Vacuum polarization option (0/1/2/3) 00172 int KeyRad = 1000*KeyEWC + 100*KeyLib + 10*KeyMod + KeyPia; 00173 00175 npar[0]= KeyOpt; 00176 npar[1]= KeyRad; 00177 00178 xpar[0] = m_cmEnergy; 00179 xpar[1] = m_ThMinp; 00180 xpar[2] = m_ThMaxp; 00181 xpar[3] = m_ThMine; 00182 xpar[4] = m_ThMaxe; 00183 xpar[5] = m_EnMinp; 00184 xpar[6] = m_EnMine; 00185 xpar[7] = m_Acolli; 00186 xpar[8] = m_infraredCut; // ! Infrared cut on photon energy 00187 xpar[9] = WTMAX; 00188 xpar[10] = AMAZ; 00189 xpar[11] = GAMMZ; 00190 xpar[12] = SINW2; 00191 xpar[13] = AMTOP; 00192 xpar[14] = AMHIG; 00193 00194 //MARINI(m_initSeed[0], m_initSeed[1], m_initSeed[2]); 00195 00196 BHWIDE(-1,xpar,npar); 00197 00198 return StatusCode::SUCCESS; 00199 }
double Bhwide::m_Acolli [private] |
double Bhwide::m_cmEnergy [private] |
double Bhwide::m_EnMine [private] |
double Bhwide::m_EnMinp [private] |
double Bhwide::m_infraredCut [private] |
std::vector<int> Bhwide::m_initSeed [private] |
int Bhwide::m_keyEwc [private] |
int Bhwide::m_keyLib [private] |
int Bhwide::m_keyMod [private] |
int Bhwide::m_keyPia [private] |
double Bhwide::m_ThMaxe [private] |
double Bhwide::m_ThMaxp [private] |
double Bhwide::m_ThMine [private] |
double Bhwide::m_ThMinp [private] |
int Bhwide::npar[100] [private] |
IBesRndmGenSvc* Bhwide::p_BesRndmGenSvc [private] |
double Bhwide::xpar[100] [private] |