75 declareProperty(
"Channel", m_ch = 0);
76 declareProperty(
"Verbose", m_iverbose = 0);
77 declareProperty(
"Nsearch", m_nsearch = 4000000);
78 declareProperty(
"RunningAlpha", m_arun = 0);
79 declareProperty(
"VPparam", m_iteubn = 0);
80 declareProperty(
"PhotonNumber", m_photmode = -1);
81 declareProperty(
"Precision", m_precision = 0);
83 declareProperty(
"CMSEnergy", m_ecmsinput = 3.686);
84 declareProperty(
"BeamEnergySpread", m_beamspread = 0.0013);
86 declareProperty(
"ThetaMin", m_thmin = 10);
87 declareProperty(
"ThetaMax", m_thmax = 170);
88 declareProperty(
"AcollMax", m_zmax = 180.0);
89 declareProperty(
"Emin",
m_emin = 0.001);
90 declareProperty(
"MinInvMass", m_Minv_min = 0.0);
91 declareProperty(
"MaxInvMass", m_Minv_max = -1.0);
93 declareProperty(
"MaximumVal", m_sdif_max = 1.e-18);
94 declareProperty(
"ScaleVPerr", m_scale_vperr = 0.0);
97 declareProperty(
"UseWeightedEv", m_weighted = 0);
99 declareProperty(
"DarkMode", m_darkmode = 0);
100 declareProperty(
"DarkMass", m_DarkMass = 0.4);
101 declareProperty(
"DarkWidth", m_DarkWidth = -1.0);
102 declareProperty(
"DarkVectorCoupling", m_DarkVec = 1.e-3);
103 declareProperty(
"DarkAxialCoupling" , m_DarkAxial = 0);
105 std::string path = getenv(
"BABAYAGANLOROOT");
106 path.append(
"/share/vpol_novosibirsk.dat");
107 declareProperty(
"NskFilePath" , m_nsk_filepath = path);
116 MsgStream log(
msgSvc(), name());
117 log << MSG::DEBUG <<
"BabayagaNLO in initialize()" << endreq;
120 static const bool CREATEIFNOTTHERE(
true);
121 StatusCode RndmStatus = service(
"BesRndmGenSvc", p_BesRndmGenSvc, CREATEIFNOTTHERE);
122 if (!RndmStatus.isSuccess() || 0 == p_BesRndmGenSvc)
124 log << MSG::ERROR <<
" Could not initialize Random Number Service" << endreq;
127 CLHEP::HepRandomEngine* engine = p_BesRndmGenSvc->
GetEngine(
"BabayagaNLO");
135 xpari[kChannel]=m_ch;
136 xpari[kVerbose]=m_iverbose;
137 xpari[kNsearch]=m_nsearch;
138 xpari[kAlphaRun]=m_arun;
139 xpari[kPhMode]=m_photmode;
140 xpari[kModelVP]=m_iteubn;
141 xpari[kPrecision]=m_precision;
142 xpari[kUseWeighted]=m_weighted;
143 xpari[kDarkMode]=m_darkmode;
145 xpard[kEcm]=m_ecmsinput;
146 xpard[kEspread]=m_beamspread;
147 xpard[kCutTh0]=m_thmin;
148 xpard[kCutTh1]=m_thmax;
149 xpard[kCutAColl]=m_zmax;
150 xpard[kCutEmin]=m_emin;
151 xpard[kCutInvMass0]=m_Minv_min;
152 xpard[kCutInvMass1]=m_Minv_max;
153 xpard[kDarkMass]=m_DarkMass;
154 xpard[kDarkWidth]=m_DarkWidth;
155 xpard[kDarkVec]=m_DarkVec;
156 xpard[kDarkAx]=m_DarkAxial;
157 xpard[kMaxSdif]=m_sdif_max;
158 xpard[kScaleVPerr]=m_scale_vperr;
160 using namespace boost::filesystem;
161 path p_nskfile (m_nsk_filepath.data());
167 m_nsk_filepath = p_nskfile.native();
168 strcpy(
vpcnskf_.nskfilepath,m_nsk_filepath.data());
183 log <<MSG::DEBUG<<
"Finish BabayagaNLO initialize()" <<endreq;
184 return StatusCode::SUCCESS;
188 MsgStream log(
msgSvc(), name());
189 log << MSG::DEBUG <<
"BabayagaNLO in execute()" << endreq;
192 GenEvent* evt =
new GenEvent(1,1);
193 GenVertex* prod_vtx =
new GenVertex();
194 evt->add_vertex( prod_vtx );
196 log << MSG::DEBUG <<
"check point 1" << endreq;
197 bool unw = !(m_weighted);
199 log << MSG::DEBUG <<
"check point 2" << endreq;
202 log << MSG::DEBUG <<
"check point 3" << endreq;
203 int finalpidm,finalpidp;
207 }
else if (m_ch == 1) {
210 }
else if (m_ch == 2) {
225 GenParticle *p =
new GenParticle(CLHEP::HepLorentzVector(
p1[1],
p1[2],-
p1[3],
p1[0]), 11, 1);
226 p->suggest_barcode(3);
227 prod_vtx->add_particle_in(p);
230 p =
new GenParticle(CLHEP::HepLorentzVector(
p2[1],
p2[2],-
p2[3],
p2[0]), -11, 1);
231 p->suggest_barcode(4);
232 prod_vtx->add_particle_in(p);
234 log << MSG::DEBUG <<
"check point 4" << endreq;
236 p =
new GenParticle(CLHEP::HepLorentzVector(
p3[1],
p3[2],-
p3[3],
p3[0]), finalpidm, 1);
237 p->suggest_barcode(3);
238 prod_vtx->add_particle_out(p);
241 p =
new GenParticle(CLHEP::HepLorentzVector(
p4[1],
p4[2],-
p4[3],
p4[0]), finalpidp, 1);
242 p->suggest_barcode(4);
243 prod_vtx->add_particle_out(p);
245 log << MSG::DEBUG <<
"check point 5" << endreq;
253 p =
new GenParticle(CLHEP::HepLorentzVector(px,py,pz,eph), 22, 1);
254 p->suggest_barcode(id_cntr);
255 prod_vtx->add_particle_out(p);
259 log << MSG::DEBUG <<
"check point 6" << endreq;
261 p =
new GenParticle(CLHEP::HepLorentzVector(0,0,0,
weights_.sdif), 99, 1);
262 p->suggest_barcode(id_cntr);
263 prod_vtx->add_particle_out(p);
267 if( log.level() <= MSG::DEBUG ){
272 SmartDataPtr<McGenEventCol> anMcCol(eventSvc(),
"/Event/Gen");
275 log<<MSG::WARNING<<
"add event"<<endreq;
276 MsgStream log(messageService(), name());
277 log << MSG::INFO <<
"Add McGenEvent to existing collection" << endreq;
279 anMcCol->push_back(mcEvent);
282 log<<MSG::WARNING<<
"create collection"<<endreq;
285 mcColl->push_back(mcEvent);
286 StatusCode sc = eventSvc()->registerObject(
"/Event/Gen",mcColl);
287 if (sc != StatusCode::SUCCESS) {
288 log << MSG::ERROR <<
"Could not register McGenEvent" << endreq;
292 return StatusCode::FAILURE;
294 log << MSG::INFO <<
"McGenEventCol created!" << endreq;
299 log<<MSG::DEBUG<<
"before execute() return"<<endreq;
300 return StatusCode::SUCCESS;