LCOV - code coverage report
Current view: top level - TEvtGen/EvtGen/EvtGenModels - EvtBToDDalitzCPK.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 66 0.0 %
Date: 2016-06-14 17:26:59 Functions: 0 8 0.0 %

          Line data    Source code
       1             : // $Id: EvtBToDDalitzCPK.cpp,v 1.2 2009-03-16 16:28:42 robbep Exp $
       2             : // Include files 
       3             : #include "EvtGenBase/EvtPDL.hh"
       4             : #include "EvtGenBase/EvtParticle.hh"
       5             : #include "EvtGenBase/EvtVector4C.hh"
       6             : 
       7             : // local
       8             : #include "EvtGenModels/EvtBToDDalitzCPK.hh"
       9             : 
      10             : //-----------------------------------------------------------------------------
      11             : // Implementation file for class : EvtBToDDalitzCPK
      12             : // Decay Model for B->D0K with D0->Ks pi+ pi-
      13             : // it is just a way to get the arguments... 
      14             : // Works also for other B->D0K decays...
      15             : // 2003-12-08 : Patrick Robbe
      16             : //-----------------------------------------------------------------------------
      17             : 
      18             : //=============================================================================
      19             : // Standard destructor
      20             : //=============================================================================
      21           0 : EvtBToDDalitzCPK::~EvtBToDDalitzCPK ( ) { }
      22             : //=============================================================================
      23             : // Name of the model
      24             : //=============================================================================
      25             : std::string EvtBToDDalitzCPK::getName( ) 
      26             : {
      27           0 :   return "BTODDALITZCPK" ;
      28             : }
      29             : //=============================================================================
      30             : // Clone method
      31             : //=============================================================================
      32             : EvtDecayBase * EvtBToDDalitzCPK::clone ( ) 
      33             : {
      34           0 :   return new EvtBToDDalitzCPK ;
      35           0 : }
      36             : //=============================================================================
      37             : // Initialisation method
      38             : //=============================================================================
      39             : void EvtBToDDalitzCPK::init ( ) 
      40             : {
      41             :   // Check that there are 3 arguments 
      42           0 :   checkNArg( 3 ) ;
      43             :   // Check that there are 2 daughters
      44           0 :   checkNDaug( 2 ) ;
      45             :   // Check that the particles of the decay are :
      46             :   // B+/-   -> D0/bar K+/-
      47             :   // B+/-   -> K+/- D0/bar
      48             :   // B0/bar -> K*0/bar D0/bar
      49             :   // and nothing else ...
      50           0 :   static EvtId BP  = EvtPDL::getId( "B+" ) ;
      51           0 :   static EvtId BM  = EvtPDL::getId( "B-" ) ;
      52           0 :   static EvtId B0  = EvtPDL::getId( "B0" ) ;
      53           0 :   static EvtId B0B = EvtPDL::getId( "anti-B0" ) ;
      54           0 :   static EvtId KP  = EvtPDL::getId( "K+" ) ;
      55           0 :   static EvtId KM  = EvtPDL::getId( "K-" ) ; 
      56           0 :   static EvtId KS  = EvtPDL::getId( "K*0" ) ;
      57           0 :   static EvtId KSB = EvtPDL::getId( "anti-K*0" ) ;
      58           0 :   static EvtId D0  = EvtPDL::getId( "D0" ) ;
      59           0 :   static EvtId D0B = EvtPDL::getId( "anti-D0" ) ;
      60             : 
      61           0 :   _flag = 0 ;
      62             :   
      63           0 :   EvtId parent = getParentId() ;
      64           0 :   EvtId d1     = getDaug( 0 )  ;
      65           0 :   EvtId d2     = getDaug( 1 )  ;
      66             : 
      67           0 :   if ( ( ( parent == BP ) || ( parent == BM  ) ) &&
      68           0 :        ( ( d1     == D0 ) || ( d1     == D0B ) ) && 
      69           0 :        ( ( d2     == KP ) || ( d2     == KM  ) ) ) {
      70           0 :     _flag = 1 ;
      71             :     // PHSP Decay 
      72           0 :   }
      73           0 :   else if ( ( ( parent == BP ) || ( parent == BM  ) ) &&
      74           0 :             ( ( d1     == KP ) || ( d1     == KM  ) ) && 
      75           0 :             ( ( d2     == D0 ) || ( d2     == D0B  ) ) ) {
      76           0 :     _flag = 1 ;
      77             :     // also PHSP decay
      78           0 :   }
      79           0 :   else if ( ( ( parent == B0 ) || ( parent == B0B ) ) &&
      80           0 :             ( ( d1     == KS ) || ( d1     == KSB ) ) && 
      81           0 :             ( ( d2     == D0 ) || ( d2     == D0B ) ) ) {
      82           0 :     _flag = 2 ;
      83             :     // SVS Decay
      84           0 :   }
      85             :   
      86           0 :   if ( _flag == 0 ) {
      87           0 :     report( Severity::Error , "EvtGen" ) << "EvtBToDDalitzCPK : Invalid mode." 
      88           0 :                                << std::endl ;
      89           0 :     assert( 0 ) ;
      90             :   }
      91           0 : }
      92             : //=============================================================================
      93             : // Set prob max
      94             : //=============================================================================
      95             : void EvtBToDDalitzCPK::initProbMax( ) 
      96             : {
      97           0 :   if ( _flag == 1 ) {
      98             :     // PHSP
      99           0 :     setProbMax ( 0. ) ;
     100           0 :   }
     101           0 :   else if ( _flag == 2 ) {
     102             :     // SVS
     103           0 :     setProbMax ( 1.0 ) ;
     104           0 :   }
     105           0 : }
     106             : //=============================================================================
     107             : // decay particle
     108             : //=============================================================================
     109             : void EvtBToDDalitzCPK::decay( EvtParticle * p ) 
     110             : {
     111           0 :   if ( _flag == 1 ) {
     112             :     // PHSP
     113           0 :     p -> initializePhaseSpace( getNDaug() , getDaugs() ) ;
     114           0 :     vertex ( 0. ) ;
     115           0 :   }
     116           0 :   else if ( _flag == 2 ) {
     117             :     // SVS
     118           0 :     p->initializePhaseSpace(getNDaug(),getDaugs());
     119             :     
     120             :     EvtParticle *v;
     121           0 :     v = p->getDaug(0);
     122           0 :     double massv = v->mass();
     123           0 :     EvtVector4R momv = v->getP4();
     124           0 :     EvtVector4R moms = p->getDaug(1)->getP4();
     125           0 :     double m_parent = p->mass();
     126           0 :     EvtVector4R p4_parent = momv+moms;
     127             :     
     128           0 :     double norm=massv/(momv.d3mag()*m_parent);
     129           0 :     p4_parent = norm*p4_parent;
     130           0 :     vertex(0,p4_parent*(v->epsParent(0)));
     131           0 :     vertex(1,p4_parent*(v->epsParent(1)));
     132           0 :     vertex(2,p4_parent*(v->epsParent(2)));
     133           0 :   }
     134           0 : }
     135             : 
     136             : 

Generated by: LCOV version 1.11