1 // $Id: EvtSSD_DirectCP.cpp,v 1.2 2009-03-16 16:24:05 robbep Exp $
2 // Generation of direct CP violation in hadronic environment
3 // Patrick Robbe, LHCb, 08 Nov 2006
6 #include "EvtGenBase/EvtParticle.hh"
7 #include "EvtGenBase/EvtRandom.hh"
8 #include "EvtGenBase/EvtGenKine.hh"
9 #include "EvtGenBase/EvtCPUtil.hh"
10 #include "EvtGenBase/EvtPDL.hh"
11 #include "EvtGenBase/EvtReport.hh"
12 #include "EvtGenBase/EvtVector4C.hh"
13 #include "EvtGenBase/EvtTensor4C.hh"
14 #include "EvtGenModels/EvtSSD_DirectCP.hh"
16 #include "EvtGenBase/EvtConst.hh"
18 EvtSSD_DirectCP::~EvtSSD_DirectCP() {}
20 std::string EvtSSD_DirectCP::getName( ){
22 return "SSD_DirectCP" ;
27 EvtDecayBase* EvtSSD_DirectCP::clone(){
29 return new EvtSSD_DirectCP;
33 void EvtSSD_DirectCP::init(){
35 // check that there is 1 argument and 2-body decay
40 EvtSpinType::spintype d1type=EvtPDL::getSpinType(getDaug(0));
41 EvtSpinType::spintype d2type=EvtPDL::getSpinType(getDaug(1));
43 if ( (!(d1type == EvtSpinType::SCALAR || d2type == EvtSpinType::SCALAR))||
44 (!((d2type==EvtSpinType::SCALAR)||(d2type==EvtSpinType::VECTOR)||
45 (d2type==EvtSpinType::TENSOR)))||
46 (!((d1type==EvtSpinType::SCALAR)||(d1type==EvtSpinType::VECTOR)||
47 (d1type==EvtSpinType::TENSOR)))
49 report(ERROR,"EvtGen") << "EvtSSD_DirectCP generator expected "
50 << "one of the daugters to be a scalar, "
51 << "the other either scalar, vector, or tensor, "
53 << EvtPDL::name(getDaug(0)).c_str()
55 <<EvtPDL::name(getDaug(1)).c_str()<<std::endl;
56 report(ERROR,"EvtGen") << "Will terminate execution!"<<std::endl;
60 _acp = getArg( 0 ) ; // A_CP defined as A_CP = (BR(fbar)-BR(f))/(BR(fbar)+BR(f))
64 void EvtSSD_DirectCP::initProbMax() {
65 double theProbMax = 1. ;
67 EvtSpinType::spintype d2type=EvtPDL::getSpinType(getDaug(1));
68 EvtSpinType::spintype d1type=EvtPDL::getSpinType(getDaug(0));
69 if (d1type==EvtSpinType::TENSOR||d2type==EvtSpinType::TENSOR) theProbMax*=10;
71 setProbMax(theProbMax);
74 void EvtSSD_DirectCP::decay( EvtParticle *p) {
79 // decide it is B or Bbar:
80 if ( EvtRandom::Flat(0.,1.) < ( ( 1. - _acp ) / 2. ) ) {
82 if ( EvtPDL::getStdHep( getParentId() ) < 0 ) flip = true ;
85 if ( EvtPDL::getStdHep( getParentId() ) > 0 ) flip = true ;
89 if ( ( isB0Mixed( p ) ) || ( isBsMixed( p ) ) ) {
91 ->setId( EvtPDL::chargeConj( p->getParent()->getId() ) ) ;
92 p->setId( EvtPDL::chargeConj( p->getId() ) ) ;
95 p->setId( EvtPDL::chargeConj( p->getId() ) ) ;
104 daugs[0]=EvtPDL::chargeConj(getDaug(0));
105 daugs[1]=EvtPDL::chargeConj(getDaug(1));
109 p->initializePhaseSpace(2, daugs);
111 EvtVector4R p4_parent=p->getP4Restframe();
112 double m_parent=p4_parent.mass();
114 EvtSpinType::spintype d2type=EvtPDL::getSpinType(getDaug(1));
119 if (d2type==EvtSpinType::SCALAR){
120 d2type=EvtPDL::getSpinType(getDaug(0));
123 moms = p->getDaug(1)->getP4();
128 moms = p->getDaug(0)->getP4();
131 if (d2type==EvtSpinType::SCALAR) {
135 if (d2type==EvtSpinType::VECTOR) {
137 double norm=momv.mass()/(momv.d3mag()*p->mass());
139 vertex(0,norm*p4_parent*(d->epsParent(0)));
140 vertex(1,norm*p4_parent*(d->epsParent(1)));
141 vertex(2,norm*p4_parent*(d->epsParent(2)));
145 if (d2type==EvtSpinType::TENSOR) {
148 d->mass()*d->mass()/(m_parent*d->getP4().d3mag()*d->getP4().d3mag());
151 vertex(0,norm*d->epsTensorParent(0).cont1(p4_parent)*p4_parent);
152 vertex(1,norm*d->epsTensorParent(1).cont1(p4_parent)*p4_parent);
153 vertex(2,norm*d->epsTensorParent(2).cont1(p4_parent)*p4_parent);
154 vertex(3,norm*d->epsTensorParent(3).cont1(p4_parent)*p4_parent);
155 vertex(4,norm*d->epsTensorParent(4).cont1(p4_parent)*p4_parent);
159 bool EvtSSD_DirectCP::isB0Mixed ( EvtParticle * p ) {
160 if ( ! ( p->getParent() ) ) return false ;
162 static EvtId B0 =EvtPDL::getId("B0");
163 static EvtId B0B=EvtPDL::getId("anti-B0");
165 if ( ( p->getId() != B0 ) && ( p->getId() != B0B ) ) return false ;
167 if ( ( p->getParent()->getId() == B0 ) ||
168 ( p->getParent()->getId() == B0B ) ) return true ;
173 bool EvtSSD_DirectCP::isBsMixed ( EvtParticle * p ) {
174 if ( ! ( p->getParent() ) ) return false ;
176 static EvtId BS0=EvtPDL::getId("B_s0");
177 static EvtId BSB=EvtPDL::getId("anti-B_s0");
179 if ( ( p->getId() != BS0 ) && ( p->getId() != BSB ) ) return false ;
181 if ( ( p->getParent()->getId() == BS0 ) ||
182 ( p->getParent()->getId() == BSB ) ) return true ;
187 std::string EvtSSD_DirectCP::getParamName(int i) {