Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:20:01

0001 
0002 /***********************************************************************
0003 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
0004 *                                                                      *
0005 * This file is part of EvtGen.                                         *
0006 *                                                                      *
0007 * EvtGen is free software: you can redistribute it and/or modify       *
0008 * it under the terms of the GNU General Public License as published by *
0009 * the Free Software Foundation, either version 3 of the License, or    *
0010 * (at your option) any later version.                                  *
0011 *                                                                      *
0012 * EvtGen is distributed in the hope that it will be useful,            *
0013 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
0014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
0015 * GNU General Public License for more details.                         *
0016 *                                                                      *
0017 * You should have received a copy of the GNU General Public License    *
0018 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
0019 ***********************************************************************/
0020 
0021 #ifndef EVTCPUTIL_HH
0022 #define EVTCPUTIL_HH
0023 
0024 #include "EvtGenBase/EvtComplex.hh"
0025 #include "EvtGenBase/EvtPatches.hh"
0026 class EvtParticle;
0027 class EvtId;
0028 
0029 class EvtCPUtil {
0030   public:
0031     EvtCPUtil( int mixingType );
0032     ~EvtCPUtil();
0033 
0034     enum MixingType
0035     {
0036         Coherent = 0,
0037         Incoherent = 1
0038     };
0039 
0040     static EvtCPUtil* getInstance();
0041 
0042     void setMixingType( int mixingType ) { _mixingType = mixingType; }
0043     int getMixingType() { return _mixingType; }
0044 
0045     void fractB0CP( EvtComplex Af, EvtComplex Abarf, double deltam, double beta,
0046                     double& fract );
0047 
0048     void fractB0nonCP( EvtComplex Af, EvtComplex Abarf, EvtComplex Afbar,
0049                        EvtComplex Abarfbar, double deltam, double beta,
0050                        int flip, double& fract );
0051 
0052     // Mark Whitehead 7/12/2009
0053     // Add required lines from EvtIncoherentMixing.hh to fix CPV
0054 
0055     // Functions to check if a B has mixed (comes from a B)
0056     bool isB0Mixed( EvtParticle* );
0057     bool isBsMixed( EvtParticle* );
0058 
0059     bool flipIsEnabled();
0060     void enableFlip();
0061     void disableFlip();
0062 
0063     void OtherB( EvtParticle* p, double& t, EvtId& otherb );
0064 
0065     void OtherCoherentB( EvtParticle* p, double& t, EvtId& otherb, double probB0 );
0066     void OtherIncoherentB( EvtParticle* p, double& t, EvtId& otherb,
0067                            double probB0 );
0068 
0069     void OtherB( EvtParticle* p, double& t, EvtId& otherb, double probB0 );
0070 
0071     //id is the produced particle
0072     //t returns the lifetime of the particle
0073     //and mix will be 1 if it mixed otherwise 0
0074     void incoherentMix( const EvtId id, double& t, int& mix );
0075 
0076     double getDeltaGamma( const EvtId id );
0077     double getDeltaM( const EvtId id );
0078 
0079   private:
0080     bool _enableFlip;
0081     int _mixingType;
0082 };
0083 
0084 #endif