76 declareProperty(
"Channel", m_ch = 0);
77 declareProperty(
"Verbose", m_iverbose = 0);
78 declareProperty(
"Nsearch", m_nsearch = 4000000);
79 declareProperty(
"RunningAlpha", m_arun = 0);
80 declareProperty(
"VPparam", m_iteubn = 0);
81 declareProperty(
"PhotonNumber", m_photmode = -1);
82 declareProperty(
"Precision", m_precision = 0);
84 declareProperty(
"CMSEnergy", m_ecmsinput = 3.686);
85 declareProperty(
"BeamEnergySpread", m_beamspread = 0.0013);
87 declareProperty(
"ThetaMin", m_thmin = 10);
88 declareProperty(
"ThetaMax", m_thmax = 170);
89 declareProperty(
"AcollMax", m_zmax = 180.0);
90 declareProperty(
"Emin", m_emin = 0.001);
91 declareProperty(
"MinInvMass", m_Minv_min = 0.0);
92 declareProperty(
"MaxInvMass", m_Minv_max = -1.0);
94 declareProperty(
"MaximumVal", m_sdif_max = 1.e-18);
95 declareProperty(
"ScaleVPerr", m_scale_vperr = 0.0);
98 declareProperty(
"UseWeightedEv", m_weighted = 0);
100 declareProperty(
"DarkMode", m_darkmode = 0);
101 declareProperty(
"DarkMass", m_DarkMass = 0.4);
102 declareProperty(
"DarkWidth", m_DarkWidth = -1.0);
103 declareProperty(
"DarkVectorCoupling", m_DarkVec = 1.e-3);
104 declareProperty(
"DarkAxialCoupling" , m_DarkAxial = 0);
106 std::string path =
"./";
107 if (getenv(
"BABAYAGANLOROOT")!=
NULL){
108 path = getenv(
"BABAYAGANLOROOT");
111 path.append(
"vpol_novosibirsk.dat");
112 declareProperty(
"NskFilePath" , m_nsk_filepath = path);
121 MsgStream log(
msgSvc(), name());
122 log << MSG::DEBUG <<
"BabayagaNLO in initialize()" << endreq;
125 static const bool CREATEIFNOTTHERE(
true);
126 StatusCode RndmStatus = service(
"BesRndmGenSvc", p_BesRndmGenSvc, CREATEIFNOTTHERE);
127 if (!RndmStatus.isSuccess() || 0 == p_BesRndmGenSvc)
129 log << MSG::ERROR <<
" Could not initialize Random Number Service" << endreq;
132 CLHEP::HepRandomEngine* engine = p_BesRndmGenSvc->GetEngine(
"BabayagaNLO");
140 xpari[kChannel]=m_ch;
141 xpari[kVerbose]=m_iverbose;
142 xpari[kNsearch]=m_nsearch;
143 xpari[kAlphaRun]=m_arun;
144 xpari[kPhMode]=m_photmode;
145 xpari[kModelVP]=m_iteubn;
146 xpari[kPrecision]=m_precision;
147 xpari[kUseWeighted]=m_weighted;
148 xpari[kDarkMode]=m_darkmode;
150 xpard[kEcm]=m_ecmsinput;
151 xpard[kEspread]=m_beamspread;
152 xpard[kCutTh0]=m_thmin;
153 xpard[kCutTh1]=m_thmax;
154 xpard[kCutAColl]=m_zmax;
155 xpard[kCutEmin]=m_emin;
156 xpard[kCutInvMass0]=m_Minv_min;
157 xpard[kCutInvMass1]=m_Minv_max;
158 xpard[kDarkMass]=m_DarkMass;
159 xpard[kDarkWidth]=m_DarkWidth;
160 xpard[kDarkVec]=m_DarkVec;
161 xpard[kDarkAx]=m_DarkAxial;
162 xpard[kMaxSdif]=m_sdif_max;
163 xpard[kScaleVPerr]=m_scale_vperr;
165 using namespace boost::filesystem;
166 path p_nskfile (m_nsk_filepath.data());
167 if (!exists(p_nskfile) && m_arun>0 && m_iteubn==2){
168 log <<MSG::FATAL<<
"Cannot find Novosibirsk VP file ("<<p_nskfile.native()<<
")!\n Is the environment variable BABAYAGANLOROOT set?"<<endreq;
169 return StatusCode::FAILURE;
172 m_nsk_filepath = p_nskfile.native();
173 strcpy(
vpcnskf_.nskfilepath,m_nsk_filepath.data());
179 log <<MSG::DEBUG<<
"Finish BabayagaNLO initialize()" <<endreq;
180 return StatusCode::SUCCESS;
184 MsgStream log(
msgSvc(), name());
185 log << MSG::DEBUG <<
"BabayagaNLO in execute()" << endreq;
188 GenEvent* evt =
new GenEvent(1,1);
189 GenVertex* prod_vtx =
new GenVertex();
190 evt->add_vertex( prod_vtx );
192 log << MSG::DEBUG <<
"check point 1" << endreq;
193 bool unw = !(m_weighted);
195 log << MSG::DEBUG <<
"check point 2" << endreq;
198 log << MSG::DEBUG <<
"check point 3" << endreq;
199 int finalpidm,finalpidp;
203 }
else if (m_ch == 1) {
206 }
else if (m_ch == 2) {
221 GenParticle *p =
new GenParticle(CLHEP::HepLorentzVector(
p1[1],
p1[2],-
p1[3],
p1[0]), 11, 3);
222 p->suggest_barcode(1);
223 prod_vtx->add_particle_in(p);
226 p =
new GenParticle(CLHEP::HepLorentzVector(
p2[1],
p2[2],-
p2[3],
p2[0]), -11, 3);
227 p->suggest_barcode(2);
228 prod_vtx->add_particle_in(p);
230 log << MSG::DEBUG <<
"check point 4" << endreq;
232 p =
new GenParticle(CLHEP::HepLorentzVector(
p3[1],
p3[2],-
p3[3],
p3[0]), finalpidm, 1);
233 p->suggest_barcode(3);
234 prod_vtx->add_particle_out(p);
237 p =
new GenParticle(CLHEP::HepLorentzVector(
p4[1],
p4[2],-
p4[3],
p4[0]), finalpidp, 1);
238 p->suggest_barcode(4);
239 prod_vtx->add_particle_out(p);
241 log << MSG::DEBUG <<
"check point 5" << endreq;
249 p =
new GenParticle(CLHEP::HepLorentzVector(px,py,pz,eph), 22, 1);
250 p->suggest_barcode(id_cntr);
251 prod_vtx->add_particle_out(p);
255 log << MSG::DEBUG <<
"check point 6" << endreq;
257 p =
new GenParticle(CLHEP::HepLorentzVector(0,0,0,
weights_.sdif), 99, 1);
258 p->suggest_barcode(id_cntr);
259 prod_vtx->add_particle_out(p);
263 if( log.level() <= MSG::DEBUG ){
268 SmartDataPtr<McGenEventCol> anMcCol(eventSvc(),
"/Event/Gen");
271 log<<MSG::WARNING<<
"add event"<<endreq;
272 MsgStream log(messageService(), name());
273 log << MSG::INFO <<
"Add McGenEvent to existing collection" << endreq;
275 anMcCol->push_back(mcEvent);
278 log<<MSG::WARNING<<
"create collection"<<endreq;
281 mcColl->push_back(mcEvent);
282 StatusCode sc = eventSvc()->registerObject(
"/Event/Gen",mcColl);
283 if (sc != StatusCode::SUCCESS) {
284 log << MSG::ERROR <<
"Could not register McGenEvent" << endreq;
288 return StatusCode::FAILURE;
290 log << MSG::INFO <<
"McGenEventCol created!" << endreq;
295 log<<MSG::DEBUG<<
"before execute() return"<<endreq;
296 return StatusCode::SUCCESS;