19#include "GaudiKernel/MsgStream.h"
20#include "GaudiKernel/AlgFactory.h"
21#include "GaudiKernel/ISvcLocator.h"
22#include "GaudiKernel/SmartDataPtr.h"
23#include "GaudiKernel/IDataProviderSvc.h"
24#include "GaudiKernel/PropertyMgr.h"
25#include "GaudiKernel/Bootstrap.h"
26#include "GaudiKernel/RegistryEntry.h"
31#include "HepPDT/ParticleDataTable.hh"
32#include "HepPDT/ParticleData.hh"
34#include "GaudiKernel/IPartPropSvc.h"
49#include "CLHEP/Random/RandFlat.h"
50#include "CLHEP/Matrix/Vector.h"
51#include "CLHEP/Matrix/Matrix.h"
52#include "CLHEP/Matrix/SymMatrix.h"
53#include "CLHEP/Vector/ThreeVector.h"
54#include "CLHEP/Vector/LorentzVector.h"
55#include "CLHEP/Vector/TwoVector.h"
56using CLHEP::HepVector;
57using CLHEP::Hep3Vector;
58using CLHEP::Hep2Vector;
59using CLHEP::HepLorentzVector;
72const double xmk0 = 0.49761;
74const double xmd0 = 1.86484;
76const double PI = 3.1415926;
80static const int kPsi3770ID = 30443 ;
81static const int kD0ID = 421 ;
82static const int kD0BarID = -421 ;
83static const int kDpID = 411 ;
84static const int kDmID = -411 ;
85static const int kGammaID = 22 ;
86static const int kGammaFSRID = -22 ;
87static const int kPiPlusID = 211 ;
88static const int kPiMinusID = -211 ;
89static const int kPi0ID = 111 ;
90static const int kEtaID = 221 ;
91static const int kEtaPrimeID = 331 ;
92static const int kF0ID = 9010221;
93static const int kFPrime0ID = 10221 ;
94static const int kF0m1500ID = 50221;
95static const int kF2ID = 225;
96static const int kA00ID = 10111 ;
97static const int kA0PlusID = 10211 ;
98static const int kA0MinusID = -10211 ;
99static const int kRhoPlusID = 213 ;
100static const int kRhoMinusID = -213 ;
101static const int kRho0ID = 113 ;
102static const int kRho2SPlusID = 30213 ;
103static const int kRho2SMinusID = -30213 ;
104static const int kRho2S0ID = 30113 ;
105static const int kA1PlusID = 20213 ;
106static const int kA1MinusID = -20213 ;
107static const int kA10ID = 20113 ;
108static const int kOmegaID = 223 ;
109static const int kPhiID = 333 ;
110static const int kKPlusID = 321 ;
111static const int kKMinusID = -321 ;
112static const int kK0SID = 310 ;
113static const int kK0LID = 130 ;
114static const int kK0ID = 311 ;
115static const int kK0BarID = -311 ;
116static const int kKStarPlusID = 323 ;
117static const int kKStarMinusID = -323 ;
118static const int kKStar0ID = 313 ;
119static const int kKStar0BarID = -313 ;
120static const int kKDPStar0ID = 30313 ;
121static const int kKDPStar0BarID = -30313 ;
122static const int kK0Star0ID = 10311;
123static const int kK0Star0BarID = -10311;
124static const int kK0StarPlusID = 10321;
125static const int kK0StarMinusID = -10321;
126static const int kK1PlusID = 10323 ;
127static const int kK1MinusID = -10323 ;
128static const int kK10ID = 10313 ;
129static const int kK10BarID = -10313 ;
130static const int kK1PrimePlusID = 20323 ;
131static const int kK1PrimeMinusID = -20323 ;
132static const int kK1Prime0ID = 20313 ;
133static const int kK1Prime0BarID = -20313 ;
134static const int kK2StarPlusID = 325 ;
135static const int kK2StarMinusID = -325 ;
136static const int kK2Star0ID = 315 ;
137static const int kK2Star0BarID = -315 ;
138static const int kEMinusID = 11 ;
139static const int kEPlusID = -11 ;
140static const int kMuMinusID = 13 ;
141static const int kMuPlusID = -13 ;
142static const int kNuEID = 12 ;
143static const int kNuEBarID = -12 ;
144static const int kNuMuID = 14 ;
145static const int kNuMuBarID = -14 ;
148static const int kFlavoredCF_0 = 0;
149static const int kFlavoredCFBar_0 = 1;
150static const int kFlavoredCF_1 = 2;
151static const int kFlavoredCFBar_1 = 3;
152static const int kFlavoredCF_3 = 4;
153static const int kFlavoredCFBar_3 = 5;
154static const int kFlavoredCS = 6;
155static const int kFlavoredCSBar = 7;
156static const int kSLPlus = 8;
157static const int kSLMinus = 9;
158static const int kCPPlus = 10;
159static const int kCPMinus = 11;
160static const int kDalitz = 12;
161static const int k2Pip2Pim = 13;
162static const int kPipPim2Pi0 = 14;
163static const int kK0PiPiPi0 = 15;
164static const int kKKPiPi = 16;
165static const int kNDecayTypes = 17;
236 Algorithm(name, pSvcLocator){
238 declareProperty(
"Debug",
m_debug=
true );
239 declareProperty(
"x",
m_x= 0.00407);
240 declareProperty(
"y",
m_y= 0.00647);
242 declareProperty(
"rForCFModes", m_rCF= 0.0621);
243 declareProperty(
"zForCFModes", m_zCF= 2.0);
244 declareProperty(
"wSignForCFModes", m_wCFSign=
true);
245 declareProperty(
"rForCFMode_0", m_rCF_0= 0.0587);
246 declareProperty(
"RForCFMode_0", m_RCF_0= 1.);
247 declareProperty(
"zForCFMode_0", m_zCF_0= 1.9585);
248 declareProperty(
"dForCFMode_0", m_dCF_0= 191.7*3.14159/180.);
249 declareProperty(
"wSignForCFMode_0", m_wCFSign_0 =
true);
250 declareProperty(
"rForCFModes_1", m_rCF_1= 0.044);
251 declareProperty(
"RForCFMode_1", m_RCF_1= 0.79);
252 declareProperty(
"zForCFModes_1", m_zCF_1= 1.9225);
253 declareProperty(
"dForCFMode_1", m_dCF_1= 196.*3.14159/180.);
254 declareProperty(
"wSignForCFModes_1", m_wCFSign_1=
true);
255 declareProperty(
"rForCFModes_3", m_rCF_3= 0.0549);
256 declareProperty(
"RForCFMode_3", m_RCF_3= 0.43);
257 declareProperty(
"zForCFModes_3", m_zCF_3= 1.2313);
258 declareProperty(
"dForCFMode_3", m_dCF_3= 161.*3.14159/180.);
259 declareProperty(
"wSignForCFModes_3", m_wCFSign_3=
true);
261 declareProperty(
"rForCSModes", m_rCS= 1.0);
262 declareProperty(
"zForCSModes", m_zCS= -2.0);
263 declareProperty(
"wSignForCSModes", m_wCSSign=
true);
264 declareProperty(
"DplusDminusWeight", m_dplusDminusWeight= 0.5);
265 declareProperty(
"dalitzModel", m_dalitzModel= 0);
266 declareProperty(
"UseNewWeights", m_useNewWeights=
true);
267 declareProperty(
"InvertSelection", m_invertSelection=
false);
273 MsgStream log(
msgSvc(), name());
275 log << MSG::INFO <<
"in initialize()" << endmsg;
278 IPartPropSvc* p_PartPropSvc;
279 static const bool CREATEIFNOTTHERE(
true);
280 StatusCode PartPropStatus = service(
"PartPropSvc", p_PartPropSvc, CREATEIFNOTTHERE);
281 if (!PartPropStatus.isSuccess() || 0 == p_PartPropSvc)
283 log << MSG::ERROR <<
" Could not initialize Particle Properties Service" << endmsg;
284 return PartPropStatus;
286 m_particleTable = p_PartPropSvc->PDT();
299 double rCF_0 = m_rCF_0 ;
300 double dCF_0 = m_dCF_0 ;
301 double RCF_0 = m_RCF_0 ;
303 double zCF_0 = 2*
cos(dCF_0) ;
304 double rCF2_0 = rCF_0 * rCF_0 ;
305 double zCF2_0 = zCF_0 * zCF_0 ;
306 double rCF_1 = m_rCF_1 ;
307 double dCF_1 = m_dCF_1 ;
308 double RCF_1 = m_RCF_1 ;
310 double zCF_1 = 2*
cos(dCF_1) ;
311 double rCF2_1 = rCF_1 * rCF_1 ;
312 double zCF2_1 = zCF_1 * zCF_1 ;
313 double rCF_3 = m_rCF_3 ;
314 double dCF_3 = m_dCF_3 ;
315 double RCF_3 = m_RCF_3 ;
317 double zCF_3 = 2*
cos(dCF_3) ;
318 double rCF2_3 = rCF_3 * rCF_3 ;
319 double zCF2_3 = zCF_3 * zCF_3 ;
322 double rCS2 = rCS * rCS ;
323 double zCS2 = zCS * zCS ;
325 double rmix = (
x *
x +
y *
y ) / 2. ;
326 double wCF_0 = 2*
cos(dCF_0) ;
327 double wCF_1 = 2*
cos(dCF_1) ;
328 double wCF_3 = 2*
cos(dCF_3) ;
329 double wCS = ( m_wCSSign ? 1. : -1. ) * sqrt( 4. - zCS2 ) ;
330 double vCF_0CSPlus = ( zCF_0 * zCS + wCF_0 * wCS ) / 2. ;
331 double vCF_1CSPlus = ( zCF_1 * zCS + wCF_1 * wCS ) / 2. ;
332 double vCF_3CSPlus = ( zCF_3 * zCS + wCF_3 * wCS ) / 2. ;
333 double vCF_0CSMinus = ( zCF_0 * zCS - wCF_0 * wCS ) / 2. ;
334 double vCF_1CSMinus = ( zCF_1 * zCS - wCF_1 * wCS ) / 2. ;
335 double vCF_3CSMinus = ( zCF_3 * zCS - wCF_3 * wCS ) / 2. ;
337 m_deltaCF_0 = acos( zCF_0 / 2. ) * ( m_wCFSign_0 ? 1. : -1. ) ;
338 m_deltaCF_1 = acos( zCF_1 / 2. ) * ( m_wCFSign_1 ? 1. : -1. ) ;
339 m_deltaCF_3 = acos( zCF_3 / 2. ) * ( m_wCFSign_3 ? 1. : -1. ) ;
340 m_deltaCS = acos( zCS / 2. ) * ( m_wCSSign ? 1. : -1. ) ;
344 double rCF2 = rCF * rCF ;
345 double zCF2 = zCF * zCF ;
346 double wCF = ( m_wCFSign ? 1. : -1. ) * sqrt( 4. - zCF2 ) ;
347 double vCFCSPlus = ( zCF * zCS + wCF * wCS ) / 2. ;
348 double vCFCSMinus = ( zCF * zCS - wCF * wCS ) / 2. ;
349 m_deltaCF = acos( zCF / 2. ) * ( m_wCFSign ? 1. : -1. ) ;
351 double bCF_0 = 1. + 0.5 * rCF_0 * ( zCF_0 *
y + wCF_0 *
x ) + 0.5 * (
y *
y -
x *
x );
352 double bCF_1 = 1. + 0.5 * rCF_1 * ( zCF_1 *
y + wCF_1 *
x ) + 0.5 * (
y *
y -
x *
x );
353 double bCF_3 = 1. + 0.5 * rCF_3 * ( zCF_3 *
y + wCF_3 *
x ) + 0.5 * (
y *
y -
x *
x );
354 double bCS = 1. + 0.5 * rCS * ( zCS *
y + wCS *
x ) + 0.5 * (
y *
y -
x *
x );
355 double bCPPlus = 1. -
y ;
356 double bCPMinus = 1. +
y ;
358 if( !m_useNewWeights )
372 m_rwsCF_0 = ( rCF2_0 + 0.5 * rCF_0 * ( zCF_0 *
y - wCF_0 *
x ) + rmix ) / bCF_0;
373 m_rwsCF_1 = ( rCF2_1 + 0.5 * rCF_1 * ( zCF_1 *
y - wCF_1 *
x ) + rmix ) / bCF_1;
374 m_rwsCF_3 = ( rCF2_3 + 0.5 * rCF_3 * ( zCF_3 *
y - wCF_3 *
x ) + rmix ) / bCF_3;
375 m_rwsCS = ( rCS2 + 0.5 * rCS * ( zCS *
y - wCS *
x ) + rmix ) / bCS;
377 double bfCF_0 = ( 1. - RCF_0 * rCF_0 * ( 0.5*zCF_0*
y + 0.5*wCF_0*
x ) + 0.5 * ( -1*
x*
x +
y*
y) );
378 double bfCF_1 = ( 1. - RCF_1 * rCF_1 * ( 0.5*zCF_1*
y + 0.5*wCF_1*
x ) + 0.5 * ( -1*
x*
x +
y*
y) );
379 double bfCF_3 = ( 1. - RCF_3 * rCF_3 * ( 0.5*zCF_3*
y + 0.5*wCF_3*
x ) + 0.5 * ( -1*
x*
x +
y*
y) );
380 double bfCFbar_0 = ( rCF2_0 - RCF_0 * rCF_0 * ( 0.5*zCF_0*
y - 0.5*wCF_0*
x ) + 0.5 * (
x*
x +
y*
y) );
381 double bfCFbar_1 = ( rCF2_1 - RCF_1 * rCF_1 * ( 0.5*zCF_1*
y - 0.5*wCF_1*
x ) + 0.5 * (
x*
x +
y*
y) );
382 double bfCFbar_3 = ( rCF2_3 - RCF_3 * rCF_3 * ( 0.5*zCF_3*
y - 0.5*wCF_3*
x ) + 0.5 * (
x*
x +
y*
y) );
405 m_weights[ kFlavoredCF_0 ][ kFlavoredCF_0 ] = ( ( 1 - RCF_0 * RCF_0 ) / ( 1 - RCF_0 * (1./rCF_0) * (0.5*zCF_0*
y - 0.5*wCF_0*
x) + rmix/(2*rCF2_0) ) ) ;
406 m_weights[ kFlavoredCF_0 ][ kFlavoredCFBar_0 ] = ( 1. + rCF2_0 * rCF2_0 - 2. * RCF_0 * RCF_0 * rCF2_0 ) / ( bfCF_0 * bfCF_0 );
407 m_weights[ kFlavoredCF_0 ][ kFlavoredCF_1 ] = ( 1. + ( rCF2_0 / rCF2_1 ) * ( rCF2_0 / rCF2_1 ) - 2. * ( rCF2_0 / rCF2_1 ) * RCF_0 * RCF_1 *
cos( dCF_0 - dCF_1 ) ) / ( 1. + ( rCF2_0 / rCF2_1 ) * ( rCF2_0 / rCF2_1 ) - RCF_1 * (1./rCF_1) * ( 0.5*zCF_1*
y - 0.5*wCF_1*
x ) - (RCF_0*rCF_1/(rCF_0*rCF_0)) * ( 0.5*zCF_0*
y - 0.5*wCF_0*
x ) + rmix/(rCF_0*rCF_0) );
408 cout<<( 1. + ( rCF2_0 / rCF2_1 ) * ( rCF2_0 / rCF2_1 ) - RCF_1 * (1./rCF_1) * ( 0.5*zCF_1*
y - 0.5*wCF_1*
x ) - (RCF_0*rCF_1/(rCF_0*rCF_0)) * ( 0.5*zCF_0*
y - 0.5*wCF_0*
x ) + rmix/(rCF_0*rCF_0) )<<endl;
409 m_weights[ kFlavoredCF_0 ][ kFlavoredCFBar_1 ] = ( 1. + rCF2_0 * rCF2_1 - 2. * RCF_0 * RCF_1 * rCF_0 * rCF_1 ) / ( bfCF_0 * bfCF_1 );
410 m_weights[ kFlavoredCF_0 ][ kFlavoredCF_3 ] = ( 1. + ( rCF2_0 / rCF2_3 ) * ( rCF2_0 / rCF2_3 ) - 2. * ( rCF2_0 / rCF2_3 ) * RCF_0 * RCF_3 *
cos( dCF_0 - dCF_3 ) ) / ( 1. + ( rCF2_0 / rCF2_3 ) * ( rCF2_0 / rCF2_3 ) - RCF_3 * (1./rCF_3) * ( 0.5*zCF_3*
y - 0.5*wCF_3*
x ) - (RCF_0/(rCF_0*rCF_0)) * ( 0.5*zCF_0*
y - 0.5*wCF_0*
x ) + rmix/(rCF_0*rCF_0) );
411 m_weights[ kFlavoredCF_0 ][ kFlavoredCFBar_3 ] = ( 1. + rCF2_0 * rCF2_3 - 2. * RCF_0 * RCF_3 * rCF_0 * rCF_3 ) / ( bfCF_0 * bfCF_3 );
412 m_weights[ kFlavoredCF_0 ][ kFlavoredCSBar ] =
413 1. + rCF2_0 * rCS2 - rCF_0 * rCS * vCFCSMinus ;
414 m_weights[ kFlavoredCF_0 ][ kFlavoredCS ] =
415 rCF2_0 + rCS2 - rCF_0 * rCS * vCF_0CSPlus +
416 rmix *
m_weights[ kFlavoredCF_0 ][ kFlavoredCSBar ] ;
418 m_weights[ kFlavoredCF_0 ][ kSLPlus ] = 1. / bfCF_0 ;
419 m_weights[ kFlavoredCF_0 ][ kSLMinus ] = 1. / bfCF_0 ;
426 ( 1. + rCF2_0 - 2. * rCF_0 * RCF_0 *
cos(dCF_0) ) / ( ( 1. + rCF2_0 - 2. * rCF_0 * RCF_0 *
cos(dCF_0) *
y +
y *
y ) * bCPPlus );
428 ( 1. + rCF2_0 + 2. * rCF_0 * RCF_0 *
cos(dCF_0) ) / ( ( 1. + rCF2_0 - 2. * rCF_0 * RCF_0 *
cos(dCF_0) *
y +
y *
y ) * bCPMinus );
429 m_weights[ kFlavoredCF_0 ][ kDalitz ] = 1. / bfCF_0;
430 m_weights[ kFlavoredCF_0 ][ k2Pip2Pim ] = 1. / bfCF_0;
431 m_weights[ kFlavoredCF_0 ][ kPipPim2Pi0 ] = 1. / bfCF_0;
432 m_weights[ kFlavoredCF_0 ][ kK0PiPiPi0 ] = 1. / bfCF_0;
433 m_weights[ kFlavoredCF_0 ][ kKKPiPi ] = 1. / bfCF_0;
436 m_weights[ kFlavoredCFBar_0 ][ kFlavoredCFBar_0 ] =
m_weights[ kFlavoredCF_0 ][ kFlavoredCF_0 ] ;
437 m_weights[ kFlavoredCFBar_0 ][ kFlavoredCF_1 ] =
m_weights[ kFlavoredCF_0 ][ kFlavoredCFBar_1 ] ;
438 m_weights[ kFlavoredCFBar_0 ][ kFlavoredCFBar_1 ] =
m_weights[ kFlavoredCF_0 ][ kFlavoredCF_1 ] ;
439 m_weights[ kFlavoredCFBar_0 ][ kFlavoredCF_3 ] =
m_weights[ kFlavoredCF_0 ][ kFlavoredCFBar_3 ] ;
440 m_weights[ kFlavoredCFBar_0 ][ kFlavoredCFBar_3 ] =
m_weights[ kFlavoredCF_0 ][ kFlavoredCF_3 ] ;
441 m_weights[ kFlavoredCFBar_0 ][ kFlavoredCS ] =
m_weights[ kFlavoredCF_0 ][ kFlavoredCSBar ] ;
442 m_weights[ kFlavoredCFBar_0 ][ kFlavoredCSBar ] =
m_weights[ kFlavoredCF_0 ][ kFlavoredCS ] ;
443 m_weights[ kFlavoredCFBar_0 ][ kSLPlus ] = 1. / bCF_0 ;
444 m_weights[ kFlavoredCFBar_0 ][ kSLMinus ] = 1. / bCF_0 ;
447 m_weights[ kFlavoredCFBar_0 ][ kDalitz ] = 1. / bCF_0;
448 m_weights[ kFlavoredCFBar_0 ][ k2Pip2Pim ] = 1. / bCF_0;
449 m_weights[ kFlavoredCFBar_0 ][ kPipPim2Pi0 ] = 1. / bCF_0;
450 m_weights[ kFlavoredCFBar_0 ][ kK0PiPiPi0 ] = 1. / bCF_0;
451 m_weights[ kFlavoredCFBar_0 ][ kKKPiPi ] = 1. / bCF_0;
453 m_weights[ kFlavoredCF_1 ][ kFlavoredCF_1 ] = ( ( 1 - RCF_1 * RCF_1 ) / ( 1 - RCF_1 * (1./rCF_1) * (0.5*zCF_1*
y - 0.5*wCF_1*
x) + rmix/(2*rCF2_1) ) ) ;
454 m_weights[ kFlavoredCF_1 ][ kFlavoredCFBar_1 ] = ( 1. + rCF2_1 * rCF2_1 - 2. * RCF_1 * RCF_1 * rCF2_1 ) / ( bfCF_1 * bfCF_1 );
455 m_weights[ kFlavoredCF_1 ][ kFlavoredCF_3 ] = ( 1. + ( rCF2_1 / rCF2_3 ) * ( rCF2_1 / rCF2_3 ) - 2. * ( rCF2_1 / rCF2_3 ) * RCF_1 * RCF_3 *
cos( dCF_1 - dCF_3 ) ) / ( 1. + ( rCF2_1 / rCF2_3 ) * ( rCF2_1 / rCF2_3 ) - RCF_3 * (1./rCF_3) * ( 0.5*zCF_3*
y - 0.5*wCF_3*
x ) - (RCF_1/(rCF_1*rCF_1)) * ( 0.5*zCF_1*
y - 0.5*wCF_1*
x ) + rmix/(rCF_1*rCF_1) );;
456 m_weights[ kFlavoredCF_1 ][ kFlavoredCFBar_3 ] = ( 1. + rCF2_1 * rCF2_3 - 2. * RCF_1 * RCF_3 * rCF_1 * rCF_3 ) / ( bfCF_1 * bfCF_3 );;
457 m_weights[ kFlavoredCF_1 ][ kFlavoredCSBar ] =
458 1. + rCF2_1 * rCS2 - rCF_1 * rCS * vCFCSMinus ;
459 m_weights[ kFlavoredCF_1 ][ kFlavoredCS ] =
460 rCF2_1 + rCS2 - rCF_1 * rCS * vCF_1CSPlus +
461 rmix *
m_weights[ kFlavoredCF_1 ][ kFlavoredCSBar ] ;
463 m_weights[ kFlavoredCF_1 ][ kSLPlus ] = 1. / bfCF_1 ;
464 m_weights[ kFlavoredCF_1 ][ kSLMinus ] = 1. / bfCF_1 ;
471 ( 1. + rCF2_1 - 2. * rCF_1 * RCF_1 *
cos(dCF_1) ) / ( ( 1. + rCF2_1 - 2. * rCF_1 * RCF_1 *
cos(dCF_1) *
y +
y *
y ) * bCPPlus );
473 ( 1. + rCF2_1 + 2. * rCF_1 * RCF_1 *
cos(dCF_1) ) / ( ( 1. + rCF2_1 - 2. * rCF_1 * RCF_1 *
cos(dCF_1) *
y +
y *
y ) * bCPMinus );
474 m_weights[ kFlavoredCF_1 ][ kDalitz ] = 1. / bCF_1;
475 m_weights[ kFlavoredCF_1 ][ k2Pip2Pim ] = 1. / bCF_1;
476 m_weights[ kFlavoredCF_1 ][ kPipPim2Pi0 ] = 1. / bCF_1;
477 m_weights[ kFlavoredCF_1 ][ kK0PiPiPi0 ] = 1. / bCF_1;
478 m_weights[ kFlavoredCF_1 ][ kKKPiPi ] = 1. / bCF_1;
481 m_weights[ kFlavoredCFBar_1 ][ kFlavoredCFBar_1 ] =
m_weights[ kFlavoredCF_1 ][ kFlavoredCF_1 ] ;
482 m_weights[ kFlavoredCFBar_1 ][ kFlavoredCF_3 ] =
m_weights[ kFlavoredCF_1 ][ kFlavoredCFBar_3 ] ;
483 m_weights[ kFlavoredCFBar_1 ][ kFlavoredCFBar_3 ] =
m_weights[ kFlavoredCF_1 ][ kFlavoredCF_3 ] ;
484 m_weights[ kFlavoredCFBar_1 ][ kFlavoredCS ] =
m_weights[ kFlavoredCF_1 ][ kFlavoredCSBar ] ;
485 m_weights[ kFlavoredCFBar_1 ][ kFlavoredCSBar ] =
m_weights[ kFlavoredCF_1 ][ kFlavoredCS ] ;
486 m_weights[ kFlavoredCFBar_1 ][ kSLPlus ] = 1. / bCF_1 ;
487 m_weights[ kFlavoredCFBar_1 ][ kSLMinus ] = 1. / bCF_1 ;
490 m_weights[ kFlavoredCFBar_1 ][ kDalitz ] = 1. / bCF_1;
491 m_weights[ kFlavoredCFBar_1 ][ k2Pip2Pim ] = 1. / bCF_1;
492 m_weights[ kFlavoredCFBar_1 ][ kPipPim2Pi0 ] = 1. / bCF_1;
493 m_weights[ kFlavoredCFBar_1 ][ kK0PiPiPi0 ] = 1. / bCF_1;
494 m_weights[ kFlavoredCFBar_1 ][ kKKPiPi ] = 1. / bCF_1;
496 m_weights[ kFlavoredCF_3 ][ kFlavoredCF_3 ] = ( ( 1 - RCF_3 * RCF_3 ) / ( 1 - RCF_3 * (1./rCF_3) * (0.5*zCF_3*
y - 0.5*wCF_3*
x) + rmix/(2*rCF2_3) ) ) ;
497 m_weights[ kFlavoredCF_3 ][ kFlavoredCFBar_3 ] = ( 1. + rCF2_3 * rCF2_3 - 2. * RCF_3 * RCF_3 * rCF2_3 ) / ( bfCF_3 * bfCF_3 );
498 m_weights[ kFlavoredCF_3 ][ kFlavoredCSBar ] =
499 1. + rCF2_3 * rCS2 - rCF_3 * rCS * vCFCSMinus ;
500 m_weights[ kFlavoredCF_3 ][ kFlavoredCS ] =
501 rCF2_3 + rCS2 - rCF_3 * rCS * vCF_3CSPlus +
502 rmix *
m_weights[ kFlavoredCF_3 ][ kFlavoredCSBar ] ;
504 m_weights[ kFlavoredCF_3 ][ kSLPlus ] = 1. / bfCF_3 ;
505 m_weights[ kFlavoredCF_3 ][ kSLMinus ] = 1. / bfCF_3 ;
512 ( 1. + rCF2_3 - 2. * rCF_3 * RCF_3 *
cos(dCF_3) ) / ( ( 1. + rCF2_3 - 2. * rCF_3 * RCF_3 *
cos(dCF_3) *
y +
y *
y ) * bCPPlus );
514 ( 1. + rCF2_3 + 2. * rCF_3 * RCF_3 *
cos(dCF_3) ) / ( ( 1. + rCF2_3 - 2. * rCF_3 * RCF_3 *
cos(dCF_3) *
y +
y *
y ) * bCPMinus );
515 m_weights[ kFlavoredCF_3 ][ kDalitz ] = 1. / bCF_3;
516 m_weights[ kFlavoredCF_3 ][ k2Pip2Pim ] = 1. / bCF_3;
517 m_weights[ kFlavoredCF_3 ][ kPipPim2Pi0 ] = 1. / bCF_3;
518 m_weights[ kFlavoredCF_3 ][ kK0PiPiPi0 ] = 1. / bCF_3;
519 m_weights[ kFlavoredCF_3 ][ kKKPiPi ] = 1. / bCF_3;
522 m_weights[ kFlavoredCFBar_3 ][ kFlavoredCFBar_3 ] =
m_weights[ kFlavoredCF_3 ][ kFlavoredCF_3 ] ;
523 m_weights[ kFlavoredCFBar_3 ][ kFlavoredCS ] =
m_weights[ kFlavoredCF_3 ][ kFlavoredCSBar ] ;
524 m_weights[ kFlavoredCFBar_3 ][ kFlavoredCSBar ] =
m_weights[ kFlavoredCF_3 ][ kFlavoredCS ] ;
525 m_weights[ kFlavoredCFBar_3 ][ kSLPlus ] = 1. / bCF_3 ;
526 m_weights[ kFlavoredCFBar_3 ][ kSLMinus ] = 1. / bCF_3 ;
529 m_weights[ kFlavoredCFBar_3 ][ kDalitz ] = 1. / bCF_3;
530 m_weights[ kFlavoredCFBar_3 ][ k2Pip2Pim ] = 1. / bCF_3;
531 m_weights[ kFlavoredCFBar_3 ][ kPipPim2Pi0 ] = 1. / bCF_3;
532 m_weights[ kFlavoredCFBar_3 ][ kK0PiPiPi0 ] = 1. / bCF_3;
533 m_weights[ kFlavoredCFBar_3 ][ kKKPiPi ] = 1. / bCF_3;
538 m_weights[ kFlavoredCS ][ kFlavoredCSBar ] = 1. + rCS2 * ( 2. - zCS2 ) + rCS2 * rCS2 ;
539 m_weights[ kFlavoredCS ][ kFlavoredCS ] = rmix *
m_weights[ kFlavoredCS ][ kFlavoredCSBar ] ;
545 m_weights[ kFlavoredCS ][ kSLPlus ] = 1. / bCS ;
546 m_weights[ kFlavoredCS ][ kSLMinus ] = 1. / bCS ;
548 m_weights[ kFlavoredCS ][ kCPPlus ] = ( 1. + rCS2 + rCS * zCS ) / ( 1. +
m_rwsCS ) / bCS / bCPPlus ;
549 m_weights[ kFlavoredCS ][ kCPMinus ] = ( 1. + rCS2 - rCS * zCS ) / ( 1. +
m_rwsCS ) / bCS / bCPMinus ;
551 m_weights[ kFlavoredCS ][ kDalitz ] = 1. / bCS;
552 m_weights[ kFlavoredCS ][ k2Pip2Pim ] = 1. / bCS;
553 m_weights[ kFlavoredCS ][ kPipPim2Pi0 ] = 1. / bCS;
554 m_weights[ kFlavoredCS ][ kK0PiPiPi0 ] = 1. / bCS;
555 m_weights[ kFlavoredCS ][ kKKPiPi ] = 1. / bCS;
559 m_weights[ kFlavoredCSBar ][ kFlavoredCSBar ] =
m_weights[ kFlavoredCS ][ kFlavoredCS ] ;
560 m_weights[ kFlavoredCSBar ][ kSLPlus ] = 1. / bCS ;
561 m_weights[ kFlavoredCSBar ][ kSLMinus ] = 1. / bCS ;
564 m_weights[ kFlavoredCSBar ][ kDalitz ] = 1. / bCS;
565 m_weights[ kFlavoredCSBar ][ k2Pip2Pim ] = 1. / bCS;
566 m_weights[ kFlavoredCSBar ][ kPipPim2Pi0 ] = 1. / bCS;
567 m_weights[ kFlavoredCSBar ][ kK0PiPiPi0 ] = 1. / bCS;
568 m_weights[ kFlavoredCSBar ][ kKKPiPi ] = 1. / bCS;
576 m_weights[ kSLPlus ][ kCPPlus ] = 1. / bCPPlus ;
577 m_weights[ kSLPlus ][ kCPMinus ] = 1. / bCPMinus ;
580 m_weights[ kSLPlus ][ kPipPim2Pi0 ] = 1. ;
581 m_weights[ kSLPlus ][ kK0PiPiPi0 ] = 1. ;
587 m_weights[ kSLMinus ][ kCPPlus ] = 1. / bCPPlus ;
588 m_weights[ kSLMinus ][ kCPMinus ] = 1. / bCPMinus ;
590 m_weights[ kSLMinus ][ k2Pip2Pim ] = 1. ;
591 m_weights[ kSLMinus ][ kPipPim2Pi0 ] = 1. ;
592 m_weights[ kSLMinus ][ kK0PiPiPi0 ] = 1. ;
598 m_weights[ kCPPlus ][ kCPMinus ] = 2. / bCPPlus / bCPMinus ;
599 m_weights[ kCPPlus ][ kDalitz ] = 1. / bCPPlus;
600 m_weights[ kCPPlus ][ k2Pip2Pim ] = 1. / bCPPlus;
601 m_weights[ kCPPlus ][ kPipPim2Pi0 ] = 1. / bCPPlus;
602 m_weights[ kCPPlus ][ kK0PiPiPi0 ] = 1. / bCPPlus;
603 m_weights[ kCPPlus ][ kKKPiPi ] = 1. / bCPPlus;
608 m_weights[ kCPMinus ][ kDalitz ] = 1. / bCPMinus;
609 m_weights[ kCPMinus ][ k2Pip2Pim ] = 1. / bCPMinus;
610 m_weights[ kCPMinus ][ kPipPim2Pi0 ] = 1. / bCPMinus;
611 m_weights[ kCPMinus ][ kK0PiPiPi0 ] = 1. / bCPMinus;
612 m_weights[ kCPMinus ][ kKKPiPi ] = 1. / bCPMinus;
622 m_weights[ k2Pip2Pim ][ kPipPim2Pi0 ] = 1;
623 m_weights[ k2Pip2Pim ][ kK0PiPiPi0 ] = 1;
626 m_weights[ kPipPim2Pi0 ][ kPipPim2Pi0 ] = 1;
627 m_weights[ kPipPim2Pi0 ][ kK0PiPiPi0 ] = 1;
630 m_weights[ kK0PiPiPi0 ][ kK0PiPiPi0 ] = 1;
634 log << MSG::INFO <<
"Weight matrix" <<
m_weights << endmsg ;
637 HepVector fractionsD0( kNDecayTypes+1, 0 ) ;
638 fractionsD0[ kFlavoredCF_0 ] = 0.305 ;
639 fractionsD0[ kFlavoredCFBar_0 ] = 0.0076 ;
640 fractionsD0[ kFlavoredCF_1 ] = 0.144 ;
641 fractionsD0[ kFlavoredCFBar_1 ] = 0.00031 ;
642 fractionsD0[ kFlavoredCF_3 ] = 0.0822 ;
643 fractionsD0[ kFlavoredCFBar_3 ] = 0.00027 ;
644 fractionsD0[ kFlavoredCS ] = 0.031 ;
645 fractionsD0[ kFlavoredCSBar ] = 0.031 ;
646 fractionsD0[ kSLPlus ] = 0.125 ;
647 fractionsD0[ kSLMinus ] = 0. ;
648 fractionsD0[ kCPPlus ] = 0.113 ;
649 fractionsD0[ kCPMinus ] = 0.102 ;
650 fractionsD0[ kDalitz ] = 0.056 ;
651 fractionsD0[ k2Pip2Pim ] = 0.00720 ;
652 fractionsD0[ kPipPim2Pi0 ] = 0.0102 ;
653 fractionsD0[ kK0PiPiPi0 ] = 0.104 ;
654 fractionsD0[ kKKPiPi ] = 0.00273 ;
655 HepVector scales =
m_weights * fractionsD0 ;
656 log << MSG::INFO <<
"Integrated scale factors " <<scales << endmsg ;
659 HepVector fractionsD0bar( kNDecayTypes+1, 0 ) ;
660 fractionsD0bar[ kFlavoredCF_0 ] = 0.0076 ;
661 fractionsD0bar[ kFlavoredCFBar_0 ] = 0.305 ;
662 fractionsD0bar[ kFlavoredCF_1 ] = 0.00031 ;
663 fractionsD0bar[ kFlavoredCFBar_1 ] = 0.144 ;
664 fractionsD0bar[ kFlavoredCF_3 ] = 0.00027 ;
665 fractionsD0bar[ kFlavoredCFBar_3 ] = 0.0822 ;
666 fractionsD0bar[ kFlavoredCS ] = 0.031 ;
667 fractionsD0bar[ kFlavoredCSBar ] = 0.031 ;
668 fractionsD0bar[ kSLPlus ] = 0. ;
669 fractionsD0bar[ kSLMinus ] = 0.125 ;
670 fractionsD0bar[ kCPPlus ] = 0.113 ;
671 fractionsD0bar[ kCPMinus ] = 0.102 ;
672 fractionsD0bar[ kDalitz ] = 0.056 ;
673 fractionsD0bar[ k2Pip2Pim ] = 0.00720 ;
674 fractionsD0bar[ kPipPim2Pi0 ] = 0.0102 ;
675 fractionsD0bar[ kK0PiPiPi0 ] = 0.104 ;
676 fractionsD0bar[ kKKPiPi ] = 0.00273 ;
677 HepVector weight_norm = fractionsD0bar.T() * scales;
678 log << MSG::INFO <<
"Overall scale factor " << fractionsD0bar.T() * scales << endmsg ;
684 double brCF_0 = ( fractionsD0bar[ kFlavoredCFBar_0 ] * scales[ kFlavoredCFBar_0 ] ) / weight_norm[0] ;
685 double brCF_1 = ( fractionsD0bar[ kFlavoredCFBar_1 ] * scales[ kFlavoredCFBar_1 ] ) / weight_norm[0] ;
686 double brCF_3 = ( fractionsD0bar[ kFlavoredCFBar_3 ] * scales[ kFlavoredCFBar_3 ] ) / weight_norm[0] ;
687 double brCS = ( fractionsD0bar[ kFlavoredCS ] * scales[ kFlavoredCS ] + fractionsD0bar[ kFlavoredCSBar ] * scales[ kFlavoredCSBar ] ) / weight_norm[0] ;
688 double brDCS_0 = ( fractionsD0bar[ kFlavoredCF_0 ] * scales[ kFlavoredCF_0 ] ) / weight_norm[0] ;
689 double brDCS_1 = ( fractionsD0bar[ kFlavoredCF_1 ] * scales[ kFlavoredCF_1 ] ) / weight_norm[0] ;
690 double brDCS_3 = ( fractionsD0bar[ kFlavoredCF_3 ] * scales[ kFlavoredCF_3 ] ) / weight_norm[0] ;
691 double brCPPlus = ( fractionsD0bar[ kCPPlus ] * scales[ kCPPlus ] ) / weight_norm[0] ;
692 double brCPMinus = ( fractionsD0bar[ kCPMinus ] * scales[ kCPMinus ] ) / weight_norm[0] ;
695 double dalitz_y_num = -0.000177536;
696 double dalitz_y_den = -0.0150846;
699 -rCF_0 * zCF_0 * ( 1. - 0.5 * rCF_0 * wCF_0 * m_x ) ;
701 -rCF_1 * zCF_1 * ( 1. - 0.5 * rCF_1 * wCF_1 * m_x ) ;
703 -rCF_3 * zCF_3 * ( 1. - 0.5 * rCF_3 * wCF_3 * m_x ) ;
705 -rCS * zCS * ( 1. - 0.5 * rCS * wCS * m_x ) ;
706 double denFactCF_0 = 0.5 * rCF2_0 * zCF2_0 ;
707 double denFactCF_1 = 0.5 * rCF2_1 * zCF2_1 ;
708 double denFactCF_3 = 0.5 * rCF2_3 * zCF2_3 ;
709 double denFactCS = 0.5 * rCS2 * zCS2 ;
712 brCPPlus - brCPMinus + brCF_0 * numFactCF_0 + brCF_1 * numFactCF_1 + brCF_3 * numFactCF_3 + 0.5 * brCS * numFactCS + dalitz_y_num;
714 1. - brCPPlus - brCPMinus - brCF_0 * denFactCF_0 - brCF_1 * denFactCF_1 - brCF_3 * denFactCF_3 - 0.5 * brCS * denFactCS + dalitz_y_den ;
715 double y_pre = num_pre / den_pre ;
717 fractionsD0bar[ kCPPlus ] - fractionsD0bar[ kCPMinus ] + fractionsD0bar[ kFlavoredCFBar_0 ] * numFactCF_0 + fractionsD0bar[ kFlavoredCFBar_1 ] * numFactCF_1 + fractionsD0bar[ kFlavoredCFBar_3 ] * numFactCF_3 + fractionsD0bar[ kFlavoredCS ] * numFactCS + dalitz_y_num;
719 1. - fractionsD0bar[ kCPPlus ] - fractionsD0bar[ kCPMinus ] - fractionsD0bar[ kFlavoredCFBar_0 ] * denFactCF_0 - fractionsD0bar[ kFlavoredCFBar_1 ] * denFactCF_1 - fractionsD0bar[ kFlavoredCFBar_3 ] * denFactCF_3 - fractionsD0bar[ kFlavoredCS ] * denFactCS + dalitz_y_den;
720 double y_prematrix =
num / den ;
721 double y_test1 = 0.25 * ( ( ( scales[ kCPMinus ] *
m_weights[ kCPPlus ][ kSLPlus ] ) / ( scales[ kCPPlus ] *
m_weights[ kCPMinus ][ kSLPlus ] ) ) -
722 ( ( scales[ kCPPlus ] *
m_weights[ kCPMinus ][ kSLPlus ] ) / ( scales[ kCPMinus ] *
m_weights[ kCPPlus ][ kSLPlus ] ) ) ) ;
724 log << MSG::INFO <<
"An Input Y of " << m_y << endmsg ;
725 log << MSG::INFO <<
"Parent MC has an intrinsic value of y as " << y_prematrix << endmsg ;
726 log << MSG::INFO <<
"The BR method predics a y of " << y_pre << endmsg ;
727 log << MSG::INFO <<
"The CP-SL double tag method predicts y of " <<y_test1 << endmsg ;
730 m_largestWeight = 0. ;
731 for(
int i = 0 ; i < kNDecayTypes ; ++i )
733 for(
int j = 0 ; j < kNDecayTypes ; ++j )
736 if(
m_weights[ i ][ j ] > m_largestWeight )
744 log << MSG::INFO <<
"Renormalized weight matrix " <<
m_weights << endmsg ;
749 double D0Sum[ 10 ], D0barSum[ 10 ] ;
753 for(
int i = 0 ; i < 10 ; ++i )
757 D0D0barSum[ i ] =
TComplex( 0., 0. ) ;
764 double stepsize = ( m2max - m2min ) / (
double ) nsteps ;
766 for(
int i = 0 ; i < nsteps ; ++i )
768 double m2i = m2min + ( ( double ) i + 0.5 ) * stepsize ;
770 for(
int j = 0 ; j < nsteps ; ++j )
772 double m2j = m2min + ( ( double ) j + 0.5 ) * stepsize ;
774 if(
t.Point_on_DP( m2i, m2j ) )
776 double m2k = 1.86450*1.86450 + 0.497648*0.497648 +
777 0.139570*0.139570 + 0.139570*0.139570 - m2i - m2j ;
780 if (m_dalitzModel == 0) {
781 D0 =
t.CLEO_Amplitude( m2i, m2j, m2k ) ;
782 D0bar =
t.CLEO_Amplitude( m2j, m2i, m2k ) ;}
783 if (m_dalitzModel == 1) {
784 D0 =
t.Babar_Amplitude( m2i, m2j, m2k ) ;
785 D0bar =
t.Babar_Amplitude( m2j, m2i, m2k ) ;}
786 if (m_dalitzModel == 2) {
787 D0 =
t.Amplitude( m2i, m2j, m2k ) ;
788 D0bar =
t.Amplitude( m2j, m2i, m2k ) ;}
791 int bin =
t.getBin( m2i, m2j, m2k ) ;
795 D0Sum[
bin ] += norm( D0 ) ;
796 D0barSum[
bin ] += norm( D0bar ) ;
797 D0D0barSum[
bin ] += D0 *
conj( D0bar ) ;
800 D0Sum[ 9 ] += norm( D0 ) ;
801 D0barSum[ 9 ] += norm( D0bar ) ;
802 D0D0barSum[ 9 ] += D0 *
conj( D0bar ) ;
809 for(
int i = 0 ; i < 10 ; ++i )
811 double r2 = D0barSum[ i ] / D0Sum[ i ] ;
812 double c =
real( D0D0barSum[ i ] ) / sqrt( D0barSum[ i ] ) / sqrt( D0Sum[ i ] ) ;
813 double s =
imag( D0D0barSum[ i ] ) / sqrt( D0barSum[ i ] ) / sqrt( D0Sum[ i ] ) ;
815 cout <<
"BIN " << i <<
": "
816 << points[ i ] <<
" pts "
817 << r2 <<
" " << c <<
" " <<
s <<
" " << c*c+
s*
s
821 log << MSG::INFO <<
"successfully return from initialize()" <<endmsg;
822 return StatusCode::SUCCESS;
829 ISvcLocator* svcLocator = Gaudi::svcLocator();
830 StatusCode sc=svcLocator->service(
"EventDataSvc", m_evtSvc);
832 std::cout<<
"Could not access EventDataSvc!"<<std::endl;
836 MsgStream log(
msgSvc(), name());
837 log<< MSG::INFO <<
"in execute()" << endmsg;
839 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
843 cout<<
" eventHeader "<<endl;
844 return StatusCode::FAILURE;
846 long runNo = eventHeader->runNumber();
847 long event = eventHeader->eventNumber();
848 log << MSG::DEBUG <<
"run, evtnum = "
852 unsigned int QC_status = 0;
859 int psipp_daughter = 0;
862 for( Event::McParticleCol::iterator it = mcParticles->begin(); it != mcParticles->end(); it++)
864 int pdg_code = (*it)->particleProperty();
865 if ((*it)->primaryParticle())
continue;
870 if (mother_pdg == kPsi3770ID)
873 if (
abs(pdg_code) == kD0ID) d0_count++;
874 if (
abs(pdg_code) == kDpID) chd_count++;
875 if (pdg_code == kD0BarID)
m_nD0bar++;
879 if( psipp_daughter == 0 )
883 if( m_invertSelection )
887 eventHeader->setEventTag(QC_status);
889 log << MSG::INFO <<
"QC_status " << QC_status << endmsg;
890 log<< MSG::DEBUG <<
"Discarding event -- did not find psi(3770). " << endmsg ;
891 return StatusCode::SUCCESS;
899 eventHeader->setEventTag(QC_status);
901 log << MSG::INFO <<
"QC_status " << QC_status << endmsg;
903 return StatusCode::SUCCESS;
907 log<< MSG::DEBUG <<
"Found psi(3770) -->" << endmsg ;
910 if ( psipp_daughter > 3 )
914 if( m_invertSelection )
918 eventHeader->setEventTag(QC_status);
920 log << MSG::INFO <<
"QC_status " << QC_status << endmsg;
921 log<< MSG::DEBUG <<
"Discarding event -- psi(3770) has >3 daughters." << endmsg ;
922 return StatusCode::SUCCESS;
929 eventHeader->setEventTag(QC_status);
931 log << MSG::INFO <<
"QC_status " << QC_status << endmsg;
935 return StatusCode::SUCCESS;
940 if (chd_count == 2) {
944 double random = RandFlat::shoot() ;
946 if( ( random < m_dplusDminusWeight && !m_invertSelection ) ||
947 ( random > m_dplusDminusWeight && m_invertSelection ) )
953 eventHeader->setEventTag(QC_status);
955 log << MSG::INFO <<
"QC_status " << QC_status << endmsg;
958 return StatusCode::SUCCESS;
964 eventHeader->setEventTag(QC_status);
966 log << MSG::INFO <<
"QC_status " << QC_status << endmsg;
967 log<< MSG::DEBUG <<
"Discarding event -- D+D- event failed reweighting." << endmsg ;
969 return StatusCode::SUCCESS;
975 if( !m_invertSelection )
979 eventHeader->setEventTag(QC_status);
981 log << MSG::INFO <<
"QC_status " << QC_status << endmsg;
982 log<< MSG::DEBUG <<
"Discarding event -- non-D0-D0bar event." << endmsg ;
983 return StatusCode::SUCCESS;
990 eventHeader->setEventTag(QC_status);
992 log << MSG::INFO <<
"QC_status " << QC_status << endmsg;
996 return StatusCode::SUCCESS;
1000 log<< MSG::INFO <<
"D0-D0bar event." << endmsg ;
1009 int d0mode = d0_decay[0];
1010 int d0barmode = d0bar_decay[0];
1011 if(m_debug)cout<<
"D0 "<<d0mode<<endl;
1012 if(m_debug)cout<<
"D0bar "<<d0barmode<<endl;
1018 if (d0_decay[0] == 18 || d0bar_decay[0] == 18 ) {
1019 if( !m_invertSelection )
1023 eventHeader->setEventTag(QC_status);
1025 log << MSG::INFO <<
"QC_status " << QC_status << endmsg;
1026 log<< MSG::DEBUG <<
"Discarding event -- unknown D0-D0bar event." << endmsg ;
1027 return StatusCode::SUCCESS;
1034 eventHeader->setEventTag(QC_status);
1036 log << MSG::INFO <<
"QC_status " << QC_status << endmsg;
1041 return StatusCode::SUCCESS;
1046 double r2D0 = d0_decay[1] ;
1047 double deltaD0 = d0_decay[2] ;
1048 double RD0 = d0_decay[3] ;
1049 double FCP = d0_decay[4] ;
1050 double r2D0bar = d0bar_decay[1] ;
1051 double deltaD0bar = d0bar_decay[2] ;
1052 double RD0bar = d0bar_decay[3] ;
1053 double FCPbar = d0bar_decay[4] ;
1058 if( d0_decay[0] == kDalitz || d0bar_decay[0] == kDalitz || d0_decay[0] == k2Pip2Pim || d0bar_decay[0] == k2Pip2Pim || d0_decay[0] == kPipPim2Pi0 || d0bar_decay[0] == kPipPim2Pi0 || d0_decay[0] == kK0PiPiPi0 || d0bar_decay[0] == kK0PiPiPi0
1059 || d0_decay[0] == kKKPiPi || d0bar_decay[0] == kKKPiPi ||d0bar_decay[0] == kFlavoredCF_3 || d0bar_decay[0] == kFlavoredCFBar_3 )
1061 double r2prod = r2D0 * r2D0bar ;
1072 double bD0 = 1. - (2*FCP - 1.) * RD0 * sqrt( r2D0 ) * (
cos( deltaD0 ) *
y +
sin( deltaD0 ) *
x ) ;
1073 double rwsD0 = ( r2D0 - (2*FCP - 1.) * RD0 * sqrt( r2D0 ) * (
cos( deltaD0 ) *
y -
sin( deltaD0 ) *
x ) ) / bD0 ;
1074 double bD0bar = 1. - (2*FCPbar - 1.) * RD0bar * sqrt( r2D0bar ) * (
cos( deltaD0bar ) *
y +
sin( deltaD0bar ) *
x ) ;
1075 double rwsD0bar = ( r2D0bar - (2*FCPbar - 1.) * RD0bar * sqrt( r2D0bar ) * (
cos( deltaD0bar ) *
y -
sin( deltaD0bar ) *
x ) ) / bD0bar ;
1077 log << MSG::INFO <<
"bD0 == " << bD0<< endmsg;
1078 log << MSG::INFO <<
"bD0bar == " << bD0bar<< endmsg;
1079 log << MSG::INFO <<
"rwsD0 == " << rwsD0<< endmsg;
1080 log << MSG::INFO <<
"rwsD0bar == " << rwsD0bar<< endmsg;
1081 weight = 1. + r2prod - 2. * RD0 * (2*FCP - 1.) * sqrt( r2prod ) *
cos( deltaD0 + deltaD0bar ) ;
1082 log << MSG::INFO <<
"weight == " <<
weight<< endmsg;
1083 weight /= ( 1. + rwsD0 * rwsD0bar ) * bD0 * bD0bar ;
1084 log << MSG::INFO <<
"weight == " <<
weight<< endmsg;
1085 weight /= m_largestWeight ;
1086 log << MSG::INFO <<
"weight == " <<
weight<< endmsg;
1093 if( d0_decay[0] == kDalitz) {
1098 if( d0bar_decay[0] == kDalitz) {
1100 m2i= d0bar_decay[4];
1101 m2j= d0bar_decay[5];
1102 m2k= d0bar_decay[7];}
1110 double random = RandFlat::shoot() ;
1111 log<< MSG::DEBUG <<
"type: " << d0_decay[0] <<
" " << d0bar_decay[0] <<
", weight " <<
1112 weight <<
" <? random " << random << endmsg ;
1114 if( ( random <
weight && !m_invertSelection ) || ( random >
weight && m_invertSelection ) )
1118 eventHeader->setEventTag(QC_status);
1120 log << MSG::INFO <<
"QC_status " << QC_status << endmsg;
1155 return StatusCode::SUCCESS;
1160 eventHeader->setEventTag(QC_status);
1162 log << MSG::INFO <<
"QC_status " << QC_status << endmsg;
1164 log << MSG::DEBUG <<
"Discarding event -- failed reweighting." << endmsg ;
1167 return StatusCode::SUCCESS;
1175 MsgStream log(
msgSvc(), name());
1176 log << MSG::INFO <<
"in finalize()" << endmsg;
1177 log << MSG::INFO <<
"Number of unknown events: " <<
m_nUnknownEvents << endmsg ;
1178 log << MSG::INFO <<
"Number of D+D- events seen: " <<
m_nDpDmEvents << endmsg ;
1179 log << MSG::INFO <<
"Number of D+D- events discarded: " <<
m_nDpDmDiscarded << endmsg ;
1186 log << MSG::INFO <<
"Number of D0D0bar events discarded: " <<
m_nD0D0barDiscarded << endmsg ;
1501return StatusCode::SUCCESS;
1509 MsgStream log(
msgSvc(), name());
1510 log << MSG::INFO <<
" In findD0Decay " << endmsg ;
1511 vector<double> d0_info(9);
1512 for(
int i=0; i< 8; i++) d0_info[i]=0;
1513 double decay_mode = 18;
1515 double deltaD0 = -1;
1520 for(
int i=0; i< 26; i++)
num[i]=0;
1527 int kNeutralScalar = 5;
1540 int kKStar0Bar = 18;
1543 int kLeptonPlus = 21;
1544 int kLeptonMinus = 22;
1552 int d0_pdg = charm == 1 ? kD0ID : kD0BarID;
1554 HepLorentzVector piPlus, piMinus, k0;
1555 vector<HepLorentzVector> piPlus_4pi, piMinus_4pi, pi0_p4;
1556 vector<HepLorentzVector> kPlus_kkpipi, kMinus_kkpipi;
1557 piPlus_4pi.clear();piMinus_4pi.clear(), pi0_p4.clear();
1558 kPlus_kkpipi.clear();kMinus_kkpipi.clear();
1560 for( Event::McParticleCol::iterator it = mcParticles->begin(); it != mcParticles->end(); it++)
1562 int pdg_code = (*it)->particleProperty();
1563 if ((*it)->primaryParticle())
continue;
1571 if (pdg_code == kKStar0ID || pdg_code == kKStar0BarID || pdg_code == kK0ID || pdg_code == kK0BarID || pdg_code == kKDPStar0ID || pdg_code == kKDPStar0BarID
1572 || pdg_code == kK10ID || pdg_code == kK10BarID
1573 || pdg_code == kK0Star0ID || pdg_code == kK0Star0BarID || pdg_code == kK0StarPlusID || pdg_code == kK0BarID )
continue;
1575 if (mother_pdg == kK0ID || mother_pdg == kK0BarID) {
1579 if (mother_pdg == kKStar0ID || mother_pdg == kKStar0BarID) {
1582 if (pdg_code == kPiPlusID || pdg_code == kPiMinusID)
continue;
1583 if (mother_pdg == kKStar0ID && pdg_code == kKPlusID) pdg_code = kKStar0ID;
1584 if (mother_pdg == kKStar0BarID && pdg_code == kKMinusID) pdg_code = kKStar0BarID;
1589 if ( mother_pdg == kK0Star0ID || mother_pdg == kK0Star0BarID ) {
1594 if (mother_pdg == kK10ID || mother_pdg == kK10BarID) {
1602 if (mother_pdg == d0_pdg)
1604 if (pdg_code == kPiPlusID || pdg_code == kA0PlusID )
num[0]++;
1605 else if (pdg_code == kPiMinusID || pdg_code == kA0MinusID )
num[1]++;
1606 else if (pdg_code == kPi0ID )
num[2]++;
1607 else if (pdg_code == kEtaID )
num[3]++;
1608 else if (pdg_code == kEtaPrimeID )
num[4]++;
1609 else if (pdg_code == kF0ID || pdg_code == kA00ID
1610 || pdg_code == kFPrime0ID|| pdg_code == kF0m1500ID
1611 || pdg_code == kF2ID)
num[5]++;
1612 else if (pdg_code == kRhoPlusID || pdg_code == kRho2SPlusID
1613 || pdg_code == kA1PlusID )
num[6]++;
1614 else if (pdg_code == kRhoMinusID || pdg_code == kRho2SMinusID
1615 || pdg_code == kA1MinusID)
num[7]++;
1616 else if (pdg_code == kRho0ID || pdg_code == kRho2S0ID)
num[8]++;
1617 else if (pdg_code == kOmegaID )
num[9]++;
1618 else if (pdg_code == kPhiID )
num[10]++;
1619 else if (pdg_code == kKPlusID )
num[11]++;
1620 else if (pdg_code == kKMinusID )
num[12]++;
1621 else if (pdg_code == kK0SID )
num[13]++;
1622 else if (pdg_code == kK0LID )
num[14]++;
1623 else if (pdg_code == kKStarPlusID || pdg_code == kK1PlusID
1624 || pdg_code == kK2StarPlusID || pdg_code == kK1PrimePlusID
1625 || pdg_code == kK0StarPlusID)
num[15]++;
1626 else if (pdg_code == kKStarMinusID || pdg_code == kK1MinusID
1627 || pdg_code == kK2StarMinusID || pdg_code == kK1PrimeMinusID
1628 || pdg_code == kK0StarMinusID )
num[16]++;
1629 else if (pdg_code == kKStar0ID )
num[17]++;
1630 else if (pdg_code == kKStar0BarID )
num[18]++;
1631 else if (pdg_code == kK10ID || pdg_code == kK1Prime0ID)
num[19]++;
1632 else if (pdg_code == kK10BarID || pdg_code == kK1Prime0BarID)
num[20]++;
1633 else if (pdg_code == kEPlusID || pdg_code == kMuPlusID )
num[21]++;
1634 else if (pdg_code == kEMinusID || pdg_code == kMuMinusID )
num[22]++;
1635 else if (pdg_code == kNuEID || pdg_code == kNuEBarID
1636 || pdg_code == kNuMuID || pdg_code == kNuMuBarID )
num[23]++;
1637 else if (pdg_code == kGammaID )
num[24]++;
1638 else if (pdg_code == kGammaFSRID )
continue;
1641 cout <<
"Unknown particle: "<< pdg_code << endl;
1651 if (pdg_code == kPiPlusID) piPlus.setVectM((*it)->initialFourMomentum().vect(),
xmpion);
1652 if (pdg_code == kPiMinusID) piMinus.setVectM((*it)->initialFourMomentum().vect(),
xmpion);
1653 if (pdg_code == kK0SID) k0.setVectM((*it)->initialFourMomentum().vect(),
xmk0);
1654 if (pdg_code == kK0LID) k0.setVectM((*it)->initialFourMomentum().vect(),
xmk0);
1655 HepLorentzVector daughterP4;
1656 if(piPlus_4pi.size()>2||piMinus_4pi.size()>2)
continue;
1657 if(kPlus_kkpipi.size()>1||kMinus_kkpipi.size()>1)
continue;
1659 if (pdg_code == kPiPlusID) {daughterP4.setVectM((*it)->initialFourMomentum().vect(),
xmpion);piPlus_4pi.push_back(daughterP4);}
1660 if (pdg_code == kPiMinusID) {daughterP4.setVectM((*it)->initialFourMomentum().vect(),
xmpion);piMinus_4pi.push_back(daughterP4);}
1661 if (pdg_code == kKPlusID) {daughterP4.setVectM((*it)->initialFourMomentum().vect(),
xmkaon);kPlus_kkpipi.push_back(daughterP4);}
1662 if (pdg_code == kKMinusID) {daughterP4.setVectM((*it)->initialFourMomentum().vect(),
xmkaon);kMinus_kkpipi.push_back(daughterP4);}
1663 if (pdg_code == kPi0ID) {daughterP4.setVectM((*it)->initialFourMomentum().vect(),
xmpi0);pi0_p4.push_back(daughterP4);}
1668 int nDaughters = 0 ;
1669 for(
int i = 0 ; i < 26 ; i++ )
1671 nDaughters +=
num[ i ] ;
1674 int nUFP0 =
num[ kPi0 ] +
num[ kEta ] +
num[ kEtaPrime ] ;
1675 int nUFV0 =
num[ kRho0 ] +
num[ kPhi ] +
num[ kOmega ] +
num[ kGamma ] ;
1676 int nFV0 =
num[ kKStar0 ] +
num[ kK10 ] ;
1677 int nFV0Bar =
num[ kKStar0Bar ] +
num[ kK10Bar ] ;
1678 int nStrange =
num[ kKMinus ] +
num[ kFVMinus ] + nFV0Bar ;
1679 int nAntiStrange =
num[ kKPlus ] +
num[ kFVPlus ] + nFV0 ;
1680 int nCPPlusEig =
num[ kNeutralScalar ] +
num[ kRho0 ] +
num[ kOmega ] +
num[ kPhi ] +
num[ kK0S ] +
num[ kGamma ] ;
1681 int nCPMinusEig =
num[ kPi0 ] +
num[ kEta ] +
num[ kEtaPrime ] +
num[ kK0L ] ;
1682 int nCPEig = nCPPlusEig + nCPMinusEig ;
1683 int nChargedPiK =
num[ kPiPlus ] +
num[ kPiMinus ] +
num[ kKPlus ] +
num[ kKMinus ] ;
1684 int nK0 =
num[ kK0S ] +
num[ kK0L ] ;
1688 double mnm_gen = 0. ;
1689 double mpn_gen = 0. ;
1690 double mpm_gen = 0. ;
1691 bool isKsPiPi =
false ;
1692 bool isKsPiPiPi0 =
false ;
1697 if( nK0 == 1 &&
num[ kPiPlus ] == 1 &&
num[ kPiMinus ] && nDaughters == 3 )
1699 decay_mode = kDalitz ;
1706 if(
num[ kK0S ] == 1) isKsPiPi =
true ;
1708 if(
num[ kPiPlus ] == 2&&
num[ kPiMinus ]==2 && nDaughters == 4 )
1710 decay_mode = k2Pip2Pim;
1712 if(
num[ kPiPlus ] == 1&&
num[ kPiMinus ]==1 &&
num[ kPi0 ]==2 && nDaughters == 4 )
1714 decay_mode = kPipPim2Pi0;
1716 if( nK0 == 1 &&
num[ kPiPlus ] == 1&&
num[ kPiMinus ]==1 &&
num[ kPi0 ]==1 && nDaughters == 4 )
1718 decay_mode = kK0PiPiPi0;
1719 if(
num[ kK0S ] == 1) isKsPiPiPi0 =
true ;
1721 if(
num[ kPiPlus ] == 1&&
num[ kPiMinus ]==1 &&
num[ kKPlus ] == 1&&
num[ kKMinus ]==1 && nDaughters == 4 )
1723 decay_mode = kKKPiPi;
1727 if( decay_mode == kDalitz )
1744 vector<double> k0l;vector<double> pip;vector<double> pim;
1745 k0l.clear();pip.clear();pim.clear();
1746 k0l.push_back(k0[0]);k0l.push_back(k0[1]);k0l.push_back(k0[2]);k0l.push_back(k0[3]);
1747 pip.push_back(piPlus[0]);pip.push_back(piPlus[1]);pip.push_back(piPlus[2]);pip.push_back(piPlus[3]);
1748 pim.push_back(piMinus[0]);pim.push_back(piMinus[1]);pim.push_back(piMinus[2]);pim.push_back(piMinus[3]);
1752 D0 = tKSpipi.
Amp_PFT(k0l,pip,pim);
1754 vector<double> cpk0l;vector<double> cppip;vector<double> cppim;
1755 cpk0l.clear();pip.clear();pim.clear();
1756 cpk0l.push_back(-k0l[0]);cpk0l.push_back(-k0l[1]);cpk0l.push_back(-k0l[2]);cpk0l.push_back(k0l[3]);
1757 cppim.push_back(-piPlus[0]);cppim.push_back(-piPlus[1]);cppim.push_back(-piPlus[2]);cppim.push_back(piPlus[3]);
1758 cppip.push_back(-piMinus[0]);cppip.push_back(-piMinus[1]);cppip.push_back(-piMinus[2]);cppip.push_back(piMinus[3]);
1759 D0bar = tKSpipi.
Amp_PFT(cpk0l, cppip, cppim);
1762 D0 = tKLpipi.
Amp_PFT(k0l,pip,pim);
1763 vector<double> cpk0l;vector<double> cppip;vector<double> cppim;
1764 cpk0l.clear();pip.clear();pim.clear();
1765 cpk0l.push_back(-k0l[0]);cpk0l.push_back(-k0l[1]);cpk0l.push_back(-k0l[2]);cpk0l.push_back(k0l[3]);
1766 cppim.push_back(-piPlus[0]);cppim.push_back(-piPlus[1]);cppim.push_back(-piPlus[2]);cppim.push_back(piPlus[3]);
1767 cppip.push_back(-piMinus[0]);cppip.push_back(-piMinus[1]);cppip.push_back(-piMinus[2]);cppip.push_back(piMinus[3]);
1768 D0bar = tKLpipi.
Amp_PFT(cpk0l, cppip, cppim);
1773 r2D0 = std::norm(D0bar)/std::norm(D0);
1774 double temp = std::arg(D0)-std::arg(D0bar);
1775 log << MSG::INFO <<
"D0 calculation " << sqrt(r2D0) <<
" "<< temp << endmsg;
1776 while (temp < -TMath::Pi())
1778 temp += 2.0 * TMath::Pi();
1780 while (temp > TMath::Pi())
1782 temp -= 2.0 * TMath::Pi();
1785 deltaD0 = isKsPiPi ? deltaD0 : (deltaD0+
PI);
1787 double cosd =
cos(deltaD0);
1788 double sind =
sin(deltaD0);
1789 if( mpn_gen - mnm_gen > 0. )
1797 r2D0 = std::norm(D0)/std::norm(D0bar);
1798 double temp = std::arg(D0bar)-std::arg(D0);
1799 while (temp < -TMath::Pi())
1801 temp += 2.0 * TMath::Pi();
1803 while (temp > TMath::Pi())
1805 temp -= 2.0 * TMath::Pi();
1808 deltaD0 = isKsPiPi ? deltaD0 : (deltaD0+
PI);
1810 double cosd =
cos( deltaD0 ) ;
1811 double sind =
sin( deltaD0 ) ;
1812 if( mpn_gen - mnm_gen < 0. )
1819 }
else if( decay_mode == k2Pip2Pim ){
1823 HepLorentzVector pip1_4pi = (piPlus_4pi.at(0));
1824 HepLorentzVector pim1_4pi = (piMinus_4pi.at(0));
1825 HepLorentzVector pip2_4pi = (piPlus_4pi.at(1));
1826 HepLorentzVector pim2_4pi = (piMinus_4pi.at(1));
1827 pip1_4pi.boost(-0.011, 0, 0);
1828 pip2_4pi.boost(-0.011, 0, 0);
1829 pim1_4pi.boost(-0.011, 0, 0);
1830 pim2_4pi.boost(-0.011, 0, 0);
1831 std::complex<double> D0, D0bar;
1836 std::vector<double> pip1; pip1.clear(); pip1.push_back(pip1_4pi[0]);pip1.push_back(pip1_4pi[1]);pip1.push_back(pip1_4pi[2]);pip1.push_back(pip1_4pi[3]);
1837 std::vector<double> pim1; pim1.clear(); pim1.push_back(pim1_4pi[0]);pim1.push_back(pim1_4pi[1]);pim1.push_back(pim1_4pi[2]);pim1.push_back(pim1_4pi[3]);
1838 std::vector<double> pip2; pip2.clear(); pip2.push_back(pip2_4pi[0]);pip2.push_back(pip2_4pi[1]);pip2.push_back(pip2_4pi[2]);pip2.push_back(pip2_4pi[3]);
1839 std::vector<double> pim2; pim2.clear(); pim2.push_back(pim2_4pi[0]);pim2.push_back(pim2_4pi[1]);pim2.push_back(pim2_4pi[2]);pim2.push_back(pim2_4pi[3]);
1842 D0 = t2pip2pim.
Amp(pip1,pim1,pip2,pim2);
1847 std::vector<double> cppip1; cppip1.clear(); cppip1.push_back(-pim1_4pi[0]);cppip1.push_back(-pim1_4pi[1]);cppip1.push_back(-pim1_4pi[2]);cppip1.push_back(pim1_4pi[3]);
1848 std::vector<double> cppim1; cppim1.clear(); cppim1.push_back(-pip1_4pi[0]);cppim1.push_back(-pip1_4pi[1]);cppim1.push_back(-pip1_4pi[2]);cppim1.push_back(pip1_4pi[3]);
1849 std::vector<double> cppip2; cppip2.clear(); cppip2.push_back(-pim2_4pi[0]);cppip2.push_back(-pim2_4pi[1]);cppip2.push_back(-pim2_4pi[2]);cppip2.push_back(pim2_4pi[3]);
1850 std::vector<double> cppim2; cppim2.clear(); cppim2.push_back(-pip2_4pi[0]);cppim2.push_back(-pip2_4pi[1]);cppim2.push_back(-pip2_4pi[2]);cppim2.push_back(pip2_4pi[3]);
1852 D0bar = t2pip2pim.
Amp(cppip1, cppim1, cppip2, cppim2);
1856 r2D0 = std::norm(D0bar)/std::norm(D0);
1857 double temp = std::arg(D0)-std::arg(D0bar);
1858 while (temp < -TMath::Pi())
1860 temp += 2.0 * TMath::Pi();
1862 while (temp > TMath::Pi())
1864 temp -= 2.0 * TMath::Pi();
1868 double cosd =
cos(deltaD0);
1869 double sind =
sin(deltaD0);
1878 r2D0 = std::norm(D0)/std::norm(D0bar);
1879 double temp = std::arg(D0bar)-std::arg(D0);
1880 while (temp < -TMath::Pi())
1882 temp += 2.0 * TMath::Pi();
1884 while (temp > TMath::Pi())
1886 temp -= 2.0 * TMath::Pi();
1890 double cosd =
cos( deltaD0 ) ;
1891 double sind =
sin( deltaD0 ) ;
1899 }
else if( decay_mode == kPipPim2Pi0 ){
1904 HepLorentzVector pip1_4pi = (piPlus_4pi.at(0));
1905 HepLorentzVector pim1_4pi = (piMinus_4pi.at(0));
1906 HepLorentzVector pi01_p4 = (pi0_p4.at(0));
1907 HepLorentzVector pi02_p4 = (pi0_p4.at(1));
1908 pip1_4pi.boost(-0.011, 0, 0);
1909 pim1_4pi.boost(-0.011, 0, 0);
1910 pi01_p4.boost(-0.011, 0, 0);
1911 pi02_p4.boost(-0.011, 0, 0);
1912 std::complex<double> D0, D0bar;
1917 std::vector<double> pip1; pip1.clear(); pip1.push_back(pip1_4pi[0]);pip1.push_back(pip1_4pi[1]);pip1.push_back(pip1_4pi[2]);pip1.push_back(pip1_4pi[3]);
1918 std::vector<double> pim1; pim1.clear(); pim1.push_back(pim1_4pi[0]);pim1.push_back(pim1_4pi[1]);pim1.push_back(pim1_4pi[2]);pim1.push_back(pim1_4pi[3]);
1919 std::vector<double> pi01; pi01.clear(); pi01.push_back(pi01_p4[0]);pi01.push_back(pi01_p4[1]);pi01.push_back(pi01_p4[2]);pi01.push_back(pi01_p4[3]);
1920 std::vector<double> pi02; pi02.clear(); pi02.push_back(pi02_p4[0]);pi02.push_back(pi02_p4[1]);pi02.push_back(pi02_p4[2]);pi02.push_back(pi02_p4[3]);
1923 D0 = tpippim2pi0.
Amp(pip1,pim1,pi01,pi02);
1928 std::vector<double> cppip1; cppip1.clear(); cppip1.push_back(-pim1_4pi[0]);cppip1.push_back(-pim1_4pi[1]);cppip1.push_back(-pim1_4pi[2]);cppip1.push_back(pim1_4pi[3]);
1929 std::vector<double> cppim1; cppim1.clear(); cppim1.push_back(-pip1_4pi[0]);cppim1.push_back(-pip1_4pi[1]);cppim1.push_back(-pip1_4pi[2]);cppim1.push_back(pip1_4pi[3]);
1930 std::vector<double> cppi01; cppi01.clear(); cppi01.push_back(-pi01_p4[0]);cppi01.push_back(-pi01_p4[1]);cppi01.push_back(-pi01_p4[2]);cppi01.push_back(pi01_p4[3]);
1931 std::vector<double> cppi02; cppi02.clear(); cppi02.push_back(-pi02_p4[0]);cppi02.push_back(-pi02_p4[1]);cppi02.push_back(-pi02_p4[2]);cppi02.push_back(pi02_p4[3]);
1933 D0bar = tpippim2pi0.
Amp(cppip1, cppim1, cppi01, cppi02);
1937 r2D0 = std::norm(D0bar)/std::norm(D0);
1938 double temp = std::arg(D0)-std::arg(D0bar);
1939 while (temp < -TMath::Pi())
1941 temp += 2.0 * TMath::Pi();
1943 while (temp > TMath::Pi())
1945 temp -= 2.0 * TMath::Pi();
1949 double cosd =
cos(deltaD0);
1950 double sind =
sin(deltaD0);
1959 r2D0 = std::norm(D0)/std::norm(D0bar);
1960 double temp = std::arg(D0bar)-std::arg(D0);
1961 while (temp < -TMath::Pi())
1963 temp += 2.0 * TMath::Pi();
1965 while (temp > TMath::Pi())
1967 temp -= 2.0 * TMath::Pi();
1971 double cosd =
cos( deltaD0 ) ;
1972 double sind =
sin( deltaD0 ) ;
1978 }
else if( decay_mode == kK0PiPiPi0 )
1993 HepLorentzVector pip_kspipipi0 = (piPlus_4pi.at(0));
1994 HepLorentzVector pim_kspipipi0 = (piMinus_4pi.at(0));
1995 HepLorentzVector k0_kspipipi0 = k0;
1996 HepLorentzVector pi0_kspipipi0 = (pi0_p4.at(0));
1997 pip_kspipipi0.boost(-0.011, 0, 0);
1998 pim_kspipipi0.boost(-0.011, 0, 0);
1999 k0_kspipipi0.boost(-0.011, 0, 0);
2000 pi0_kspipipi0.boost(-0.011, 0, 0);
2003 vector<double> k0l;vector<double> pip;vector<double> pim; vector<double> pi0;
2004 k0l.clear();pip.clear();pim.clear();pi0.clear();
2005 k0l.push_back(k0_kspipipi0[0]);k0l.push_back(k0_kspipipi0[1]);k0l.push_back(k0_kspipipi0[2]);k0l.push_back(k0_kspipipi0[3]);
2006 pip.push_back(pip_kspipipi0[0]);pip.push_back(pip_kspipipi0[1]);pip.push_back(pip_kspipipi0[2]);pip.push_back(pip_kspipipi0[3]);
2007 pim.push_back(pim_kspipipi0[0]);pim.push_back(pim_kspipipi0[1]);pim.push_back(pim_kspipipi0[2]);pim.push_back(pim_kspipipi0[3]);
2008 pi0.push_back(pi0_kspipipi0[0]);pi0.push_back(pi0_kspipipi0[1]);pi0.push_back(pi0_kspipipi0[2]);pi0.push_back(pi0_kspipipi0[3]);
2012 D0 = tKSpipipi0.
Amp(k0l,pip,pim,pi0);
2014 vector<double> cpk0l;vector<double> cppip;vector<double> cppim;vector<double> cppi0;
2015 cpk0l.clear();cppip.clear();cppim.clear();cppi0.clear();
2016 cpk0l.push_back(-k0l[0]);cpk0l.push_back(-k0l[1]);cpk0l.push_back(-k0l[2]);cpk0l.push_back(k0l[3]);
2017 cppim.push_back(-pip[0]);cppim.push_back(-pip[1]);cppim.push_back(-pip[2]);cppim.push_back(pip[3]);
2018 cppip.push_back(-pim[0]);cppip.push_back(-pim[1]);cppip.push_back(-pim[2]);cppip.push_back(pim[3]);
2019 cppi0.push_back(-pi0[0]);cppi0.push_back(-pi0[1]);cppi0.push_back(-pi0[2]);cppi0.push_back(pi0[3]);
2020 D0bar = tKSpipipi0.
Amp(cpk0l, cppip, cppim, cppi0);
2023 D0 = tKSpipipi0.
Amp(k0l,pip,pim,pi0);
2025 vector<double> cpk0l;vector<double> cppip;vector<double> cppim;vector<double> cppi0;
2026 cpk0l.clear();cppip.clear();cppim.clear();cppi0.clear();
2027 cpk0l.push_back(-k0l[0]);cpk0l.push_back(-k0l[1]);cpk0l.push_back(-k0l[2]);cpk0l.push_back(k0l[3]);
2028 cppim.push_back(-pip[0]);cppim.push_back(-pip[1]);cppim.push_back(-pip[2]);cppim.push_back(pip[3]);
2029 cppip.push_back(-pim[0]);cppip.push_back(-pim[1]);cppip.push_back(-pim[2]);cppip.push_back(pim[3]);
2030 cppi0.push_back(-pi0[0]);cppi0.push_back(-pi0[1]);cppi0.push_back(-pi0[2]);cppi0.push_back(pi0[3]);
2031 D0bar = tKSpipipi0.
Amp(cpk0l, cppip, cppim, cppi0);
2044 r2D0 = std::norm(D0bar)/std::norm(D0);
2045 double temp = std::arg(D0)-std::arg(D0bar);
2046 log << MSG::INFO <<
"D0 calculation " << sqrt(r2D0) <<
" "<< temp << endmsg;
2047 while (temp < -TMath::Pi())
2049 temp += 2.0 * TMath::Pi();
2051 while (temp > TMath::Pi())
2053 temp -= 2.0 * TMath::Pi();
2056 deltaD0 = isKsPiPiPi0 ? (deltaD0+
PI) : (deltaD0);
2058 double cosd =
cos(deltaD0);
2059 double sind =
sin(deltaD0);
2060 if( mpn_gen - mnm_gen > 0. )
2068 r2D0 = std::norm(D0)/std::norm(D0bar);
2069 double temp = std::arg(D0bar)-std::arg(D0);
2070 while (temp < -TMath::Pi())
2072 temp += 2.0 * TMath::Pi();
2074 while (temp > TMath::Pi())
2076 temp -= 2.0 * TMath::Pi();
2079 deltaD0 = isKsPiPiPi0 ? (deltaD0+
PI) : (deltaD0);
2081 double cosd =
cos( deltaD0 ) ;
2082 double sind =
sin( deltaD0 ) ;
2083 if( mpn_gen - mnm_gen < 0. )
2090 }
else if( decay_mode == kKKPiPi ){
2095 vector<double> kp; vector<double> km; vector<double> pip;vector<double> pim;
2097 pip.clear();pim.clear();
2098 kp.clear();km.clear();
2100 HepLorentzVector pip_kkpipi = (piPlus_4pi.at(0));
2101 HepLorentzVector pim_kkpipi = (piMinus_4pi.at(0));
2102 HepLorentzVector kp_kkpipi = (kPlus_kkpipi.at(0));
2103 HepLorentzVector km_kkpipi = (kMinus_kkpipi.at(0));
2105 pip.push_back(pip_kkpipi[0]);pip.push_back(pip_kkpipi[1]);pip.push_back(pip_kkpipi[2]);pip.push_back(pip_kkpipi[3]);
2106 pim.push_back(pim_kkpipi[0]);pim.push_back(pim_kkpipi[1]);pim.push_back(pim_kkpipi[2]);pim.push_back(pim_kkpipi[3]);
2107 kp.push_back(kp_kkpipi[0]);kp.push_back(kp_kkpipi[1]);kp.push_back(kp_kkpipi[2]);kp.push_back(kp_kkpipi[3]);
2108 km.push_back(km_kkpipi[0]);km.push_back(km_kkpipi[1]);km.push_back(km_kkpipi[2]);km.push_back(km_kkpipi[3]);
2110 pdau[0]=kp_kkpipi[0]; pdau[1]=kp_kkpipi[1]; pdau[2]=kp_kkpipi[2]; pdau[3]=kp_kkpipi[3];
2111 pdau[4]=km_kkpipi[0]; pdau[5]=km_kkpipi[1]; pdau[6]=km_kkpipi[2]; pdau[7]=km_kkpipi[3];
2112 pdau[8]=pip_kkpipi[0];pdau[9]=pip_kkpipi[1];pdau[10]=pip_kkpipi[2];pdau[11]=pip_kkpipi[3];
2113 pdau[12]=pim_kkpipi[0];pdau[13]=pim_kkpipi[1];pdau[14]=pim_kkpipi[2];pdau[15]=pim_kkpipi[3];
2116 D0 = tKKpipi.
AMP(pdau,1);
2118 pdau[0]=-km_kkpipi[0]; pdau[1]=-km_kkpipi[1]; pdau[2]=-km_kkpipi[2]; pdau[3]=km_kkpipi[3];
2119 pdau[4]=-kp_kkpipi[0]; pdau[5]=-kp_kkpipi[1]; pdau[6]=-kp_kkpipi[2]; pdau[7]=kp_kkpipi[3];
2120 pdau[8]=-pim_kkpipi[0]; pdau[9]=-pim_kkpipi[1]; pdau[10]=-pim_kkpipi[2];pdau[11]=pim_kkpipi[3];
2121 pdau[12]=-pip_kkpipi[0];pdau[13]=-pip_kkpipi[1];pdau[14]=-pip_kkpipi[2];pdau[15]=pip_kkpipi[3];
2122 D0bar = tKKpipi.
AMP(pdau,1);
2126 r2D0 = std::norm(D0bar)/std::norm(D0);
2127 double temp = std::arg(D0)-std::arg(D0bar);
2128 log << MSG::INFO <<
"D0 calculation " << sqrt(r2D0) <<
" "<< temp << endmsg;
2129 while (temp < -TMath::Pi())
2131 temp += 2.0 * TMath::Pi();
2133 while (temp > TMath::Pi())
2135 temp -= 2.0 * TMath::Pi();
2140 r2D0 = std::norm(D0)/std::norm(D0bar);
2141 double temp = std::arg(D0bar)-std::arg(D0);
2142 while (temp < -TMath::Pi())
2144 temp += 2.0 * TMath::Pi();
2146 while (temp > TMath::Pi())
2148 temp -= 2.0 * TMath::Pi();
2153 }
else if(
num[ kLeptonPlus ] == 1 )
2155 decay_mode = kSLPlus ;
2161 else if(
num[ kLeptonMinus ] == 1 )
2163 decay_mode = kSLMinus ;
2171 ( nDaughters == 2 &&
2172 ( (
num[ kPiPlus ] == 1 &&
num[ kPiMinus ] == 1 ) ||
2174 num[ kNeutralScalar ] == 2 ||
2175 ( nUFP0 == 1 && nUFV0 == 1 ) ||
2176 (
num[ kKPlus ] == 1 &&
num[ kKMinus ] == 1 ) ||
2179 (
num[ kK0L ] == 1 && nUFP0 == 1 ) ||
2180 (
num[ kK0S ] == 1 &&
num[ kNeutralScalar ] == 1 ) ||
2181 (
num[ kK0L ] == 1 && nUFV0 == 1 ) ||
2182 (
num[ kUFVPlus ] ==1 &&
num [ kPiMinus ] == 1 ) ||
2183 (
num[ kUFVMinus ] ==1 &&
num [ kPiPlus ] == 1 ) ) ) ||
2184 ( nDaughters == 3 &&
2185 ( (
num[ kPiPlus ] == 1 &&
num[ kPiMinus ] == 1 &&
num[ kPi0 ] == 1 ) ||
2186 ( nCPPlusEig == 1 &&
num[ kPi0 ] == 2 ) ||
2187 (
num[ kK0S ] == 3 ) || (
num[ kK0S ] == 1 &&
num[ kK0L ] == 2 ) ||
2188 (
num[ kK0S ] == 1 &&
num[ kK0L ] == 1 && nUFP0 == 1 ) ||
2189 (
num[ kK0S ] == 1 && nUFP0 == 2 )
2191 ( nDaughters == 4 &&
2192 (
num[ kK0L ] == 1 && nUFP0 == 3 )||
2193 ( (
num[ kK0S ] == 2 ||
num[ kK0L ] == 2 ) && nUFP0 == 2 ) )
2196 decay_mode = kCPPlus ;
2202 else if((
num[ kPiPlus ] == 1 &&
num[ kPiMinus ] == 1 &&
num[ kPi0 ] == 1 ) ){
2204 decay_mode = kCPPlus ;
2213 ( nDaughters == 2 &&
2214 ( (
num[ kK0S ] == 1 && nUFP0 == 1 ) ||
2215 (
num[ kK0L ] == 1 &&
num[ kNeutralScalar ] == 1 ) ||
2216 (
num[ kK0S ] == 1 && nUFV0 == 1 ) ||
2217 (
num[ kNeutralScalar ] == 1 && nUFV0 == 1 ) ||
2218 ( nUFP0 == 1 &&
num[ kNeutralScalar ] == 1 ) ) ) ||
2219 ( nDaughters == 3 &&
2220 ( ( nCPMinusEig == 3 &&
num[ kPi0 ] == 2 ) ||
2221 (
num[ kPi0 ] == 3 ) ||
2222 (
num[ kK0L ] == 3 ) || (
num[ kK0S ] == 2 &&
num[ kK0L ] == 1 ) ||
2223 ( (
num[ kK0S ] == 2 ||
num[ kK0L ] == 2 ) && nUFP0 == 1 ) ||
2224 (
num[ kK0L ] == 1 && nUFP0 == 2 ) ) ) ||
2225 ( nDaughters == 4 &&
2226 (
num[ kK0S ] == 1 &&
num[ kPi0 ] == 3 )|| ( (
num[ kK0S ] == 1 &&
num[ kK0L ] == 1 ) && nUFP0 == 2 ) )
2229 decay_mode = kCPMinus ;
2235 else if( nStrange == nAntiStrange + 1 )
2237 if(m_debug)cout<< nDaughters <<endl;
2238 if(m_debug)cout<<
num[ kKMinus ]<<endl;
2239 if(m_debug)cout<<
num[ kPiMinus ]<<endl;
2240 if(m_debug)cout<<
num[ kPiPlus ]<<endl;
2243 if( (
num[ kKMinus ] == 1 &&
num[ kPiPlus ] == 2 &&
num[ kPiMinus ] == 1 ) && nDaughters == 4 ){
2244 if(m_debug)cout<<
"True K-3Pi "<<endl;
2245 decay_mode = kFlavoredCF_3 ;
2249 vector<double> kp; vector<double> pi1; vector<double> pi2;vector<double> pi3;
2251 pi1.clear();pi2.clear();pi3.clear();
2254 HepLorentzVector kp_kpipipi = (kMinus_kkpipi.at(0));
2255 HepLorentzVector pi1_kpipipi = (piPlus_4pi.at(0));
2256 HepLorentzVector pi2_kpipipi = (piPlus_4pi.at(1));
2257 HepLorentzVector pi3_kpipipi = (piMinus_4pi.at(0));
2259 kp.push_back( kp_kpipipi[0]); kp.push_back(kp_kpipipi[1]); kp.push_back(kp_kpipipi[2]); kp.push_back(kp_kpipipi[3]);
2260 pi1.push_back(pi1_kpipipi[0]);pi1.push_back(pi1_kpipipi[1]);pi1.push_back(pi1_kpipipi[2]);pi1.push_back(pi1_kpipipi[3]);
2261 pi2.push_back(pi2_kpipipi[0]);pi2.push_back(pi2_kpipipi[1]);pi2.push_back(pi2_kpipipi[2]);pi2.push_back(pi2_kpipipi[3]);
2262 pi3.push_back(pi3_kpipipi[0]);pi3.push_back(pi3_kpipipi[1]);pi3.push_back(pi3_kpipipi[2]);pi3.push_back(pi3_kpipipi[3]);
2264 pdau[0]=kp[0]; pdau[1]=kp[1]; pdau[2]=kp[2] ; pdau[3]=kp[3];
2265 pdau[4]=pi1[0]; pdau[5]=pi1[1]; pdau[6]=pi1[2]; pdau[7]=pi1[3];
2266 pdau[8]=pi2[0]; pdau[9]=pi2[1]; pdau[10]=pi2[2];pdau[11]=pi2[3];
2267 pdau[12]=pi3[0];pdau[13]=pi3[1];pdau[14]=pi3[2];pdau[15]=pi3[3];
2270 D0 = tKpipipi.
AMP(pdau,1);
2273 std::complex<double> dcs_offset = 0.0601387 *
exp( std::complex<double>(0,1) * 1.04827 *
M_PI / 180. );
2274 D0bar = dcs_offset*tpiKpipi.
AMP(pdau,1);
2275 deltaD0 = ( std::arg(D0 * std::conj(D0bar)) + m_dCF_3 );
2276 r2D0 = std::norm(D0bar)/std::norm(D0);
2278 }
else if( (
num[ kKMinus ] == 1 &&
num[ kPiPlus ] == 1 &&
num[ kPi0 ] == 1 ) && nDaughters == 3 ){
2279 decay_mode = kFlavoredCF_1 ;
2281 r2D0 = pow(m_rCF_1,2) ;
2286 if(m_debug)cout<<
"True K-Pi "<<endl;
2287 decay_mode = kFlavoredCF_0 ;
2289 r2D0 = pow(m_rCF_0,2) ;
2296 if( (
num[ kKMinus ] == 1 &&
num[ kPiPlus ] == 2 &&
num[ kPiMinus ] == 1 ) && nDaughters == 4 ){
2297 decay_mode = kFlavoredCF_3 ;
2301 vector<double> kp; vector<double> pi1; vector<double> pi2;vector<double> pi3;
2303 pi1.clear();pi2.clear();pi3.clear();
2306 HepLorentzVector kp_kpipipi = (kMinus_kkpipi.at(0));
2307 HepLorentzVector pi1_kpipipi = (piPlus_4pi.at(0));
2308 HepLorentzVector pi2_kpipipi = (piPlus_4pi.at(1));
2309 HepLorentzVector pi3_kpipipi = (piMinus_4pi.at(0));
2311 kp.push_back( kp_kpipipi[0]); kp.push_back(kp_kpipipi[1]); kp.push_back(kp_kpipipi[2]); kp.push_back(kp_kpipipi[3]);
2312 pi1.push_back(pi1_kpipipi[0]);pi1.push_back(pi1_kpipipi[1]);pi1.push_back(pi1_kpipipi[2]);pi1.push_back(pi1_kpipipi[3]);
2313 pi2.push_back(pi2_kpipipi[0]);pi2.push_back(pi2_kpipipi[1]);pi2.push_back(pi2_kpipipi[2]);pi2.push_back(pi2_kpipipi[3]);
2314 pi3.push_back(pi3_kpipipi[0]);pi3.push_back(pi3_kpipipi[1]);pi3.push_back(pi3_kpipipi[2]);pi3.push_back(pi3_kpipipi[3]);
2316 pdau[0]=kp[0]; pdau[1]=kp[1]; pdau[2]=kp[2] ; pdau[3]=kp[3];
2317 pdau[4]=pi1[0]; pdau[5]=pi1[1]; pdau[6]=pi1[2]; pdau[7]=pi1[3];
2318 pdau[8]=pi2[0]; pdau[9]=pi2[1]; pdau[10]=pi2[2];pdau[11]=pi2[3];
2319 pdau[12]=pi3[0];pdau[13]=pi3[1];pdau[14]=pi3[2];pdau[15]=pi3[3];
2322 D0 = tKpipipi.
AMP(pdau,1);
2325 std::complex<double> dcs_offset = 0.0601387 *
exp( std::complex<double>(0,1) * 1.04827 *
M_PI / 180. );
2326 D0bar = dcs_offset*tpiKpipi.
AMP(pdau,1);
2327 deltaD0 = - ( std::arg(D0 * std::conj(D0bar)) + m_dCF_3 );
2328 r2D0 = std::norm(D0)/std::norm(D0bar);
2330 }
else if( (
num[ kKMinus ] == 1 &&
num[ kPiPlus ] == 1 &&
num[ kPi0 ] == 1 ) && nDaughters == 3 ){
2331 decay_mode = kFlavoredCF_1 ;
2333 r2D0 = 1. / pow( m_rCF_1,2 ) ;
2338 decay_mode = kFlavoredCF_0 ;
2340 r2D0 = 1. / pow( m_rCF_0,2 ) ;
2346 else if( nAntiStrange == nStrange + 1 )
2350 if( (
num[ kKPlus ] == 1 &&
num[ kPiMinus ] == 2 &&
num[ kPiPlus ] == 1 ) && nDaughters == 4 ){
2351 decay_mode = kFlavoredCFBar_3 ;
2355 vector<double> kp; vector<double> pi1; vector<double> pi2;vector<double> pi3;
2357 pi1.clear();pi2.clear();pi3.clear();
2360 HepLorentzVector kp_kpipipi = (kPlus_kkpipi.at(0));
2361 HepLorentzVector pi1_kpipipi = (piMinus_4pi.at(0));
2362 HepLorentzVector pi2_kpipipi = (piMinus_4pi.at(1));
2363 HepLorentzVector pi3_kpipipi = (piPlus_4pi.at(0));
2365 kp.push_back( -kp_kpipipi[0]); kp.push_back(-kp_kpipipi[1]); kp.push_back(-kp_kpipipi[2]); kp.push_back(kp_kpipipi[3]);
2366 pi1.push_back(-pi1_kpipipi[0]);pi1.push_back(-pi1_kpipipi[1]);pi1.push_back(-pi1_kpipipi[2]);pi1.push_back(pi1_kpipipi[3]);
2367 pi2.push_back(-pi2_kpipipi[0]);pi2.push_back(-pi2_kpipipi[1]);pi2.push_back(-pi2_kpipipi[2]);pi2.push_back(pi2_kpipipi[3]);
2368 pi3.push_back(-pi3_kpipipi[0]);pi3.push_back(-pi3_kpipipi[1]);pi3.push_back(-pi3_kpipipi[2]);pi3.push_back(pi3_kpipipi[3]);
2370 pdau[0]=kp[0]; pdau[1]=kp[1]; pdau[2]=kp[2] ; pdau[3]=kp[3];
2371 pdau[4]=pi1[0]; pdau[5]=pi1[1]; pdau[6]=pi1[2]; pdau[7]=pi1[3];
2372 pdau[8]=pi2[0]; pdau[9]=pi2[1]; pdau[10]=pi2[2];pdau[11]=pi2[3];
2373 pdau[12]=pi3[0];pdau[13]=pi3[1];pdau[14]=pi3[2];pdau[15]=pi3[3];
2376 D0 = tKpipipi.
AMP(pdau,1);
2379 std::complex<double> dcs_offset = 0.0601387 *
exp( std::complex<double>(0,1) * 1.04827 *
M_PI / 180. );
2380 D0bar = dcs_offset*tpiKpipi.
AMP(pdau,1);
2381 deltaD0 = ( std::arg(D0 * std::conj(D0bar)) + m_dCF_3 );
2382 r2D0 = std::norm(D0bar)/std::norm(D0);
2385 }
else if( (
num[ kKPlus ] == 1 &&
num[ kPiMinus ] == 1 &&
num[ kPi0 ] == 1 ) && nDaughters == 3 ){
2386 decay_mode = kFlavoredCFBar_1 ;
2388 r2D0 = pow(m_rCF_1,2) ;
2393 decay_mode = kFlavoredCFBar_0 ;
2395 r2D0 = pow(m_rCF_0,2) ;
2402 if( (
num[ kKPlus ] == 1 &&
num[ kPiMinus ] == 2 &&
num[ kPiPlus ] == 1 ) && nDaughters == 4 ){
2403 decay_mode = kFlavoredCFBar_3 ;
2407 vector<double> kp; vector<double> pi1; vector<double> pi2;vector<double> pi3;
2409 pi1.clear();pi2.clear();pi3.clear();
2412 HepLorentzVector kp_kpipipi = (kPlus_kkpipi.at(0));
2413 HepLorentzVector pi1_kpipipi = (piMinus_4pi.at(0));
2414 HepLorentzVector pi2_kpipipi = (piMinus_4pi.at(1));
2415 HepLorentzVector pi3_kpipipi = (piPlus_4pi.at(0));
2417 kp.push_back( -kp_kpipipi[0]); kp.push_back(-kp_kpipipi[1]); kp.push_back(-kp_kpipipi[2]); kp.push_back(kp_kpipipi[3]);
2418 pi1.push_back(-pi1_kpipipi[0]);pi1.push_back(-pi1_kpipipi[1]);pi1.push_back(-pi1_kpipipi[2]);pi1.push_back(pi1_kpipipi[3]);
2419 pi2.push_back(-pi2_kpipipi[0]);pi2.push_back(-pi2_kpipipi[1]);pi2.push_back(-pi2_kpipipi[2]);pi2.push_back(pi2_kpipipi[3]);
2420 pi3.push_back(-pi3_kpipipi[0]);pi3.push_back(-pi3_kpipipi[1]);pi3.push_back(-pi3_kpipipi[2]);pi3.push_back(pi3_kpipipi[3]);
2422 pdau[0]=kp[0]; pdau[1]=kp[1]; pdau[2]=kp[2] ; pdau[3]=kp[3];
2423 pdau[4]=pi1[0]; pdau[5]=pi1[1]; pdau[6]=pi1[2]; pdau[7]=pi1[3];
2424 pdau[8]=pi2[0]; pdau[9]=pi2[1]; pdau[10]=pi2[2];pdau[11]=pi2[3];
2425 pdau[12]=pi3[0];pdau[13]=pi3[1];pdau[14]=pi3[2];pdau[15]=pi3[3];
2428 D0 = tKpipipi.
AMP(pdau,1);
2431 std::complex<double> dcs_offset = 0.0601387 *
exp( std::complex<double>(0,1) * 1.04827 *
M_PI / 180. );
2432 D0bar = dcs_offset*tpiKpipi.
AMP(pdau,1);
2433 deltaD0 = - ( std::arg(D0 * std::conj(D0bar)) + m_dCF_3 );
2434 r2D0 = std::norm(D0)/std::norm(D0bar);
2436 }
else if( (
num[ kKPlus ] == 1 &&
num[ kPiMinus ] == 1 &&
num[ kPi0 ] == 1 ) && nDaughters == 3 ){
2437 decay_mode = kFlavoredCFBar_1 ;
2439 r2D0 = 1. / pow( m_rCF_1,2 ) ;
2444 decay_mode = kFlavoredCFBar_0 ;
2446 r2D0 = 1. / pow( m_rCF_0,2 ) ;
2452 else if( nStrange == nAntiStrange )
2454 if( (
num[ kKPlus ] > 0 &&
2455 (
num[ kKPlus ] ==
num[ kFVMinus ] ||
2456 num[ kKPlus ] == nFV0Bar ) ) ||
2460 (
num[ kPiPlus ] > 0 &&
2461 num[ kPiPlus ] ==
num[ kUFVMinus ] ) )
2463 decay_mode = kFlavoredCS ;
2468 r2D0 = pow( m_rCS, 2 ) ;
2473 r2D0 = 1. / pow( m_rCS, 2 ) ;
2477 else if( (
num[ kKMinus ] > 0 && (
num[ kKMinus ] ==
num[ kFVPlus ] ||
num[ kKMinus ] == nFV0 ) ) ||
2478 ( nK0 > 0 && nFV0 != nFV0Bar && nK0 == nFV0 ) ||
2479 (
num[ kPiMinus ] > 0 &&
num[ kPiMinus ] ==
num[ kUFVPlus ] ) )
2481 decay_mode = kFlavoredCSBar ;
2486 r2D0 = pow( m_rCS, 2 ) ;
2491 r2D0 = 1. / pow( m_rCS, 2 ) ;
2499 else if( ( nDaughters >= 3 &&
num[ kPiPlus ] ==
num[ kPiMinus ] &&
2500 num[ kKPlus ] ==
num[ kKMinus ] && nChargedPiK + nCPEig == nDaughters ) ||
2501 nUFV0 == nDaughters ||
2502 (
num[ kKStar0 ] > 0 &&
num[ kKStar0 ] ==
num[ kKStar0Bar ] ) ||
2503 (
num[ kK10 ] > 0 &&
num[ kK10 ] ==
num[ kK10Bar ] ) ||
2504 (
num[ kUFVPlus ] == 1 &&
num[ kUFVMinus ] == 1 )
2508 log << MSG::DEBUG <<
" [ Self-conjugate mixed-CP ]" << endmsg ;
2510 if( RandFlat::shoot() > 0.5 )
2512 if( RandFlat::shoot() > 0.5 )
2514 decay_mode = kCPPlus ;
2522 decay_mode = kCPMinus ;
2539 cutoff = 1. - cutoff ;
2542 log << MSG::DEBUG <<
" [ cutoff = " << cutoff <<
" ]" << endmsg ;
2544 decay_mode = ( RandFlat::shoot() > cutoff ) ? kFlavoredCF_0 : kFlavoredCFBar_0 ;
2546 if( ( decay_mode == kFlavoredCF_0 && charm == 1 ) ||
2547 ( decay_mode == kFlavoredCFBar_0 && charm == -1 ) )
2551 r2D0 = sqrt( m_rCF_0 ) ;
2558 r2D0 = 1. / sqrt( m_rCF_0 ) ;
2569 cutoff = 1. - cutoff ;
2572 log << MSG::DEBUG <<
" [ cutoff = " << cutoff <<
" ]" << endmsg ;
2574 decay_mode = ( RandFlat::shoot() > cutoff ) ?
2575 kFlavoredCS : kFlavoredCSBar ;
2578 if( ( decay_mode == kFlavoredCS && charm == 1 ) ||
2579 ( decay_mode == kFlavoredCSBar && charm == -1 ) )
2581 r2D0 = sqrt( m_rCS ) ;
2586 r2D0 = 1. / sqrt( m_rCS ) ;
2594 if (
num[kUnknown] >= 1)
2596 cout <<
"decay mode " << decay_mode << endl ;
2597 cout <<
"D #" << charm << endl ;
2598 cout <<
"pi+: " <<
num[ kPiPlus ] << endl ;
2599 cout <<
"pi-: " <<
num[ kPiMinus ] << endl ;
2600 cout <<
"pi0: " <<
num[ kPi0 ] << endl ;
2601 cout <<
"eta: " <<
num[ kEta ] << endl ;
2602 cout <<
"eta': " <<
num[ kEtaPrime ] << endl ;
2603 cout <<
"f0/a0: " <<
num[ kNeutralScalar ] << endl ;
2604 cout <<
"UFV+: " <<
num[ kUFVPlus ] << endl ;
2605 cout <<
"UFV-: " <<
num[ kUFVMinus ] << endl ;
2606 cout <<
"rho0: " <<
num[ kRho0 ] << endl ;
2607 cout <<
"omega: " <<
num[ kOmega ] << endl ;
2608 cout <<
"phi: " <<
num[ kPhi ] << endl ;
2609 cout <<
"K+: " <<
num[ kKPlus ] << endl ;
2610 cout <<
"K-: " <<
num[ kKMinus ] << endl ;
2611 cout <<
"K0S: " <<
num[ kK0S ] << endl ;
2612 cout <<
"K0L: " <<
num[ kK0L ] << endl ;
2613 cout <<
"FV+: " <<
num[ kFVPlus ] << endl ;
2614 cout <<
"FV-: " <<
num[ kFVMinus ] << endl ;
2615 cout <<
"K*0: " <<
num[ kKStar0 ] << endl ;
2616 cout <<
"K*0b: " <<
num[ kKStar0Bar ] << endl ;
2617 cout <<
"K10: " <<
num[ kK10 ] << endl ;
2618 cout <<
"K10b: " <<
num[ kK10Bar ] << endl ;
2619 cout <<
"l+: " <<
num[ kLeptonPlus ] << endl ;
2620 cout <<
"l-: " <<
num[ kLeptonMinus ] << endl ;
2621 cout <<
"nu: " <<
num[ kNeutrino ] << endl ;
2622 cout <<
"gamma: " <<
num[ kGamma ] << endl ;
2623 cout <<
"Unknown: " <<
num[ 25 ] << endl ;
2627 d0_info[0]=decay_mode;
2634 d0_info[7]= double (isKsPiPi);
double sin(const BesAngle a)
double cos(const BesAngle a)
complex< double > TComplex
Evt3Rank3C conj(const Evt3Rank3C &t2)
double imag(const EvtComplex &c)
EvtComplex exp(const EvtComplex &c)
*******INTEGER m_nBinMax INTEGER m_NdiMax !No of bins in histogram for cell exploration division $ !Last vertex $ !Last active cell $ !Last cell in buffer $ !No of sampling when dividing cell $ !No of function total $ !Flag for random ceel for $ !Flag for type of for WtMax $ !Flag which decides whether vertices are included in the sampling $ entire domain is hyp !Maximum effective eevents per bin
*********Class see also m_nmax DOUBLE PRECISION m_MasPhot DOUBLE PRECISION m_phsu DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_r2 DOUBLE PRECISION m_WtMass INTEGER m_nmax INTEGER m_Nevgen INTEGER m_IsFSR INTEGER m_MarTot *COMMON c_KarFin $ !Output file $ !Event serial number $ !alpha QED at Thomson limit $ !minimum energy at CMS for remooval $ !infrared dimensionless $ !dummy photon IR regulator $ !crude photon multiplicity enhancement factor *EVENT $ !MC crude volume of PhhSpace *Sfactors $ !YFS formfactor IR part only $ !YFS formfactor non IR finite part $ !mass weight
NTuple::Array< double > m_x
NTuple::Array< double > m_y
double Pip2Pim2Numer1_fil
double m_PipPim2Pi0Numer2
HepMatrix m_modeCounter(19, 19, 0)
double PipPim2Pi0Denom_fil
double m_PipPim2Pi0Numer1
double PipPim2Pi0Numer1_fil
double Pip2Pim2Numer2_fil
HepSymMatrix m_weights(18, 0)
double KSPiPiPi0Denom_fil
double KSPiPiPi0Numer1_fil
double PipPim2Pi0Numer2_fil
double KSPiPiPi0Numer2_fil
HepMatrix m_keptModeCounter(19, 19, 0)
***************************************************************************************Pseudo Class RRes *****************************************************************************************Parameters and physical constants **Maarten sept ************************************************************************DOUBLE PRECISION xsmu **************************************************************************PARTICLE DATA all others are from PDG *Only resonances with known widths into electron pairs are sept ************************************************************************C Declarations xmb DOUBLE PRECISION xcb DOUBLE PRECISION xmpi0
complex< double > Amp(vector< double > Pip1, vector< double > Pim1, vector< double > Pip2, vector< double > Pim2)
complex< double > AMP(double const *x0, const int &x1)
complex< double > Amp_PFT(vector< double > k0l, vector< double > pip, vector< double > pim)
complex< double > Amp_PFT(vector< double > k0l, vector< double > pip, vector< double > pim)
complex< double > Amp(vector< double > ks0, vector< double > pip, vector< double > pim, vector< double > pi0)
std::complex< double > AMP(const double *x0, const int &x1)
complex< double > AMP(double const *x0, const int &x1)
complex< double > Amp(vector< double > Pip, vector< double > Pim, vector< double > Pi01, vector< double > Pi02)
const McParticle & mother() const
access to the mother particle
StdHepId particleProperty() const
Retrieve particle property.
std::vector< double > findD0Decay(int charm)
_EXTERN_ std::string McParticleCol