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

          Line data    Source code
       1             : //-----------------------------------------------------------------------
       2             : // File and Version Information: 
       3             : //      $Id: EvtPto3P.cpp,v 1.4 2009-03-16 15:46:31 robbep Exp $
       4             : // 
       5             : // Environment:
       6             : //      This software is part of the EvtGen package developed jointly
       7             : //      for the BaBar and CLEO collaborations. If you use all or part
       8             : //      of it, please give an appropriate acknowledgement.
       9             : //
      10             : // Copyright Information:
      11             : //      Copyright (C) 1998 Caltech, UCSB
      12             : //
      13             : // Module creator:
      14             : //      Alexei Dvoretskii, Caltech, 2001-2002.
      15             : //-----------------------------------------------------------------------
      16             : #include "EvtGenBase/EvtPatches.hh"
      17             : 
      18             : #include "EvtGenBase/EvtPatches.hh"
      19             : #include "EvtGenBase/EvtPDL.hh"
      20             : #include "EvtGenModels/EvtPto3P.hh"
      21             : #include "EvtGenBase/EvtPto3PAmpFactory.hh"
      22             : using namespace EvtCyclic3;
      23             : 
      24             : EvtDalitzPlot EvtPto3P::dp()
      25             : {
      26             :   // There must be 3 daughters. All particles must be pseudoscalars.
      27             :   // Charge must be conserved. Number of arguments must be non-zero.
      28             : 
      29           0 :   EvtId parent = getParentId();
      30           0 :   assert(getNDaug() == 3);
      31           0 :   EvtId dau0 = getDaug(0);
      32           0 :   EvtId dau1 = getDaug(1);
      33           0 :   EvtId dau2 = getDaug(2);
      34             :   
      35           0 :   assert(EvtPDL::getSpinType(parent) == EvtSpinType::SCALAR);
      36           0 :   assert(EvtPDL::getSpinType(dau0) == EvtSpinType::SCALAR);
      37           0 :   assert(EvtPDL::getSpinType(dau1) == EvtSpinType::SCALAR);
      38           0 :   assert(EvtPDL::getSpinType(dau2) == EvtSpinType::SCALAR);  
      39           0 :   assert(EvtPDL::chg3(parent) == EvtPDL::chg3(dau0) + EvtPDL::chg3(dau1) + EvtPDL::chg3(dau2));
      40           0 :   assert(getNArg() > 0);
      41             : 
      42           0 :   return EvtDalitzPlot(EvtPDL::getMass(dau0),EvtPDL::getMass(dau1),EvtPDL::getMass(dau2),EvtPDL::getMass(parent));
      43           0 : }
      44             : 
      45             : EvtAmpFactory<EvtDalitzPoint>* EvtPto3P::createFactory(const EvtMultiChannelParser& parser)
      46             : {
      47             :   // Compute the interval size
      48             : 
      49           0 :   EvtDalitzPlot plot = dp();
      50           0 :   EvtAmpFactory<EvtDalitzPoint>* fact = new EvtPto3PAmpFactory(plot);
      51           0 :   fact->build(parser,10000);
      52             :   return fact;
      53           0 : }
      54             : 
      55             : 
      56             : std::vector<EvtVector4R> EvtPto3P::initDaughters(const EvtDalitzPoint& x) const
      57             : {
      58           0 :   std::vector<EvtVector4R> v;
      59           0 :   assert(x.isValid());
      60             :   
      61             :   // Calculate in the r.f. of AB
      62             :                                                                               
      63           0 :   double eA = x.e(A,AB);
      64           0 :   double eB = x.e(B,AB);
      65           0 :   double eC = x.e(C,AB);
      66           0 :   double pA = x.p(A,AB);
      67           0 :   double pC = x.p(C,AB);
      68           0 :   double cos = x.cosTh(CA,AB);
      69           0 :   double sin = sqrt(1.0-cos*cos);
      70             :                                                                                   
      71           0 :   EvtVector4R vA(eA,0,0,pA);                                                   
      72           0 :   EvtVector4R vB(eB,0,0,-pA); 
      73           0 :   EvtVector4R vC(eC,0,pC*sin,pC*cos);
      74             : 
      75             :   // Boost from rest frame of AB to rest-frame of decaying particle
      76             :   // vboost is the 4-momentum of frame being boosted from in the frame
      77             :   // being boosted into.
      78             :  
      79           0 :   EvtVector4R vboost = vA + vB + vC;
      80           0 :   vboost.set(1,-vboost.get(1));
      81           0 :   vboost.set(2,-vboost.get(2));
      82           0 :   vboost.set(3,-vboost.get(3));
      83           0 :   vA.applyBoostTo(vboost);
      84           0 :   vB.applyBoostTo(vboost);
      85           0 :   vC.applyBoostTo(vboost);
      86             :   
      87             :   // Rotate
      88             :                                                                                 
      89           0 :   double alpha = EvtRandom::Flat( EvtConst::twoPi );
      90           0 :   double beta = acos(EvtRandom::Flat( -1.0, 1.0 ));
      91           0 :   double gamma = EvtRandom::Flat( EvtConst::twoPi );
      92             :                                                                                 
      93           0 :   vA.applyRotateEuler( alpha, beta, gamma );
      94           0 :   vB.applyRotateEuler( alpha, beta, gamma );
      95           0 :   vC.applyRotateEuler( alpha, beta, gamma );
      96             :                                                                                  
      97             :    // Fill vector
      98             :                                                                                  
      99           0 :   assert(v.size() == 0);  
     100           0 :   v.push_back(vA);
     101           0 :   v.push_back(vB);
     102           0 :   v.push_back(vC);
     103             : 
     104             :   return v;
     105           0 : }                                                                             
     106             : 
     107             : 
     108             : 
     109             : 
     110             : 
     111             : 
     112             : 
     113             : 
     114             : 
     115             : 
     116             : 

Generated by: LCOV version 1.11