Page MenuHomeHEPForge

No OneTemporary

This file is larger than 256 KB, so syntax highlighting was skipped.
diff --git a/.clang-format b/.clang-format
index 029e87f..1ac0a15 100644
--- a/.clang-format
+++ b/.clang-format
@@ -1,121 +1,121 @@
Language: Cpp
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: InlineOnly
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: true
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: true
BreakInheritanceList: AfterColon
BreakConstructorInitializers: AfterColon
BreakStringLiterals: false
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- BOOST_FOREACH
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^"EvtGen/'
Priority: 1
- Regex: '^"EvtGenBase/'
Priority: 2
- Regex: '^"EvtGenModels/'
Priority: 3
- Regex: '^"EvtGenExternal/'
Priority: 4
- Regex: '^"(HepMC|HepMC3)/'
Priority: 5
- Regex: '^"(Pythia8|Photos|Tauola)/'
Priority: 6
- Regex: '^"T[[:alnum:]]+\.h"'
Priority: 7
- - Regex: '^<[[:alnum:].]+>'
+ - Regex: '^<[[:alnum:]._]+>'
Priority: 9
- Regex: '.*'
Priority: 8
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
PenaltyBreakAssignment: 50
PenaltyBreakBeforeFirstCallParameter: 50
PenaltyBreakComment: 250
PenaltyBreakFirstLessLess: 100
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 1
PenaltyExcessCharacter: 10
PenaltyReturnTypeOnItsOwnLine: 250
PointerAlignment: Left
ReflowComments: false
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 4
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: true
SpacesInSquareBrackets: false
Standard: Cpp11
StatementMacros:
- ClassDef
- ClassImp
TabWidth: 8
UseTab: Never
diff --git a/EvtGenBase/EvtAbsLineShape.hh b/EvtGenBase/EvtAbsLineShape.hh
index ae1473f..30d7e1b 100644
--- a/EvtGenBase/EvtAbsLineShape.hh
+++ b/EvtGenBase/EvtAbsLineShape.hh
@@ -1,99 +1,97 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#ifndef EVTABSLINESHAPE_HH
#define EVTABSLINESHAPE_HH
#include "EvtGenBase/EvtId.hh"
#include "EvtGenBase/EvtSpinType.hh"
#include <vector>
-class EvtId;
-
class EvtAbsLineShape {
public:
EvtAbsLineShape() = default;
EvtAbsLineShape( double mass, double width, double maxRange,
EvtSpinType::spintype sp );
virtual ~EvtAbsLineShape() = default;
EvtAbsLineShape& operator=( const EvtAbsLineShape& x );
EvtAbsLineShape( const EvtAbsLineShape& x );
double getMass() { return _mass; }
double getMassMin() { return _massMin; }
double getMassMax() { return _massMax; }
double getMaxRange() { return _maxRange; }
double getWidth() { return _width; }
EvtSpinType::spintype getSpinType() { return _spin; }
virtual double rollMass();
virtual EvtAbsLineShape* clone();
void reSetMass( double mass ) { _mass = mass; }
void reSetWidth( double width ) { _width = width; }
void reSetMassMin( double mass ) { _massMin = mass; }
void reSetMassMax( double mass ) { _massMax = mass; }
virtual void reSetBlatt( double /*blatt*/ ){};
virtual void reSetBlattBirth( double /*blatt*/ ){};
void includeBirthFactor( bool yesno ) { _includeBirthFact = yesno; }
void includeDecayFactor( bool yesno ) { _includeDecayFact = yesno; }
void setPWForDecay( int spin, EvtId d1, EvtId d2 )
{
_userSetPW.push_back( spin );
_userSetPWD1.push_back( d1 );
_userSetPWD2.push_back( d2 );
}
void setPWForBirthL( int spin, EvtId par, EvtId othD )
{
_userSetBirthPW.push_back( spin );
_userSetBirthOthD.push_back( othD );
_userSetBirthPar.push_back( par );
}
virtual double getRandMass( EvtId* parId, int nDaug, EvtId* dauId,
EvtId* othDaugId, double maxMass,
double* dauMasses );
virtual double getMassProb( double mass, double massPar, int nDaug,
double* massDau );
protected:
bool _includeDecayFact;
bool _includeBirthFact;
double _mass;
double _massMin;
double _massMax;
double _width;
double _maxRange;
// allow for special cases where the default method of picking the
//lowest allowed partial wave for a decay is not the right answer.
// string is "<spin> <daughter1> <daughter2>"
//new 9/12/2003 Lange
std::vector<EvtId> _userSetPWD1, _userSetPWD2;
std::vector<int> _userSetPW;
// also do it for birth factors
std::vector<EvtId> _userSetBirthPar, _userSetBirthOthD;
std::vector<int> _userSetBirthPW;
EvtSpinType::spintype _spin;
};
#endif
diff --git a/EvtGenBase/EvtIdSet.hh b/EvtGenBase/EvtIdSet.hh
index 0ae3cbb..a61f136 100644
--- a/EvtGenBase/EvtIdSet.hh
+++ b/EvtGenBase/EvtIdSet.hh
@@ -1,146 +1,47 @@
/***********************************************************************
-* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
+* Copyright 1998-2021 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#ifndef EVTIDSET_HH
#define EVTIDSET_HH
#include "EvtGenBase/EvtId.hh"
#include "EvtGenBase/EvtPatches.hh"
+#include <initializer_list>
+#include <set>
#include <string>
-class EvtId;
class EvtIdSet {
public:
- //need a default constructor
-
- EvtIdSet( const EvtId name1 );
- EvtIdSet( const std::string name1 );
-
- EvtIdSet( const EvtId name1, const EvtId name2 );
-
- EvtIdSet( const std::string name1, const std::string name2 );
-
- EvtIdSet( const EvtId name1, const EvtId name2, const EvtId name3 );
-
- EvtIdSet( const std::string name1, const std::string name2,
- const std::string name3 );
-
- EvtIdSet( const EvtId name1, const EvtId name2, const EvtId name3,
- const EvtId name4 );
-
- EvtIdSet( const std::string name1, const std::string name2,
- const std::string name3, const std::string name4 );
-
- EvtIdSet( const EvtId name1, const EvtId name2, const EvtId name3,
- const EvtId name4, const EvtId name5 );
-
- EvtIdSet( const std::string name1, const std::string name2,
- const std::string name3, const std::string name4,
- const std::string name5 );
-
- EvtIdSet( const EvtId name1, const EvtId name2, const EvtId name3,
- const EvtId name4, const EvtId name5, const EvtId name6 );
-
- EvtIdSet( const std::string name1, const std::string name2,
- const std::string name3, const std::string name4,
- const std::string name5, const std::string name6 );
-
- EvtIdSet( const EvtId name1, const EvtId name2, const EvtId name3,
- const EvtId name4, const EvtId name5, const EvtId name6,
- const EvtId name7 );
-
- EvtIdSet( const std::string name1, const std::string name2,
- const std::string name3, const std::string name4,
- const std::string name5, const std::string name6,
- const std::string name7 );
-
- EvtIdSet( const EvtId name1, const EvtId name2, const EvtId name3,
- const EvtId name4, const EvtId name5, const EvtId name6,
- const EvtId name7, const EvtId name8 );
-
- EvtIdSet( const std::string name1, const std::string name2,
- const std::string name3, const std::string name4,
- const std::string name5, const std::string name6,
- const std::string name7, const std::string name8 );
-
- EvtIdSet( const EvtId name1, const EvtId name2, const EvtId name3,
- const EvtId name4, const EvtId name5, const EvtId name6,
- const EvtId name7, const EvtId name8, const EvtId name9 );
-
- EvtIdSet( const std::string name1, const std::string name2,
- const std::string name3, const std::string name4,
- const std::string name5, const std::string name6,
- const std::string name7, const std::string name8,
- const std::string name9 );
-
- EvtIdSet( const EvtId name1, const EvtId name2, const EvtId name3,
- const EvtId name4, const EvtId name5, const EvtId name6,
- const EvtId name7, const EvtId name8, const EvtId name9,
- const EvtId name10 );
-
- EvtIdSet( const std::string name1, const std::string name2,
- const std::string name3, const std::string name4,
- const std::string name5, const std::string name6,
- const std::string name7, const std::string name8,
- const std::string name9, const std::string name10 );
-
- EvtIdSet( const EvtId name1, const EvtId name2, const EvtId name3,
- const EvtId name4, const EvtId name5, const EvtId name6,
- const EvtId name7, const EvtId name8, const EvtId name9,
- const EvtId name10, const EvtId name11 );
-
- EvtIdSet( const std::string name1, const std::string name2,
- const std::string name3, const std::string name4,
- const std::string name5, const std::string name6,
- const std::string name7, const std::string name8,
- const std::string name9, const std::string name10,
- const std::string name11 );
-
- EvtIdSet( const EvtId name1, const EvtId name2, const EvtId name3,
- const EvtId name4, const EvtId name5, const EvtId name6,
- const EvtId name7, const EvtId name8, const EvtId name9,
- const EvtId name10, const EvtId name11, const EvtId name12 );
-
- EvtIdSet( const std::string name1, const std::string name2,
- const std::string name3, const std::string name4,
- const std::string name5, const std::string name6,
- const std::string name7, const std::string name8,
- const std::string name9, const std::string name10,
- const std::string name11, const std::string name12 );
-
- ~EvtIdSet() { delete[] _list; }
-
- EvtIdSet( const EvtIdSet& set1 );
+ explicit EvtIdSet( std::initializer_list<EvtId> idList );
+ explicit EvtIdSet( std::initializer_list<std::string> nameList );
EvtIdSet( const EvtIdSet& set1, const EvtIdSet& set2 );
- int contains( const EvtId id ) const;
- int contains( const std::string id ) const;
+ std::size_t sizeOfSet() const { return m_list.size(); };
+ bool contains( const EvtId& id ) const;
+ bool contains( const std::string& name ) const;
- void append( const EvtIdSet set1 );
- int sizeOfSet() const;
- EvtId getElem( const int i ) const;
+ void append( const EvtIdSet& set1 );
private:
- int _numInList;
- EvtId* _list;
+ std::set<EvtId> m_list;
};
#endif
diff --git a/EvtGenBase/EvtPto3PAmp.hh b/EvtGenBase/EvtPto3PAmp.hh
index 40a0887..c5c560b 100644
--- a/EvtGenBase/EvtPto3PAmp.hh
+++ b/EvtGenBase/EvtPto3PAmp.hh
@@ -1,116 +1,116 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#ifndef EVT_PTO3P_AMP_HH
#define EVT_PTO3P_AMP_HH
+#include "EvtGenBase/EvtComplex.hh"
#include "EvtGenBase/EvtCyclic3.hh"
#include "EvtGenBase/EvtSpinType.hh"
#include <vector>
using std::vector;
#include "EvtGenBase/EvtAmplitude.hh"
#include "EvtGenBase/EvtDalitzPoint.hh"
#include "EvtGenBase/EvtPropagator.hh"
#include "EvtGenBase/EvtTwoBodyVertex.hh"
-class EvtComplex;
class EvtBlattWeisskopf;
class EvtPto3PAmp : public EvtAmplitude<EvtDalitzPoint> {
public:
// Numerator type
enum NumType
{
NBW = 0,
RBW_ZEMACH = 1,
RBW_KUEHN = 2,
RBW_CLEO = 3,
FLATTE,
GAUSS,
DOUBLE_GAUSS,
NONRES,
NONRES_LIN,
NONRES_EXP,
NONRES_EXP_ADD,
NONRES_CCS,
NONRES_LAURA,
LASS,
LASS_ELASTIC,
LASS_RESONANT,
GS
};
EvtPto3PAmp( EvtDalitzPlot dp, EvtCyclic3::Pair pairAng,
EvtCyclic3::Pair pairRes, EvtSpinType::spintype spin,
const EvtPropagator& prop, NumType typeN );
EvtPto3PAmp( const EvtPto3PAmp& other );
~EvtPto3PAmp();
EvtAmplitude<EvtDalitzPoint>* clone() const override
{
return new EvtPto3PAmp( *this );
}
EvtComplex amplitude( const EvtDalitzPoint& p ) const override;
EvtComplex numerator( const EvtDalitzPoint& p ) const;
double angDep( const EvtDalitzPoint& p ) const;
void set_fd( double R );
void set_fb( double R );
void setmin( double min ) { _min = min; }
void setmax( double max ) { _max = max; }
virtual EvtComplex evalPropagator( double m ) const
{
return _prop->evaluate( m );
}
private:
// Pairing indices:
EvtCyclic3::Pair _pairAng; // angular
EvtCyclic3::Pair _pairRes; // resonance
// Spin
EvtSpinType::spintype _spin;
// Numerator type
NumType _typeN;
// _Owned_ pointer to propagator factor
EvtPropagator* _prop;
double _g0; // nominal width
double _min; //min and max values on which
double _max; //the resonance is defined
// Vertices
EvtTwoBodyVertex _vb;
EvtTwoBodyVertex _vd;
};
#endif
diff --git a/History.md b/History.md
index 3dfe455..43f9359 100644
--- a/History.md
+++ b/History.md
@@ -1,823 +1,831 @@
# History file for EvtGen
From version 2.0.0,
Tabc labels refer to [Maniphest tasks](https://phab.hepforge.org/maniphest/query/nkBRd9OhPCBN/), while
Dxyz labels refer to [Differential code reviews](https://phab.hepforge.org/differential/query/YDY8EgjNGd.e/) on HepForge:
https://phab.hepforge.org/Tabc
https://phab.hepforge.org/Dxyz
===
## R02-0X-00
+16 Oct 2023 Thomas Latham
+* D98: Modernise EvtIdSet and other improvements
+ - Modernise and greatly simplify EvtIdSet implementation
+ - Fixes in EvtPropSLPole to avoid unnecessary dynamic allocations
+ - Other minor fixes and tidy-ups
+* Credit to Heather Ratcliffe and Chris Brady for providing
+ and/or inspiring several of these improvements
+
22 Aug 2023 Fernando Abudinen
* D97: Bugfix probmax issue and introduced pole compensation for VTOSLL model
Calculation of amplitude moved to dedicated calcAmp function and fixed initialisation.
22 Aug 2023 Tom Latham
* CMake updates
- Update default C++ standard to 17
- Suppress 'up-to-date' messages during install
- Add 'EvtGen' prefix to file names of custom CMake modules
- Remove unused CMake module
* Update CI config
- Update default LCG version to 103
- Add builds for el9 OS using LCG 104
- Allow switching on/off building against each external
- Test stage: attempt to improve selection of commits to diff in different cases
- Update CVMFS tags as per https://cern.service-now.com/service-portal?id=outage&n=OTG0079356
* Fix script for generating src dependencies
- Adapted to behaviour of newer CMake version in LCG 103
* Apply clang-format
- Few small changes after update of CI clang version to 12
- Document version of clang-format to be used
* Updates to install script
- Update to latest Pythia8 and HepMC3 versions
- Fix to ensure dependencies are picked up from the local install
22 Aug 2023 Andrii Verbytskyi
* Patch for finding Pythia8 xmldoc path
21 Aug 2023 Tom Latham
* D96: Work around change of interface for setRndmEnginePtr in Pythia8 310
22 Jun 2023 Ludovico Massaccesi
* T219: Fixed amplitudes for D_DALITZ model of D0 -> pi+ pi- pi0.
1 March 2023 Fernando Abudinen
* D92: Bugfix probmax issue for TENSOR daughter in EvtSSD_DirectCP model.
Calculation of amplitude in EvtSSD_DirectCP model moved to dedicated calcAmp function.
Got rid of a few static variables along the way.
8 Feb 2023 Alexei Sibidanov and Tom Latham
* D90: Apply clang format and enable checking of formatting in gitlab CI
3 Feb 2023 John Back
* D91: Check for non-zero momentum for EvtSLBaryonAmp parent spin density matrix.
Print out integrals of JSON test histograms.
16 Dec 2022 John Back
* D89: Added probabilities for B_c -> V pi+ and V pi+ pi0 EvtBcVHad modes.
16 Dec 2022 Alexei Sibidanov
* D88: Applied clang-tidy modernize-use-nullptr
13 Dec 2022 Fernando Abudinen and Tom Latham
* Various improvements to testing framework
16 Nov 2022 Tom Latham
* T123: Provide documention of how to contribute bug reports, feature requests, new/modified code
8 Sep 2022 Fernando Abudinen, John Back, Michal Kreps, Tom Latham, Alex Ward
* T108: Implement JSON test framework for all decay models
9 June 2022 Michal Kreps
* D84: Improve efficiency of RareLbToLll decay model for final states with e+e- pair.
===
## R02-02-00
12 May 2022 Michal Kreps
* D83: Fix double counting of charmonia with K0 decays for B0.
11 May 2022 Tom Latham
* D80: Add CMake options for enabling clang-tidy static analysis checks during build
14 Apr 2022 John Back
* D82: EvtDecayProb: initialise data members and remove empty destructor
14 Apr 2022 Michal Kreps
* D81: Derive EvtFlatSqDalitz from EvtDecayIncoherent since we directly provide
final kinematics
2nd Mar 2022 John Back
* D78: Add Bc -> J/psi K+ pi- pi+ pi- pi+, Bc -> J/psi K+ K- pi+ pi- pi+ &
Bc -> J/psi 4pi+ 3pi- decay modes to the BC_VHAD model, courtesy of
Aleksei Luchinsky, Anna Danilina, Dmitrii Pereima & Vanya Belyaev (LHCb)
===
## R02-01-01
8th Sep 2021 Michal Kreps
* Update location of web page for Pythia8 download in setup script.
8th Sep 2021 Markus Prim, Lu Cao, Chaoyi Lyu and Michel De Cian (Michal Kreps)
* D73: Add new model for semileptonic B decays with BCL and BGL form-factors
8th June 2021 Michal Kreps
* T110, D71: Fix B+ --> eta' l nu BF which was order of magnitude too high.
Balance the decrease by increasing B+ --> D0 l nu, which is after change
still bit smaller than PDG 2021.
8th Jun 2021 Michal Kreps
* D71: Fix B+ --> eta' l nu BF.
20th Apr 2021 Tom Lathem
* D68: Fix compilation with Pythia 8.304
17th Mar 2021 Michal Kreps
* D62: Improve PI0DALITZ model to dynamically work out maximum probability to
make it usuable also for eta --> llgamma decays.
Remove ETA2MUMUGAMMA since it is a pure one-to-one copy of PI0DALITZ.
15th Jan 2021 Michal Kreps
* D47: Model to generate 4-body phase-space decays in restricted part of the m12-m34 space
12th Jan 2021 Michal Kreps
* D48: Fix bug in calculation of the daughter momentum in decay model EvtBsMuMuKK
7th Jan 2021 Michal Kreps
* D43: Allow to pass particle properties table in form of stringstream to constructor
of EvtGen for use case where these are created on fly.
10th Dec 2020 Michal Kreps
* D36: EvtFlatSqDalitz model to be more efficient and to avoid cut-off around the edges
21st Aug 2020 John Back
* T109: Add EvtEtaLLPiPi model for eta' -> l l pi pi decays (l = e or mu),
- courtesy of Aleksei Luchinsky (LHCb).
29th Jun 2020 Michal Kreps
* T103: Add missing include in EvtGenBase/EvtMatrix.hh.
15th May 2020 Michal Kreps
* D28: Add EvtThreeBodyPhsp (rectangular Dalitz plot selection) and
EvtPhspDecaytimeCut (minimum decay time requirement) models.
* D27: Fix initialisation of constants in EvtBTo3hCP model.
===
## R02-00-00
24th Apr 2020 Michal Kreps
* Update particle properties file evt.pdl to 2019 version of RPP by PDG.
23rd Apr 2020 Tom Latham
* Apply copyright and licence notices to all relevant files.
17th Apr 2020 Tom Latham
* Add text of GNU GPLv3 in COPYING, add (preliminary) list of authors in
AUTHORS, and clean-up all source files, prior to applying copyright and
licence notices.
9th Apr 2020 Tom Latham
* Improve, and document use of, standalone installation script.
* Apply clang-format formatting to all C++ source files.
8th Apr 2020 Tom Latham
* One small modernisation change to EvtPhotosEngine to match that already
applied in EvtTauolaEngine.
8th Apr 2020 John Back
* Fixed NonReson amplitude and the 4-momentum boosts used for angles in
EvtLambdacPHH,
- courtesy of Elisabeth Niel (LHCb).
7th Apr 2020 Gerhard Raven, Tom Latham, Michal Kreps and John Back
* Incorporate C++ modernization changes from Gerhard Raven (LHCb).
- Merged modernize branch into master.
9th Mar 2020 John Back
* Add EvtAbsExternalGen::getDecayProb() to allow external generators to
return a probability that can be used in EvtDecayProb (default = 1).
6th Mar 2020 Andrii Verbytskyi and Tom Latham
* Implement HepMC3 support: EvtHepMCEvent, external engines & cmake files.
15th Nov 2019 John Back
* Added EvtPsi2JpsiPiPi model for psi2S -> J/psi pi+ pi- decays based on hep-ph/1507.07985,
- courtesy of Aleksei Luchinsky (LHCb).
21st August 2019 Michal Kreps
* Added the EvtDToKpienu decay model for D -> K pi e nu decays from BESIII,
- courtesy of Liaoyuan Dong.
16th July 2019 John Back
* Correct imaginary sign for EvtComplex /= (EvtComplex c) operator.
3rd July 2019 John Back
* Added the EvtLambdacPHH decay model for Lc -> p K pi decays with K*(890),
Delta++(1232) and Lambda(1520) resonances, based on the Fermilab E791
analysis hep-ex/9912003v1,
- courtesy of Elisabeth Niel and Patrick Robbe (LHCb).
* Modified EvtResonance2 to accept other barrier factor radii.
3rd July 2019 Michal Kreps
* Make sure minimum mass for resonances with non-zero widths is larger than
1e-4 GeV in EvtRelBreitWignerBarrierFact.
3rd May 2019 John Back
* Corrected EvtSLDiBaryonAmp bugs/issues in the BToDiBaryonlnupQCD model:
- parity, amplitude terms and B momentum reference frame variables.
* Corrected treament of spinor indices in EvtRareLb2Lll,
- courtesy of Tom Blake and Michal Kreps (LHCb).
* Updated the EvtBcVHad model to also handle Bc -> psi Ks K decays,
- courtesy of Aleksei Luchinsky (LHCb).
* Add new decay model EvtBsMuMuKK (BS_MUMUKK) for Bs to J/psi (mu+mu-) K+K-,
- courtesy of Veronika Chobanova, Jeremy Dalseno, Diego Martinez Santos and
Marcos Romero Lamas (LHCb).
* Fix infinite loop during initialisation of the EvtBTo3hCP model via
EvtCBTo3piP00 and EvtCBTo3piMPP,
- courtesy of Peter Richardson (Durham).
15th March 2019 Tom Latham
* Implement cmake build system, replacing the old config method.
30th Jan 2019 John Back
* Fix modernization compiler errors and warnings.
29th Jan 2019 Michal Kreps
* Allow reading decay files which are missing end-of-line before end-of-file.
21st December 2018 John Back
* Imported C++ modernization changes from Gerhard Raven (LHCb).
7th December 2018 John Back
* Added the EvtBLLNuL (BLLNUL) model that generates rare B -> ell ell nu ell
decays, where ell = e or mu,
- courtesy of Anna Danilina and Nikolai Nikitin (LHCb).
* Removed the EvtB2MuMuMuNu (BUTOMMMN) model, since its now replaced
by the more general BLLNuL one.
5th November 2018 John Back
* Added the BToDiBaryonlnupQCD model for generating B to p N* l nu decays,
where N can be any (exited) charged baryon (spin 1/2 or 3/2),
- courtesy of Mark Smith and Ryan Newcombe (LHCb), with added code optimisations.
17th October 2018 John Back
* Added various decay models from LHCb EvtGenExtras package:
- EvtBcVHad ("BC_VHAD"),
- Evtbs2llGammaMNT ("BSTOGLLMNT"),
- Evtbs2llGammaISRFSR ("BSTOGLLISRFSR"),
- EvtbTosllMS ("BTOSLLMS"),
- EvtbTosllMSExt ("BTOSLLMSEXT"),
- EvtLb2Baryonlnu ("Lb2Baryonlnu"),
- EvtLb2plnuLCSR ("Lb2plnuLCSR"),
- EvtLb2plnuLQCD ("Lb2plnuLQCD"),
- EvtFlatSqDalitz ("FLATSQDALITZ"),
- EvtPhspFlatLifetime ("PHSPFLATLIFETIME").
5th October 2018 John Back
* Updated setupEvtGen.sh to work with the new HepForge Phabricator site.
13th March 2018 John Back
* Updated EvtPythiaEngine to correctly handle updates of various particle
properties so that Pythia uses the same information as EvtGen (evt.pdl)
for the generic and alias PYTHIA decay model.
12th March 2018 John Back
* Updated EvtBcXMuNu models (X = Scalar, Vector, Tensor) to generate
Bc to D0(star) mu nu decays, with associated form factors in EvtBCXFF,
- courtesy of Aleksei Luchinsky (LHCb).
* Also generalised the calculation
of their maximum probabilities by reusing the CalcMaxProb method in
EvtSemiLeptonicAmp, which now allows for different Q^2 binning
(default remains at 25 bins).
===
## R01-07-00
13th December 2017 John Back
* New tag incorporating all changes below.
* Recommended external packages are
(as used in the setupEvtGen.sh script):
- HepMC 2.06.09,
- pythia 8.230,
- Photos++ 3.61
- Tauola++ 1.1.6c.
12th December 2017 John Back
* Changed Pythia validation example decay files to use Pythia8 codes.
6th December 2017 John Back
* Modified the examples to use DECAY.DEC (see 25th April 2016) instead of
DECAY_2010.DEC. Changed EvtExternalGenList to assume Pythia8 codes are
used in decay files by default, which is the case for DECAY.DEC. Also
updated the setupEvtGen.sh script to work with Pythia 8.2x versions.
29th November 2017 John Back
* Modified EvtSVP, EvtVVP and EvtTVP models to handle both radiative and
two-lepton decays,
- courtesy of Aleksei Luchinsky (LHCb).
14th July 2017 John Back
* Only create external generator objects if they don't already exist in
EvtExternalGenFactory.
* Modified configure script to work with Pythia 8.2x
5th July 2017 Michal Kreps
* Register the VTOSLL model.
14th June 2017 John Back
* Add isNeutralKaon() boolean function and corrected comments in EvtDDalitz.
8th May 2017 Michal Kreps
* Fix bug in EvtbTosllVectorAmp to recognise Bs --> K*bar mu mu decay as
b --> d ll transition.
8th May 2017 Michal Kreps
* Significantly simplify way how we decide on decay mode and daughters
ordering in DDalitz model.
- With new code by definition all orderings of
daughters in the decay file will yield same output.
4th May 2017 John Back
* Further fixes to DDalitz particle ordering (including charge-conjugates):
- Mode 5: D0 -> K- K0bar K+ and K+ K- K0bar
- Mode 12: D0 -> pi0 pi- pi+ and pi+ pi0 pi-
- Removed unneeded index ordering checks for mode 10 (D+ -> pi- pi+ pi+)
and mode 11 (Ds+ -> pi- pi+ pi+)
27th April 2017 John Back
* Fixed DDalitz particle ordering for mode 7: D+ -> pi+ K- K+ and K+ pi+ K-
and their charge-conjugates
7th April 2017 John Back
* Modified EvtGenExternal/EvtPythiaEngine to ensure that the EvtGen-based
instances of Pythia8 (for generic and alias decays) use the same
particle properties as defined by EvtGen,
- courtesy Patrick Robbe (LHCb).
5th April 2017 Michal Kreps
* Fixed indexing in copy constructor of Evt3Rank3C, which would otherwise
produce an infinite loop;
- bug report from David Grellscheid.
3rd November 2016 John Back
* Modified EvtFlatQ2 model to work for all B -> X lepton lepton modes, as
well as adding an extra phase space factor to correct for the dip at low
q^2, which is enabled by using "FLATQ2 1" instead of just "FLATQ2" in the decay file,
- courtesy of Marcin Chrzaszcz & Thomas Blake (LHCb).
13th October 2016 John Back
* Added the TauolaCurrentOption decfile keyword to select the hadronic
current in Tauola; default is the BaBar-tuned current option (int = 1).
* EvtParticles can store double attributes using the functions
setAttributeDouble(name, double) and getAttributeDouble(name), which can
be useful for storing and retrieving amplitude weights, for example.
- The analogous EvtParticle integer attribute interface remains unchanged:
setAttribute(name, int) and getAttribute(name).
13th September 2016 John Back
* Modified EvtTauolaEngine to use internal Tauola spin matrices for
tau pair events by temporarily setting the PDG id of the mother as a
boson, keeping the same 4-momentum.
* The BaBar hadronic currents are now used by default.
* Also added the ability to change some Tauola parameters
using the "Define" keyword in decay files.
* Added an example decay file
illustrating the new features: validation/TauolaFiles/Btautau.dec
9th September 2016 Michal Kreps
* Reimplement code in EvtBTo3pi.F, EvtBTo3piMPP.F, EvtBTo3piP00.F and
EvtBToKpipi.F in C++ in order to remove dependence on Fortran compiler.
- With this, there is no internal Fortran code in EvtGen.
===
## R01-06-00
1st June 2016 John Back
* New tag incorporating all changes below.
* Recommended external packages are
- HepMC 2.06.09
- pythia 8.186
- Photos++ 3.61
- Tauola++ 1.1.5
28th April 2016 Michal Kreps
* For Ds+ --> 2pi+ pi- there was double counting of branching fraction
resulting in total branching fraction being 1.5 times larger than measured
one.
- Fix by revisiting submodes, which now fill total Ds --> 3pi.
25th April 2016 Michal Kreps
* Added DECAY.DEC/XML, which contain updated semileptonic charm and beauty
branching fractions using the 2014 PDG, tuned to minimize disagreements
between measurements and EvtGen for both inclusive and exclusive decays.
* Updated the evt.pdl particle properties file to the PDG 2014 edition.
* Implemented new LQCD form factors for Lb --> L mu mu from arXiv paper
1602.01399 (EvtRareLbToLllFFlQCD); old LQCD form factors are removed.
18th March 2016 John Back
* Fixed incorrect spinor algebra used in S1 -> 1/2 S2, 1/2 -> S3 S4 decays
in EvtDiracParticle::rotateToHelicityBasis() functions,
- courtesy of Luis Miguel Garcia Martin and the IFIC Valencia LHCb group.
19th Feburary 2016 John Back
* Fixed bug in the definition of the initial spinor term Sinit in
EvtRareLbToLll::HadronicAmpRS(),
- from Tom Blake (LHCb).
12th February 2016 John Back
* From LHCb, added extensions to the EvtHQET2(FF) model for semitauonic
decays from Brian Hamilton, which needs a patch to EvtSemiLeptonicAmp
from Jack Wimberley to ensure that the q^2 range is physical when
finding the maximum amplitude probability.
2nd December 2015 John Back
* From LHCb, added EvtKStopizmumu model for KS -> pi0 mu mu decays based on
JHEP08(1998)004,
- courtesy of Veronika Chobanova, Diego Martinez Santos and Jeremy Dalseno.
* Added EvtConst::Fermi for Fermi coupling constant.
===
## R01-05-00
21st October 2015 John Back
* New tag incorporating all changes below.
* Recommended external packages are
- HepMC 2.06.09
- pythia 8.186
- Photos++ 3.61
- Tauola++ 1.1.5
* Added the EvtB2MuMuMuNu model for simulating the very rare four-leptonic
decays B- -> mu+ mu- anti-nu_mu mu-,
- courtesy Nikolai Nikitin.
16th October 2015 John Back
* Updated the configure script to automatically select the library names
for PHOTOS++; version 3.56 and below uses Fortran, version 3.61 and above
uses C++ only (default). Avoid using v3.60, since it does not work.
This needs the PHOTOS libraries built before EvtGen is configured.
Modified setupEvtGen.sh to use Photos++ v3.61.
7th October 2015 John Back
* Updated EvtGenExternal/EvtPhotosEngine to check that additional particles
from the outgoing vertex are indeed (FSR) photons, since later versions of
PHOTOS introduce pair emission, where particles may not always be photons.
* Added the genRootDecayChain.cc validation program to create ROOT files
containing information about the complete decay tree. Two example test
decay files BKstarGamma.dec and BuDst0rhop.dec can be used with this; the
first tests PHOTOS, the second looks at sequential decay chain storage.
The plotBKstarGamma.C ROOT macro can be used for B -> K* gamma plots.
2nd October 2015 John Back
* Modified EvtSVPHelAmp and added a new EvtSVPHelCPMix model, implementing
the complete mixing phenomenology of Bs to vector gamma decays,
- courtesy of Clara Remon (LHCb).
* EvtD0mixDalitz code: cleanup, inverted q/p for decays of D0bar (simplifies
user decay files) and fixed y parameter bug,
- courtesy of Jordi Tico (LHCb).
* Changed the initialisation order of the infrared cut-off in EvtPhotosEngine.
This actually has no effect, since the exponentiation function sets it to the
same 1e-7 value, but it is now in the correct order if we need to update it.
* Removed all remaining obsolete pragma (Win32) warnings from some classes.
23rd September 2015 Michal Kreps
* Reimplement the real Spence function in C++ and removed its fortran
implementation.
15th September 2015 Michal Kreps
* Fixed accessed uninitialised memory in EvtPDL.cpp, line 213.
* Modified the configure and setupEvtGen.sh scripts to work on Mac; needed
Mac compilation patch files added to the new "platform" subdirectory.
10th September 2015 John Back
* Updated setupEvtGen.sh to use the recommended external packages:
- HepMC 2.06.09, pythia 8.186, Photos++ 3.56 and Tauola++ 1.1.5.
* Fixed form-factor calculations for the BTOSLLBALL model 6 used to generate
b -> sll decays,
- courtesy of Christoph Langenbruch and David Loh (LHCb).
- Affects B->K*ll, B->rholl and B->omegall, particularly the electron modes.
* In the validation directory, added runPhotosTest.sh for testing FSR in
Upsilon(4S) -> e+ e- decays, and changed the plot comparison scripts to
use the 2nd directory "oldRootFiles" (which could be a soft-link) for
including ROOT histograms made from a previous version of EvtGen.
27th August 2015 John Back
* Added Mersenne-Twister random number generator (RNG) EvtMTRandomEngine.
- It requires c++11 compiler features (>= gcc 4.7), which should
automatically be enabled by the configure script.
- Introduced the preprocessor environment variable EVTGEN_CPP11 for c++11
features.
- EvtMTRandomEngine is the default RNG for the validation and test examples
if c++11 features are enabled.
* Added a phase-space test validation/genPHSP.sh and PhaseSpacePlots.C to
visually check the flatness of Dalitz plots in order to ensure that the
RNG is not producing biased results that depend on particle ordering.
* Added the models EvtbsToLLLLAmp and EvtbsToLLLLHyperCP for
B0_q -> l+ l- l+ l- decays (SM and one supersymmetric scenario),
- courtesy of Nikolai Nikitin and Konstantin Toms.
- Documentation provided in doc/evt_BQTOLLLL_model.pdf and
doc/evt_BQTOLLLLHYPERCP_model.pdf.
* Changed the installation and set-up script name to be just setupEvtGen.sh;
it uses the VERSION variable to specify the required tag. List of tags
are available using either "svn ls -v http://svn.cern.ch/guest/evtgen/tags"
or by going to http://svn.cern.ch/guest/evtgen/tags in a web browser.
12th June 2015 John Back
* Changed the width of chi_b1 in evt.pdl from 9.8928 GeV (!) to zero.
1st May 2015 John Back
* Added Bc -> scalar ell nu (EvtBcSMuNu) and Bc -> tensor ell nu
(EvtBcTMuNu) decays,
- courtesy of Jack Wimberley, LHCb.
- Also included the chi_c1 mode for EvtBcVMuNu.
===
## R01-04-00
2nd April 2015 John Back
* Removed the EvtStdlibRandomEngine class since this can produce biases
to kinematic distributions when one or more of the daughters is a
resonance, such as B0 -> K pi psi
- (thanks to Antonio Augusto Alves Jr who discovered this issue).
- EvtSimpleRandomEngine is now the default random number generator in the
validation and test examples.
* Incorporated several additions and modifications from LHCb:
a) From Michal Kreps, Tom Blake & Christoph Langenbruch,
added rare Lb --> Lambda^(*) ell ell models described in
arXiv:1108.6129, with various form factors from Gutsche et al.
(arXiv:1301.3737) and lattice QCD (arXiv:1212.4827)
b) From Andrew Crocombe, implemented Bs --> K* form factors
from Ball-Zwicky and z-parametrization form factors from
arXiv:1006.4945 for EvtbTosllBallFF
c) Christoph Langenbruch fixed the Bs -> phi ll form factors in
EvtbTosllBallFF; T3 showed a non-physical pole at very low
q2 which significantly affected the electron mode
d) From Michal Kreps, removed semicolons from wrong places to
clear warnings when compiled with the "-pedantic" option.
9th October 2014 John Back
* Change svnweb.cern.ch to svn.cern.ch in the setup script.
1st April 2014 John Back
* In EvtReport, modified the logging output severity status flags
to have the "EVTGEN_" prefix, e.g. INFO becomes EVTGEN_INFO.
* The global report() function has been renamed to EvtGenReport().
31st March 2014 John Back
* Added the ability to store named attributes for EvtParticles in the
form of a map<string, int>. The setAttribute(name, value) stores the
required value, while getAttribute(name) retrieves the integer value.
This is used in EvtPhotosEngine to specify the final-state radiation
"FSR" attribute to 1 for any additional photons (EvtPhotonParticles)
created by Photos++. It also stores the "ISR" attribute, but this
is always set to zero, since only FSR photons are created.
If the named attribute does not exist, then getAttribute() returns zero.
29th January 2014 Daniel Craik
* Removed mass assertion on GS shape in EvtDalitzReso to allow it to also
be used for charged rho resonances.
27th January 2014 John Back
* Minor corrections to Vub models to remove further gcc 4.8 warnings.
* Updated configure script to work for MacOS clang (from Genser team).
===
## R01-03-00
9th January 2014 John Back
* New tag version "1.3.0", incorporating all changes below.
* Replaced auto-install script to work with this version as well as
the latest versions of all external generator packages.
* Updated README to mention the new CERN-based web pages for Photos++
and Tauola++.
8th January 2014 John Back
* Fix gcc 4.6 and 4.8 compilation warnings,
- courtesy of Patrick Robbe (LHCb);
- main changes are removal of unused variables.
* Changed the EvtPythiaEngine class and configure script to use new
Pythia 8 header locations; Pythia 8.180 or above is now required.
7th January 2014 John Back
* Modified EvtBCVFF to correct the Kiselev form factors
- from Jack Wimberley (LHCb).
9th October 2013 Daniel Craik
* Added Gounaris-Sakurai and Gaussian shapes to EvtGenericDalitz
and set sensible defaults for LASS parameters.
19th September 2013 John Back
* Modified EvtGenExternal/EvtPythiaEngine to keep track of any new
particles that are added to the default Pythia database to avoid
duplicating particle/anti-particle entries that could override
previously defined Pythia decay chains.
18th September 2013 John Back
* Added Mac OS flags for the configure script and src/Makefile.
15th July 2013 Daniel Craik
* Added flag to turn on scaling of LASS amplitude by M/q in EvtDalitzReso
15th July 2013 Daniel Craik
* EvtParserXML now accepts file names containing environment variables,
exponential non-resonant shape in EvtDalitzReso now defined as exp(-alpha*m^2),
LASS shape in EvtDalitzReso now takes a cutoff parameter
4th July 2013 Daniel Craik
* Added LASS, exponential non-resonant and linear non-resonant shapes to EvtGenericDalitz.
3rd July 2013 Daniel Craik
* Fixed auto-install script for R01-02-00.
1st July 2013 Daniel Craik
* Added auto-install script for R01-02-00.
===
## R01-02-00
15th May 2013 John Back
* New tag, version "1.2.0", incorporating all changes below.
14th May 2013 Michal Kreps
* Added Blatt-Weisskopf barrier factors up to L=5 in
EvtGenBase/EvtBlattWeisskopf::compute().
14th May 2013 John Back
* Added additional entries (appended at the end) to the evt.pdl particle
data file
- courtesy of Romulus Godang and Belle II colleagues.
14th March 2013 John Back
* Added the method EvtParticle::getPDGId() to get the PDG integer for a
particle directly (which just calls EvtPDL::getStdHep()).
* Added a check in EvtPhotosEngine::doDecay to skip Photos if a given
particle has too many daughters (>= 10) to avoid a problem with a
hard coded upper limit in the Photos PHOENE subroutine.
2nd February 2013 Daniel Craik
* Updated EvtDalitzTable to estimate probMax when it is missing from a
Dalitz model.
1st February 2013 John Back
* Added the ability to read in Pythia 6 commands in ascii decay files in
EvtDecayTable::readDecayFile (this was already possible in xml files).
* Modified the Photos++ engine default settings to be more suited to B
decays (from LHCb defaults).
31st January 2013 John Back
* Added the ability to read in Pythia 8 commands in ascii decay files
in EvtDecayTable::readDecayFile. They can be set using the syntax:
"PythiaTypeParam module:variable=value", where Type = Generic, Alias or
Both for specifying whether the parameter is for the generic or alias
Pythia decay engines (or both). The 2nd argument must not contain any
spaces. Fixed the list of commands strings being used in the
EvtPythiaEngine class (i.e. Pythia parameters that can be set via decay
files).
31st January 2013 Daniel Craik
* Added named parameters to various decay models.
30th January 2013 John Back
* Fixed some of the parameter arguments used in the EvtSVSCPiso model.
24th January 2013 John Back
* Set the Photos++ and Tauola++ models to use the EvtGen random number
engine when useEvtGenRandom is set to true in the EvtExternalGenList
constructor.
23rd January 2013 John Back
* Added EvtGenExternal/EvtPythiaRandom to allow the use of the EvtGen
random number engine to also be used for the random engine for Pythia 8.
* Added a boolean (useEvtGenRandom, default = true) within the
EvtExternalGenList constructor to use this feature.
18th December 2012 John Back
* Corrected some wrong daughter ordering assignments for decay modes 5 and
12 in EvtDDalitz. Updated validation/DalitzDecays.xml to also contain
D decay mode 12, as well as various modes that may use K_S0 and K_L0.
* Added validation/genDDalitzModes.sh and updated validation/compareDalitz.C to
do a complete comparison of the D Dalitz modes with the xml versions.
11th December 2012 Daniel Craik
* Updated the Xml parser to support named model parameters.
* Updated the generic Dalitz model to use named model parameters as an example.
15th October 2012 John Back
* Make EvtSimpleRandomEngine inherit from EvtRandomEngine to avoid
crash in EvtGen.cpp when no random engine is defined
- (from Bjoern Spruck).
===
## R01-01-00
4th October 2012 John Back
* New tag, version "1.1.0", incorporating all changes below.
* Provide proper default constructors for EvtVector4R and
EvtPhotonParticle. Modified the validation and test code to also
compile/link in the case of no external generators being included.
3rd October 2012 John Back
* Corrected the t3 vector form factor values for the Ball-Zwicky 2005
model (modelId = 6) in EvtbTosllBallFF::getVectorFF(), which
were set to t3tilde instead.
18th September 2012 John Back
* Moved the external generator engines to a new sub-directory
EvtGenExternal. Building the code now creates 2 libraries:
libEvtGen.so (Base+Models) and libEvtGenExternal.so.
- This allows anyone to ignore using the new external generators
if required (by not creating/loading the 2nd library).
* Added prefix option to the configure script/Makefile to allow the user
to specify an installation directory for the include files, libraries,
DECAY.DEC and evt.pdl files (for Genser).
14th September 2012 Michal Kreps
* Fixed the calculation of the angle between decay planes in the function
EvtKine::EvtDecayAngleChi. Fixed typo in EvtLb2Lll decay model. Only
some NP scenarious could be affected, SM one is definitely unaffected.
13th September 2012 John Back
* Added the use of the environment variables EVTGEN_PHOTOS, EVTGEN_PYTHIA
and EVTGEN_TAUOLA to specify if the Photos, Pythia and/or Tauola engine
classes are used or not. These variables are set by the configure script,
depending if the library paths are specified for these generators.
===
## R01-00-01
12th September 2012 John Back
* New tag incorporating all changes below, since R01-00-00.
11th September 2012 John Back
* Modified the Photos and Tauola engine classes to use the new
Photospp and Tauolapp namespaces that are present in the latest
versions of Photos++(3.5) and Tauola++(1.0.7).
* Updated the configure file to get the correct location of the Tauola++
include files.
* Added the D0->pi+pi-pi0 decay mode in EvtDDalitz
- from Marco Gersabeck and Frederic Dreyer (LHCb).
* Added new decay models/classes from Alexey Luchinsky (LHCb):
EvtBcVMuNu, EvtTVP, EvtWnPi, EvtSVP, EvtXPsiGamma, EvtBcVNpi
29th June 2012 John Back
* Corrected mass(squared) variables filled in the Dalitz TTree in
validation/genExampleRootFiles.
15th May 2012 Daniel Craik
* Updated EvtD0gammaDalitz to deal with D mesons from neutral B->DK
* Added save function to validation/compareDalitz.C.
11th May 2012 Daniel Craik
* Replaced BaBar specific configuration for BlattWeisskopf birth factors.
* Updated XML conversion script to handle new configuration.
* Fixed some bugs in the XML conversion script related to particle
modifications.
9th May 2012 Daniel Craik
* Added latex documentation for xml decay files.
2nd May 2012 Daniel Craik
* Added resDaughters attribute to the Dalitz resonance xml tag to
simplify defining symmetric resonances. Updated validation xml files to
use the new functionality.
27th April 2012 Daniel Craik
* Upgraded EvtGenericDalitz to use EvtDalitzReso for resonances.
* Added validation to compare EvtGenericDalitz to all 11 EvtDDalitz modes.
* Added a root macro to quickly compare two Dalitz decays for validation.
24th April 2012 John Back
* Solved two bugs in the EvtD0gammaDalitz model (from Jordi Tico, LHCb):
configuration of the conjugated model, and using only the B charge
to determine the model used, not the D flavour.
17th April 2012 Daniel Craik
* Updated the GenericDalitz validation code to use the same probMax
values as DDalitz.
* Added XML decay file parsing to EvtGen::readUDecay.
- Dec files are still the default.
30th March 2012 John Back
* Update maximum probability values in EvtDDalitz::initProbMax()
for all DDalitz modes.
23rd March 2012 John Back
* Added the EvtEta2MuMuGamma decay model from LHCb.
21st March 2012 John Back
* Added EvtD0gammaDalitz decay model from LHCb.
20th March 2012 Daniel Craik
* Added backwards compatibility for Pythia 6 commands in the XML configuration.
* Updated decay file conversion tool to convert JetSetPar lines to pythia6Param
tags.
19th March 2012 Daniel Craik
* Added infrastructure to pass commands to external generators.
* XML config now takes Pythia8 configuration commands.
16th March 2012 Daniel Craik
* Added the ability to define particles from the PDL for Dalitz decay
resonances instead of defining mass, width and spin seperately.
* Renamed the lifetime attribute of Dalitz decay resonaces to width to avoid
confusion.
* Added further validation code for the generic Dalitz model.
15th March 2012 Daniel Craik
* Added validation code for xml decay files and the generic Dalitz model.
===
## R01-00-00
6th March 2012 John Back
* First official version for Genser (evtgen 1.0.0) that includes
support for external generators: Pythia8, Photos++ and Tauola++.
* This also includes a preliminary version of creating Dalitz plot
decay models using EvtGenericDalitz.
diff --git a/src/EvtGenBase/EvtCPUtil.cpp b/src/EvtGenBase/EvtCPUtil.cpp
index 7069bd6..3cb0bdf 100644
--- a/src/EvtGenBase/EvtCPUtil.cpp
+++ b/src/EvtGenBase/EvtCPUtil.cpp
@@ -1,577 +1,577 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenBase/EvtCPUtil.hh"
#include "EvtGenBase/EvtConst.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtPatches.hh"
#include "EvtGenBase/EvtRandom.hh"
#include "EvtGenBase/EvtReport.hh"
#include "EvtGenBase/EvtScalarParticle.hh"
#include "EvtGenBase/EvtSymTable.hh"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
using std::endl;
EvtCPUtil::EvtCPUtil( int mixingType )
{
_enableFlip = false;
_mixingType = mixingType;
}
EvtCPUtil* EvtCPUtil::getInstance()
{
static EvtCPUtil* theCPUtil = nullptr;
- if ( theCPUtil == nullptr ) {
+ if ( !theCPUtil ) {
theCPUtil = new EvtCPUtil( 1 );
}
return theCPUtil;
}
//added two functions for finding the fraction of B0 tags for decays into
//both CP eigenstates and non-CP eigenstates -- NK, Jan. 27th, 1998
void EvtCPUtil::fractB0CP( EvtComplex Af, EvtComplex Abarf, double /*deltam*/,
double beta, double& fract )
{
//This function returns the number of B0 tags for decays into CP-eigenstates
//(the "probB0" in the new EvtOtherB)
//double gamma_B = EvtPDL::getWidth(B0);
//double xd = deltam/gamma_B;
//double xd = 0.65;
double ratio = 1 / ( 1 + 0.65 * 0.65 );
EvtComplex rf, rbarf;
rf = EvtComplex( cos( 2.0 * beta ), sin( 2.0 * beta ) ) * Abarf / Af;
rbarf = EvtComplex( 1.0 ) / rf;
double A2 = real( Af ) * real( Af ) + imag( Af ) * imag( Af );
double Abar2 = real( Abarf ) * real( Abarf ) + imag( Abarf ) * imag( Abarf );
double rf2 = real( rf ) * real( rf ) + imag( rf ) * imag( rf );
double rbarf2 = real( rbarf ) * real( rbarf ) + imag( rbarf ) * imag( rbarf );
fract = ( Abar2 * ( 1 + rbarf2 + ( 1 - rbarf2 ) * ratio ) ) /
( Abar2 * ( 1 + rbarf2 + ( 1 - rbarf2 ) * ratio ) +
A2 * ( 1 + rf2 + ( 1 - rf2 ) * ratio ) );
return;
}
void EvtCPUtil::fractB0nonCP( EvtComplex Af, EvtComplex Abarf, EvtComplex Afbar,
EvtComplex Abarfbar, double deltam, double beta,
int flip, double& fract )
{
//this function returns the number of B0 tags for decays into non-CP eigenstates
//(the "probB0" in the new EvtOtherB)
//this needs more thought...
//double gamma_B = EvtPDL::getWidth(B0);
//EvtGenReport(EVTGEN_INFO,"EvtGen") << "gamma " << gamma_B<< endl;
//double xd = deltam/gamma_B;
//why is the width of B0 0 in PDL??
double xd = 0.65;
double gamma_B = deltam / xd;
double IAf, IAfbar, IAbarf, IAbarfbar;
EvtComplex rf, rfbar, rbarf, rbarfbar;
double rf2, rfbar2, rbarf2, rbarfbar2;
double Af2, Afbar2, Abarf2, Abarfbar2;
rf = EvtComplex( cos( 2.0 * beta ), sin( 2.0 * beta ) ) * Abarf / Af;
rfbar = EvtComplex( cos( 2.0 * beta ), sin( 2.0 * beta ) ) * Abarfbar / Afbar;
rbarf = EvtComplex( cos( -2.0 * beta ), sin( -2.0 * beta ) ) * Af / Abarf;
rbarfbar = EvtComplex( cos( -2.0 * beta ), sin( -2.0 * beta ) ) * Afbar /
Abarfbar;
rf2 = real( rf ) * real( rf ) + imag( rf ) * imag( rf );
rfbar2 = real( rfbar ) * real( rfbar ) + imag( rfbar ) * imag( rfbar );
rbarf2 = real( rbarf ) * real( rbarf ) + imag( rbarf ) * imag( rbarf );
rbarfbar2 = real( rbarfbar ) * real( rbarfbar ) +
imag( rbarfbar ) * imag( rbarfbar );
Af2 = real( Af ) * real( Af ) + imag( Af ) * imag( Af );
Afbar2 = real( Afbar ) * real( Afbar ) + imag( Afbar ) * imag( Afbar );
Abarf2 = real( Abarf ) * real( Abarf ) + imag( Abarf ) * imag( Abarf );
Abarfbar2 = real( Abarfbar ) * real( Abarfbar ) +
imag( Abarfbar ) * imag( Abarfbar );
//
//IAf = integral(gamma(B0->f)), etc.
//
IAf = ( Af2 / ( 2 * gamma_B ) ) * ( 1 + rf2 + ( 1 - rf2 ) / ( 1 + xd * xd ) );
IAfbar = ( Afbar2 / ( 2 * gamma_B ) ) *
( 1 + rfbar2 + ( 1 - rfbar2 ) / ( 1 + xd * xd ) );
IAbarf = ( Abarf2 / ( 2 * gamma_B ) ) *
( 1 + rbarf2 + ( 1 - rbarf2 ) / ( 1 + xd * xd ) );
IAbarfbar = ( Abarfbar2 / ( 2 * gamma_B ) ) *
( 1 + rbarfbar2 + ( 1 - rbarfbar2 ) / ( 1 + xd * xd ) );
//flip specifies the relative fraction of fbar events
fract = IAbarf / ( IAbarf + IAf ) + flip * IAbarfbar / ( IAfbar + IAbarfbar );
return;
}
void EvtCPUtil::OtherB( EvtParticle* p, double& t, EvtId& otherb, double probB0 )
{
if ( _mixingType == EvtCPUtil::Coherent ) {
OtherCoherentB( p, t, otherb, probB0 );
} else if ( _mixingType == EvtCPUtil::Incoherent ) {
OtherIncoherentB( p, t, otherb, probB0 );
}
}
void EvtCPUtil::OtherCoherentB( EvtParticle* p, double& t, EvtId& otherb,
double probB0 )
{
//Can not call this recursively!!!
static int entryCount = 0;
entryCount++;
//added by Lange Jan4,2000
static EvtId B0B = EvtPDL::getId( "anti-B0" );
static EvtId B0 = EvtPDL::getId( "B0" );
static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
static EvtId BS = EvtPDL::getId( "B_s0" );
static EvtId UPS4S = EvtPDL::getId( "Upsilon(4S)" );
int isB0 = EvtRandom::Flat( 0.0, 1.0 ) < probB0;
int idaug;
p->setLifetime();
// now get the time between the decay of this B and the other B!
EvtParticle* parent = p->getParent();
EvtParticle* other;
bool incoherentmix = false;
if ( ( parent != nullptr ) &&
( parent->getId() == B0 || parent->getId() == B0B ||
parent->getId() == BS || parent->getId() == BSB ) ) {
incoherentmix = true;
}
if ( incoherentmix )
parent = parent->getParent();
if ( parent == nullptr || parent->getId() != UPS4S ) {
//Need to make this more general, but for now
//assume no parent. If we have parent of B we
//need to charge conj. full decay tree.
if ( parent != nullptr ) {
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "p=" << EvtPDL::name( p->getId() )
<< " parent=" << EvtPDL::name( parent->getId() ) << endl;
}
assert( parent == 0 );
p->setLifetime();
t = p->getLifetime();
bool needToChargeConj = false;
if ( p->getId() == B0B && isB0 )
needToChargeConj = true;
if ( p->getId() == B0 && !isB0 )
needToChargeConj = true;
if ( p->getId() == BSB && isB0 )
needToChargeConj = true;
if ( p->getId() == BS && !isB0 )
needToChargeConj = true;
if ( needToChargeConj ) {
p->setId( EvtPDL::chargeConj( p->getId() ) );
if ( incoherentmix ) {
p->getDaug( 0 )->setId(
EvtPDL::chargeConj( p->getDaug( 0 )->getId() ) );
}
}
otherb = EvtPDL::chargeConj( p->getId() );
entryCount--;
return;
} else {
if ( parent->getDaug( 0 ) != p ) {
other = parent->getDaug( 0 );
idaug = 0;
} else {
other = parent->getDaug( 1 );
idaug = 1;
}
}
if ( parent != nullptr ) {
//if (entryCount>1){
// EvtGenReport(EVTGEN_INFO,"EvtGen") << "Double CP decay:"<<entryCount<<endl;
//}
//kludge!! Lange Mar21, 2003
// if the other B is an alias... don't change the flavor..
if ( other->getId().isAlias() ) {
OtherB( p, t, otherb );
entryCount--;
return;
}
if ( entryCount == 1 ) {
EvtVector4R p_init = other->getP4();
//int decayed=other->getNDaug()>0;
bool decayed = other->isDecayed();
other->deleteTree();
EvtScalarParticle* scalar_part;
scalar_part = new EvtScalarParticle;
if ( isB0 ) {
scalar_part->init( B0, p_init );
} else {
scalar_part->init( B0B, p_init );
}
other = (EvtParticle*)scalar_part;
// other->set_type(EvtSpinType::SCALAR);
other->setDiagonalSpinDensity();
parent->insertDaugPtr( idaug, other );
if ( decayed ) {
//EvtGenReport(EVTGEN_INFO,"EvtGen") << "In CP Util calling decay \n";
other->decay();
}
}
otherb = other->getId();
other->setLifetime();
t = p->getLifetime() - other->getLifetime();
otherb = other->getId();
} else {
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "We have an error here!!!!" << endl;
otherb = EvtId( -1, -1 );
}
entryCount--;
return;
}
// ========================================================================
bool EvtCPUtil::isBsMixed( EvtParticle* p )
{
if ( !( p->getParent() ) )
return false;
static EvtId BS0 = EvtPDL::getId( "B_s0" );
static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
if ( ( p->getId() != BS0 ) && ( p->getId() != BSB ) )
return false;
if ( ( p->getParent()->getId() == BS0 ) || ( p->getParent()->getId() == BSB ) )
return true;
return false;
}
// ========================================================================
bool EvtCPUtil::isB0Mixed( EvtParticle* p )
{
if ( !( p->getParent() ) )
return false;
static EvtId B0 = EvtPDL::getId( "B0" );
static EvtId B0B = EvtPDL::getId( "anti-B0" );
if ( ( p->getId() != B0 ) && ( p->getId() != B0B ) )
return false;
if ( ( p->getParent()->getId() == B0 ) || ( p->getParent()->getId() == B0B ) )
return true;
return false;
}
//============================================================================
// Return the tag of the event (ie the anti-flavour of the produced
// B meson). Flip the flavour of the event with probB probability
//============================================================================
void EvtCPUtil::OtherIncoherentB( EvtParticle* p, double& t, EvtId& otherb,
double probB )
{
//std::cout<<"New routine running"<<endl;
//if(p->getId() == B0 || p->getId() == B0B)
//added by liming Zhang
enableFlip();
if ( ( isB0Mixed( p ) ) || ( isBsMixed( p ) ) ) {
p->getParent()->setLifetime();
t = p->getParent()->getLifetime();
} else {
p->setLifetime();
t = p->getLifetime();
}
if ( flipIsEnabled() ) {
//std::cout << " liming << flipIsEnabled " << std::endl;
// Flip the flavour of the particle with probability probB
bool isFlipped = ( EvtRandom::Flat( 0., 1. ) < probB );
if ( isFlipped ) {
if ( ( isB0Mixed( p ) ) || ( isBsMixed( p ) ) ) {
p->getParent()->setId(
EvtPDL::chargeConj( p->getParent()->getId() ) );
p->setId( EvtPDL::chargeConj( p->getId() ) );
} else {
p->setId( EvtPDL::chargeConj( p->getId() ) );
}
}
}
if ( ( isB0Mixed( p ) ) || ( isBsMixed( p ) ) ) {
// if B has mixed, tag flavour is charge conjugate of parent of B-meson
otherb = EvtPDL::chargeConj( p->getParent()->getId() );
} else {
// else it is opposite flavour than this B hadron
otherb = EvtPDL::chargeConj( p->getId() );
}
return;
}
//============================================================================
void EvtCPUtil::OtherB( EvtParticle* p, double& t, EvtId& otherb )
{
static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
static EvtId BS0 = EvtPDL::getId( "B_s0" );
static EvtId B0B = EvtPDL::getId( "anti-B0" );
static EvtId B0 = EvtPDL::getId( "B0" );
static EvtId D0B = EvtPDL::getId( "anti-D0" );
static EvtId D0 = EvtPDL::getId( "D0" );
static EvtId UPS4 = EvtPDL::getId( "Upsilon(4S)" );
if ( p->getId() == BS0 || p->getId() == BSB ) {
static double ctauL = EvtPDL::getctau( EvtPDL::getId( "B_s0L" ) );
static double ctauH = EvtPDL::getctau( EvtPDL::getId( "B_s0H" ) );
static double ctau = ctauL < ctauH ? ctauH : ctauL;
t = -log( EvtRandom::Flat() ) * ctau;
EvtParticle* parent = p->getParent();
if ( parent != nullptr &&
( parent->getId() == BS0 || parent->getId() == BSB ) ) {
if ( parent->getId() == BS0 )
otherb = BSB;
if ( parent->getId() == BSB )
otherb = BS0;
parent->setLifetime( t );
return;
}
if ( p->getId() == BS0 )
otherb = BSB;
if ( p->getId() == BSB )
otherb = BS0;
p->setLifetime( t );
return;
}
if ( p->getId() == D0 || p->getId() == D0B ) {
static double ctauL = EvtPDL::getctau( EvtPDL::getId( "D0L" ) );
static double ctauH = EvtPDL::getctau( EvtPDL::getId( "D0H" ) );
static double ctau = ctauL < ctauH ? ctauH : ctauL;
t = -log( EvtRandom::Flat() ) * ctau;
EvtParticle* parent = p->getParent();
if ( parent != nullptr &&
( parent->getId() == D0 || parent->getId() == D0B ) ) {
if ( parent->getId() == D0 )
otherb = D0B;
if ( parent->getId() == D0B )
otherb = D0;
parent->setLifetime( t );
return;
}
if ( p->getId() == D0 )
otherb = D0B;
if ( p->getId() == D0B )
otherb = D0;
p->setLifetime( t );
return;
}
p->setLifetime();
// now get the time between the decay of this B and the other B!
EvtParticle* parent = p->getParent();
if ( parent == nullptr || parent->getId() != UPS4 ) {
//EvtGenReport(EVTGEN_ERROR,"EvtGen") <<
// "Warning CP violation with B having no parent!"<<endl;
t = p->getLifetime();
if ( p->getId() == B0 )
otherb = B0B;
if ( p->getId() == B0B )
otherb = B0;
if ( p->getId() == BS0 )
otherb = BSB;
if ( p->getId() == BSB )
otherb = BS0;
return;
} else {
if ( parent->getDaug( 0 ) != p ) {
otherb = parent->getDaug( 0 )->getId();
parent->getDaug( 0 )->setLifetime();
t = p->getLifetime() - parent->getDaug( 0 )->getLifetime();
} else {
otherb = parent->getDaug( 1 )->getId();
parent->getDaug( 1 )->setLifetime();
t = p->getLifetime() - parent->getDaug( 1 )->getLifetime();
}
}
return;
}
// No CP violation is assumed
void EvtCPUtil::incoherentMix( const EvtId id, double& t, int& mix )
{
int stdHepNum = EvtPDL::getStdHep( id );
stdHepNum = abs( stdHepNum );
EvtId partId = EvtPDL::evtIdFromStdHep( stdHepNum );
std::string partName = EvtPDL::name( partId );
std::string hname = partName + std::string( "H" );
std::string lname = partName + std::string( "L" );
EvtId lId = EvtPDL::getId( lname );
EvtId hId = EvtPDL::getId( hname );
double ctauL = EvtPDL::getctau( lId );
double ctauH = EvtPDL::getctau( hId );
// Bug Fixed: Corrected the average as gamma is the relevent parameter
double ctau = 2.0 * ( ctauL * ctauH ) / ( ctauL + ctauH );
//double ctau=0.5*(ctauL+ctauH);
// Bug Fixed: ctau definition changed above
//double y=(ctauH-ctauL)/(2*ctau);
double y = ( ctauH - ctauL ) / ( ctauH + ctauL );
//deltam and qoverp defined in DECAY.DEC
std::string qoverpParmName = std::string( "qoverp_incohMix_" ) + partName;
std::string mdParmName = std::string( "dm_incohMix_" ) + partName;
int ierr;
double qoverp = atof( EvtSymTable::get( qoverpParmName, ierr ).c_str() );
double x = atof( EvtSymTable::get( mdParmName, ierr ).c_str() ) * ctau /
EvtConst::c;
double fac;
if ( id == partId ) {
fac = 1.0 / ( qoverp * qoverp );
} else {
fac = qoverp * qoverp;
}
double mixprob = ( x * x + y * y ) /
( x * x + y * y + fac * ( 2.0 + x * x - y * y ) );
int mixsign;
mixsign = ( mixprob > EvtRandom::Flat( 0.0, 1.0 ) ) ? -1 : 1;
double prob;
// Find the longest of the two lifetimes
double ctaulong = ctauL <= ctauH ? ctauH : ctauL;
// Bug fixed: Ensure cosine argument is dimensionless so /ctau
do {
t = -log( EvtRandom::Flat() ) * ctaulong;
prob = 1.0 + exp( -2.0 * fabs( y ) * t / ctau ) +
mixsign * 2.0 * exp( -fabs( y ) * t / ctau ) * cos( x * t / ctau );
} while ( prob < 4.0 * EvtRandom::Flat() );
mix = 0;
if ( mixsign == -1 )
mix = 1;
return;
}
double EvtCPUtil::getDeltaGamma( const EvtId id )
{
int stdHepNum = EvtPDL::getStdHep( id );
stdHepNum = abs( stdHepNum );
EvtId partId = EvtPDL::evtIdFromStdHep( stdHepNum );
std::string partName = EvtPDL::name( partId );
std::string hname = partName + std::string( "H" );
std::string lname = partName + std::string( "L" );
EvtId lId = EvtPDL::getId( lname );
EvtId hId = EvtPDL::getId( hname );
double ctauL = EvtPDL::getctau( lId );
double ctauH = EvtPDL::getctau( hId );
double dGamma = ( 1 / ctauL - 1 / ctauH ) * EvtConst::c;
return dGamma;
}
double EvtCPUtil::getDeltaM( const EvtId id )
{
int stdHepNum = EvtPDL::getStdHep( id );
stdHepNum = abs( stdHepNum );
EvtId partId = EvtPDL::evtIdFromStdHep( stdHepNum );
std::string partName = EvtPDL::name( partId );
std::string parmName = std::string( "dm_incohMix_" ) + partName;
int ierr;
double dM = atof( EvtSymTable::get( parmName, ierr ).c_str() );
return dM;
}
bool EvtCPUtil::flipIsEnabled()
{
return _enableFlip;
}
void EvtCPUtil::enableFlip()
{
_enableFlip = true;
}
void EvtCPUtil::disableFlip()
{
_enableFlip = false;
}
diff --git a/src/EvtGenBase/EvtDecayTable.cpp b/src/EvtGenBase/EvtDecayTable.cpp
index 69d5d9d..4740be8 100644
--- a/src/EvtGenBase/EvtDecayTable.cpp
+++ b/src/EvtGenBase/EvtDecayTable.cpp
@@ -1,1634 +1,1634 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenBase/EvtDecayTable.hh"
#include "EvtGenBase/EvtDecayBase.hh"
#include "EvtGenBase/EvtExtGeneratorCommandsTable.hh"
#include "EvtGenBase/EvtModel.hh"
#include "EvtGenBase/EvtModelAlias.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtParser.hh"
#include "EvtGenBase/EvtParserXml.hh"
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtPatches.hh"
#include "EvtGenBase/EvtRadCorr.hh"
#include "EvtGenBase/EvtRandom.hh"
#include "EvtGenBase/EvtReport.hh"
#include "EvtGenBase/EvtSymTable.hh"
#include <ctype.h>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <stdlib.h>
#include <string.h>
using std::endl;
using std::fstream;
using std::ifstream;
EvtDecayTable::EvtDecayTable()
{
_decaytable.clear();
}
EvtDecayTable::~EvtDecayTable()
{
_decaytable.clear();
}
EvtDecayTable* EvtDecayTable::getInstance()
{
static EvtDecayTable* theDecayTable = nullptr;
- if ( theDecayTable == nullptr ) {
+ if ( !theDecayTable ) {
theDecayTable = new EvtDecayTable();
}
return theDecayTable;
}
int EvtDecayTable::getNMode( int ipar )
{
return _decaytable[ipar].getNMode();
}
EvtDecayBase* EvtDecayTable::getDecay( int ipar, int imode )
{
return _decaytable[ipar].getDecayModel( imode );
}
void EvtDecayTable::printSummary()
{
for ( size_t i = 0; i < EvtPDL::entries(); i++ ) {
_decaytable[i].printSummary();
}
}
EvtDecayBase* EvtDecayTable::getDecayFunc( EvtParticle* p )
{
int partnum;
partnum = p->getId().getAlias();
if ( _decaytable[partnum].getNMode() == 0 )
return nullptr;
return _decaytable[partnum].getDecayModel( p );
}
void EvtDecayTable::readDecayFile( const std::string dec_name, bool verbose )
{
if ( _decaytable.size() < EvtPDL::entries() )
_decaytable.resize( EvtPDL::entries() );
EvtModel& modelist = EvtModel::instance();
EvtExtGeneratorCommandsTable* extGenCommands =
EvtExtGeneratorCommandsTable::getInstance();
std::string colon( ":" ), equals( "=" );
int i;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "In readDecayFile, reading:" << dec_name.c_str() << endl;
ifstream fin;
fin.open( dec_name.c_str() );
if ( !fin ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Could not open " << dec_name.c_str() << endl;
}
fin.close();
EvtParser parser;
parser.read( dec_name );
int itok;
int hasend = 0;
std::string token;
for ( itok = 0; itok < parser.getNToken(); itok++ ) {
token = parser.getToken( itok );
if ( token == "End" )
hasend = 1;
}
if ( !hasend ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Could not find an 'End' in " << dec_name.c_str() << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution." << endl;
::abort();
}
std::string model, parent, sdaug;
EvtId ipar;
int n_daugh;
EvtId daught[MAX_DAUG];
double brfr;
int itoken = 0;
std::vector<EvtModelAlias> modelAliasList;
do {
token = parser.getToken( itoken++ );
//Easy way to turn off photos... Lange September 5, 2000
if ( token == "noPhotos" ) {
EvtRadCorr::setNeverRadCorr();
if ( verbose )
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "As requested, PHOTOS will be turned off." << endl;
} else if ( token == "yesPhotos" ) {
EvtRadCorr::setAlwaysRadCorr();
if ( verbose )
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "As requested, PHOTOS will be turned on for all decays."
<< endl;
} else if ( token == "normalPhotos" ) {
EvtRadCorr::setNormalRadCorr();
if ( verbose )
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "As requested, PHOTOS will be turned on only when requested."
<< endl;
} else if ( token == "Alias" ) {
std::string newname;
std::string oldname;
newname = parser.getToken( itoken++ );
oldname = parser.getToken( itoken++ );
EvtId id = EvtPDL::getId( oldname );
if ( id == EvtId( -1, -1 ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Unknown particle name:" << oldname.c_str()
<< " on line " << parser.getLineofToken( itoken ) << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
EvtPDL::alias( id, newname );
if ( _decaytable.size() < EvtPDL::entries() )
_decaytable.resize( EvtPDL::entries() );
} else if ( token == "ModelAlias" ) {
std::vector<std::string> modelArgList;
std::string aliasName = parser.getToken( itoken++ );
std::string modelName = parser.getToken( itoken++ );
std::string nameTemp;
do {
nameTemp = parser.getToken( itoken++ );
if ( nameTemp != ";" ) {
modelArgList.push_back( nameTemp );
}
} while ( nameTemp != ";" );
EvtModelAlias newAlias( aliasName, modelName, modelArgList );
modelAliasList.push_back( newAlias );
} else if ( token == "ChargeConj" ) {
std::string aname;
std::string abarname;
aname = parser.getToken( itoken++ );
abarname = parser.getToken( itoken++ );
EvtId a = EvtPDL::getId( aname );
EvtId abar = EvtPDL::getId( abarname );
if ( a == EvtId( -1, -1 ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Unknown particle name:" << aname.c_str() << " on line "
<< parser.getLineofToken( itoken ) << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
if ( abar == EvtId( -1, -1 ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Unknown particle name:" << abarname.c_str()
<< " on line " << parser.getLineofToken( itoken ) << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
EvtPDL::aliasChgConj( a, abar );
} else if ( token == "JetSetPar" ) {
// Check if any old Pythia 6 commands are present
std::string pythiaCommand = parser.getToken( itoken++ );
Command command;
// The old command format is NAME(INT)=VALUE
int i1 = pythiaCommand.find_first_of( "(" );
int i2 = pythiaCommand.find_first_of( ")" );
int i3 = pythiaCommand.find_first_of( "=" );
std::string pythiaModule = pythiaCommand.substr( 0, i1 );
std::string pythiaParam = pythiaCommand.substr( i1 + 1, i2 - i1 - 1 );
std::string pythiaValue = pythiaCommand.substr( i3 + 1 );
command["MODULE"] = pythiaModule;
command["PARAM"] = pythiaParam;
command["VALUE"] = pythiaValue;
command["GENERATOR"] = "Both";
command["VERSION"] = "PYTHIA6";
extGenCommands->addCommand( "PYTHIA", command );
} else if ( modelist.isCommand( token ) ) {
std::string cnfgstr;
cnfgstr = parser.getToken( itoken++ );
modelist.storeCommand( token, cnfgstr );
} else if ( token == "PythiaGenericParam" ||
token == "PythiaAliasParam" || token == "PythiaBothParam" ) {
// Read in any Pythia 8 commands, which will be of the form
// pythia<type>Param module:param=value, with no spaces in the parameter
// string! Here, <type> specifies whether the command is for generic
// decays, alias decays, or both.
// Pythia 6 commands will be defined by the old JetSetPar command
// name, which is handled by the modelist.isCommand() statement above.
std::string pythiaCommand = parser.getToken( itoken++ );
std::string pythiaModule( "" ), pythiaParam( "" ), pythiaValue( "" );
// Separate out the string into the 3 sections using the delimiters
// ":" and "=".
std::vector<std::string> pComVect1 =
this->splitString( pythiaCommand, colon );
if ( pComVect1.size() == 2 ) {
pythiaModule = pComVect1[0];
std::string pCom2 = pComVect1[1];
std::vector<std::string> pComVect2 = this->splitString( pCom2,
equals );
if ( pComVect2.size() == 2 ) {
pythiaParam = pComVect2[0];
pythiaValue = pComVect2[1];
}
}
// Define the Pythia 8 command and pass it to the external generator
// command list.
Command command;
if ( token == "PythiaGenericParam" ) {
command["GENERATOR"] = "Generic";
} else if ( token == "PythiaAliasParam" ) {
command["GENERATOR"] = "Alias";
} else {
command["GENERATOR"] = "Both";
}
command["MODULE"] = pythiaModule;
command["PARAM"] = pythiaParam;
command["VALUE"] = pythiaValue;
command["VERSION"] = "PYTHIA8";
extGenCommands->addCommand( "PYTHIA", command );
} else if ( token == "CDecay" ) {
std::string name;
name = parser.getToken( itoken++ );
ipar = EvtPDL::getId( name );
if ( ipar == EvtId( -1, -1 ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Unknown particle name:" << name.c_str() << " on line "
<< parser.getLineofToken( itoken - 1 ) << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
EvtId cipar = EvtPDL::chargeConj( ipar );
if ( _decaytable[ipar.getAlias()].getNMode() != 0 ) {
if ( verbose )
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Redefined decay of " << name.c_str() << " in CDecay"
<< endl;
_decaytable[ipar.getAlias()].removeDecay();
}
//take contents of cipar and conjugate and store in ipar
_decaytable[ipar.getAlias()].makeChargeConj(
&_decaytable[cipar.getAlias()] );
} else if ( token == "Define" ) {
std::string name;
name = parser.getToken( itoken++ );
// value=atof(parser.getToken(itoken++).c_str());
EvtSymTable::define( name, parser.getToken( itoken++ ) );
//New code Lange April 10, 2001 - allow the user
//to change particle definitions of EXISTING
//particles on the fly
} else if ( token == "Particle" ) {
std::string pname;
pname = parser.getToken( itoken++ );
if ( verbose )
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << pname.c_str() << endl;
//There should be at least the mass
double newMass = atof( parser.getToken( itoken++ ).c_str() );
EvtId thisPart = EvtPDL::getId( pname );
double newWidth = EvtPDL::getMeanMass( thisPart );
if ( parser.getNToken() > 3 )
newWidth = atof( parser.getToken( itoken++ ).c_str() );
//Now make the change!
EvtPDL::reSetMass( thisPart, newMass );
EvtPDL::reSetWidth( thisPart, newWidth );
if ( verbose )
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Changing particle properties of " << pname.c_str()
<< " Mass=" << newMass << " Width=" << newWidth << endl;
} else if ( token == "ChangeMassMin" ) {
std::string pname;
pname = parser.getToken( itoken++ );
double tmass = atof( parser.getToken( itoken++ ).c_str() );
EvtId thisPart = EvtPDL::getId( pname );
EvtPDL::reSetMassMin( thisPart, tmass );
if ( verbose )
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Refined minimum mass for "
<< EvtPDL::name( thisPart ).c_str() << " to be " << tmass
<< endl;
} else if ( token == "ChangeMassMax" ) {
std::string pname;
pname = parser.getToken( itoken++ );
double tmass = atof( parser.getToken( itoken++ ).c_str() );
EvtId thisPart = EvtPDL::getId( pname );
EvtPDL::reSetMassMax( thisPart, tmass );
if ( verbose )
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Refined maximum mass for "
<< EvtPDL::name( thisPart ).c_str() << " to be " << tmass
<< endl;
} else if ( token == "IncludeBirthFactor" ) {
std::string pname;
pname = parser.getToken( itoken++ );
bool yesno = false;
if ( parser.getToken( itoken++ ) == "yes" )
yesno = true;
EvtId thisPart = EvtPDL::getId( pname );
EvtPDL::includeBirthFactor( thisPart, yesno );
if ( verbose ) {
if ( yesno )
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Include birth factor for "
<< EvtPDL::name( thisPart ).c_str() << endl;
if ( !yesno )
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "No longer include birth factor for "
<< EvtPDL::name( thisPart ).c_str() << endl;
}
} else if ( token == "IncludeDecayFactor" ) {
std::string pname;
pname = parser.getToken( itoken++ );
bool yesno = false;
if ( parser.getToken( itoken++ ) == "yes" )
yesno = true;
EvtId thisPart = EvtPDL::getId( pname );
EvtPDL::includeDecayFactor( thisPart, yesno );
if ( verbose ) {
if ( yesno )
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Include decay factor for "
<< EvtPDL::name( thisPart ).c_str() << endl;
if ( !yesno )
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "No longer include decay factor for "
<< EvtPDL::name( thisPart ).c_str() << endl;
}
} else if ( token == "LSNONRELBW" ) {
std::string pname;
pname = parser.getToken( itoken++ );
EvtId thisPart = EvtPDL::getId( pname );
std::string tstr = "NONRELBW";
EvtPDL::changeLS( thisPart, tstr );
if ( verbose )
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Change lineshape to non-rel BW for "
<< EvtPDL::name( thisPart ).c_str() << endl;
} else if ( token == "LSFLAT" ) {
std::string pname;
pname = parser.getToken( itoken++ );
EvtId thisPart = EvtPDL::getId( pname );
std::string tstr = "FLAT";
EvtPDL::changeLS( thisPart, tstr );
if ( verbose )
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Change lineshape to flat for "
<< EvtPDL::name( thisPart ).c_str() << endl;
} else if ( token == "LSMANYDELTAFUNC" ) {
std::string pname;
pname = parser.getToken( itoken++ );
EvtId thisPart = EvtPDL::getId( pname );
std::string tstr = "MANYDELTAFUNC";
EvtPDL::changeLS( thisPart, tstr );
if ( verbose )
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Change lineshape to spikes for "
<< EvtPDL::name( thisPart ).c_str() << endl;
} else if ( token == "BlattWeisskopf" ) {
std::string pname;
pname = parser.getToken( itoken++ );
double tnum = atof( parser.getToken( itoken++ ).c_str() );
EvtId thisPart = EvtPDL::getId( pname );
EvtPDL::reSetBlatt( thisPart, tnum );
if ( verbose )
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Redefined Blatt-Weisskopf factor "
<< EvtPDL::name( thisPart ).c_str() << " to be " << tnum
<< endl;
} else if ( token == "BlattWeisskopfBirth" ) {
std::string pname;
pname = parser.getToken( itoken++ );
double tnum = atof( parser.getToken( itoken++ ).c_str() );
EvtId thisPart = EvtPDL::getId( pname );
EvtPDL::reSetBlattBirth( thisPart, tnum );
if ( verbose )
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Redefined Blatt-Weisskopf birth factor "
<< EvtPDL::name( thisPart ).c_str() << " to be " << tnum
<< endl;
} else if ( token == "SetLineshapePW" ) {
std::string pname;
pname = parser.getToken( itoken++ );
EvtId thisPart = EvtPDL::getId( pname );
std::string pnameD1 = parser.getToken( itoken++ );
EvtId thisD1 = EvtPDL::getId( pnameD1 );
std::string pnameD2 = parser.getToken( itoken++ );
EvtId thisD2 = EvtPDL::getId( pnameD2 );
int pw = atoi( parser.getToken( itoken++ ).c_str() );
if ( verbose )
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Redefined Partial wave for " << pname.c_str() << " to "
<< pnameD1.c_str() << " " << pnameD2.c_str() << " (" << pw
<< ")" << endl;
EvtPDL::setPWForDecay( thisPart, pw, thisD1, thisD2 );
EvtPDL::setPWForBirthL( thisD1, pw, thisPart, thisD2 );
EvtPDL::setPWForBirthL( thisD2, pw, thisPart, thisD1 );
} else if ( token == "Decay" ) {
std::string temp_fcn_new_model;
EvtDecayBase* temp_fcn_new;
double brfrsum = 0.0;
parent = parser.getToken( itoken++ );
ipar = EvtPDL::getId( parent );
if ( ipar == EvtId( -1, -1 ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Unknown particle name:" << parent.c_str() << " on line "
<< parser.getLineofToken( itoken - 1 ) << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
if ( _decaytable[ipar.getAlias()].getNMode() != 0 ) {
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Redefined decay of " << parent.c_str() << endl;
_decaytable[ipar.getAlias()].removeDecay();
}
do {
token = parser.getToken( itoken++ );
if ( token != "Enddecay" ) {
i = 0;
while ( token.c_str()[i++] != 0 ) {
if ( isalpha( token.c_str()[i] ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Expected to find a branching fraction or Enddecay "
<< "but found:" << token.c_str() << " on line "
<< parser.getLineofToken( itoken - 1 ) << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Possibly to few arguments to model "
<< "on previous line!" << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
}
brfr = atof( token.c_str() );
int isname =
EvtPDL::getId( parser.getToken( itoken ) ).getId() >= 0;
int ismodel = modelist.isModel( parser.getToken( itoken ) );
if ( !( isname || ismodel ) ) {
//see if this is an aliased model
for ( size_t iAlias = 0; iAlias < modelAliasList.size();
iAlias++ ) {
if ( modelAliasList[iAlias].matchAlias(
parser.getToken( itoken ) ) ) {
ismodel = 2;
break;
}
}
}
if ( !( isname || ismodel ) ) {
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< parser.getToken( itoken ).c_str()
<< " is neither a particle name nor "
<< "the name of a model. " << endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "It was encountered on line "
<< parser.getLineofToken( itoken )
<< " of the decay file." << endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Please fix it. Thank you." << endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Be sure to check that the "
<< "correct case has been used. \n";
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Terminating execution. \n";
::abort();
itoken++;
}
n_daugh = 0;
while ( EvtPDL::getId( parser.getToken( itoken ) ).getId() >=
0 ) {
sdaug = parser.getToken( itoken++ );
daught[n_daugh++] = EvtPDL::getId( sdaug );
if ( daught[n_daugh - 1] == EvtId( -1, -1 ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Unknown particle name:" << sdaug.c_str()
<< " on line "
<< parser.getLineofToken( itoken ) << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
}
model = parser.getToken( itoken++ );
int photos = 0;
int verbose = 0;
int summary = 0;
do {
if ( model == "PHOTOS" ) {
photos = 1;
model = parser.getToken( itoken++ );
}
if ( model == "VERBOSE" ) {
verbose = 1;
model = parser.getToken( itoken++ );
}
if ( model == "SUMMARY" ) {
summary = 1;
model = parser.getToken( itoken++ );
}
} while ( model == "PHOTOS" || model == "VERBOSE" ||
model == "SUMMARY" );
//see if this is an aliased model
int foundAnAlias = -1;
for ( size_t iAlias = 0; iAlias < modelAliasList.size();
iAlias++ ) {
if ( modelAliasList[iAlias].matchAlias( model ) ) {
foundAnAlias = iAlias;
break;
}
}
if ( foundAnAlias == -1 ) {
if ( !modelist.isModel( model ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Expected to find a model name,"
<< "found:" << model.c_str() << " on line "
<< parser.getLineofToken( itoken ) << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
} else {
model = modelAliasList[foundAnAlias].getName();
}
temp_fcn_new_model = model;
temp_fcn_new = modelist.getFcn( model );
if ( photos ) {
temp_fcn_new->setPHOTOS();
}
if ( verbose ) {
temp_fcn_new->setVerbose();
}
if ( summary ) {
temp_fcn_new->setSummary();
}
std::vector<std::string> temp_fcn_new_args;
std::string name;
int ierr;
if ( foundAnAlias == -1 ) {
do {
name = parser.getToken( itoken++ );
if ( name != ";" ) {
temp_fcn_new_args.push_back(
EvtSymTable::get( name, ierr ) );
if ( ierr ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Reading arguments and found:"
<< name.c_str() << " on line:"
<< parser.getLineofToken( itoken - 1 )
<< endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
}
//int isname=EvtPDL::getId(name).getId()>=0;
int ismodel = modelist.isModel( name );
if ( ismodel ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Expected ';' but found:" << name.c_str()
<< " on line:"
<< parser.getLineofToken( itoken - 1 )
<< endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Most probable error is omitted ';'."
<< endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
} while ( name != ";" );
} else {
std::vector<std::string> copyMe =
modelAliasList[foundAnAlias].getArgList();
temp_fcn_new_args = copyMe;
itoken++;
}
//Found one decay.
brfrsum += brfr;
temp_fcn_new->saveDecayInfo( ipar, n_daugh, daught,
temp_fcn_new_args.size(),
temp_fcn_new_args,
temp_fcn_new_model, brfr );
double massmin = 0.0;
// for (i=0;i<n_daugh;i++){
for ( i = 0; i < temp_fcn_new->nRealDaughters(); i++ ) {
if ( EvtPDL::getMinMass( daught[i] ) > 0.0001 ) {
massmin += EvtPDL::getMinMass( daught[i] );
} else {
massmin += EvtPDL::getMeanMass( daught[i] );
}
}
_decaytable[ipar.getAlias()].addMode( temp_fcn_new, brfrsum,
massmin );
}
} while ( token != "Enddecay" );
_decaytable[ipar.getAlias()].finalize();
}
// Allow copying of decays from one particle to another; useful
// in combination with RemoveDecay
else if ( token == "CopyDecay" ) {
std::string newname;
std::string oldname;
newname = parser.getToken( itoken++ );
oldname = parser.getToken( itoken++ );
EvtId newipar = EvtPDL::getId( newname );
EvtId oldipar = EvtPDL::getId( oldname );
if ( oldipar == EvtId( -1, -1 ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Unknown particle name:" << oldname.c_str()
<< " on line " << parser.getLineofToken( itoken ) << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
if ( newipar == EvtId( -1, -1 ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Unknown particle name:" << newname.c_str()
<< " on line " << parser.getLineofToken( itoken ) << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
if ( _decaytable[newipar.getAlias()].getNMode() != 0 ) {
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Redefining decay of " << newname << endl;
_decaytable[newipar.getAlias()].removeDecay();
}
_decaytable[newipar.getAlias()] = _decaytable[oldipar.getAlias()];
}
// Enable decay deletion; intended primarily for aliases
// Peter Onyisi, March 2008
else if ( token == "RemoveDecay" ) {
parent = parser.getToken( itoken++ );
ipar = EvtPDL::getId( parent );
if ( ipar == EvtId( -1, -1 ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Unknown particle name:" << parent.c_str() << " on line "
<< parser.getLineofToken( itoken - 1 ) << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
if ( _decaytable[ipar.getAlias()].getNMode() == 0 ) {
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "No decays to delete for " << parent.c_str() << endl;
} else {
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Deleting selected decays of " << parent.c_str() << endl;
}
do {
token = parser.getToken( itoken );
if ( token != "Enddecay" ) {
n_daugh = 0;
while ( EvtPDL::getId( parser.getToken( itoken ) ).getId() >=
0 ) {
sdaug = parser.getToken( itoken++ );
daught[n_daugh++] = EvtPDL::getId( sdaug );
if ( daught[n_daugh - 1] == EvtId( -1, -1 ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Unknown particle name:" << sdaug.c_str()
<< " on line "
<< parser.getLineofToken( itoken ) << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
}
token = parser.getToken( itoken );
if ( token != ";" ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Expected ';' but found:" << token << " on line:"
<< parser.getLineofToken( itoken - 1 ) << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Most probable error is omitted ';'." << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
token = parser.getToken( itoken++ );
EvtDecayBase* temp_fcn_new = modelist.getFcn( "PHSP" );
std::vector<std::string> temp_fcn_new_args;
std::string temp_fcn_new_model( "PHSP" );
temp_fcn_new->saveDecayInfo( ipar, n_daugh, daught, 0,
temp_fcn_new_args,
temp_fcn_new_model, 0. );
_decaytable[ipar.getAlias()].removeMode( temp_fcn_new );
}
} while ( token != "Enddecay" );
itoken++;
} else if ( token != "End" ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Found unknown command:'" << token.c_str() << "' on line "
<< parser.getLineofToken( itoken ) << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
} while ( ( token != "End" ) && itoken != parser.getNToken() );
//Now we may need to reset the minimum mass for some particles????
for ( size_t ii = 0; ii < EvtPDL::entries(); ii++ ) {
EvtId temp( ii, ii );
int nModTot = getNMode( ii );
//no decay modes
if ( nModTot == 0 )
continue;
//0 width?
if ( EvtPDL::getWidth( temp ) < 0.0000001 )
continue;
int jj;
double minMass = EvtPDL::getMaxMass( temp );
for ( jj = 0; jj < nModTot; jj++ ) {
double tmass = _decaytable[ii].getDecay( jj ).getMassMin();
if ( tmass < minMass )
minMass = tmass;
}
if ( minMass > EvtPDL::getMinMass( temp ) ) {
if ( verbose )
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Given allowed decays, resetting minMass "
<< EvtPDL::name( temp ).c_str() << " "
<< EvtPDL::getMinMass( temp ) << " to " << minMass << endl;
EvtPDL::reSetMassMin( temp, minMass );
}
}
}
void EvtDecayTable::readXMLDecayFile( const std::string dec_name, bool verbose )
{
if ( _decaytable.size() < EvtPDL::entries() )
_decaytable.resize( EvtPDL::entries() );
EvtModel& modelist = EvtModel::instance();
EvtExtGeneratorCommandsTable* extGenCommands =
EvtExtGeneratorCommandsTable::getInstance();
EvtParserXml parser;
parser.open( dec_name );
EvtId ipar;
std::string decayParent = "";
double brfrSum = 0.;
std::vector<EvtModelAlias> modelAliasList;
bool endReached = false;
while ( parser.readNextTag() ) {
//TAGS FOUND UNDER DATA
if ( parser.getParentTagTitle() == "data" ) {
if ( parser.getTagTitle() == "photos" ) {
std::string usage = parser.readAttribute( "usage" );
if ( usage == "always" ) {
EvtRadCorr::setAlwaysRadCorr();
if ( verbose )
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "As requested, PHOTOS will be turned on for all decays."
<< endl;
} else if ( usage == "never" ) {
EvtRadCorr::setNeverRadCorr();
if ( verbose )
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "As requested, PHOTOS will be turned off."
<< endl;
} else {
EvtRadCorr::setNormalRadCorr();
if ( verbose )
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "As requested, PHOTOS will be turned on only when requested."
<< endl;
}
} else if ( parser.getTagTitle() == "alias" ) {
std::string alias = parser.readAttribute( "name" );
std::string particle = parser.readAttribute( "particle" );
checkParticle( particle );
EvtId id = EvtPDL::getId( particle );
EvtPDL::alias( id, alias );
if ( _decaytable.size() < EvtPDL::entries() )
_decaytable.resize( EvtPDL::entries() );
} else if ( parser.getTagTitle() == "modelAlias" ) {
std::vector<std::string> modelArgList;
std::string alias = parser.readAttribute( "name" );
std::string model = parser.readAttribute( "model" );
std::string paramStr = parser.readAttribute( "params" );
std::istringstream paramStream( paramStr );
std::string param;
if ( paramStr == "" ) {
EvtDecayBase* fcn = modelist.getFcn( model );
int i( 0 );
std::string paramName = fcn->getParamName( 0 );
while ( paramName != "" ) {
param = parser.readAttribute( paramName,
fcn->getParamDefault( i ) );
if ( param == "" )
break;
modelArgList.push_back( param );
++i;
paramName = fcn->getParamName( i );
}
} else {
while ( std::getline( paramStream, param, ' ' ) ) {
modelArgList.push_back( param );
}
}
EvtModelAlias newAlias( alias, model, modelArgList );
modelAliasList.push_back( newAlias );
} else if ( parser.getTagTitle() == "chargeConj" ) {
std::string particle = parser.readAttribute( "particle" );
std::string conjugate = parser.readAttribute( "conjugate" );
EvtId a = EvtPDL::getId( particle );
EvtId abar = EvtPDL::getId( conjugate );
checkParticle( particle );
checkParticle( conjugate );
EvtPDL::aliasChgConj( a, abar );
} else if ( parser.getTagTitle() == "conjDecay" ) {
std::string particle = parser.readAttribute( "particle" );
EvtId a = EvtPDL::getId( particle );
EvtId abar = EvtPDL::chargeConj( a );
checkParticle( particle );
checkParticle( abar.getName() );
if ( _decaytable[a.getAlias()].getNMode() != 0 ) {
if ( verbose )
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Redefined decay of " << particle.c_str()
<< " in ConjDecay" << endl;
_decaytable[a.getAlias()].removeDecay();
}
//take contents of abar and conjugate and store in a
_decaytable[a.getAlias()].makeChargeConj(
&_decaytable[abar.getAlias()] );
} else if ( parser.getTagTitle() == "define" ) {
std::string name = parser.readAttribute( "name" );
std::string value = parser.readAttribute( "value" );
EvtSymTable::define( name, value );
} else if ( parser.getTagTitle() == "particle" ) {
std::string name = parser.readAttribute( "name" );
double mass = parser.readAttributeDouble( "mass" );
double width = parser.readAttributeDouble( "width" );
double minMass = parser.readAttributeDouble( "massMin" );
double maxMass = parser.readAttributeDouble( "massMax" );
std::string birthFactor = parser.readAttribute(
"includeBirthFactor" );
std::string decayFactor = parser.readAttribute(
"includeDecayFactor" );
std::string lineShape = parser.readAttribute( "lineShape" );
double blattWeisskopfD = parser.readAttributeDouble(
"blattWeisskopfFactor" );
double blattWeisskopfB = parser.readAttributeDouble(
"blattWeisskopfBirth" );
EvtId thisPart = EvtPDL::getId( name );
checkParticle( name );
if ( mass != -1 ) {
EvtPDL::reSetMass( thisPart, mass );
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Refined mass for "
<< EvtPDL::name( thisPart ).c_str() << " to be " << mass
<< endl;
}
if ( width != -1 ) {
EvtPDL::reSetWidth( thisPart, width );
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Refined width for "
<< EvtPDL::name( thisPart ).c_str() << " to be "
<< width << endl;
}
if ( minMass != -1 ) {
EvtPDL::reSetMassMin( thisPart, minMass );
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Refined minimum mass for "
<< EvtPDL::name( thisPart ).c_str() << " to be "
<< minMass << endl;
}
if ( maxMass != -1 ) {
EvtPDL::reSetMassMax( thisPart, maxMass );
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Refined maximum mass for "
<< EvtPDL::name( thisPart ).c_str() << " to be "
<< maxMass << endl;
}
if ( !birthFactor.empty() ) {
EvtPDL::includeBirthFactor( thisPart,
stringToBoolean( birthFactor ) );
if ( verbose ) {
if ( stringToBoolean( birthFactor ) ) {
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Include birth factor for "
<< EvtPDL::name( thisPart ).c_str() << endl;
} else {
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "No longer include birth factor for "
<< EvtPDL::name( thisPart ).c_str() << endl;
}
}
}
if ( !decayFactor.empty() ) {
EvtPDL::includeDecayFactor( thisPart,
stringToBoolean( decayFactor ) );
if ( verbose ) {
if ( stringToBoolean( decayFactor ) ) {
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Include decay factor for "
<< EvtPDL::name( thisPart ).c_str() << endl;
} else {
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "No longer include decay factor for "
<< EvtPDL::name( thisPart ).c_str() << endl;
}
}
}
if ( !lineShape.empty() ) {
EvtPDL::changeLS( thisPart, lineShape );
if ( verbose )
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Change lineshape to " << lineShape << " for "
<< EvtPDL::name( thisPart ).c_str() << endl;
}
if ( blattWeisskopfD != -1 ) {
EvtPDL::reSetBlatt( thisPart, blattWeisskopfD );
if ( verbose )
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Redefined Blatt-Weisskopf factor "
<< EvtPDL::name( thisPart ).c_str() << " to be "
<< blattWeisskopfD << endl;
}
if ( blattWeisskopfB != -1 ) {
EvtPDL::reSetBlattBirth( thisPart, blattWeisskopfB );
if ( verbose )
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Redefined Blatt-Weisskopf birth factor "
<< EvtPDL::name( thisPart ).c_str() << " to be "
<< blattWeisskopfB << endl;
}
} else if ( parser.getTagTitle() == "lineShapePW" ) {
std::string parent = parser.readAttribute( "parent" );
std::string daug1 = parser.readAttribute( "daug1" );
std::string daug2 = parser.readAttribute( "daug2" );
int pw = parser.readAttributeInt( "pw" );
checkParticle( parent );
checkParticle( daug1 );
checkParticle( daug2 );
EvtId thisPart = EvtPDL::getId( parent );
EvtId thisD1 = EvtPDL::getId( daug1 );
EvtId thisD2 = EvtPDL::getId( daug2 );
EvtPDL::setPWForDecay( thisPart, pw, thisD1, thisD2 );
EvtPDL::setPWForBirthL( thisD1, pw, thisPart, thisD2 );
EvtPDL::setPWForBirthL( thisD2, pw, thisPart, thisD1 );
if ( verbose )
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Redefined Partial wave for " << parent.c_str()
<< " to " << daug1.c_str() << " " << daug2.c_str()
<< " (" << pw << ")" << endl;
} else if ( parser.getTagTitle() == "decay" ) { //start of a particle
brfrSum = 0.;
decayParent = parser.readAttribute( "name" );
checkParticle( decayParent );
ipar = EvtPDL::getId( decayParent );
if ( _decaytable[ipar.getAlias()].getNMode() != 0 ) {
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Redefined decay of " << decayParent.c_str() << endl;
_decaytable[ipar.getAlias()].removeDecay();
}
} else if ( parser.getTagTitle() == "copyDecay" ) {
std::string particle = parser.readAttribute( "particle" );
std::string copy = parser.readAttribute( "copy" );
EvtId newipar = EvtPDL::getId( particle );
EvtId oldipar = EvtPDL::getId( copy );
checkParticle( particle );
checkParticle( copy );
if ( _decaytable[newipar.getAlias()].getNMode() != 0 ) {
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Redefining decay of " << particle << endl;
_decaytable[newipar.getAlias()].removeDecay();
}
_decaytable[newipar.getAlias()] = _decaytable[oldipar.getAlias()];
} else if ( parser.getTagTitle() == "removeDecay" ) {
decayParent = parser.readAttribute( "particle" );
checkParticle( decayParent );
ipar = EvtPDL::getId( decayParent );
if ( _decaytable[ipar.getAlias()].getNMode() == 0 ) {
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "No decays to delete for " << decayParent.c_str()
<< endl;
} else {
EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
<< "Deleting selected decays of " << decayParent.c_str()
<< endl;
}
} else if ( parser.getTagTitle() == "pythiaParam" ) {
Command command;
command["GENERATOR"] = parser.readAttribute( "generator" );
command["MODULE"] = parser.readAttribute( "module" );
command["PARAM"] = parser.readAttribute( "param" );
command["VALUE"] = parser.readAttribute( "value" );
command["VERSION"] = "PYTHIA8";
extGenCommands->addCommand( "PYTHIA", command );
} else if ( parser.getTagTitle() == "pythia6Param" ) {
Command command;
command["GENERATOR"] = parser.readAttribute( "generator" );
command["MODULE"] = parser.readAttribute( "module" );
command["PARAM"] = parser.readAttribute( "param" );
command["VALUE"] = parser.readAttribute( "value" );
command["VERSION"] = "PYTHIA6";
extGenCommands->addCommand( "PYTHIA", command );
} else if ( parser.getTagTitle() == "/data" ) { //end of data
endReached = true;
parser.close();
break;
} else if ( parser.getTagTitle() == "Title" ||
parser.getTagTitle() == "Details" ||
parser.getTagTitle() == "Author" ||
parser.getTagTitle() == "Version"
//the above tags are expected to be in the XML decay file but are not used by EvtGen
|| parser.getTagTitle() == "dalitzDecay" ||
parser.getTagTitle() == "copyDalitz" ) {
//the above tags are only used by EvtGenModels/EvtDalitzTable
} else {
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Unknown tag " << parser.getTagTitle()
<< " found in XML decay file near line "
<< parser.getLineNumber() << ". Tag will be ignored."
<< endl;
}
//TAGS FOUND UNDER DECAY
} else if ( parser.getParentTagTitle() == "decay" ) {
if ( parser.getTagTitle() == "channel" ) { //start of a channel
int nDaughters = 0;
EvtId daughter[MAX_DAUG];
EvtDecayBase* temp_fcn_new;
std::string temp_fcn_new_model;
std::vector<std::string> temp_fcn_new_args;
double brfr = parser.readAttributeDouble( "br" );
std::string daugStr = parser.readAttribute( "daughters" );
std::istringstream daugStream( daugStr );
std::string model = parser.readAttribute( "model" );
std::string paramStr = parser.readAttribute( "params" );
std::istringstream paramStream( paramStr );
bool decVerbose = parser.readAttributeBool( "verbose" );
bool decPhotos = parser.readAttributeBool( "photos" );
bool decSummary = parser.readAttributeBool( "summary" );
std::string daugh;
while ( std::getline( daugStream, daugh, ' ' ) ) {
checkParticle( daugh );
daughter[nDaughters++] = EvtPDL::getId( daugh );
}
int modelAlias = -1;
for ( size_t iAlias = 0; iAlias < modelAliasList.size();
iAlias++ ) {
if ( modelAliasList[iAlias].matchAlias( model ) ) {
modelAlias = iAlias;
break;
}
}
if ( modelAlias == -1 ) {
if ( !modelist.isModel( model ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Expected to find a model name near line "
<< parser.getLineNumber() << ","
<< "found:" << model.c_str() << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
} else {
model = modelAliasList[modelAlias].getName();
}
temp_fcn_new_model = model;
temp_fcn_new = modelist.getFcn( model );
if ( decPhotos )
temp_fcn_new->setPHOTOS();
if ( decVerbose )
temp_fcn_new->setVerbose();
if ( decSummary )
temp_fcn_new->setSummary();
int ierr;
if ( modelAlias == -1 ) {
std::string param;
if ( paramStr == "" ) {
int i( 0 );
std::string paramName = temp_fcn_new->getParamName( 0 );
while ( paramName != "" ) {
param = parser.readAttribute(
paramName, temp_fcn_new->getParamDefault( i ) );
if ( param == "" )
break; //params must be added in order so we can't just skip the missing ones
temp_fcn_new_args.push_back(
EvtSymTable::get( param, ierr ) );
if ( ierr ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Reading arguments near line "
<< parser.getLineNumber()
<< " and found:" << param.c_str() << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
++i;
paramName = temp_fcn_new->getParamName( i );
}
} else { //if the params are not set seperately
while ( std::getline( paramStream, param, ' ' ) ) {
temp_fcn_new_args.push_back(
EvtSymTable::get( param, ierr ) );
if ( ierr ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Reading arguments near line "
<< parser.getLineNumber()
<< " and found:" << param.c_str() << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
}
}
} else {
std::vector<std::string> copyMe =
modelAliasList[modelAlias].getArgList();
temp_fcn_new_args = copyMe;
}
brfrSum += brfr;
temp_fcn_new->saveDecayInfo( ipar, nDaughters, daughter,
temp_fcn_new_args.size(),
temp_fcn_new_args,
temp_fcn_new_model, brfr );
double massMin = 0.0;
for ( int i = 0; i < temp_fcn_new->nRealDaughters(); i++ ) {
if ( EvtPDL::getMinMass( daughter[i] ) > 0.0001 ) {
massMin += EvtPDL::getMinMass( daughter[i] );
} else {
massMin += EvtPDL::getMeanMass( daughter[i] );
}
}
_decaytable[ipar.getAlias()].addMode( temp_fcn_new, brfrSum,
massMin );
} else if ( parser.getTagTitle() == "/decay" ) { //end of a particle
_decaytable[ipar.getAlias()].finalize();
} else
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Unexpected tag " << parser.getTagTitle()
<< " found in XML decay file near line "
<< parser.getLineNumber() << ". Tag will be ignored."
<< endl;
//TAGS FOUND UNDER REMOVEDECAY
} else if ( parser.getParentTagTitle() == "removeDecay" ) {
if ( parser.getTagTitle() == "channel" ) { //start of a channel
int nDaughters = 0;
EvtId daughter[MAX_DAUG];
std::string daugStr = parser.readAttribute( "daughters" );
std::istringstream daugStream( daugStr );
std::string daugh;
while ( std::getline( daugStream, daugh, ' ' ) ) {
checkParticle( daugh );
daughter[nDaughters++] = EvtPDL::getId( daugh );
}
EvtDecayBase* temp_fcn_new = modelist.getFcn( "PHSP" );
std::vector<std::string> temp_fcn_new_args;
std::string temp_fcn_new_model( "PHSP" );
temp_fcn_new->saveDecayInfo( ipar, nDaughters, daughter, 0,
temp_fcn_new_args,
temp_fcn_new_model, 0. );
_decaytable[ipar.getAlias()].removeMode( temp_fcn_new );
} else if ( parser.getTagTitle() != "/removeDecay" ) {
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Unexpected tag " << parser.getTagTitle()
<< " found in XML decay file near line "
<< parser.getLineNumber() << ". Tag will be ignored."
<< endl;
}
}
} //while lines in file
if ( !endReached ) {
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Either the decay file ended prematurely or the file is badly formed.\n"
<< "Error occured near line" << parser.getLineNumber() << endl;
::abort();
}
//Now we may need to reset the minimum mass for some particles????
for ( size_t ii = 0; ii < EvtPDL::entries(); ii++ ) {
EvtId temp( ii, ii );
int nModTot = getNMode( ii );
//no decay modes
if ( nModTot == 0 )
continue;
//0 width?
if ( EvtPDL::getWidth( temp ) < 0.0000001 )
continue;
int jj;
double minMass = EvtPDL::getMaxMass( temp );
for ( jj = 0; jj < nModTot; jj++ ) {
double tmass = _decaytable[ii].getDecay( jj ).getMassMin();
if ( tmass < minMass )
minMass = tmass;
}
if ( minMass > EvtPDL::getMinMass( temp ) ) {
if ( verbose )
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Given allowed decays, resetting minMass "
<< EvtPDL::name( temp ).c_str() << " "
<< EvtPDL::getMinMass( temp ) << " to " << minMass << endl;
EvtPDL::reSetMassMin( temp, minMass );
}
}
}
bool EvtDecayTable::stringToBoolean( std::string valStr )
{
return ( valStr == "true" || valStr == "1" || valStr == "on" ||
valStr == "yes" );
}
void EvtDecayTable::checkParticle( std::string particle )
{
if ( EvtPDL::getId( particle ) == EvtId( -1, -1 ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Unknown particle name:" << particle.c_str() << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
}
EvtDecayBase* EvtDecayTable::findDecayModel( EvtId id, int modeInt )
{
int aliasInt = id.getAlias();
EvtDecayBase* theModel = this->findDecayModel( aliasInt, modeInt );
return theModel;
}
EvtDecayBase* EvtDecayTable::findDecayModel( int aliasInt, int modeInt )
{
EvtDecayBase* theModel( nullptr );
if ( aliasInt >= 0 && aliasInt < (int)EvtPDL::entries() ) {
theModel = _decaytable[aliasInt].getDecayModel( modeInt );
}
return theModel;
}
bool EvtDecayTable::hasPythia( EvtId id )
{
bool hasPythia = this->hasPythia( id.getAlias() );
return hasPythia;
}
bool EvtDecayTable::hasPythia( int aliasInt )
{
bool hasPythia( false );
if ( aliasInt >= 0 && aliasInt < (int)EvtPDL::entries() ) {
hasPythia = _decaytable[aliasInt].isJetSet();
}
return hasPythia;
}
int EvtDecayTable::getNModes( EvtId id )
{
int nModes = this->getNModes( id.getAlias() );
return nModes;
}
int EvtDecayTable::getNModes( int aliasInt )
{
int nModes( 0 );
if ( aliasInt >= 0 && aliasInt < (int)EvtPDL::entries() ) {
nModes = _decaytable[aliasInt].getNMode();
}
return nModes;
}
int EvtDecayTable::findChannel( EvtId parent, std::string model, int ndaug,
EvtId* daugs, int narg, std::string* args )
{
int i, j, right;
EvtId daugs_scratch[50];
int nmatch, k;
for ( i = 0; i < _decaytable[parent.getAlias()].getNMode(); i++ ) {
right = 1;
right = right && model == _decaytable[parent.getAlias()]
.getDecay( i )
.getDecayModel()
->getModelName();
right = right && ( ndaug == _decaytable[parent.getAlias()]
.getDecay( i )
.getDecayModel()
->getNDaug() );
right = right && ( narg == _decaytable[parent.getAlias()]
.getDecay( i )
.getDecayModel()
->getNArg() );
if ( right ) {
for ( j = 0; j < ndaug; j++ ) {
daugs_scratch[j] = daugs[j];
}
nmatch = 0;
for ( j = 0; j < _decaytable[parent.getAlias()]
.getDecay( i )
.getDecayModel()
->getNDaug();
j++ ) {
for ( k = 0; k < ndaug; k++ ) {
if ( daugs_scratch[k] == _decaytable[parent.getAlias()]
.getDecay( i )
.getDecayModel()
->getDaug( j ) ) {
daugs_scratch[k] = EvtId( -1, -1 );
nmatch++;
break;
}
}
}
right = right && ( nmatch == ndaug );
for ( j = 0; j < _decaytable[parent.getAlias()]
.getDecay( i )
.getDecayModel()
->getNArg();
j++ ) {
right = right && ( args[j] == _decaytable[parent.getAlias()]
.getDecay( i )
.getDecayModel()
->getArgStr( j ) );
}
}
if ( right )
return i;
}
return -1;
}
int EvtDecayTable::inChannelList( EvtId parent, int ndaug, EvtId* daugs )
{
int i, j, k;
EvtId daugs_scratch[MAX_DAUG];
int dsum = 0;
for ( i = 0; i < ndaug; i++ ) {
dsum += daugs[i].getAlias();
}
int nmatch;
int ipar = parent.getAlias();
int nmode = _decaytable[ipar].getNMode();
for ( i = 0; i < nmode; i++ ) {
EvtDecayBase* thedecaymodel =
_decaytable[ipar].getDecay( i ).getDecayModel();
if ( thedecaymodel->getDSum() == dsum ) {
int nd = thedecaymodel->getNDaug();
if ( ndaug == nd ) {
for ( j = 0; j < ndaug; j++ ) {
daugs_scratch[j] = daugs[j];
}
nmatch = 0;
for ( j = 0; j < nd; j++ ) {
for ( k = 0; k < ndaug; k++ ) {
if ( EvtId( daugs_scratch[k] ) ==
thedecaymodel->getDaug( j ) ) {
daugs_scratch[k] = EvtId( -1, -1 );
nmatch++;
break;
}
}
}
if ( ( nmatch == ndaug ) &&
( !( ( thedecaymodel->getModelName() == "JETSET" ) ||
( thedecaymodel->getModelName() == "PYTHIA" ) ) ) ) {
return i;
}
}
}
}
return -1;
}
std::vector<std::string> EvtDecayTable::splitString( std::string& theString,
std::string& splitter )
{
// Code from STLplus
std::vector<std::string> result;
if ( !theString.empty() && !splitter.empty() ) {
for ( std::string::size_type offset = 0;; ) {
std::string::size_type found = theString.find( splitter, offset );
if ( found != std::string::npos ) {
std::string tmpString = theString.substr( offset, found - offset );
if ( tmpString.size() > 0 ) {
result.push_back( tmpString );
}
offset = found + splitter.size();
} else {
std::string tmpString =
theString.substr( offset, theString.size() - offset );
if ( tmpString.size() > 0 ) {
result.push_back( tmpString );
}
break;
}
}
}
return result;
}
diff --git a/src/EvtGenBase/EvtExtGeneratorCommandsTable.cpp b/src/EvtGenBase/EvtExtGeneratorCommandsTable.cpp
index ebdb620..6913781 100644
--- a/src/EvtGenBase/EvtExtGeneratorCommandsTable.cpp
+++ b/src/EvtGenBase/EvtExtGeneratorCommandsTable.cpp
@@ -1,42 +1,42 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenBase/EvtExtGeneratorCommandsTable.hh"
EvtExtGeneratorCommandsTable::EvtExtGeneratorCommandsTable()
{
_commandMap.clear();
}
EvtExtGeneratorCommandsTable::~EvtExtGeneratorCommandsTable()
{
_commandMap.clear();
}
EvtExtGeneratorCommandsTable* EvtExtGeneratorCommandsTable::getInstance()
{
static EvtExtGeneratorCommandsTable* theCommandMap = nullptr;
- if ( theCommandMap == nullptr ) {
+ if ( !theCommandMap ) {
theCommandMap = new EvtExtGeneratorCommandsTable();
}
return theCommandMap;
}
diff --git a/src/EvtGenBase/EvtIdSet.cpp b/src/EvtGenBase/EvtIdSet.cpp
index 64dcfd4..7fb85b4 100644
--- a/src/EvtGenBase/EvtIdSet.cpp
+++ b/src/EvtGenBase/EvtIdSet.cpp
@@ -1,492 +1,62 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenBase/EvtIdSet.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtPatches.hh"
-#include <iostream>
+#include <initializer_list>
+#include <set>
#include <string>
-EvtIdSet::EvtIdSet( const EvtId name1 )
+EvtIdSet::EvtIdSet( std::initializer_list<EvtId> idList ) : m_list{ idList }
{
- _numInList = 1;
- _list = new EvtId[_numInList];
-
- _list[0] = name1;
-}
-
-EvtIdSet::EvtIdSet( const std::string name1 )
-{
- _numInList = 1;
- _list = new EvtId[_numInList];
-
- _list[0] = EvtPDL::getId( name1 );
-}
-
-EvtIdSet::EvtIdSet( const EvtId name1, const EvtId name2 )
-{
- _numInList = 2;
- _list = new EvtId[_numInList];
-
- _list[0] = name1;
- _list[1] = name2;
-}
-
-EvtIdSet::EvtIdSet( const std::string name1, const std::string name2 )
-{
- _numInList = 2;
- _list = new EvtId[_numInList];
-
- _list[0] = EvtPDL::getId( name1 );
- _list[1] = EvtPDL::getId( name2 );
-}
-
-EvtIdSet::EvtIdSet( const EvtId name1, const EvtId name2, const EvtId name3 )
-{
- _numInList = 3;
- _list = new EvtId[_numInList];
-
- _list[0] = name1;
- _list[1] = name2;
- _list[2] = name3;
-}
-
-EvtIdSet::EvtIdSet( const std::string name1, const std::string name2,
- const std::string name3 )
-{
- _numInList = 3;
- _list = new EvtId[_numInList];
-
- _list[0] = EvtPDL::getId( name1 );
- _list[1] = EvtPDL::getId( name2 );
- _list[2] = EvtPDL::getId( name3 );
-}
-
-EvtIdSet::EvtIdSet( const EvtId name1, const EvtId name2, const EvtId name3,
- const EvtId name4 )
-{
- _numInList = 4;
- _list = new EvtId[_numInList];
-
- _list[0] = name1;
- _list[1] = name2;
- _list[2] = name3;
- _list[3] = name4;
-}
-
-EvtIdSet::EvtIdSet( const std::string name1, const std::string name2,
- const std::string name3, const std::string name4 )
-{
- _numInList = 4;
- _list = new EvtId[_numInList];
-
- _list[0] = EvtPDL::getId( name1 );
- _list[1] = EvtPDL::getId( name2 );
- _list[2] = EvtPDL::getId( name3 );
- _list[3] = EvtPDL::getId( name4 );
-}
-
-EvtIdSet::EvtIdSet( const EvtId name1, const EvtId name2, const EvtId name3,
- const EvtId name4, const EvtId name5 )
-{
- _numInList = 5;
- _list = new EvtId[_numInList];
-
- _list[0] = name1;
- _list[1] = name2;
- _list[2] = name3;
- _list[3] = name4;
- _list[4] = name5;
-}
-
-EvtIdSet::EvtIdSet( const std::string name1, const std::string name2,
- const std::string name3, const std::string name4,
- const std::string name5 )
-{
- _numInList = 5;
- _list = new EvtId[_numInList];
-
- _list[0] = EvtPDL::getId( name1 );
- _list[1] = EvtPDL::getId( name2 );
- _list[2] = EvtPDL::getId( name3 );
- _list[3] = EvtPDL::getId( name4 );
- _list[4] = EvtPDL::getId( name5 );
-}
-
-EvtIdSet::EvtIdSet( const EvtId name1, const EvtId name2, const EvtId name3,
- const EvtId name4, const EvtId name5, const EvtId name6 )
-{
- _numInList = 6;
- _list = new EvtId[_numInList];
-
- _list[0] = name1;
- _list[1] = name2;
- _list[2] = name3;
- _list[3] = name4;
- _list[4] = name5;
- _list[5] = name6;
-}
-
-EvtIdSet::EvtIdSet( const std::string name1, const std::string name2,
- const std::string name3, const std::string name4,
- const std::string name5, const std::string name6 )
-{
- _numInList = 6;
- _list = new EvtId[_numInList];
-
- _list[0] = EvtPDL::getId( name1 );
- _list[1] = EvtPDL::getId( name2 );
- _list[2] = EvtPDL::getId( name3 );
- _list[3] = EvtPDL::getId( name4 );
- _list[4] = EvtPDL::getId( name5 );
- _list[5] = EvtPDL::getId( name6 );
-}
-
-EvtIdSet::EvtIdSet( const EvtId name1, const EvtId name2, const EvtId name3,
- const EvtId name4, const EvtId name5, const EvtId name6,
- const EvtId name7 )
-{
- _numInList = 7;
- _list = new EvtId[_numInList];
-
- _list[0] = name1;
- _list[1] = name2;
- _list[2] = name3;
- _list[3] = name4;
- _list[4] = name5;
- _list[5] = name6;
- _list[6] = name7;
}
-EvtIdSet::EvtIdSet( const std::string name1, const std::string name2,
- const std::string name3, const std::string name4,
- const std::string name5, const std::string name6,
- const std::string name7 )
+EvtIdSet::EvtIdSet( std::initializer_list<std::string> nameList )
{
- _numInList = 7;
- _list = new EvtId[_numInList];
-
- _list[0] = EvtPDL::getId( name1 );
- _list[1] = EvtPDL::getId( name2 );
- _list[2] = EvtPDL::getId( name3 );
- _list[3] = EvtPDL::getId( name4 );
- _list[4] = EvtPDL::getId( name5 );
- _list[5] = EvtPDL::getId( name6 );
- _list[6] = EvtPDL::getId( name7 );
-}
-
-EvtIdSet::EvtIdSet( const EvtId name1, const EvtId name2, const EvtId name3,
- const EvtId name4, const EvtId name5, const EvtId name6,
- const EvtId name7, const EvtId name8 )
-{
- _numInList = 8;
- _list = new EvtId[_numInList];
-
- _list[0] = name1;
- _list[1] = name2;
- _list[2] = name3;
- _list[3] = name4;
- _list[4] = name5;
- _list[5] = name6;
- _list[6] = name7;
- _list[7] = name8;
-}
-
-EvtIdSet::EvtIdSet( const std::string name1, const std::string name2,
- const std::string name3, const std::string name4,
- const std::string name5, const std::string name6,
- const std::string name7, const std::string name8 )
-{
- _numInList = 8;
- _list = new EvtId[_numInList];
-
- _list[0] = EvtPDL::getId( name1 );
- _list[1] = EvtPDL::getId( name2 );
- _list[2] = EvtPDL::getId( name3 );
- _list[3] = EvtPDL::getId( name4 );
- _list[4] = EvtPDL::getId( name5 );
- _list[5] = EvtPDL::getId( name6 );
- _list[6] = EvtPDL::getId( name7 );
- _list[7] = EvtPDL::getId( name8 );
-}
-
-EvtIdSet::EvtIdSet( const EvtId name1, const EvtId name2, const EvtId name3,
- const EvtId name4, const EvtId name5, const EvtId name6,
- const EvtId name7, const EvtId name8, const EvtId name9 )
-{
- _numInList = 9;
- _list = new EvtId[_numInList];
-
- _list[0] = name1;
- _list[1] = name2;
- _list[2] = name3;
- _list[3] = name4;
- _list[4] = name5;
- _list[5] = name6;
- _list[6] = name7;
- _list[7] = name8;
- _list[8] = name9;
-}
-
-EvtIdSet::EvtIdSet( const std::string name1, const std::string name2,
- const std::string name3, const std::string name4,
- const std::string name5, const std::string name6,
- const std::string name7, const std::string name8,
- const std::string name9 )
-{
- _numInList = 9;
- _list = new EvtId[_numInList];
-
- _list[0] = EvtPDL::getId( name1 );
- _list[1] = EvtPDL::getId( name2 );
- _list[2] = EvtPDL::getId( name3 );
- _list[3] = EvtPDL::getId( name4 );
- _list[4] = EvtPDL::getId( name5 );
- _list[5] = EvtPDL::getId( name6 );
- _list[6] = EvtPDL::getId( name7 );
- _list[7] = EvtPDL::getId( name8 );
- _list[8] = EvtPDL::getId( name9 );
-}
-
-EvtIdSet::EvtIdSet( const EvtId name1, const EvtId name2, const EvtId name3,
- const EvtId name4, const EvtId name5, const EvtId name6,
- const EvtId name7, const EvtId name8, const EvtId name9,
- const EvtId name10 )
-{
- _numInList = 10;
- _list = new EvtId[_numInList];
-
- _list[0] = name1;
- _list[1] = name2;
- _list[2] = name3;
- _list[3] = name4;
- _list[4] = name5;
- _list[5] = name6;
- _list[6] = name7;
- _list[7] = name8;
- _list[8] = name9;
- _list[9] = name10;
-}
-
-EvtIdSet::EvtIdSet( const std::string name1, const std::string name2,
- const std::string name3, const std::string name4,
- const std::string name5, const std::string name6,
- const std::string name7, const std::string name8,
- const std::string name9, const std::string name10 )
-{
- _numInList = 10;
- _list = new EvtId[_numInList];
-
- _list[0] = EvtPDL::getId( name1 );
- _list[1] = EvtPDL::getId( name2 );
- _list[2] = EvtPDL::getId( name3 );
- _list[3] = EvtPDL::getId( name4 );
- _list[4] = EvtPDL::getId( name5 );
- _list[5] = EvtPDL::getId( name6 );
- _list[6] = EvtPDL::getId( name7 );
- _list[7] = EvtPDL::getId( name8 );
- _list[8] = EvtPDL::getId( name9 );
- _list[9] = EvtPDL::getId( name10 );
-}
-
-EvtIdSet::EvtIdSet( const EvtId name1, const EvtId name2, const EvtId name3,
- const EvtId name4, const EvtId name5, const EvtId name6,
- const EvtId name7, const EvtId name8, const EvtId name9,
- const EvtId name10, const EvtId name11 )
-{
- _numInList = 11;
- _list = new EvtId[_numInList];
-
- _list[0] = name1;
- _list[1] = name2;
- _list[2] = name3;
- _list[3] = name4;
- _list[4] = name5;
- _list[5] = name6;
- _list[6] = name7;
- _list[7] = name8;
- _list[8] = name9;
- _list[9] = name10;
- _list[10] = name11;
-}
-
-EvtIdSet::EvtIdSet( const std::string name1, const std::string name2,
- const std::string name3, const std::string name4,
- const std::string name5, const std::string name6,
- const std::string name7, const std::string name8,
- const std::string name9, const std::string name10,
- const std::string name11 )
-{
- _numInList = 11;
- _list = new EvtId[_numInList];
-
- _list[0] = EvtPDL::getId( name1 );
- _list[1] = EvtPDL::getId( name2 );
- _list[2] = EvtPDL::getId( name3 );
- _list[3] = EvtPDL::getId( name4 );
- _list[4] = EvtPDL::getId( name5 );
- _list[5] = EvtPDL::getId( name6 );
- _list[6] = EvtPDL::getId( name7 );
- _list[7] = EvtPDL::getId( name8 );
- _list[8] = EvtPDL::getId( name9 );
- _list[9] = EvtPDL::getId( name10 );
- _list[10] = EvtPDL::getId( name11 );
-}
-
-EvtIdSet::EvtIdSet( const EvtId name1, const EvtId name2, const EvtId name3,
- const EvtId name4, const EvtId name5, const EvtId name6,
- const EvtId name7, const EvtId name8, const EvtId name9,
- const EvtId name10, const EvtId name11, const EvtId name12 )
-{
- _numInList = 12;
- _list = new EvtId[_numInList];
-
- _list[0] = name1;
- _list[1] = name2;
- _list[2] = name3;
- _list[3] = name4;
- _list[4] = name5;
- _list[5] = name6;
- _list[6] = name7;
- _list[7] = name8;
- _list[8] = name9;
- _list[9] = name10;
- _list[10] = name11;
- _list[11] = name12;
-}
-
-EvtIdSet::EvtIdSet( const std::string name1, const std::string name2,
- const std::string name3, const std::string name4,
- const std::string name5, const std::string name6,
- const std::string name7, const std::string name8,
- const std::string name9, const std::string name10,
- const std::string name11, const std::string name12 )
-{
- _numInList = 12;
- _list = new EvtId[_numInList];
-
- _list[0] = EvtPDL::getId( name1 );
- _list[1] = EvtPDL::getId( name2 );
- _list[2] = EvtPDL::getId( name3 );
- _list[3] = EvtPDL::getId( name4 );
- _list[4] = EvtPDL::getId( name5 );
- _list[5] = EvtPDL::getId( name6 );
- _list[6] = EvtPDL::getId( name7 );
- _list[7] = EvtPDL::getId( name8 );
- _list[8] = EvtPDL::getId( name9 );
- _list[9] = EvtPDL::getId( name10 );
- _list[10] = EvtPDL::getId( name11 );
- _list[11] = EvtPDL::getId( name12 );
-}
-
-EvtIdSet::EvtIdSet( const EvtIdSet& set1 )
-{
- _numInList = set1.sizeOfSet();
- _list = new EvtId[_numInList];
- int i;
- for ( i = 0; i < _numInList; i++ ) {
- _list[i] = set1.getElem( i );
+ for ( const std::string& name : nameList ) {
+ m_list.insert( EvtPDL::getId( name ) );
}
}
-EvtIdSet::EvtIdSet( const EvtIdSet& set1, const EvtIdSet& set2 )
-{
- _numInList = set1.sizeOfSet();
- _list = new EvtId[_numInList];
- int i;
- for ( i = 0; i < _numInList; i++ ) {
- _list[i] = set1.getElem( i );
- }
- //then just append the second list.
- this->append( set2 );
-}
-int EvtIdSet::contains( const EvtId id ) const
+EvtIdSet::EvtIdSet( const EvtIdSet& set1, const EvtIdSet& set2 ) :
+ m_list{ set1.m_list }
{
- int i;
- for ( i = 0; i < _numInList; i++ ) {
- if ( _list[i] == id )
- return 1;
- }
-
- return 0;
-}
-
-int EvtIdSet::contains( const std::string nm ) const
-{
- int i;
- for ( i = 0; i < _numInList; i++ ) {
- if ( _list[i] == EvtPDL::getId( nm ) )
- return 1;
- }
-
- return 0;
+ this->append( set2 );
}
-void EvtIdSet::append( const EvtIdSet set1 )
+bool EvtIdSet::contains( const EvtId& id ) const
{
- int combLen = _numInList + set1.sizeOfSet();
- int uniqueLen = 0;
- EvtId* combSet;
-
- combSet = new EvtId[combLen];
-
- int i;
- for ( i = 0; i < combLen; i++ ) {
- if ( i >= _numInList ) {
- //check that there are no overlaps between lists
- int j;
- int isUnique = 1;
- for ( j = 0; j < _numInList; j++ ) {
- if ( _list[j] == set1.getElem( i - _numInList ) ) {
- isUnique = 0;
- }
- }
- if ( isUnique == 1 ) {
- combSet[uniqueLen] = set1.getElem( i - _numInList );
- uniqueLen += 1;
- }
- } else {
- combSet[uniqueLen] = _list[i];
- uniqueLen += 1;
- }
-
- delete _list;
- _list = new EvtId[uniqueLen];
-
- _numInList = uniqueLen;
- for ( i = 0; i < _numInList; i++ ) {
- _list[i] = combSet[i];
- }
-
- delete combSet;
- }
+ const auto iter = m_list.find( id );
+ return iter != m_list.end();
}
-int EvtIdSet::sizeOfSet() const
+bool EvtIdSet::contains( const std::string& name ) const
{
- return _numInList;
+ const EvtId id{ EvtPDL::getId( name ) };
+ return this->contains( id );
}
-EvtId EvtIdSet::getElem( const int i ) const
+void EvtIdSet::append( const EvtIdSet& set1 )
{
- return _list[i];
+ m_list.insert( set1.m_list.begin(), set1.m_list.end() );
}
diff --git a/src/EvtGenBase/EvtModel.cpp b/src/EvtGenBase/EvtModel.cpp
index 5f11a5b..10adc6b 100644
--- a/src/EvtGenBase/EvtModel.cpp
+++ b/src/EvtGenBase/EvtModel.cpp
@@ -1,102 +1,102 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenBase/EvtModel.hh"
#include "EvtGenBase/EvtDecayBase.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtParser.hh"
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtParticleDecayList.hh"
#include "EvtGenBase/EvtPatches.hh"
#include "EvtGenBase/EvtRandom.hh"
#include "EvtGenBase/EvtReport.hh"
#include <assert.h>
#include <ctype.h>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <stdlib.h>
#include <string>
using std::fstream;
EvtModel* EvtModel::_instance = nullptr;
EvtModel::EvtModel()
{
}
EvtDecayBase* EvtModel::getFcn( std::string model_name )
{
EvtDecayBase* model = nullptr;
if ( _modelNameHash.find( model_name ) != _modelNameHash.end() ) {
model = _modelNameHash[model_name];
}
- if ( model == nullptr ) {
+ if ( !model ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Did not find the right model:" << model_name.c_str() << "\n";
return nullptr;
}
return model->clone();
}
void EvtModel::registerModel( EvtDecayBase* prototype )
{
std::string modelName = prototype->getName();
_modelNameHash[modelName] = prototype;
std::string commandName = prototype->commandName();
if ( commandName != "" ) {
_commandNameHash[commandName] = prototype;
}
}
int EvtModel::isModel( std::string model_name )
{
if ( _modelNameHash.find( model_name ) != _modelNameHash.end() ) {
return 1;
}
return 0;
}
int EvtModel::isCommand( std::string cmd )
{
if ( _commandNameHash.find( cmd ) != _commandNameHash.end() ) {
return 1;
}
return 0;
}
void EvtModel::storeCommand( std::string cmd, std::string cnfgstr )
{
EvtDecayBase* model = nullptr;
if ( _commandNameHash.find( cmd ) != _commandNameHash.end() ) {
model = _commandNameHash[cmd];
}
- assert( model != 0 );
+ assert( model );
model->command( cnfgstr );
}
diff --git a/src/EvtGenBase/EvtParticle.cpp b/src/EvtGenBase/EvtParticle.cpp
index fe9dc5e..7218fa2 100644
--- a/src/EvtGenBase/EvtParticle.cpp
+++ b/src/EvtGenBase/EvtParticle.cpp
@@ -1,1314 +1,1317 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtCPUtil.hh"
#include "EvtGenBase/EvtDecayTable.hh"
#include "EvtGenBase/EvtDiracParticle.hh"
#include "EvtGenBase/EvtGenKine.hh"
#include "EvtGenBase/EvtId.hh"
#include "EvtGenBase/EvtIdSet.hh"
#include "EvtGenBase/EvtNeutrinoParticle.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtParticleFactory.hh"
#include "EvtGenBase/EvtPatches.hh"
#include "EvtGenBase/EvtPhotonParticle.hh"
#include "EvtGenBase/EvtRadCorr.hh"
#include "EvtGenBase/EvtRandom.hh"
#include "EvtGenBase/EvtRaritaSchwingerParticle.hh"
#include "EvtGenBase/EvtReport.hh"
#include "EvtGenBase/EvtScalarParticle.hh"
#include "EvtGenBase/EvtSecondary.hh"
#include "EvtGenBase/EvtStatus.hh"
#include "EvtGenBase/EvtStdHep.hh"
#include "EvtGenBase/EvtStringParticle.hh"
#include "EvtGenBase/EvtTensorParticle.hh"
#include "EvtGenBase/EvtVectorParticle.hh"
#include <sys/stat.h>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
using std::endl;
EvtParticle::~EvtParticle()
{
delete _decayProb;
}
EvtParticle::EvtParticle()
{
_ndaug = 0;
_parent = nullptr;
_channel = -10;
_t = 0.0;
_genlifetime = 1;
_first = 1;
_isInit = false;
_validP4 = false;
_isDecayed = false;
_decayProb = nullptr;
_intAttributes.clear();
_dblAttributes.clear();
// _mix=false;
}
void EvtParticle::setFirstOrNot()
{
_first = 0;
}
void EvtParticle::resetFirstOrNot()
{
_first = 1;
}
void EvtParticle::setChannel( int i )
{
_channel = i;
}
EvtParticle* EvtParticle::getParent() const
{
return _parent;
}
void EvtParticle::setLifetime( double tau )
{
_t = tau;
}
void EvtParticle::setLifetime()
{
if ( _genlifetime ) {
_t = -log( EvtRandom::Flat() ) * EvtPDL::getctau( getId() );
}
}
double EvtParticle::getLifetime() const
{
return _t;
}
void EvtParticle::addDaug( EvtParticle* node )
{
node->_daug[node->_ndaug++] = this;
_ndaug = 0;
_parent = node;
}
int EvtParticle::firstornot() const
{
return _first;
}
EvtId EvtParticle::getId() const
{
return _id;
}
int EvtParticle::getPDGId() const
{
return EvtPDL::getStdHep( _id );
}
EvtSpinType::spintype EvtParticle::getSpinType() const
{
return EvtPDL::getSpinType( _id );
}
int EvtParticle::getSpinStates() const
{
return EvtSpinType::getSpinStates( EvtPDL::getSpinType( _id ) );
}
const EvtVector4R& EvtParticle::getP4() const
{
return _p;
}
int EvtParticle::getChannel() const
{
return _channel;
}
size_t EvtParticle::getNDaug() const
{
return _ndaug;
}
double EvtParticle::mass() const
{
return _p.mass();
}
void EvtParticle::setDiagonalSpinDensity()
{
_rhoForward.setDiag( getSpinStates() );
}
void EvtParticle::setVectorSpinDensity()
{
if ( getSpinStates() != 3 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Error in EvtParticle::setVectorSpinDensity" << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "spin_states:" << getSpinStates() << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "particle:" << EvtPDL::name( _id ).c_str() << endl;
::abort();
}
EvtSpinDensity rho;
//Set helicity +1 and -1 to 1.
rho.setDiag( getSpinStates() );
rho.set( 1, 1, EvtComplex( 0.0, 0.0 ) );
setSpinDensityForwardHelicityBasis( rho );
}
void EvtParticle::setSpinDensityForwardHelicityBasis( const EvtSpinDensity& rho )
{
EvtSpinDensity R = rotateToHelicityBasis();
assert( R.getDim() == rho.getDim() );
int n = rho.getDim();
_rhoForward.setDim( n );
int i, j, k, l;
for ( i = 0; i < n; i++ ) {
for ( j = 0; j < n; j++ ) {
EvtComplex tmp = 0.0;
for ( k = 0; k < n; k++ ) {
for ( l = 0; l < n; l++ ) {
tmp += R.get( l, i ) * rho.get( l, k ) *
conj( R.get( k, j ) );
}
}
_rhoForward.set( i, j, tmp );
}
}
}
void EvtParticle::setSpinDensityForwardHelicityBasis( const EvtSpinDensity& rho,
double alpha, double beta,
double gamma )
{
EvtSpinDensity R = rotateToHelicityBasis( alpha, beta, gamma );
assert( R.getDim() == rho.getDim() );
int n = rho.getDim();
_rhoForward.setDim( n );
int i, j, k, l;
for ( i = 0; i < n; i++ ) {
for ( j = 0; j < n; j++ ) {
EvtComplex tmp = 0.0;
for ( k = 0; k < n; k++ ) {
for ( l = 0; l < n; l++ ) {
tmp += R.get( l, i ) * rho.get( l, k ) *
conj( R.get( k, j ) );
}
}
_rhoForward.set( i, j, tmp );
}
}
}
void EvtParticle::initDecay( bool useMinMass )
{
EvtParticle* p = this;
// carefull - the parent mass might be fixed in stone..
EvtParticle* par = p->getParent();
double parMass = -1.;
- if ( par != nullptr ) {
+ if ( par ) {
if ( par->hasValidP4() )
parMass = par->mass();
for ( size_t i = 0; i < par->getNDaug(); i++ ) {
EvtParticle* tDaug = par->getDaug( i );
if ( p != tDaug )
parMass -= EvtPDL::getMinMass( tDaug->getId() );
}
}
if ( _isInit ) {
//we have already been here - just reroll the masses!
if ( _ndaug > 0 ) {
for ( size_t ii = 0; ii < _ndaug; ii++ ) {
if ( _ndaug == 1 ||
EvtPDL::getWidth( p->getDaug( ii )->getId() ) > 0.0000001 )
p->getDaug( ii )->initDecay( useMinMass );
else
p->getDaug( ii )->setMass(
EvtPDL::getMeanMass( p->getDaug( ii )->getId() ) );
}
}
EvtId* dauId = nullptr;
double* dauMasses = nullptr;
if ( _ndaug > 0 ) {
dauId = new EvtId[_ndaug];
dauMasses = new double[_ndaug];
for ( size_t j = 0; j < _ndaug; j++ ) {
dauId[j] = p->getDaug( j )->getId();
dauMasses[j] = p->getDaug( j )->mass();
}
}
EvtId* parId = nullptr;
EvtId* othDauId = nullptr;
EvtParticle* tempPar = p->getParent();
if ( tempPar ) {
parId = new EvtId( tempPar->getId() );
if ( tempPar->getNDaug() == 2 ) {
if ( tempPar->getDaug( 0 ) == this )
othDauId = new EvtId( tempPar->getDaug( 1 )->getId() );
else
othDauId = new EvtId( tempPar->getDaug( 0 )->getId() );
}
}
if ( p->getParent() && _validP4 == false ) {
if ( !useMinMass ) {
p->setMass( EvtPDL::getRandMass( p->getId(), parId, _ndaug, dauId,
othDauId, parMass, dauMasses ) );
} else
p->setMass( EvtPDL::getMinMass( p->getId() ) );
}
if ( parId )
delete parId;
if ( othDauId )
delete othDauId;
if ( dauId )
delete[] dauId;
if ( dauMasses )
delete[] dauMasses;
return;
}
//Will include effects of mixing here
//added by Lange Jan4,2000
static EvtId BS0 = EvtPDL::getId( "B_s0" );
static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
static EvtId BD0 = EvtPDL::getId( "B0" );
static EvtId BDB = EvtPDL::getId( "anti-B0" );
static EvtId D0 = EvtPDL::getId( "D0" );
static EvtId D0B = EvtPDL::getId( "anti-D0" );
static EvtId U4S = EvtPDL::getId( "Upsilon(4S)" );
- static EvtIdSet borUps( BS0, BSB, BD0, BDB, U4S );
+ static EvtIdSet borUps{ BS0, BSB, BD0, BDB, U4S };
//only makes sense if there is no parent particle which is a B or an Upsilon
bool hasBorUps = false;
if ( getParent() && borUps.contains( getParent()->getId() ) )
hasBorUps = true;
// if ( (getNDaug()==0)&&(getParent()==0) && (getId()==BS0||getId()==BSB||getId()==BD0||getId()==BDB)){
EvtId thisId = getId();
// remove D0 mixing for now.
// if ( (getNDaug()==0 && !hasBorUps) && (thisId==BS0||thisId==BSB||thisId==BD0||thisId==BDB||thisId==D0||thisId==D0B)){
if ( ( getNDaug() == 0 && !hasBorUps ) &&
( thisId == BS0 || thisId == BSB || thisId == BD0 || thisId == BDB ) ) {
double t;
int mix;
EvtCPUtil::getInstance()->incoherentMix( getId(), t, mix );
setLifetime( t );
if ( mix ) {
EvtScalarParticle* scalar_part;
scalar_part = new EvtScalarParticle;
if ( getId() == BS0 ) {
EvtVector4R p_init( EvtPDL::getMass( BSB ), 0.0, 0.0, 0.0 );
scalar_part->init( EvtPDL::chargeConj( getId() ), p_init );
} else if ( getId() == BSB ) {
EvtVector4R p_init( EvtPDL::getMass( BS0 ), 0.0, 0.0, 0.0 );
scalar_part->init( EvtPDL::chargeConj( getId() ), p_init );
} else if ( getId() == BD0 ) {
EvtVector4R p_init( EvtPDL::getMass( BDB ), 0.0, 0.0, 0.0 );
scalar_part->init( EvtPDL::chargeConj( getId() ), p_init );
} else if ( getId() == BDB ) {
EvtVector4R p_init( EvtPDL::getMass( BD0 ), 0.0, 0.0, 0.0 );
scalar_part->init( EvtPDL::chargeConj( getId() ), p_init );
} else if ( getId() == D0 ) {
EvtVector4R p_init( EvtPDL::getMass( D0B ), 0.0, 0.0, 0.0 );
scalar_part->init( EvtPDL::chargeConj( getId() ), p_init );
} else if ( getId() == D0B ) {
EvtVector4R p_init( EvtPDL::getMass( D0 ), 0.0, 0.0, 0.0 );
scalar_part->init( EvtPDL::chargeConj( getId() ), p_init );
}
scalar_part->setLifetime( 0 );
scalar_part->setDiagonalSpinDensity();
insertDaugPtr( 0, scalar_part );
_ndaug = 1;
_isInit = true;
p = scalar_part;
p->initDecay( useMinMass );
return;
}
}
EvtDecayBase* decayer;
decayer = EvtDecayTable::getInstance()->getDecayFunc( p );
if ( decayer ) {
p->makeDaughters( decayer->nRealDaughters(), decayer->getDaugs() );
//then loop over the daughters and init their decay
for ( size_t i = 0; i < p->getNDaug(); i++ ) {
// std::cout << EvtPDL::name(p->getDaug(i)->getId()) << " " << i << " " << p->getDaug(i)->getSpinType() << " " << EvtPDL::name(p->getId()) << std::endl;
if ( EvtPDL::getWidth( p->getDaug( i )->getId() ) > 0.0000001 )
p->getDaug( i )->initDecay( useMinMass );
else
p->getDaug( i )->setMass(
EvtPDL::getMeanMass( p->getDaug( i )->getId() ) );
}
}
int j;
EvtId* dauId = nullptr;
double* dauMasses = nullptr;
int nDaugT = p->getNDaug();
if ( nDaugT > 0 ) {
dauId = new EvtId[nDaugT];
dauMasses = new double[nDaugT];
for ( j = 0; j < nDaugT; j++ ) {
dauId[j] = p->getDaug( j )->getId();
dauMasses[j] = p->getDaug( j )->mass();
}
}
EvtId* parId = nullptr;
EvtId* othDauId = nullptr;
EvtParticle* tempPar = p->getParent();
if ( tempPar ) {
parId = new EvtId( tempPar->getId() );
if ( tempPar->getNDaug() == 2 ) {
if ( tempPar->getDaug( 0 ) == this )
othDauId = new EvtId( tempPar->getDaug( 1 )->getId() );
else
othDauId = new EvtId( tempPar->getDaug( 0 )->getId() );
}
}
if ( p->getParent() && p->hasValidP4() == false ) {
if ( !useMinMass ) {
p->setMass( EvtPDL::getRandMass( p->getId(), parId, p->getNDaug(),
dauId, othDauId, parMass,
dauMasses ) );
} else {
p->setMass( EvtPDL::getMinMass( p->getId() ) );
}
}
if ( parId )
delete parId;
if ( othDauId )
delete othDauId;
if ( dauId )
delete[] dauId;
if ( dauMasses )
delete[] dauMasses;
_isInit = true;
}
void EvtParticle::decay()
{
//P is particle to decay, typically 'this' but sometime
//modified by mixing
EvtParticle* p = this;
//Did it mix?
//if ( p->getMixed() ) {
//should take C(p) - this should only
//happen the first time we call decay for this
//particle
//p->takeCConj();
// p->setUnMixed();
//}
EvtDecayBase* decayer;
decayer = EvtDecayTable::getInstance()->getDecayFunc( p );
// if ( decayer ) {
// EvtGenReport(EVTGEN_INFO,"EvtGen") << "calling decay for " << EvtPDL::name(p->getId()) << " " << p->mass() << " " << p->getP4() << " " << p->getNDaug() << " " << p << endl;
// EvtGenReport(EVTGEN_INFO,"EvtGen") << "NDaug= " << decayer->getNDaug() << endl;
// int ti;
// for ( ti=0; ti<decayer->getNDaug(); ti++)
// EvtGenReport(EVTGEN_INFO,"EvtGen") << "Daug " << ti << " " << EvtPDL::name(decayer->getDaug(ti)) << endl;
// }
//if (p->_ndaug>0) {
// EvtGenReport(EVTGEN_INFO,"EvtGen") <<"Is decaying particle with daughters!!!!!"<<endl;
// ::abort();
//return;
//call initdecay first - April 29,2002 - Lange
//}
//if there are already daughters, then this step is already done!
// figure out the masses
bool massTreeOK( true );
if ( _ndaug == 0 ) {
massTreeOK = generateMassTree();
}
if ( massTreeOK == false ) {
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Could not decay " << EvtPDL::name( p->getId() ) << " with mass "
<< p->mass() << " to decay channel number " << _channel << endl;
_isDecayed = false;
return;
}
static EvtId BS0 = EvtPDL::getId( "B_s0" );
static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
static EvtId BD0 = EvtPDL::getId( "B0" );
static EvtId BDB = EvtPDL::getId( "anti-B0" );
// static EvtId D0=EvtPDL::getId("D0");
// static EvtId D0B=EvtPDL::getId("anti-D0");
EvtId thisId = getId();
// remove D0 mixing for now..
// if ( _ndaug==1 && (thisId==BS0||thisId==BSB||thisId==BD0||thisId==BDB||thisId==D0||thisId==D0B) ) {
if ( _ndaug == 1 &&
( thisId == BS0 || thisId == BSB || thisId == BD0 || thisId == BDB ) ) {
p = p->getDaug( 0 );
decayer = EvtDecayTable::getInstance()->getDecayFunc( p );
}
//now we have accepted a set of masses - time
if ( decayer != nullptr ) {
decayer->makeDecay( p );
} else {
p->_rhoBackward.setDiag( p->getSpinStates() );
}
_isDecayed = true;
return;
}
bool EvtParticle::generateMassTree()
{
bool isOK( true );
double massProb = 1.;
double ranNum = 2.;
int counter = 0;
EvtParticle* p = this;
while ( massProb < ranNum ) {
//check it out the first time.
p->initDecay();
massProb = p->compMassProb();
ranNum = EvtRandom::Flat();
counter++;
if ( counter > 10000 ) {
if ( counter == 10001 ) {
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Too many iterations to determine the mass tree. Parent mass= "
<< p->mass() << " " << massProb << endl;
p->printTree();
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "will take next combo with non-zero likelihood\n";
}
if ( massProb > 0. )
massProb = 2.0;
if ( counter > 20000 ) {
// one last try - take the minimum masses
p->initDecay( true );
p->printTree();
massProb = p->compMassProb();
if ( massProb > 0. ) {
massProb = 2.0;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Taking the minimum mass of all particles in the chain\n";
} else {
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Sorry, no luck finding a valid set of masses. This may be a pathological combo\n";
isOK = false;
break;
}
}
}
}
return isOK;
}
double EvtParticle::compMassProb()
{
EvtParticle* p = this;
double mass = p->mass();
double parMass = 0.;
if ( p->getParent() ) {
parMass = p->getParent()->mass();
}
int nDaug = p->getNDaug();
double* dMasses = nullptr;
int i;
if ( nDaug > 0 ) {
dMasses = new double[nDaug];
for ( i = 0; i < nDaug; i++ )
dMasses[i] = p->getDaug( i )->mass();
}
double temp = 1.0;
temp = EvtPDL::getMassProb( p->getId(), mass, parMass, nDaug, dMasses );
//If the particle already has a mass, we dont need to include
//it in the probability calculation
if ( ( !p->getParent() || _validP4 ) && temp > 0.0 )
temp = 1.;
delete[] dMasses;
for ( i = 0; i < nDaug; i++ ) {
temp *= p->getDaug( i )->compMassProb();
}
return temp;
}
void EvtParticle::deleteDaughters( bool keepChannel )
{
for ( size_t i = 0; i < _ndaug; i++ ) {
_daug[i]->deleteTree();
}
_ndaug = 0;
if ( !keepChannel )
_channel = -10;
_first = 1;
_isInit = false;
}
void EvtParticle::deleteTree()
{
this->deleteDaughters();
delete this;
}
EvtVector4C EvtParticle::epsParent( int i ) const
{
EvtVector4C temp;
printParticle();
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "and you have asked for the:" << i << "th polarization vector."
<< " I.e. you thought it was a"
<< " vector particle!" << endl;
::abort();
return temp;
}
EvtVector4C EvtParticle::eps( int i ) const
{
EvtVector4C temp;
printParticle();
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "and you have asked for the:" << i << "th polarization vector."
<< " I.e. you thought it was a"
<< " vector particle!" << endl;
::abort();
return temp;
}
EvtVector4C EvtParticle::epsParentPhoton( int i )
{
EvtVector4C temp;
printParticle();
EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "and you have asked for the:" << i
<< "th polarization vector of photon."
<< " I.e. you thought it was a"
<< " photon particle!" << endl;
::abort();
return temp;
}
EvtVector4C EvtParticle::epsPhoton( int i )
{
EvtVector4C temp;
printParticle();
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "and you have asked for the:" << i
<< "th polarization vector of a photon."
<< " I.e. you thought it was a"
<< " photon particle!" << endl;
::abort();
return temp;
}
EvtDiracSpinor EvtParticle::spParent( int i ) const
{
EvtDiracSpinor tempD;
printParticle();
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "and you have asked for the:" << i << "th dirac spinor."
<< " I.e. you thought it was a"
<< " Dirac particle!" << endl;
::abort();
return tempD;
}
EvtDiracSpinor EvtParticle::sp( int i ) const
{
EvtDiracSpinor tempD;
printParticle();
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "and you have asked for the:" << i << "th dirac spinor."
<< " I.e. you thought it was a"
<< " Dirac particle!" << endl;
::abort();
return tempD;
}
EvtDiracSpinor EvtParticle::spParentNeutrino() const
{
EvtDiracSpinor tempD;
printParticle();
EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "and you have asked for the "
<< "dirac spinor."
<< " I.e. you thought it was a"
<< " neutrino particle!" << endl;
::abort();
return tempD;
}
EvtDiracSpinor EvtParticle::spNeutrino() const
{
EvtDiracSpinor tempD;
printParticle();
EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "and you have asked for the "
<< "dirac spinor."
<< " I.e. you thought it was a"
<< " neutrino particle!" << endl;
::abort();
return tempD;
}
EvtTensor4C EvtParticle::epsTensorParent( int i ) const
{
EvtTensor4C tempC;
printParticle();
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "and you have asked for the:" << i << "th tensor."
<< " I.e. you thought it was a"
<< " Tensor particle!" << endl;
::abort();
return tempC;
}
EvtTensor4C EvtParticle::epsTensor( int i ) const
{
EvtTensor4C tempC;
printParticle();
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "and you have asked for the:" << i << "th tensor."
<< " I.e. you thought it was a"
<< " Tensor particle!" << endl;
::abort();
return tempC;
}
EvtRaritaSchwinger EvtParticle::spRSParent( int i ) const
{
EvtRaritaSchwinger tempD;
printParticle();
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "and you have asked for the:" << i << "th Rarita-Schwinger spinor."
<< " I.e. you thought it was a"
<< " RaritaSchwinger particle!" << std::endl;
::abort();
return tempD;
}
EvtRaritaSchwinger EvtParticle::spRS( int i ) const
{
EvtRaritaSchwinger tempD;
printParticle();
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "and you have asked for the:" << i << "th Rarita-Schwinger spinor."
<< " I.e. you thought it was a"
<< " RaritaSchwinger particle!" << std::endl;
::abort();
return tempD;
}
EvtVector4R EvtParticle::getP4Lab() const
{
EvtVector4R temp, mom;
const EvtParticle* ptemp;
temp = this->getP4();
ptemp = this;
- while ( ptemp->getParent() != nullptr ) {
+ while ( ptemp->getParent() ) {
ptemp = ptemp->getParent();
mom = ptemp->getP4();
temp = boostTo( temp, mom );
}
return temp;
}
EvtVector4R EvtParticle::getP4LabBeforeFSR()
{
EvtVector4R temp, mom;
EvtParticle* ptemp;
temp = this->_pBeforeFSR;
ptemp = this;
- while ( ptemp->getParent() != nullptr ) {
+ while ( ptemp->getParent() ) {
ptemp = ptemp->getParent();
mom = ptemp->getP4();
temp = boostTo( temp, mom );
}
return temp;
}
EvtVector4R EvtParticle::getP4Restframe() const
{
return EvtVector4R( mass(), 0.0, 0.0, 0.0 );
}
EvtVector4R EvtParticle::get4Pos() const
{
EvtVector4R temp, mom;
EvtParticle* ptemp;
temp.set( 0.0, 0.0, 0.0, 0.0 );
ptemp = getParent();
- if ( ptemp == nullptr )
+ if ( !ptemp ) {
return temp;
+ }
temp = ( ptemp->_t / ptemp->mass() ) * ( ptemp->getP4() );
- while ( ptemp->getParent() != nullptr ) {
+ while ( ptemp->getParent() ) {
ptemp = ptemp->getParent();
mom = ptemp->getP4();
temp = boostTo( temp, mom );
temp = temp + ( ptemp->_t / ptemp->mass() ) * ( ptemp->getP4() );
}
return temp;
}
EvtParticle* EvtParticle::nextIter( EvtParticle* rootOfTree )
{
EvtParticle* bpart;
EvtParticle* current;
current = this;
size_t i;
if ( _ndaug != 0 )
return _daug[0];
do {
bpart = current->_parent;
- if ( bpart == nullptr )
+ if ( !bpart ) {
return nullptr;
+ }
i = 0;
while ( bpart->_daug[i] != current ) {
i++;
}
if ( bpart == rootOfTree ) {
- if ( i + 1 == bpart->_ndaug )
+ if ( i + 1 == bpart->_ndaug ) {
return nullptr;
+ }
}
i++;
current = bpart;
} while ( i >= bpart->_ndaug );
return bpart->_daug[i];
}
void EvtParticle::makeStdHep( EvtStdHep& stdhep, EvtSecondary& secondary,
EvtId* list_of_stable )
{
//first add particle to the stdhep list;
stdhep.createParticle( getP4Lab(), get4Pos(), -1, -1,
EvtPDL::getStdHep( getId() ) );
int ii = 0;
//lets see if this is a longlived particle and terminate the
//list building!
while ( list_of_stable[ii] != EvtId( -1, -1 ) ) {
if ( getId() == list_of_stable[ii] ) {
secondary.createSecondary( 0, this );
return;
}
ii++;
}
for ( size_t i = 0; i < _ndaug; i++ ) {
stdhep.createParticle( _daug[i]->getP4Lab(), _daug[i]->get4Pos(), 0, 0,
EvtPDL::getStdHep( _daug[i]->getId() ) );
}
for ( size_t i = 0; i < _ndaug; i++ ) {
_daug[i]->makeStdHepRec( 1 + i, 1 + i, stdhep, secondary, list_of_stable );
}
return;
}
void EvtParticle::makeStdHep( EvtStdHep& stdhep )
{
//first add particle to the stdhep list;
stdhep.createParticle( getP4Lab(), get4Pos(), -1, -1,
EvtPDL::getStdHep( getId() ) );
for ( size_t i = 0; i < _ndaug; i++ ) {
stdhep.createParticle( _daug[i]->getP4Lab(), _daug[i]->get4Pos(), 0, 0,
EvtPDL::getStdHep( _daug[i]->getId() ) );
}
for ( size_t i = 0; i < _ndaug; i++ ) {
_daug[i]->makeStdHepRec( 1 + i, 1 + i, stdhep );
}
return;
}
void EvtParticle::makeStdHepRec( int firstparent, int lastparent,
EvtStdHep& stdhep, EvtSecondary& secondary,
EvtId* list_of_stable )
{
int ii = 0;
//lets see if this is a longlived particle and terminate the
//list building!
while ( list_of_stable[ii] != EvtId( -1, -1 ) ) {
if ( getId() == list_of_stable[ii] ) {
secondary.createSecondary( firstparent, this );
return;
}
ii++;
}
int parent_num = stdhep.getNPart();
for ( size_t i = 0; i < _ndaug; i++ ) {
stdhep.createParticle( _daug[i]->getP4Lab(), _daug[i]->get4Pos(),
firstparent, lastparent,
EvtPDL::getStdHep( _daug[i]->getId() ) );
}
for ( size_t i = 0; i < _ndaug; i++ ) {
_daug[i]->makeStdHepRec( parent_num + i, parent_num + i, stdhep,
secondary, list_of_stable );
}
return;
}
void EvtParticle::makeStdHepRec( int firstparent, int lastparent,
EvtStdHep& stdhep )
{
int parent_num = stdhep.getNPart();
for ( size_t i = 0; i < _ndaug; i++ ) {
stdhep.createParticle( _daug[i]->getP4Lab(), _daug[i]->get4Pos(),
firstparent, lastparent,
EvtPDL::getStdHep( _daug[i]->getId() ) );
}
for ( size_t i = 0; i < _ndaug; i++ ) {
_daug[i]->makeStdHepRec( parent_num + i, parent_num + i, stdhep );
}
return;
}
void EvtParticle::printTreeRec( unsigned int level ) const
{
size_t newlevel, i;
newlevel = level + 1;
if ( _ndaug != 0 ) {
if ( level > 0 ) {
for ( i = 0; i < ( 5 * level ); i++ ) {
EvtGenReport( EVTGEN_INFO, "" ) << " ";
}
}
EvtGenReport( EVTGEN_INFO, "" ) << EvtPDL::name( _id ).c_str();
EvtGenReport( EVTGEN_INFO, "" ) << " -> ";
for ( i = 0; i < _ndaug; i++ ) {
EvtGenReport( EVTGEN_INFO, "" )
<< EvtPDL::name( _daug[i]->getId() ).c_str() << " ";
}
for ( i = 0; i < _ndaug; i++ ) {
EvtGenReport( EVTGEN_INFO, "" )
<< _daug[i]->mass() << " " << _daug[i]->getP4() << " "
<< _daug[i]->getSpinStates() << "; ";
}
EvtGenReport( EVTGEN_INFO, "" ) << endl;
for ( i = 0; i < _ndaug; i++ ) {
_daug[i]->printTreeRec( newlevel );
}
}
}
void EvtParticle::printTree() const
{
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "This is the current decay chain" << endl;
EvtGenReport( EVTGEN_INFO, "" )
<< "This top particle is " << EvtPDL::name( _id ).c_str() << " "
<< this->mass() << " " << this->getP4() << endl;
this->printTreeRec( 0 );
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "End of decay chain." << endl;
}
std::string EvtParticle::treeStrRec( unsigned int level ) const
{
size_t newlevel, i;
newlevel = level + 1;
std::string retval = "";
for ( i = 0; i < _ndaug; i++ ) {
retval += EvtPDL::name( _daug[i]->getId() );
if ( _daug[i]->getNDaug() > 0 ) {
retval += " (";
retval += _daug[i]->treeStrRec( newlevel );
retval += ") ";
} else {
if ( i + 1 != _ndaug )
retval += " ";
}
}
return retval;
}
std::string EvtParticle::treeStr() const
{
std::string retval = EvtPDL::name( _id );
retval += " -> ";
retval += treeStrRec( 0 );
return retval;
}
void EvtParticle::printParticle() const
{
switch ( EvtPDL::getSpinType( _id ) ) {
case EvtSpinType::SCALAR:
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "This is a scalar particle:" << EvtPDL::name( _id ).c_str()
<< "\n";
break;
case EvtSpinType::VECTOR:
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "This is a vector particle:" << EvtPDL::name( _id ).c_str()
<< "\n";
break;
case EvtSpinType::TENSOR:
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "This is a tensor particle:" << EvtPDL::name( _id ).c_str()
<< "\n";
break;
case EvtSpinType::DIRAC:
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "This is a dirac particle:" << EvtPDL::name( _id ).c_str()
<< "\n";
break;
case EvtSpinType::PHOTON:
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "This is a photon:" << EvtPDL::name( _id ).c_str() << "\n";
break;
case EvtSpinType::NEUTRINO:
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "This is a neutrino:" << EvtPDL::name( _id ).c_str() << "\n";
break;
case EvtSpinType::STRING:
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "This is a string:" << EvtPDL::name( _id ).c_str() << "\n";
break;
default:
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Unknown particle type in EvtParticle::printParticle()"
<< endl;
break;
}
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Number of daughters:" << _ndaug << "\n";
}
void init_vector( EvtParticle** part )
{
*part = new EvtVectorParticle;
}
void init_scalar( EvtParticle** part )
{
*part = new EvtScalarParticle;
}
void init_tensor( EvtParticle** part )
{
*part = new EvtTensorParticle;
}
void init_dirac( EvtParticle** part )
{
*part = new EvtDiracParticle;
}
void init_photon( EvtParticle** part )
{
*part = new EvtPhotonParticle;
}
void init_neutrino( EvtParticle** part )
{
*part = new EvtNeutrinoParticle;
}
void init_string( EvtParticle** part )
{
*part = new EvtStringParticle;
}
double EvtParticle::initializePhaseSpace( unsigned int numdaughter,
EvtId* daughters,
bool forceDaugMassReset,
double poleSize, int whichTwo1,
int whichTwo2 )
{
double m_b;
unsigned int i;
//lange
// this->makeDaughters(numdaughter,daughters);
static EvtVector4R p4[100];
static double mass[100];
m_b = this->mass();
//lange - Jan2,2002 - Need to check to see if the daughters of the parent
// have changed. If so, delete them and start over.
//EvtGenReport(EVTGEN_INFO,"EvtGen") << "the parent is\n";
//if ( this->getParent() ) {
// if ( this->getParent()->getParent() ) this->getParent()->getParent()->printTree();
// this->getParent()->printTree();
//}
//EvtGenReport(EVTGEN_INFO,"EvtGen") << "and this is\n";
//if ( this) this->printTree();
bool resetDaughters = false;
if ( numdaughter != this->getNDaug() && this->getNDaug() > 0 )
resetDaughters = true;
if ( numdaughter == this->getNDaug() )
for ( i = 0; i < numdaughter; i++ ) {
if ( this->getDaug( i )->getId() != daughters[i] )
resetDaughters = true;
//EvtGenReport(EVTGEN_INFO,"EvtGen") << EvtPDL::name(this->getDaug(i)->getId())
// << " " << EvtPDL::name(daughters[i]) << endl;
}
if ( resetDaughters || forceDaugMassReset ) {
bool t1 = true;
//but keep the decay channel of the parent.
this->deleteDaughters( t1 );
this->makeDaughters( numdaughter, daughters );
bool massTreeOK = this->generateMassTree();
if ( massTreeOK == false ) {
return 0.0;
}
}
double weight = 0.;
for ( i = 0; i < numdaughter; i++ ) {
mass[i] = this->getDaug( i )->mass();
}
if ( poleSize < -0.1 ) {
//special case to enforce 4-momentum conservation in 1->1 decays
if ( numdaughter == 1 ) {
this->getDaug( 0 )->init( daughters[0],
EvtVector4R( m_b, 0.0, 0.0, 0.0 ) );
} else {
EvtGenKine::PhaseSpace( numdaughter, mass, p4, m_b );
for ( i = 0; i < numdaughter; i++ ) {
this->getDaug( i )->init( daughters[i], p4[i] );
}
}
} else {
if ( numdaughter != 3 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Only can generate pole phase space "
<< "distributions for 3 body final states" << endl
<< "Will terminate." << endl;
::abort();
}
bool ok = false;
if ( ( whichTwo1 == 1 && whichTwo2 == 0 ) ||
( whichTwo1 == 0 && whichTwo2 == 1 ) ) {
weight = EvtGenKine::PhaseSpacePole( m_b, mass[0], mass[1], mass[2],
poleSize, p4 );
this->getDaug( 0 )->init( daughters[0], p4[0] );
this->getDaug( 1 )->init( daughters[1], p4[1] );
this->getDaug( 2 )->init( daughters[2], p4[2] );
ok = true;
}
if ( ( whichTwo1 == 1 && whichTwo2 == 2 ) ||
( whichTwo1 == 2 && whichTwo2 == 1 ) ) {
weight = EvtGenKine::PhaseSpacePole( m_b, mass[2], mass[1], mass[0],
poleSize, p4 );
this->getDaug( 0 )->init( daughters[0], p4[2] );
this->getDaug( 1 )->init( daughters[1], p4[1] );
this->getDaug( 2 )->init( daughters[2], p4[0] );
ok = true;
}
if ( ( whichTwo1 == 0 && whichTwo2 == 2 ) ||
( whichTwo1 == 2 && whichTwo2 == 0 ) ) {
weight = EvtGenKine::PhaseSpacePole( m_b, mass[1], mass[0], mass[2],
poleSize, p4 );
this->getDaug( 0 )->init( daughters[0], p4[1] );
this->getDaug( 1 )->init( daughters[1], p4[0] );
this->getDaug( 2 )->init( daughters[2], p4[2] );
ok = true;
}
if ( !ok ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Invalid pair of particle to generate a pole dist "
<< whichTwo1 << " " << whichTwo2 << endl
<< "Will terminate." << endl;
::abort();
}
}
return weight;
}
void EvtParticle::makeDaughters( unsigned int ndaugstore,
std::vector<EvtId> idVector )
{
// Convert the STL vector method to use the array method for now, since the
// array method pervades most of the EvtGen code...
unsigned int nVector = idVector.size();
if ( nVector < ndaugstore ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Asking to make " << ndaugstore << " daughters when there "
<< "are only " << nVector << " EvtId values available" << endl;
return;
}
EvtId* idArray = new EvtId[ndaugstore];
unsigned int i;
for ( i = 0; i < ndaugstore; i++ ) {
idArray[i] = idVector[i];
}
this->makeDaughters( ndaugstore, idArray );
delete[] idArray;
}
void EvtParticle::makeDaughters( unsigned int ndaugstore, EvtId* id )
{
unsigned int i;
if ( _channel < 0 ) {
setChannel( 0 );
}
EvtParticle* pdaug;
if ( _ndaug != 0 ) {
if ( _ndaug != ndaugstore ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Asking to make a different number of "
<< "daughters than what was previously created." << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Original parent:" << EvtPDL::name( _id ) << endl;
for ( size_t i = 0; i < _ndaug; i++ ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Original daugther:"
<< EvtPDL::name( getDaug( i )->getId() ) << endl;
}
for ( size_t i = 0; i < ndaugstore; i++ ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "New Daug:" << EvtPDL::name( id[i] ) << endl;
}
EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "Will terminate." << endl;
::abort();
}
} else {
for ( i = 0; i < ndaugstore; i++ ) {
pdaug = EvtParticleFactory::particleFactory(
EvtPDL::getSpinType( id[i] ) );
pdaug->setId( id[i] );
pdaug->addDaug( this );
}
} //else
} //makeDaughters
void EvtParticle::setDecayProb( double prob )
{
if ( _decayProb == nullptr )
_decayProb = new double;
*_decayProb = prob;
}
std::string EvtParticle::getName() const
{
std::string theName = _id.getName();
return theName;
}
int EvtParticle::getAttribute( std::string attName )
{
// Retrieve the attribute integer if the name exists.
// Otherwise, simply return 0
int attValue = 0;
EvtAttIntMap::iterator mapIter;
if ( ( mapIter = _intAttributes.find( attName ) ) != _intAttributes.end() ) {
attValue = mapIter->second;
}
return attValue;
}
double EvtParticle::getAttributeDouble( std::string attName )
{
// Retrieve the attribute double if the name exists.
// Otherwise, simply return 0.0
double attValue = 0.0;
EvtAttDblMap::iterator mapIter;
if ( ( mapIter = _dblAttributes.find( attName ) ) != _dblAttributes.end() ) {
attValue = mapIter->second;
}
return attValue;
}
diff --git a/src/EvtGenModels/EvtBLLNuL.cpp b/src/EvtGenModels/EvtBLLNuL.cpp
index f3256b1..1047451 100644
--- a/src/EvtGenModels/EvtBLLNuL.cpp
+++ b/src/EvtGenModels/EvtBLLNuL.cpp
@@ -1,148 +1,148 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenModels/EvtBLLNuL.hh"
#include "EvtGenBase/EvtIdSet.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtReport.hh"
#include "EvtGenBase/EvtSpinType.hh"
EvtBLLNuL::EvtBLLNuL() : calcAmp_()
{
}
std::string EvtBLLNuL::getName()
{
// The model name
return "BLLNUL";
}
EvtDecayBase* EvtBLLNuL::clone()
{
return new EvtBLLNuL();
}
void EvtBLLNuL::init()
{
// check that there are 4 daughters
checkNDaug( 4 );
// We expect that the parent to be a scalar (B meson) and
// the daughters to be ell+ (k1), ell- (k2), neutrino (k3)
// and the last lepton ell- (k4)
// Check spin types
checkSpinParent( EvtSpinType::SCALAR );
checkSpinDaughter( 0, EvtSpinType::DIRAC ); // ell+(k_1)
checkSpinDaughter( 1, EvtSpinType::DIRAC ); // ell-(k_2)
checkSpinDaughter( 2, EvtSpinType::NEUTRINO ); // neu (k_3)
checkSpinDaughter( 3, EvtSpinType::DIRAC ); // ell-(k_4)
// Check that we have a charged B parent
- static EvtIdSet BMesons( "B-", "B+" );
+ static EvtIdSet BMesons{ "B-", "B+" };
if ( !BMesons.contains( getParentId() ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtBLLNuL" )
<< "Expecting the parent to be a charged B. Found PDG = "
<< EvtPDL::getStdHep( getParentId() ) << std::endl;
::abort();
}
// Make sure the first two leptons are charged conjugates of each other
int id1 = EvtPDL::getStdHep( getDaug( 0 ) );
int id2 = EvtPDL::getStdHep( getDaug( 1 ) );
if ( id1 != -id2 ) {
EvtGenReport( EVTGEN_ERROR, "EvtBLLNuL" )
<< "Expecting the first 2 leptons, with PDG codes " << id1 << " and "
<< id2 << ", to be charged conjugates of each other" << std::endl;
::abort();
}
// Check that the last lepton has the same charge as the B parent
int q3 = EvtPDL::chg3( getDaug( 3 ) ) / 3;
int qB = EvtPDL::chg3( getParentId() ) / 3;
if ( q3 != qB ) {
EvtGenReport( EVTGEN_ERROR, "EvtBLLNuL" )
<< "The 3rd lepton charge " << q3 << " does not match the B charge "
<< qB << std::endl;
::abort();
}
// Also check that the 2nd lepton has the same charge as the 3rd one
int q2 = EvtPDL::chg3( getDaug( 1 ) ) / 3;
if ( q2 != q3 ) {
EvtGenReport( EVTGEN_ERROR, "EvtBLLNuL" )
<< "The 2nd lepton charge " << q2
<< " does not match the 3rd lepton charge " << q3 << std::endl;
::abort();
}
// Identify if the decay has 3 charged leptons with the same flavour.
// If so, then we need to include amplitude terms where the 2nd and 3rd
// same-sign leptons are interchanged: k2 <-> k4
bool symmetry( false );
int id3 = EvtPDL::getStdHep( getDaug( 3 ) );
if ( abs( id1 ) == abs( id2 ) && abs( id1 ) == abs( id3 ) ) {
symmetry = true;
}
// Specify the qSq minimum cut-off as 4*(muon mass)^2 = 0.044655 and the
// kSq minimum cut off as 4*(electron mass)^2 = 1.044e-6
double muMass = EvtPDL::getMeanMass( EvtPDL::getId( "mu+" ) );
double eMass = EvtPDL::getMeanMass( EvtPDL::getId( "e+" ) );
double qSqMin = 4.0 * muMass * muMass;
double kSqMin = 4.0 * eMass * eMass;
// Optionally set these cut-offs using two decay file parameters. We may
// have a 3rd parameter (max prob), so check for at least 2 parameters
if ( getNArg() >= 2 ) {
qSqMin = getArg( 0 );
kSqMin = getArg( 1 );
}
// Define the amplitude qSq and kSq cut-offs, also
// specifying if the decay mode has flavour symmetry
calcAmp_.setParameters( qSqMin, kSqMin, symmetry );
}
void EvtBLLNuL::initProbMax()
{
// Set the maximum probability of the decay
double maxProb( 3.2 );
// Optional 3rd decay file parameter, e.g. if qSq and/or kSq min have changed.
// Note that both qSq and kSq parameters must still be specified in the decay
// file to ensure that the maximum probability value is the 3rd parameter!
if ( getNArg() == 3 ) {
maxProb = getArg( 2 );
}
setProbMax( maxProb );
}
void EvtBLLNuL::decay( EvtParticle* p )
{
p->initializePhaseSpace( getNDaug(), getDaugs() );
calcAmp_.CalcAmp( p, _amp2 );
}
diff --git a/src/EvtGenModels/EvtBToDiBaryonlnupQCD.cpp b/src/EvtGenModels/EvtBToDiBaryonlnupQCD.cpp
index c5eb475..bcc7e7c 100644
--- a/src/EvtGenModels/EvtBToDiBaryonlnupQCD.cpp
+++ b/src/EvtGenModels/EvtBToDiBaryonlnupQCD.cpp
@@ -1,228 +1,228 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenModels/EvtBToDiBaryonlnupQCD.hh"
#include "EvtGenBase/EvtId.hh"
#include "EvtGenBase/EvtIdSet.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtPatches.hh"
#include "EvtGenBase/EvtReport.hh"
#include "EvtGenBase/EvtScalarParticle.hh"
#include "EvtGenBase/EvtSpinType.hh"
#include "EvtGenBase/EvtVector4R.hh"
std::string EvtBToDiBaryonlnupQCD::getName()
{
return "BToDiBaryonlnupQCD";
}
EvtDecayBase* EvtBToDiBaryonlnupQCD::clone()
{
return new EvtBToDiBaryonlnupQCD;
}
void EvtBToDiBaryonlnupQCD::decay( EvtParticle* p )
{
p->initializePhaseSpace( getNDaug(), getDaugs(), true );
calcAmp_->CalcAmp( p, _amp2 );
}
void EvtBToDiBaryonlnupQCD::init()
{
if ( !( getNArg() == 6 || getNArg() == 7 ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "EvtBToDiBaryonlnupQCD model expected "
<< " 6 or 7 arguments but found:" << getNArg() << std::endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << std::endl;
::abort();
}
if ( getNDaug() != 4 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Wrong number of daughters in EvtBToDiBaryonlnupQCD model: "
<< "4 daughters expected but found: " << getNDaug() << std::endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << std::endl;
::abort();
}
// We expect B -> baryon baryon lepton neutrino
EvtSpinType::spintype parentType = EvtPDL::getSpinType( getParentId() );
EvtSpinType::spintype leptonType = EvtPDL::getSpinType( getDaug( 2 ) );
EvtSpinType::spintype neutrinoType = EvtPDL::getSpinType( getDaug( 3 ) );
if ( parentType != EvtSpinType::SCALAR ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "EvtBToDiBaryonlnupQCD model expected "
<< " a SCALAR parent, found:" << EvtPDL::name( getParentId() )
<< std::endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << std::endl;
::abort();
}
if ( leptonType != EvtSpinType::DIRAC ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "EvtBToDiBaryonlnupQCD model expected "
<< " a DIRAC 3rd daughter, found:" << EvtPDL::name( getDaug( 2 ) )
<< std::endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << std::endl;
::abort();
}
if ( neutrinoType != EvtSpinType::NEUTRINO ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "EvtBToDiBaryonlnupQCD model expected "
<< " a NEUTRINO 4th daughter, found:" << EvtPDL::name( getDaug( 3 ) )
<< std::endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << std::endl;
::abort();
}
// Get the 6 form factor D parameters from model arguments in the decay file
std::vector<double> DPars( 6 );
for ( int i = 0; i < 6; i++ ) {
DPars[i] = getArg( i );
}
// Form factor model
ffModel_ = std::make_unique<EvtBToDiBaryonlnupQCDFF>( DPars );
// Set amplitude calculation pointer.
// Accomodate for spin 1/2 (DIRAC) or 3/2 (RARITASCHWINGER) baryons
EvtSpinType::spintype baryon1Type = EvtPDL::getSpinType( getDaug( 0 ) );
EvtSpinType::spintype baryon2Type = EvtPDL::getSpinType( getDaug( 1 ) );
if ( ( baryon1Type == EvtSpinType::DIRAC &&
baryon2Type == EvtSpinType::RARITASCHWINGER ) ||
( baryon1Type == EvtSpinType::RARITASCHWINGER &&
baryon2Type == EvtSpinType::DIRAC ) ||
( baryon1Type == EvtSpinType::DIRAC &&
baryon2Type == EvtSpinType::DIRAC ) ) {
calcAmp_ = std::make_unique<EvtSLDiBaryonAmp>( *ffModel_ );
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Wrong baryon spin type in EvtBToDiBaryonlnupQCD model. "
<< "Expected spin type " << EvtSpinType::DIRAC << " or "
<< EvtSpinType::RARITASCHWINGER << ", found spin types "
<< baryon1Type << " and " << baryon2Type << std::endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << std::endl;
::abort();
}
}
void EvtBToDiBaryonlnupQCD::initProbMax()
{
// Set maximum prob using dec file parameter if present
if ( getNArg() == 7 ) {
setProbMax( getArg( 6 ) );
} else {
// Default probability for the B -> p p l nu mode, where l = e, mu or tau
setProbMax( 3.0e6 );
// Specific decay modes, where we have one proton plus a second
// baryon that can be any (excited) state. They all have lower
// maximum probabilities compared to the default pp mode in order
// to improve accept/reject generation efficiency
- static EvtIdSet BMesons( "B-", "B+" );
- static EvtIdSet Delta( "Delta+", "anti-Delta-" );
- static EvtIdSet LambdaC( "Lambda_c+", "anti-Lambda_c-" );
- static EvtIdSet LambdaC1( "Lambda_c(2593)+", "anti-Lambda_c(2593)-" );
- static EvtIdSet LambdaC2( "Lambda_c(2625)+", "anti-Lambda_c(2625)-" );
- static EvtIdSet N1440( "N(1440)+", "anti-N(1440)-" );
- static EvtIdSet N1520( "N(1520)+", "anti-N(1520)-" );
- static EvtIdSet N1535( "N(1535)+", "anti-N(1535)-" );
- static EvtIdSet N1650( "N(1650)+", "anti-N(1650)-" );
- static EvtIdSet N1700( "N(1700)+", "anti-N(1700)-" );
- static EvtIdSet N1710( "N(1710)+", "anti-N(1710)-" );
- static EvtIdSet N1720( "N(1720)+", "anti-N(1720)-" );
+ static EvtIdSet BMesons{ "B-", "B+" };
+ static EvtIdSet Delta{ "Delta+", "anti-Delta-" };
+ static EvtIdSet LambdaC{ "Lambda_c+", "anti-Lambda_c-" };
+ static EvtIdSet LambdaC1{ "Lambda_c(2593)+", "anti-Lambda_c(2593)-" };
+ static EvtIdSet LambdaC2{ "Lambda_c(2625)+", "anti-Lambda_c(2625)-" };
+ static EvtIdSet N1440{ "N(1440)+", "anti-N(1440)-" };
+ static EvtIdSet N1520{ "N(1520)+", "anti-N(1520)-" };
+ static EvtIdSet N1535{ "N(1535)+", "anti-N(1535)-" };
+ static EvtIdSet N1650{ "N(1650)+", "anti-N(1650)-" };
+ static EvtIdSet N1700{ "N(1700)+", "anti-N(1700)-" };
+ static EvtIdSet N1710{ "N(1710)+", "anti-N(1710)-" };
+ static EvtIdSet N1720{ "N(1720)+", "anti-N(1720)-" };
EvtId parId = getParentId();
EvtId bar1Id = getDaug( 0 );
EvtId bar2Id = getDaug( 1 );
// These probabilties are sensitive to the sub-decay modes of the excited baryon states,
// which limit the available phase space and allows for events to be generated within the
// 10,000 event trial limit. Otherwise the amplitude varies too much (by more than a factor
// of a million) and events fail to be generated correctly. In case of problems, specify
// the maximum probability by passing an extra 7th model parameter
if ( BMesons.contains( parId ) ) {
if ( Delta.contains( bar1Id ) || Delta.contains( bar2Id ) ) {
// Delta
setProbMax( 1e7 );
} else if ( LambdaC.contains( bar1Id ) ||
LambdaC.contains( bar2Id ) ) {
// Lambda_c+
setProbMax( 1000.0 );
} else if ( LambdaC1.contains( bar1Id ) ||
LambdaC1.contains( bar2Id ) ) {
// Lambda_c+(2593)
setProbMax( 200.0 );
} else if ( LambdaC2.contains( bar1Id ) ||
LambdaC2.contains( bar2Id ) ) {
// Lambda_c+(2625)
setProbMax( 500.0 );
} else if ( N1440.contains( bar1Id ) || N1440.contains( bar2Id ) ) {
// N(1440)
setProbMax( 8e5 );
} else if ( N1520.contains( bar1Id ) || N1520.contains( bar2Id ) ) {
// N(1520)
setProbMax( 8e6 );
} else if ( N1535.contains( bar1Id ) || N1535.contains( bar2Id ) ) {
// N(1535)
setProbMax( 8e5 );
} else if ( N1650.contains( bar1Id ) || N1650.contains( bar2Id ) ) {
// N(1650)
setProbMax( 8e5 );
} else if ( N1700.contains( bar1Id ) || N1700.contains( bar2Id ) ) {
// N(1700)
setProbMax( 4e6 );
} else if ( N1710.contains( bar1Id ) || N1710.contains( bar2Id ) ) {
// N(1710)
setProbMax( 5e5 );
} else if ( N1720.contains( bar1Id ) || N1720.contains( bar2Id ) ) {
// N(1720)
setProbMax( 4e6 );
} // Baryon combinations
} // B parent
} // Specific modes
}
diff --git a/src/EvtGenModels/EvtBaryonPCR.cpp b/src/EvtGenModels/EvtBaryonPCR.cpp
index 7c8ed9b..8a47ac8 100644
--- a/src/EvtGenModels/EvtBaryonPCR.cpp
+++ b/src/EvtGenModels/EvtBaryonPCR.cpp
@@ -1,183 +1,183 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenModels/EvtBaryonPCR.hh"
#include "EvtGenBase/EvtConst.hh"
#include "EvtGenBase/EvtGenKine.hh"
#include "EvtGenBase/EvtIdSet.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtPatches.hh"
#include "EvtGenBase/EvtReport.hh"
#include "EvtGenModels/EvtBaryonPCRFF.hh"
#include <stdlib.h>
#include <string>
using namespace std;
#ifdef D0
#undef D0
#endif
std::string EvtBaryonPCR::getName()
{
return "BaryonPCR";
}
EvtBaryonPCR* EvtBaryonPCR::clone()
{
return new EvtBaryonPCR;
}
void EvtBaryonPCR::decay( EvtParticle* p )
{
//This is a kludge to avoid warnings because the K_2* mass becomes to large.
- static EvtIdSet regenerateMasses( "K_2*+", "K_2*-", "K_2*0", "anti-K_2*0",
- "K_1+", "K_1-", "K_10", "anti-K_10",
- "D'_1+", "D'_1-", "D'_10", "anti-D'_10" );
+ static EvtIdSet regenerateMasses{ "K_2*+", "K_2*-", "K_2*0", "anti-K_2*0",
+ "K_1+", "K_1-", "K_10", "anti-K_10",
+ "D'_1+", "D'_1-", "D'_10", "anti-D'_10" };
if ( regenerateMasses.contains( getDaug( 0 ) ) ) {
p->resetFirstOrNot();
}
p->initializePhaseSpace( getNDaug(), getDaugs() );
EvtComplex r00( getArg( 0 ), 0.0 );
EvtComplex r01( getArg( 1 ), 0.0 );
EvtComplex r10( getArg( 2 ), 0.0 );
EvtComplex r11( getArg( 3 ), 0.0 );
calcamp->CalcAmp( p, _amp2, baryonpcrffmodel.get(), r00, r01, r10, r11 );
}
void EvtBaryonPCR::initProbMax()
{
// Baryons (partial list 5/28/04)
static EvtId SIGC0 = EvtPDL::getId( "Sigma_c0" );
static EvtId SIGC0B = EvtPDL::getId( "anti-Sigma_c0" );
static EvtId SIGCP = EvtPDL::getId( "Sigma_c+" );
static EvtId SIGCM = EvtPDL::getId( "anti-Sigma_c-" );
static EvtId SIGCPP = EvtPDL::getId( "Sigma_c++" );
static EvtId SIGCMM = EvtPDL::getId( "anti-Sigma_c--" );
static EvtId LAMCP = EvtPDL::getId( "Lambda_c+" );
static EvtId LAMCM = EvtPDL::getId( "anti-Lambda_c-" );
static EvtId LAMC1P = EvtPDL::getId( "Lambda_c(2593)+" );
static EvtId LAMC1M = EvtPDL::getId( "anti-Lambda_c(2593)-" );
static EvtId LAMC2P = EvtPDL::getId( "Lambda_c(2625)+" );
static EvtId LAMC2M = EvtPDL::getId( "anti-Lambda_c(2625)-" );
static EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
static EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
EvtId parnum, barnum, lnum;
parnum = getParentId();
barnum = getDaug( 0 );
lnum = getDaug( 1 );
if ( parnum == LAMB || parnum == LAMBB ) {
if ( barnum == LAMCP || barnum == LAMCM || barnum == LAMC1P ||
barnum == LAMC1M || barnum == LAMC2P || barnum == LAMC2M ||
barnum == SIGC0 || barnum == SIGC0B || barnum == SIGCP ||
barnum == SIGCM || barnum == SIGCPP || barnum == SIGCMM ) {
setProbMax( 22000.0 );
return;
}
}
//This is a real cludge.. (ryd)
setProbMax( 0.0 );
}
void EvtBaryonPCR::init()
{
//if (getNArg()!=0) {
if ( getNArg() != 4 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "EvtBaryonPCR generator expected "
<< " 4 arguments but found:" << getNArg() << endl;
//<< " 0 arguments but found:"<<getNArg()<<endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
if ( getNDaug() != 3 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Wrong number of daughters in EvtBaryonPCR.cc "
<< " 3 daughters expected but found: " << getNDaug() << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
//We expect the parent to be a scalar
//and the daughters to be X lepton neutrino
EvtSpinType::spintype parenttype = EvtPDL::getSpinType( getParentId() );
EvtSpinType::spintype baryontype = EvtPDL::getSpinType( getDaug( 0 ) );
EvtSpinType::spintype leptontype = EvtPDL::getSpinType( getDaug( 1 ) );
EvtSpinType::spintype neutrinotype = EvtPDL::getSpinType( getDaug( 2 ) );
if ( parenttype != EvtSpinType::DIRAC ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "EvtBaryonPCR generator expected "
<< " a DIRAC parent, found:" << EvtPDL::name( getParentId() )
<< endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
if ( leptontype != EvtSpinType::DIRAC ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "EvtBaryonPCR generator expected "
<< " a DIRAC 2nd daughter, found:" << EvtPDL::name( getDaug( 1 ) )
<< endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
if ( neutrinotype != EvtSpinType::NEUTRINO ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "EvtBaryonPCR generator expected "
<< " a NEUTRINO 3rd daughter, found:" << EvtPDL::name( getDaug( 2 ) )
<< endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
baryonpcrffmodel = std::make_unique<EvtBaryonPCRFF>();
if ( baryontype == EvtSpinType::DIRAC ||
baryontype == EvtSpinType::RARITASCHWINGER ) {
calcamp = std::make_unique<EvtSemiLeptonicBaryonAmp>();
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Wrong baryon spin type in EvtBaryonPCR.cc "
<< "Expected spin type " << EvtSpinType::DIRAC
<< ", found spin type " << baryontype << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
}
diff --git a/src/EvtGenModels/EvtBcToNPi.cpp b/src/EvtGenModels/EvtBcToNPi.cpp
index bd9e408..f53577b 100644
--- a/src/EvtGenModels/EvtBcToNPi.cpp
+++ b/src/EvtGenModels/EvtBcToNPi.cpp
@@ -1,379 +1,379 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenModels/EvtBcToNPi.hh"
#include "EvtGenBase/EvtIdSet.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtPatches.hh"
#include "EvtGenBase/EvtReport.hh"
#include "EvtGenBase/EvtScalarParticle.hh"
#include "EvtGenBase/EvtSpinType.hh"
#include "EvtGenBase/EvtTensor4C.hh"
#include "EvtGenBase/EvtVector4C.hh"
#include <iostream>
using std::endl;
EvtBcToNPi::EvtBcToNPi( bool printAuthorInfo )
{
nCall = 0;
maxAmp2 = 0;
if ( printAuthorInfo == true ) {
this->printAuthorInfo();
}
}
std::string EvtBcToNPi::getName()
{
return "EvtBcToNPi";
}
EvtDecayBase* EvtBcToNPi::clone()
{
return new EvtBcToNPi;
}
void EvtBcToNPi::init()
{
// check spins
checkSpinParent( EvtSpinType::SCALAR );
// the others are scalar
for ( int i = 1; i <= ( getNDaug() - 1 ); i++ ) {
checkSpinDaughter( i, EvtSpinType::SCALAR );
};
_beta = -0.108;
_mRho = 0.775;
_gammaRho = 0.149;
_mRhopr = 1.364;
_gammaRhopr = 0.400;
_mA1 = 1.23;
_gammaA1 = 0.4;
// read arguments
if ( EvtPDL::getSpinType( getDaug( 0 ) ) == EvtSpinType::VECTOR ) {
checkNArg( 10 );
int n = 0;
_maxProb = getArg( n++ );
FA0_N = getArg( n++ );
FA0_c1 = getArg( n++ );
FA0_c2 = getArg( n++ );
FAp_N = getArg( n++ );
FAp_c1 = getArg( n++ );
FAp_c2 = getArg( n++ );
FV_N = getArg( n++ );
FV_c1 = getArg( n++ );
FV_c2 = getArg( n++ );
FAm_N = 0;
FAm_c1 = 0;
FAm_c2 = 0;
} else if ( EvtPDL::getSpinType( getDaug( 0 ) ) == EvtSpinType::SCALAR ) {
checkNArg( 4 );
int n = 0;
_maxProb = getArg( n++ );
Fp_N = getArg( n++ );
Fp_c1 = getArg( n++ );
Fp_c2 = getArg( n++ );
Fm_N = 0;
Fm_c1 = 0;
Fm_c2 = 0;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Have not yet implemented this final state in BCPSINPI model"
<< endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "Ndaug=" << getNDaug() << endl;
for ( int id = 0; id < ( getNDaug() - 1 ); id++ )
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Daug " << id << " " << EvtPDL::name( getDaug( id ) ).c_str()
<< endl;
return;
};
if ( getNDaug() < 2 || getNDaug() > 4 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Have not yet implemented this final state in BCPSINPI model"
<< endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "Ndaug=" << getNDaug() << endl;
for ( int id = 0; id < ( getNDaug() - 1 ); id++ )
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Daug " << id << " " << EvtPDL::name( getDaug( id ) ).c_str()
<< endl;
return;
}
}
double EvtBcToNPi::_ee( double M, double m1, double m2 )
{
return ( M * M + m1 * m1 - m2 * m2 ) / ( 2 * M );
}
double EvtBcToNPi::_pp( double M, double m1, double m2 )
{
double __ee = _ee( M, m1, m2 );
return sqrt( __ee * __ee - m1 * m1 );
}
void EvtBcToNPi::initProbMax()
{
if ( _maxProb > 0. )
setProbMax( _maxProb );
else {
EvtId id = getParentId();
EvtScalarParticle* p = new EvtScalarParticle();
p->init( id, EvtPDL::getMass( id ), 0., 0., 0. );
p->setDiagonalSpinDensity();
// add daughters
p->makeDaughters( getNDaug(), getDaugs() );
// fill the momenta
if ( getNDaug() == 2 ) {
double M = EvtPDL::getMass( id ),
m1 = EvtPDL::getMass( getDaug( 0 ) ),
m2 = EvtPDL::getMass( getDaug( 1 ) );
double __pp = _pp( M, m1, m2 );
p->getDaug( 0 )->setP4(
EvtVector4R( _ee( M, m1, m2 ), 0., 0., __pp ) );
p->getDaug( 1 )->setP4(
EvtVector4R( _ee( M, m2, m1 ), 0., 0., -__pp ) );
} else if ( getNDaug() == 3 ) {
double M = EvtPDL::getMass( id ),
m1 = EvtPDL::getMass( getDaug( 0 ) ),
m2 = EvtPDL::getMass( getDaug( 1 ) ),
m3 = EvtPDL::getMass( getDaug( 2 ) );
double __ppRho = _pp( M, m1, _mRho ), __ppPi = _pp( _mRho, m2, m3 );
p->getDaug( 0 )->setP4(
EvtVector4R( _ee( M, m1, _mRho ), 0., 0., __ppRho ) );
EvtVector4R _pRho( _ee( M, _mRho, m1 ), 0., 0., -__ppRho );
EvtVector4R _p2( _ee( _mRho, m2, m3 ), 0., 0., __ppPi );
_p2.applyBoostTo( _pRho );
EvtVector4R _p3( _ee( _mRho, m2, m3 ), 0., 0., -__ppPi );
_p3.applyBoostTo( _pRho );
p->getDaug( 1 )->setP4( _p2 );
p->getDaug( 2 )->setP4( _p3 );
} else if ( getNDaug() == 4 ) {
double M = EvtPDL::getMass( id ),
m1 = EvtPDL::getMass( getDaug( 0 ) ),
m2 = EvtPDL::getMass( getDaug( 1 ) ),
m3 = EvtPDL::getMass( getDaug( 2 ) ),
m4 = EvtPDL::getMass( getDaug( 3 ) );
if ( M < m1 + _mA1 )
return;
double __ppA1 = _pp( M, m1, _mA1 ), __ppRho = _pp( _mA1, _mRho, m4 ),
__ppPi = _pp( _mRho, m2, m3 );
p->getDaug( 0 )->setP4(
EvtVector4R( _ee( M, m1, _mRho ), 0., 0., __ppA1 ) );
EvtVector4R _pA1( _ee( M, _mA1, m1 ), 0., 0., -__ppA1 );
EvtVector4R _pRho( _ee( _mA1, _mRho, m4 ), 0, 0, __ppRho );
_pRho.applyBoostTo( _pA1 );
EvtVector4R _p4( _ee( _mA1, m4, _mRho ), 0, 0, -__ppRho );
_p4.applyBoostTo( _pA1 );
p->getDaug( 3 )->setP4( _p4 );
EvtVector4R _p2( _ee( _mRho, m2, m3 ), 0, 0, __ppPi );
_p2.applyBoostTo( _pRho );
p->getDaug( 1 )->setP4( _p2 );
EvtVector4R _p3( _ee( _mRho, m2, m3 ), 0, 0, -__ppPi );
_p2.applyBoostTo( _pRho );
p->getDaug( 2 )->setP4( _p3 );
};
_amp2.init( p->getId(), getNDaug(), getDaugs() );
decay( p );
EvtSpinDensity rho = _amp2.getSpinDensity();
double prob = p->getSpinDensityForward().normalizedProb( rho );
if ( prob > 0 )
setProbMax( 0.9 * prob );
};
}
void EvtBcToNPi::decay( EvtParticle* root_particle )
{
++nCall;
- EvtIdSet thePis( "pi+", "pi-", "pi0" );
+ EvtIdSet thePis{ "pi+", "pi-", "pi0" };
EvtComplex I = EvtComplex( 0.0, 1.0 );
root_particle->initializePhaseSpace( getNDaug(), getDaugs() );
EvtVector4R p( root_particle->mass(), 0., 0., 0. ), // Bc momentum
k = root_particle->getDaug( 0 )->getP4(), // J/psi momenta
Q = p - k;
double Q2 = Q.mass2();
// check pi-mesons and calculate hadronic current
EvtVector4C hardCur;
bool foundHadCurr = false;
if ( getNDaug() == 2 ) // Bc -> psi pi+
{
hardCur = Q;
foundHadCurr = true;
} else if ( getNDaug() == 3 ) // Bc -> psi pi+ pi0
{
EvtVector4R p1, p2;
p1 = root_particle->getDaug( 1 )->getP4(), // pi+ momenta
p2 = root_particle->getDaug( 2 )->getP4(), // pi0 momentum
hardCur = Fpi( p1, p2 ) * ( p1 - p2 );
foundHadCurr = true;
} else if ( getNDaug() == 4 ) // Bc -> psi pi+ pi pi
{
int diffPi( 0 ), samePi1( 0 ), samePi2( 0 );
if ( getDaug( 1 ) == getDaug( 2 ) ) {
diffPi = 3;
samePi1 = 1;
samePi2 = 2;
}
if ( getDaug( 1 ) == getDaug( 3 ) ) {
diffPi = 2;
samePi1 = 1;
samePi2 = 3;
}
if ( getDaug( 2 ) == getDaug( 3 ) ) {
diffPi = 1;
samePi1 = 2;
samePi2 = 3;
}
EvtVector4R p1 = root_particle->getDaug( samePi1 )->getP4();
EvtVector4R p2 = root_particle->getDaug( samePi2 )->getP4();
EvtVector4R p3 = root_particle->getDaug( diffPi )->getP4();
EvtComplex BA1;
double GA1 = _gammaA1 * pi3G( Q2, samePi1 ) /
pi3G( _mA1 * _mA1, samePi1 );
EvtComplex denBA1( _mA1 * _mA1 - Q.mass2(), -1. * _mA1 * GA1 );
BA1 = _mA1 * _mA1 / denBA1;
hardCur = BA1 * ( ( p1 - p3 ) -
( Q * ( Q * ( p1 - p3 ) ) / Q2 ) * Fpi( p2, p3 ) +
( p2 - p3 ) -
( Q * ( Q * ( p2 - p3 ) ) / Q2 ) * Fpi( p1, p3 ) );
foundHadCurr = true;
}
if ( !foundHadCurr ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Have not yet implemented this final state in BCNPI model"
<< endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "Ndaug=" << getNDaug() << endl;
int id;
for ( id = 0; id < ( getNDaug() - 1 ); id++ )
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Daug " << id << " " << EvtPDL::name( getDaug( id ) ).c_str()
<< endl;
::abort();
};
EvtTensor4C H;
double amp2 = 0.;
if ( root_particle->getDaug( 0 )->getSpinType() == EvtSpinType::VECTOR ) {
double FA0 = FA0_N * exp( FA0_c1 * Q2 + FA0_c2 * Q2 * Q2 );
double FAp = FAp_N * exp( FAp_c1 * Q2 + FAp_c2 * Q2 * Q2 );
double FAm = FAm_N * exp( FAm_c1 * Q2 + FAm_c2 * Q2 * Q2 );
double FV = FV_N * exp( FV_c1 * Q2 + FV_c2 * Q2 * Q2 );
H = -FA0 * EvtTensor4C::g() -
FAp * EvtGenFunctions::directProd( p, p + k ) +
FAm * EvtGenFunctions::directProd( p, p - k ) +
2 * I * FV * dual( EvtGenFunctions::directProd( p, k ) );
EvtVector4C Heps = H.cont2( hardCur );
for ( int i = 0; i < 4; i++ ) {
EvtVector4C eps = root_particle->getDaug( 0 )
->epsParent( i )
.conj(); // psi-meson polarization vector
EvtComplex amp = eps * Heps;
vertex( i, amp );
amp2 += pow( abs( amp ), 2 );
}
} else if ( root_particle->getDaug( 0 )->getSpinType() ==
EvtSpinType::SCALAR ) {
double Fp = Fp_N * exp( Fp_c1 * Q2 + Fp_c2 * Q2 * Q2 );
double Fm = Fm_N * exp( Fm_c1 * Q2 + Fm_c2 * Q2 * Q2 );
EvtVector4C H = Fp * ( p + k ) + Fm * ( p - k );
EvtComplex amp = H * hardCur;
vertex( amp );
amp2 += pow( abs( amp ), 2 );
};
if ( amp2 > maxAmp2 )
maxAmp2 = amp2;
return;
}
EvtComplex EvtBcToNPi::Fpi( EvtVector4R q1, EvtVector4R q2 )
{
double m1 = q1.mass();
double m2 = q2.mass();
EvtVector4R Q = q1 + q2;
double mQ2 = Q * Q;
// momenta in the rho->pipi decay
double dRho = _mRho * _mRho - m1 * m1 - m2 * m2;
double pPiRho = ( 1.0 / _mRho ) *
sqrt( ( dRho * dRho ) / 4.0 - m1 * m1 * m2 * m2 );
double dRhopr = _mRhopr * _mRhopr - m1 * m1 - m2 * m2;
double pPiRhopr = ( 1.0 / _mRhopr ) *
sqrt( ( dRhopr * dRhopr ) / 4.0 - m1 * m1 * m2 * m2 );
double dQ = mQ2 - m1 * m1 - m2 * m2;
double pPiQ = ( 1.0 / sqrt( mQ2 ) ) *
sqrt( ( dQ * dQ ) / 4.0 - m1 * m1 * m2 * m2 );
double gammaRho = _gammaRho * _mRho / sqrt( mQ2 ) *
pow( ( pPiQ / pPiRho ), 3 );
EvtComplex BRhoDem( _mRho * _mRho - mQ2, -1.0 * _mRho * gammaRho );
EvtComplex BRho = _mRho * _mRho / BRhoDem;
double gammaRhopr = _gammaRhopr * _mRhopr / sqrt( mQ2 ) *
pow( ( pPiQ / pPiRhopr ), 3 );
EvtComplex BRhoprDem( _mRhopr * _mRhopr - mQ2, -1.0 * _mRho * gammaRhopr );
EvtComplex BRhopr = _mRhopr * _mRhopr / BRhoprDem;
return ( BRho + _beta * BRhopr ) / ( 1 + _beta );
}
double EvtBcToNPi::pi3G( double m2, int dupD )
{
double mPi = EvtPDL::getMeanMass( getDaug( dupD ) );
if ( m2 > ( _mRho + mPi ) ) {
return m2 * ( 1.623 + 10.38 / m2 - 9.32 / ( m2 * m2 ) +
0.65 / ( m2 * m2 * m2 ) );
} else {
double t1 = m2 - 9.0 * mPi * mPi;
return 4.1 * pow( t1, 3.0 ) * ( 1.0 - 3.3 * t1 + 5.8 * t1 * t1 );
}
}
void EvtBcToNPi::printAuthorInfo()
{
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Defining EvtBcToNPi model: Bc -> V + npi and Bc -> P + npi decays\n"
<< "from A.V. Berezhnoy, A.K. Likhoded, A.V. Luchinsky: "
<< "Phys.Rev.D 82, 014012 (2010) and arXiV:1104.0808." << endl;
}
diff --git a/src/EvtGenModels/EvtBcVHad.cpp b/src/EvtGenModels/EvtBcVHad.cpp
index f2dd903..18042af 100644
--- a/src/EvtGenModels/EvtBcVHad.cpp
+++ b/src/EvtGenModels/EvtBcVHad.cpp
@@ -1,376 +1,376 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenModels/EvtBcVHad.hh"
#include "EvtGenBase/EvtIdSet.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtReport.hh"
#include "EvtGenBase/EvtSpinType.hh"
#include "EvtGenBase/EvtTensor4C.hh"
#include "EvtGenBase/EvtVector4R.hh"
#include "EvtGenModels/EvtBCVFF2.hh"
#include "EvtGenModels/EvtWHad.hh"
#include <iostream>
std::string EvtBcVHad::getName()
{
return "BC_VHAD";
}
EvtDecayBase* EvtBcVHad::clone()
{
return new EvtBcVHad;
}
//======================================================
void EvtBcVHad::init()
{
checkNArg( 1 );
checkSpinParent( EvtSpinType::SCALAR );
checkSpinDaughter( 0, EvtSpinType::VECTOR );
for ( int i = 1; i <= ( getNDaug() - 1 ); i++ ) {
checkSpinDaughter( i, EvtSpinType::SCALAR );
}
idVector = getDaug( 0 ).getId();
whichfit = int( getArg( 0 ) + 0.1 );
ffmodel = std::make_unique<EvtBCVFF2>( idVector, whichfit );
wcurr = std::make_unique<EvtWHad>();
// determine the code of final hadronic state
- EvtIdSet thePis( "pi+", "pi-", "pi0" );
- EvtIdSet theK( "K+", "K-", "K_S0" );
+ EvtIdSet thePis{ "pi+", "pi-", "pi0" };
+ EvtIdSet theK{ "K+", "K-", "K_S0" };
if ( getNDaug() == 2 && thePis.contains( getDaug( 1 ) ) ) {
out_code = 1; // pi+
} else if ( getNDaug() == 3 && thePis.contains( getDaug( 1 ) ) &&
thePis.contains( getDaug( 2 ) ) ) {
out_code = 2; // pi+ pi0
} else if ( getNDaug() == 4 && thePis.contains( getDaug( 1 ) ) &&
thePis.contains( getDaug( 2 ) ) &&
thePis.contains( getDaug( 3 ) ) ) {
out_code = 3; // pi+ pi+ pi-
} else if ( getNDaug() == 5 && thePis.contains( getDaug( 1 ) ) &&
thePis.contains( getDaug( 2 ) ) &&
thePis.contains( getDaug( 3 ) ) &&
thePis.contains( getDaug( 4 ) ) ) {
out_code = 4; //4pi
} else if ( getNDaug() == 6 && thePis.contains( getDaug( 1 ) ) &&
thePis.contains( getDaug( 2 ) ) &&
thePis.contains( getDaug( 3 ) ) &&
thePis.contains( getDaug( 4 ) ) &&
thePis.contains( getDaug( 5 ) ) ) {
out_code = 5; //5pi
} else if ( getNDaug() == 4 && theK.contains( getDaug( 1 ) ) &&
theK.contains( getDaug( 2 ) ) &&
thePis.contains( getDaug( 3 ) ) ) {
out_code = 6; //KKpi
} else if ( getNDaug() == 4 && theK.contains( getDaug( 1 ) ) &&
thePis.contains( getDaug( 2 ) ) &&
thePis.contains( getDaug( 3 ) ) ) {
out_code = 7; // Kpi pi
} else if ( getNDaug() == 3 && theK.contains( getDaug( 1 ) ) &&
theK.contains( getDaug( 2 ) ) ) {
out_code = 8; // KK
} else if ( getNDaug() == 6 && theK.contains( getDaug( 1 ) ) &&
theK.contains( getDaug( 2 ) ) && thePis.contains( getDaug( 3 ) ) &&
thePis.contains( getDaug( 4 ) ) &&
thePis.contains( getDaug( 5 ) ) ) {
out_code = 9; // KK+3pi
} else if ( getNDaug() == 8 && thePis.contains( getDaug( 1 ) ) &&
thePis.contains( getDaug( 2 ) ) &&
thePis.contains( getDaug( 3 ) ) &&
thePis.contains( getDaug( 4 ) ) &&
thePis.contains( getDaug( 5 ) ) &&
thePis.contains( getDaug( 6 ) ) &&
thePis.contains( getDaug( 7 ) ) ) {
out_code = 10; //7pi
} else if ( getNDaug() == 6 && theK.contains( getDaug( 1 ) ) &&
thePis.contains( getDaug( 2 ) ) &&
thePis.contains( getDaug( 3 ) ) &&
thePis.contains( getDaug( 4 ) ) &&
thePis.contains( getDaug( 5 ) ) ) {
out_code = 11; // K+ pi+ pi+ pi- pi-
} else {
EvtGenReport( EVTGEN_ERROR, "EvtBcHad" )
<< "Init: unknown decay" << std::endl;
};
EvtGenReport( EVTGEN_INFO, "EvtBcHad" )
<< "out_code = " << out_code << ", whichfit = " << whichfit << std::endl;
}
//======================================================
void EvtBcVHad::initProbMax()
{
if ( out_code == 1 ) {
if ( idVector == EvtPDL::getId( "J/psi" ).getId() && whichfit == 1 &&
getNDaug() == 2 )
setProbMax( 500. );
else if ( idVector == EvtPDL::getId( "J/psi" ).getId() &&
whichfit == 2 && getNDaug() == 2 )
setProbMax( 300. );
else if ( idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
whichfit == 1 && getNDaug() == 2 )
setProbMax( 17. );
else if ( idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
whichfit == 2 && getNDaug() == 2 )
setProbMax( 40. );
} else if ( out_code == 2 ) {
if ( idVector == EvtPDL::getId( "J/psi" ).getId() && whichfit == 1 &&
getNDaug() == 3 )
setProbMax( 10950. );
else if ( idVector == EvtPDL::getId( "J/psi" ).getId() &&
whichfit == 2 && getNDaug() == 3 )
setProbMax( 4200. );
else if ( idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
whichfit == 1 && getNDaug() == 3 )
setProbMax( 500. );
else if ( idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
whichfit == 2 && getNDaug() == 3 )
setProbMax( 700. );
} else if ( out_code == 3 ) {
if ( idVector == EvtPDL::getId( "J/psi" ).getId() && whichfit == 1 &&
getNDaug() == 4 )
setProbMax( 42000. );
else if ( idVector == EvtPDL::getId( "J/psi" ).getId() &&
whichfit == 2 && getNDaug() == 4 )
setProbMax( 90000. );
else if ( idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
whichfit == 1 && getNDaug() == 4 )
setProbMax( 1660. );
else if ( idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
whichfit == 2 && getNDaug() == 4 )
setProbMax( 2600. );
} else if ( out_code == 5 ) {
if ( idVector == EvtPDL::getId( "J/psi" ).getId() && whichfit == 1 &&
getNDaug() == 6 )
setProbMax( 720000. );
else if ( idVector == EvtPDL::getId( "J/psi" ).getId() &&
whichfit == 2 && getNDaug() == 6 )
setProbMax( 519753. );
else if ( idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
whichfit == 1 && getNDaug() == 6 )
setProbMax( 40000. );
else if ( idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
whichfit == 2 && getNDaug() == 6 )
setProbMax( 30000. );
} else if ( out_code == 6 ) {
if ( idVector == EvtPDL::getId( "J/psi" ).getId() && whichfit == 1 )
setProbMax( 50000. );
else if ( idVector == EvtPDL::getId( "J/psi" ).getId() && whichfit == 2 )
setProbMax( 22000.0 );
else if ( idVector == EvtPDL::getId( "psi(2S)" ).getId() && whichfit == 1 )
setProbMax( 2300.0 );
else if ( idVector == EvtPDL::getId( "psi(2S)" ).getId() && whichfit == 2 )
setProbMax( 1700.00 );
} else if ( out_code == 7 ) {
if ( idVector == EvtPDL::getId( "J/psi" ).getId() && whichfit == 1 )
setProbMax( 2.2e+06 );
else if ( idVector == EvtPDL::getId( "J/psi" ).getId() && whichfit == 2 )
setProbMax( 930000 );
else if ( idVector == EvtPDL::getId( "psi(2S)" ).getId() && whichfit == 1 )
setProbMax( 92000.0 );
else if ( idVector == EvtPDL::getId( "psi(2S)" ).getId() && whichfit == 2 )
setProbMax( 93000.0 );
} else if ( out_code == 8 ) {
if ( idVector == EvtPDL::getId( "J/psi" ).getId() && whichfit == 1 )
setProbMax( 2e2 );
else if ( idVector == EvtPDL::getId( "J/psi" ).getId() && whichfit == 2 )
setProbMax( 80 );
else if ( idVector == EvtPDL::getId( "psi(2S)" ).getId() && whichfit == 1 )
setProbMax( 10 );
else if ( idVector == EvtPDL::getId( "psi(2S)" ).getId() && whichfit == 2 )
setProbMax( 10 );
} else if ( out_code == 9 ) {
if ( idVector == EvtPDL::getId( "J/psi" ).getId() && whichfit == 1 )
setProbMax( 3e4 );
else if ( idVector == EvtPDL::getId( "J/psi" ).getId() && whichfit == 2 )
setProbMax( 18540 );
else if ( idVector == EvtPDL::getId( "psi(2S)" ).getId() && whichfit == 1 )
setProbMax( 0.15 * 1e4 );
else if ( idVector == EvtPDL::getId( "psi(2S)" ).getId() && whichfit == 2 )
setProbMax( 2 * 500 );
} else if ( out_code == 10 ) {
if ( idVector == EvtPDL::getId( "J/psi" ).getId() && whichfit == 1 )
setProbMax( 2e6 );
else if ( idVector == EvtPDL::getId( "J/psi" ).getId() && whichfit == 2 )
setProbMax( 5e6 );
else if ( idVector == EvtPDL::getId( "psi(2S)" ).getId() && whichfit == 1 )
setProbMax( 1.5e5 );
else if ( idVector == EvtPDL::getId( "psi(2S)" ).getId() && whichfit == 2 )
setProbMax( 1e5 );
} else if ( out_code == 11 ) {
if ( idVector == EvtPDL::getId( "J/psi" ).getId() && whichfit == 1 )
setProbMax( 2.5e8 );
else if ( idVector == EvtPDL::getId( "J/psi" ).getId() && whichfit == 2 )
setProbMax( 1.4e7 );
else if ( idVector == EvtPDL::getId( "psi(2S)" ).getId() && whichfit == 1 )
setProbMax( 2e6 );
else if ( idVector == EvtPDL::getId( "psi(2S)" ).getId() && whichfit == 2 )
setProbMax( 8e4 );
} else {
EvtGenReport( EVTGEN_ERROR, "EvtBcHad" )
<< "probmax: Have not yet implemented this final state in BC_VHAD model, out_code = "
<< out_code << std::endl;
::abort();
}
}
//======================================================
EvtVector4C EvtBcVHad::hardCurr( EvtParticle* root_particle ) const
{
EvtVector4C hardCur;
if ( out_code == 1 ) {
// pi+
hardCur = wcurr->WCurrent( root_particle->getDaug( 1 )->getP4() );
} else if ( out_code == 2 ) {
// pi+ pi0
hardCur = wcurr->WCurrent( root_particle->getDaug( 1 )->getP4(),
root_particle->getDaug( 2 )->getP4() );
} else if ( out_code == 3 ) {
// pi+ pi+ pi-
hardCur = wcurr->WCurrent( root_particle->getDaug( 1 )->getP4(),
root_particle->getDaug( 2 )->getP4(),
root_particle->getDaug( 3 )->getP4() );
} else if ( out_code == 5 ) {
// Bc -> psi pi+ pi+ pi- pi- pi+ from Kuhn, Was, hep-ph/0602162
hardCur = wcurr->WCurrent( root_particle->getDaug( 1 )->getP4(),
root_particle->getDaug( 2 )->getP4(),
root_particle->getDaug( 3 )->getP4(),
root_particle->getDaug( 4 )->getP4(),
root_particle->getDaug( 5 )->getP4() );
} else if ( out_code == 6 ) {
// K+ K- pi+
hardCur = wcurr->WCurrent_KKP( root_particle->getDaug( 1 )->getP4(),
root_particle->getDaug( 2 )->getP4(),
root_particle->getDaug( 3 )->getP4() );
} else if ( out_code == 7 ) {
// K+ pi+ pi-
hardCur = wcurr->WCurrent_KPP( root_particle->getDaug( 1 )->getP4(),
root_particle->getDaug( 2 )->getP4(),
root_particle->getDaug( 3 )->getP4() );
} else if ( out_code == 8 ) {
// K_S0 K+
hardCur = wcurr->WCurrent_KSK( root_particle->getDaug( 1 )->getP4(),
root_particle->getDaug( 2 )->getP4() );
} else if ( out_code == 9 ) {
// K+ K- pi+ pi+ pi-
hardCur = wcurr->WCurrent_KKPPP(
root_particle->getDaug( 1 )->getP4(), // K+
root_particle->getDaug( 2 )->getP4(), // K-
root_particle->getDaug( 3 )->getP4(), // pi+
root_particle->getDaug( 4 )->getP4(), // pi+
root_particle->getDaug( 5 )->getP4() // pi-
);
} else if ( out_code == 10 ) {
// 1=pi+ 2=pi+ 3=pi+ 4=pi+ 5=pi- 6=pi- 7=pi- with symmetrization of the identical particles
hardCur =
wcurr->WCurrent_7pi( root_particle->getDaug( 1 )->getP4(), // pi+
root_particle->getDaug( 2 )->getP4(), // pi+
root_particle->getDaug( 3 )->getP4(), // pi+
root_particle->getDaug( 4 )->getP4(), // pi+
root_particle->getDaug( 5 )->getP4(), // pi-
root_particle->getDaug( 6 )->getP4(), // pi-
root_particle->getDaug( 7 )->getP4() // pi-
);
} else if ( out_code == 11 ) {
// 1=K+ 2 = pi+ 3 = pi+ 4 = pi- 5 = pi- with symmetrizatiom
hardCur = wcurr->WCurrent_K4pi(
root_particle->getDaug( 1 )->getP4(), // K+
root_particle->getDaug( 2 )->getP4(), // pi+
root_particle->getDaug( 3 )->getP4(), // pi+
root_particle->getDaug( 4 )->getP4(), // pi-
root_particle->getDaug( 5 )->getP4() // pi-
);
} else {
EvtGenReport( EVTGEN_ERROR, "EvtBcHad" )
<< "hardCurr: Have not yet implemented this final state in BC_VHAD model"
<< std::endl;
// EvtGenReport(EVTGEN_ERROR, "EvtGen") << "Have not yet implemented this final state in BC_VHAD model" << std::endl;
// EvtGenReport(EVTGEN_ERROR, "EvtGen") << "Ndaug=" << getNDaug() << std::endl;
for ( int id = 0; id < ( getNDaug() - 1 ); id++ ) {
// EvtGenReport(EVTGEN_ERROR, "EvtGen") << "Daug " << id << " " << EvtPDL::name(getDaug(id)).c_str() << std::endl;
}
::abort();
}
return hardCur;
}
//======================================================
void EvtBcVHad::decay( EvtParticle* root_particle )
{
root_particle->initializePhaseSpace( getNDaug(), getDaugs() );
// Calculate hadronic current
const EvtVector4C hardCur = hardCurr( root_particle );
EvtParticle* Jpsi = root_particle->getDaug( 0 );
const EvtVector4R p4b( root_particle->mass(), 0., 0., 0. ), // Bc momentum
p4meson = Jpsi->getP4(), // J/psi momenta
Q = p4b - p4meson, p4Sum = p4meson + p4b;
const double Q2 = Q.mass2();
// Calculate Bc -> V W form-factors
double a1f( 0.0 ), a2f( 0.0 ), vf( 0.0 ), a0f( 0.0 );
const double m_meson = Jpsi->mass();
const double m_b = root_particle->mass();
const double mVar = m_b + m_meson;
ffmodel->getvectorff( root_particle->getId(), Jpsi->getId(), Q2, m_meson,
&a1f, &a2f, &vf, &a0f );
const double a3f = ( mVar / ( 2.0 * m_meson ) ) * a1f -
( ( m_b - m_meson ) / ( 2.0 * m_meson ) ) * a2f;
// Calculate Bc -> V W current
EvtTensor4C H = a1f * mVar * EvtTensor4C::g();
H.addDirProd( ( -a2f / mVar ) * p4b, p4Sum );
H += EvtComplex( 0.0, vf / mVar ) *
dual( EvtGenFunctions::directProd( p4Sum, Q ) );
H.addDirProd( ( a0f - a3f ) * 2.0 * ( m_meson / Q2 ) * p4b, Q );
const EvtVector4C Heps = H.cont2( hardCur );
for ( int i = 0; i < 4; i++ ) {
const EvtVector4C eps =
Jpsi->epsParent( i ).conj(); // psi-meson polarization vector
const EvtComplex amp = eps * Heps;
vertex( i, amp );
}
}
diff --git a/src/EvtGenModels/EvtBsquark.cpp b/src/EvtGenModels/EvtBsquark.cpp
index 65c61a9..7da21a8 100644
--- a/src/EvtGenModels/EvtBsquark.cpp
+++ b/src/EvtGenModels/EvtBsquark.cpp
@@ -1,204 +1,204 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenModels/EvtBsquark.hh"
#include "EvtGenBase/EvtDiracParticle.hh"
#include "EvtGenBase/EvtDiracSpinor.hh"
#include "EvtGenBase/EvtGammaMatrix.hh"
#include "EvtGenBase/EvtGenKine.hh"
#include "EvtGenBase/EvtIdSet.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtPatches.hh"
#include "EvtGenBase/EvtReport.hh"
#include <iostream>
#include <string>
std::string EvtBsquark::getName()
{
return "BSQUARK";
}
EvtDecayBase* EvtBsquark::clone()
{
return new EvtBsquark;
}
void EvtBsquark::init()
{
// check that there are 5 arguments
checkNArg( 5 );
}
void EvtBsquark::initProbMax()
{
setProbMax( 1e-6 );
}
void EvtBsquark::decay( EvtParticle* p )
{
static EvtId cquark = EvtPDL::getId( "c" );
static EvtId anticquark = EvtPDL::getId( "anti-c" );
- static EvtIdSet leptons( "e-", "mu-", "tau-" );
+ static EvtIdSet leptons{ "e-", "mu-", "tau-" };
p->initializePhaseSpace( getNDaug(), getDaugs() );
int charge = 1;
EvtParticle* lepton;
lepton = p->getDaug( 1 );
if ( leptons.contains( lepton->getId() ) ) {
charge = -1;
}
EvtDiracParticle charmquark;
//this is a very crude approximation...
if ( charge == -1 ) {
charmquark.init( cquark, p->getDaug( 0 )->getP4() );
} else {
charmquark.init( anticquark, p->getDaug( 0 )->getP4() );
}
EvtVector4R p4c = p->getDaug( 0 )->getP4();
EvtVector4R p4sn = p->getDaug( 2 )->getP4();
EvtVector4R p4b( p->mass(), 0.0, 0.0, 0.0 );
EvtComplex M[2][2];
int il, ic;
//project out the right handed current
EvtGammaMatrix PR = 0.5 * ( EvtGammaMatrix::id() + EvtGammaMatrix::g5() );
double tanbeta = getArg( 1 );
double cosbeta = cos( atan( tanbeta ) );
double sinbeta = sin( atan( tanbeta ) );
double mb = 4.9;
double mc = 1.3;
double mw = 80.4;
double Mass = getArg( 2 );
double mu = getArg( 3 );
double mchargino = getArg( 4 );
double tan2phim = 2 * sqrt( 2.0 ) * mw * ( mu * cosbeta + Mass * sinbeta ) /
( Mass * Mass - mu * mu +
2 * mw * mw * cos( 2 * atan( tanbeta ) ) );
double phim = 0.5 * atan( tan2phim );
EvtComplex U11 = cos( phim );
EvtComplex U12 = sin( phim );
EvtComplex U21 = -sin( phim );
EvtComplex U22 = cos( phim );
double tan2phip = 2 * sqrt( 2.0 ) * mw * ( mu * cosbeta + Mass * sinbeta ) /
( Mass * Mass - mu * mu -
2 * mw * mw * cos( 2 * atan( tanbeta ) ) );
double phip = 0.5 * atan( tan2phip );
EvtComplex V11 = cos( phip );
EvtComplex V12 = sin( phip );
EvtComplex V21 = -sin( phip );
EvtComplex V22 = cos( phip );
double theta = getArg( 0 );
double ctheta = cos( theta );
double stheta = sin( theta );
double vcsb = 0.08;
double mchi1 = mchargino;
double mchi2 = mchargino;
//overall scale factor
double g = 1.0;
EvtComplex a1 = mchi1 * ( U11 * ctheta - mb * U12 * stheta /
( sqrt( 2.0 ) * mw * cosbeta ) );
EvtComplex a2 = mchi2 * ( U21 * ctheta - mb * U22 * stheta /
( sqrt( 2.0 ) * mw * cosbeta ) );
EvtComplex b1 = mc * conj( V12 ) * ctheta / ( sqrt( 2.0 ) * mw * sinbeta );
EvtComplex b2 = mc * conj( V22 ) * ctheta / ( sqrt( 2.0 ) * mw * sinbeta );
EvtComplex f1 = -( g * g * V11 * vcsb ) /
( ( p4b - p4c ).mass2() - mchi1 * mchi1 );
EvtComplex f2 = -( g * g * V21 * vcsb ) /
( ( p4b - p4c ).mass2() - mchi1 * mchi2 );
//EvtGenReport(EVTGEN_INFO,"EvtGen") <<g<<" "<<V11<<" "<<FL<<" "<<vcsb<<" "<<mchi1<<endl;
//EvtGenReport(EVTGEN_INFO,"EvtGen") << "f1:"<<f1<<" "<<(p4b-p4c).mass2()<<endl;
//EvtGenReport(EVTGEN_INFO,"EvtGen") << "f2:"<<f2<<" "<<(p4b-p4c).mass2()<<endl;
//EvtGenReport(EVTGEN_INFO,"EvtGen") << "p4sn:"<<p4sn<<endl;
EvtGammaMatrix pslash = p4sn.get( 0 ) * EvtGammaMatrix::g0() -
p4sn.get( 1 ) * EvtGammaMatrix::g1() -
p4sn.get( 2 ) * EvtGammaMatrix::g2() -
p4sn.get( 3 ) * EvtGammaMatrix::g3();
//EvtGenReport(EVTGEN_INFO,"EvtGen") << "pslash:"<<pslash<<endl;
for ( il = 0; il < 2; il++ ) {
for ( ic = 0; ic < 2; ic++ ) {
EvtComplex a = 0.0;
EvtComplex b = 0.0;
if ( charge == -1 ) {
a = charmquark.spParent( ic ) * ( PR * lepton->spParent( il ) );
b = charmquark.spParent( ic ) *
( ( pslash * PR ) * lepton->spParent( il ) );
} else {
a = lepton->spParent( il ) * ( PR * charmquark.spParent( ic ) );
b = lepton->spParent( il ) *
( ( pslash * PR ) * charmquark.spParent( ic ) );
}
//EvtGenReport(EVTGEN_INFO,"EvtGen") <<"pslash*PR:"<<pslash*PR<<endl;
//EvtGenReport(EVTGEN_INFO,"EvtGen") <<"sp charm:"<<charmquark.spParent(ic)<<endl;
//EvtGenReport(EVTGEN_INFO,"EvtGen") <<"sp lepton:"<<lepton->spParent(il)<<endl;
M[ic][il] = f1 * ( a1 * a + b1 * b ) + f2 * ( a2 * a + b2 * b );
//EvtGenReport(EVTGEN_INFO,"EvtGen") << "Contr1:"<<a1<<" "<<a<<" "<<b1<<" "<<b<<endl;
//EvtGenReport(EVTGEN_INFO,"EvtGen") << "Contr2:"<<a2<<" "<<a<<" "<<b2<<" "<<b<<endl;
//EvtGenReport(EVTGEN_INFO,"EvtGen") <<"case1:"<<f1<<" "<<a1<<" "<<b1<<" "<<a<<" "<<b<<endl;
//EvtGenReport(EVTGEN_INFO,"EvtGen") <<"case2:"<<f2<<" "<<a2<<" "<<b2<<" "<<a<<" "<<b<<endl;
}
}
double prob = real( M[0][0] * conj( M[0][0] ) + M[1][0] * conj( M[1][0] ) +
M[0][1] * conj( M[0][1] ) + M[1][1] * conj( M[1][1] ) );
//EvtGenReport(EVTGEN_INFO,"EvtGen") <<"prob:"<<prob<<endl;
setProb( prob );
return;
}
diff --git a/src/EvtGenModels/EvtISGW2FF.cpp b/src/EvtGenModels/EvtISGW2FF.cpp
index 15cfa77..bb5ba3a 100644
--- a/src/EvtGenModels/EvtISGW2FF.cpp
+++ b/src/EvtGenModels/EvtISGW2FF.cpp
@@ -1,1796 +1,1796 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenModels/EvtISGW2FF.hh"
#include "EvtGenBase/EvtConst.hh"
#include "EvtGenBase/EvtId.hh"
#include "EvtGenBase/EvtIdSet.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtPatches.hh"
#include "EvtGenBase/EvtReport.hh"
#include <math.h>
#include <stdlib.h>
#include <string>
using std::endl;
void EvtISGW2FF::getscalarff( EvtId parent, EvtId daught, double t, double mass,
double* fpf, double* f0f )
{
//added by Lange Jan4,2000
static EvtId D0 = EvtPDL::getId( "D0" );
static EvtId D0B = EvtPDL::getId( "anti-D0" );
static EvtId DP = EvtPDL::getId( "D+" );
static EvtId DM = EvtPDL::getId( "D-" );
static EvtId D3P0P = EvtPDL::getId( "D_0*+" );
static EvtId D3P0N = EvtPDL::getId( "D_0*-" );
static EvtId D3P00 = EvtPDL::getId( "D_0*0" );
static EvtId D3P0B = EvtPDL::getId( "anti-D_0*0" );
static EvtId D21S0P = EvtPDL::getId( "D(2S)+" );
static EvtId D21S0N = EvtPDL::getId( "D(2S)-" );
static EvtId D21S00 = EvtPDL::getId( "D(2S)0" );
static EvtId D21S0B = EvtPDL::getId( "anti-D(2S)0" );
static EvtId ETA2S = EvtPDL::getId( "eta(2S)" );
static EvtId PI2S0 = EvtPDL::getId( "pi(2S)0" );
static EvtId PI2SP = EvtPDL::getId( "pi(2S)+" );
static EvtId PI2SM = EvtPDL::getId( "pi(2S)-" );
static EvtId PIP = EvtPDL::getId( "pi+" );
static EvtId PIM = EvtPDL::getId( "pi-" );
static EvtId PI0 = EvtPDL::getId( "pi0" );
static EvtId A0P = EvtPDL::getId( "a_0+" );
static EvtId A0M = EvtPDL::getId( "a_0-" );
static EvtId A00 = EvtPDL::getId( "a_00" );
static EvtId F0 = EvtPDL::getId( "f_0" );
static EvtId F0PR = EvtPDL::getId( "f'_0" );
static EvtId ETA = EvtPDL::getId( "eta" );
static EvtId ETAPR = EvtPDL::getId( "eta'" );
static EvtId KP = EvtPDL::getId( "K+" );
static EvtId KM = EvtPDL::getId( "K-" );
static EvtId K0 = EvtPDL::getId( "K0" );
static EvtId KB = EvtPDL::getId( "anti-K0" );
static EvtId K0S = EvtPDL::getId( "K_S0" );
static EvtId K0L = EvtPDL::getId( "K_L0" );
static EvtId K0STP = EvtPDL::getId( "K_0*+" );
static EvtId K0STM = EvtPDL::getId( "K_0*-" );
static EvtId K0ST0 = EvtPDL::getId( "K_0*0" );
static EvtId K0STB = EvtPDL::getId( "anti-K_0*0" );
static EvtId DSP = EvtPDL::getId( "D_s+" );
static EvtId DSM = EvtPDL::getId( "D_s-" );
static EvtId D3P0SP = EvtPDL::getId( "D_s0*+" );
static EvtId D3P0SN = EvtPDL::getId( "D_s0*-" );
double fmf;
double mb = EvtPDL::getMeanMass( parent );
if ( daught == PI0 || daught == PIP || daught == PIM || daught == ETA ||
daught == ETAPR || daught == D0 || daught == D0B || daught == DP ||
daught == DM || daught == KP || daught == KM || daught == K0 ||
daught == K0S || daught == K0L || daught == KB || daught == DSP ||
daught == DSM ) {
EvtISGW2FF1S0( parent, daught, t, mass, fpf, &fmf );
}
if ( daught == PI2S0 || daught == PI2SP || daught == PI2SM ||
daught == ETA2S || daught == D21S0P || daught == D21S0B ||
daught == D21S0N || daught == D21S00 ) {
EvtISGW2FF21S0( parent, daught, t, mass, fpf, &fmf );
}
if ( daught == A00 || daught == A0P || daught == A0M || daught == F0 ||
daught == F0PR || daught == D3P0P || daught == D3P00 ||
daught == D3P0B || daught == D3P0N || daught == K0STM ||
daught == K0STB || daught == K0STP || daught == D3P0SP ||
daught == D3P0SN || daught == K0ST0 ) {
EvtISGW2FF3P0( parent, daught, t, mass, fpf, &fmf );
}
*f0f = ( fmf / ( ( mb * mb - mass * mass ) / t ) ) + ( *fpf );
return;
}
void EvtISGW2FF::gettensorff( EvtId parent, EvtId daught, double t, double mass,
double* hf, double* kf, double* bpf, double* bmf )
{
//added by Lange Jan4,2000
EvtISGW2FF3P2( parent, daught, t, mass, hf, kf, bpf, bmf );
return;
}
void EvtISGW2FF::getvectorff( EvtId parent, EvtId daught, double t, double mass,
double* a1f, double* a2f, double* vf, double* a0f )
{
double ff, gf, apf, amf;
//added by Lange Jan4,2000
static EvtId DST0 = EvtPDL::getId( "D*0" );
static EvtId DSTB = EvtPDL::getId( "anti-D*0" );
static EvtId DSTP = EvtPDL::getId( "D*+" );
static EvtId DSTM = EvtPDL::getId( "D*-" );
static EvtId D1P1P = EvtPDL::getId( "D_1+" );
static EvtId D1P1N = EvtPDL::getId( "D_1-" );
static EvtId D1P10 = EvtPDL::getId( "D_10" );
static EvtId D1P1B = EvtPDL::getId( "anti-D_10" );
static EvtId D3P1P = EvtPDL::getId( "D'_1+" );
static EvtId D3P1N = EvtPDL::getId( "D'_1-" );
static EvtId D3P10 = EvtPDL::getId( "D'_10" );
static EvtId D3P1B = EvtPDL::getId( "anti-D'_10" );
static EvtId D23S1P = EvtPDL::getId( "D*(2S)+" );
static EvtId D23S1N = EvtPDL::getId( "D*(2S)-" );
static EvtId D23S10 = EvtPDL::getId( "D*(2S)0" );
static EvtId D23S1B = EvtPDL::getId( "anti-D*(2S)0" );
static EvtId RHO2S0 = EvtPDL::getId( "rho(2S)0" );
static EvtId RHO2SP = EvtPDL::getId( "rho(2S)+" );
static EvtId RHO2SM = EvtPDL::getId( "rho(2S)-" );
static EvtId OMEG2S = EvtPDL::getId( "omega(2S)" );
static EvtId RHOP = EvtPDL::getId( "rho+" );
static EvtId RHOM = EvtPDL::getId( "rho-" );
static EvtId RHO0 = EvtPDL::getId( "rho0" );
static EvtId A1P = EvtPDL::getId( "a_1+" );
static EvtId A1M = EvtPDL::getId( "a_1-" );
static EvtId A10 = EvtPDL::getId( "a_10" );
static EvtId B1P = EvtPDL::getId( "b_1+" );
static EvtId B1M = EvtPDL::getId( "b_1-" );
static EvtId B10 = EvtPDL::getId( "b_10" );
static EvtId H1 = EvtPDL::getId( "h_1" );
static EvtId H1PR = EvtPDL::getId( "h'_1" );
static EvtId F1 = EvtPDL::getId( "f_1" );
static EvtId F1PR = EvtPDL::getId( "f'_1" );
static EvtId OMEG = EvtPDL::getId( "omega" );
static EvtId KSTP = EvtPDL::getId( "K*+" );
static EvtId KSTM = EvtPDL::getId( "K*-" );
static EvtId KST0 = EvtPDL::getId( "K*0" );
static EvtId KSTB = EvtPDL::getId( "anti-K*0" );
static EvtId K1P = EvtPDL::getId( "K_1+" );
static EvtId K1M = EvtPDL::getId( "K_1-" );
static EvtId K10 = EvtPDL::getId( "K_10" );
static EvtId K1B = EvtPDL::getId( "anti-K_10" );
static EvtId K1STP = EvtPDL::getId( "K'_1+" );
static EvtId K1STM = EvtPDL::getId( "K'_1-" );
static EvtId K1ST0 = EvtPDL::getId( "K'_10" );
static EvtId K1STB = EvtPDL::getId( "anti-K'_10" );
static EvtId PHI = EvtPDL::getId( "phi" );
static EvtId D1P1SP = EvtPDL::getId( "D_s1+" );
static EvtId D1P1SN = EvtPDL::getId( "D_s1-" );
static EvtId D3P1SP = EvtPDL::getId( "D'_s1+" );
static EvtId D3P1SN = EvtPDL::getId( "D'_s1-" );
static EvtId DSSTP = EvtPDL::getId( "D_s*+" );
static EvtId DSSTM = EvtPDL::getId( "D_s*-" );
if ( daught == DST0 || daught == DSTP || daught == DSTM || daught == DSTB ||
daught == OMEG || daught == RHO0 || daught == RHOM || daught == RHOP ||
daught == KSTP || daught == KSTM || daught == KST0 || daught == KSTB ||
daught == PHI || daught == DSSTP || daught == DSSTM ) {
EvtISGW2FF3S1( parent, daught, t, mass, &ff, &gf, &apf, &amf );
}
if ( daught == B10 || daught == B1P || daught == B1M || daught == H1 ||
daught == H1PR || daught == D1P1P || daught == D1P10 || daught == D1P1B ||
daught == D1P1SP || daught == D1P1SN || daught == D1P1N ||
daught == K10 || daught == K1B || daught == K1P || daught == K1M ) {
EvtISGW2FF1P1( parent, daught, t, mass, &ff, &gf, &apf, &amf );
}
if ( daught == RHO2S0 || daught == RHO2SP || daught == RHO2SM ||
daught == OMEG2S || daught == D23S1P || daught == D23S1B ||
daught == D23S1N || daught == D23S10 ) {
EvtISGW2FF23S1( parent, daught, t, mass, &ff, &gf, &apf, &amf );
}
if ( daught == A10 || daught == A1P || daught == A1M || daught == F1 ||
daught == F1PR || daught == D3P1P || daught == D3P10 ||
daught == D3P1B || daught == D3P1N || daught == K1STM ||
daught == K1STB || daught == K1STP || daught == D3P1SP ||
daught == D3P1SN || daught == K1ST0 ) {
EvtISGW2FF3P1( parent, daught, t, mass, &ff, &gf, &apf, &amf );
}
// Need to stuff in some factors to make these the ffs that
// is used elsewhere...
double mb = EvtPDL::getMeanMass( parent );
*vf = ( gf ) * ( mb + mass );
*a1f = ( ff ) / ( mb + mass );
*a2f = -1.0 * ( apf ) * ( mb + mass );
double a3f = ( ( mb + mass ) / ( 2.0 * mass ) ) * ( *a1f ) -
( ( mb - mass ) / ( 2.0 * mass ) ) * ( *a2f );
*a0f = a3f + ( ( t * amf ) / ( 2.0 * mass ) );
return;
}
void EvtISGW2FF::EvtISGW2FF1S0( EvtId parent, EvtId daugt, double t,
double mass, double* fpf, double* fmf )
{
double mtb, mbb( 0.0 );
double msd( 0.0 ), mx, mb, nf( 0.0 ), nfp( 0.0 );
double msq( 0.0 ), bx2( 0.0 ), mbx( 0.0 ), mtx;
double zji, cji, gammaji, chiji, betaji_fppfm;
double rfppfm, rfpmfm, f3fppfm, f3fpmfm, fppfm, fpmfm, ai, f3;
double mqm, msb( 0.0 ), bb2( 0.0 ), mup, bbx2, tm, r2, betaji_fpmfm;
EvtId prnt = parent;
EvtId dgt = daugt;
//added by Lange Jan4,2000
- static EvtIdSet theB( "B+", "B-", "B0", "anti-B0" );
+ static EvtIdSet theB{ "B+", "B-", "B0", "anti-B0" };
static EvtId D0 = EvtPDL::getId( "D0" );
static EvtId D0B = EvtPDL::getId( "anti-D0" );
static EvtId DP = EvtPDL::getId( "D+" );
static EvtId DM = EvtPDL::getId( "D-" );
static EvtId PIP = EvtPDL::getId( "pi+" );
static EvtId PIM = EvtPDL::getId( "pi-" );
static EvtId PI0 = EvtPDL::getId( "pi0" );
static EvtId ETA = EvtPDL::getId( "eta" );
static EvtId ETAPR = EvtPDL::getId( "eta'" );
static EvtId KP = EvtPDL::getId( "K+" );
static EvtId KM = EvtPDL::getId( "K-" );
static EvtId K0 = EvtPDL::getId( "K0" );
static EvtId KB = EvtPDL::getId( "anti-K0" );
static EvtId K0S = EvtPDL::getId( "K_S0" );
static EvtId K0L = EvtPDL::getId( "K_L0" );
static EvtId DSP = EvtPDL::getId( "D_s+" );
static EvtId DSM = EvtPDL::getId( "D_s-" );
static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
static EvtId BS0 = EvtPDL::getId( "B_s0" );
if ( theB.contains( prnt ) ) {
msb = 5.2;
msd = 0.33;
bb2 = 0.431 * 0.431;
mbb = 5.31;
nf = 4.0;
if ( dgt == PI0 || dgt == PIP || dgt == PIM || dgt == ETA ||
dgt == ETAPR ) {
msq = 0.33;
bx2 = 0.406 * 0.406;
mbx = 0.75 * 0.770 + 0.25 * 0.14;
nfp = 0.0;
} else {
if ( dgt == D0 || dgt == D0B || dgt == DP || dgt == DM ) {
msq = 1.82;
bx2 = 0.45 * 0.45;
mbx = 0.75 * 2.01 + 0.25 * 1.87;
nfp = 3.0;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented daugt:" << daugt.getId()
<< " in get_isgw_ff_1S0.\n";
}
}
} else {
if ( prnt == D0 || prnt == D0B || prnt == DP || prnt == DM ) {
msb = 1.82;
msd = 0.33;
bb2 = 0.45 * 0.45;
mbb = 1.963;
nf = 3.0;
if ( dgt == PIP || dgt == PIM || dgt == PI0 || dgt == ETA ||
dgt == ETAPR ) {
msq = 0.33;
bx2 = 0.406 * 0.406;
mbx = 0.75 * 0.770 + 0.25 * 0.14;
nfp = 0.0;
} else {
if ( dgt == K0 || dgt == K0S || dgt == K0L || dgt == KB ||
dgt == KP || dgt == KM ) {
msq = 0.55;
bx2 = 0.44 * 0.44;
mbx = 0.75 * 0.892 + 0.25 * 0.49767;
nfp = 2.0;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented daugt:" << daugt.getId()
<< " in get_isgw_ff_1S0.\n";
}
}
} else {
if ( prnt == DSP || prnt == DSM ) {
msb = 1.82;
msd = 0.55;
bb2 = 0.56 * 0.56;
mbb = 1.968;
nf = 3.0;
if ( dgt == K0 || dgt == K0S || dgt == K0L || dgt == KB ) {
msq = 0.33;
bx2 = 0.44 * 0.44;
mbx = 0.75 * 0.770 + 0.25 * 0.14;
nfp = 0.0;
} else {
if ( dgt == PI0 || dgt == ETA || dgt == ETAPR ) {
msq = 0.33;
bx2 = 0.53 * 0.53;
mbx = 0.75 * 0.892 + 0.25 * 0.49767;
nfp = 0.0;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented daugt:" << daugt.getId()
<< " in get_isgw_ff_1S0.\n";
}
}
} else {
//BS -> cs constants added by djl on Jan. 21,1998
if ( prnt == BS0 || prnt == BSB ) {
msb = 5.2;
msd = 0.55;
bb2 = 0.54 * 0.54;
mbb = 5.38;
nf = 4.0;
if ( dgt == DSP || dgt == DSM ) {
msq = 1.82;
bx2 = 0.56 * 0.56;
mbx = 0.75 * 2.11 + 0.25 * 1.97;
nfp = 3.0;
} else if ( dgt == KP || dgt == KM ) {
msq = 0.55;
bx2 = 0.44 * 0.44;
mbx = 0.75 * 0.892 + 0.25 * 0.49767;
nfp = 2.0;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented daugt:" << daugt.getId()
<< " in get_isgw_ff_1S0.\n";
}
}
else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented parent in get_isgw_ff_1S0.\n";
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Parent:" << parent.getId() << endl;
}
}
}
}
mtb = msb + msd;
mtx = msq + msd;
mb = EvtPDL::getMeanMass( parent );
mx = mass;
mup = 1.0 / ( 1.0 / msq + 1.0 / msb );
bbx2 = 0.5 * ( bb2 + bx2 );
tm = ( mb - mx ) * ( mb - mx );
if ( t > tm )
t = 0.99 * tm;
mqm = 0.1;
r2 = 3.0 / ( 4.0 * msb * msq ) + 3 * msd * msd / ( 2 * mbb * mbx * bbx2 ) +
( 16.0 / ( mbb * mbx * ( 33.0 - 2.0 * nfp ) ) ) *
log( EvtGetas( mqm, mqm ) / EvtGetas( msq, msq ) );
f3 = sqrt( mtx / mtb ) * pow( sqrt( bx2 * bb2 ) / bbx2, 1.5 ) /
( ( 1.0 + r2 * ( tm - t ) / 12.0 ) * ( 1.0 + r2 * ( tm - t ) / 12.0 ) );
// for w use wt def with physical masses.
// EvtGenReport(EVTGEN_ERROR,"EvtGen") << "before w\n";
ai = -1.0 * ( 6.0 / ( 33.0 - 2.0 * nf ) );
cji = pow( ( EvtGetas( msb, msb ) / EvtGetas( msq, msq ) ), ai );
zji = msq / msb;
gammaji = EvtGetGammaji( zji );
chiji = -1.0 - ( gammaji / ( 1 - zji ) );
betaji_fppfm = gammaji - ( 2.0 / 3.0 ) * chiji;
betaji_fpmfm = gammaji + ( 2.0 / 3.0 ) * chiji;
rfppfm = cji * ( 1.0 + betaji_fppfm * EvtGetas( msq, sqrt( msb * msq ) ) /
EvtConst::pi );
rfpmfm = cji * ( 1.0 + betaji_fpmfm * EvtGetas( msq, sqrt( msb * msq ) ) /
EvtConst::pi );
f3fppfm = f3 * pow( ( mbb / mtb ), -0.5 ) * pow( ( mbx / mtx ), 0.5 );
f3fpmfm = f3 * pow( ( mbb / mtb ), 0.5 ) * pow( ( mbx / mtx ), -0.5 );
fppfm = f3fppfm * rfppfm *
( 2.0 - ( ( mtx / msq ) * ( 1 - ( ( msd * msq * bb2 ) /
( 2.0 * mup * mtx * bbx2 ) ) ) ) );
fpmfm = f3fpmfm * rfpmfm * ( mtb / msq ) *
( 1 - ( ( msd * msq * bb2 ) / ( 2.0 * mup * mtx * bbx2 ) ) );
*fpf = ( fppfm + fpmfm ) / 2.0;
*fmf = ( fppfm - fpmfm ) / 2.0;
return;
} //get_ff_isgw_1s0
void EvtISGW2FF::EvtISGW2FF3S1( EvtId parent, EvtId daugt, double t, double mass,
double* f, double* g, double* ap, double* am )
{
//added by Lange Jan4,2000
static EvtId BP = EvtPDL::getId( "B+" );
static EvtId BM = EvtPDL::getId( "B-" );
static EvtId B0 = EvtPDL::getId( "B0" );
static EvtId B0B = EvtPDL::getId( "anti-B0" );
static EvtId DST0 = EvtPDL::getId( "D*0" );
static EvtId DSTB = EvtPDL::getId( "anti-D*0" );
static EvtId DSTP = EvtPDL::getId( "D*+" );
static EvtId DSTM = EvtPDL::getId( "D*-" );
static EvtId D0 = EvtPDL::getId( "D0" );
static EvtId D0B = EvtPDL::getId( "anti-D0" );
static EvtId DP = EvtPDL::getId( "D+" );
static EvtId DM = EvtPDL::getId( "D-" );
static EvtId RHOP = EvtPDL::getId( "rho+" );
static EvtId RHOM = EvtPDL::getId( "rho-" );
static EvtId RHO0 = EvtPDL::getId( "rho0" );
static EvtId OMEG = EvtPDL::getId( "omega" );
static EvtId KSTP = EvtPDL::getId( "K*+" );
static EvtId KSTM = EvtPDL::getId( "K*-" );
static EvtId KST0 = EvtPDL::getId( "K*0" );
static EvtId KSTB = EvtPDL::getId( "anti-K*0" );
static EvtId PHI = EvtPDL::getId( "phi" );
static EvtId DSP = EvtPDL::getId( "D_s+" );
static EvtId DSM = EvtPDL::getId( "D_s-" );
static EvtId DSSTP = EvtPDL::getId( "D_s*+" );
static EvtId DSSTM = EvtPDL::getId( "D_s*-" );
static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
static EvtId BS0 = EvtPDL::getId( "B_s0" );
double cf( 0.0 ), mtb, wt, msd( 0.0 ), mup, f3f, msq( 0.0 ), bb2( 0.0 ),
mum, mtx, bbx2, f3g;
double cji, bx2( 0.0 ), f3appam, msb( 0.0 ), tm, mbb( 0.0 ), mbx( 0.0 );
double f3apmam, appam, apmam, mb, mx, f3;
double r_f, r_g, r_apmam, betaji_f, betaji_g;
double betaji_appam, betaji_apmam;
double mqm, r2, chiji, zji, ai, nf( 0.0 ), nfp( 0.0 ), gammaji;
EvtId prnt = parent;
EvtId dgt = daugt;
if ( parent == B0 || parent == B0B || parent == BP || parent == BM ) {
msb = 5.2;
msd = 0.33;
bb2 = 0.431 * 0.431;
mbb = 5.31;
nf = 4.0;
if ( dgt == DST0 || dgt == DSTP || dgt == DSTM || dgt == DSTB ) {
cf = 0.989;
msq = 1.82;
bx2 = 0.38 * 0.38;
mbx = 0.75 * 2.01 + 0.25 * 1.87;
nfp = 3.0;
} else {
if ( dgt == OMEG || dgt == RHO0 || dgt == RHOM || dgt == RHOP ) {
cf = 0.905;
msq = 0.33;
bx2 = 0.299 * 0.299;
mbx = 0.75 * 0.770 + 0.25 * 0.14;
nfp = 0.0;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented daugt:" << daugt.getId()
<< " in get_isgw_ff_3S1.\n";
}
}
} else {
if ( prnt == D0 || prnt == D0B || prnt == DP || prnt == DM ) {
msb = 1.82;
msd = 0.33;
bb2 = 0.45 * 0.45;
mbb = 1.963;
nf = 3.0;
if ( dgt == KSTP || dgt == KSTM || dgt == KST0 || dgt == KSTB ) {
cf = 0.928;
msq = 0.55;
bx2 = 0.33 * 0.33;
mbx = 0.75 * 0.892 + 0.25 * 0.494;
nfp = 2.0;
} else {
if ( dgt == RHO0 || dgt == OMEG || dgt == RHOM || dgt == RHOP ) {
cf = 0.889;
msq = 0.33;
bx2 = 0.299 * 0.299;
mbx = 0.75 * 0.770 + 0.25 * 0.14;
nfp = 0.0;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented daugt:" << daugt.getId()
<< " in get_isgw_ff_3S1.\n";
}
}
} else {
if ( prnt == DSP || prnt == DSM ) {
msb = 1.82;
msd = 0.55;
bb2 = 0.56 * 0.56;
mbb = 1.968;
nf = 3.0;
if ( dgt == KSTB || dgt == KST0 ) {
cf = 0.8731;
msq = 0.55;
bx2 = 0.33 * 0.33;
mbx = 0.87;
nfp = 2.0;
} else {
if ( dgt == PHI ) {
cf = 0.911;
msq = 0.55;
bx2 = 0.37 * 0.37;
mbx = 0.97;
nfp = 2.0;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented daugt:" << daugt.getId()
<< " in get_isgw_ff_3S1.\n";
}
}
} else {
//BS -> cs constants added by djl on Jan. 21,1998
if ( prnt == BS0 || prnt == BSB ) {
msb = 5.2;
msd = 0.55;
bb2 = 0.54 * 0.54;
mbb = 5.38;
nf = 4.0;
if ( dgt == DSSTP || dgt == DSSTM ) {
cf = 0.984;
msq = 1.82;
bx2 = 0.49 * 0.49;
mbx = 0.75 * 2.11 + 0.25 * 1.97;
nfp = 3.0;
} else if ( dgt == KSTP || dgt == KSTM || dgt == KST0 ||
dgt == KSTB ) {
cf = 0.928;
msq = 0.55;
bx2 = 0.33 * 0.33;
mbx = 0.75 * 0.892 + 0.25 * 0.494;
nfp = 2.0;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented daugt:" << daugt.getId()
<< " in get_isgw_ff_1S0.\n";
}
}
else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented parent in get_isgw2_ff_3S1.\n";
}
}
}
}
mtb = msb + msd;
mtx = msq + msd;
mup = 1.0 / ( 1.0 / msq + 1.0 / msb );
mum = 1.0 / ( 1.0 / msq - 1.0 / msb );
bbx2 = 0.5 * ( bb2 + bx2 );
mb = EvtPDL::getMeanMass( parent );
mx = mass;
tm = ( mb - mx ) * ( mb - mx );
if ( t > tm )
t = 0.99 * tm;
wt = 1.0 + ( tm - t ) / ( 2.0 * mbb * mbx );
mqm = 0.1;
r2 = 3.0 / ( 4.0 * msb * msq ) + 3 * msd * msd / ( 2 * mbb * mbx * bbx2 ) +
( 16.0 / ( mbb * mbx * ( 33.0 - 2.0 * nfp ) ) ) *
log( EvtGetas( mqm, mqm ) / EvtGetas( msq, msq ) );
ai = -1.0 * ( 6.0 / ( 33.0 - 2.0 * nf ) );
cji = pow( ( EvtGetas( msb, msb ) / EvtGetas( msq, msq ) ), ai );
zji = msq / msb;
gammaji = EvtGetGammaji( zji );
chiji = -1.0 - ( gammaji / ( 1 - zji ) );
betaji_g = ( 2.0 / 3.0 ) + gammaji;
betaji_f = ( -2.0 / 3.0 ) + gammaji;
betaji_appam = -1.0 - chiji + ( 4.0 / ( 3.0 * ( 1.0 - zji ) ) ) +
( 2.0 * ( 1 + zji ) * gammaji /
( 3.0 * ( 1.0 - zji ) * ( 1.0 - zji ) ) );
betaji_apmam = ( 1.0 / 3.0 ) - chiji - ( 4.0 / ( 3.0 * ( 1.0 - zji ) ) ) -
( 2.0 * ( 1 + zji ) * gammaji /
( 3.0 * ( 1.0 - zji ) * ( 1.0 - zji ) ) ) +
gammaji;
r_g = cji * ( 1 + ( betaji_g * EvtGetas( msq, sqrt( mb * msq ) ) /
( EvtConst::pi ) ) );
r_f = cji * ( 1 + ( betaji_f * EvtGetas( msq, sqrt( mb * msq ) ) /
( EvtConst::pi ) ) );
r_apmam = cji * ( 1 + ( betaji_apmam * EvtGetas( msq, sqrt( mb * msq ) ) /
( EvtConst::pi ) ) );
f3 = sqrt( mtx / mtb ) * pow( sqrt( bx2 * bb2 ) / bbx2, 1.5 ) /
( ( 1.0 + r2 * ( tm - t ) / 12.0 ) * ( 1.0 + r2 * ( tm - t ) / 12.0 ) );
f3f = sqrt( mbx * mbb / ( mtx * mtb ) ) * f3;
f3g = sqrt( mtx * mtb / ( mbx * mbb ) ) * f3;
f3appam = sqrt( mtb * mtb * mtb * mbx / ( mbb * mbb * mbb * mtx ) ) * f3;
f3apmam = sqrt( mtx * mtb / ( mbx * mbb ) ) * f3;
*f = cf * mtb * ( 1 + wt + msd * ( wt - 1 ) / ( 2 * mup ) ) * f3f * r_f;
*g = 0.5 * ( 1 / msq - msd * bb2 / ( 2 * mum * mtx * bbx2 ) ) * f3g * r_g;
appam = cji *
( msd * bx2 * ( 1 - msd * bx2 / ( 2 * mtb * bbx2 ) ) /
( ( 1 + wt ) * msq * msb * bbx2 ) -
betaji_appam * EvtGetas( msq, sqrt( msq * mb ) ) /
( mtb * EvtConst::pi ) ) *
f3appam;
apmam = -1.0 *
( mtb / msb - msd * bx2 / ( 2 * mup * bbx2 ) +
wt * msd * mtb * bx2 * ( 1 - msd * bx2 / ( 2 * mtb * bbx2 ) ) /
( ( wt + 1 ) * msq * msb * bbx2 ) ) *
f3apmam * r_apmam / mtx;
*ap = 0.5 * ( appam + apmam );
*am = 0.5 * ( appam - apmam );
return;
}
void EvtISGW2FF::EvtISGW2FF21S0( EvtId parent, EvtId daugt, double t,
double mass, double* fppf, double* fpmf )
{
//added by Lange Jan4,2000
static EvtId BP = EvtPDL::getId( "B+" );
static EvtId BM = EvtPDL::getId( "B-" );
static EvtId B0 = EvtPDL::getId( "B0" );
static EvtId B0B = EvtPDL::getId( "anti-B0" );
static EvtId D0 = EvtPDL::getId( "D0" );
static EvtId D0B = EvtPDL::getId( "anti-D0" );
static EvtId DP = EvtPDL::getId( "D+" );
static EvtId DM = EvtPDL::getId( "D-" );
static EvtId D21S0P = EvtPDL::getId( "D(2S)+" );
static EvtId D21S0N = EvtPDL::getId( "D(2S)-" );
static EvtId D21S00 = EvtPDL::getId( "D(2S)0" );
static EvtId D21S0B = EvtPDL::getId( "anti-D(2S)0" );
static EvtId ETA2S = EvtPDL::getId( "eta(2S)" );
static EvtId PI2S0 = EvtPDL::getId( "pi(2S)0" );
static EvtId PI2SP = EvtPDL::getId( "pi(2S)+" );
static EvtId PI2SM = EvtPDL::getId( "pi(2S)-" );
double mtb, mbb( 0.0 );
double msd( 0.0 ), mx, mb, nfp( 0.0 );
double msq( 0.0 ), bx2( 0.0 ), mbx( 0.0 ), mtx;
double f3fppfm, f3fpmfm, fppfm, fpmfm, f3;
double mqm, msb( 0.0 );
double r2, wt, tm, bb2( 0.0 ), bbx2;
double tau, udef, vdef;
EvtId prnt = parent;
EvtId dgt = daugt;
if ( prnt == B0 || prnt == B0B || prnt == BP || prnt == BM ) {
msb = 5.2;
msd = 0.33;
bb2 = 0.431 * 0.431;
mbb = 0.75 * 5.325 + 0.25 * 5.279;
if ( dgt == PI2S0 || dgt == PI2SP || dgt == PI2SM || dgt == ETA2S ) {
msq = 0.33;
bx2 = 0.406 * 0.406;
mbx = 0.75 * 1.45 + 0.25 * 1.300;
nfp = 0.0;
} else {
if ( dgt == D21S0P || dgt == D21S0B || dgt == D21S0N ||
dgt == D21S00 ) {
msq = 1.82;
bx2 = 0.45 * 0.45;
mbx = 0.75 * 2.64 + 0.25 * 2.58;
nfp = 3.0;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented daugt in get_EvtISGW2_ff_21S0.\n";
}
}
} else {
if ( prnt == D0 || prnt == D0B || prnt == DP || prnt == DM ) {
msb = 1.82;
msd = 0.33;
bb2 = 0.45 * 0.45;
mbb = 1.963;
if ( dgt == PI2SP || dgt == PI2SM || dgt == PI2S0 || dgt == ETA2S ) {
msq = 0.33;
bx2 = 0.406 * 0.406;
mbx = 0.75 * 1.45 + 0.25 * 1.300;
nfp = 0.0;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented daugt in get_EvtISGW2_ff_21S0.\n";
}
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented parent in get_EvtISGW2_ff_21S0.\n";
}
}
mtb = msb + msd;
mtx = msq + msd;
mb = EvtPDL::getMeanMass( parent );
mx = mass;
bbx2 = 0.5 * ( bb2 + bx2 );
tm = ( mb - mx ) * ( mb - mx );
if ( t > tm )
t = 0.99 * tm;
wt = 1.0 + ( tm - t ) / ( 2.0 * mbb * mbx );
mqm = 0.1;
r2 = 3.0 / ( 4.0 * msb * msq ) + 3 * msd * msd / ( 2 * mbb * mbx * bbx2 ) +
( 16.0 / ( mbb * mbx * ( 33.0 - 2.0 * nfp ) ) ) *
log( EvtGetas( mqm ) / EvtGetas( msq ) );
f3 = sqrt( mtx / mtb ) * pow( sqrt( bx2 * bb2 ) / bbx2, 3.0 / 2.0 ) /
( pow( ( 1.0 + r2 * ( tm - t ) / 24.0 ), 4.0 ) );
f3fppfm = f3 * pow( ( mbb / mtb ), -0.5 ) * pow( ( mbx / mtx ), 0.5 );
f3fpmfm = f3 * pow( ( mbb / mtb ), 0.5 ) * pow( ( mbx / mtx ), -0.5 );
tau = msd * msd * bx2 * ( wt - 1 ) / ( bb2 * bbx2 );
udef = ( ( bb2 - bx2 ) / ( 2.0 * bbx2 ) ) +
( ( bb2 * tau ) / ( 3.0 * bbx2 ) );
vdef = ( bb2 * ( 1.0 + ( msq / msb ) ) / ( 6.0 * bbx2 ) ) *
( 7.0 - ( ( bb2 / bbx2 ) * ( 5 + tau ) ) );
fppfm = f3fppfm * sqrt( 1.5 ) *
( ( 1.0 - ( msd / msq ) ) * udef - ( msd * vdef / msq ) );
fpmfm = f3fpmfm * sqrt( 1.5 ) * ( mtb / msq ) *
( udef + ( msd * vdef / mtx ) );
*fppf = ( fppfm + fpmfm ) / 2.0;
*fpmf = ( fppfm - fpmfm ) / 2.0;
return;
} //get_ff_isgw_21s0
void EvtISGW2FF::EvtISGW2FF23S1( EvtId parent, EvtId daugt, double t,
double mass, double* fpf, double* gpf,
double* appf, double* apmf )
{
//added by Lange Jan4,2000
static EvtId BP = EvtPDL::getId( "B+" );
static EvtId BM = EvtPDL::getId( "B-" );
static EvtId B0 = EvtPDL::getId( "B0" );
static EvtId B0B = EvtPDL::getId( "anti-B0" );
static EvtId D0 = EvtPDL::getId( "D0" );
static EvtId D0B = EvtPDL::getId( "anti-D0" );
static EvtId DP = EvtPDL::getId( "D+" );
static EvtId DM = EvtPDL::getId( "D-" );
static EvtId D23S1P = EvtPDL::getId( "D*(2S)+" );
static EvtId D23S1N = EvtPDL::getId( "D*(2S)-" );
static EvtId D23S10 = EvtPDL::getId( "D*(2S)0" );
static EvtId D23S1B = EvtPDL::getId( "anti-D*(2S)0" );
static EvtId RHO2S0 = EvtPDL::getId( "rho(2S)0" );
static EvtId RHO2SP = EvtPDL::getId( "rho(2S)+" );
static EvtId RHO2SM = EvtPDL::getId( "rho(2S)-" );
static EvtId OMEG2S = EvtPDL::getId( "omega(2S)" );
double mtb, mbb( 0.0 );
double msd( 0.0 ), mx, mb, nfp( 0.0 );
double msq( 0.0 ), bx2( 0.0 ), mbx( 0.0 ), mtx;
double f3appam, f3apmam, f3, appam, apmam, f3fp, f3gp;
double udef, tau, mum, bb2( 0.0 ), bbx2, tm, wt, mqm, r2, msb( 0.0 );
double cfp( 0.0 );
EvtId prnt = parent;
EvtId dgt = daugt;
if ( prnt == B0 || prnt == B0B || prnt == BP || prnt == BM ) {
msb = 5.2;
msd = 0.33;
bb2 = 0.431 * 0.431;
mbb = 0.75 * 5.325 + 0.25 * 5.279;
if ( dgt == RHO2S0 || dgt == RHO2SP || dgt == RHO2SM || dgt == OMEG2S ) {
cfp = 0.776;
msq = 0.33;
bx2 = 0.299 * 0.299;
mbx = 0.75 * 1.45 + 0.25 * 1.300;
nfp = 0.0;
} else {
if ( dgt == D23S1N || dgt == D23S1P || dgt == D23S1B ||
dgt == D23S10 ) {
cfp = 0.929;
msq = 1.82;
bx2 = 0.38 * 0.38;
mbx = 0.75 * 2.64 + 0.25 * 2.58;
nfp = 3.0;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented daugt in get_isgw_ff_23P1.\n";
}
}
} else {
if ( prnt == D0 || prnt == D0B || prnt == DP || prnt == DM ) {
msb = 1.82;
msd = 0.33;
bb2 = 0.45 * 0.45;
mbb = 1.963;
if ( dgt == RHO2S0 || dgt == RHO2SP || dgt == RHO2SM ||
dgt == OMEG2S ) {
cfp = 0.74;
msq = 0.33;
bx2 = 0.299 * 0.299;
mbx = 0.75 * 1.45 + 0.25 * 1.300;
nfp = 0.0;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented daugt in get_isgw_ff_23P1.\n";
}
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented parent in get_isgw_ff_23P1.\n";
}
}
mtb = msb + msd;
mtx = msq + msd;
mb = EvtPDL::getMeanMass( parent );
mx = mass;
mum = 1.0 / ( 1.0 / msq - 1.0 / msb );
bbx2 = 0.5 * ( bb2 + bx2 );
tm = ( mb - mx ) * ( mb - mx );
if ( t > tm )
t = 0.99 * tm;
wt = 1.0 + ( tm - t ) / ( 2.0 * mbb * mbx );
mqm = 0.1;
r2 = 3.0 / ( 4.0 * msb * msq ) + 3 * msd * msd / ( 2 * mbb * mbx * bbx2 ) +
( 16.0 / ( mbb * mbx * ( 33.0 - 2.0 * nfp ) ) ) *
log( EvtGetas( mqm ) / EvtGetas( msq ) );
f3 = sqrt( mtx / mtb ) * pow( sqrt( bx2 * bb2 ) / bbx2, 3.0 / 2.0 ) /
( pow( ( 1.0 + r2 * ( tm - t ) / 24.0 ), 4.0 ) );
f3fp = f3 * pow( ( mbb / mtb ), 0.5 ) * pow( ( mbx / mtx ), 0.5 );
f3gp = f3 * pow( ( mbb / mtb ), -0.5 ) * pow( ( mbx / mtx ), -0.5 );
f3appam = f3 * pow( ( mbb / mtb ), -1.5 ) * pow( ( mbx / mtx ), 0.5 );
f3apmam = f3 * pow( ( mbb / mtb ), -0.5 ) * pow( ( mbx / mtx ), -0.5 );
tau = msd * msd * bx2 * ( wt - 1.0 ) / ( bb2 * bbx2 );
udef = ( ( bb2 - bx2 ) / ( 2.0 * bbx2 ) );
udef = udef + ( ( bb2 * tau ) / ( 3.0 * bbx2 ) );
*fpf = cfp * sqrt( 1.5 ) * mtb * ( 1.0 + wt ) * udef * f3fp;
*gpf = sqrt( 3.0 / 8.0 ) * f3gp *
( ( ( 1.0 / msq ) - ( ( msd * bb2 ) / ( 2.0 * mum * mtx * bbx2 ) ) ) *
udef +
( ( msd * bb2 * bx2 ) / ( 3.0 * mum * mtx * bbx2 * bbx2 ) ) );
appam = f3appam * sqrt( 2.0 / 3.0 ) * ( bb2 / ( msq * msb * bbx2 ) ) *
( ( -7.0 * msd * msd * bx2 * bx2 * ( 1.0 + ( tau / 7.0 ) ) /
( 8.0 * mtb * bbx2 * bbx2 ) ) +
( 5.0 * msd * bx2 * ( 1.0 + ( tau / 5.0 ) ) / ( 4.0 * bbx2 ) ) +
( 3.0 * msd * msd * bx2 * bx2 / ( 8.0 * mtb * bb2 * bbx2 ) ) -
( 3.0 * msd * bx2 / ( 4.0 * bb2 ) ) );
apmam =
f3apmam * sqrt( 3.0 / 2.0 ) * ( mtb / ( msb * mtx ) ) *
( 1.0 - ( bb2 * ( 1.0 + ( tau / 7.0 ) ) / bbx2 ) -
( msd * bx2 *
( 1.0 - ( 5.0 * bb2 * ( 1.0 + ( tau / 5.0 ) ) / ( 3.0 * bbx2 ) ) ) /
( 2.0 * mtb * bbx2 ) ) -
( 7.0 * msd * msd * bb2 * bx2 / ( 12.0 * msq * mtb * bbx2 * bbx2 ) ) *
( 1.0 - ( bx2 / bbx2 ) + ( bb2 * tau / ( 7.0 * bbx2 ) ) ) );
*appf = ( appam + apmam ) / 2.0;
*apmf = ( appam - apmam ) / 2.0;
return;
} //get_ff_isgw_23s1
void EvtISGW2FF::EvtISGW2FF1P1( EvtId parent, EvtId daugt, double t, double mass,
double* rf, double* vf, double* spf, double* smf )
{
//added by Lange Jan4,2000
static EvtId BP = EvtPDL::getId( "B+" );
static EvtId BM = EvtPDL::getId( "B-" );
static EvtId B0 = EvtPDL::getId( "B0" );
static EvtId B0B = EvtPDL::getId( "anti-B0" );
static EvtId D0 = EvtPDL::getId( "D0" );
static EvtId D0B = EvtPDL::getId( "anti-D0" );
static EvtId DP = EvtPDL::getId( "D+" );
static EvtId DM = EvtPDL::getId( "D-" );
static EvtId D1P1P = EvtPDL::getId( "D_1+" );
static EvtId D1P1N = EvtPDL::getId( "D_1-" );
static EvtId D1P10 = EvtPDL::getId( "D_10" );
static EvtId D1P1B = EvtPDL::getId( "anti-D_10" );
static EvtId B1P = EvtPDL::getId( "b_1+" );
static EvtId B1M = EvtPDL::getId( "b_1-" );
static EvtId B10 = EvtPDL::getId( "b_10" );
static EvtId H1 = EvtPDL::getId( "h_1" );
static EvtId H1PR = EvtPDL::getId( "h'_1" );
static EvtId K1P = EvtPDL::getId( "K_1+" );
static EvtId K1M = EvtPDL::getId( "K_1-" );
static EvtId K10 = EvtPDL::getId( "K_10" );
static EvtId K1B = EvtPDL::getId( "anti-K_10" );
static EvtId D1P1SP = EvtPDL::getId( "D_s1+" );
static EvtId D1P1SN = EvtPDL::getId( "D_s1-" );
static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
static EvtId BS0 = EvtPDL::getId( "B_s0" );
double mtb, mbb( 0.0 );
double msd( 0.0 ), mx, mb, nfp( 0.0 );
double msq( 0.0 ), bx2( 0.0 ), mbx( 0.0 ), mtx, f5;
double f5sppsm, f5spmsm;
double f5v, f5r, mup, mum, vv, rr, spmsm, sppsm;
double mqm, msb( 0.0 ), bb2( 0.0 ), bbx2, tm, wt, r2;
EvtId prnt = parent;
EvtId dgt = daugt;
if ( prnt == B0 || prnt == B0B || prnt == BP || prnt == BM ) {
msb = 5.2;
msd = 0.33;
bb2 = 0.431 * 0.431;
mbb = 5.31;
if ( dgt == B10 || dgt == B1P || dgt == B1M || dgt == H1 || dgt == H1PR ) {
msq = 0.33;
bx2 = 0.275 * 0.275;
mbx = ( 3.0 * 1.123 + 0.98 + 5.0 * 1.32 + 3.0 * 1.26 ) / 12.0;
nfp = 0.0;
} else {
if ( dgt == D1P1P || dgt == D1P10 || dgt == D1P1B || dgt == D1P1N ) {
msq = 1.82;
bx2 = 0.33 * 0.33;
mbx = ( 5.0 * 2.46 + 3.0 * 2.42 ) / 8.0;
nfp = 3.0;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented daugt in get_isgw_ff_1P1.\n";
}
}
} else {
if ( prnt == DM || prnt == DP || prnt == D0B || prnt == D0 ) {
msb = 1.82;
msd = 0.33;
bb2 = 0.45 * 0.45;
mbb = 1.963;
if ( dgt == B10 || dgt == B1P || dgt == B1M || dgt == H1 ||
dgt == H1PR ) {
msq = 0.33;
bx2 = 0.275 * 0.275;
mbx = ( 3.0 * 1.123 + 0.98 + 5.0 * 1.32 + 3.0 * 1.26 ) / 12.0;
nfp = 0.0;
} else {
if ( dgt == K10 || dgt == K1B || dgt == K1P || dgt == K1M ) {
msq = 0.55;
bx2 = 0.30 * 0.30;
mbx = ( 3.0 * 1.27 + 1.43 + 5.0 * 1.43 + 3.0 * 1.4 ) / 12.0;
nfp = 2.0;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented daugt in get_isgw_ff_1P1.\n";
}
}
} else {
//BS -> cs constants added by djl on Jan. 21,1998
if ( prnt == BS0 || prnt == BSB ) {
msb = 5.2;
msd = 0.55;
bb2 = 0.54 * 0.54;
mbb = 5.38;
if ( dgt == D1P1SP || dgt == D1P1SN ) {
msq = 1.82;
bx2 = 0.41 * 0.41;
mbx = ( 5.0 * 2.61 + 3.0 * 2.54 ) / 8.0;
nfp = 3.0;
} else if ( dgt == K10 || dgt == K1B || dgt == K1P ||
dgt == K1M ) {
msq = 0.55;
bx2 = 0.30 * 0.30;
mbx = ( 3.0 * 1.27 + 1.43 + 5.0 * 1.43 + 3.0 * 1.4 ) / 12.0;
nfp = 2.0;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented daugt:" << daugt.getId()
<< " in get_isgw_ff_1S0.\n";
}
}
else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented parent in get_isgw_ff_1P1.\n";
}
}
}
mtb = msb + msd;
mtx = msq + msd;
mb = EvtPDL::getMeanMass( parent );
mx = mass;
mup = 1.0 / ( 1.0 / msq + 1.0 / msb );
mum = 1.0 / ( 1.0 / msq - 1.0 / msb );
bbx2 = 0.5 * ( bb2 + bx2 );
tm = ( mb - mx ) * ( mb - mx );
if ( t > tm )
t = 0.99 * tm;
wt = 1.0 + ( tm - t ) / ( 2.0 * mbb * mbx );
mqm = 0.1;
r2 = 3.0 / ( 4.0 * msb * msq ) + 3 * msd * msd / ( 2 * mbb * mbx * bbx2 ) +
( 16.0 / ( mbb * mbx * ( 33.0 - 2.0 * nfp ) ) ) *
log( EvtGetas( mqm, mqm ) / EvtGetas( msq, msq ) );
f5 = sqrt( mtx / mtb ) * pow( sqrt( bx2 * bb2 ) / bbx2, 5.0 / 2.0 ) /
( pow( ( 1.0 + r2 * ( tm - t ) / 18.0 ), 3.0 ) );
f5v = f5 * pow( ( mbb / mtb ), -0.5 ) * pow( ( mbx / mtx ), -0.5 );
f5r = f5 * pow( ( mbb / mtb ), 0.5 ) * pow( ( mbx / mtx ), 0.5 );
f5sppsm = f5 * pow( ( mbb / mtb ), -1.5 ) * pow( ( mbx / mtx ), 0.5 );
f5spmsm = f5 * pow( ( mbb / mtb ), -0.5 ) * pow( ( mbx / mtx ), -0.5 );
if ( msq == msd ) {
vv = f5v *
( ( ( mtb * sqrt( bb2 ) ) / ( 4.0 * sqrt( 2.0 ) * msb * msq * mtx ) ) +
( ( ( wt - 1 ) * msd ) / ( 6.0 * sqrt( 2.0 * bb2 ) * mtx ) ) );
rr = f5r * mtb * sqrt( bb2 / 2 ) *
( ( 1.0 / mup ) + ( ( msd * mtx * ( wt - 1 ) * ( wt - 1 ) ) /
( 3.0 * msq * bb2 ) ) );
sppsm = msd * f5sppsm / ( sqrt( 2.0 * bb2 ) * mtb ) *
( 1.0 - ( msd / msq ) + ( ( msd * bb2 ) / ( 2.0 * mup * bbx2 ) ) );
spmsm = msd * f5spmsm / ( sqrt( 2.0 * bb2 ) * msq ) *
( ( ( 4 - wt ) / 3.0 ) -
( ( msd * msq * bb2 ) / ( 2.0 * mtx * mup * bbx2 ) ) );
} else {
vv = -1.0 * msd * f5v / ( 2.0 * sqrt( 3.0 * bb2 ) * mtx ) *
( ( wt + 1 ) / 2.0 + bb2 * mtb / ( 2.0 * msd * msq * msb ) );
rr = -2.0 * mtb * sqrt( bb2 / 3.0 ) * f5r *
( 1.0 / msq + mtx * msd * ( wt - 1 ) / ( 2.0 * bb2 ) *
( ( wt + 1 ) / ( 2.0 * msq ) -
msd * bb2 / ( 2.0 * mum * mtx * bbx2 ) ) );
sppsm = -1.0 * sqrt( 3.0 ) * msd * f5sppsm / ( 2.0 * sqrt( bb2 ) * mtb ) *
( 1 - msd / ( 3.0 * msq ) -
msd * bb2 / ( 3.0 * bbx2 ) *
( 1.0 / ( 2.0 * mum ) - 1.0 / mup ) );
spmsm = -1.0 * msd * f5spmsm / ( 2.0 * sqrt( 3.0 * bb2 ) * mtx ) *
( ( 2 - wt ) * mtx / msq +
msd * bb2 / bbx2 * ( 1.0 / ( 2.0 * mum ) - 1.0 / mup ) );
}
//smooth out the mass(meson) dependence a little
double parMass = EvtPDL::getMeanMass( prnt );
double q2max = parMass * parMass + mass * mass - 2.0 * parMass * mass;
double massNom = EvtPDL::getMeanMass( dgt );
double q2maxNom = parMass * parMass + massNom * massNom -
2.0 * parMass * massNom;
double q2maxin = sqrt( q2maxNom / q2max );
if ( q2maxin > 1000. )
q2maxin = 1000.;
vv *= q2maxin;
rr *= q2maxin;
sppsm *= q2maxin;
spmsm *= q2maxin;
*vf = vv;
*rf = rr;
*spf = ( sppsm + spmsm ) / 2.0;
*smf = ( sppsm - spmsm ) / 2.0;
return;
} //get_ff_isgw_1p1
void EvtISGW2FF::EvtISGW2FF3P1( EvtId parent, EvtId daugt, double t, double mass,
double* lf, double* qf, double* cpf, double* cmf )
{
//added by Lange Jan4,2000
static EvtId BP = EvtPDL::getId( "B+" );
static EvtId BM = EvtPDL::getId( "B-" );
static EvtId B0 = EvtPDL::getId( "B0" );
static EvtId B0B = EvtPDL::getId( "anti-B0" );
static EvtId D0 = EvtPDL::getId( "D0" );
static EvtId D0B = EvtPDL::getId( "anti-D0" );
static EvtId DP = EvtPDL::getId( "D+" );
static EvtId DM = EvtPDL::getId( "D-" );
static EvtId D3P1P = EvtPDL::getId( "D'_1+" );
static EvtId D3P1N = EvtPDL::getId( "D'_1-" );
static EvtId D3P10 = EvtPDL::getId( "D'_10" );
static EvtId D3P1B = EvtPDL::getId( "anti-D'_10" );
static EvtId A1P = EvtPDL::getId( "a_1+" );
static EvtId A1M = EvtPDL::getId( "a_1-" );
static EvtId A10 = EvtPDL::getId( "a_10" );
static EvtId F1 = EvtPDL::getId( "f_1" );
static EvtId F1PR = EvtPDL::getId( "f'_1" );
static EvtId K1STP = EvtPDL::getId( "K'_1+" );
static EvtId K1STM = EvtPDL::getId( "K'_1-" );
static EvtId K1ST0 = EvtPDL::getId( "K'_10" );
static EvtId K1STB = EvtPDL::getId( "anti-K'_10" );
static EvtId D3P1SP = EvtPDL::getId( "D'_s1+" );
static EvtId D3P1SN = EvtPDL::getId( "D'_s1-" );
static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
static EvtId BS0 = EvtPDL::getId( "B_s0" );
double mtb, mbb( 0.0 );
double msd( 0.0 ), mx, mb, nfp( 0.0 );
double msq( 0.0 ), bx2( 0.0 ), mbx( 0.0 ), mtx;
double f5cppcm, f5cpmcm, f5, ql, ll, cppcm, cpmcm, f5q, f5l;
double mqm, msb( 0.0 ), bb2( 0.0 ), mum, bbx2, tm, wt, r2;
EvtId prnt = parent;
EvtId dgt = daugt;
if ( prnt == B0 || prnt == B0B || prnt == BP || prnt == BM ) {
msb = 5.2;
msd = 0.33;
bb2 = 0.431 * 0.431;
mbb = 5.31;
if ( dgt == A10 || dgt == A1P || dgt == A1M || dgt == F1 || dgt == F1PR ) {
msq = 0.33;
bx2 = 0.275 * 0.275;
mbx = ( 3.0 * 1.23 + 0.98 + 5.0 * 1.32 + 3.0 * 1.26 ) / 12.0;
nfp = 0.0;
} else {
if ( dgt == D3P1P || dgt == D3P1N || dgt == D3P10 || dgt == D3P1B ) {
msq = 1.82;
bx2 = 0.33 * 0.33;
mbx = ( 3.0 * 2.49 + 2.40 ) / 4.0;
nfp = 3.0;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented daugt:" << daugt.getId()
<< " in get_isgw_ff_3P1.\n";
}
}
} else {
if ( prnt == D0 || prnt == D0B || prnt == DP || prnt == DM ) {
msb = 1.82;
msd = 0.33;
bb2 = 0.45 * 0.45;
mbb = 1.963;
if ( dgt == F1 || dgt == F1PR || dgt == A10 || dgt == A1P ||
dgt == A1M ) {
msq = 0.33;
bx2 = 0.275 * 0.275;
mbx = ( 3.0 * 1.23 + 0.98 + 5.0 * 1.32 + 3.0 * 1.26 ) / 12.0;
nfp = 0.0;
} else {
if ( dgt == K1STM || dgt == K1STB || dgt == K1STP ||
dgt == K1ST0 ) {
msq = 0.55;
bx2 = 0.30 * 0.30;
mbx = ( 3.0 * 1.40 + 1.43 + 5.0 * 1.43 + 3.0 * 1.27 ) / 12.0;
nfp = 2.0;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented daugt:" << daugt.getId()
<< " in get_isgw_ff_3P1.\n";
}
}
} else {
//BS -> cs constants added by djl on Jan. 21,1998
if ( prnt == BS0 || prnt == BSB ) {
msb = 5.2;
msd = 0.55;
bb2 = 0.54 * 0.54;
mbb = 5.38;
if ( dgt == D3P1SP || dgt == D3P1SN ) {
msq = 1.82;
bx2 = 0.41 * 0.41;
mbx = ( 3.0 * 2.54 + 2.46 ) / 4.0;
nfp = 3.0;
} else if ( dgt == K1STM || dgt == K1STB || dgt == K1STP ||
dgt == K1ST0 ) {
msq = 0.55;
bx2 = 0.30 * 0.30;
mbx = ( 3.0 * 1.40 + 1.43 + 5.0 * 1.43 + 3.0 * 1.27 ) / 12.0;
nfp = 2.0;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented daugt:" << daugt.getId()
<< " in get_isgw_ff_1S0.\n";
}
}
else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented parent in get_isgw_ff_3P1.\n";
}
}
}
mtb = msb + msd;
mtx = msq + msd;
mb = EvtPDL::getMeanMass( parent );
mx = mass;
mum = 1.0 / ( 1.0 / msq - 1.0 / msb );
bbx2 = 0.5 * ( bb2 + bx2 );
tm = ( mb - mx ) * ( mb - mx );
if ( t > tm )
t = 0.99 * tm;
wt = 1.0 + ( tm - t ) / ( 2.0 * mbb * mbx );
mqm = 0.1;
r2 = 3.0 / ( 4.0 * msb * msq ) + 3 * msd * msd / ( 2 * mbb * mbx * bbx2 ) +
( 16.0 / ( mbb * mbx * ( 33.0 - 2.0 * nfp ) ) ) *
log( EvtGetas( mqm ) / EvtGetas( msq ) );
f5 = sqrt( mtx / mtb ) * pow( sqrt( bx2 * bb2 ) / bbx2, 5.0 / 2.0 ) /
( pow( ( 1.0 + r2 * ( tm - t ) / 18.0 ), 3.0 ) );
f5q = f5 * pow( ( mbb / mtb ), -0.5 ) * pow( ( mbx / mtx ), -0.5 );
f5l = f5 * pow( ( mbb / mtb ), 0.5 ) * pow( ( mbx / mtx ), 0.5 );
f5cppcm = f5 * pow( ( mbb / mtb ), -1.5 ) * pow( ( mbx / mtx ), 0.5 );
f5cpmcm = f5 * pow( ( mbb / mtb ), -0.5 ) * pow( ( mbx / mtx ), -0.5 );
if ( msq == msd ) {
ql = -1.0 *
( msd * ( 5.0 + wt ) * f5q / ( 2.0 * mtx * sqrt( bb2 ) * 6.0 ) );
ll = -1.0 * mtb * sqrt( bb2 ) * f5l *
( 1 / mum + ( ( msd * mtx * ( wt - 1 ) / bb2 ) *
( ( 5.0 + wt ) / ( 6.0 * msq ) -
( msd * bb2 ) / ( 2.0 * mum * mtx * bbx2 ) ) ) );
cppcm = ( -1.0 *
( msd * mtx * f5cppcm / ( 2.0 * msq * mtb * sqrt( bb2 ) ) ) *
( 1 - ( msd * msq * bb2 ) / ( 2.0 * mtx * mum * bbx2 ) ) );
cpmcm = 1.0 *
( msd * mtx * f5cpmcm / ( 2.0 * msq * mtb * sqrt( bb2 ) ) ) *
( ( ( wt + 2.0 ) / 3.0 ) -
( msd * msq * bb2 ) / ( 2.0 * mtx * mum * bbx2 ) ) *
( mtb / mtx );
} else {
ql = f5q * sqrt( 1.0 / 6.0 ) * msd / ( sqrt( bb2 ) * mtx ) *
( 1.0 - bb2 * mtb / ( 4.0 * msd * msq * msb ) );
ll = f5l * sqrt( 2.0 / 3.0 ) * mtb * sqrt( bb2 ) *
( 1.0 / ( 2.0 * msq ) - 3.0 / ( 2.0 * msb ) +
msd * mtx * ( wt - 1 ) / bb2 *
( 1.0 / msq - msd * bb2 / ( 2.0 * mum * mtx * bbx2 ) ) );
cppcm = msd * msd * bx2 * f5cppcm /
( sqrt( 6.0 ) * mtb * msq * sqrt( bb2 ) * bbx2 );
cpmcm = -sqrt( 2.0 / 3.0 ) * msd * f5cpmcm / ( sqrt( bb2 ) * mtx ) *
( 1 + msd * bx2 / ( 2.0 * msq * bbx2 ) );
}
//smooth out the mass(meson) dependence a little
double parMass = EvtPDL::getMeanMass( prnt );
double q2max = parMass * parMass + mass * mass - 2.0 * parMass * mass;
double massNom = EvtPDL::getMeanMass( dgt );
double q2maxNom = parMass * parMass + massNom * massNom -
2.0 * parMass * massNom;
double q2maxin = sqrt( q2maxNom / q2max );
if ( q2maxin > 1000. )
q2maxin = 1000.;
ql *= q2maxin;
ll *= q2maxin;
cppcm *= q2maxin;
cpmcm *= q2maxin;
*qf = ql;
*lf = ll;
*cpf = ( cppcm + cpmcm ) / 2.0;
*cmf = ( cppcm - cpmcm ) / 2.0;
return;
} //get_ff_isgw_3p1
void EvtISGW2FF::EvtISGW2FF3P0( EvtId parent, EvtId daugt, double t,
double mass, double* upf, double* umf )
{
//added by Lange Jan4,2000
static EvtId BP = EvtPDL::getId( "B+" );
static EvtId BM = EvtPDL::getId( "B-" );
static EvtId B0 = EvtPDL::getId( "B0" );
static EvtId B0B = EvtPDL::getId( "anti-B0" );
static EvtId D0 = EvtPDL::getId( "D0" );
static EvtId D0B = EvtPDL::getId( "anti-D0" );
static EvtId DP = EvtPDL::getId( "D+" );
static EvtId DM = EvtPDL::getId( "D-" );
static EvtId D3P0P = EvtPDL::getId( "D_0*+" );
static EvtId D3P0N = EvtPDL::getId( "D_0*-" );
static EvtId D3P00 = EvtPDL::getId( "D_0*0" );
static EvtId D3P0B = EvtPDL::getId( "anti-D_0*0" );
static EvtId D3P0SP = EvtPDL::getId( "D_s0*+" );
static EvtId D3P0SN = EvtPDL::getId( "D_s0*-" );
static EvtId A0P = EvtPDL::getId( "a_0+" );
static EvtId A0M = EvtPDL::getId( "a_0-" );
static EvtId A00 = EvtPDL::getId( "a_00" );
static EvtId F0 = EvtPDL::getId( "f_0" );
static EvtId F0PR = EvtPDL::getId( "f'_0" );
static EvtId K0STP = EvtPDL::getId( "K_0*+" );
static EvtId K0STM = EvtPDL::getId( "K_0*-" );
static EvtId K0ST0 = EvtPDL::getId( "K_0*0" );
static EvtId K0STB = EvtPDL::getId( "anti-K_0*0" );
static EvtId DSP = EvtPDL::getId( "D_s+" );
static EvtId DSM = EvtPDL::getId( "D_s-" );
static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
static EvtId BS0 = EvtPDL::getId( "B_s0" );
double mtb, mbb( 0.0 );
double msd( 0.0 ), mx, mb, nfp( 0.0 );
double msq( 0.0 ), bx2( 0.0 ), mbx( 0.0 ), mtx;
double f5uppum, f5upmum, uppum, upmum, f5;
double mqm, r2, bb2( 0.0 ), bbx2, msb( 0.0 ), tm;
EvtId prnt = parent;
EvtId dgt = daugt;
if ( prnt == B0 || prnt == B0B || prnt == BP || prnt == BM ) {
msb = 5.2;
msd = 0.33;
bb2 = 0.431 * 0.431;
mbb = 5.31;
if ( dgt == A00 || dgt == A0P || dgt == A0M || dgt == F0 || dgt == F0PR ) {
msq = 0.33;
bx2 = 0.275 * 0.275;
mbx = ( 3.0 * 1.23 + 0.98 + 5.0 * 1.32 + 3.0 * 1.26 ) / 12.0;
nfp = 0.0;
} else {
if ( dgt == D3P0P || dgt == D3P0N || dgt == D3P00 || dgt == D3P0B ) {
msq = 1.82;
bx2 = 0.33 * 0.33;
mbx = ( 3.0 * 2.49 + 2.40 ) / 4.0;
nfp = 3.0;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented daugt in get_EvtISGW2_ff_3P0.\n";
}
}
} else {
if ( prnt == D0 || prnt == D0B || prnt == DP || prnt == DM ) {
msb = 1.82;
msd = 0.33;
bb2 = 0.45 * 0.45;
mbb = 1.963;
if ( dgt == F0 || dgt == F0PR || dgt == A00 || dgt == A0P ||
dgt == A0M ) {
msq = 0.33;
bx2 = 0.275 * 0.275;
mbx = ( 3.0 * 1.23 + 0.98 + 5.0 * 1.32 + 3.0 * 1.26 ) / 12.0;
nfp = 0.0;
} else {
if ( dgt == K0STM || dgt == K0STB || dgt == K0STP ||
dgt == K0ST0 ) {
msq = 0.55;
bx2 = 0.30 * 0.30;
mbx = ( 3.0 * 1.40 + 1.43 + 5.0 * 1.43 + 3.0 * 1.27 ) / 12.0;
nfp = 2.0;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented daugt in get_EvtISGW2_ff_3P0.\n";
}
}
} else {
if ( prnt == DSP || prnt == DSM ) {
msb = 1.82;
msd = 0.55;
bb2 = 0.56 * 0.56;
mbb = 1.968;
if ( dgt == F0 || dgt == F0PR || dgt == A00 || dgt == A0P ||
dgt == A0M ) {
msq = 0.55;
bx2 = 0.33 * 0.33;
mbx = ( 3.0 * 1.40 + 1.43 + 5.0 * 1.43 + 3.0 * 1.27 ) / 12.0;
nfp = 2.0;
} else {
if ( dgt == K0STM || dgt == K0STB || dgt == K0STP ||
dgt == K0ST0 ) {
msq = 0.33;
bx2 = 0.30 * 0.30;
mbx = ( 3.0 * 1.23 + 0.98 + 5.0 * 1.32 + 3.0 * 1.26 ) /
12.0;
nfp = 0.0;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented daugt in get_EvtISGW2_ff_3P0.\n";
}
}
} else {
//BS -> cs constants added by djl on Jan. 21,1998
if ( prnt == BS0 || prnt == BSB ) {
msb = 5.2;
msd = 0.55;
bb2 = 0.54 * 0.54;
mbb = 5.38;
if ( dgt == D3P0SP || dgt == D3P0SN ) {
msq = 1.82;
bx2 = 0.41 * 0.41;
mbx = ( 3.0 * 2.54 + 2.46 ) / 4.0;
nfp = 3.0;
} else if ( dgt == K0STM || dgt == K0STB || dgt == K0STP ||
dgt == K0ST0 ) {
msq = 0.55;
bx2 = 0.30 * 0.30;
mbx = ( 3.0 * 1.40 + 1.43 + 5.0 * 1.43 + 3.0 * 1.27 ) /
12.0;
nfp = 2.0;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented daugt:" << daugt.getId()
<< " in get_isgw_ff_1S0.\n";
}
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented parent in get_EvtISGW2_ff_3P0.\n";
}
}
}
}
mtb = msb + msd;
mtx = msq + msd;
mb = EvtPDL::getMeanMass( parent );
mx = mass;
bbx2 = 0.5 * ( bb2 + bx2 );
tm = ( mb - mx ) * ( mb - mx );
if ( t > tm )
t = 0.99 * tm;
mqm = 0.1;
r2 = 3.0 / ( 4.0 * msb * msq ) + 3 * msd * msd / ( 2 * mbb * mbx * bbx2 ) +
( 16.0 / ( mbb * mbx * ( 33.0 - 2.0 * nfp ) ) ) *
log( EvtGetas( mqm ) / EvtGetas( msq ) );
f5 = sqrt( mtx / mtb ) * pow( sqrt( bx2 * bb2 ) / bbx2, 5.0 / 2.0 ) /
( pow( ( 1.0 + r2 * ( tm - t ) / 18.0 ), 3.0 ) );
f5uppum = f5 * pow( ( mbb / mtb ), -0.5 ) * pow( ( mbx / mtx ), 0.5 );
f5upmum = f5 * pow( ( mbb / mtb ), 0.5 ) * pow( ( mbx / mtx ), -0.5 );
uppum = -1.0 * f5uppum * sqrt( 2.0 / ( 3.0 * bb2 ) ) * msd;
upmum = 1.0 * f5upmum * sqrt( 2.0 / ( 3.0 * bb2 ) ) * msd * mtb / mtx;
*upf = ( uppum + upmum ) / 2.0;
*umf = ( uppum - upmum ) / 2.0;
return;
}
void EvtISGW2FF::EvtISGW2FF3P2( EvtId parent, EvtId daugt, double t, double mass,
double* hf, double* kf, double* bpf, double* bmf )
{
//added by Lange Jan4,2000
static EvtId BP = EvtPDL::getId( "B+" );
static EvtId BM = EvtPDL::getId( "B-" );
static EvtId B0 = EvtPDL::getId( "B0" );
static EvtId B0B = EvtPDL::getId( "anti-B0" );
static EvtId D0 = EvtPDL::getId( "D0" );
static EvtId D0B = EvtPDL::getId( "anti-D0" );
static EvtId DP = EvtPDL::getId( "D+" );
static EvtId DM = EvtPDL::getId( "D-" );
static EvtId D3P2P = EvtPDL::getId( "D_2*+" );
static EvtId D3P2N = EvtPDL::getId( "D_2*-" );
static EvtId D3P20 = EvtPDL::getId( "D_2*0" );
static EvtId D3P2B = EvtPDL::getId( "anti-D_2*0" );
static EvtId A2P = EvtPDL::getId( "a_2+" );
static EvtId A2M = EvtPDL::getId( "a_2-" );
static EvtId A20 = EvtPDL::getId( "a_20" );
static EvtId F2 = EvtPDL::getId( "f_2" );
static EvtId F2PR = EvtPDL::getId( "f'_2" );
static EvtId K2STP = EvtPDL::getId( "K_2*+" );
static EvtId K2STM = EvtPDL::getId( "K_2*-" );
static EvtId K2ST0 = EvtPDL::getId( "K_2*0" );
static EvtId K2STB = EvtPDL::getId( "anti-K_2*0" );
static EvtId D3P2SP = EvtPDL::getId( "D_s2*+" );
static EvtId D3P2SN = EvtPDL::getId( "D_s2*-" );
static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
static EvtId BS0 = EvtPDL::getId( "B_s0" );
double mtb, mbb( 0.0 );
double msd( 0.0 ), mx, mb, nfp( 0.0 );
double msq( 0.0 ), bx2( 0.0 ), mbx( 0.0 ), mtx, f5;
double f5h, f5k, f5bppbm, f5bpmbm, bppbm, bpmbm;
double mqm, mum, mup, tm, wt, r2, bb2( 0.0 ), bbx2;
double msb( 0.0 );
EvtId prnt = parent;
EvtId dgt = daugt;
if ( prnt == B0 || prnt == B0B || prnt == BP || prnt == BM ) {
msb = 5.2;
msd = 0.33;
bb2 = 0.431 * 0.431;
mbb = 5.31;
if ( dgt == A20 || dgt == A2P || dgt == A2M || dgt == F2 || dgt == F2PR ) {
msq = 0.33;
bx2 = 0.275 * 0.275;
mbx = ( 3.0 * 1.23 + 0.98 + 5.0 * 1.32 + 3.0 * 1.26 ) / 12.0;
nfp = 0.0;
}
else {
if ( dgt == D3P2P || dgt == D3P2N || dgt == D3P20 || dgt == D3P2B ) {
msq = 1.82;
bx2 = 0.33 * 0.33;
mbx = ( 5.0 * 2.46 + 3.0 * 2.42 ) / 8.0;
nfp = 3.0;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented daugt in get_isgw_ff_3P2.\n";
}
}
} else {
if ( prnt == D0 || prnt == D0B || prnt == DP || prnt == DM ) {
msb = 1.82;
msd = 0.33;
bb2 = 0.45 * 0.45;
mbb = 1.963;
if ( dgt == F2 || dgt == F2PR || dgt == A20 || dgt == A2P ||
dgt == A2M ) {
msq = 0.33;
bx2 = 0.275 * 0.275;
mbx = ( 3.0 * 1.23 + 0.98 + 5.0 * 1.32 + 3.0 * 1.26 ) / 12.0;
nfp = 0.0;
} else {
if ( dgt == K2STM || dgt == K2STB || dgt == K2STP ||
dgt == K2ST0 ) {
msq = 0.55;
bx2 = 0.30 * 0.30;
mbx = ( 3.0 * 1.40 + 1.43 + 5.0 * 1.43 + 3.0 * 1.27 ) / 12.0;
nfp = 2.0;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented daugt in get_isgw_ff_3P2.\n";
}
}
} else {
//BS -> cs constants added by djl on Jan. 21,1998
if ( prnt == BS0 || prnt == BSB ) {
msb = 5.2;
msd = 0.55;
bb2 = 0.54 * 0.54;
mbb = 5.38;
if ( dgt == D3P2SP || dgt == D3P2SN ) {
msq = 1.82;
bx2 = 0.41 * 0.41;
mbx = ( 5.0 * 2.61 + 3.0 * 2.54 ) / 8.0;
nfp = 3.0;
} else if ( dgt == K2STM || dgt == K2STB || dgt == K2STP ||
dgt == K2ST0 ) {
msq = 0.55;
bx2 = 0.30 * 0.30;
mbx = ( 3.0 * 1.40 + 1.43 + 5.0 * 1.43 + 3.0 * 1.27 ) / 12.0;
nfp = 2.0;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented daugt:" << daugt.getId()
<< " in get_isgw_ff_1S0.\n";
}
}
else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented parent in get_isgw_ff_3P2.\n";
}
}
}
mtb = msb + msd;
mtx = msq + msd;
mb = EvtPDL::getMeanMass( parent );
mx = mass;
mup = 1.0 / ( 1.0 / msq + 1.0 / msb );
mum = 1.0 / ( 1.0 / msq - 1.0 / msb );
bbx2 = 0.5 * ( bb2 + bx2 );
tm = ( mb - mx ) * ( mb - mx );
if ( t > tm )
t = 0.99 * tm;
wt = 1.0 + ( tm - t ) / ( 2.0 * mbb * mbx );
mqm = 0.1;
r2 = 3.0 / ( 4.0 * msb * msq ) + 3 * msd * msd / ( 2 * mbb * mbx * bbx2 ) +
( 16.0 / ( mbb * mbx * ( 33.0 - 2.0 * nfp ) ) ) *
log( EvtGetas( mqm ) / EvtGetas( msq ) );
f5 = sqrt( mtx / mtb ) * pow( sqrt( bx2 * bb2 ) / bbx2, 5.0 / 2.0 ) /
( pow( ( 1.0 + r2 * ( tm - t ) / 18.0 ), 3.0 ) );
f5h = f5 * pow( ( mbb / mtb ), -1.5 ) * pow( ( mbx / mtx ), -0.5 );
f5k = f5 * pow( ( mbb / mtb ), -0.5 ) * pow( ( mbx / mtx ), 0.5 );
f5bppbm = f5 * pow( ( mbb / mtb ), -2.5 ) * pow( ( mbx / mtx ), 0.5 );
f5bpmbm = f5 * pow( ( mbb / mtb ), -1.5 ) * pow( ( mbx / mtx ), -0.5 );
*hf = f5h * ( msd / ( sqrt( 8.0 * bb2 ) * mtb ) ) *
( ( 1.0 / msq ) - ( msd * bb2 / ( 2.0 * mum * mtx * bbx2 ) ) );
*kf = f5k * ( msd / ( sqrt( 2.0 * bb2 ) ) ) * ( 1.0 + wt );
bppbm = ( ( msd * msd * f5bppbm * bx2 ) /
( sqrt( 32.0 * bb2 ) * msq * msb * mtb * bbx2 ) ) *
( 1.0 - ( msd * bx2 / ( 2.0 * mtb * bbx2 ) ) );
bpmbm = -1.0 * ( msd * f5bpmbm / ( sqrt( 2.0 * bb2 ) * msb * mtx ) ) *
( 1.0 - ( ( msd * msb * bx2 ) / ( 2.0 * mup * mtb * bbx2 ) ) +
( ( msd * bx2 * ( 1.0 - ( ( msd * bx2 ) / ( 2.0 * mtb * bbx2 ) ) ) ) /
( 4.0 * msq * bbx2 ) ) );
*bpf = ( bppbm + bpmbm ) / 2.0;
*bmf = ( bppbm - bpmbm ) / 2.0;
return;
} //get_ff_isgw_1p1
double EvtISGW2FF::EvtGetGammaji( double z )
{
double temp;
temp = 2 + ( ( 2.0 * z ) / ( 1 - z ) ) * log( z );
temp = -1.0 * temp;
return temp;
} //EvtGetGammaji
double EvtISGW2FF::EvtGetas( double massq, double massx )
{
double lqcd2 = 0.04;
double nflav = 4;
double temp = 0.6;
if ( massx > 0.6 ) {
if ( massq < 1.85 ) {
nflav = 3.0;
}
temp = 12.0 * EvtConst::pi / ( 33.0 - 2.0 * nflav ) /
log( massx * massx / lqcd2 );
}
return temp;
} //EvtGetas
double EvtISGW2FF::EvtGetas( double mass )
{
double lqcd2 = 0.04;
double nflav = 4;
double temp = 0.6;
if ( mass > 0.6 ) {
if ( mass < 1.85 ) {
nflav = 3.0;
}
temp = 12.0 * EvtConst::pi / ( 33.0 - 2.0 * nflav ) /
log( mass * mass / lqcd2 );
}
return temp;
} //EvtGetas
void EvtISGW2FF::getbaryonff( EvtId, EvtId, double, double, double*, double*,
double*, double* )
{
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented :getbaryonff in EvtISGW2FF.\n";
::abort();
}
void EvtISGW2FF::getdiracff( EvtId, EvtId, double, double, double*, double*,
double*, double*, double*, double* )
{
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented :getdiracff in EvtISGW2FF.\n";
::abort();
}
void EvtISGW2FF::getraritaff( EvtId, EvtId, double, double, double*, double*,
double*, double*, double*, double*, double*,
double* )
{
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Not implemented :getraritaff in EvtISGW2FF.\n";
::abort();
}
diff --git a/src/EvtGenModels/EvtLb2Baryonlnu.cpp b/src/EvtGenModels/EvtLb2Baryonlnu.cpp
index d03f962..419bb35 100644
--- a/src/EvtGenModels/EvtLb2Baryonlnu.cpp
+++ b/src/EvtGenModels/EvtLb2Baryonlnu.cpp
@@ -1,225 +1,225 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenModels/EvtLb2Baryonlnu.hh"
#include "EvtGenBase/EvtConst.hh"
#include "EvtGenBase/EvtGenKine.hh"
#include "EvtGenBase/EvtIdSet.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtPatches.hh"
#include "EvtGenBase/EvtReport.hh"
#include "EvtGenModels/EvtLb2BaryonlnuFF.hh"
#include <stdlib.h>
#include <string>
using namespace std;
#ifdef D0
#undef D0
#endif
EvtLb2Baryonlnu::EvtLb2Baryonlnu() : ffmodel( nullptr ), calcamp( nullptr )
{
}
EvtLb2Baryonlnu::~EvtLb2Baryonlnu()
{
delete ffmodel;
ffmodel = nullptr;
delete calcamp;
calcamp = nullptr;
}
std::string EvtLb2Baryonlnu::getName()
{
return "Lb2Baryonlnu";
}
EvtDecayBase* EvtLb2Baryonlnu::clone()
{
return new EvtLb2Baryonlnu;
}
void EvtLb2Baryonlnu::decay( EvtParticle* p )
{
//This is a kludge to avoid warnings because the K_2* mass becomes to large.
- static EvtIdSet regenerateMasses( "K_2*+", "K_2*-", "K_2*0", "anti-K_2*0",
- "K_1+", "K_1-", "K_10", "anti-K_10",
- "D'_1+", "D'_1-", "D'_10", "anti-D'_10" );
+ static EvtIdSet regenerateMasses{ "K_2*+", "K_2*-", "K_2*0", "anti-K_2*0",
+ "K_1+", "K_1-", "K_10", "anti-K_10",
+ "D'_1+", "D'_1-", "D'_10", "anti-D'_10" };
if ( regenerateMasses.contains( getDaug( 0 ) ) ) {
p->resetFirstOrNot();
}
p->initializePhaseSpace( getNDaug(), getDaugs() );
EvtComplex r00( getArg( 0 ), 0.0 );
EvtComplex r01( getArg( 1 ), 0.0 );
EvtComplex r10( getArg( 2 ), 0.0 );
EvtComplex r11( getArg( 3 ), 0.0 );
calcamp->CalcAmp( p, _amp2, ffmodel, r00, r01, r10, r11 );
}
void EvtLb2Baryonlnu::initProbMax()
{
static EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
static EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
static EvtId PRO = EvtPDL::getId( "p+" );
static EvtId PROB = EvtPDL::getId( "anti-p-" );
static EvtId N1440 = EvtPDL::getId( "N(1440)+" );
static EvtId N1440B = EvtPDL::getId( "anti-N(1440)-" );
static EvtId N1535 = EvtPDL::getId( "N(1535)+" );
static EvtId N1535B = EvtPDL::getId( "anti-N(1535)-" );
static EvtId N1520 = EvtPDL::getId( "N(1520)+" );
static EvtId N1520B = EvtPDL::getId( "anti-N(1520)-" );
static EvtId N1720 = EvtPDL::getId( "N(1720)+" );
static EvtId N1720B = EvtPDL::getId( "anti-N(1720)-" );
static EvtId N1650 = EvtPDL::getId( "N(1650)+" );
static EvtId N1650B = EvtPDL::getId( "anti-N(1650)-" );
static EvtId N1700 = EvtPDL::getId( "N(1700)+" );
static EvtId N1700B = EvtPDL::getId( "anti-N(1700)-" );
static EvtId N1710 = EvtPDL::getId( "N(1710)+" );
static EvtId N1710B = EvtPDL::getId( "anti-N(1710)-" );
static EvtId N1875 = EvtPDL::getId( "N(1875)+" );
static EvtId N1875B = EvtPDL::getId( "anti-N(1875)-" );
static EvtId N1900 = EvtPDL::getId( "N(1900)+" );
static EvtId N1900B = EvtPDL::getId( "anti-N(1900)-" );
static EvtId LAMCP = EvtPDL::getId( "Lambda_c+" );
static EvtId LAMCM = EvtPDL::getId( "anti-Lambda_c-" );
static EvtId LAMC1P = EvtPDL::getId( "Lambda_c(2593)+" );
static EvtId LAMC1M = EvtPDL::getId( "anti-Lambda_c(2593)-" );
static EvtId LAMC2P = EvtPDL::getId( "Lambda_c(2625)+" );
static EvtId LAMC2M = EvtPDL::getId( "anti-Lambda_c(2625)-" );
EvtId parnum, barnum;
parnum = getParentId();
barnum = getDaug( 0 );
if ( ( parnum == LAMB && barnum == PRO ) ||
( parnum == LAMBB && barnum == PROB ) ||
( parnum == LAMB && barnum == N1440 ) ||
( parnum == LAMBB && barnum == N1440B ) ||
( parnum == LAMB && barnum == N1520 ) ||
( parnum == LAMBB && barnum == N1520B ) ||
( parnum == LAMB && barnum == N1535 ) ||
( parnum == LAMBB && barnum == N1535B ) ||
( parnum == LAMB && barnum == N1720 ) ||
( parnum == LAMBB && barnum == N1720B ) ||
( parnum == LAMB && barnum == N1650 ) ||
( parnum == LAMBB && barnum == N1650B ) ||
( parnum == LAMB && barnum == N1700 ) ||
( parnum == LAMBB && barnum == N1700B ) ||
( parnum == LAMB && barnum == N1710 ) ||
( parnum == LAMBB && barnum == N1710B ) ||
( parnum == LAMB && barnum == N1875 ) ||
( parnum == LAMBB && barnum == N1875B ) ||
( parnum == LAMB && barnum == N1900 ) ||
( parnum == LAMBB && barnum == N1900B ) ||
( parnum == LAMB && barnum == LAMCP ) ||
( parnum == LAMBB && barnum == LAMCM ) ||
( parnum == LAMB && barnum == LAMC1P ) ||
( parnum == LAMBB && barnum == LAMC1M ) ||
( parnum == LAMB && barnum == LAMC2P ) ||
( parnum == LAMBB && barnum == LAMC2M ) ) {
setProbMax( 22000.0 );
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Decay does not have acceptable final state baryon for this model setting ProbMax = 0 "
<< endl;
setProbMax( 0.0 );
}
}
void EvtLb2Baryonlnu::init()
{
if ( getNArg() != 4 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "EvtLb2Baryonlnu generator expected "
<< " 4 arguments but found:" << getNArg() << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
if ( getNDaug() != 3 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Wrong number of daughters in EvtLb2plnu.cc "
<< " 3 daughters expected but found: " << getNDaug() << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
//We expect the parent to be a dirac particle
//and the daughters to be X lepton neutrino
EvtSpinType::spintype parenttype = EvtPDL::getSpinType( getParentId() );
EvtSpinType::spintype baryontype = EvtPDL::getSpinType( getDaug( 0 ) );
EvtSpinType::spintype leptontype = EvtPDL::getSpinType( getDaug( 1 ) );
EvtSpinType::spintype neutrinotype = EvtPDL::getSpinType( getDaug( 2 ) );
if ( parenttype != EvtSpinType::DIRAC ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "EvtLb2Baryonlnu generator expected "
<< " a DIRAC parent, found:" << EvtPDL::name( getParentId() )
<< endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
if ( leptontype != EvtSpinType::DIRAC ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "EvtLb2Baryonlnu generator expected "
<< " a DIRAC 2nd daughter, found:" << EvtPDL::name( getDaug( 1 ) )
<< endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
if ( neutrinotype != EvtSpinType::NEUTRINO ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "EvtLb2Baryonlnu generator expected "
<< " a NEUTRINO 3rd daughter, found:" << EvtPDL::name( getDaug( 2 ) )
<< endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
//set ffmodel
ffmodel = new EvtLb2BaryonlnuFF;
if ( baryontype == EvtSpinType::DIRAC ||
baryontype == EvtSpinType::RARITASCHWINGER ) {
calcamp = new EvtSLBaryonAmp;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Wrong baryon spin type in EvtLb2Baryonlnu.cc "
<< "Expected spin type " << EvtSpinType::DIRAC
<< ", found spin type " << baryontype << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
}
diff --git a/src/EvtGenModels/EvtLb2plnuLCSR.cpp b/src/EvtGenModels/EvtLb2plnuLCSR.cpp
index 94a81b4..a4d5635 100644
--- a/src/EvtGenModels/EvtLb2plnuLCSR.cpp
+++ b/src/EvtGenModels/EvtLb2plnuLCSR.cpp
@@ -1,175 +1,175 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenModels/EvtLb2plnuLCSR.hh"
#include "EvtGenBase/EvtConst.hh"
#include "EvtGenBase/EvtGenKine.hh"
#include "EvtGenBase/EvtIdSet.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtPatches.hh"
#include "EvtGenBase/EvtReport.hh"
#include "EvtGenModels/EvtLb2plnuLCSRFF.hh"
#include <stdlib.h>
#include <string>
using namespace std;
#ifdef D0
#undef D0
#endif
EvtLb2plnuLCSR::EvtLb2plnuLCSR() : ffmodel( nullptr ), calcamp( nullptr )
{
}
EvtLb2plnuLCSR::~EvtLb2plnuLCSR()
{
delete ffmodel;
ffmodel = nullptr;
delete calcamp;
calcamp = nullptr;
}
std::string EvtLb2plnuLCSR::getName()
{
return "Lb2plnuLCSR";
}
EvtDecayBase* EvtLb2plnuLCSR::clone()
{
return new EvtLb2plnuLCSR;
}
void EvtLb2plnuLCSR::decay( EvtParticle* p )
{
//This is a kludge to avoid warnings because the K_2* mass becomes to large.
- static EvtIdSet regenerateMasses( "K_2*+", "K_2*-", "K_2*0", "anti-K_2*0",
- "K_1+", "K_1-", "K_10", "anti-K_10",
- "D'_1+", "D'_1-", "D'_10", "anti-D'_10" );
+ static EvtIdSet regenerateMasses{ "K_2*+", "K_2*-", "K_2*0", "anti-K_2*0",
+ "K_1+", "K_1-", "K_10", "anti-K_10",
+ "D'_1+", "D'_1-", "D'_10", "anti-D'_10" };
if ( regenerateMasses.contains( getDaug( 0 ) ) ) {
p->resetFirstOrNot();
}
p->initializePhaseSpace( getNDaug(), getDaugs() );
EvtComplex r00( getArg( 0 ), 0.0 );
EvtComplex r01( getArg( 1 ), 0.0 );
EvtComplex r10( getArg( 2 ), 0.0 );
EvtComplex r11( getArg( 3 ), 0.0 );
calcamp->CalcAmp( p, _amp2, ffmodel, r00, r01, r10, r11 );
}
void EvtLb2plnuLCSR::initProbMax()
{
static EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
static EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
static EvtId PRO = EvtPDL::getId( "p+" );
static EvtId PROB = EvtPDL::getId( "anti-p-" );
EvtId parnum, barnum;
parnum = getParentId();
barnum = getDaug( 0 );
if ( ( parnum == LAMB && barnum == PRO ) ||
( parnum == LAMBB && barnum == PROB ) ) {
setProbMax( 22000.0 );
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Decay does not have Lb->p setting ProbMax = 0 " << endl;
setProbMax( 0.0 );
}
}
void EvtLb2plnuLCSR::init()
{
if ( getNArg() != 4 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "EvtLb2plnuLCSR generator expected "
<< " 4 arguments but found:" << getNArg() << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
if ( getNDaug() != 3 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Wrong number of daughters in EvtLb2plnu.cc "
<< " 3 daughters expected but found: " << getNDaug() << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
//We expect the parent to be a dirac particle
//and the daughters to be X lepton neutrino
EvtSpinType::spintype parenttype = EvtPDL::getSpinType( getParentId() );
EvtSpinType::spintype baryontype = EvtPDL::getSpinType( getDaug( 0 ) );
EvtSpinType::spintype leptontype = EvtPDL::getSpinType( getDaug( 1 ) );
EvtSpinType::spintype neutrinotype = EvtPDL::getSpinType( getDaug( 2 ) );
if ( parenttype != EvtSpinType::DIRAC ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "EvtLb2plnuLCSR generator expected "
<< " a DIRAC parent, found:" << EvtPDL::name( getParentId() )
<< endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
if ( leptontype != EvtSpinType::DIRAC ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "EvtLb2plnuLCSR generator expected "
<< " a DIRAC 2nd daughter, found:" << EvtPDL::name( getDaug( 1 ) )
<< endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
if ( neutrinotype != EvtSpinType::NEUTRINO ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "EvtLb2plnuLCSR generator expected "
<< " a NEUTRINO 3rd daughter, found:" << EvtPDL::name( getDaug( 2 ) )
<< endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
//set ffmodel
ffmodel = new EvtLb2plnuLCSRFF;
if ( baryontype == EvtSpinType::DIRAC ) {
calcamp = new EvtSLBaryonAmp;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Wrong baryon spin type in EvtLb2plnuLCSR.cc "
<< "Expected spin type " << EvtSpinType::DIRAC
<< ", found spin type " << baryontype << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
}
diff --git a/src/EvtGenModels/EvtLb2plnuLQCD.cpp b/src/EvtGenModels/EvtLb2plnuLQCD.cpp
index 3c2e8cc..0abfba4 100644
--- a/src/EvtGenModels/EvtLb2plnuLQCD.cpp
+++ b/src/EvtGenModels/EvtLb2plnuLQCD.cpp
@@ -1,175 +1,175 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenModels/EvtLb2plnuLQCD.hh"
#include "EvtGenBase/EvtConst.hh"
#include "EvtGenBase/EvtGenKine.hh"
#include "EvtGenBase/EvtIdSet.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtPatches.hh"
#include "EvtGenBase/EvtReport.hh"
#include "EvtGenModels/EvtLb2plnuLQCDFF.hh"
#include <stdlib.h>
#include <string>
using namespace std;
#ifdef D0
#undef D0
#endif
EvtLb2plnuLQCD::EvtLb2plnuLQCD() : ffmodel( nullptr ), calcamp( nullptr )
{
}
EvtLb2plnuLQCD::~EvtLb2plnuLQCD()
{
delete ffmodel;
ffmodel = nullptr;
delete calcamp;
calcamp = nullptr;
}
std::string EvtLb2plnuLQCD::getName()
{
return "Lb2plnuLQCD";
}
EvtDecayBase* EvtLb2plnuLQCD::clone()
{
return new EvtLb2plnuLQCD;
}
void EvtLb2plnuLQCD::decay( EvtParticle* p )
{
//This is a kludge to avoid warnings because the K_2* mass becomes to large.
- static EvtIdSet regenerateMasses( "K_2*+", "K_2*-", "K_2*0", "anti-K_2*0",
- "K_1+", "K_1-", "K_10", "anti-K_10",
- "D'_1+", "D'_1-", "D'_10", "anti-D'_10" );
+ static EvtIdSet regenerateMasses{ "K_2*+", "K_2*-", "K_2*0", "anti-K_2*0",
+ "K_1+", "K_1-", "K_10", "anti-K_10",
+ "D'_1+", "D'_1-", "D'_10", "anti-D'_10" };
if ( regenerateMasses.contains( getDaug( 0 ) ) ) {
p->resetFirstOrNot();
}
p->initializePhaseSpace( getNDaug(), getDaugs() );
EvtComplex r00( getArg( 0 ), 0.0 );
EvtComplex r01( getArg( 1 ), 0.0 );
EvtComplex r10( getArg( 2 ), 0.0 );
EvtComplex r11( getArg( 3 ), 0.0 );
calcamp->CalcAmp( p, _amp2, ffmodel, r00, r01, r10, r11 );
}
void EvtLb2plnuLQCD::initProbMax()
{
static EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
static EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
static EvtId PRO = EvtPDL::getId( "p+" );
static EvtId PROB = EvtPDL::getId( "anti-p-" );
EvtId parnum, barnum;
parnum = getParentId();
barnum = getDaug( 0 );
if ( ( parnum == LAMB && barnum == PRO ) ||
( parnum == LAMBB && barnum == PROB ) ) {
setProbMax( 22000.0 );
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Decay does not have Lb->p setting ProbMax = 0 " << endl;
setProbMax( 0.0 );
}
}
void EvtLb2plnuLQCD::init()
{
if ( getNArg() != 4 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "EvtLb2plnuLQCD generator expected "
<< " 4 arguments but found:" << getNArg() << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
if ( getNDaug() != 3 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Wrong number of daughters in EvtLb2plnu.cc "
<< " 3 daughters expected but found: " << getNDaug() << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
//We expect the parent to be a dirac particle
//and the daughters to be X lepton neutrino
EvtSpinType::spintype parenttype = EvtPDL::getSpinType( getParentId() );
EvtSpinType::spintype baryontype = EvtPDL::getSpinType( getDaug( 0 ) );
EvtSpinType::spintype leptontype = EvtPDL::getSpinType( getDaug( 1 ) );
EvtSpinType::spintype neutrinotype = EvtPDL::getSpinType( getDaug( 2 ) );
if ( parenttype != EvtSpinType::DIRAC ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "EvtLb2plnuLQCD generator expected "
<< " a DIRAC parent, found:" << EvtPDL::name( getParentId() )
<< endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
if ( leptontype != EvtSpinType::DIRAC ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "EvtLb2plnuLQCD generator expected "
<< " a DIRAC 2nd daughter, found:" << EvtPDL::name( getDaug( 1 ) )
<< endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
if ( neutrinotype != EvtSpinType::NEUTRINO ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "EvtLb2plnuLQCD generator expected "
<< " a NEUTRINO 3rd daughter, found:" << EvtPDL::name( getDaug( 2 ) )
<< endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
//set ffmodel
ffmodel = new EvtLb2plnuLQCDFF;
if ( baryontype == EvtSpinType::DIRAC ) {
calcamp = new EvtSLBaryonAmp;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Wrong baryon spin type in EvtLb2plnuLQCD.cc "
<< "Expected spin type " << EvtSpinType::DIRAC
<< ", found spin type " << baryontype << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
}
diff --git a/src/EvtGenModels/EvtPropSLPole.cpp b/src/EvtGenModels/EvtPropSLPole.cpp
index 247ba50..571061d 100644
--- a/src/EvtGenModels/EvtPropSLPole.cpp
+++ b/src/EvtGenModels/EvtPropSLPole.cpp
@@ -1,559 +1,551 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenModels/EvtPropSLPole.hh"
#include "EvtGenBase/EvtAmpPdf.hh"
#include "EvtGenBase/EvtDecayTable.hh"
#include "EvtGenBase/EvtGenKine.hh"
#include "EvtGenBase/EvtIntervalFlatPdf.hh"
#include "EvtGenBase/EvtMassAmp.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtPatches.hh"
#include "EvtGenBase/EvtPropBreitWignerRel.hh"
#include "EvtGenBase/EvtReport.hh"
#include "EvtGenBase/EvtScalarParticle.hh"
#include "EvtGenBase/EvtSemiLeptonicScalarAmp.hh"
#include "EvtGenBase/EvtSemiLeptonicTensorAmp.hh"
#include "EvtGenBase/EvtSemiLeptonicVectorAmp.hh"
#include "EvtGenBase/EvtSpinType.hh"
#include "EvtGenBase/EvtTensorParticle.hh"
#include "EvtGenBase/EvtTwoBodyVertex.hh"
#include "EvtGenBase/EvtVectorParticle.hh"
#include "EvtGenModels/EvtSLPoleFF.hh"
#include <stdlib.h>
#include <string>
std::string EvtPropSLPole::getName()
{
return "PROPSLPOLE";
}
EvtDecayBase* EvtPropSLPole::clone()
{
return new EvtPropSLPole;
}
void EvtPropSLPole::decay( EvtParticle* p )
{
if ( !_isProbMaxSet ) {
EvtId parnum, mesnum, lnum, nunum;
parnum = getParentId();
mesnum = getDaug( 0 );
lnum = getDaug( 1 );
nunum = getDaug( 2 );
double mymaxprob = calcMaxProb( parnum, mesnum, lnum, nunum,
SLPoleffmodel.get() );
setProbMax( mymaxprob );
_isProbMaxSet = true;
}
double minKstMass = EvtPDL::getMinMass( p->getDaug( 0 )->getId() );
double maxKstMass = EvtPDL::getMaxMass( p->getDaug( 0 )->getId() );
EvtIntervalFlatPdf flat( minKstMass, maxKstMass );
EvtPdfGen<EvtPoint1D> gen( flat );
EvtPoint1D point = gen();
double massKst = point.value();
p->getDaug( 0 )->setMass( massKst );
p->initializePhaseSpace( getNDaug(), getDaugs() );
// EvtVector4R p4meson = p->getDaug(0)->getP4();
calcamp->CalcAmp( p, _amp2, SLPoleffmodel.get() );
EvtParticle* mesonPart = p->getDaug( 0 );
double meson_BWAmp = calBreitWigner( mesonPart, point );
int list[2];
list[0] = 0;
list[1] = 0;
_amp2.vertex( 0, 0, _amp2.getAmp( list ) * meson_BWAmp );
list[0] = 0;
list[1] = 1;
_amp2.vertex( 0, 1, _amp2.getAmp( list ) * meson_BWAmp );
list[0] = 1;
list[1] = 0;
_amp2.vertex( 1, 0, _amp2.getAmp( list ) * meson_BWAmp );
list[0] = 1;
list[1] = 1;
_amp2.vertex( 1, 1, _amp2.getAmp( list ) * meson_BWAmp );
list[0] = 2;
list[1] = 0;
_amp2.vertex( 2, 0, _amp2.getAmp( list ) * meson_BWAmp );
list[0] = 2;
list[1] = 1;
_amp2.vertex( 2, 1, _amp2.getAmp( list ) * meson_BWAmp );
return;
}
void EvtPropSLPole::initProbMax()
{
_isProbMaxSet = false;
return;
}
void EvtPropSLPole::init()
{
checkNDaug( 3 );
//We expect the parent to be a scalar
//and the daughters to be X lepton neutrino
checkSpinParent( EvtSpinType::SCALAR );
checkSpinDaughter( 1, EvtSpinType::DIRAC );
checkSpinDaughter( 2, EvtSpinType::NEUTRINO );
EvtSpinType::spintype mesontype = EvtPDL::getSpinType( getDaug( 0 ) );
SLPoleffmodel = std::make_unique<EvtSLPoleFF>( getNArg(), getArgs() );
switch ( mesontype ) {
case EvtSpinType::SCALAR:
calcamp = std::make_unique<EvtSemiLeptonicScalarAmp>();
break;
case EvtSpinType::VECTOR:
calcamp = std::make_unique<EvtSemiLeptonicVectorAmp>();
break;
case EvtSpinType::TENSOR:
calcamp = std::make_unique<EvtSemiLeptonicTensorAmp>();
break;
default:;
}
}
double EvtPropSLPole::calBreitWignerBasic( double maxMass )
{
if ( _width < 0.0001 )
return 1.0;
//its not flat - but generated according to a BW
double mMin = _massMin;
double mMax = _massMax;
if ( maxMass > -0.5 && maxMass < mMax )
mMax = maxMass;
double massGood = EvtRandom::Flat( mMin, mMax );
double ampVal = sqrt(
1.0 / ( pow( massGood - _mass, 2.0 ) + pow( _width, 2.0 ) / 4.0 ) );
return ampVal;
}
double EvtPropSLPole::calBreitWigner( EvtParticle* pmeson, EvtPoint1D point )
{
EvtId mesnum = pmeson->getId();
_mass = EvtPDL::getMeanMass( mesnum );
_width = EvtPDL::getWidth( mesnum );
_maxRange = EvtPDL::getMaxRange( mesnum );
EvtSpinType::spintype mesontype = EvtPDL::getSpinType( mesnum );
_includeDecayFact = true;
_includeBirthFact = true;
_spin = mesontype;
_blatt = 3.0;
double maxdelta = 15.0 * _width;
if ( _maxRange > 0.00001 ) {
_massMax = _mass + maxdelta;
_massMin = _mass - _maxRange;
} else {
_massMax = _mass + maxdelta;
_massMin = _mass - 15.0 * _width;
}
_massMax = _mass + maxdelta;
if ( _massMin < 0. )
_massMin = 0.;
EvtParticle* par = pmeson->getParent();
double maxMass = -1.;
if ( par != nullptr ) {
if ( par->hasValidP4() )
maxMass = par->mass();
- for ( size_t i = 0; i < par->getNDaug(); i++ ) {
+ for ( std::size_t i = 0; i < par->getNDaug(); i++ ) {
EvtParticle* tDaug = par->getDaug( i );
if ( pmeson != tDaug )
maxMass -= EvtPDL::getMinMass( tDaug->getId() );
}
}
- EvtId* dauId = nullptr;
- double* dauMasses = nullptr;
- size_t nDaug = pmeson->getNDaug();
+ std::vector<EvtId> dauId;
+ std::vector<double> dauMasses;
+ const std::size_t nDaug{ pmeson->getNDaug() };
if ( nDaug > 0 ) {
- dauId = new EvtId[nDaug];
- dauMasses = new double[nDaug];
- for ( size_t j = 0; j < nDaug; j++ ) {
+ dauId.resize( nDaug );
+ dauMasses.resize( nDaug );
+ for ( std::size_t j = 0; j < nDaug; j++ ) {
dauId[j] = pmeson->getDaug( j )->getId();
dauMasses[j] = pmeson->getDaug( j )->mass();
}
}
- EvtId* parId = nullptr;
- EvtId* othDaugId = nullptr;
+ EvtId parId;
+ EvtId othDaugId;
EvtParticle* tempPar = pmeson->getParent();
if ( tempPar ) {
- parId = new EvtId( tempPar->getId() );
+ parId = tempPar->getId();
if ( tempPar->getNDaug() == 2 ) {
- if ( tempPar->getDaug( 0 ) == pmeson )
- othDaugId = new EvtId( tempPar->getDaug( 1 )->getId() );
- else
- othDaugId = new EvtId( tempPar->getDaug( 0 )->getId() );
+ if ( tempPar->getDaug( 0 ) == pmeson ) {
+ othDaugId = tempPar->getDaug( 1 )->getId();
+ } else {
+ othDaugId = tempPar->getDaug( 0 )->getId();
+ }
}
}
if ( nDaug != 2 )
return calBreitWignerBasic( maxMass );
if ( _width < 0.00001 )
return 1.0;
//first figure out L - take the lowest allowed.
EvtSpinType::spintype spinD1 = EvtPDL::getSpinType( dauId[0] );
EvtSpinType::spintype spinD2 = EvtPDL::getSpinType( dauId[1] );
int t1 = EvtSpinType::getSpin2( spinD1 );
int t2 = EvtSpinType::getSpin2( spinD2 );
int t3 = EvtSpinType::getSpin2( _spin );
int Lmin = -10;
// allow for special cases.
if ( Lmin < -1 ) {
//There are some things I don't know how to deal with
if ( t3 > 4 )
return calBreitWignerBasic( maxMass );
if ( t1 > 4 )
return calBreitWignerBasic( maxMass );
if ( t2 > 4 )
return calBreitWignerBasic( maxMass );
//figure the min and max allowwed "spins" for the daughters state
Lmin = std::max( t3 - t2 - t1, std::max( t2 - t3 - t1, t1 - t3 - t2 ) );
if ( Lmin < 0 )
Lmin = 0;
assert( Lmin == 0 || Lmin == 2 || Lmin == 4 );
}
//double massD1=EvtPDL::getMeanMass(dauId[0]);
//double massD2=EvtPDL::getMeanMass(dauId[1]);
double massD1 = dauMasses[0];
double massD2 = dauMasses[1];
// I'm not sure how to define the vertex factor here - so retreat to nonRel code.
if ( ( massD1 + massD2 ) > _mass )
return calBreitWignerBasic( maxMass );
//parent vertex factor not yet implemented
double massOthD = -10.;
double massParent = -10.;
int birthl = -10;
- if ( othDaugId ) {
- EvtSpinType::spintype spinOth = EvtPDL::getSpinType( *othDaugId );
- EvtSpinType::spintype spinPar = EvtPDL::getSpinType( *parId );
+ if ( othDaugId != EvtId{} ) {
+ EvtSpinType::spintype spinOth = EvtPDL::getSpinType( othDaugId );
+ EvtSpinType::spintype spinPar = EvtPDL::getSpinType( parId );
int tt1 = EvtSpinType::getSpin2( spinOth );
int tt2 = EvtSpinType::getSpin2( spinPar );
int tt3 = EvtSpinType::getSpin2( _spin );
//figure the min and max allowwed "spins" for the daughters state
if ( ( tt1 <= 4 ) && ( tt2 <= 4 ) ) {
birthl = std::max( tt3 - tt2 - tt1,
std::max( tt2 - tt3 - tt1, tt1 - tt3 - tt2 ) );
if ( birthl < 0 )
birthl = 0;
- massOthD = EvtPDL::getMeanMass( *othDaugId );
- massParent = EvtPDL::getMeanMass( *parId );
+ massOthD = EvtPDL::getMeanMass( othDaugId );
+ massParent = EvtPDL::getMeanMass( parId );
}
}
double massM = _massMax;
if ( ( maxMass > -0.5 ) && ( maxMass < massM ) )
massM = maxMass;
//special case... if the parent mass is _fixed_ we can do a little better
//and only for a two body decay as that seems to be where we have problems
// Define relativistic propagator amplitude
EvtTwoBodyVertex vd( massD1, massD2, _mass, Lmin / 2 );
vd.set_f( _blatt );
EvtPropBreitWignerRel bw( _mass, _width );
EvtMassAmp amp( bw, vd );
// if ( _fixMassForMax) amp.fixUpMassForMax();
// else std::cout << "problem problem\n";
if ( _includeDecayFact ) {
amp.addDeathFact();
amp.addDeathFactFF();
}
if ( massParent > -1. ) {
if ( _includeBirthFact ) {
EvtTwoBodyVertex vb( _mass, massOthD, massParent, birthl / 2 );
amp.setBirthVtx( vb );
amp.addBirthFact();
amp.addBirthFactFF();
}
}
EvtAmpPdf<EvtPoint1D> pdf( amp );
double ampVal = sqrt( pdf.evaluate( point ) );
- if ( parId )
- delete parId;
- if ( othDaugId )
- delete othDaugId;
- if ( dauId )
- delete[] dauId;
- if ( dauMasses )
- delete[] dauMasses;
-
return ampVal;
}
double EvtPropSLPole::calcMaxProb( EvtId parent, EvtId meson, EvtId lepton,
EvtId nudaug, EvtSemiLeptonicFF* FormFactors )
{
//This routine takes the arguements parent, meson, and lepton
//number, and a form factor model, and returns a maximum
//probability for this semileptonic form factor model. A
//brute force method is used. The 2D cos theta lepton and
//q2 phase space is probed.
//Start by declaring a particle at rest.
//It only makes sense to have a scalar parent. For now.
//This should be generalized later.
EvtScalarParticle* scalar_part;
EvtParticle* root_part;
scalar_part = new EvtScalarParticle;
//cludge to avoid generating random numbers!
scalar_part->noLifeTime();
EvtVector4R p_init;
p_init.set( EvtPDL::getMass( parent ), 0.0, 0.0, 0.0 );
scalar_part->init( parent, p_init );
- root_part = (EvtParticle*)scalar_part;
+ root_part = scalar_part;
// root_part->set_type(EvtSpinType::SCALAR);
root_part->setDiagonalSpinDensity();
EvtParticle *daughter, *lep, *trino;
EvtAmp amp;
EvtId listdaug[3];
listdaug[0] = meson;
listdaug[1] = lepton;
listdaug[2] = nudaug;
amp.init( parent, 3, listdaug );
root_part->makeDaughters( 3, listdaug );
daughter = root_part->getDaug( 0 );
lep = root_part->getDaug( 1 );
trino = root_part->getDaug( 2 );
EvtDecayBase* decayer;
decayer = EvtDecayTable::getInstance()->getDecayFunc( daughter );
if ( decayer ) {
daughter->makeDaughters( decayer->nRealDaughters(), decayer->getDaugs() );
for ( int ii = 0; ii < decayer->nRealDaughters(); ii++ ) {
daughter->getDaug( ii )->setMass(
EvtPDL::getMeanMass( daughter->getDaug( ii )->getId() ) );
}
}
//cludge to avoid generating random numbers!
daughter->noLifeTime();
lep->noLifeTime();
trino->noLifeTime();
//Initial particle is unpolarized, well it is a scalar so it is
//trivial
EvtSpinDensity rho;
rho.setDiag( root_part->getSpinStates() );
double mass[3];
double m = root_part->mass();
EvtVector4R p4meson, p4lepton, p4nu, p4w;
double q2max;
double q2, elepton, plepton;
int i, j;
double erho, prho, costl;
double maxfoundprob = 0.0;
double prob = -10.0;
int massiter;
for ( massiter = 0; massiter < 3; massiter++ ) {
mass[0] = EvtPDL::getMeanMass( meson );
mass[1] = EvtPDL::getMeanMass( lepton );
mass[2] = EvtPDL::getMeanMass( nudaug );
if ( massiter == 1 ) {
mass[0] = EvtPDL::getMinMass( meson );
}
if ( massiter == 2 ) {
mass[0] = EvtPDL::getMaxMass( meson );
if ( ( mass[0] + mass[1] + mass[2] ) > m )
mass[0] = m - mass[1] - mass[2] - 0.00001;
}
q2max = ( m - mass[0] ) * ( m - mass[0] );
//loop over q2
for ( i = 0; i < 25; i++ ) {
q2 = ( ( i + 0.5 ) * q2max ) / 25.0;
erho = ( m * m + mass[0] * mass[0] - q2 ) / ( 2.0 * m );
prho = sqrt( erho * erho - mass[0] * mass[0] );
p4meson.set( erho, 0.0, 0.0, -1.0 * prho );
p4w.set( m - erho, 0.0, 0.0, prho );
//This is in the W rest frame
elepton = ( q2 + mass[1] * mass[1] ) / ( 2.0 * sqrt( q2 ) );
plepton = sqrt( elepton * elepton - mass[1] * mass[1] );
double probctl[3];
for ( j = 0; j < 3; j++ ) {
costl = 0.99 * ( j - 1.0 );
//These are in the W rest frame. Need to boost out into
//the B frame.
p4lepton.set( elepton, 0.0, plepton * sqrt( 1.0 - costl * costl ),
plepton * costl );
p4nu.set( plepton, 0.0,
-1.0 * plepton * sqrt( 1.0 - costl * costl ),
-1.0 * plepton * costl );
EvtVector4R boost( ( m - erho ), 0.0, 0.0, 1.0 * prho );
p4lepton = boostTo( p4lepton, boost );
p4nu = boostTo( p4nu, boost );
//Now initialize the daughters...
daughter->init( meson, p4meson );
lep->init( lepton, p4lepton );
trino->init( nudaug, p4nu );
calcamp->CalcAmp( root_part, amp, FormFactors );
- EvtPoint1D* point = new EvtPoint1D( mass[0] );
+ EvtPoint1D point( mass[0] );
- double meson_BWAmp = calBreitWigner( daughter, *point );
+ double meson_BWAmp = calBreitWigner( daughter, point );
int list[2];
list[0] = 0;
list[1] = 0;
amp.vertex( 0, 0, amp.getAmp( list ) * meson_BWAmp );
list[0] = 0;
list[1] = 1;
amp.vertex( 0, 1, amp.getAmp( list ) * meson_BWAmp );
list[0] = 1;
list[1] = 0;
amp.vertex( 1, 0, amp.getAmp( list ) * meson_BWAmp );
list[0] = 1;
list[1] = 1;
amp.vertex( 1, 1, amp.getAmp( list ) * meson_BWAmp );
list[0] = 2;
list[1] = 0;
amp.vertex( 2, 0, amp.getAmp( list ) * meson_BWAmp );
list[0] = 2;
list[1] = 1;
amp.vertex( 2, 1, amp.getAmp( list ) * meson_BWAmp );
//Now find the probability at this q2 and cos theta lepton point
//and compare to maxfoundprob.
//Do a little magic to get the probability!!
prob = rho.normalizedProb( amp.getSpinDensity() );
probctl[j] = prob;
}
//probclt contains prob at ctl=-1,0,1.
//prob=a+b*ctl+c*ctl^2
double a = probctl[1];
double b = 0.5 * ( probctl[2] - probctl[0] );
double c = 0.5 * ( probctl[2] + probctl[0] ) - probctl[1];
prob = probctl[0];
if ( probctl[1] > prob )
prob = probctl[1];
if ( probctl[2] > prob )
prob = probctl[2];
if ( fabs( c ) > 1e-20 ) {
double ctlx = -0.5 * b / c;
if ( fabs( ctlx ) < 1.0 ) {
double probtmp = a + b * ctlx + c * ctlx * ctlx;
if ( probtmp > prob )
prob = probtmp;
}
}
//EvtGenReport(EVTGEN_DEBUG,"EvtGen") << "prob,probctl:"<<prob<<" "
// << probctl[0]<<" "
// << probctl[1]<<" "
// << probctl[2]<<endl;
if ( prob > maxfoundprob ) {
maxfoundprob = prob;
}
}
if ( EvtPDL::getWidth( meson ) <= 0.0 ) {
//if the particle is narrow dont bother with changing the mass.
massiter = 4;
}
}
root_part->deleteTree();
maxfoundprob *= 1.1;
return maxfoundprob;
}
diff --git a/src/EvtGenModels/EvtRareLbToLllFFBase.cpp b/src/EvtGenModels/EvtRareLbToLllFFBase.cpp
index 8b72ad0..21e7d22 100644
--- a/src/EvtGenModels/EvtRareLbToLllFFBase.cpp
+++ b/src/EvtGenModels/EvtRareLbToLllFFBase.cpp
@@ -1,75 +1,76 @@
/***********************************************************************
* Copyright 1998-2022 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenModels/EvtRareLbToLllFFBase.hh"
EvtRareLbToLllFFBase::FormFactors::FormFactors()
{
areZero();
}
void EvtRareLbToLllFFBase::FormFactors::areZero()
{
for ( unsigned int i = 0; i < 4; ++i ) {
F_[i] = 0;
G_[i] = 0;
FT_[i] = 0;
GT_[i] = 0;
}
}
EvtRareLbToLllFFBase::EvtRareLbToLllFFBase() :
- natural_( "Lambda0", "anti-Lambda0", "Lambda(1520)0", "anti-Lambda(1520)0",
- "Lambda(1600)0", "anti-Lambda(1600)0" )
+ natural_{ "Lambda0", "anti-Lambda0",
+ "Lambda(1520)0", "anti-Lambda(1520)0",
+ "Lambda(1600)0", "anti-Lambda(1600)0" }
{
}
bool EvtRareLbToLllFFBase::isNatural( const EvtParticle& lambda ) const
{
return natural_.contains( lambda.getId() );
}
double EvtRareLbToLllFFBase::calculateVdotV( const EvtParticle& parent,
const EvtParticle& lambda ) const
{
EvtVector4R p4parent;
p4parent.set( parent.mass(), 0, 0, 0 );
EvtVector4R p4lambda = lambda.getP4();
const double M = lambda.mass();
const double MB = parent.mass();
return p4parent.cont( p4lambda ) / ( MB * M );
// return E_Lambda/M_Lambda
}
double EvtRareLbToLllFFBase::calculateVdotV( const EvtParticle& parent,
const EvtParticle& lambda,
const double qsq ) const
{
const double M = lambda.mass();
const double MB = parent.mass();
double E = ( MB * MB - M * M - qsq ) / ( 2. * MB );
return E / M;
}
diff --git a/src/EvtGenModels/EvtSLDiBaryonAmp.cpp b/src/EvtGenModels/EvtSLDiBaryonAmp.cpp
index 60e190b..efcf4cf 100644
--- a/src/EvtGenModels/EvtSLDiBaryonAmp.cpp
+++ b/src/EvtGenModels/EvtSLDiBaryonAmp.cpp
@@ -1,435 +1,442 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenModels/EvtSLDiBaryonAmp.hh"
#include "EvtGenBase/EvtGammaMatrix.hh"
#include "EvtGenBase/EvtIdSet.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtPatches.hh"
#include "EvtGenBase/EvtRaritaSchwinger.hh"
#include "EvtGenBase/EvtReport.hh"
#include "EvtGenBase/EvtTensor4C.hh"
EvtSLDiBaryonAmp::EvtSLDiBaryonAmp( const EvtBToDiBaryonlnupQCDFF& formFactors ) :
ffModel_( formFactors )
{
}
void EvtSLDiBaryonAmp::CalcAmp( EvtParticle* parent, EvtAmp& amp ) const
{
static EvtId EM = EvtPDL::getId( "e-" );
static EvtId MUM = EvtPDL::getId( "mu-" );
static EvtId TAUM = EvtPDL::getId( "tau-" );
static EvtId EP = EvtPDL::getId( "e+" );
static EvtId MUP = EvtPDL::getId( "mu+" );
static EvtId TAUP = EvtPDL::getId( "tau+" );
// The amplitude assumes B- -> p+ p- l- nubar ordering
// i.e. the B- decay is the "particle" mode
// B charge (x3) to check for antiparticle mode and baryon daughter ordering
EvtId BId = parent->getId();
int qB3 = EvtPDL::chg3( BId );
bool particleMode( true );
// Check if we have B+ instead (antiparticle mode)
if ( qB3 > 0 ) {
particleMode = false;
}
// The baryon, charged lepton and neutrino daughters
// Make sure the first baryon has a charge opposite to the B, since the
// amplitude expressions assume this order
EvtParticle* baryon1 = parent->getDaug( 0 );
EvtParticle* baryon2 = parent->getDaug( 1 );
// Check if we need to reverse the baryon ordering
if ( EvtPDL::chg3( baryon1->getId() ) == qB3 ) {
baryon1 = parent->getDaug( 1 );
baryon2 = parent->getDaug( 0 );
}
EvtParticle* lepton = parent->getDaug( 2 );
EvtParticle* neutrino = parent->getDaug( 3 );
// 4-momenta in B rest frame
EvtVector4R p0( parent->mass(), 0.0, 0.0, 0.0 );
EvtVector4R p1 = baryon1->getP4();
EvtVector4R p2 = baryon2->getP4();
EvtVector4R pSum = p1 + p2;
EvtVector4R p = p0 - pSum;
EvtVector4R pDiff = p2 - p1;
// Particle id's: retrieve 1st baryon again in case order has changed
EvtId Id1 = baryon1->getId();
EvtId Id2 = baryon2->getId();
EvtId l_num = lepton->getId();
EvtSpinType::spintype type1 = EvtPDL::getSpinType( Id1 );
EvtSpinType::spintype type2 = EvtPDL::getSpinType( Id2 );
// Parity of B+- = -1. Check if the parity of the dibaryon state is the same.
// If so, set the sameParity integer to 1. Otherwise set it to -1,
// i.e. the dibaryon system has opposite parity to the B meson
int J1 = EvtSpinType::getSpin2( type1 );
int J2 = EvtSpinType::getSpin2( type2 );
int sameParity = this->checkDibaryonParity( Id1, Id2, J1, J2 );
// Number of chiral components of the baryon spinors
int N1 = EvtSpinType::getSpinStates( type1 );
int N2 = EvtSpinType::getSpinStates( type2 );
// Invariant mass of the two baryon particle system
double m_dibaryon = sqrt( pSum.mass2() );
// Complex number i
EvtComplex I( 0, 1 );
// Lepton currents, same for all baryon options
EvtVector4C l1, l2;
if ( l_num == EM || l_num == MUM || l_num == TAUM ) {
// B-
l1 = EvtLeptonVACurrent( lepton->spParent( 0 ),
neutrino->spParentNeutrino() );
l2 = EvtLeptonVACurrent( lepton->spParent( 1 ),
neutrino->spParentNeutrino() );
} else if ( l_num == EP || l_num == MUP || l_num == TAUP ) {
// B+
l1 = EvtLeptonVACurrent( neutrino->spParentNeutrino(),
lepton->spParent( 0 ) );
l2 = EvtLeptonVACurrent( neutrino->spParentNeutrino(),
lepton->spParent( 1 ) );
} else {
EvtGenReport( EVTGEN_ERROR, "EvtSLDiBaryonAmp" )
<< "Wrong lepton number" << std::endl;
}
// Parity multiplication factors for the antiparticle mode hadronic currents
double sign1 = ( particleMode == true ) ? 1.0 : 1.0 * sameParity;
double sign2 = ( particleMode == true ) ? 1.0 : 1.0 * sameParity;
double sign3 = ( particleMode == true ) ? 1.0 : -1.0 * sameParity;
double sign4 = ( particleMode == true ) ? 1.0 : -1.0 * sameParity;
double sign5 = ( particleMode == true ) ? 1.0 : -1.0 * sameParity;
double sign6 = ( particleMode == true ) ? 1.0 : 1.0 * sameParity;
// Define form factor coeff variables
double f1( 0.0 ), f2( 0.0 ), f3( 0.0 ), f4( 0.0 ), f5( 0.0 );
double g1( 0.0 ), g2( 0.0 ), g3( 0.0 ), g4( 0.0 ), g5( 0.0 );
// Handle case of two Dirac-type daughters, e.g. p pbar, p N(1440)
if ( type1 == EvtSpinType::DIRAC && type2 == EvtSpinType::DIRAC ) {
// Form factor parameters
EvtBToDiBaryonlnupQCDFF::FormFactors FF;
ffModel_.getDiracFF( parent, m_dibaryon, FF );
if ( sameParity == 1 ) {
f1 = FF.F1;
f2 = FF.F2;
f3 = FF.F3;
f4 = FF.F4;
f5 = FF.F5;
g1 = FF.G1;
g2 = FF.G2;
g3 = FF.G3;
g4 = FF.G4;
g5 = FF.G5;
} else {
// Swap coeffs: f_i <--> g_i
f1 = FF.G1;
f2 = FF.G2;
f3 = FF.G3;
f4 = FF.G4;
f5 = FF.G5;
g1 = FF.F1;
g2 = FF.F2;
g3 = FF.F3;
g4 = FF.F4;
g5 = FF.F5;
}
EvtVector4R gMtmTerms = g3 * p + g4 * pSum + g5 * pDiff;
EvtVector4R fMtmTerms = f3 * p + f4 * pSum + f5 * pDiff;
// First baryon
for ( int i = 0; i < N1; i++ ) {
// Get the baryon spinor in the B rest frame. Also just use u and not i*u,
// since the imaginary constant factor is not needed for the probability
EvtDiracSpinor u = baryon1->spParent( i );
// Second baryon
for ( int j = 0; j < N2; j++ ) {
EvtDiracSpinor v = baryon2->spParent( j );
// Hadronic currents
std::vector<EvtVector4C> hadCurrents =
this->getHadronicCurrents( u, v, p, gMtmTerms, fMtmTerms );
// First amplitude terms: 3rd current already has the form factor coeffs applied (gMtmTerms)
EvtVector4C amp1 = g1 * sign1 * hadCurrents[0] +
g2 * sign2 * hadCurrents[1] +
sign3 * hadCurrents[2];
// Second amplitude terms: 6th current already has the form factor coeffs applied (fMtmTerms)
EvtVector4C amp2 = f1 * sign4 * hadCurrents[3] +
f2 * sign5 * hadCurrents[4] +
sign6 * hadCurrents[5];
EvtVector4C hadAmp;
if ( sameParity == 1 ) {
hadAmp = amp1 - amp2;
} else {
hadAmp = amp2 - amp1;
}
amp.vertex( i, j, 0, l1 * hadAmp );
amp.vertex( i, j, 1, l2 * hadAmp );
} // j
} // i
} else if ( ( type1 == EvtSpinType::DIRAC &&
type2 == EvtSpinType::RARITASCHWINGER ) ||
( type1 == EvtSpinType::RARITASCHWINGER &&
type2 == EvtSpinType::DIRAC ) ) {
// Handle the case of one Dirac-type daughter (not including the leptons), e.g. one proton, and one
// Rarita-Schwinger-type (spin 3/2) daughter e.g. B -> p N(1520) l nu
// Form factor parameters
EvtBToDiBaryonlnupQCDFF::FormFactors FF;
ffModel_.getRaritaFF( parent, m_dibaryon, FF );
if ( sameParity == 1 ) {
f1 = FF.F1;
f2 = FF.F2;
f3 = FF.F3;
f4 = FF.F4;
f5 = FF.F5;
g1 = FF.G1;
g2 = FF.G2;
g3 = FF.G3;
g4 = FF.G4;
g5 = FF.G5;
} else {
// Swap coeffs: f_i <--> g_i
f1 = FF.G1;
f2 = FF.G2;
f3 = FF.G3;
f4 = FF.G4;
f5 = FF.G5;
g1 = FF.F1;
g2 = FF.F2;
g3 = FF.F3;
g4 = FF.F4;
g5 = FF.F5;
}
EvtVector4R gMtmTerms = g3 * p + g4 * pSum + g5 * pDiff;
EvtVector4R fMtmTerms = f3 * p + f4 * pSum + f5 * pDiff;
if ( type1 == EvtSpinType::DIRAC ) {
// First baryon is Dirac
for ( int i = 0; i < N1; i++ ) {
// Get the baryon spinor in the B rest frame. Also just use u and not i*u,
// since the imaginary constant factor is not needed for the probability
EvtDiracSpinor u = baryon1->spParent( i );
// Second baryon is RS-type
for ( int j = 0; j < N2; j++ ) {
EvtRaritaSchwinger vRS = baryon2->spRSParent( j );
EvtDiracSpinor v;
for ( int k = 0; k < 4; k++ ) {
v.set_spinor( k, vRS.getVector( k ) * p0 );
}
// Hadronic currents
std::vector<EvtVector4C> hadCurrents =
this->getHadronicCurrents( u, v, p, gMtmTerms, fMtmTerms );
// First amplitude terms: 3rd current already has the form factor coeffs applied (gMtmTerms)
EvtVector4C amp1 = g1 * sign1 * hadCurrents[0] +
g2 * sign2 * hadCurrents[1] +
sign3 * hadCurrents[2];
// Second amplitude terms: 6th current already has the form factor coeffs applied (fMtmTerms)
EvtVector4C amp2 = f1 * sign4 * hadCurrents[3] +
f2 * sign5 * hadCurrents[4] +
sign6 * hadCurrents[5];
EvtVector4C hadAmp;
if ( sameParity == 1 ) {
hadAmp = amp1 - amp2;
} else {
hadAmp = amp2 - amp1;
}
amp.vertex( i, j, 0, l1 * hadAmp );
amp.vertex( i, j, 1, l2 * hadAmp );
} // j
} // i
} else if ( type2 == EvtSpinType::DIRAC ) {
// Same as before, but where the first daughter is RS-type, e.g. B -> N(1520) p l nu
// First baryon is RS
for ( int i = 0; i < N1; i++ ) {
// Get the baryon spinor in the B rest frame
EvtRaritaSchwinger uRS = baryon1->spRSParent( i );
EvtDiracSpinor u;
for ( int k = 0; k < 4; k++ ) {
u.set_spinor( k, uRS.getVector( k ) * p0 );
}
// Second baryon is Dirac
for ( int j = 0; j < N2; j++ ) {
EvtDiracSpinor v = baryon2->spParent( j );
// Hadronic currents
std::vector<EvtVector4C> hadCurrents =
this->getHadronicCurrents( u, v, p, gMtmTerms, fMtmTerms );
// First amplitude terms: 3rd current already has the form factor coeffs applied (gMtmTerms)
EvtVector4C amp1 = g1 * sign1 * hadCurrents[0] +
g2 * sign2 * hadCurrents[1] +
sign3 * hadCurrents[2];
// Second amplitude terms: 6th current already has the form factor coeffs applied (fMtmTerms)
EvtVector4C amp2 = f1 * sign4 * hadCurrents[3] +
f2 * sign5 * hadCurrents[4] +
sign6 * hadCurrents[5];
EvtVector4C hadAmp;
if ( sameParity == 1 ) {
hadAmp = amp1 - amp2;
} else {
hadAmp = amp2 - amp1;
}
amp.vertex( i, j, 0, l1 * hadAmp );
amp.vertex( i, j, 1, l2 * hadAmp );
} // j
} // i
} // RS daughter check
} // Have Dirac and RS baryons
}
std::vector<EvtVector4C> EvtSLDiBaryonAmp::getHadronicCurrents(
const EvtDiracSpinor& u, const EvtDiracSpinor& v, const EvtVector4R& p,
const EvtVector4R& gMtmTerms, const EvtVector4R& fMtmTerms ) const
{
// Store the currents used in Eq 6 (in order of appearance)
std::vector<EvtVector4C> currents;
currents.reserve( 6 );
EvtDiracSpinor g5v = EvtGammaMatrix::g5() * v;
// ubar*gamma*gamma5*v
EvtVector4C current1 = EvtLeptonACurrent( u, v );
currents.push_back( current1 );
// ubar*sigma*p*gamma5*v -> [ubar*sigma*(gamma5*v)]*p
EvtTensor4C TC1 = EvtLeptonTCurrent( u, g5v );
// Contract tensor with 4-momentum
EvtVector4C current2 = TC1.cont2( p );
currents.push_back( current2 );
// ubar*p*gamma5*v; "p" = p, pSum and pDiff
EvtComplex PC1 = EvtLeptonPCurrent( u, v );
EvtVector4C current3 = PC1 * gMtmTerms;
currents.push_back( current3 );
// ubar*gamma*v
EvtVector4C current4 = EvtLeptonVCurrent( u, v );
currents.push_back( current4 );
// ubar*sigma*p*v -> [ubar*sigma*v]*p
EvtTensor4C TC2 = EvtLeptonTCurrent( u, v );
// Contract tensor with 4-momentum
EvtVector4C current5 = TC2.cont2( p );
currents.push_back( current5 );
// ubar*p*v; "p" = p, pSum and pDiff
EvtComplex S1 = EvtLeptonSCurrent( u, v );
EvtVector4C current6 = S1 * fMtmTerms;
currents.push_back( current6 );
return currents;
}
int EvtSLDiBaryonAmp::checkDibaryonParity( const EvtId& id1, const EvtId& id2,
const int J1, const int J2 ) const
{
// Get intrisic parities of the two baryons, then multiply by (-1)^|J1 - J2|.
// Note here that the J1 and J2 function arguments = 2*spin
int par1 = this->getBaryonParity( id1 );
int par2 = this->getBaryonParity( id2 );
// mult should be either 0 or 1 for allowed Dirac/RS baryon pairs
int mult = static_cast<int>( pow( -1.0, 0.5 * fabs( J1 - J2 ) ) );
int dbParity = par1 * par2 * mult;
// Initialise result to 1, i.e. dibaryon parity = B parity = -1
int result( 1 );
// Dibaryon parity is opposite to the negative B parity
if ( dbParity > 0 ) {
result = -1;
}
return result;
}
int EvtSLDiBaryonAmp::getBaryonParity( const EvtId& id ) const
{
// Initialise parity to +1
int parity( 1 );
// List of baryons with parity = +1
- static EvtIdSet posParity( "p+", "Delta+", "Lambda_c+",
- "anti-Lambda_c(2593)-", "anti-Lambda_c(2625)-",
- "N(1440)+", "anti-N(1520)-", "anti-N(1535)-",
- "anti-N(1650)-", "anti-N(1700)-", "N(1710)+",
- "N(1720)+" );
+ static EvtIdSet posParity{ "p+",
+ "Delta+",
+ "Lambda_c+",
+ "anti-Lambda_c(2593)-",
+ "anti-Lambda_c(2625)-",
+ "N(1440)+",
+ "anti-N(1520)-",
+ "anti-N(1535)-",
+ "anti-N(1650)-",
+ "anti-N(1700)-",
+ "N(1710)+",
+ "N(1720)+" };
// If the baryon id is not in the list, set the parity to -1
if ( !posParity.contains( id ) ) {
parity = -1;
}
return parity;
}
diff --git a/src/EvtGenModels/EvtTauHadnu.cpp b/src/EvtGenModels/EvtTauHadnu.cpp
index 129ed3c..dccd906 100644
--- a/src/EvtGenModels/EvtTauHadnu.cpp
+++ b/src/EvtGenModels/EvtTauHadnu.cpp
@@ -1,266 +1,266 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenModels/EvtTauHadnu.hh"
#include "EvtGenBase/EvtDiracSpinor.hh"
#include "EvtGenBase/EvtGenKine.hh"
#include "EvtGenBase/EvtIdSet.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtReport.hh"
#include "EvtGenBase/EvtVector4C.hh"
#include <iostream>
#include <stdlib.h>
#include <string>
using namespace std;
std::string EvtTauHadnu::getName()
{
return "TAUHADNU";
}
EvtDecayBase* EvtTauHadnu::clone()
{
return new EvtTauHadnu;
}
void EvtTauHadnu::init()
{
// check that there are 0 arguments
checkSpinParent( EvtSpinType::DIRAC );
//the last daughter should be a neutrino
checkSpinDaughter( getNDaug() - 1, EvtSpinType::NEUTRINO );
int i;
for ( i = 0; i < ( getNDaug() - 1 ); i++ ) {
checkSpinDaughter( i, EvtSpinType::SCALAR );
}
bool validndaug = false;
if ( getNDaug() == 4 ) {
//pipinu
validndaug = true;
checkNArg( 7 );
_beta = getArg( 0 );
_mRho = getArg( 1 );
_gammaRho = getArg( 2 );
_mRhopr = getArg( 3 );
_gammaRhopr = getArg( 4 );
_mA1 = getArg( 5 );
_gammaA1 = getArg( 6 );
}
if ( getNDaug() == 3 ) {
//pipinu
validndaug = true;
checkNArg( 5 );
_beta = getArg( 0 );
_mRho = getArg( 1 );
_gammaRho = getArg( 2 );
_mRhopr = getArg( 3 );
_gammaRhopr = getArg( 4 );
}
if ( getNDaug() == 2 ) {
//pipinu
validndaug = true;
checkNArg( 0 );
}
if ( !validndaug ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Have not yet implemented this final state in TAUHADNUKS model"
<< endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "Ndaug=" << getNDaug() << endl;
int id;
for ( id = 0; id < ( getNDaug() - 1 ); id++ )
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Daug " << id << " " << EvtPDL::name( getDaug( id ) ).c_str()
<< endl;
}
}
void EvtTauHadnu::initProbMax()
{
if ( getNDaug() == 2 )
setProbMax( 90.0 );
if ( getNDaug() == 3 )
setProbMax( 2500.0 );
if ( getNDaug() == 4 )
setProbMax( 30000.0 );
}
void EvtTauHadnu::decay( EvtParticle* p )
{
static EvtId TAUM = EvtPDL::getId( "tau-" );
- EvtIdSet thePis( "pi+", "pi-", "pi0" );
- EvtIdSet theKs( "K+", "K-" );
+ EvtIdSet thePis{ "pi+", "pi-", "pi0" };
+ EvtIdSet theKs{ "K+", "K-" };
p->initializePhaseSpace( getNDaug(), getDaugs() );
EvtParticle* nut;
nut = p->getDaug( getNDaug() - 1 );
p->getDaug( 0 )->getP4();
//get the leptonic current
EvtVector4C tau1, tau2;
if ( p->getId() == TAUM ) {
tau1 = EvtLeptonVACurrent( nut->spParentNeutrino(), p->sp( 0 ) );
tau2 = EvtLeptonVACurrent( nut->spParentNeutrino(), p->sp( 1 ) );
} else {
tau1 = EvtLeptonVACurrent( p->sp( 0 ), nut->spParentNeutrino() );
tau2 = EvtLeptonVACurrent( p->sp( 1 ), nut->spParentNeutrino() );
}
EvtVector4C hadCurr;
bool foundHadCurr = false;
if ( getNDaug() == 2 ) {
hadCurr = p->getDaug( 0 )->getP4();
foundHadCurr = true;
}
if ( getNDaug() == 3 ) {
//pi pi0 nu with rho and rhopr resonance
if ( thePis.contains( getDaug( 0 ) ) && thePis.contains( getDaug( 1 ) ) ) {
EvtVector4R q1 = p->getDaug( 0 )->getP4();
EvtVector4R q2 = p->getDaug( 1 )->getP4();
double m1 = q1.mass();
double m2 = q2.mass();
hadCurr = Fpi( ( q1 + q2 ).mass2(), m1, m2 ) * ( q1 - q2 );
foundHadCurr = true;
}
}
if ( getNDaug() == 4 ) {
if ( thePis.contains( getDaug( 0 ) ) && thePis.contains( getDaug( 1 ) ) &&
thePis.contains( getDaug( 2 ) ) ) {
//figure out which is the different charged pi
//want it to be q3
int diffPi( 0 ), samePi1( 0 ), samePi2( 0 );
if ( getDaug( 0 ) == getDaug( 1 ) ) {
diffPi = 2;
samePi1 = 0;
samePi2 = 1;
}
if ( getDaug( 0 ) == getDaug( 2 ) ) {
diffPi = 1;
samePi1 = 0;
samePi2 = 2;
}
if ( getDaug( 1 ) == getDaug( 2 ) ) {
diffPi = 0;
samePi1 = 1;
samePi2 = 2;
}
EvtVector4R q1 = p->getDaug( samePi1 )->getP4();
EvtVector4R q2 = p->getDaug( samePi2 )->getP4();
EvtVector4R q3 = p->getDaug( diffPi )->getP4();
double m1 = q1.mass();
double m2 = q2.mass();
double m3 = q3.mass();
EvtVector4R Q = q1 + q2 + q3;
double Q2 = Q.mass2();
double _mA12 = _mA1 * _mA1;
double _gammaA1X = _gammaA1 * gFunc( Q2, samePi1 ) /
gFunc( _mA12, samePi1 );
EvtComplex denBW_A1( _mA12 - Q2, -1. * _mA1 * _gammaA1X );
EvtComplex BW_A1 = _mA12 / denBW_A1;
hadCurr = BW_A1 *
( ( ( q1 - q3 ) - ( Q * ( Q * ( q1 - q3 ) ) / Q2 ) ) *
Fpi( ( q1 + q3 ).mass2(), m1, m3 ) +
( ( q2 - q3 ) - ( Q * ( Q * ( q2 - q3 ) ) / Q2 ) ) *
Fpi( ( q2 + q3 ).mass2(), m2, m3 ) );
foundHadCurr = true;
}
}
if ( !foundHadCurr ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Have not yet implemented this final state in TAUHADNUKS model"
<< endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "Ndaug=" << getNDaug() << endl;
int id;
for ( id = 0; id < ( getNDaug() - 1 ); id++ )
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Daug " << id << " " << EvtPDL::name( getDaug( id ) ).c_str()
<< endl;
}
vertex( 0, tau1 * hadCurr );
vertex( 1, tau2 * hadCurr );
return;
}
double EvtTauHadnu::gFunc( double Q2, int dupD )
{
double mpi = EvtPDL::getMeanMass( getDaug( dupD ) );
double mpi2 = pow( mpi, 2. );
if ( Q2 < pow( _mRho + mpi, 2. ) ) {
double arg = Q2 - 9. * mpi2;
return 4.1 * pow( arg, 3. ) * ( 1. - 3.3 * arg + 5.8 * pow( arg, 2. ) );
} else
return Q2 * ( 1.623 + 10.38 / Q2 - 9.32 / pow( Q2, 2. ) +
0.65 / pow( Q2, 3. ) );
}
EvtComplex EvtTauHadnu::Fpi( double s, double xm1, double xm2 )
{
EvtComplex BW_rho = BW( s, _mRho, _gammaRho, xm1, xm2 );
EvtComplex BW_rhopr = BW( s, _mRhopr, _gammaRhopr, xm1, xm2 );
return ( BW_rho + _beta * BW_rhopr ) / ( 1. + _beta );
}
EvtComplex EvtTauHadnu::BW( double s, double m, double gamma, double xm1,
double xm2 )
{
double m2 = pow( m, 2. );
if ( s > pow( xm1 + xm2, 2. ) ) {
double qs = sqrt( fabs( ( s - pow( xm1 + xm2, 2. ) ) *
( s - pow( xm1 - xm2, 2. ) ) ) ) /
sqrt( s );
double qm = sqrt( fabs( ( m2 - pow( xm1 + xm2, 2. ) ) *
( m2 - pow( xm1 - xm2, 2. ) ) ) ) /
m;
gamma *= m2 / s * pow( qs / qm, 3. );
} else
gamma = 0.;
EvtComplex denBW( m2 - s, -1. * sqrt( s ) * gamma );
return m2 / denBW;
}
diff --git a/src/EvtGenModels/EvtbTosllScalarAmp.cpp b/src/EvtGenModels/EvtbTosllScalarAmp.cpp
index 8bdf2d2..9daf336 100644
--- a/src/EvtGenModels/EvtbTosllScalarAmp.cpp
+++ b/src/EvtGenModels/EvtbTosllScalarAmp.cpp
@@ -1,157 +1,157 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenModels/EvtbTosllScalarAmp.hh"
#include "EvtGenBase/EvtAmp.hh"
#include "EvtGenBase/EvtConst.hh"
#include "EvtGenBase/EvtDiracSpinor.hh"
#include "EvtGenBase/EvtGenKine.hh"
#include "EvtGenBase/EvtId.hh"
#include "EvtGenBase/EvtIdSet.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtPatches.hh"
#include "EvtGenBase/EvtReport.hh"
#include "EvtGenBase/EvtTensor4C.hh"
#include "EvtGenBase/EvtVector4C.hh"
#include "EvtGenModels/EvtbTosllAmp.hh"
#include "EvtGenModels/EvtbTosllFF.hh"
void EvtbTosllScalarAmp::CalcAmp( EvtParticle* parent, EvtAmp& amp,
EvtbTosllFF* formFactors )
{
//Add the lepton and neutrino 4 momenta to find q2
EvtVector4R q = parent->getDaug( 1 )->getP4() + parent->getDaug( 2 )->getP4();
double q2 = ( q.mass2() );
double fp( 0. ), f0( 0. ), ft( 0. );
double mesonmass = parent->getDaug( 0 )->mass();
double parentmass = parent->mass();
formFactors->getScalarFF( parent->getId(), parent->getDaug( 0 )->getId(),
q2, mesonmass, fp, f0, ft );
EvtId daught = parent->getDaug( 0 )->getId();
bool btod = false;
bool nnlo = true;
if ( daught == EvtPDL::getId( std::string( "pi+" ) ) ||
daught == EvtPDL::getId( std::string( "pi-" ) ) ||
daught == EvtPDL::getId( std::string( "pi0" ) ) ||
daught == EvtPDL::getId( std::string( "eta" ) ) ||
daught == EvtPDL::getId( std::string( "eta'" ) ) )
btod = true;
EvtVector4R p4b;
p4b.set( parent->mass(), 0.0, 0.0, 0.0 );
EvtVector4C l11, l12;
EvtVector4C l21, l22;
EvtVector4C a11, a12;
EvtVector4C a21, a22;
EvtId l_num = parent->getDaug( 1 )->getId();
EvtVector4C T1, T2;
EvtVector4R phat = p4b / parentmass;
EvtVector4R qhat = q / parentmass;
EvtComplex c7eff = EvtbTosllAmp::GetC7Eff( q2, nnlo );
EvtComplex c9eff = EvtbTosllAmp::GetC9Eff( q2, nnlo, btod );
EvtComplex c10eff = EvtbTosllAmp::GetC10Eff( q2, nnlo );
//double mbhat=1;
double mbhat = 4.4 / ( parentmass );
//double mkhat = 0.15;
double mkhat = mesonmass / ( parentmass );
double shat = q2 / ( parentmass * parentmass );
double fm = ( f0 - fp ) * ( 1 - mkhat * mkhat ) / shat;
EvtComplex aprime;
aprime = c9eff * fp + 2.0 * mbhat * c7eff * ft / ( 1 + mkhat );
EvtComplex bprime;
bprime = c9eff * fm - 2 * mbhat * c7eff * ft * ( 1 - mkhat ) / shat;
EvtComplex cprime;
cprime = c10eff * fp;
EvtComplex dprime;
dprime = c10eff * fm;
- static EvtIdSet leptons( "e-", "mu-", "tau-" );
- static EvtIdSet antileptons( "e+", "mu+", "tau+" );
+ static EvtIdSet leptons{ "e-", "mu-", "tau-" };
+ static EvtIdSet antileptons{ "e+", "mu+", "tau+" };
if ( leptons.contains( l_num ) ) {
T1 = aprime * phat + bprime * qhat;
T2 = cprime * phat + dprime * qhat;
l11 = EvtLeptonVCurrent( parent->getDaug( 1 )->spParent( 0 ),
parent->getDaug( 2 )->spParent( 0 ) );
l21 = EvtLeptonVCurrent( parent->getDaug( 1 )->spParent( 1 ),
parent->getDaug( 2 )->spParent( 0 ) );
l12 = EvtLeptonVCurrent( parent->getDaug( 1 )->spParent( 0 ),
parent->getDaug( 2 )->spParent( 1 ) );
l22 = EvtLeptonVCurrent( parent->getDaug( 1 )->spParent( 1 ),
parent->getDaug( 2 )->spParent( 1 ) );
a11 = EvtLeptonACurrent( parent->getDaug( 1 )->spParent( 0 ),
parent->getDaug( 2 )->spParent( 0 ) );
a21 = EvtLeptonACurrent( parent->getDaug( 1 )->spParent( 1 ),
parent->getDaug( 2 )->spParent( 0 ) );
a12 = EvtLeptonACurrent( parent->getDaug( 1 )->spParent( 0 ),
parent->getDaug( 2 )->spParent( 1 ) );
a22 = EvtLeptonACurrent( parent->getDaug( 1 )->spParent( 1 ),
parent->getDaug( 2 )->spParent( 1 ) );
} else {
if ( antileptons.contains( l_num ) ) {
T1 = aprime * phat + bprime * qhat;
T2 = cprime * phat + dprime * qhat;
l11 = EvtLeptonVCurrent( parent->getDaug( 1 )->spParent( 1 ),
parent->getDaug( 2 )->spParent( 1 ) );
l21 = EvtLeptonVCurrent( parent->getDaug( 1 )->spParent( 0 ),
parent->getDaug( 2 )->spParent( 1 ) );
l12 = EvtLeptonVCurrent( parent->getDaug( 1 )->spParent( 1 ),
parent->getDaug( 2 )->spParent( 0 ) );
l22 = EvtLeptonVCurrent( parent->getDaug( 1 )->spParent( 0 ),
parent->getDaug( 2 )->spParent( 0 ) );
a11 = EvtLeptonACurrent( parent->getDaug( 1 )->spParent( 1 ),
parent->getDaug( 2 )->spParent( 1 ) );
a21 = EvtLeptonACurrent( parent->getDaug( 1 )->spParent( 0 ),
parent->getDaug( 2 )->spParent( 1 ) );
a12 = EvtLeptonACurrent( parent->getDaug( 1 )->spParent( 1 ),
parent->getDaug( 2 )->spParent( 0 ) );
a22 = EvtLeptonACurrent( parent->getDaug( 1 )->spParent( 0 ),
parent->getDaug( 2 )->spParent( 0 ) );
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "Wrong lepton number\n";
}
}
amp.vertex( 0, 0, l11 * T1 + a11 * T2 );
amp.vertex( 0, 1, l12 * T1 + a12 * T2 );
amp.vertex( 1, 0, l21 * T1 + a21 * T2 );
amp.vertex( 1, 1, l22 * T1 + a22 * T2 );
}
diff --git a/src/EvtGenModels/EvtbTosllScalarAmpNew.cpp b/src/EvtGenModels/EvtbTosllScalarAmpNew.cpp
index c3f2de7..90e9b99 100644
--- a/src/EvtGenModels/EvtbTosllScalarAmpNew.cpp
+++ b/src/EvtGenModels/EvtbTosllScalarAmpNew.cpp
@@ -1,938 +1,938 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenModels/EvtbTosllScalarAmpNew.hh"
#include "EvtGenBase/EvtAmp.hh"
#include "EvtGenBase/EvtComplex.hh"
#include "EvtGenBase/EvtDiracSpinor.hh"
#include "EvtGenBase/EvtGenKine.hh"
#include "EvtGenBase/EvtId.hh"
#include "EvtGenBase/EvtIdSet.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtPatches.hh"
#include "EvtGenBase/EvtReport.hh"
#include "EvtGenBase/EvtScalarParticle.hh"
#include "EvtGenBase/EvtTensor4C.hh"
#include "EvtGenBase/EvtVector4C.hh"
#include "EvtGenModels/EvtbTosllAmpNew.hh"
#include "EvtGenModels/EvtbTosllFFNew.hh"
#include "EvtGenModels/EvtbTosllWilsCoeffNLO.hh"
#include <cstdlib>
//
// The main functiom for the amplitude calculation
//
// input: *parent - the pointer to the parent particle (B-meson, the
// object of the EvtParticle class);
// *formFactors - the pointer to instance of EvtbTosllFFNew class object;
// *WilsCoeff - the pointer to
// mu - the scale parameter, GeV;
// Nf - number of "effective" flavors (for b-quark Nf=5);
// res_swch - resonant switching parameter:
// = 0 the resonant contribution switched OFF,
// = 1 the resonant contribution switched ON;
// ias - switching parameter for \alpha_s(M_Z) value:
// = 0 PDG 1sigma minimal alpha_s(M_Z),
// = 1 PDG average value alpha_s(M_Z),
// = 2 PDG 1sigma maximal alpha_s(M_Z).
// Wolfenstein parameterization for CKM matrix
// CKM_A, CKM_lambda, CKM_barrho, CKM_bareta
//
// return: amp - amplitude for the decay B -> P ell^+ ell^-
//
// Note: in our calculations we assume, that pseudoscalar meson is the first
// daughter particle (iP=0) and leptons are the second and thirds
// daughter particles (il1=1 and il2=2).
//
void EvtbTosllScalarAmpNew::CalcAmp( EvtParticle* parent, EvtAmp& amp,
EvtbTosllFFNew* formFactors,
EvtbTosllWilsCoeffNLO* WilsCoeff,
double mu, int Nf, int res_swch, int ias,
double CKM_A, double CKM_lambda,
double CKM_barrho, double CKM_bareta )
{
// FILE *mytest;
EvtComplex unit1( 1.0, 0.0 ); // real unit
EvtComplex uniti( 0.0, 1.0 ); // imaginary unit
int iP = 0; // pseudoscalar meson is the first daughter particle
int il1 = 1,
il2 = 2; // leptons are the second and thirds daughter particles
// transition momentum of the leptonic pair q=k1+k2 or q=p1-p2
EvtVector4R q = parent->getDaug( il1 )->getP4() +
parent->getDaug( il2 )->getP4();
// Mandelstam variable t=q^2
double q2 = q.mass2();
double M1 = parent->mass(); // B - meson mass
double M2 = parent->getDaug( iP )->mass(); // pseudoscalar meson mass
double ml = parent->getDaug( il1 )->mass(); // leptonic mass
double ms = 0.0; // light quark mass from the dispersion QM
double mc = formFactors->getQuarkMass( 4 ); // m_c mass from the dispersion QM
double mb = formFactors->getQuarkMass( 5 ); // m_b mass from the dispersion QM
// double Mw = EvtPDL::getNominalMass("W+"); // W-boson mass
// double mt = EvtPDL::getNominalMass("t"); // t-quark mass
double Mw = 80.403; // GeV W-boson mass
double mt = 174.2; // GeV t-quark mass
EvtComplex Vtb, Vtq, Vub, Vuq; // V_{tb}, V_{tq}, V_{ub} and V_{uq}
EvtComplex CKM_factor; // V^*_{tq}*V_{tb}, where q={d,s}
EvtComplex lambda_qu; // V^*_{uq}*V_{ub}/V^*_{tq}*V_{tb}, where q={d,s}
double Relambda_qu, Imlambda_qu;
EvtId idparent = parent->getId(); // B-meson Id
EvtId iddaught = parent->getDaug( iP )->getId(); // The pseudoscalar meson Id
// set of the light quark mass value
if ( ( idparent == EvtPDL::getId( std::string( "B+" ) ) &&
iddaught == EvtPDL::getId( std::string( "K+" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B-" ) ) &&
iddaught == EvtPDL::getId( std::string( "K-" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "K0" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "anti-K0" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B_s0" ) ) &&
iddaught == EvtPDL::getId( std::string( "eta" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B_s0" ) ) &&
iddaught == EvtPDL::getId( std::string( "eta" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B_s0" ) ) &&
iddaught == EvtPDL::getId( std::string( "eta'" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B_s0" ) ) &&
iddaught == EvtPDL::getId( std::string( "eta'" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B_s0" ) ) &&
iddaught == EvtPDL::getId( std::string( "f_0" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B_s0" ) ) &&
iddaught == EvtPDL::getId( std::string( "f_0" ) ) ) ) {
ms = formFactors->getQuarkMass( 3 ); // m_s mass from the dispersion QM
// V_{ts}
Vtq = unit1 * ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) ) +
pow( CKM_lambda, 2.0 ) *
( CKM_barrho * unit1 + CKM_bareta * uniti ) /
sqrt( 1.0 - pow( CKM_lambda, 2.0 ) );
Vtq = -CKM_A * pow( CKM_lambda, 2.0 ) * Vtq;
// V_{us}
Vuq = CKM_lambda * unit1;
// EvtGenReport(EVTGEN_ERROR,"EvtGen")
// << "\n\n In the function EvtbTosllScalarAmpNew::CalcScalarMaxProb(...)"
// << "\n ms = " << ms
// << "\n idparent = " << idparent << ", " << EvtPDL::getId(std::string("B_s0"))
// << "\n iddaught = " << iddaught << ", " << EvtPDL::getId(std::string("f_0"))
// << std::endl;
}
if ( ( idparent == EvtPDL::getId( std::string( "B+" ) ) &&
iddaught == EvtPDL::getId( std::string( "pi+" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B-" ) ) &&
iddaught == EvtPDL::getId( std::string( "pi-" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "pi0" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "pi0" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "eta" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "eta" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "eta'" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "eta'" ) ) ) ) {
ms = formFactors->getQuarkMass( 2 ); // m_d mass from the dispersion QM
// V_{td}
Vtq = unit1 - ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) ) *
( CKM_barrho * unit1 + CKM_bareta * uniti ) /
sqrt( 1.0 - pow( CKM_lambda, 2.0 ) );
Vtq = CKM_A * pow( CKM_lambda, 3.0 ) * Vtq;
// V_{ud}
Vuq = unit1 * ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) -
0.125 * pow( CKM_lambda, 4.0 ) );
}
if ( ms < 0.001 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function EvtbTosllScalarAmpNew::CalcAmp(...)"
<< "\n Error in the model set!"
<< " ms = " << ms << std::endl;
::abort();
}
Vtb = unit1 * ( 1.0 - 0.5 * pow( CKM_A * CKM_lambda * CKM_lambda,
2.0 ) ); // V_{tb}
Vub = CKM_A * pow( CKM_lambda, 3.0 ) *
( CKM_barrho * unit1 - CKM_bareta * uniti ) /
sqrt( 1.0 - pow( CKM_lambda, 2.0 ) ); // V_{ub}
CKM_factor = conj( Vtq ) * Vtb; // V^*_{tq}*V_{tb}
lambda_qu = conj( Vuq ) * Vub /
CKM_factor; // V^*_{uq}*V_{ub}/V^*_{tq}*V_{tb}
Relambda_qu = real( lambda_qu );
Imlambda_qu = imag( lambda_qu );
double fp, f0, ft; // B -> P transition form-factors
// To get the B -> P transition form-factors
formFactors->getScalarFF( parent->getId(), parent->getDaug( iP )->getId(),
q2, fp, f0, ft );
// The Wilson Coefficients preparation according to the paper
// A.J.Buras, M.Munz, Phys.Rev.D52, p.189 (1995)
EvtComplex c7gam = WilsCoeff->GetC7Eff( mu, Mw, mt, Nf, ias );
EvtComplex c9eff_b2q = WilsCoeff->GetC9Eff( 0, res_swch, ias, Nf, q2, mb,
ms, mc, mu, mt, Mw, ml,
Relambda_qu, Imlambda_qu );
EvtComplex c9eff_barb2barq = WilsCoeff->GetC9Eff( 1, res_swch, ias, Nf, q2,
mb, ms, mc, mu, mt, Mw, ml,
Relambda_qu, Imlambda_qu );
EvtComplex c10a = WilsCoeff->GetC10Eff( mt, Mw );
// EvtGenReport(EVTGEN_NOTICE,"EvtGen") << "\n\n The function EvtbTosllScalarAmpNew::CalcAmp(...) passed."
// << "\n Particle masses:"
// << "\n B - meson mass M1 = " << M1
// << "\n P - meson mass M2 = " << M2
// << "\n leptonic mass ml = " << ml
// << "\n light quark mass = " << ms
// << "\n c - quark mass mc = " << mc
// << "\n b - quark mass mb = " << mb
// << "\n t - quark mass mt = " << mt
// << "\n W - boson mass Mw = " << Mw
// << "\n ============================================================================"
// << "\n Input parameters:"
// << "\n scale parameter mu = " << mu
// << "\n number of flavors Nf = " << Nf
// << "\n resonant switching = " << res_swch
// << "\n parameter for alpha_s(M_Z) = " << ias
// << "\n ============================================================================"
// << "\n Vector form-factors at q^2 = " << q2
// << " for B -> P transition:"
// << "\n fp = " << fp
// << "\n f0 = " << f0
// << "\n ft = " << ft
// << "\n ============================================================================"
// << "\n Wilson Coefficients:"
// << "\n Re(c7gam) = " << real(c7gam) << " Im(c7gam) = " << imag(c7gam)
// << "\n Re(c9eff_b2q) = " << real(c9eff_b2q)
// << " Im(c9eff_b2q) = " << imag(c9eff_b2q)
// << "\n Re(c9eff_barb2barq) = " << real(c9eff_barb2barq)
// << " Im(c9eff_barb2barq) = " << imag(c9eff_barb2barq)
// << "\n Re(c10a) = " << real(c10a) << " Im(c10a) = " << imag(c10a)
// << std::endl;
// mytest = fopen("scalaroutput.txt","a");
// if(mytest != NULL){
// fprintf(mytest,"%lf\n",q2);
// fclose(mytest);
// }
// else{
// EvtGenReport(EVTGEN_ERROR,"EvtGen") << "\n Error in writing to file.\n"
// << std::endl;
// return;
// }
// 4- momentum of the B-meson in the the B-meson rest frame
EvtVector4R p1 = parent->getP4Restframe();
EvtVector4R hatp1 = p1 / M1;
// 4-momentum of the pseudoscalar meson in the B-meson rest frame
EvtVector4R p2 = parent->getDaug( 0 )->getP4();
EvtVector4R hatp2 = p2 / M1;
// 4-vector \hat q = q/M1
EvtVector4R hatq = q / M1;
// 4-vector \hat P= (p1 + p2)/M1
EvtVector4R hatP = hatp1 + hatp2;
double hats = q2 / pow( M1, 2 );
double hatM2 = M2 / M1;
double hatmb = mb / M1;
double hatms = ms / M1;
// Hadronic matrix element with m_s.NE.0
EvtComplex a_b2q, a_barb2barq, b_b2q, b_barb2barq, c, d;
a_b2q = c9eff_b2q * fp -
2.0 * c7gam * ( hatmb + hatms ) * ft / ( 1.0 + hatM2 );
a_barb2barq = c9eff_barb2barq * fp -
2.0 * c7gam * ( hatmb + hatms ) * ft / ( 1.0 + hatM2 );
b_b2q = ( c9eff_b2q * ( f0 - fp ) +
2.0 * c7gam * ( hatmb + hatms ) * ft / ( 1.0 + hatM2 ) ) *
( 1 - pow( hatM2, 2.0 ) ) / hats;
b_barb2barq = ( c9eff_barb2barq * ( f0 - fp ) +
2.0 * c7gam * ( hatmb + hatms ) * ft / ( 1.0 + hatM2 ) ) *
( 1 - pow( hatM2, 2.0 ) ) / hats;
c = c10a * fp;
d = c10a * ( 1.0 - pow( hatM2, 2 ) ) * ( f0 - fp ) / hats;
// to find ell^+ and ell^- in the B-meson daughters
int charge1 = EvtPDL::chg3( parent->getDaug( 1 )->getId() );
int charge2 = EvtPDL::chg3( parent->getDaug( 2 )->getId() );
EvtParticle* lepPlus = nullptr;
EvtParticle* lepMinus = nullptr;
lepPlus = ( charge1 > charge2 ) ? parent->getDaug( 1 ) : parent->getDaug( 2 );
lepMinus = ( charge1 < charge2 ) ? parent->getDaug( 1 )
: parent->getDaug( 2 );
EvtVector4C T1, T2; // hadronic matrix element vector structures
EvtVector4C lvc11, lvc12; // spin structures for
EvtVector4C lvc21, lvc22; // the leptonic vector current
EvtVector4C lac11, lac12; // spin structures for
EvtVector4C lac21, lac22; // the leptonic axial current
// B - and barB - mesons descriptors
- EvtIdSet bmesons( "B-", "anti-B0", "anti-B_s0", "B_c-" );
- EvtIdSet bbarmesons( "B+", "B0", "B_s0", "B_c+" );
+ EvtIdSet bmesons{ "B-", "anti-B0", "anti-B_s0", "B_c-" };
+ EvtIdSet bbarmesons{ "B+", "B0", "B_s0", "B_c+" };
EvtId parentID = parent->getId();
if ( bmesons.contains( parentID ) ) {
// The amplitude for the decay barB -> barP ell^+ ell^-
// (b -> q ell^+ ell^- transition)
T1 = a_b2q * hatP + b_b2q * hatq;
T2 = c * hatP + d * hatq;
lvc11 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
lvc21 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lvc12 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lvc22 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
lac11 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
lac21 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lac12 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lac22 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
amp.vertex( 0, 0, CKM_factor * ( lvc11 * T1 + lac11 * T2 ) );
amp.vertex( 0, 1, CKM_factor * ( lvc12 * T1 + lac12 * T2 ) );
amp.vertex( 1, 0, CKM_factor * ( lvc21 * T1 + lac21 * T2 ) );
amp.vertex( 1, 1, CKM_factor * ( lvc22 * T1 + lac22 * T2 ) );
} else {
if ( bbarmesons.contains( parentID ) ) {
// The amplitude for the decay B -> K* ell^+ ell^-
// (barb -> barq ell^+ ell^- transition)
T1 = a_barb2barq * hatP + b_barb2barq * hatq;
T2 = c * hatP + d * hatq;
lvc11 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
lvc21 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lvc12 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lvc22 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
lac11 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
lac21 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lac12 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lac22 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
amp.vertex( 0, 0, conj( CKM_factor ) * ( lvc11 * T1 + lac11 * T2 ) );
amp.vertex( 0, 1, conj( CKM_factor ) * ( lvc12 * T1 + lac12 * T2 ) );
amp.vertex( 1, 0, conj( CKM_factor ) * ( lvc21 * T1 + lac21 * T2 ) );
amp.vertex( 1, 1, conj( CKM_factor ) * ( lvc22 * T1 + lac22 * T2 ) );
}
else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function EvtbTosllScalarAmpNew::CalcAmp(...)"
<< "\n Wrong B-meson number" << std::endl;
::abort();
}
}
}
//
// The decays B -> P ell^+ ell^- maximum probability calculation for the
// d^2\Gamma/dq^2 d\cos\theta distribution.
//
// \theta - the angle between the final P-meson and ell^- directions in the
// B-meson rest frame.
//
// If ias=0 (nonresonant case), the maximum is achieved at (s,t) plane!
// If ias=1 (resonant case), the maximum is achieved at q2=M^2_{J/\psi}.
//
double EvtbTosllScalarAmpNew::CalcMaxProb(
EvtId parnum, EvtId mesnum, EvtId l1num, EvtId l2num,
EvtbTosllFFNew* formFactors, EvtbTosllWilsCoeffNLO* WilsCoeff, double mu,
int Nf, int res_swch, int ias, double CKM_A, double CKM_lambda,
double CKM_barrho, double CKM_bareta )
{
double maxfoundprob = -100.0; // maximum of the probability
double M1 = EvtPDL::getMeanMass( parnum ); // B - meson mass
double M2 = EvtPDL::getMeanMass( mesnum ); // P - meson mass
double ml = EvtPDL::getMeanMass( l1num ); // leptonic mass
if ( res_swch == 0 ) {
double s, t_for_s; // Mandelstam variables
double s_min, s_max; // s-variable boundaries
double t_plus, t_minus; // t-variable boundaries for current s-variable
double ds, dt;
int j, k;
int max_j, max_k;
s_min = 4.0 * pow( ml, 2.0 ); // minimum value of s-variable
s_max = pow( ( M1 - M2 ), 2.0 ); // maximum value of s-variable
max_j = 1000;
ds = ( s_max - s_min ) / ( (double)max_j );
if ( ds < 0.0 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbTosllScalarAmpNew::CalcScalarMaxProb(...)"
<< "\n ds = " << ds << " < 0."
<< "\n s_min = " << s_min << "\n s_max = " << s_max
<< "\n M1 = " << M1 << "\n M2 = " << M2
<< "\n ml = " << ml << std::endl;
::abort();
}
// The maximum probability calculation
// from s_min to s_max
for ( j = max_j / 3; j < max_j; j++ ) {
s = s_min + ds * ( (double)j );
t_plus = pow( M1, 2.0 ) + pow( M2, 2.0 ) + 2.0 * pow( ml, 2.0 ) - s;
t_plus = t_plus +
sqrt( 1.0 - 4.0 * pow( ml, 2.0 ) / s ) *
sqrt( lambda( s, pow( M1, 2.0 ), pow( M2, 2.0 ) ) );
t_plus *= 0.5;
t_minus = pow( M1, 2.0 ) + pow( M2, 2.0 ) + 2.0 * pow( ml, 2.0 ) - s;
t_minus = t_minus -
sqrt( 1.0 - 4.0 * pow( ml, 2.0 ) / s ) *
sqrt( lambda( s, pow( M1, 2.0 ), pow( M2, 2.0 ) ) );
t_minus *= 0.5;
max_k = 1000;
dt = ( t_plus - t_minus ) / ( (double)max_k );
if ( fabs( dt ) < 0.00001 )
dt = 0.0;
if ( dt <= ( -0.00001 ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbTosllScalarAmpNew::CalcScalarMaxProb(...)"
<< "\n dt = " << dt << " < 0."
<< "\n s = " << s << "\n s_min = " << s_min
<< "\n s_max = " << s_max << "\n ds = " << ds
<< "\n j = " << j << "\n t_plus = " << t_plus
<< "\n t_minus = " << t_minus << "\n M1 = " << M1
<< "\n M2 = " << M2 << "\n ml = " << ml
<< std::endl;
::abort();
}
// from t_minus to t_plus
for ( k = 0; k < max_k; k++ ) {
t_for_s = t_minus + dt * ( (double)k );
if ( ( t_for_s > t_plus ) && ( t_for_s <= ( 1.0001 * t_plus ) ) ) {
t_for_s = t_plus;
}
if ( t_for_s > ( 1.0001 * t_plus ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbTosllScalarAmpNew::CalcScalarMaxProb(...)"
<< "\n t_for_s = " << t_for_s
<< " > t_plus = " << t_plus << " ! "
<< "\n t_minus = " << t_minus << "\n dt = " << dt
<< "\n k = " << k << "\n s = " << s
<< "\n M1 = " << M1 << "\n M2 = " << M2
<< "\n ml = " << ml << std::endl;
::abort();
}
// B-meson rest frame particles and they kinematics inicialization
double EV, El1, El2;
EV = ( pow( M1, 2.0 ) + pow( M2, 2.0 ) - s ) /
( 2.0 * M1 ); // P-meson energy
if ( EV < M2 ) {
EV = 1.0000001 * M2;
}
El1 = ( pow( M1, 2.0 ) + pow( ml, 2.0 ) - t_for_s ) /
( 2.0 * M1 ); // ell^+ energy
if ( El1 < ml ) {
El1 = 1.0000001 * ml;
}
El2 = ( s + t_for_s - pow( M2, 2.0 ) - pow( ml, 2.0 ) ) /
( 2.0 * M1 ); // ell^- energy
if ( El2 < ml ) {
El2 = 1.0000001 * ml;
}
double modV, modl2;
modV = sqrt( pow( EV, 2.0 ) - pow( M2, 2.0 ) );
modl2 = sqrt( pow( El2, 2.0 ) - pow( ml, 2.0 ) );
double cosVellminus; // angle between the P-meson and ell^- directions
cosVellminus = ( pow( M2, 2.0 ) + pow( ml, 2.0 ) +
2.0 * EV * El2 - t_for_s ) /
( 2.0 * modV * modl2 );
if ( ( fabs( cosVellminus ) > 1.0 ) &&
( fabs( cosVellminus ) <= 1.0001 ) ) {
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n Debug in the function EvtbTosllScalarAmpNew::CalcMaxProb(...):"
// << "\n cos(theta) = " << cosVellminus
// << std::endl;
cosVellminus = cosVellminus / fabs( cosVellminus );
}
if ( ( modV <= 0.000001 ) || ( modl2 <= 0.000001 ) ) {
cosVellminus = cosVellminus / fabs( cosVellminus );
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n Debug in the function EvtbTosllScalarAmpNew::CalcMaxProb(...):"
// << "\n modV = " << modV
// << "\n modl2 = " << modl2
// << "\n cos(theta) = " << cosVellminus
// << "\n s = " << s
// << "\n t_for_s = " << t_for_s
// << "\n s_min = " << s_min
// << "\n s_max = " << s_max
// << "\n t_plus = " << t_plus
// << "\n t_minus = " << t_minus
// << "\n dt = " << dt
// << "\n EV = " << EV
// << "\n El2 = " << El2
// << "\n M2 = " << M2
// << "\n ml = " << ml
// << std::endl;
}
if ( fabs( cosVellminus ) > 1.0001 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbTosllScalarAmpNew::CalcMaxProb(...)"
<< "\n |cos(theta)| = " << fabs( cosVellminus ) << " > 1"
<< "\n s = " << s << "\n t_for_s = " << t_for_s
<< "\n s_min = " << s_min << "\n s_max = " << s_max
<< "\n t_plus = " << t_plus << "\n t_minus = " << t_minus
<< "\n dt = " << dt << "\n EV = " << EV
<< "\n El2 = " << El2 << "\n modV = " << modV
<< "\n modl2 = " << modl2 << "\n M2 = " << M2
<< "\n ml = " << ml << std::endl;
::abort();
}
double sin2Vellminus = 1.0 - pow( cosVellminus, 2.0 );
if ( ( sin2Vellminus < 0.0 ) && ( sin2Vellminus >= -0.0001 ) ) {
sin2Vellminus = 0.0;
}
if ( sin2Vellminus <= -0.0001 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbTosllScalarAmpNew::CalcMaxProb(...)"
<< "\n cos^2(theta) = " << sin2Vellminus << " < -0.001"
<< "\n s = " << s << "\n t_for_s = " << t_for_s
<< "\n s_min = " << s_min << "\n s_max = " << s_max
<< "\n t_plus = " << t_plus << "\n t_minus = " << t_minus
<< "\n dt = " << dt << "\n EV = " << EV
<< "\n El2 = " << El2 << "\n modV = " << modV
<< "\n modl2 = " << modl2 << "\n M2 = " << M2
<< "\n ml = " << ml << std::endl;
::abort();
}
EvtVector4R p1, p2, k1, k2;
p1.set( M1, 0.0, 0.0, 0.0 );
p2.set( EV, modV, 0.0, 0.0 );
k2.set( El2, modl2 * cosVellminus,
-modl2 * sqrt( sin2Vellminus ), 0.0 );
k1 = p1 - p2 - k2;
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n Debug in the function EvtbTosllScalarAmpNew::CalcMaxProb(...):"
// << "\n mu =" << mu << " Nf =" << Nf
// << " res_swch =" << res_swch
// << " ias =" << ias
// << "\n M1 = " << M1
// << "\n M2 = " << M2
// << "\n ml = " << ml
// << "\n s = " << s
// << "\n t_for_s = " << t_for_s
// << "\n EV = " << EV
// << "\n El1 = " << El1
// << "\n El2 = " << El2
// << "\n modV = " << modV
// << "\n modl1 = " << modl1
// << "\n modl2 = " << modl2
// << "\n cos(theta) = " << cosVellminus
// << "\n p1 =" << p1
// << "\n p2 =" << p2
// << "\n k1 =" << k1
// << "\n k2 =" << k2
// << std::endl;
// B-meson state preparation at the rest frame of B-meson
EvtScalarParticle* scalar_part;
EvtParticle* root_part;
scalar_part = new EvtScalarParticle;
scalar_part->noLifeTime();
scalar_part->init( parnum, p1 );
root_part = (EvtParticle*)scalar_part;
root_part->setDiagonalSpinDensity();
// Amplitude initialization
EvtId listdaug[3];
listdaug[0] = mesnum;
listdaug[1] = l1num;
listdaug[2] = l2num;
EvtAmp amp;
amp.init( parnum, 3, listdaug );
// Daughters states preparation at the rest frame of B-meson
root_part->makeDaughters( 3, listdaug );
EvtParticle *vect, *lep1, *lep2;
vect = root_part->getDaug( 0 );
lep1 = root_part->getDaug( 1 );
lep2 = root_part->getDaug( 2 );
vect->noLifeTime();
lep1->noLifeTime();
lep2->noLifeTime();
// EvtGenReport(EVTGEN_ERROR,"EvtGen")
// << "\n\n In the function EvtbTosllScalarAmpNew::CalcScalarMaxProb(...)"
// << "\n M1 = " << M1
// << "\n M2 = " << M2
// << "\n s = " << s
// << "\n t_for_s = " << t_for_s
// << "\n p1 = " << p1
// << "\n p2 = " << p2
// << "\n k1 = " << k1
// << "\n k2 = " << k2
// << "\n mesnum = " << mesnum
// << "\n l1num = " << l1num
// << "\n l2num = " << l2num
// << std::endl;
vect->init( mesnum, p2 );
lep1->init( l1num, k1 );
lep2->init( l2num, k2 );
// EvtGenReport(EVTGEN_ERROR,"EvtGen")
// << "\n vect = " << vect
// << "\n lep1 = " << lep1
// << "\n lep2 = " << lep2
// << std::endl;
EvtSpinDensity rho;
rho.setDiag( root_part->getSpinStates() );
// The amplitude calculation at the
// "maximum amplitude" kinematical configuration
CalcAmp( root_part, amp, formFactors, WilsCoeff, mu, Nf, res_swch,
ias, CKM_A, CKM_lambda, CKM_barrho, CKM_bareta );
// Now find the probability at this q2 and cos theta lepton point
double nikmax = rho.normalizedProb( amp.getSpinDensity() );
if ( nikmax > maxfoundprob ) {
maxfoundprob = nikmax;
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n maxfoundprob ( s =" << s << ", t = " << t_for_s << " ) = "
// << maxfoundprob
// << "\n k =" << k
// << std::endl;
}
delete scalar_part;
// delete root_part;
delete vect;
delete lep1;
delete lep2;
} // for(k=0; k<=max_k; k++)
} // for(j=0; j<max_j; j++)
} // if(res_swch==0)
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if ( res_swch == 1 ) {
double s, t_for_s; // Mandelstam variables
double t_plus, t_minus; // t-variable boundaries for current s-variable
double dt;
int k;
s = pow( 3.09688, 2.0 ); // s = (M_{J/\psi})^2
t_plus = pow( M1, 2.0 ) + pow( M2, 2.0 ) + 2.0 * pow( ml, 2.0 ) - s;
t_plus = t_plus + sqrt( 1.0 - 4.0 * pow( ml, 2.0 ) / s ) *
sqrt( lambda( s, pow( M1, 2.0 ), pow( M2, 2.0 ) ) );
t_plus *= 0.5;
t_minus = pow( M1, 2.0 ) + pow( M2, 2.0 ) + 2.0 * pow( ml, 2.0 ) - s;
t_minus = t_minus -
sqrt( 1.0 - 4.0 * pow( ml, 2.0 ) / s ) *
sqrt( lambda( s, pow( M1, 2.0 ), pow( M2, 2.0 ) ) );
t_minus *= 0.5;
dt = ( t_plus - t_minus ) / 1000.0;
// The maximum probability calculation
for ( k = 0; k < 1000; k++ ) {
t_for_s = t_minus + dt * ( (double)k );
if ( ( t_for_s > t_plus ) && ( t_for_s <= ( 1.0001 * t_plus ) ) ) {
t_for_s = t_plus;
}
if ( t_for_s > ( 1.0001 * t_plus ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbTosllScalarAmpNew::CalcMaxProb(...)"
<< "\n t_for_s = " << t_for_s << " > t_plus = " << t_plus
<< " ! "
<< "\n t_minus = " << t_minus << "\n dt = " << dt
<< "\n k = " << k << "\n s = " << s
<< "\n M1 = " << M1 << "\n M2 = " << M2
<< "\n ml = " << ml << std::endl;
::abort();
}
// B-meson rest frame particles and they kinematics inicialization
double EV, El2;
EV = ( pow( M1, 2.0 ) + pow( M2, 2.0 ) - s ) /
( 2.0 * M1 ); // V-meson energy
El2 = ( s + t_for_s - pow( M2, 2.0 ) - pow( ml, 2.0 ) ) /
( 2.0 * M1 ); // ell^- energy
double modV, modl2;
modV = sqrt( pow( EV, 2.0 ) - pow( M2, 2.0 ) );
modl2 = sqrt( pow( El2, 2.0 ) - pow( ml, 2.0 ) );
double cosVellminus; // angle between the vector meson and ell^- directions
cosVellminus = ( pow( M2, 2.0 ) + pow( ml, 2.0 ) + 2.0 * EV * El2 -
t_for_s ) /
( 2.0 * modV * modl2 );
if ( ( fabs( cosVellminus ) > 1.0 ) &&
( fabs( cosVellminus ) <= 1.0001 ) ) {
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n Debug in the function EvtbTosllScalarAmpNew::CalcMaxProb(...):"
// << "\n cos(theta) = " << cosVellminus
// << std::endl;
cosVellminus = cosVellminus / fabs( cosVellminus );
}
if ( ( modV <= 0.000001 ) || ( modl2 <= 0.000001 ) ) {
cosVellminus = cosVellminus / fabs( cosVellminus );
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n Debug in the function EvtbTosllScalarAmpNew::CalcMaxProb(...):"
// << "\n modV = " << modV
// << "\n modl2 = " << modl2
// << "\n cos(theta) = " << cosVellminus
// << "\n s = " << s
// << "\n t_for_s = " << t_for_s
// << "\n t_plus = " << t_plus
// << "\n t_minus = " << t_minus
// << "\n dt = " << dt
// << "\n EV = " << EV
// << "\n El2 = " << El2
// << "\n M2 = " << M2
// << "\n ml = " << ml
// << std::endl;
}
if ( fabs( cosVellminus ) > 1.0001 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbTosllScalarAmpNew::CalcMaxProb(...)"
<< "\n |cos(theta)| = " << fabs( cosVellminus ) << " > 1"
<< "\n s = " << s << "\n t_for_s = " << t_for_s
<< "\n t_plus = " << t_plus << "\n t_minus = " << t_minus
<< "\n dt = " << dt << "\n EV = " << EV
<< "\n El2 = " << El2 << "\n modV = " << modV
<< "\n modl2 = " << modl2 << "\n M2 = " << M2
<< "\n ml = " << ml << std::endl;
::abort();
}
double sin2Vellminus = 1.0 - pow( cosVellminus, 2.0 );
if ( ( sin2Vellminus < 0.0 ) && ( sin2Vellminus >= -0.0001 ) ) {
sin2Vellminus = 0.0;
}
if ( sin2Vellminus <= -0.0001 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbTosllScalarAmpNew::CalcMaxProb(...)"
<< "\n cos^2(theta) = " << sin2Vellminus << " < -0.001"
<< "\n s = " << s << "\n t_for_s = " << t_for_s
<< "\n t_plus = " << t_plus << "\n t_minus = " << t_minus
<< "\n dt = " << dt << "\n EV = " << EV
<< "\n El2 = " << El2 << "\n modV = " << modV
<< "\n modl2 = " << modl2 << "\n M2 = " << M2
<< "\n ml = " << ml << std::endl;
::abort();
}
EvtVector4R p1, p2, k1, k2;
p1.set( M1, 0.0, 0.0, 0.0 );
p2.set( EV, modV, 0.0, 0.0 );
k2.set( El2, modl2 * cosVellminus, -modl2 * sqrt( sin2Vellminus ),
0.0 );
k1 = p1 - p2 - k2;
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n Debug in the function EvtbTosllScalarAmpNew::CalcMaxProb(...):"
// << "\n mu =" << mu << " Nf =" << Nf
// << " res_swch =" << res_swch
// << " ias =" << ias
// << "\n M1 = " << M1
// << "\n M2 = " << M2
// << "\n ml = " << ml
// << "\n s = " << s
// << "\n t_for_s = " << t_for_s
// << "\n EV = " << EV
// << "\n El1 = " << El1
// << "\n El2 = " << El2
// << "\n modV = " << modV
// << "\n modl1 = " << modl1
// << "\n modl2 = " << modl2
// << "\n cos(theta) = " << cosVellminus
// << "\n p1 =" << p1
// << "\n p2 =" << p2
// << "\n k1 =" << k1
// << "\n k2 =" << k2
// << std::endl;
// B-meson state preparation at the rest frame of B-meson
EvtScalarParticle* scalar_part;
EvtParticle* root_part;
scalar_part = new EvtScalarParticle;
scalar_part->noLifeTime();
scalar_part->init( parnum, p1 );
root_part = (EvtParticle*)scalar_part;
root_part->setDiagonalSpinDensity();
// Amplitude initialization
EvtId listdaug[3];
listdaug[0] = mesnum;
listdaug[1] = l1num;
listdaug[2] = l2num;
EvtAmp amp;
amp.init( parnum, 3, listdaug );
// Daughters states preparation at the rest frame of B-meson
root_part->makeDaughters( 3, listdaug );
EvtParticle *vect, *lep1, *lep2;
vect = root_part->getDaug( 0 );
lep1 = root_part->getDaug( 1 );
lep2 = root_part->getDaug( 2 );
vect->noLifeTime();
lep1->noLifeTime();
lep2->noLifeTime();
vect->init( mesnum, p2 );
lep1->init( l1num, k1 );
lep2->init( l2num, k2 );
EvtSpinDensity rho;
rho.setDiag( root_part->getSpinStates() );
// The amplitude calculation at the
// "maximum amplitude" kinematical configuration
CalcAmp( root_part, amp, formFactors, WilsCoeff, mu, Nf, res_swch,
ias, CKM_A, CKM_lambda, CKM_barrho, CKM_bareta );
// Now find the probability at this q2 and cos theta lepton point
double nikmax = rho.normalizedProb( amp.getSpinDensity() );
if ( nikmax > maxfoundprob ) {
maxfoundprob = nikmax;
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n maxfoundprob ( s =" << s << ", t = " << t_for_s << " ) = "
// << maxfoundprob
// << "\n k =" << k
// << std::endl;
}
delete scalar_part;
// delete root_part;
delete vect;
delete lep1;
delete lep2;
} // for(k=0; k<=1000; k++)
} // if(res_swch==1)
if ( maxfoundprob <= 0.0 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbTosllScalarAmpNew::CalcMaxProb(...)"
<< "\n maxfoundprob = " << maxfoundprob << " <0 or =0!"
<< "\n res_swch = " << res_swch << std::endl;
::abort();
}
EvtGenReport( EVTGEN_NOTICE, "EvtGen" )
<< "\n maxfoundprob (...) = " << maxfoundprob << std::endl;
maxfoundprob *= 1.01;
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n ***************************************************************************"
// << "\n The function EvtbTosllScalarAmpNew::CalcMaxProb(...) passed with arguments:"
// << "\n mu =" << mu << " Nf =" << Nf
// << " res_swch =" << res_swch
// << " ias =" << ias
// << " \n s_at_max = " << s_at_max
// << " t_at_max = " << t_at_max
// << "\n The distribution maximum maxfoundprob =" << maxfoundprob
// << "\n ***************************************************************************"
// << std::endl;
return maxfoundprob;
}
// Triangular function
double EvtbTosllScalarAmpNew::lambda( double a, double b, double c )
{
double l;
l = pow( a, 2.0 ) + pow( b, 2.0 ) + pow( c, 2.0 ) - 2.0 * a * b -
2.0 * a * c - 2.0 * b * c;
return l;
}
diff --git a/src/EvtGenModels/EvtbTosllScalarAmpNewExt.cpp b/src/EvtGenModels/EvtbTosllScalarAmpNewExt.cpp
index e7455cb..891eb82 100644
--- a/src/EvtGenModels/EvtbTosllScalarAmpNewExt.cpp
+++ b/src/EvtGenModels/EvtbTosllScalarAmpNewExt.cpp
@@ -1,871 +1,871 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenModels/EvtbTosllScalarAmpNewExt.hh"
#include "EvtGenBase/EvtAmp.hh"
#include "EvtGenBase/EvtComplex.hh"
#include "EvtGenBase/EvtDiracSpinor.hh"
#include "EvtGenBase/EvtGenKine.hh"
#include "EvtGenBase/EvtId.hh"
#include "EvtGenBase/EvtIdSet.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtPatches.hh"
#include "EvtGenBase/EvtReport.hh"
#include "EvtGenBase/EvtScalarParticle.hh"
#include "EvtGenBase/EvtTensor4C.hh"
#include "EvtGenBase/EvtVector4C.hh"
#include "EvtGenModels/EvtbTosllAmpNewExt.hh"
#include "EvtGenModels/EvtbTosllFFNew.hh"
#include "EvtGenModels/EvtbTosllWilsCoeffNLO.hh"
#include <cstdlib>
//
// The main functiom for the amplitude calculation
//
// input: *parent - the pointer to the parent particle (B-meson, the
// object of the EvtParticle class);
// *formFactors - the pointer to instance of EvtbTosllFFNew class object;
// *WilsCoeff - the pointer to
// mu - the scale parameter, GeV;
// Nf - number of "effective" flavors (for b-quark Nf=5);
// res_swch - resonant switching parameter:
// = 0 the resonant contribution switched OFF,
// = 1 the resonant contribution switched ON;
// ias - switching parameter for \alpha_s(M_Z) value:
// = 0 PDG 1sigma minimal alpha_s(M_Z),
// = 1 PDG average value alpha_s(M_Z),
// = 2 PDG 1sigma maximal alpha_s(M_Z).
// Wolfenstein parameterization for CKM matrix
// CKM_A, CKM_lambda, CKM_barrho, CKM_bareta
//
// return: amp - amplitude for the decay B -> P ell^+ ell^-
//
// Note: in our calculations we assume, that pseudoscalar meson is the first
// daughter particle (iP=0) and leptons are the second and thirds
// daughter particles (il1=1 and il2=2).
//
void EvtbTosllScalarAmpNewExt::CalcAmp(
EvtParticle* parent, EvtAmp& amp, EvtbTosllFFNew* formFactors,
EvtbTosllWilsCoeffNLO* WilsCoeff, double mu, int Nf, int res_swch, int ias,
double CKM_A, double CKM_lambda, double CKM_barrho, double CKM_bareta,
double ReA7, double ImA7, double ReA10, double ImA10 )
{
// FILE *mytest;
EvtComplex unit1( 1.0, 0.0 ); // real unit
EvtComplex uniti( 0.0, 1.0 ); // imaginary unit
EvtComplex A7 = ReA7 * unit1 + ImA7 * uniti;
EvtComplex A10 = ReA10 * unit1 + ImA10 * uniti;
int iP = 0; // pseudoscalar meson is the first daughter particle
int il1 = 1,
il2 = 2; // leptons are the second and thirds daughter particles
// transition momentum of the leptonic pair q=k1+k2 or q=p1-p2
EvtVector4R q = parent->getDaug( il1 )->getP4() +
parent->getDaug( il2 )->getP4();
// Mandelstam variable t=q^2
double q2 = q.mass2();
double M1 = parent->mass(); // B - meson mass
double M2 = parent->getDaug( iP )->mass(); // pseudoscalar meson mass
double ml = parent->getDaug( il1 )->mass(); // leptonic mass
double ms = 0.0; // light quark mass from the dispersion QM
double mc = formFactors->getQuarkMass( 4 ); // m_c mass from the dispersion QM
double mb = formFactors->getQuarkMass( 5 ); // m_b mass from the dispersion QM
// double Mw = EvtPDL::getNominalMass("W+"); // W-boson mass
// double mt = EvtPDL::getNominalMass("t"); // t-quark mass
double Mw = 80.403; // GeV W-boson mass
double mt = 174.2; // GeV t-quark mass
EvtComplex Vtb, Vtq, Vub, Vuq; // V_{tb}, V_{tq}, V_{ub} and V_{uq}
EvtComplex CKM_factor; // V^*_{tq}*V_{tb}, where q={d,s}
EvtComplex lambda_qu; // V^*_{uq}*V_{ub}/V^*_{tq}*V_{tb}, where q={d,s}
double Relambda_qu, Imlambda_qu;
EvtId idparent = parent->getId(); // B-meson Id
EvtId iddaught = parent->getDaug( iP )->getId(); // The pseudoscalar meson Id
// set of the light quark mass value
if ( ( idparent == EvtPDL::getId( std::string( "B+" ) ) &&
iddaught == EvtPDL::getId( std::string( "K+" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B-" ) ) &&
iddaught == EvtPDL::getId( std::string( "K-" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "K0" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "anti-K0" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B_s0" ) ) &&
iddaught == EvtPDL::getId( std::string( "eta" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B_s0" ) ) &&
iddaught == EvtPDL::getId( std::string( "eta" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B_s0" ) ) &&
iddaught == EvtPDL::getId( std::string( "eta'" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B_s0" ) ) &&
iddaught == EvtPDL::getId( std::string( "eta'" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B_s0" ) ) &&
iddaught == EvtPDL::getId( std::string( "f_0" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B_s0" ) ) &&
iddaught == EvtPDL::getId( std::string( "f_0" ) ) ) ) {
ms = formFactors->getQuarkMass( 3 ); // m_s mass from the dispersion QM
// V_{ts}
Vtq = unit1 * ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) ) +
pow( CKM_lambda, 2.0 ) *
( CKM_barrho * unit1 + CKM_bareta * uniti ) /
sqrt( 1.0 - pow( CKM_lambda, 2.0 ) );
Vtq = -CKM_A * pow( CKM_lambda, 2.0 ) * Vtq;
// V_{us}
Vuq = CKM_lambda * unit1;
}
if ( ( idparent == EvtPDL::getId( std::string( "B+" ) ) &&
iddaught == EvtPDL::getId( std::string( "pi+" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B-" ) ) &&
iddaught == EvtPDL::getId( std::string( "pi-" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "pi0" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "pi0" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "eta" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "eta" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "eta'" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "eta'" ) ) ) ) {
ms = formFactors->getQuarkMass( 2 ); // m_d mass from the dispersion QM
// V_{td}
Vtq = unit1 - ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) ) *
( CKM_barrho * unit1 + CKM_bareta * uniti ) /
sqrt( 1.0 - pow( CKM_lambda, 2.0 ) );
Vtq = CKM_A * pow( CKM_lambda, 3.0 ) * Vtq;
// V_{ud}
Vuq = unit1 * ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) -
0.125 * pow( CKM_lambda, 4.0 ) );
}
if ( ms < 0.001 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function EvtbTosllScalarAmpNew::CalcAmp(...)"
<< "\n Error in the model set!"
<< " ms = " << ms << std::endl;
::abort();
}
Vtb = unit1 * ( 1.0 - 0.5 * pow( CKM_A * CKM_lambda * CKM_lambda,
2.0 ) ); // V_{tb}
Vub = CKM_A * pow( CKM_lambda, 3.0 ) *
( CKM_barrho * unit1 - CKM_bareta * uniti ) /
sqrt( 1.0 - pow( CKM_lambda, 2.0 ) ); // V_{ub}
CKM_factor = conj( Vtq ) * Vtb; // V^*_{tq}*V_{tb}
lambda_qu = conj( Vuq ) * Vub /
CKM_factor; // V^*_{uq}*V_{ub}/V^*_{tq}*V_{tb}
Relambda_qu = real( lambda_qu );
Imlambda_qu = imag( lambda_qu );
double fp, f0, ft; // B -> P transition form-factors
// To get the B -> P transition form-factors
formFactors->getScalarFF( parent->getId(), parent->getDaug( iP )->getId(),
q2, fp, f0, ft );
// The Wilson Coefficients preparation according to the paper
// A.J.Buras, M.Munz, Phys.Rev.D52, p.189 (1995)
EvtComplex c7gam = WilsCoeff->GetC7Eff( mu, Mw, mt, Nf, ias );
c7gam = c7gam * A7;
EvtComplex c9eff_b2q = WilsCoeff->GetC9Eff( 0, res_swch, ias, Nf, q2, mb,
ms, mc, mu, mt, Mw, ml,
Relambda_qu, Imlambda_qu );
EvtComplex c9eff_barb2barq = WilsCoeff->GetC9Eff( 1, res_swch, ias, Nf, q2,
mb, ms, mc, mu, mt, Mw, ml,
Relambda_qu, Imlambda_qu );
EvtComplex c10a = WilsCoeff->GetC10Eff( mt, Mw );
c10a = c10a * A10;
// EvtGenReport(EVTGEN_NOTICE,"EvtGen") << "\n\n The function EvtbTosllScalarAmpNew::CalcAmp(...) passed."
// << "\n Particle masses:"
// << "\n B - meson mass M1 = " << M1
// << "\n P - meson mass M2 = " << M2
// << "\n leptonic mass ml = " << ml
// << "\n light quark mass = " << ms
// << "\n c - quark mass mc = " << mc
// << "\n b - quark mass mb = " << mb
// << "\n t - quark mass mt = " << mt
// << "\n W - boson mass Mw = " << Mw
// << "\n ============================================================================"
// << "\n Input parameters:"
// << "\n scale parameter mu = " << mu
// << "\n number of flavors Nf = " << Nf
// << "\n resonant switching = " << res_swch
// << "\n parameter for alpha_s(M_Z) = " << ias
// << "\n ============================================================================"
// << "\n Vector form-factors at q^2 = " << q2
// << " for B -> P transition:"
// << "\n fp = " << fp
// << "\n f0 = " << f0
// << "\n ft = " << ft
// << "\n ============================================================================"
// << "\n Wilson Coefficients:"
// << "\n Re(c7gam) = " << real(c7gam) << " Im(c7gam) = " << imag(c7gam)
// << "\n Re(c9eff_b2q) = " << real(c9eff_b2q)
// << " Im(c9eff_b2q) = " << imag(c9eff_b2q)
// << "\n Re(c9eff_barb2barq) = " << real(c9eff_barb2barq)
// << " Im(c9eff_barb2barq) = " << imag(c9eff_barb2barq)
// << "\n Re(c10a) = " << real(c10a) << " Im(c10a) = " << imag(c10a)
// << std::endl;
// mytest = fopen("scalaroutput.txt","a");
// if(mytest != NULL){
// fprintf(mytest,"%lf\n",q2);
// fclose(mytest);
// }
// else{
// EvtGenReport(EVTGEN_ERROR,"EvtGen") << "\n Error in writing to file.\n"
// << std::endl;
// return;
// }
// 4- momentum of the B-meson in the the B-meson rest frame
EvtVector4R p1 = parent->getP4Restframe();
EvtVector4R hatp1 = p1 / M1;
// 4-momentum of the pseudoscalar meson in the B-meson rest frame
EvtVector4R p2 = parent->getDaug( 0 )->getP4();
EvtVector4R hatp2 = p2 / M1;
// 4-vector \hat q = q/M1
EvtVector4R hatq = q / M1;
// 4-vector \hat P= (p1 + p2)/M1
EvtVector4R hatP = hatp1 + hatp2;
double hats = q2 / pow( M1, 2 );
double hatM2 = M2 / M1;
double hatmb = mb / M1;
double hatms = ms / M1;
// Hadronic matrix element with m_s.NE.0
EvtComplex a_b2q, a_barb2barq, b_b2q, b_barb2barq, c, d;
a_b2q = c9eff_b2q * fp -
2.0 * c7gam * ( hatmb + hatms ) * ft / ( 1.0 + hatM2 );
a_barb2barq = c9eff_barb2barq * fp -
2.0 * c7gam * ( hatmb + hatms ) * ft / ( 1.0 + hatM2 );
b_b2q = ( c9eff_b2q * ( f0 - fp ) +
2.0 * c7gam * ( hatmb + hatms ) * ft / ( 1.0 + hatM2 ) ) *
( 1 - pow( hatM2, 2.0 ) ) / hats;
b_barb2barq = ( c9eff_barb2barq * ( f0 - fp ) +
2.0 * c7gam * ( hatmb + hatms ) * ft / ( 1.0 + hatM2 ) ) *
( 1 - pow( hatM2, 2.0 ) ) / hats;
c = c10a * fp;
d = c10a * ( 1.0 - pow( hatM2, 2 ) ) * ( f0 - fp ) / hats;
// to find ell^+ and ell^- in the B-meson daughters
int charge1 = EvtPDL::chg3( parent->getDaug( 1 )->getId() );
int charge2 = EvtPDL::chg3( parent->getDaug( 2 )->getId() );
EvtParticle* lepPlus = nullptr;
EvtParticle* lepMinus = nullptr;
lepPlus = ( charge1 > charge2 ) ? parent->getDaug( 1 ) : parent->getDaug( 2 );
lepMinus = ( charge1 < charge2 ) ? parent->getDaug( 1 )
: parent->getDaug( 2 );
EvtVector4C T1, T2; // hadronic matrix element vector structures
EvtVector4C lvc11, lvc12; // spin structures for
EvtVector4C lvc21, lvc22; // the leptonic vector current
EvtVector4C lac11, lac12; // spin structures for
EvtVector4C lac21, lac22; // the leptonic axial current
// B - and barB - mesons descriptors
- EvtIdSet bmesons( "B-", "anti-B0", "anti-B_s0", "B_c-" );
- EvtIdSet bbarmesons( "B+", "B0", "B_s0", "B_c+" );
+ EvtIdSet bmesons{ "B-", "anti-B0", "anti-B_s0", "B_c-" };
+ EvtIdSet bbarmesons{ "B+", "B0", "B_s0", "B_c+" };
EvtId parentID = parent->getId();
if ( bmesons.contains( parentID ) ) {
// The amplitude for the decay barB -> barP ell^+ ell^-
// (b -> q ell^+ ell^- transition)
T1 = a_b2q * hatP + b_b2q * hatq;
T2 = c * hatP + d * hatq;
lvc11 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
lvc21 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lvc12 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lvc22 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
lac11 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
lac21 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lac12 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lac22 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
amp.vertex( 0, 0, CKM_factor * ( lvc11 * T1 + lac11 * T2 ) );
amp.vertex( 0, 1, CKM_factor * ( lvc12 * T1 + lac12 * T2 ) );
amp.vertex( 1, 0, CKM_factor * ( lvc21 * T1 + lac21 * T2 ) );
amp.vertex( 1, 1, CKM_factor * ( lvc22 * T1 + lac22 * T2 ) );
} else {
if ( bbarmesons.contains( parentID ) ) {
// The amplitude for the decay B -> K* ell^+ ell^-
// (barb -> barq ell^+ ell^- transition)
T1 = a_barb2barq * hatP + b_barb2barq * hatq;
T2 = c * hatP + d * hatq;
lvc11 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
lvc21 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lvc12 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lvc22 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
lac11 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
lac21 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lac12 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lac22 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
amp.vertex( 0, 0, conj( CKM_factor ) * ( lvc11 * T1 + lac11 * T2 ) );
amp.vertex( 0, 1, conj( CKM_factor ) * ( lvc12 * T1 + lac12 * T2 ) );
amp.vertex( 1, 0, conj( CKM_factor ) * ( lvc21 * T1 + lac21 * T2 ) );
amp.vertex( 1, 1, conj( CKM_factor ) * ( lvc22 * T1 + lac22 * T2 ) );
}
else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function EvtbTosllScalarAmpNew::CalcAmp(...)"
<< "\n Wrong B-meson number" << std::endl;
::abort();
}
}
}
//
// The decays B -> P ell^+ ell^- maximum probability calculation for the
// d^2\Gamma/dq^2 d\cos\theta distribution.
//
// \theta - the angle between the final P-meson and ell^- directions in the
// B-meson rest frame.
//
// If ias=0 (nonresonant case), the maximum is achieved at (s,t) plane!
// If ias=1 (resonant case), the maximum is achieved at q2=M^2_{J/\psi}.
//
double EvtbTosllScalarAmpNewExt::CalcMaxProb(
EvtId parnum, EvtId mesnum, EvtId l1num, EvtId l2num,
EvtbTosllFFNew* formFactors, EvtbTosllWilsCoeffNLO* WilsCoeff, double mu,
int Nf, int res_swch, int ias, double CKM_A, double CKM_lambda,
double CKM_barrho, double CKM_bareta, double ReA7, double ImA7,
double ReA10, double ImA10 )
{
double maxfoundprob = -100.0; // maximum of the probability
double M1 = EvtPDL::getMeanMass( parnum ); // B - meson mass
double M2 = EvtPDL::getMeanMass( mesnum ); // P - meson mass
double ml = EvtPDL::getMeanMass( l1num ); // leptonic mass
if ( res_swch == 0 ) {
double s, t_for_s; // Mandelstam variables
double s_min, s_max; // s-variable boundaries
double t_plus, t_minus; // t-variable boundaries for current s-variable
double ds, dt;
int j, k;
int max_j, max_k;
s_min = 4.0 * pow( ml, 2.0 ); // minimum value of s-variable
s_max = pow( ( M1 - M2 ), 2.0 ); // maximum value of s-variable
max_j = 1000;
ds = ( s_max - s_min ) / ( (double)max_j );
if ( ds < 0.0 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbTosllScalarAmpNew::CalcScalarMaxProb(...)"
<< "\n ds = " << ds << " < 0."
<< "\n s_min = " << s_min << "\n s_max = " << s_max
<< "\n M1 = " << M1 << "\n M2 = " << M2
<< "\n ml = " << ml << std::endl;
::abort();
}
// The maximum probability calculation
// from s_min to s_max
for ( j = max_j / 3; j < max_j; j++ ) {
s = s_min + ds * ( (double)j );
t_plus = pow( M1, 2.0 ) + pow( M2, 2.0 ) + 2.0 * pow( ml, 2.0 ) - s;
t_plus = t_plus +
sqrt( 1.0 - 4.0 * pow( ml, 2.0 ) / s ) *
sqrt( lambda( s, pow( M1, 2.0 ), pow( M2, 2.0 ) ) );
t_plus *= 0.5;
t_minus = pow( M1, 2.0 ) + pow( M2, 2.0 ) + 2.0 * pow( ml, 2.0 ) - s;
t_minus = t_minus -
sqrt( 1.0 - 4.0 * pow( ml, 2.0 ) / s ) *
sqrt( lambda( s, pow( M1, 2.0 ), pow( M2, 2.0 ) ) );
t_minus *= 0.5;
max_k = 1000;
dt = ( t_plus - t_minus ) / ( (double)max_k );
if ( fabs( dt ) < 0.00001 )
dt = 0.0;
if ( dt <= ( -0.00001 ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbTosllScalarAmpNew::CalcScalarMaxProb(...)"
<< "\n dt = " << dt << " < 0."
<< "\n s = " << s << "\n s_min = " << s_min
<< "\n s_max = " << s_max << "\n ds = " << ds
<< "\n j = " << j << "\n t_plus = " << t_plus
<< "\n t_minus = " << t_minus << "\n M1 = " << M1
<< "\n M2 = " << M2 << "\n ml = " << ml
<< std::endl;
::abort();
}
// from t_minus to t_plus
for ( k = 0; k < max_k; k++ ) {
t_for_s = t_minus + dt * ( (double)k );
if ( ( t_for_s > t_plus ) && ( t_for_s <= ( 1.0001 * t_plus ) ) ) {
t_for_s = t_plus;
}
if ( t_for_s > ( 1.0001 * t_plus ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbTosllScalarAmpNew::CalcScalarMaxProb(...)"
<< "\n t_for_s = " << t_for_s
<< " > t_plus = " << t_plus << " ! "
<< "\n t_minus = " << t_minus << "\n dt = " << dt
<< "\n k = " << k << "\n s = " << s
<< "\n M1 = " << M1 << "\n M2 = " << M2
<< "\n ml = " << ml << std::endl;
::abort();
}
// B-meson rest frame particles and they kinematics inicialization
double EV, El2;
EV = ( pow( M1, 2.0 ) + pow( M2, 2.0 ) - s ) /
( 2.0 * M1 ); // P-meson energy
El2 = ( s + t_for_s - pow( M2, 2.0 ) - pow( ml, 2.0 ) ) /
( 2.0 * M1 ); // ell^- energy
double modV, modl2;
modV = sqrt( pow( EV, 2.0 ) - pow( M2, 2.0 ) );
modl2 = sqrt( pow( El2, 2.0 ) - pow( ml, 2.0 ) );
double cosVellminus; // angle between the P-meson and ell^- directions
cosVellminus = ( pow( M2, 2.0 ) + pow( ml, 2.0 ) +
2.0 * EV * El2 - t_for_s ) /
( 2.0 * modV * modl2 );
if ( ( fabs( cosVellminus ) > 1.0 ) &&
( fabs( cosVellminus ) <= 1.0001 ) ) {
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n Debug in the function EvtbTosllScalarAmpNew::CalcMaxProb(...):"
// << "\n cos(theta) = " << cosVellminus
// << std::endl;
cosVellminus = cosVellminus / fabs( cosVellminus );
}
if ( ( modV <= 0.000001 ) || ( modl2 <= 0.000001 ) ) {
cosVellminus = cosVellminus / fabs( cosVellminus );
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n Debug in the function EvtbTosllScalarAmpNew::CalcMaxProb(...):"
// << "\n modV = " << modV
// << "\n modl2 = " << modl2
// << "\n cos(theta) = " << cosVellminus
// << "\n s = " << s
// << "\n t_for_s = " << t_for_s
// << "\n s_min = " << s_min
// << "\n s_max = " << s_max
// << "\n t_plus = " << t_plus
// << "\n t_minus = " << t_minus
// << "\n dt = " << dt
// << "\n EV = " << EV
// << "\n El2 = " << El2
// << "\n M2 = " << M2
// << "\n ml = " << ml
// << std::endl;
}
if ( fabs( cosVellminus ) > 1.0001 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbTosllScalarAmpNew::CalcMaxProb(...)"
<< "\n |cos(theta)| = " << fabs( cosVellminus ) << " > 1"
<< "\n s = " << s << "\n t_for_s = " << t_for_s
<< "\n s_min = " << s_min << "\n s_max = " << s_max
<< "\n t_plus = " << t_plus << "\n t_minus = " << t_minus
<< "\n dt = " << dt << "\n EV = " << EV
<< "\n El2 = " << El2 << "\n modV = " << modV
<< "\n modl2 = " << modl2 << "\n M2 = " << M2
<< "\n ml = " << ml << std::endl;
::abort();
}
EvtVector4R p1, p2, k1, k2;
p1.set( M1, 0.0, 0.0, 0.0 );
p2.set( EV, modV, 0.0, 0.0 );
k2.set( El2, modl2 * cosVellminus,
-modl2 * sqrt( 1.0 - pow( cosVellminus, 2.0 ) ), 0.0 );
k1 = p1 - p2 - k2;
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n Debug in the function EvtbTosllScalarAmpNew::CalcMaxProb(...):"
// << "\n mu =" << mu << " Nf =" << Nf
// << " res_swch =" << res_swch
// << " ias =" << ias
// << "\n M1 = " << M1
// << "\n M2 = " << M2
// << "\n ml = " << ml
// << "\n s = " << s
// << "\n t_for_s = " << t_for_s
// << "\n EV = " << EV
// << "\n El1 = " << El1
// << "\n El2 = " << El2
// << "\n modV = " << modV
// << "\n modl1 = " << modl1
// << "\n modl2 = " << modl2
// << "\n cos(theta) = " << cosVellminus
// << "\n p1 =" << p1
// << "\n p2 =" << p2
// << "\n k1 =" << k1
// << "\n k2 =" << k2
// << std::endl;
// B-meson state preparation at the rest frame of B-meson
EvtScalarParticle* scalar_part;
EvtParticle* root_part;
scalar_part = new EvtScalarParticle;
scalar_part->noLifeTime();
scalar_part->init( parnum, p1 );
root_part = (EvtParticle*)scalar_part;
root_part->setDiagonalSpinDensity();
// Amplitude initialization
EvtId listdaug[3];
listdaug[0] = mesnum;
listdaug[1] = l1num;
listdaug[2] = l2num;
EvtAmp amp;
amp.init( parnum, 3, listdaug );
// Daughters states preparation at the rest frame of B-meson
root_part->makeDaughters( 3, listdaug );
EvtParticle *vect, *lep1, *lep2;
vect = root_part->getDaug( 0 );
lep1 = root_part->getDaug( 1 );
lep2 = root_part->getDaug( 2 );
vect->noLifeTime();
lep1->noLifeTime();
lep2->noLifeTime();
vect->init( mesnum, p2 );
lep1->init( l1num, k1 );
lep2->init( l2num, k2 );
EvtSpinDensity rho;
rho.setDiag( root_part->getSpinStates() );
// The amplitude calculation at the
// "maximum amplitude" kinematical configuration
CalcAmp( root_part, amp, formFactors, WilsCoeff, mu, Nf,
res_swch, ias, CKM_A, CKM_lambda, CKM_barrho,
CKM_bareta, ReA7, ImA7, ReA10, ImA10 );
// Now find the probability at this q2 and cos theta lepton point
double nikmax = rho.normalizedProb( amp.getSpinDensity() );
if ( nikmax > maxfoundprob ) {
maxfoundprob = nikmax;
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n maxfoundprob ( s =" << s << ", t = " << t_for_s << " ) = "
// << maxfoundprob
// << "\n k =" << k
// << std::endl;
}
delete scalar_part;
// delete root_part;
delete vect;
delete lep1;
delete lep2;
} // for(k=0; k<=max_k; k++)
} // for(j=0; j<=max_j; j++)
} // if(res_swch==0)
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if ( res_swch == 1 ) {
double s, t_for_s; // Mandelstam variables
double t_plus, t_minus; // t-variable boundaries for current s-variable
double dt;
int k;
s = pow( 3.09688, 2.0 ); // s = (M_{J/\psi})^2
t_plus = pow( M1, 2.0 ) + pow( M2, 2.0 ) + 2.0 * pow( ml, 2.0 ) - s;
t_plus = t_plus + sqrt( 1.0 - 4.0 * pow( ml, 2.0 ) / s ) *
sqrt( lambda( s, pow( M1, 2.0 ), pow( M2, 2.0 ) ) );
t_plus *= 0.5;
t_minus = pow( M1, 2.0 ) + pow( M2, 2.0 ) + 2.0 * pow( ml, 2.0 ) - s;
t_minus = t_minus -
sqrt( 1.0 - 4.0 * pow( ml, 2.0 ) / s ) *
sqrt( lambda( s, pow( M1, 2.0 ), pow( M2, 2.0 ) ) );
t_minus *= 0.5;
dt = ( t_plus - t_minus ) / 1000.0;
// The maximum probability calculation
for ( k = 0; k < 1000; k++ ) {
t_for_s = t_minus + dt * ( (double)k );
if ( ( t_for_s > t_plus ) && ( t_for_s <= ( 1.0001 * t_plus ) ) ) {
t_for_s = t_plus;
}
if ( t_for_s > ( 1.0001 * t_plus ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbTosllScalarAmpNew::CalcMaxProb(...)"
<< "\n t_for_s = " << t_for_s << " > t_plus = " << t_plus
<< " ! "
<< "\n t_minus = " << t_minus << "\n dt = " << dt
<< "\n k = " << k << "\n s = " << s
<< "\n M1 = " << M1 << "\n M2 = " << M2
<< "\n ml = " << ml << std::endl;
::abort();
}
// B-meson rest frame particles and they kinematics inicialization
double EV, El2;
EV = ( pow( M1, 2.0 ) + pow( M2, 2.0 ) - s ) /
( 2.0 * M1 ); // V-meson energy
El2 = ( s + t_for_s - pow( M2, 2.0 ) - pow( ml, 2.0 ) ) /
( 2.0 * M1 ); // ell^- energy
double modV, modl2;
modV = sqrt( pow( EV, 2.0 ) - pow( M2, 2.0 ) );
modl2 = sqrt( pow( El2, 2.0 ) - pow( ml, 2.0 ) );
double cosVellminus; // angle between the vector meson and ell^- directions
cosVellminus = ( pow( M2, 2.0 ) + pow( ml, 2.0 ) + 2.0 * EV * El2 -
t_for_s ) /
( 2.0 * modV * modl2 );
if ( ( fabs( cosVellminus ) > 1.0 ) &&
( fabs( cosVellminus ) <= 1.0001 ) ) {
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n Debug in the function EvtbTosllScalarAmpNew::CalcMaxProb(...):"
// << "\n cos(theta) = " << cosVellminus
// << std::endl;
cosVellminus = cosVellminus / fabs( cosVellminus );
}
if ( ( modV <= 0.000001 ) || ( modl2 <= 0.000001 ) ) {
cosVellminus = cosVellminus / fabs( cosVellminus );
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n Debug in the function EvtbTosllScalarAmpNew::CalcMaxProb(...):"
// << "\n modV = " << modV
// << "\n modl2 = " << modl2
// << "\n cos(theta) = " << cosVellminus
// << "\n s = " << s
// << "\n t_for_s = " << t_for_s
// << "\n t_plus = " << t_plus
// << "\n t_minus = " << t_minus
// << "\n dt = " << dt
// << "\n EV = " << EV
// << "\n El2 = " << El2
// << "\n M2 = " << M2
// << "\n ml = " << ml
// << std::endl;
}
if ( fabs( cosVellminus ) > 1.0001 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbTosllScalarAmpNew::CalcMaxProb(...)"
<< "\n |cos(theta)| = " << fabs( cosVellminus ) << " > 1"
<< "\n s = " << s << "\n t_for_s = " << t_for_s
<< "\n t_plus = " << t_plus << "\n t_minus = " << t_minus
<< "\n dt = " << dt << "\n EV = " << EV
<< "\n El2 = " << El2 << "\n modV = " << modV
<< "\n modl2 = " << modl2 << "\n M2 = " << M2
<< "\n ml = " << ml << std::endl;
::abort();
}
EvtVector4R p1, p2, k1, k2;
p1.set( M1, 0.0, 0.0, 0.0 );
p2.set( EV, modV, 0.0, 0.0 );
k2.set( El2, modl2 * cosVellminus,
-modl2 * sqrt( 1.0 - pow( cosVellminus, 2.0 ) ), 0.0 );
k1 = p1 - p2 - k2;
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n Debug in the function EvtbTosllScalarAmpNew::CalcMaxProb(...):"
// << "\n mu =" << mu << " Nf =" << Nf
// << " res_swch =" << res_swch
// << " ias =" << ias
// << "\n M1 = " << M1
// << "\n M2 = " << M2
// << "\n ml = " << ml
// << "\n s = " << s
// << "\n t_for_s = " << t_for_s
// << "\n EV = " << EV
// << "\n El1 = " << El1
// << "\n El2 = " << El2
// << "\n modV = " << modV
// << "\n modl1 = " << modl1
// << "\n modl2 = " << modl2
// << "\n cos(theta) = " << cosVellminus
// << "\n p1 =" << p1
// << "\n p2 =" << p2
// << "\n k1 =" << k1
// << "\n k2 =" << k2
// << std::endl;
// B-meson state preparation at the rest frame of B-meson
EvtScalarParticle* scalar_part;
EvtParticle* root_part;
scalar_part = new EvtScalarParticle;
scalar_part->noLifeTime();
scalar_part->init( parnum, p1 );
root_part = (EvtParticle*)scalar_part;
root_part->setDiagonalSpinDensity();
// Amplitude initialization
EvtId listdaug[3];
listdaug[0] = mesnum;
listdaug[1] = l1num;
listdaug[2] = l2num;
EvtAmp amp;
amp.init( parnum, 3, listdaug );
// Daughters states preparation at the rest frame of B-meson
root_part->makeDaughters( 3, listdaug );
EvtParticle *vect, *lep1, *lep2;
vect = root_part->getDaug( 0 );
lep1 = root_part->getDaug( 1 );
lep2 = root_part->getDaug( 2 );
vect->noLifeTime();
lep1->noLifeTime();
lep2->noLifeTime();
vect->init( mesnum, p2 );
lep1->init( l1num, k1 );
lep2->init( l2num, k2 );
EvtSpinDensity rho;
rho.setDiag( root_part->getSpinStates() );
// The amplitude calculation at the
// "maximum amplitude" kinematical configuration
CalcAmp( root_part, amp, formFactors, WilsCoeff, mu, Nf, res_swch,
ias, CKM_A, CKM_lambda, CKM_barrho, CKM_bareta, ReA7, ImA7,
ReA10, ImA10 );
// Now find the probability at this q2 and cos theta lepton point
double nikmax = rho.normalizedProb( amp.getSpinDensity() );
if ( nikmax > maxfoundprob ) {
maxfoundprob = nikmax;
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n maxfoundprob ( s =" << s << ", t = " << t_for_s << " ) = "
// << maxfoundprob
// << "\n k =" << k
// << std::endl;
}
delete scalar_part;
// delete root_part;
delete vect;
delete lep1;
delete lep2;
} // for(k=0; k<=1000; k++)
} // if(res_swch==1)
if ( maxfoundprob <= 0.0 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbTosllScalarAmpNew::CalcMaxProb(...)"
<< "\n maxfoundprob = " << maxfoundprob << " <0 or =0!"
<< "\n res_swch = " << res_swch << std::endl;
::abort();
}
EvtGenReport( EVTGEN_NOTICE, "EvtGen" )
<< "\n maxfoundprob (...) = " << maxfoundprob << std::endl;
maxfoundprob *= 1.01;
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n ***************************************************************************"
// << "\n The function EvtbTosllScalarAmpNew::CalcMaxProb(...) passed with arguments:"
// << "\n mu =" << mu << " Nf =" << Nf
// << " res_swch =" << res_swch
// << " ias =" << ias
// << " \n s_at_max = " << s_at_max
// << " t_at_max = " << t_at_max
// << "\n The distribution maximum maxfoundprob =" << maxfoundprob
// << "\n ***************************************************************************"
// << std::endl;
return maxfoundprob;
}
// Triangular function
double EvtbTosllScalarAmpNewExt::lambda( double a, double b, double c )
{
double l;
l = pow( a, 2.0 ) + pow( b, 2.0 ) + pow( c, 2.0 ) - 2.0 * a * b -
2.0 * a * c - 2.0 * b * c;
return l;
}
diff --git a/src/EvtGenModels/EvtbTosllVectorAmp.cpp b/src/EvtGenModels/EvtbTosllVectorAmp.cpp
index e4fe67e..283be0a 100644
--- a/src/EvtGenModels/EvtbTosllVectorAmp.cpp
+++ b/src/EvtGenModels/EvtbTosllVectorAmp.cpp
@@ -1,215 +1,215 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenModels/EvtbTosllVectorAmp.hh"
#include "EvtGenBase/EvtAmp.hh"
#include "EvtGenBase/EvtDiracSpinor.hh"
#include "EvtGenBase/EvtGenKine.hh"
#include "EvtGenBase/EvtId.hh"
#include "EvtGenBase/EvtIdSet.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtPatches.hh"
#include "EvtGenBase/EvtReport.hh"
#include "EvtGenBase/EvtTensor4C.hh"
#include "EvtGenBase/EvtVector4C.hh"
#include "EvtGenModels/EvtbTosllAmp.hh"
#include "EvtGenModels/EvtbTosllFF.hh"
void EvtbTosllVectorAmp::CalcAmp( EvtParticle* parent, EvtAmp& amp,
EvtbTosllFF* formFactors )
{
//Add the lepton and neutrino 4 momenta to find q2
EvtVector4R q = parent->getDaug( 1 )->getP4() + parent->getDaug( 2 )->getP4();
double q2 = ( q.mass2() );
double a1, a2, a0, v, t1, t2, t3;
double mesonmass = parent->getDaug( 0 )->mass();
double parentmass = parent->mass();
formFactors->getVectorFF( parent->getId(), parent->getDaug( 0 )->getId(),
q2, mesonmass, a1, a2, a0, v, t1, t2, t3 );
EvtId daught = parent->getDaug( 0 )->getId();
EvtId parentId = parent->getId();
bool btod = false;
bool nnlo = true;
if ( ( parentId == EvtPDL::getId( "B0" ) ||
parentId == EvtPDL::getId( "anti-B0" ) ||
parentId == EvtPDL::getId( "B+" ) ||
parentId == EvtPDL::getId( "B-" ) ) &&
( daught == EvtPDL::getId( std::string( "rho+" ) ) ||
daught == EvtPDL::getId( std::string( "rho-" ) ) ||
daught == EvtPDL::getId( std::string( "rho0" ) ) ||
daught == EvtPDL::getId( std::string( "omega" ) ) ) ) {
btod = true;
}
if ( ( parentId == EvtPDL::getId( "B_s0" ) ||
parentId == EvtPDL::getId( "anti-B_s0" ) ) &&
( daught == EvtPDL::getId( std::string( "K*0" ) ) ||
daught == EvtPDL::getId( std::string( "anti-K*0" ) ) ||
daught == EvtPDL::getId( std::string( "K*+" ) ) ||
daught == EvtPDL::getId( std::string( "K*-" ) ) ) ) {
btod = true;
}
EvtVector4R p4b;
p4b.set( parent->mass(), 0.0, 0.0, 0.0 );
EvtVector4R p4meson = parent->getDaug( 0 )->getP4();
EvtVector4C l11, l12;
EvtVector4C l21, l22;
EvtVector4C a11, a12;
EvtVector4C a21, a22;
EvtId parentID = parent->getId();
//EvtId l_num = parent->getDaug(1)->getId();
EvtVector4R pbhat = p4b / parentmass;
EvtVector4R qhat = q / parentmass;
EvtVector4R pkstarhat = p4meson / parentmass;
EvtVector4R phat = pbhat + pkstarhat;
EvtComplex c7eff = EvtbTosllAmp::GetC7Eff( q2, nnlo );
EvtComplex c9eff = EvtbTosllAmp::GetC9Eff( q2, nnlo, btod );
EvtComplex c10eff = EvtbTosllAmp::GetC10Eff( q2, nnlo );
EvtComplex uniti( 0.0, 1.0 );
double mhatb = 4.4 / ( parentmass );
double mhatkstar = mesonmass / ( parentmass );
double shat = q2 / ( parentmass * parentmass );
EvtComplex a;
a = c9eff * v * 2 / ( 1 + mhatkstar ) + 4 * mhatb * c7eff * t1 / shat;
EvtComplex b;
b = ( 1 + mhatkstar ) *
( c9eff * a1 + 2 * mhatb * ( 1 - mhatkstar ) * c7eff * t2 / shat );
EvtComplex c;
c = ( ( 1 - mhatkstar ) * c9eff * a2 +
2 * mhatb * c7eff * ( t3 + ( 1 - mhatkstar * mhatkstar ) * t2 / shat ) ) /
( 1 - mhatkstar * mhatkstar );
EvtComplex d;
d = ( c9eff * ( ( 1 + mhatkstar ) * a1 - ( 1 - mhatkstar ) * a2 -
2 * mhatkstar * a0 ) -
2 * mhatb * c7eff * t3 ) /
shat;
EvtComplex e;
e = 2 * c10eff * v / ( 1 + mhatkstar );
EvtComplex f;
f = ( 1 + mhatkstar ) * c10eff * a1;
EvtComplex g;
g = c10eff * a2 / ( 1 + mhatkstar );
EvtComplex h;
h = c10eff *
( ( 1 + mhatkstar ) * a1 - ( 1 - mhatkstar ) * a2 - 2 * mhatkstar * a0 ) /
shat;
EvtTensor4C T1, T2;
- static EvtIdSet bmesons( "B-", "anti-B0", "anti-B_s0" );
- static EvtIdSet bbarmesons( "B+", "B0", "B_s0" );
+ static EvtIdSet bmesons{ "B-", "anti-B0", "anti-B_s0" };
+ static EvtIdSet bbarmesons{ "B+", "B0", "B_s0" };
EvtParticle* lepPlus = nullptr;
EvtParticle* lepMinus = nullptr;
int charge1 = EvtPDL::chg3( parent->getDaug( 1 )->getId() );
int charge2 = EvtPDL::chg3( parent->getDaug( 2 )->getId() );
lepPlus = ( charge1 > charge2 ) ? parent->getDaug( 1 ) : parent->getDaug( 2 );
lepMinus = ( charge1 < charge2 ) ? parent->getDaug( 1 )
: parent->getDaug( 2 );
if ( bmesons.contains( parentID ) ) {
T1 = a * dual( EvtGenFunctions::directProd( pbhat, pkstarhat ) ) -
b * uniti * EvtTensor4C::g() +
c * uniti * EvtGenFunctions::directProd( pbhat, phat ) +
d * uniti * EvtGenFunctions::directProd( pbhat, qhat );
T2 = e * dual( EvtGenFunctions::directProd( pbhat, pkstarhat ) ) -
f * uniti * EvtTensor4C::g() +
g * uniti * EvtGenFunctions::directProd( pbhat, phat ) +
h * uniti * EvtGenFunctions::directProd( pbhat, qhat );
l11 = EvtLeptonVCurrent( lepPlus->spParent( 0 ), lepMinus->spParent( 0 ) );
l21 = EvtLeptonVCurrent( lepPlus->spParent( 1 ), lepMinus->spParent( 0 ) );
l12 = EvtLeptonVCurrent( lepPlus->spParent( 0 ), lepMinus->spParent( 1 ) );
l22 = EvtLeptonVCurrent( lepPlus->spParent( 1 ), lepMinus->spParent( 1 ) );
a11 = EvtLeptonACurrent( lepPlus->spParent( 0 ), lepMinus->spParent( 0 ) );
a21 = EvtLeptonACurrent( lepPlus->spParent( 1 ), lepMinus->spParent( 0 ) );
a12 = EvtLeptonACurrent( lepPlus->spParent( 0 ), lepMinus->spParent( 1 ) );
a22 = EvtLeptonACurrent( lepPlus->spParent( 1 ), lepMinus->spParent( 1 ) );
} else {
if ( bbarmesons.contains( parentID ) ) {
T1 = -a * dual( EvtGenFunctions::directProd( pbhat, pkstarhat ) ) -
b * uniti * EvtTensor4C::g() +
c * uniti * EvtGenFunctions::directProd( pbhat, phat ) +
d * uniti * EvtGenFunctions::directProd( pbhat, qhat );
T2 = -e * dual( EvtGenFunctions::directProd( pbhat, pkstarhat ) ) -
f * uniti * EvtTensor4C::g() +
g * uniti * EvtGenFunctions::directProd( pbhat, phat ) +
h * uniti * EvtGenFunctions::directProd( pbhat, qhat );
l11 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
l21 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
l12 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
l22 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
a11 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
a21 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
a12 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
a22 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "Wrong lepton number\n";
T1.zero();
T2.zero(); // Set all tensor terms to zero.
}
}
int i;
for ( i = 0; i < 3; i++ ) {
EvtVector4C eps = parent->getDaug( 0 )->epsParent( i ).conj();
EvtVector4C E1 = T1.cont1( eps );
EvtVector4C E2 = T2.cont1( eps );
amp.vertex( i, 0, 0, l11 * E1 + a11 * E2 );
amp.vertex( i, 0, 1, l12 * E1 + a12 * E2 );
amp.vertex( i, 1, 0, l21 * E1 + a21 * E2 );
amp.vertex( i, 1, 1, l22 * E1 + a22 * E2 );
}
}
diff --git a/src/EvtGenModels/EvtbTosllVectorAmpNew.cpp b/src/EvtGenModels/EvtbTosllVectorAmpNew.cpp
index ccefe64..4558522 100644
--- a/src/EvtGenModels/EvtbTosllVectorAmpNew.cpp
+++ b/src/EvtGenModels/EvtbTosllVectorAmpNew.cpp
@@ -1,872 +1,872 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenModels/EvtbTosllVectorAmpNew.hh"
#include "EvtGenBase/EvtAmp.hh"
#include "EvtGenBase/EvtComplex.hh"
#include "EvtGenBase/EvtDiracSpinor.hh"
#include "EvtGenBase/EvtGenKine.hh"
#include "EvtGenBase/EvtId.hh"
#include "EvtGenBase/EvtIdSet.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtPatches.hh"
#include "EvtGenBase/EvtReport.hh"
#include "EvtGenBase/EvtScalarParticle.hh"
#include "EvtGenBase/EvtTensor4C.hh"
#include "EvtGenBase/EvtVector4C.hh"
#include "EvtGenBase/EvtVectorParticle.hh"
#include "EvtGenModels/EvtbTosllAmpNew.hh"
#include "EvtGenModels/EvtbTosllFFNew.hh"
#include "EvtGenModels/EvtbTosllWilsCoeffNLO.hh"
#include <cstdlib>
//
// The main functiom for the amplitude calculation
//
// input: *parent - the pointer to the parent particle (B-meson, the
// object of the EvtParticle class);
// *formFactors - the pointer to instance of EvtbTosllFFNew class object;
// *WilsCoeff - the pointer to the Standart Model Wilson Coefficients class;
// mu - the scale parameter, GeV;
// Nf - number of "effective" flavors (for b-quark Nf=5);
// res_swch - resonant switching parameter:
// = 0 the resonant contribution switched OFF,
// = 1 the resonant contribution switched ON;
// ias - switching parameter for \alpha_s(M_Z) value:
// = 0 PDG 1sigma minimal alpha_s(M_Z),
// = 1 PDG average value alpha_s(M_Z),
// = 2 PDG 1sigma maximal alpha_s(M_Z).
// Wolfenstein parameterization for CKM matrix
// CKM_A, CKM_lambda, CKM_barrho, CKM_bareta
//
// return: amp - amplitude for the decay B -> V ell^+ ell^-
//
// Note: in our calculations we assume, that V-meson is the first
// daughter particle (iV=0) and leptons are the second and thirds
// daughter particles (il1=1 and il2=2).
//
void EvtbTosllVectorAmpNew::CalcAmp( EvtParticle* parent, EvtAmp& amp,
EvtbTosllFFNew* formFactors,
EvtbTosllWilsCoeffNLO* WilsCoeff,
double mu, int Nf, int res_swch, int ias,
double CKM_A, double CKM_lambda,
double CKM_barrho, double CKM_bareta )
{
// FILE *mytest;
EvtComplex unit1( 1.0, 0.0 ); // real unit
EvtComplex uniti( 0.0, 1.0 ); // imaginary unit
int iV = 0; // V-meson is the first daughter particle
int il1 = 1,
il2 = 2; // leptons are the second and thirds daughter particles
// transition momentum of the leptonic pair q=k1+k2 or q=p1-p2
EvtVector4R q = parent->getDaug( il1 )->getP4() +
parent->getDaug( il2 )->getP4();
// Mandelstam variable t=q^2
double q2 = q.mass2();
double M1 = parent->mass(); // B - meson mass
double M2 = parent->getDaug( iV )->mass(); // V - meson mass
double ml = parent->getDaug( il1 )->mass(); // leptonic mass
double ms = 0.0; // light quark mass from the dispersion QM
double mc = formFactors->getQuarkMass( 4 ); // m_c mass from the dispersion QM
double mb = formFactors->getQuarkMass( 5 ); // m_b mass from the dispersion QM
// double Mw = EvtPDL::getNominalMass("W+"); // W-boson mass
// double mt = EvtPDL::getNominalMass("t"); // t-quark mass
double Mw = 80.403; // GeV W-boson mass
double mt = 174.2; // GeV t-quark mass
EvtComplex Vtb, Vtq, Vub, Vuq; // V_{tb}, V_{tq}, V_{ub} and V_{uq}
EvtComplex CKM_factor; // V^*_{tq}*V_{tb}, where q={d,s}
EvtComplex lambda_qu; // V^*_{uq}*V_{ub}/V^*_{tq}*V_{tb}, where q={d,s}
double Relambda_qu, Imlambda_qu;
EvtId idparent = parent->getId(); // B-meson Id
EvtId iddaught = parent->getDaug( iV )->getId(); // The vector meson Id
// set of the light quark mass value
if ( ( idparent == EvtPDL::getId( std::string( "B+" ) ) &&
iddaught == EvtPDL::getId( std::string( "K*+" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B-" ) ) &&
iddaught == EvtPDL::getId( std::string( "K*-" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "K*0" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "anti-K*0" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B_s0" ) ) &&
iddaught == EvtPDL::getId( std::string( "phi" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B_s0" ) ) &&
iddaught == EvtPDL::getId( std::string( "phi" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B+" ) ) &&
iddaught == EvtPDL::getId( std::string( "K_1+" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B-" ) ) &&
iddaught == EvtPDL::getId( std::string( "K_1-" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "K_10" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "anti-K_10" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B+" ) ) &&
iddaught == EvtPDL::getId( std::string( "K'_1+" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B-" ) ) &&
iddaught == EvtPDL::getId( std::string( "K'_1-" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "K'_10" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "anti-K'_10" ) ) ) ) {
ms = formFactors->getQuarkMass( 3 ); // m_s mass from the dispersion QM
// V_{ts}
Vtq = unit1 * ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) ) +
pow( CKM_lambda, 2.0 ) *
( CKM_barrho * unit1 + CKM_bareta * uniti ) /
sqrt( 1.0 - pow( CKM_lambda, 2.0 ) );
Vtq = -CKM_A * pow( CKM_lambda, 2.0 ) * Vtq;
// V_{us}
Vuq = CKM_lambda * unit1;
}
if ( ( idparent == EvtPDL::getId( std::string( "B+" ) ) &&
iddaught == EvtPDL::getId( std::string( "rho+" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B-" ) ) &&
iddaught == EvtPDL::getId( std::string( "rho-" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "rho0" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "rho0" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "omega" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "omega" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B_s0" ) ) &&
iddaught == EvtPDL::getId( std::string( "anti-K*0" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B_s0" ) ) &&
iddaught == EvtPDL::getId( std::string( "K*0" ) ) ) ) {
ms = formFactors->getQuarkMass( 2 ); // m_d mass from the dispersion QM
// V_{td}
Vtq = unit1 - ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) ) *
( CKM_barrho * unit1 + CKM_bareta * uniti ) /
sqrt( 1.0 - pow( CKM_lambda, 2.0 ) );
Vtq = CKM_A * pow( CKM_lambda, 3.0 ) * Vtq;
// V_{ud}
Vuq = unit1 * ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) -
0.125 * pow( CKM_lambda, 4.0 ) );
}
if ( ms < 0.001 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function EvtbTosllVectorAmpNew::CalcAmp(...)"
<< "\n Error in the model set!"
<< " ms = " << ms << std::endl;
::abort();
}
Vtb = unit1 * ( 1.0 - 0.5 * pow( CKM_A * CKM_lambda * CKM_lambda,
2.0 ) ); // V_{tb}
Vub = CKM_A * pow( CKM_lambda, 3.0 ) *
( CKM_barrho * unit1 - CKM_bareta * uniti ) /
sqrt( 1.0 - pow( CKM_lambda, 2.0 ) ); // V_{ub}
CKM_factor = conj( Vtq ) * Vtb; // V^*_{tq}*V_{tb}
lambda_qu = conj( Vuq ) * Vub /
CKM_factor; // V^*_{uq}*V_{ub}/V^*_{tq}*V_{tb}
Relambda_qu = real( lambda_qu );
Imlambda_qu = imag( lambda_qu );
double a1, a2, a0, v, t1, t2, t3; // B -> V transition form-factors
// To get the B -> V transition form-factors
formFactors->getVectorFF( parent->getId(), parent->getDaug( iV )->getId(),
q2, a1, a2, a0, v, t1, t2, t3 );
// The Wilson Coefficients preparation according to the paper
// A.J.Buras, M.Munz, Phys.Rev.D52, p.189 (1995)
EvtComplex c7gam = WilsCoeff->GetC7Eff( mu, Mw, mt, Nf, ias );
EvtComplex c9eff_b2q = WilsCoeff->GetC9Eff( 0, res_swch, ias, Nf, q2, mb,
ms, mc, mu, mt, Mw, ml,
Relambda_qu, Imlambda_qu );
EvtComplex c9eff_barb2barq = WilsCoeff->GetC9Eff( 1, res_swch, ias, Nf, q2,
mb, ms, mc, mu, mt, Mw, ml,
Relambda_qu, Imlambda_qu );
EvtComplex c10a = WilsCoeff->GetC10Eff( mt, Mw );
// EvtGenReport(EVTGEN_NOTICE,"EvtGen") << "\n\n The function EvtbTosllVectorAmpNew::CalcAmp(...) passed."
// << "\n Particle masses:"
// << "\n B - meson mass M1 = " << M1
// << "\n V - meson mass M2 = " << M2
// << "\n leptonic mass ml = " << ml
// << "\n light quark mass = " << ms
// << "\n c - quark mass mc = " << mc
// << "\n b - quark mass mb = " << mb
// << "\n t - quark mass mt = " << mt
// << "\n W - boson mass Mw = " << Mw
// << "\n ============================================================================"
// << "\n Input parameters:"
// << "\n scale parameter mu = " << mu
// << "\n number of flavors Nf = " << Nf
// << "\n resonant switching = " << res_swch
// << "\n parameter for alpha_s(M_Z) = " << ias
// << "\n ============================================================================"
// << "\n Vector form-factors at q^2 = " << q2
// << " for B -> V transition:"
// << "\n v = " << v
// << "\n a0 = " << a0
// << "\n a1 = " << a1
// << "\n a2 = " << a2
// << "\n t1 = " << t1
// << "\n t2 = " << t2
// << "\n t3 = " << t3
// << "\n ============================================================================"
// << "\n Wilson Coefficients:"
// << "\n Re(c7gam) = " << real(c7gam) << " Im(c7gam) = " << imag(c7gam)
// << "\n Re(c9eff_b2q) = " << real(c9eff_b2q)
// << " Im(c9eff_b2q) = " << imag(c9eff_b2q)
// << "\n Re(c9eff_barb2barq) = " << real(c9eff_barb2barq)
// << " Im(c9eff_barb2barq) = " << imag(c9eff_barb2barq)
// << "\n Re(c10a) = " << real(c10a) << " Im(c10a) = " << imag(c10a)
// << std::endl;
// mytest = fopen("output.txt","a");
//
// if(mytest != NULL){
// fprintf(mytest,"%lf\n",q2);
// fclose(mytest);
// }
// else{
// EvtGenReport(EVTGEN_ERROR,"EvtGen") << "\n Error in writing to file.\n"
// << std::endl;
// return;
// }
// 4- momentum of the B-meson in the the B-meson rest frame
EvtVector4R p1 = parent->getP4Restframe();
EvtVector4R hatp1 = p1 / M1;
// 4-momentum of the V-meson in the B-meson rest frame
EvtVector4R p2 = parent->getDaug( 0 )->getP4();
EvtVector4R hatp2 = p2 / M1;
double hats = q2 / pow( M1, 2 );
double hatM2 = M2 / M1;
double hatmb = mb / M1;
double hatms = ms / M1;
// Hadronic matrix element coefficients according to the paper
// A. Ali, A. Salim Safir, Eur.Phys.J.C25, pp.583-601 (2002)
// with m_s.NE.0
EvtComplex a_b2q, a_barb2barq, b_b2q, b_barb2barq, c_b2q, c_barb2barq, e, f,
g, h;
a_b2q = 2.0 * c9eff_b2q * v / ( 1.0 + hatM2 ) +
4.0 * ( hatmb + hatms ) * c7gam * t1 / hats;
a_barb2barq = 2.0 * c9eff_barb2barq * v / ( 1.0 + hatM2 ) +
4.0 * ( hatmb + hatms ) * c7gam * t1 / hats;
b_b2q = ( c9eff_b2q * a1 +
2.0 * ( hatmb - hatms ) * ( 1.0 - hatM2 ) * c7gam * t2 / hats ) *
( 1.0 + hatM2 );
b_barb2barq = ( c9eff_barb2barq * a1 + 2.0 * ( hatmb - hatms ) *
( 1.0 - hatM2 ) * c7gam * t2 /
hats ) *
( 1.0 + hatM2 );
c_b2q = ( c9eff_b2q * ( 1.0 - hatM2 ) * a2 +
2.0 * ( hatmb - hatms ) * ( 1.0 - pow( hatM2, 2 ) ) * c7gam * t2 /
hats +
2.0 * ( hatmb - hatms ) * c7gam * t3 ) /
( 1 - pow( hatM2, 2 ) );
c_barb2barq = ( c9eff_barb2barq * ( 1.0 - hatM2 ) * a2 +
2.0 * ( hatmb - hatms ) * ( 1.0 - pow( hatM2, 2 ) ) *
c7gam * t2 / hats +
2.0 * ( hatmb - hatms ) * c7gam * t3 ) /
( 1 - pow( hatM2, 2 ) );
e = 2.0 * c10a * v / ( 1 + hatM2 );
f = ( 1.0 + hatM2 ) * c10a * a1;
g = c10a * a2 / ( 1 + hatM2 );
h = ( ( 1.0 + hatM2 ) * a1 - ( 1.0 - hatM2 ) * a2 - 2.0 * hatM2 * a0 ) *
c10a / hats;
// EvtGenReport(EVTGEN_NOTICE,"EvtGen") << " a_b2q = " << a_b2q
// << " a_barb2barq = " << a_barb2barq
// << " b_b2q = " << b_b2q
// << " b_barb2barq = " << b_barb2barq
// << " c_b2q = " << c_b2q
// << " c_barb2barq = " << c_barb2barq
// << " e = " << e
// << " f = " << f
// << " g = " << g
// << " h = " << h
// << std::endl;
// to find ell^+ and ell^- in the B-meson daughters
int charge1 = EvtPDL::chg3( parent->getDaug( 1 )->getId() );
int charge2 = EvtPDL::chg3( parent->getDaug( 2 )->getId() );
EvtParticle* lepPlus = nullptr;
EvtParticle* lepMinus = nullptr;
lepPlus = ( charge1 > charge2 ) ? parent->getDaug( 1 ) : parent->getDaug( 2 );
lepMinus = ( charge1 < charge2 ) ? parent->getDaug( 1 )
: parent->getDaug( 2 );
EvtTensor4C T1, T2; // hadronic matrix element tensor structures
EvtVector4C epsV; // vector meson polarisation vector
int i; // vector meson polarisations counter
EvtVector4C lvc11, lvc12; // spin structures for
EvtVector4C lvc21, lvc22; // the leptonic vector current
EvtVector4C lac11, lac12; // spin structures for
EvtVector4C lac21, lac22; // the leptonic axial current
// B - and barB - mesons descriptors
- EvtIdSet bmesons( "B-", "anti-B0", "anti-B_s0", "B_c-" );
- EvtIdSet bbarmesons( "B+", "B0", "B_s0", "B_c+" );
+ EvtIdSet bmesons{ "B-", "anti-B0", "anti-B_s0", "B_c-" };
+ EvtIdSet bbarmesons{ "B+", "B0", "B_s0", "B_c+" };
EvtId parentID = parent->getId();
if ( bmesons.contains( parentID ) ) {
// The amplitude for the decay barB -> barV ell^+ ell^-
// (b -> q ell^+ ell^- transition)
T1 = -a_b2q * unit1 * dual( EvtGenFunctions::directProd( hatp1, hatp2 ) ) -
b_b2q * uniti * EvtTensor4C::g() +
c_b2q * uniti *
EvtGenFunctions::directProd( ( hatp1 + hatp2 ), hatp1 );
T2 = -e * unit1 * dual( EvtGenFunctions::directProd( hatp1, hatp2 ) ) -
f * uniti * EvtTensor4C::g() +
g * uniti * EvtGenFunctions::directProd( ( hatp1 + hatp2 ), hatp1 ) +
h * uniti * EvtGenFunctions::directProd( ( hatp1 - hatp2 ), hatp1 );
lvc11 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
lvc21 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lvc12 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lvc22 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
lac11 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
lac21 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lac12 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lac22 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
// summing up vector meson polarisations \epsilon^*_{\nu}(i)
for ( i = 0; i < 3; i++ ) {
EvtVector4C epsV = parent->getDaug( 0 )->epsParent( i ).conj();
EvtVector4C E1 = M1 * T1.cont2( epsV );
EvtVector4C E2 = M1 * T2.cont2( epsV );
amp.vertex( i, 0, 0, CKM_factor * ( lvc11 * E1 + lac11 * E2 ) );
amp.vertex( i, 0, 1, CKM_factor * ( lvc12 * E1 + lac12 * E2 ) );
amp.vertex( i, 1, 0, CKM_factor * ( lvc21 * E1 + lac21 * E2 ) );
amp.vertex( i, 1, 1, CKM_factor * ( lvc22 * E1 + lac22 * E2 ) );
}
} else {
if ( bbarmesons.contains( parentID ) ) {
// The amplitude for the decay B -> V ell^+ ell^-
// (barb -> barq ell^+ ell^- transition)
T1 = a_barb2barq * unit1 *
dual( EvtGenFunctions::directProd( hatp1, hatp2 ) ) -
b_barb2barq * uniti * EvtTensor4C::g() +
c_barb2barq * uniti *
EvtGenFunctions::directProd( ( hatp1 + hatp2 ), hatp1 );
T2 = e * unit1 * dual( EvtGenFunctions::directProd( hatp1, hatp2 ) ) -
f * uniti * EvtTensor4C::g() +
g * uniti *
EvtGenFunctions::directProd( ( hatp1 + hatp2 ), hatp1 ) +
h * uniti *
EvtGenFunctions::directProd( ( hatp1 - hatp2 ), hatp1 );
lvc11 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
lvc21 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lvc12 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lvc22 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
lac11 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
lac21 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lac12 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lac22 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
// summing up vector meson polarisations \epsilon^*_{\nu}(i)
for ( i = 0; i < 3; i++ ) {
EvtVector4C barepsV = parent->getDaug( 0 )->epsParent( i ).conj();
EvtVector4C E3 = M1 * T1.cont2( barepsV );
EvtVector4C E4 = M1 * T2.cont2( barepsV );
amp.vertex( i, 0, 0,
conj( CKM_factor ) * ( lvc11 * E3 + lac11 * E4 ) );
amp.vertex( i, 0, 1,
conj( CKM_factor ) * ( lvc12 * E3 + lac12 * E4 ) );
amp.vertex( i, 1, 0,
conj( CKM_factor ) * ( lvc21 * E3 + lac21 * E4 ) );
amp.vertex( i, 1, 1,
conj( CKM_factor ) * ( lvc22 * E3 + lac22 * E4 ) );
}
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function EvtbTosllVectorAmpNew::CalcAmp(...)"
<< "\n Wrong B-meson number" << std::endl;
::abort();
}
}
// Test of the signature for Levi-Civita tensor
// EvtVector4C Vec0, Vec1, Vec2, Vec3;
// EvtTensor4C Ttest;
// Vec0.set(1.0,0.0,0.0,0.0);
// Vec1.set(0.0,1.0,0.0,0.0);
// Vec2.set(0.0,0.0,1.0,0.0);
// Vec3.set(0.0,0.0,0.0,1.0);
// Ttest=dual(directProd(Vec2,Vec3));
// EvtGenReport(EVTGEN_NOTICE,"EvtGen") << "\n\n\n e^{0123} =" << Ttest.get(0,1) << std::endl;
// EvtGenReport(EVTGEN_NOTICE,"EvtGen") << " e^{1023} =" << Ttest.get(1,0) << std::endl;
// EvtGenReport(EVTGEN_NOTICE,"EvtGen") << " e^{1123} =" << Ttest.get(1,1) << "\n" << std::endl;
// EvtVector4C Vtest=Ttest.cont2(Vec1);
// for(i=0;i<=3;i++){
// EvtGenReport(EVTGEN_NOTICE,"EvtGen") << " Vtest =" << Vtest.get(i) << std::endl;
// }
// EvtComplex Atest;
// Atest=Vec0*Vtest;
// EvtGenReport(EVTGEN_NOTICE,"EvtGen") << "\n Atest =" << Atest << "\n\n\n" << std::endl;
}
//
// The decays B -> V ell^+ ell^- maximum probability calculation for the
// d^2\Gamma/dq^2 d\cos\theta distribution.
//
// \theta - the angle between the vector meson and ell^- directions in the
// B-meson rest frame.
//
// If ias=0 (nonresonant case), the maximum is achieved at q2=q2_min=4*ml^2.
// If ias=1 (resonant case), the maximum is achieved at q2=M^2_{J/\psi}.
//
double EvtbTosllVectorAmpNew::CalcMaxProb(
EvtId parnum, EvtId mesnum, EvtId l1num, EvtId l2num,
EvtbTosllFFNew* formFactors, EvtbTosllWilsCoeffNLO* WilsCoeff, double mu,
int Nf, int res_swch, int ias, double CKM_A, double CKM_lambda,
double CKM_barrho, double CKM_bareta )
{
double maxfoundprob = -100.0; // maximum of the probability
int katmax = 0;
double M1 = EvtPDL::getMeanMass( parnum ); // B - meson mass
double M2 = EvtPDL::getMeanMass( mesnum ); // V - meson mass
double ml = EvtPDL::getMeanMass( l1num ); // leptonic mass
if ( res_swch == 0 ) {
// B-meson rest frame particles and they kinematics inicialization
double s_min, t_for_s;
s_min = 4.0 * pow( ml, 2.0 );
t_for_s = 0.5 *
( pow( M1, 2.0 ) + pow( M2, 2.0 ) - 2.0 * pow( ml, 2.0 ) );
double EV, El2;
EV = ( pow( M1, 2.0 ) + pow( M2, 2.0 ) - s_min ) /
( 2.0 * M1 ); // V-meson energy
El2 = ( s_min + t_for_s - pow( M2, 2.0 ) - pow( ml, 2.0 ) ) /
( 2.0 * M1 ); // ell^- energy
double modV, modl2;
modV = sqrt( pow( EV, 2.0 ) - pow( M2, 2.0 ) );
modl2 = sqrt( pow( El2, 2.0 ) - pow( ml, 2.0 ) );
double cosVellminus; // angle between the vector meson and ell^- directions
cosVellminus = ( pow( M2, 2.0 ) + pow( ml, 2.0 ) + 2.0 * EV * El2 -
t_for_s ) /
( 2.0 * modV * modl2 );
if ( ( fabs( cosVellminus ) > 1.0 ) &&
( fabs( cosVellminus ) <= 1.0001 ) ) {
// EvtGenReport(EVTGEN_DEBUG,"EvtGen")
// << "\n Debug in the function EvtbTosllVectorAmpNew::CalcMaxProb(...):"
// << "\n cos(theta) = " << cosVellminus
// << std::endl;
cosVellminus = cosVellminus / fabs( cosVellminus );
}
if ( ( modV <= 0.000001 ) || ( modl2 <= 0.000001 ) ) {
cosVellminus = cosVellminus / fabs( cosVellminus );
EvtGenReport( EVTGEN_NOTICE, "EvtGen" )
<< "\n Debug in the function EvtbTosllVectorAmpNew::CalcMaxProb(...):"
<< "\n modV = " << modV << "\n modl2 = " << modl2
<< "\n cos(theta) = " << cosVellminus
<< "\n t_for_s = " << t_for_s << "\n s_min = " << s_min
<< "\n EV = " << EV << "\n El2 = " << El2
<< "\n M2 = " << M2 << "\n ml = " << ml
<< std::endl;
}
if ( fabs( cosVellminus ) > 1.0001 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbTosllVectorAmpNew::CalcMaxProb(...)"
<< "\n |cos(theta)| = " << fabs( cosVellminus ) << " > 1"
<< "\n s_min = " << s_min << "\n t_for_s = " << t_for_s
<< "\n EV = " << EV << "\n El2 = " << El2
<< "\n modV = " << modV << "\n modl2 = " << modl2
<< "\n M2 = " << M2 << "\n ml = " << ml << std::endl;
::abort();
}
EvtVector4R p1, p2, k1, k2;
p1.set( M1, 0.0, 0.0, 0.0 );
p2.set( EV, modV, 0.0, 0.0 );
k2.set( El2, modl2 * cosVellminus,
-modl2 * sqrt( 1.0 - pow( cosVellminus, 2.0 ) ), 0.0 );
k1 = p1 - p2 - k2;
// EvtGenReport(EVTGEN_DEBUG,"EvtGen")
// << "\n Debug in the function EvtbTosllVectorAmpNew::CalcMaxProb(...):"
// << "\n mu =" << mu << " Nf =" << Nf
// << " res_swch =" << res_swch
// << " ias =" << ias
// << "\n CKM_A = " << CKM_A
// << " CKM_lambda = " << CKM_lambda
// << "\n CKM_barrho = " << CKM_barrho
// << " CKM_bareta = " << CKM_bareta
// << "\n M1 = " << M1
// << "\n M2 = " << M2
// << "\n ml = " << ml
// << "\n s_min = " << s_min
// << "\n t_for_s = " << t_for_s
// << "\n EV = " << EV
// << "\n El1 = " << El1
// << "\n El2 = " << El2
// << "\n modV = " << modV
// << "\n modl1 = " << modl1
// << "\n modl2 = " << modl2
// << "\n cos(theta) = " << cosVellminus
// << "\n p1 =" << p1
// << "\n p2 =" << p2
// << "\n k1 =" << k1
// << "\n k2 =" << k2
// << std::endl;
// B-meson state preparation at the rest frame of B-meson
EvtScalarParticle* scalar_part;
EvtParticle* root_part;
scalar_part = new EvtScalarParticle;
scalar_part->noLifeTime();
scalar_part->init( parnum, p1 );
root_part = (EvtParticle*)scalar_part;
root_part->setDiagonalSpinDensity();
// Amplitude initialization
EvtId listdaug[3];
listdaug[0] = mesnum;
listdaug[1] = l1num;
listdaug[2] = l2num;
EvtAmp amp;
amp.init( parnum, 3, listdaug );
// Daughters states preparation at the rest frame of B-meson
root_part->makeDaughters( 3, listdaug );
EvtParticle *vect, *lep1, *lep2;
vect = root_part->getDaug( 0 );
lep1 = root_part->getDaug( 1 );
lep2 = root_part->getDaug( 2 );
vect->noLifeTime();
lep1->noLifeTime();
lep2->noLifeTime();
vect->init( mesnum, p2 );
lep1->init( l1num, k1 );
lep2->init( l2num, k2 );
EvtSpinDensity rho;
rho.setDiag( root_part->getSpinStates() );
// The amplitude calculation at the
// "maximum amplitude" kinematical configuration
CalcAmp( root_part, amp, formFactors, WilsCoeff, mu, Nf, res_swch, ias,
CKM_A, CKM_lambda, CKM_barrho, CKM_bareta );
// Now find the probability at this q2 and cos theta lepton point
maxfoundprob = rho.normalizedProb( amp.getSpinDensity() );
delete scalar_part;
// delete root_part;
delete vect;
delete lep1;
delete lep2;
} // if(res_swch==0)
if ( res_swch == 1 ) {
double s, t_for_s; // Mandelstam variables
double t_plus, t_minus; // t-variable boundaries for current s-variable
double dt;
int k;
s = pow( 3.09688, 2.0 ); // s = (M_{J/\psi})^2
t_plus = pow( M1, 2.0 ) + pow( M2, 2.0 ) + 2.0 * pow( ml, 2.0 ) - s;
t_plus = t_plus + sqrt( 1.0 - 4.0 * pow( ml, 2.0 ) / s ) *
sqrt( lambda( s, pow( M1, 2.0 ), pow( M2, 2.0 ) ) );
t_plus *= 0.5;
t_minus = pow( M1, 2.0 ) + pow( M2, 2.0 ) + 2.0 * pow( ml, 2.0 ) - s;
t_minus = t_minus -
sqrt( 1.0 - 4.0 * pow( ml, 2.0 ) / s ) *
sqrt( lambda( s, pow( M1, 2.0 ), pow( M2, 2.0 ) ) );
t_minus *= 0.5;
dt = ( t_plus - t_minus ) / 1000.0;
// The maximum probability calculation
for ( k = 0; k <= 1000; k++ ) {
t_for_s = t_plus - dt * ( (double)k );
if ( ( t_for_s < t_minus ) && ( t_for_s >= ( 0.9999 * t_minus ) ) ) {
t_for_s = t_minus;
}
if ( t_for_s < ( 0.9999 * t_minus ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbTosllVectorAmpNew::CalcMaxProb(...)"
<< "\n t_for_s = " << t_for_s << " < t_minus = " << t_minus
<< " ! "
<< "\n t_plus = " << t_plus << "\n dt = " << dt
<< "\n k = " << k << "\n s = " << s
<< "\n M1 = " << M1 << "\n M2 = " << M2
<< "\n ml = " << ml << std::endl;
::abort();
}
// B-meson rest frame particles and they kinematics inicialization
double EV, El2;
EV = ( pow( M1, 2.0 ) + pow( M2, 2.0 ) - s ) /
( 2.0 * M1 ); // V-meson energy
El2 = ( s + t_for_s - pow( M2, 2.0 ) - pow( ml, 2.0 ) ) /
( 2.0 * M1 ); // ell^- energy
double modV, modl2;
modV = sqrt( pow( EV, 2.0 ) - pow( M2, 2.0 ) );
modl2 = sqrt( pow( El2, 2.0 ) - pow( ml, 2.0 ) );
double cosVellminus; // angle between the vector meson and ell^- directions
cosVellminus = ( pow( M2, 2.0 ) + pow( ml, 2.0 ) + 2.0 * EV * El2 -
t_for_s ) /
( 2.0 * modV * modl2 );
if ( ( fabs( cosVellminus ) > 1.0 ) &&
( fabs( cosVellminus ) <= 1.0001 ) ) {
// EvtGenReport(EVTGEN_DEBUG,"EvtGen")
// << "\n Debug in the function EvtbTosllVectorAmpNew::CalcMaxProb(...):"
// << "\n cos(theta) = " << cosVellminus
// << std::endl;
cosVellminus = cosVellminus / fabs( cosVellminus );
}
if ( ( modV <= 0.000001 ) || ( modl2 <= 0.000001 ) ) {
cosVellminus = cosVellminus / fabs( cosVellminus );
EvtGenReport( EVTGEN_NOTICE, "EvtGen" )
<< "\n Debug in the function EvtbTosllVectorAmpNew::CalcMaxProb(...):"
<< "\n modV = " << modV << "\n modl2 = " << modl2
<< "\n cos(theta) = " << cosVellminus
<< "\n s = " << s << "\n t_for_s = " << t_for_s
<< "\n t_plus = " << t_plus
<< "\n t_minus = " << t_minus << "\n dt = " << dt
<< "\n EV = " << EV << "\n El2 = " << El2
<< "\n M2 = " << M2 << "\n ml = " << ml
<< std::endl;
}
if ( fabs( cosVellminus ) > 1.0001 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbTosllVectorAmpNew::CalcMaxProb(...)"
<< "\n |cos(theta)| = " << fabs( cosVellminus ) << " > 1"
<< "\n s = " << s << "\n t_for_s = " << t_for_s
<< "\n EV = " << EV << "\n El2 = " << El2
<< "\n modV = " << modV << "\n modl2 = " << modl2
<< "\n M2 = " << M2 << "\n ml = " << ml
<< std::endl;
::abort();
}
EvtVector4R p1, p2, k1, k2;
p1.set( M1, 0.0, 0.0, 0.0 );
p2.set( EV, modV, 0.0, 0.0 );
k2.set( El2, modl2 * cosVellminus,
-modl2 * sqrt( 1.0 - pow( cosVellminus, 2.0 ) ), 0.0 );
k1 = p1 - p2 - k2;
// EvtGenReport(EVTGEN_DEBUG,"EvtGen")
// << "\n Debug in the function EvtbTosllVectorAmpNew::CalcMaxProb(...):"
// << "\n mu =" << mu << " Nf =" << Nf
// << " res_swch =" << res_swch
// << " ias =" << ias
// << "\n CKM_A = " << CKM_A
// << " CKM_lambda = " << CKM_lambda
// << "\n CKM_barrho = " << CKM_barrho
// << " CKM_bareta = " << CKM_bareta
// << "\n M1 = " << M1
// << "\n M2 = " << M2
// << "\n ml = " << ml
// << "\n s = " << s
// << "\n t_for_s = " << t_for_s
// << "\n EV = " << EV
// << "\n El1 = " << El1
// << "\n El2 = " << El2
// << "\n modV = " << modV
// << "\n modl1 = " << modl1
// << "\n modl2 = " << modl2
// << "\n cos(theta) = " << cosVellminus
// << "\n p1 =" << p1
// << "\n p2 =" << p2
// << "\n k1 =" << k1
// << "\n k2 =" << k2
// << std::endl;
// B-meson state preparation at the rest frame of B-meson
EvtScalarParticle* scalar_part;
EvtParticle* root_part;
scalar_part = new EvtScalarParticle;
scalar_part->noLifeTime();
scalar_part->init( parnum, p1 );
root_part = (EvtParticle*)scalar_part;
root_part->setDiagonalSpinDensity();
// Amplitude initialization
EvtId listdaug[3];
listdaug[0] = mesnum;
listdaug[1] = l1num;
listdaug[2] = l2num;
EvtAmp amp;
amp.init( parnum, 3, listdaug );
// Daughters states preparation at the rest frame of B-meson
root_part->makeDaughters( 3, listdaug );
EvtParticle *vect, *lep1, *lep2;
vect = root_part->getDaug( 0 );
lep1 = root_part->getDaug( 1 );
lep2 = root_part->getDaug( 2 );
vect->noLifeTime();
lep1->noLifeTime();
lep2->noLifeTime();
vect->init( mesnum, p2 );
lep1->init( l1num, k1 );
lep2->init( l2num, k2 );
EvtSpinDensity rho;
rho.setDiag( root_part->getSpinStates() );
// The amplitude calculation at the
// "maximum amplitude" kinematical configuration
CalcAmp( root_part, amp, formFactors, WilsCoeff, mu, Nf, res_swch,
ias, CKM_A, CKM_lambda, CKM_barrho, CKM_bareta );
// Now find the probability at this q2 and cos theta lepton point
double nikmax = rho.normalizedProb( amp.getSpinDensity() );
if ( nikmax > maxfoundprob ) {
maxfoundprob = nikmax;
katmax = k;
EvtGenReport( EVTGEN_NOTICE, "EvtGen" )
<< "\n maxfoundprob ( s =" << s << ", t = " << t_for_s
<< " ) = " << maxfoundprob << "\n k =" << katmax
<< std::endl;
}
delete scalar_part;
// delete root_part;
delete vect;
delete lep1;
delete lep2;
} // for(k=0; k<=1000; k++)
} // if(res_swch==1)
if ( maxfoundprob <= 0.0 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbTosllVectorAmpNew::CalcMaxProb(...)"
<< "\n maxfoundprob = " << maxfoundprob << " <0 or =0!"
<< "\n res_swch = " << res_swch << std::endl;
::abort();
}
EvtGenReport( EVTGEN_NOTICE, "EvtGen" )
<< "\n maxfoundprob (...) = " << maxfoundprob << std::endl;
maxfoundprob *= 1.01;
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n ***************************************************************************"
// << "\n The function EvtbTosllVectorAmpNew::CalcMaxProb(...) passed with arguments:"
// << "\n mu =" << mu << " Nf =" << Nf
// << " res_swch =" << res_swch
// << " ias =" << ias
// << "\n CKM_A = " << CKM_A
// << " CKM_lambda = " << CKM_lambda
// << "\n CKM_barrho = " << CKM_barrho
// << " CKM_bareta = " << CKM_bareta
// << "\n The distribution maximum maxfoundprob =" << maxfoundprob
// << "\n k = " << katmax
// << "\n ***************************************************************************"
// << std::endl;
return maxfoundprob;
}
// Triangular function
double EvtbTosllVectorAmpNew::lambda( double a, double b, double c )
{
double l;
l = pow( a, 2.0 ) + pow( b, 2.0 ) + pow( c, 2.0 ) - 2.0 * a * b -
2.0 * a * c - 2.0 * b * c;
return l;
}
diff --git a/src/EvtGenModels/EvtbTosllVectorAmpNewExt.cpp b/src/EvtGenModels/EvtbTosllVectorAmpNewExt.cpp
index 650278e..59c8e47 100644
--- a/src/EvtGenModels/EvtbTosllVectorAmpNewExt.cpp
+++ b/src/EvtGenModels/EvtbTosllVectorAmpNewExt.cpp
@@ -1,882 +1,882 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenModels/EvtbTosllVectorAmpNewExt.hh"
#include "EvtGenBase/EvtAmp.hh"
#include "EvtGenBase/EvtComplex.hh"
#include "EvtGenBase/EvtDiracSpinor.hh"
#include "EvtGenBase/EvtGenKine.hh"
#include "EvtGenBase/EvtId.hh"
#include "EvtGenBase/EvtIdSet.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtPatches.hh"
#include "EvtGenBase/EvtReport.hh"
#include "EvtGenBase/EvtScalarParticle.hh"
#include "EvtGenBase/EvtTensor4C.hh"
#include "EvtGenBase/EvtVector4C.hh"
#include "EvtGenBase/EvtVectorParticle.hh"
#include "EvtGenModels/EvtbTosllAmpNewExt.hh"
#include "EvtGenModels/EvtbTosllFFNew.hh"
#include "EvtGenModels/EvtbTosllWilsCoeffNLO.hh"
#include <cstdlib>
//
// The main functiom for the amplitude calculation
//
// input: *parent - the pointer to the parent particle (B-meson, the
// object of the EvtParticle class);
// *formFactors - the pointer to instance of EvtbTosllFFNew class object;
// *WilsCoeff - the pointer to the Standart Model Wilson Coefficients class;
// mu - the scale parameter, GeV;
// Nf - number of "effective" flavors (for b-quark Nf=5);
// res_swch - resonant switching parameter:
// = 0 the resonant contribution switched OFF,
// = 1 the resonant contribution switched ON;
// ias - switching parameter for \alpha_s(M_Z) value:
// = 0 PDG 1sigma minimal alpha_s(M_Z),
// = 1 PDG average value alpha_s(M_Z),
// = 2 PDG 1sigma maximal alpha_s(M_Z).
// Wolfenstein parameterization for CKM matrix
// CKM_A, CKM_lambda, CKM_barrho, CKM_bareta
// Multiplication coefficients
// A7 = ReA7 + i*ImA7
// A10 = ReA10 + i*ImA10
//
// return: amp - amplitude for the decay B -> V ell^+ ell^-
//
// Note: in our calculations we assume, that V-meson is the first
// daughter particle (iV=0) and leptons are the second and thirds
// daughter particles (il1=1 and il2=2).
//
void EvtbTosllVectorAmpNewExt::CalcAmp(
EvtParticle* parent, EvtAmp& amp, EvtbTosllFFNew* formFactors,
EvtbTosllWilsCoeffNLO* WilsCoeff, double mu, int Nf, int res_swch, int ias,
double CKM_A, double CKM_lambda, double CKM_barrho, double CKM_bareta,
double ReA7, double ImA7, double ReA10, double ImA10 )
{
// FILE *mytest;
EvtComplex unit1( 1.0, 0.0 ); // real unit
EvtComplex uniti( 0.0, 1.0 ); // imaginary unit
EvtComplex A7 = ReA7 * unit1 + ImA7 * uniti;
EvtComplex A10 = ReA10 * unit1 + ImA10 * uniti;
int iV = 0; // V-meson is the first daughter particle
int il1 = 1,
il2 = 2; // leptons are the second and thirds daughter particles
// transition momentum of the leptonic pair q=k1+k2 or q=p1-p2
EvtVector4R q = parent->getDaug( il1 )->getP4() +
parent->getDaug( il2 )->getP4();
// Mandelstam variable t=q^2
double q2 = q.mass2();
double M1 = parent->mass(); // B - meson mass
double M2 = parent->getDaug( iV )->mass(); // V - meson mass
double ml = parent->getDaug( il1 )->mass(); // leptonic mass
double ms = 0.0; // light quark mass from the dispersion QM
double mc = formFactors->getQuarkMass( 4 ); // m_c mass from the dispersion QM
double mb = formFactors->getQuarkMass( 5 ); // m_b mass from the dispersion QM
// double Mw = EvtPDL::getNominalMass("W+"); // W-boson mass
// double mt = EvtPDL::getNominalMass("t"); // t-quark mass
double Mw = 80.403; // GeV W-boson mass
double mt = 174.2; // GeV t-quark mass
EvtComplex Vtb, Vtq, Vub, Vuq; // V_{tb}, V_{tq}, V_{ub} and V_{uq}
EvtComplex CKM_factor; // V^*_{tq}*V_{tb}, where q={d,s}
EvtComplex lambda_qu; // V^*_{uq}*V_{ub}/V^*_{tq}*V_{tb}, where q={d,s}
double Relambda_qu, Imlambda_qu;
EvtId idparent = parent->getId(); // B-meson Id
EvtId iddaught = parent->getDaug( iV )->getId(); // The vector meson Id
// set of the light quark mass value
if ( ( idparent == EvtPDL::getId( std::string( "B+" ) ) &&
iddaught == EvtPDL::getId( std::string( "K*+" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B-" ) ) &&
iddaught == EvtPDL::getId( std::string( "K*-" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "K*0" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "anti-K*0" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B_s0" ) ) &&
iddaught == EvtPDL::getId( std::string( "phi" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B_s0" ) ) &&
iddaught == EvtPDL::getId( std::string( "phi" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B+" ) ) &&
iddaught == EvtPDL::getId( std::string( "K_1+" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B-" ) ) &&
iddaught == EvtPDL::getId( std::string( "K_1-" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "K_10" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "anti-K_10" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B+" ) ) &&
iddaught == EvtPDL::getId( std::string( "K'_1+" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B-" ) ) &&
iddaught == EvtPDL::getId( std::string( "K'_1-" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "K'_10" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "anti-K'_10" ) ) ) ) {
ms = formFactors->getQuarkMass( 3 ); // m_s mass from the dispersion QM
// V_{ts}
Vtq = unit1 * ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) ) +
pow( CKM_lambda, 2.0 ) *
( CKM_barrho * unit1 + CKM_bareta * uniti ) /
sqrt( 1.0 - pow( CKM_lambda, 2.0 ) );
Vtq = -CKM_A * pow( CKM_lambda, 2.0 ) * Vtq;
// V_{us}
Vuq = CKM_lambda * unit1;
}
if ( ( idparent == EvtPDL::getId( std::string( "B+" ) ) &&
iddaught == EvtPDL::getId( std::string( "rho+" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B-" ) ) &&
iddaught == EvtPDL::getId( std::string( "rho-" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "rho0" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "rho0" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "omega" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B0" ) ) &&
iddaught == EvtPDL::getId( std::string( "omega" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "B_s0" ) ) &&
iddaught == EvtPDL::getId( std::string( "anti-K*0" ) ) ) ||
( idparent == EvtPDL::getId( std::string( "anti-B_s0" ) ) &&
iddaught == EvtPDL::getId( std::string( "K*0" ) ) ) ) {
ms = formFactors->getQuarkMass( 2 ); // m_d mass from the dispersion QM
// V_{td}
Vtq = unit1 - ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) ) *
( CKM_barrho * unit1 + CKM_bareta * uniti ) /
sqrt( 1.0 - pow( CKM_lambda, 2.0 ) );
Vtq = CKM_A * pow( CKM_lambda, 3.0 ) * Vtq;
// V_{ud}
Vuq = unit1 * ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) -
0.125 * pow( CKM_lambda, 4.0 ) );
}
if ( ms < 0.001 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function EvtbTosllVectorAmpNew::CalcAmp(...)"
<< "\n Error in the model set!"
<< " ms = " << ms << std::endl;
::abort();
}
Vtb = unit1 * ( 1.0 - 0.5 * pow( CKM_A * CKM_lambda * CKM_lambda,
2.0 ) ); // V_{tb}
Vub = CKM_A * pow( CKM_lambda, 3.0 ) *
( CKM_barrho * unit1 - CKM_bareta * uniti ) /
sqrt( 1.0 - pow( CKM_lambda, 2.0 ) ); // V_{ub}
CKM_factor = conj( Vtq ) * Vtb; // V^*_{tq}*V_{tb}
lambda_qu = conj( Vuq ) * Vub /
CKM_factor; // V^*_{uq}*V_{ub}/V^*_{tq}*V_{tb}
Relambda_qu = real( lambda_qu );
Imlambda_qu = imag( lambda_qu );
double a1, a2, a0, v, t1, t2, t3; // B -> V transition form-factors
// To get the B -> V transition form-factors
formFactors->getVectorFF( parent->getId(), parent->getDaug( iV )->getId(),
q2, a1, a2, a0, v, t1, t2, t3 );
// The Wilson Coefficients preparation according to the paper
// A.J.Buras, M.Munz, Phys.Rev.D52, p.189 (1995)
EvtComplex c7gam = WilsCoeff->GetC7Eff( mu, Mw, mt, Nf, ias );
c7gam = c7gam * A7;
EvtComplex c9eff_b2q = WilsCoeff->GetC9Eff( 0, res_swch, ias, Nf, q2, mb,
ms, mc, mu, mt, Mw, ml,
Relambda_qu, Imlambda_qu );
EvtComplex c9eff_barb2barq = WilsCoeff->GetC9Eff( 1, res_swch, ias, Nf, q2,
mb, ms, mc, mu, mt, Mw, ml,
Relambda_qu, Imlambda_qu );
EvtComplex c10a = WilsCoeff->GetC10Eff( mt, Mw );
c10a = c10a * A10;
// EvtGenReport(EVTGEN_NOTICE,"EvtGen") << "\n\n The function EvtbTosllVectorAmpNew::CalcAmp(...) passed."
// << "\n Particle masses:"
// << "\n B - meson mass M1 = " << M1
// << "\n V - meson mass M2 = " << M2
// << "\n leptonic mass ml = " << ml
// << "\n light quark mass = " << ms
// << "\n c - quark mass mc = " << mc
// << "\n b - quark mass mb = " << mb
// << "\n t - quark mass mt = " << mt
// << "\n W - boson mass Mw = " << Mw
// << "\n ============================================================================"
// << "\n Input parameters:"
// << "\n scale parameter mu = " << mu
// << "\n number of flavors Nf = " << Nf
// << "\n resonant switching = " << res_swch
// << "\n parameter for alpha_s(M_Z) = " << ias
// << "\n ============================================================================"
// << "\n Vector form-factors at q^2 = " << q2
// << " for B -> V transition:"
// << "\n v = " << v
// << "\n a0 = " << a0
// << "\n a1 = " << a1
// << "\n a2 = " << a2
// << "\n t1 = " << t1
// << "\n t2 = " << t2
// << "\n t3 = " << t3
// << "\n ============================================================================"
// << "\n Wilson Coefficients:"
// << "\n Re(c7gam) = " << real(c7gam) << " Im(c7gam) = " << imag(c7gam)
// << "\n Re(c9eff_b2q) = " << real(c9eff_b2q)
// << " Im(c9eff_b2q) = " << imag(c9eff_b2q)
// << "\n Re(c9eff_barb2barq) = " << real(c9eff_barb2barq)
// << " Im(c9eff_barb2barq) = " << imag(c9eff_barb2barq)
// << "\n Re(c10a) = " << real(c10a) << " Im(c10a) = " << imag(c10a)
// << std::endl;
// mytest = fopen("output.txt","a");
//
// if(mytest != NULL){
// fprintf(mytest,"%lf\n",q2);
// fclose(mytest);
// }
// else{
// EvtGenReport(EVTGEN_ERROR,"EvtGen") << "\n Error in writing to file.\n"
// << std::endl;
// return;
// }
// 4- momentum of the B-meson in the the B-meson rest frame
EvtVector4R p1 = parent->getP4Restframe();
EvtVector4R hatp1 = p1 / M1;
// 4-momentum of the V-meson in the B-meson rest frame
EvtVector4R p2 = parent->getDaug( 0 )->getP4();
EvtVector4R hatp2 = p2 / M1;
double hats = q2 / pow( M1, 2 );
double hatM2 = M2 / M1;
double hatmb = mb / M1;
double hatms = ms / M1;
// Hadronic matrix element coefficients according to the paper
// A. Ali, A. Salim Safir, Eur.Phys.J.C25, pp.583-601 (2002)
// with m_s.NE.0
EvtComplex a_b2q, a_barb2barq, b_b2q, b_barb2barq, c_b2q, c_barb2barq, e, f,
g, h;
a_b2q = 2.0 * c9eff_b2q * v / ( 1.0 + hatM2 ) +
4.0 * ( hatmb + hatms ) * c7gam * t1 / hats;
a_barb2barq = 2.0 * c9eff_barb2barq * v / ( 1.0 + hatM2 ) +
4.0 * ( hatmb + hatms ) * c7gam * t1 / hats;
b_b2q = ( c9eff_b2q * a1 +
2.0 * ( hatmb - hatms ) * ( 1.0 - hatM2 ) * c7gam * t2 / hats ) *
( 1.0 + hatM2 );
b_barb2barq = ( c9eff_barb2barq * a1 + 2.0 * ( hatmb - hatms ) *
( 1.0 - hatM2 ) * c7gam * t2 /
hats ) *
( 1.0 + hatM2 );
c_b2q = ( c9eff_b2q * ( 1.0 - hatM2 ) * a2 +
2.0 * ( hatmb - hatms ) * ( 1.0 - pow( hatM2, 2 ) ) * c7gam * t2 /
hats +
2.0 * ( hatmb - hatms ) * c7gam * t3 ) /
( 1 - pow( hatM2, 2 ) );
c_barb2barq = ( c9eff_barb2barq * ( 1.0 - hatM2 ) * a2 +
2.0 * ( hatmb - hatms ) * ( 1.0 - pow( hatM2, 2 ) ) *
c7gam * t2 / hats +
2.0 * ( hatmb - hatms ) * c7gam * t3 ) /
( 1 - pow( hatM2, 2 ) );
e = 2.0 * c10a * v / ( 1 + hatM2 );
f = ( 1.0 + hatM2 ) * c10a * a1;
g = c10a * a2 / ( 1 + hatM2 );
h = ( ( 1.0 + hatM2 ) * a1 - ( 1.0 - hatM2 ) * a2 - 2.0 * hatM2 * a0 ) *
c10a / hats;
// EvtGenReport(EVTGEN_NOTICE,"EvtGen") << " a_b2q = " << a_b2q
// << " a_barb2barq = " << a_barb2barq
// << " b_b2q = " << b_b2q
// << " b_barb2barq = " << b_barb2barq
// << " c_b2q = " << c_b2q
// << " c_barb2barq = " << c_barb2barq
// << " e = " << e
// << " f = " << f
// << " g = " << g
// << " h = " << h
// << std::endl;
// to find ell^+ and ell^- in the B-meson daughters
int charge1 = EvtPDL::chg3( parent->getDaug( 1 )->getId() );
int charge2 = EvtPDL::chg3( parent->getDaug( 2 )->getId() );
EvtParticle* lepPlus = nullptr;
EvtParticle* lepMinus = nullptr;
lepPlus = ( charge1 > charge2 ) ? parent->getDaug( 1 ) : parent->getDaug( 2 );
lepMinus = ( charge1 < charge2 ) ? parent->getDaug( 1 )
: parent->getDaug( 2 );
EvtTensor4C T1, T2; // hadronic matrix element tensor structures
EvtVector4C epsV; // vector meson polarisation vector
int i; // vector meson polarisations counter
EvtVector4C lvc11, lvc12; // spin structures for
EvtVector4C lvc21, lvc22; // the leptonic vector current
EvtVector4C lac11, lac12; // spin structures for
EvtVector4C lac21, lac22; // the leptonic axial current
// B - and barB - mesons descriptors
- EvtIdSet bmesons( "B-", "anti-B0", "anti-B_s0", "B_c-" );
- EvtIdSet bbarmesons( "B+", "B0", "B_s0", "B_c+" );
+ EvtIdSet bmesons{ "B-", "anti-B0", "anti-B_s0", "B_c-" };
+ EvtIdSet bbarmesons{ "B+", "B0", "B_s0", "B_c+" };
EvtId parentID = parent->getId();
if ( bmesons.contains( parentID ) ) {
// The amplitude for the decay barB -> barV ell^+ ell^-
// (b -> q ell^+ ell^- transition)
T1 = -a_b2q * unit1 * dual( EvtGenFunctions::directProd( hatp1, hatp2 ) ) -
b_b2q * uniti * EvtTensor4C::g() +
c_b2q * uniti *
EvtGenFunctions::directProd( ( hatp1 + hatp2 ), hatp1 );
T2 = -e * unit1 * dual( EvtGenFunctions::directProd( hatp1, hatp2 ) ) -
f * uniti * EvtTensor4C::g() +
g * uniti * EvtGenFunctions::directProd( ( hatp1 + hatp2 ), hatp1 ) +
h * uniti * EvtGenFunctions::directProd( ( hatp1 - hatp2 ), hatp1 );
lvc11 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
lvc21 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lvc12 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lvc22 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
lac11 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
lac21 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lac12 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lac22 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
// summing up vector meson polarisations \epsilon^*_{\nu}(i)
for ( i = 0; i < 3; i++ ) {
EvtVector4C epsV = parent->getDaug( 0 )->epsParent( i ).conj();
EvtVector4C E1 = M1 * T1.cont2( epsV );
EvtVector4C E2 = M1 * T2.cont2( epsV );
amp.vertex( i, 0, 0, CKM_factor * ( lvc11 * E1 + lac11 * E2 ) );
amp.vertex( i, 0, 1, CKM_factor * ( lvc12 * E1 + lac12 * E2 ) );
amp.vertex( i, 1, 0, CKM_factor * ( lvc21 * E1 + lac21 * E2 ) );
amp.vertex( i, 1, 1, CKM_factor * ( lvc22 * E1 + lac22 * E2 ) );
}
} else {
if ( bbarmesons.contains( parentID ) ) {
// The amplitude for the decay B -> V ell^+ ell^-
// (barb -> barq ell^+ ell^- transition)
T1 = a_barb2barq * unit1 *
dual( EvtGenFunctions::directProd( hatp1, hatp2 ) ) -
b_barb2barq * uniti * EvtTensor4C::g() +
c_barb2barq * uniti *
EvtGenFunctions::directProd( ( hatp1 + hatp2 ), hatp1 );
T2 = e * unit1 * dual( EvtGenFunctions::directProd( hatp1, hatp2 ) ) -
f * uniti * EvtTensor4C::g() +
g * uniti *
EvtGenFunctions::directProd( ( hatp1 + hatp2 ), hatp1 ) +
h * uniti *
EvtGenFunctions::directProd( ( hatp1 - hatp2 ), hatp1 );
lvc11 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
lvc21 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lvc12 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lvc22 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
lac11 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
lac21 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lac12 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lac22 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
// summing up vector meson polarisations \epsilon^*_{\nu}(i)
for ( i = 0; i < 3; i++ ) {
EvtVector4C barepsV = parent->getDaug( 0 )->epsParent( i ).conj();
EvtVector4C E3 = M1 * T1.cont2( barepsV );
EvtVector4C E4 = M1 * T2.cont2( barepsV );
amp.vertex( i, 0, 0,
conj( CKM_factor ) * ( lvc11 * E3 + lac11 * E4 ) );
amp.vertex( i, 0, 1,
conj( CKM_factor ) * ( lvc12 * E3 + lac12 * E4 ) );
amp.vertex( i, 1, 0,
conj( CKM_factor ) * ( lvc21 * E3 + lac21 * E4 ) );
amp.vertex( i, 1, 1,
conj( CKM_factor ) * ( lvc22 * E3 + lac22 * E4 ) );
}
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function EvtbTosllVectorAmpNew::CalcAmp(...)"
<< "\n Wrong B-meson number" << std::endl;
::abort();
}
}
// Test of the signature for Levi-Civita tensor
// EvtVector4C Vec0, Vec1, Vec2, Vec3;
// EvtTensor4C Ttest;
// Vec0.set(1.0,0.0,0.0,0.0);
// Vec1.set(0.0,1.0,0.0,0.0);
// Vec2.set(0.0,0.0,1.0,0.0);
// Vec3.set(0.0,0.0,0.0,1.0);
// Ttest=dual(directProd(Vec2,Vec3));
// EvtGenReport(EVTGEN_NOTICE,"EvtGen") << "\n\n\n e^{0123} =" << Ttest.get(0,1) << std::endl;
// EvtGenReport(EVTGEN_NOTICE,"EvtGen") << " e^{1023} =" << Ttest.get(1,0) << std::endl;
// EvtGenReport(EVTGEN_NOTICE,"EvtGen") << " e^{1123} =" << Ttest.get(1,1) << "\n" << std::endl;
// EvtVector4C Vtest=Ttest.cont2(Vec1);
// for(i=0;i<=3;i++){
// EvtGenReport(EVTGEN_NOTICE,"EvtGen") << " Vtest =" << Vtest.get(i) << std::endl;
// }
// EvtComplex Atest;
// Atest=Vec0*Vtest;
// EvtGenReport(EVTGEN_NOTICE,"EvtGen") << "\n Atest =" << Atest << "\n\n\n" << std::endl;
}
//
// The decays B -> V ell^+ ell^- maximum probability calculation for the
// d^2\Gamma/dq^2 d\cos\theta distribution.
//
// \theta - the angle between the vector meson and ell^- directions in the
// B-meson rest frame.
//
// If ias=0 (nonresonant case), the maximum is achieved at q2=q2_min=4*ml^2.
// If ias=1 (resonant case), the maximum is achieved at q2=M^2_{J/\psi}.
//
double EvtbTosllVectorAmpNewExt::CalcMaxProb(
EvtId parnum, EvtId mesnum, EvtId l1num, EvtId l2num,
EvtbTosllFFNew* formFactors, EvtbTosllWilsCoeffNLO* WilsCoeff, double mu,
int Nf, int res_swch, int ias, double CKM_A, double CKM_lambda,
double CKM_barrho, double CKM_bareta, double ReA7, double ImA7,
double ReA10, double ImA10 )
{
double maxfoundprob = -100.0; // maximum of the probability
int katmax = 0;
double M1 = EvtPDL::getMeanMass( parnum ); // B - meson mass
double M2 = EvtPDL::getMeanMass( mesnum ); // V - meson mass
double ml = EvtPDL::getMeanMass( l1num ); // leptonic mass
if ( res_swch == 0 ) {
// B-meson rest frame particles and they kinematics inicialization
double s_min, t_for_s;
s_min = 4.0 * pow( ml, 2.0 );
t_for_s = 0.5 *
( pow( M1, 2.0 ) + pow( M2, 2.0 ) - 2.0 * pow( ml, 2.0 ) );
double EV, El2;
EV = ( pow( M1, 2.0 ) + pow( M2, 2.0 ) - s_min ) /
( 2.0 * M1 ); // V-meson energy
El2 = ( s_min + t_for_s - pow( M2, 2.0 ) - pow( ml, 2.0 ) ) /
( 2.0 * M1 ); // ell^- energy
double modV, modl2;
modV = sqrt( pow( EV, 2.0 ) - pow( M2, 2.0 ) );
modl2 = sqrt( pow( El2, 2.0 ) - pow( ml, 2.0 ) );
double cosVellminus; // angle between the vector meson and ell^- directions
cosVellminus = ( pow( M2, 2.0 ) + pow( ml, 2.0 ) + 2.0 * EV * El2 -
t_for_s ) /
( 2.0 * modV * modl2 );
if ( ( fabs( cosVellminus ) > 1.0 ) &&
( fabs( cosVellminus ) <= 1.0001 ) ) {
// EvtGenReport(EVTGEN_DEBUG,"EvtGen")
// << "\n Debug in the function EvtbTosllVectorAmpNew::CalcMaxProb(...):"
// << "\n cos(theta) = " << cosVellminus
// << std::endl;
cosVellminus = cosVellminus / fabs( cosVellminus );
}
if ( ( modV <= 0.000001 ) || ( modl2 <= 0.000001 ) ) {
cosVellminus = cosVellminus / fabs( cosVellminus );
EvtGenReport( EVTGEN_NOTICE, "EvtGen" )
<< "\n Debug in the function EvtbTosllVectorAmpNew::CalcMaxProb(...):"
<< "\n modV = " << modV << "\n modl2 = " << modl2
<< "\n cos(theta) = " << cosVellminus
<< "\n t_for_s = " << t_for_s << "\n s_min = " << s_min
<< "\n EV = " << EV << "\n El2 = " << El2
<< "\n M2 = " << M2 << "\n ml = " << ml
<< std::endl;
}
if ( fabs( cosVellminus ) > 1.0001 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbTosllVectorAmpNew::CalcMaxProb(...)"
<< "\n |cos(theta)| = " << fabs( cosVellminus ) << " > 1"
<< "\n s_min = " << s_min << "\n t_for_s = " << t_for_s
<< "\n EV = " << EV << "\n El2 = " << El2
<< "\n modV = " << modV << "\n modl2 = " << modl2
<< "\n M2 = " << M2 << "\n ml = " << ml << std::endl;
::abort();
}
EvtVector4R p1, p2, k1, k2;
p1.set( M1, 0.0, 0.0, 0.0 );
p2.set( EV, modV, 0.0, 0.0 );
k2.set( El2, modl2 * cosVellminus,
-modl2 * sqrt( 1.0 - pow( cosVellminus, 2.0 ) ), 0.0 );
k1 = p1 - p2 - k2;
// EvtGenReport(EVTGEN_DEBUG,"EvtGen")
// << "\n Debug in the function EvtbTosllVectorAmpNew::CalcMaxProb(...):"
// << "\n mu =" << mu << " Nf =" << Nf
// << " res_swch =" << res_swch
// << " ias =" << ias
// << "\n CKM_A = " << CKM_A
// << " CKM_lambda = " << CKM_lambda
// << "\n CKM_barrho = " << CKM_barrho
// << " CKM_bareta = " << CKM_bareta
// << "\n M1 = " << M1
// << "\n M2 = " << M2
// << "\n ml = " << ml
// << "\n s_min = " << s_min
// << "\n t_for_s = " << t_for_s
// << "\n EV = " << EV
// << "\n El1 = " << El1
// << "\n El2 = " << El2
// << "\n modV = " << modV
// << "\n modl1 = " << modl1
// << "\n modl2 = " << modl2
// << "\n cos(theta) = " << cosVellminus
// << "\n p1 =" << p1
// << "\n p2 =" << p2
// << "\n k1 =" << k1
// << "\n k2 =" << k2
// << std::endl;
// B-meson state preparation at the rest frame of B-meson
EvtScalarParticle* scalar_part;
EvtParticle* root_part;
scalar_part = new EvtScalarParticle;
scalar_part->noLifeTime();
scalar_part->init( parnum, p1 );
root_part = (EvtParticle*)scalar_part;
root_part->setDiagonalSpinDensity();
// Amplitude initialization
EvtId listdaug[3];
listdaug[0] = mesnum;
listdaug[1] = l1num;
listdaug[2] = l2num;
EvtAmp amp;
amp.init( parnum, 3, listdaug );
// Daughters states preparation at the rest frame of B-meson
root_part->makeDaughters( 3, listdaug );
EvtParticle *vect, *lep1, *lep2;
vect = root_part->getDaug( 0 );
lep1 = root_part->getDaug( 1 );
lep2 = root_part->getDaug( 2 );
vect->noLifeTime();
lep1->noLifeTime();
lep2->noLifeTime();
vect->init( mesnum, p2 );
lep1->init( l1num, k1 );
lep2->init( l2num, k2 );
EvtSpinDensity rho;
rho.setDiag( root_part->getSpinStates() );
// The amplitude calculation at the
// "maximum amplitude" kinematical configuration
CalcAmp( root_part, amp, formFactors, WilsCoeff, mu, Nf, res_swch, ias,
CKM_A, CKM_lambda, CKM_barrho, CKM_bareta, ReA7, ImA7, ReA10,
ImA10 );
// Now find the probability at this q2 and cos theta lepton point
maxfoundprob = rho.normalizedProb( amp.getSpinDensity() );
delete scalar_part;
// delete root_part;
delete vect;
delete lep1;
delete lep2;
} // if(res_swch==0)
if ( res_swch == 1 ) {
double s, t_for_s; // Mandelstam variables
double t_plus, t_minus; // t-variable boundaries for current s-variable
double dt;
int k;
s = pow( 3.09688, 2.0 ); // s = (M_{J/\psi})^2
t_plus = pow( M1, 2.0 ) + pow( M2, 2.0 ) + 2.0 * pow( ml, 2.0 ) - s;
t_plus = t_plus + sqrt( 1.0 - 4.0 * pow( ml, 2.0 ) / s ) *
sqrt( lambda( s, pow( M1, 2.0 ), pow( M2, 2.0 ) ) );
t_plus *= 0.5;
t_minus = pow( M1, 2.0 ) + pow( M2, 2.0 ) + 2.0 * pow( ml, 2.0 ) - s;
t_minus = t_minus -
sqrt( 1.0 - 4.0 * pow( ml, 2.0 ) / s ) *
sqrt( lambda( s, pow( M1, 2.0 ), pow( M2, 2.0 ) ) );
t_minus *= 0.5;
dt = ( t_plus - t_minus ) / 1000.0;
// The maximum probability calculation
for ( k = 0; k <= 1000; k++ ) {
t_for_s = t_plus - dt * ( (double)k );
if ( ( t_for_s < t_minus ) && ( t_for_s >= ( 0.9999 * t_minus ) ) ) {
t_for_s = t_minus;
}
if ( t_for_s < ( 0.9999 * t_minus ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbTosllVectorAmpNew::CalcMaxProb(...)"
<< "\n t_for_s = " << t_for_s << " < t_minus = " << t_minus
<< " ! "
<< "\n t_plus = " << t_plus << "\n dt = " << dt
<< "\n k = " << k << "\n s = " << s
<< "\n M1 = " << M1 << "\n M2 = " << M2
<< "\n ml = " << ml << std::endl;
::abort();
}
// B-meson rest frame particles and they kinematics inicialization
double EV, El2;
EV = ( pow( M1, 2.0 ) + pow( M2, 2.0 ) - s ) /
( 2.0 * M1 ); // V-meson energy
El2 = ( s + t_for_s - pow( M2, 2.0 ) - pow( ml, 2.0 ) ) /
( 2.0 * M1 ); // ell^- energy
double modV, modl2;
modV = sqrt( pow( EV, 2.0 ) - pow( M2, 2.0 ) );
modl2 = sqrt( pow( El2, 2.0 ) - pow( ml, 2.0 ) );
double cosVellminus; // angle between the vector meson and ell^- directions
cosVellminus = ( pow( M2, 2.0 ) + pow( ml, 2.0 ) + 2.0 * EV * El2 -
t_for_s ) /
( 2.0 * modV * modl2 );
if ( ( fabs( cosVellminus ) > 1.0 ) &&
( fabs( cosVellminus ) <= 1.0001 ) ) {
// EvtGenReport(EVTGEN_DEBUG,"EvtGen")
// << "\n Debug in the function EvtbTosllVectorAmpNew::CalcMaxProb(...):"
// << "\n cos(theta) = " << cosVellminus
// << std::endl;
cosVellminus = cosVellminus / fabs( cosVellminus );
}
if ( ( modV <= 0.000001 ) || ( modl2 <= 0.000001 ) ) {
cosVellminus = cosVellminus / fabs( cosVellminus );
EvtGenReport( EVTGEN_NOTICE, "EvtGen" )
<< "\n Debug in the function EvtbTosllVectorAmpNew::CalcMaxProb(...):"
<< "\n modV = " << modV << "\n modl2 = " << modl2
<< "\n cos(theta) = " << cosVellminus
<< "\n s = " << s << "\n t_for_s = " << t_for_s
<< "\n t_plus = " << t_plus
<< "\n t_minus = " << t_minus << "\n dt = " << dt
<< "\n EV = " << EV << "\n El2 = " << El2
<< "\n M2 = " << M2 << "\n ml = " << ml
<< std::endl;
}
if ( fabs( cosVellminus ) > 1.0001 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbTosllVectorAmpNew::CalcMaxProb(...)"
<< "\n |cos(theta)| = " << fabs( cosVellminus ) << " > 1"
<< "\n s = " << s << "\n t_for_s = " << t_for_s
<< "\n EV = " << EV << "\n El2 = " << El2
<< "\n modV = " << modV << "\n modl2 = " << modl2
<< "\n M2 = " << M2 << "\n ml = " << ml
<< std::endl;
::abort();
}
EvtVector4R p1, p2, k1, k2;
p1.set( M1, 0.0, 0.0, 0.0 );
p2.set( EV, modV, 0.0, 0.0 );
k2.set( El2, modl2 * cosVellminus,
-modl2 * sqrt( 1.0 - pow( cosVellminus, 2.0 ) ), 0.0 );
k1 = p1 - p2 - k2;
// EvtGenReport(EVTGEN_DEBUG,"EvtGen")
// << "\n Debug in the function EvtbTosllVectorAmpNew::CalcMaxProb(...):"
// << "\n mu =" << mu << " Nf =" << Nf
// << " res_swch =" << res_swch
// << " ias =" << ias
// << "\n CKM_A = " << CKM_A
// << " CKM_lambda = " << CKM_lambda
// << "\n CKM_barrho = " << CKM_barrho
// << " CKM_bareta = " << CKM_bareta
// << "\n M1 = " << M1
// << "\n M2 = " << M2
// << "\n ml = " << ml
// << "\n s = " << s
// << "\n t_for_s = " << t_for_s
// << "\n EV = " << EV
// << "\n El1 = " << El1
// << "\n El2 = " << El2
// << "\n modV = " << modV
// << "\n modl1 = " << modl1
// << "\n modl2 = " << modl2
// << "\n cos(theta) = " << cosVellminus
// << "\n p1 =" << p1
// << "\n p2 =" << p2
// << "\n k1 =" << k1
// << "\n k2 =" << k2
// << std::endl;
// B-meson state preparation at the rest frame of B-meson
EvtScalarParticle* scalar_part;
EvtParticle* root_part;
scalar_part = new EvtScalarParticle;
scalar_part->noLifeTime();
scalar_part->init( parnum, p1 );
root_part = (EvtParticle*)scalar_part;
root_part->setDiagonalSpinDensity();
// Amplitude initialization
EvtId listdaug[3];
listdaug[0] = mesnum;
listdaug[1] = l1num;
listdaug[2] = l2num;
EvtAmp amp;
amp.init( parnum, 3, listdaug );
// Daughters states preparation at the rest frame of B-meson
root_part->makeDaughters( 3, listdaug );
EvtParticle *vect, *lep1, *lep2;
vect = root_part->getDaug( 0 );
lep1 = root_part->getDaug( 1 );
lep2 = root_part->getDaug( 2 );
vect->noLifeTime();
lep1->noLifeTime();
lep2->noLifeTime();
vect->init( mesnum, p2 );
lep1->init( l1num, k1 );
lep2->init( l2num, k2 );
EvtSpinDensity rho;
rho.setDiag( root_part->getSpinStates() );
// The amplitude calculation at the
// "maximum amplitude" kinematical configuration
CalcAmp( root_part, amp, formFactors, WilsCoeff, mu, Nf, res_swch,
ias, CKM_A, CKM_lambda, CKM_barrho, CKM_bareta, ReA7, ImA7,
ReA10, ImA10 );
// Now find the probability at this q2 and cos theta lepton point
double nikmax = rho.normalizedProb( amp.getSpinDensity() );
if ( nikmax > maxfoundprob ) {
maxfoundprob = nikmax;
katmax = k;
EvtGenReport( EVTGEN_NOTICE, "EvtGen" )
<< "\n maxfoundprob ( s =" << s << ", t = " << t_for_s
<< " ) = " << maxfoundprob << "\n k =" << katmax
<< std::endl;
}
delete scalar_part;
// delete root_part;
delete vect;
delete lep1;
delete lep2;
} // for(k=0; k<=1000; k++)
} // if(res_swch==1)
if ( maxfoundprob <= 0.0 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbTosllVectorAmpNew::CalcMaxProb(...)"
<< "\n maxfoundprob = " << maxfoundprob << " <0 or =0!"
<< "\n res_swch = " << res_swch << std::endl;
::abort();
}
EvtGenReport( EVTGEN_NOTICE, "EvtGen" )
<< "\n maxfoundprob (...) = " << maxfoundprob << std::endl;
maxfoundprob *= 1.01;
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n ***************************************************************************"
// << "\n The function EvtbTosllVectorAmpNew::CalcMaxProb(...) passed with arguments:"
// << "\n mu =" << mu << " Nf =" << Nf
// << " res_swch =" << res_swch
// << " ias =" << ias
// << "\n CKM_A = " << CKM_A
// << " CKM_lambda = " << CKM_lambda
// << "\n CKM_barrho = " << CKM_barrho
// << " CKM_bareta = " << CKM_bareta
// << "\n The distribution maximum maxfoundprob =" << maxfoundprob
// << "\n k = " << katmax
// << "\n ***************************************************************************"
// << std::endl;
return maxfoundprob;
}
// Triangular function
double EvtbTosllVectorAmpNewExt::lambda( double a, double b, double c )
{
double l;
l = pow( a, 2.0 ) + pow( b, 2.0 ) + pow( c, 2.0 ) - 2.0 * a * b -
2.0 * a * c - 2.0 * b * c;
return l;
}
diff --git a/src/EvtGenModels/Evtbs2llGammaAmp.cpp b/src/EvtGenModels/Evtbs2llGammaAmp.cpp
index 8ea28c9..1c046f4 100644
--- a/src/EvtGenModels/Evtbs2llGammaAmp.cpp
+++ b/src/EvtGenModels/Evtbs2llGammaAmp.cpp
@@ -1,856 +1,856 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenModels/Evtbs2llGammaAmp.hh"
#include "EvtGenBase/EvtAmp.hh"
#include "EvtGenBase/EvtComplex.hh"
#include "EvtGenBase/EvtDiracSpinor.hh"
#include "EvtGenBase/EvtGenKine.hh"
#include "EvtGenBase/EvtId.hh"
#include "EvtGenBase/EvtIdSet.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtPatches.hh"
#include "EvtGenBase/EvtReport.hh"
#include "EvtGenBase/EvtScalarParticle.hh"
#include "EvtGenBase/EvtTensor4C.hh"
#include "EvtGenBase/EvtVector4C.hh"
#include "EvtGenBase/EvtVectorParticle.hh"
#include "EvtGenModels/EvtbTosllWilsCoeffNLO.hh"
#include "EvtGenModels/Evtbs2llGammaFFMNT.hh"
#include <cstdlib>
// input: *parent - the pointer to the parent particle (B-meson, the
// object of the EvtParticle class);
// *formFactors - the pointer to instance of EvtbTosllGammaFF class object;
// *WilsCoeff - the pointer to the Standart Model Wilson Coefficients class;
// mu - the scale parameter, GeV;
// Nf - number of "effective" flavors (for b-quark Nf=5);
// res_swch - resonant switching parameter:
// = 0 the resonant contribution switched OFF,
// = 1 the resonant contribution switched ON;
// ias - switching parameter for \alpha_s(M_Z) value:
// = 0 PDG 1sigma minimal alpha_s(M_Z),
// = 1 PDG average value alpha_s(M_Z),
// = 2 PDG 1sigma maximal alpha_s(M_Z).
// Egamma_min - photon energy cut, GeV;
// Wolfenstein parameterization for CKM matrix
// CKM_A, CKM_lambda, CKM_barrho, CKM_bareta
void Evtbs2llGammaAmp::CalcAmp( EvtParticle* parent, EvtAmp& amp,
Evtbs2llGammaFF* formFactors,
EvtbTosllWilsCoeffNLO* WilsCoeff, double mu,
int Nf, int res_swch, int ias, double Egamma_min,
double CKM_A, double CKM_lambda,
double CKM_barrho, double CKM_bareta )
{
// FILE *mytest;
int iG = 0; // photon is the first daughter particle
int il1 = 1,
il2 = 2; // leptons are the second and thirds daughter particles
EvtComplex unit1( 1.0, 0.0 ); // real unit
EvtComplex uniti( 0.0, 1.0 ); // imaginary unit
double M1 = parent->mass(); // B - meson mass, GeV
double ml = parent->getDaug( il1 )->mass(); // leptonic mass, GeV
double mq = 0.0; // light quark mass from the dispersion QM, GeV
double mc = formFactors->getQuarkMass(
4 ); // m_c mass from the dispersion QM, GeV
double mb = formFactors->getQuarkMass(
5 ); // m_b mass from the dispersion QM, GeV
double Mw = 80.403; // GeV W-boson mass, GeV
double mt = 174.2; // GeV t-quark mass, GeV
double fb = 0.0; // leptonic decay constant of B-meson, Gev
EvtComplex Vtb, Vtq, Vub, Vuq, Vcb,
Vcq; // V_{tb}, V_{tq}, V_{ub}, V_{uq}, V_{cb}, V_{cq}
EvtComplex CKM_factor; // V^*_{tq}*V_{tb}, where q={d,s}
EvtComplex lambda_qu; // V^*_{uq}*V_{ub}/V^*_{tq}*V_{tb}, where q={d,s}
EvtComplex lambda_qc; // V^*_{cq}*V_{cb}/V^*_{tq}*V_{tb}, where q={d,s}
double Relambda_qu, Imlambda_qu;
// to find charges of ell^+ and ell^- in the B-meson daughters
int charge1 = EvtPDL::chg3( parent->getDaug( il1 )->getId() );
int charge2 = EvtPDL::chg3( parent->getDaug( il2 )->getId() );
if ( charge1 == 0 || charge2 == 0 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function EvtbsTollGammaAmp::CalcAmp(...)"
<< "\n Error in the leptonic charge getting!"
<< "\n charge1 =" << charge1
<< "\n charge2 =" << charge2 << "\n charge gamma ="
<< EvtPDL::chg3( parent->getDaug( iG )->getId() )
<< "\n number of daughters =" << parent->getNDaug() << std::endl;
::abort();
}
EvtParticle* lepPlus = nullptr;
EvtParticle* lepMinus = nullptr;
lepPlus = ( charge1 > charge2 )
? parent->getDaug( il1 )
: parent->getDaug( il2 ); // positive charged
lepMinus = ( charge1 < charge2 )
? parent->getDaug( il1 )
: parent->getDaug( il2 ); // negative charged
EvtVector4R p = parent->getP4Restframe(); // B-meson momentum in the B-rest frame
EvtVector4R k =
parent->getDaug( iG )->getP4(); // 4-momentum of photon in the B-rest frame
EvtVector4R q = p - k; // transition 4-momentum q=p-k in the B-rest frame
EvtVector4R p_1; // 4-momentum of ell^+ in the B-rest frame
EvtVector4R p_2; // 4-momentum of ell^- in the B-rest frame
// the preparation of the leptonic 4-momentums in the B-rest frame
if ( charge1 > charge2 ) {
p_1 = parent->getDaug( il1 )->getP4();
p_2 = parent->getDaug( il2 )->getP4();
} else {
p_1 = parent->getDaug( il2 )->getP4();
p_2 = parent->getDaug( il1 )->getP4();
}
EvtVector4R p_minus_p_1 =
p - p_1; // transition momentum of the B-meson and antilepton p-p_1
EvtVector4R p_minus_p_2 =
p - p_2; // transition momentum of the B-meson and lepton p-p_2
double q2 = q.mass2(); // Mandelstam variable s=q^2
double p2 = p.mass2(); // p^2=M1^2
double t = p_minus_p_1.mass2(); // Mandelstam variable t=(p-p_1)^2
double u = p_minus_p_2.mass2(); // Mandelstam variable u=(p-p_2)^2
// scalar products
double pk = 0.5 * ( p2 - q2 ); // (p*k)
double p1k = 0.5 * ( pow( ml, 2.0 ) - u ); // (p1*k)
double p2k = 0.5 * ( pow( ml, 2.0 ) - t ); // (p2*k)
double hatq2 = q2 / ( M1 * M1 ); // \hat s = q^2/M_1^2
double Egam = 0.5 * M1 *
( 1 - hatq2 ); // photon energy in the B-meson rest frame
EvtVector4R hatp = p / M1;
EvtVector4R hatk = k / M1;
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n\n The function EvtbsTollGammaAmp::CalcAmp(...)"
// << "\n q = p-k =" << p-k << " q^2 = " << (p-k).mass2()
// << "\n q = p1+p2 =" << p_1+p_2 << " q^2 = " << (p_1+p_2).mass2()
// << "\n m_ell =" << parent->getDaug(il1)->mass()
// << "\n m_ell =" << parent->getDaug(il2)->mass()
// << "\n m_gamma =" << parent->getDaug(iG)->mass()
// << std::endl;
EvtId idparent = parent->getId(); // B-meson Id
if ( idparent == EvtPDL::getId( std::string( "B_s0" ) ) ||
idparent == EvtPDL::getId( std::string( "anti-B_s0" ) ) ) {
mq = formFactors->getQuarkMass( 3 ); // m_s mass from the dispersion QM
fb = 0.24; // leptonic decay constant
// V_{ts}
Vtq = unit1 * ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) ) +
pow( CKM_lambda, 2.0 ) *
( CKM_barrho * unit1 + CKM_bareta * uniti ) /
sqrt( 1.0 - pow( CKM_lambda, 2.0 ) );
Vtq = -CKM_A * pow( CKM_lambda, 2.0 ) * Vtq;
// V_{us}
Vuq = CKM_lambda * unit1;
// V_{cs}
Vcq = unit1 - 0.5 * pow( CKM_lambda, 2.0 ) -
0.125 * pow( CKM_lambda, 4.0 ) * ( 1.0 + 4.0 * pow( CKM_A, 2.0 ) );
}
if ( idparent == EvtPDL::getId( std::string( "B0" ) ) ||
idparent == EvtPDL::getId( std::string( "anti-B0" ) ) ) {
mq = formFactors->getQuarkMass( 2 ); // m_d mass from the dispersion QM
fb = 0.20; // leptonic decay constant
// V_{td}
Vtq = unit1 - ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) ) *
( CKM_barrho * unit1 + CKM_bareta * uniti ) /
sqrt( 1.0 - pow( CKM_lambda, 2.0 ) );
Vtq = CKM_A * pow( CKM_lambda, 3.0 ) * Vtq;
// V_{ud}
Vuq = unit1 * ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) -
0.125 * pow( CKM_lambda, 4.0 ) );
// V_{cd}
Vcq = unit1 *
( -CKM_lambda +
0.5 * pow( CKM_A, 2.0 ) * pow( CKM_lambda, 5.0 ) *
( 1.0 - 2.0 * ( CKM_barrho * unit1 + CKM_bareta * uniti ) /
sqrt( 1.0 - pow( CKM_lambda, 2.0 ) ) ) );
}
if ( mq < 0.001 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function EvtbsTollGammaAmp::CalcAmp(..// 4-momentum of ell^+.)"
<< "\n Error in the model set!"
<< " mq = " << mq << std::endl;
::abort();
}
Vtb = unit1 * ( 1.0 - 0.5 * pow( CKM_A * CKM_lambda * CKM_lambda,
2.0 ) ); // V_{tb}
Vub = CKM_A * pow( CKM_lambda, 3.0 ) *
( CKM_barrho * unit1 - CKM_bareta * uniti ) /
sqrt( 1.0 - pow( CKM_lambda, 2.0 ) ); // V_{ub}
Vcb = unit1 * CKM_A * pow( CKM_lambda, 2.0 ); // V_{cb}
CKM_factor = conj( Vtq ) * Vtb; // V^*_{tq}*V_{tb}
lambda_qu = conj( Vuq ) * Vub /
CKM_factor; // V^*_{uq}*V_{ub}/V^*_{tq}*V_{tb}
Relambda_qu = real( lambda_qu );
Imlambda_qu = imag( lambda_qu );
lambda_qc = conj( Vcq ) * Vcb /
CKM_factor; // V^*_{cq}*V_{cb}/V^*_{tq}*V_{tb}
// The Wilson Coefficients preparation according to the paper
// A.J.Buras, M.Munz, Phys.Rev.D52, p.189 (1995)
double c1, c2;
EvtComplex a1, c7gam, c9eff_b2q, c9eff_barb2barq, c10a;
// foton energy cut and removal of the J/psi amd psi' resonant area
if ( Egam < Egamma_min || ( res_swch == 1 && q2 >= 9.199 && q2 <= 15.333 ) ) {
c1 = 0.0;
c2 = 0.0;
a1 = unit1 * 0.0;
c7gam = unit1 * 0.0;
c9eff_b2q = unit1 * 0.0;
c9eff_barb2barq = unit1 * 0.0;
c10a = unit1 * 0.0;
} else {
c1 = WilsCoeff->C1( mu, Mw, Nf, ias );
c2 = WilsCoeff->C2( mu, Mw, Nf, ias );
a1 = unit1 * ( c1 + c2 / 3.0 );
c7gam = WilsCoeff->GetC7Eff( mu, Mw, mt, Nf, ias );
c9eff_b2q = WilsCoeff->GetC9Eff( 0, res_swch, ias, Nf, q2, mb, mq, mc, mu,
mt, Mw, ml, Relambda_qu, Imlambda_qu );
c9eff_barb2barq = WilsCoeff->GetC9Eff( 1, res_swch, ias, Nf, q2, mb, mq,
mc, mu, mt, Mw, ml, Relambda_qu,
Imlambda_qu );
c10a = WilsCoeff->GetC10Eff( mt, Mw );
}
EvtComplex Fv,
Fa; // The change of the sign is included in the amplitudes definition!
EvtComplex Ftv_b2q, Ftv_barb2barq;
EvtComplex Fta_b2q, Fta_barb2barq;
// foton energy cut and removal of the J/psi amd psi' resonant area
if ( Egam < Egamma_min || ( res_swch == 1 && q2 >= 9.199 && q2 <= 15.333 ) ) {
fb = 0.0;
Fa = unit1 * 0.0;
Fv = unit1 * 0.0;
Fta_b2q = unit1 * 0.0;
Fta_barb2barq = unit1 * 0.0;
Ftv_b2q = unit1 * 0.0;
Ftv_barb2barq = unit1 * 0.0;
} else {
if ( fb < 0.01 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function EvtbsTollGammaAmp::CalcAmp(...)"
<< "\n Leptonic decay constant fb is not uninitialized in this function!"
<< " fb = " << fb << std::endl;
::abort();
}
// For \bar B^0_q -> l^+ l^- gamma
formFactors->getPhotonFF( 0, fb, parent->getId(), q2, M1, mb, mq, c7gam,
a1, lambda_qu, lambda_qc, Fv, Fa, Ftv_b2q,
Fta_b2q );
// For B^0_q -> l^+ l^- gamma
formFactors->getPhotonFF( 1, fb, parent->getId(), q2, M1, mb, mq, c7gam,
a1, lambda_qu, lambda_qc, Fv, Fa,
Ftv_barb2barq, Fta_barb2barq );
}
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n ============================================================================"
// << "\n ============================================================================"
// << "\n\n The function Evtbs2llGammaAmp::CalcAmp(...) passed."
// << "\n Particle masses:"
// << "\n B - meson mass M1 = " << M1
// << "\n photon minimum E = " << Egamma_min
// << "\n q2 = " << q2
// << "\n leptonic mass ml = " << ml
// << "\n light quark mass = " << mq
// << "\n c - quark mass mc = " << mc
// << "\n b - quark mass mb = " << mb
// << "\n t - quark mass mt = " << mt
// << "\n W - boson mass Mw = " << Mw
// << "\n ============================================================================"
// << "\n Input parameters:"
// << "\n scale parameter mu = " << mu
// << "\n number of flavors Nf = " << Nf
// << "\n resonant switching = " << res_swch
// << "\n parameter for alpha_s(M_Z) = " << ias
// << "\n photon energy cut (GeV) = " << Egamma_min
// << "\n ============================================================================"
// << "\n Form-factors"
// << "\n Egam = " << Egam
// << "\n Egamma_min = " << Egamma_min
// << "\n Fv = " << Fv
// << "\n Fa = " << Fa
// << "\n Ftv_b2q = " << Ftv_b2q
// << "\n Fta_b2q = " << Fta_b2q
// << "\n Ftv_barb2barq = " << Ftv_barb2barq
// << "\n Fta_barb2barq = " << Fta_barb2barq
// << "\n ============================================================================"
// << "\n Wilson Coefficients:"
// << "\n Egam = " << Egam
// << "\n Egamma_min = " << Egamma_min
// << "\n Re(c7gam) = " << real(c7gam)
// << " Im(c7gam) = " << imag(c7gam)
// << "\n Re(c9eff_b2q) = " << real(c9eff_b2q)
// << " Im(c9eff_b2q) = " << imag(c9eff_b2q)
// << "\n Re(c9eff_barb2barq) = " << real(c9eff_barb2barq)
// << " Im(c9eff_barb2barq) = " << imag(c9eff_barb2barq)
// << "\n Re(c10a) = " << real(c10a)
// << " Im(c10a) = " << imag(c10a)
// << std::endl;
// Hadronic matrix element coefficients
EvtComplex a_b2q, a_barb2barq, b_b2q, b_barb2barq, e_b2q, e_barb2barq,
f_b2q, f_barb2barq;
EvtComplex brammS, brammT;
a_b2q = c9eff_b2q * Fv + 2.0 * c7gam * Ftv_b2q * mb * M1 / q2;
a_barb2barq = c9eff_barb2barq * Fv +
2.0 * c7gam * Ftv_barb2barq * mb * M1 / q2;
b_b2q = ( c9eff_b2q * Fa + 2.0 * c7gam * Fta_b2q * mb * M1 / q2 ) * pk /
( M1 * M1 );
b_barb2barq = ( c9eff_barb2barq * Fa +
2.0 * c7gam * Fta_barb2barq * mb * M1 / q2 ) *
pk / ( M1 * M1 );
e_b2q = c10a * Fv;
e_barb2barq = e_b2q;
f_b2q = c10a * Fa * pk / ( M1 * M1 );
f_barb2barq = f_b2q;
brammS = 0.0; // in the Bq-meson rest frame!
brammT = 0.5 * c10a * ml * fb *
( 1.0 / p2k + 1.0 / p1k ); // for Bramsstrahlung
EvtTensor4C T1, T2; // hadronic matrix element tensor structures
EvtVector4C E1, E2;
EvtComplex E3;
EvtVector4C epsG; // photon polarisation vector
int i; // photon polarisations counter
EvtVector4C lvc11, lvc12; // spin structures for
EvtVector4C lvc21, lvc22; // the leptonic vector current
EvtVector4C lac11, lac12; // spin structures for
EvtVector4C lac21, lac22; // the leptonic axial current
EvtComplex lsc11, lsc12; // spin structures for
EvtComplex lsc21, lsc22; // the leptonic scalar current
EvtTensor4C ltc11, ltc12; // spin structures for
EvtTensor4C ltc21, ltc22; // the leptonic tensor current
// B - and barB - mesons descriptors
- static EvtIdSet bmesons( "anti-B0", "anti-B_s0" );
- static EvtIdSet bbarmesons( "B0", "B_s0" );
+ static EvtIdSet bmesons{ "anti-B0", "anti-B_s0" };
+ static EvtIdSet bbarmesons{ "B0", "B_s0" };
EvtId parentID = parent->getId();
if ( bmesons.contains( parentID ) ) {
// The amplitude for the decay barB -> gamma ell^+ ell^- or
// b \bar q -> gamma ell^+ ell^-
T1 = -a_b2q * unit1 * dual( EvtGenFunctions::directProd( hatp, hatk ) ) -
b_b2q * uniti * EvtTensor4C::g();
T2 = -e_b2q * unit1 * dual( EvtGenFunctions::directProd( hatp, hatk ) ) -
f_b2q * uniti * EvtTensor4C::g();
// spin combinations for vector lepton current
lvc11 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
lvc21 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lvc12 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lvc22 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
lac11 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
lac21 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lac12 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lac22 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
lsc11 = EvtLeptonSCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
lsc21 = EvtLeptonSCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lsc12 = EvtLeptonSCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lsc22 = EvtLeptonSCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
// \epsilon^{\alpha\beta\mu\nu}*TCurrent_{\mu\nu}
ltc11 = dual( EvtLeptonTCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) ) );
ltc21 = dual( EvtLeptonTCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) ) );
ltc12 = dual( EvtLeptonTCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) ) );
ltc22 = dual( EvtLeptonTCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) ) );
// summing up photon polarisations
for ( i = 0; i < 2; i++ ) {
// conjaction of epsG (photon polarization vector)
EvtVector4C epsG = parent->getDaug( 0 )->epsParentPhoton( i ).conj();
// de-escalation T with epsG
E1 = T1.cont2( epsG );
E2 = T2.cont2( epsG );
E3 = ( epsG * hatp ) * brammS;
// foton energy cut and removal of the J/psi amd psi' resonant area
if ( Egam < Egamma_min ||
( res_swch == 1 && q2 >= 9.199 && q2 <= 15.333 ) ) {
CKM_factor = 0.0 * unit1;
}
// 1
amp.vertex( i, 0, 0,
CKM_factor *
( lvc11 * E1 + lac11 * E2 + uniti * lsc11 * E3 +
uniti * ( ( ltc11.cont2( hatp ) ) * epsG ) *
brammT ) );
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n 1" << CKM_factor*(lvc11*E1+lac11*E2+uniti*lsc11*E3+uniti*((ltc11.cont2(hatp))*epsG)*brammT)
// << std::endl;
// 2
amp.vertex( i, 0, 1,
CKM_factor *
( lvc12 * E1 + lac12 * E2 + uniti * lsc12 * E3 +
uniti * ( ( ltc12.cont2( hatp ) ) * epsG ) *
brammT ) );
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n 2" << CKM_factor*(lvc12*E1+lac12*E2+uniti*lsc12*E3+uniti*((ltc12.cont2(hatp))*epsG)*brammT)
// << std::endl;
// 3
amp.vertex( i, 1, 0,
CKM_factor *
( lvc21 * E1 + lac21 * E2 + uniti * lsc21 * E3 +
uniti * ( ( ltc21.cont2( hatp ) ) * epsG ) *
brammT ) );
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n 3" << CKM_factor*(lvc21*E1+lac21*E2+uniti*lsc21*E3+uniti*((ltc21.cont2(hatp))*epsG)*brammT)
// << std::endl;
// 4
amp.vertex( i, 1, 1,
CKM_factor *
( lvc22 * E1 + lac22 * E2 + uniti * lsc22 * E3 +
uniti * ( ( ltc22.cont2( hatp ) ) * epsG ) *
brammT ) );
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n 4" << CKM_factor*(lvc22*E1+lac22*E2+uniti*lsc22*E3+uniti*((ltc22.cont2(hatp))*epsG)*brammT)
// << std::endl;
}
} else {
if ( bbarmesons.contains( parentID ) ) {
// The amplitude for the decay B -> gamma ell^+ ell^- or
// q bar b -> gamma ell^+ ell^-
T1 = -a_barb2barq * unit1 *
dual( EvtGenFunctions::directProd( hatp, hatk ) ) +
b_barb2barq * uniti * EvtTensor4C::g();
T2 = -e_barb2barq * unit1 *
dual( EvtGenFunctions::directProd( hatp, hatk ) ) +
f_barb2barq * uniti * EvtTensor4C::g();
lvc11 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
lvc21 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lvc12 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lvc22 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
lac11 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
lac21 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lac12 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lac22 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
lsc11 = EvtLeptonSCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
lsc21 = EvtLeptonSCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lsc12 = EvtLeptonSCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lsc22 = EvtLeptonSCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
// \epsilon^{\alpha\beta\mu\nu}*TCurrent_{\mu\nu}
ltc11 = dual( EvtLeptonTCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) ) );
ltc21 = dual( EvtLeptonTCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) ) );
ltc12 = dual( EvtLeptonTCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) ) );
ltc22 = dual( EvtLeptonTCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) ) );
// summing up photon polarisations
for ( i = 0; i < 2; i++ ) {
EvtVector4C barepsG = parent->getDaug( 0 )->epsParentPhoton( i );
E1 = T1.cont2( barepsG );
E2 = T2.cont2( barepsG );
E3 = ( barepsG * hatp ) * brammS;
// foton energy cut and removal of the J/psi amd psi' resonant area
if ( Egam < Egamma_min ||
( res_swch == 1 && q2 >= 9.199 && q2 <= 15.333 ) ) {
CKM_factor = 0.0 * unit1;
}
amp.vertex(
i, 1, 1,
conj( CKM_factor ) *
( lvc11 * E1 + lac11 * E2 + uniti * lsc11 * E3 + // -?
uniti * ( ( ltc11.cont2( hatp ) ) * epsG ) * brammT ) );
amp.vertex(
i, 1, 0,
conj( CKM_factor ) *
( lvc12 * E1 + lac12 * E2 + uniti * lsc12 * E3 + // -?
uniti * ( ( ltc12.cont2( hatp ) ) * epsG ) * brammT ) );
amp.vertex(
i, 0, 1,
conj( CKM_factor ) *
( lvc21 * E1 + lac21 * E2 + uniti * lsc21 * E3 + // -?
uniti * ( ( ltc21.cont2( hatp ) ) * epsG ) * brammT ) );
amp.vertex(
i, 0, 0,
conj( CKM_factor ) *
( lvc22 * E1 + lac22 * E2 + uniti * lsc22 * E3 + // -?
uniti * ( ( ltc22.cont2( hatp ) ) * epsG ) * brammT ) );
}
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function Evtbs2llGammaAmp::CalcAmp(...)"
<< "\n Wrong B-meson number" << std::endl;
::abort();
}
}
}
//
// The decays B -> Gamma ell^+ ell^- maximum probability calculation for the
// d^2\Gamma/dq^2 d\cos\theta distribution.
//
// \theta - the angle between the photon and ell^- directions in the
// B-meson rest frame.
//
// If ias=0 (nonresonant case), the maximum is achieved at q2
// B0s: q2 = 4*ml^2, Mphi^2, q_max^2;
// B0d: q2 = 4*ml^2, Mrho^2, Momega^2, q_max^2;
// If ias=1 (resonant case), the maximum in the same points, because the
// resonat area is remove
//
double Evtbs2llGammaAmp::CalcMaxProb( EvtId parnum, EvtId photnum, EvtId l1num,
EvtId l2num, Evtbs2llGammaFF* formFactors,
EvtbTosllWilsCoeffNLO* WilsCoeff,
double mu, int Nf, int res_swch, int ias,
double Egamma_min, double CKM_A,
double CKM_lambda, double CKM_barrho,
double CKM_bareta )
{
double maxfoundprob = -100.0; // maximum of the probability
// int ijk_atmax = 1000000;
double M1 = EvtPDL::getMeanMass( parnum ); // B - meson mass
double ml = EvtPDL::getMeanMass( l1num ); // leptonic mass
double Mrho = EvtPDL::getMeanMass(
EvtPDL::getId( std::string( "rho0" ) ) ); // mass of the rho-meson, MeV
double Momega = EvtPDL::getMeanMass( EvtPDL::getId(
std::string( "omega" ) ) ); // mass of the omega-meson, MeV
double Mphi = EvtPDL::getMeanMass(
EvtPDL::getId( std::string( "phi" ) ) ); // mass of the phi-meson, MeV
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n M1 = " << M1
// << "\n ml = " << ml
// << "\n Mrho = " << Mrho
// << "\n Momega = " << Momega
// << "\n Mphi = " << Mphi
// << "\n Egamma_min = " << Egamma_min
// << std::endl;
double list_of_max_q2_points[5];
list_of_max_q2_points[0] = pow( 2.0 * ml, 2.0 );
list_of_max_q2_points[1] = pow( Mrho, 2.0 );
list_of_max_q2_points[2] = pow( Momega, 2.0 );
list_of_max_q2_points[3] = pow( Mphi, 2.0 );
list_of_max_q2_points[4] =
pow( M1, 2.0 ) - 2.0 * M1 * Egamma_min; // q^2_max at photon energy cut
// if(list_of_max_points[4]<0){
// EvtGenReport(EVTGEN_ERROR,"EvtGen")
// << "\n\n In the function EvtbsTollGammaAmp::CalcScalarMaxProb(...)"
// << "\n Bad photon energy cut: Egamma_min > M1 in the rest frame of B-meson!"
// << "\n q2_max = " << list_of_max_points[4]
// << "\n M1 = " << M1
// << "\n Egamma_min = " << Egamma_min
// << std::endl;
// ::abort();
// }
if ( Egamma_min > Mrho ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbsTollGammaAmp::CalcScalarMaxProb(...)"
<< "\n Bad photon energy cut: Egamma_min > M_rho0 in the rest frame of B-meson."
<< "\n Mrho = " << Mrho << "\n Egamma_min = " << Egamma_min
<< std::endl;
::abort();
}
if ( Egamma_min <= 0 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbsTollGammaAmp::CalcScalarMaxProb(...)"
<< "\n Bad photon energy cut: Egamma_min <= 0 in the rest frame of B-meson."
<< "\n Egamma_min = " << Egamma_min << std::endl;
::abort();
}
if ( res_swch == 0 || res_swch == 1 ) {
int i_list;
for ( i_list = 0; i_list <= 4; i_list++ ) {
double s; // mandelstam variable "s";
double t_minus; // minimum and maximum of the mandelstam variable "t"
double t_plus; // as function of the mandelstam variable "s=q2";
double t_for_s;
int ijk; // counter for variable "t";
int max_ijk; // maximal value of this counter;
s = list_of_max_q2_points[i_list];
t_plus = pow( M1, 2.0 ) + 2.0 * pow( ml, 2.0 ) - s;
t_plus = t_plus + sqrt( 1.0 - 4.0 * pow( ml, 2.0 ) / s ) *
( pow( M1, 2.0 ) - s );
t_plus *= 0.5;
t_minus = pow( M1, 2.0 ) + 2.0 * pow( ml, 2.0 ) - s;
t_minus = t_minus - sqrt( 1.0 - 4.0 * pow( ml, 2.0 ) / s ) *
( pow( M1, 2.0 ) - s );
t_minus *= 0.5;
if ( fabs( t_plus - t_minus ) < 0.000001 )
t_minus = t_plus;
max_ijk = 1000;
double dt = ( t_plus - t_minus ) / ( (double)max_ijk );
if ( fabs( dt ) < 0.00001 )
dt = 0.0;
if ( dt < 0.0 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbsTollGammaAmp::CalcScalarMaxProb(...)"
<< "\n dt = " << dt << " < 0."
<< "\n s = " << s << "\n t_plus = " << t_plus
<< "\n t_minus = " << t_minus << "\n M1 = " << M1
<< "\n ml = " << ml << std::endl;
::abort();
}
for ( ijk = 0; ijk <= max_ijk; ijk++ ) {
t_for_s = t_minus + dt * ( (double)ijk );
// B-meson rest frame particles and they kinematics inicialization
double Eg, El2;
Eg = ( pow( M1, 2.0 ) - s ) / ( 2.0 * M1 ); // photon energy
El2 = ( s + t_for_s - pow( ml, 2.0 ) ) /
( 2.0 * M1 ); // ell^- energy
double modl2;
modl2 = sqrt( pow( El2, 2.0 ) - pow( ml, 2.0 ) );
double cosBellminus; // angle between the B-meson and ell^- directions
cosBellminus = ( pow( ml, 2.0 ) + 2.0 * Eg * El2 - t_for_s ) /
( 2.0 * Eg * modl2 );
if ( ( fabs( cosBellminus ) > 1.0 ) &&
( fabs( cosBellminus ) <= 1.0001 ) ) {
EvtGenReport( EVTGEN_NOTICE, "EvtGen" )
<< "\n Debug in the function EvtbsTollGammaAmp::CalcMaxProb(...):"
<< "\n cos(theta) = " << cosBellminus << std::endl;
cosBellminus = cosBellminus / fabs( cosBellminus );
}
if ( fabs( cosBellminus ) > 1.0001 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbsTollGammaAmp::CalcMaxProb(...)"
<< "\n |cos(theta)| = " << fabs( cosBellminus ) << " > 1"
<< "\n s = " << s << "\n t_for_s = " << t_for_s
<< "\n t_plus = " << t_plus << "\n t_minus = " << t_minus
<< "\n dt = " << dt << "\n Eg = " << Eg
<< "\n El2 = " << El2 << "\n modl2 = " << modl2
<< "\n ml = " << ml << std::endl;
::abort();
}
EvtVector4R p, k, p1, p2;
p.set( M1, 0.0, 0.0, 0.0 );
k.set( Eg, Eg, 0.0, 0.0 );
p2.set( El2, modl2 * cosBellminus,
-modl2 * sqrt( 1.0 - pow( cosBellminus, 2.0 ) ), 0.0 );
p1 = p - k - p2;
// B-meson state preparation at the rest frame of B-meson
EvtScalarParticle* scalar_part;
EvtParticle* root_part;
scalar_part = new EvtScalarParticle;
scalar_part->noLifeTime();
scalar_part->init( parnum, p );
root_part = (EvtParticle*)scalar_part;
root_part->setDiagonalSpinDensity();
// Amplitude initialization
EvtId listdaug[3];
listdaug[0] = photnum;
listdaug[1] = l1num;
listdaug[2] = l2num;
EvtAmp amp;
amp.init( parnum, 3, listdaug );
// Daughters states preparation at the rest frame of B-meson
root_part->makeDaughters( 3, listdaug );
EvtParticle *gamm, *lep1, *lep2;
gamm = root_part->getDaug( 0 );
lep1 = root_part->getDaug( 1 );
lep2 = root_part->getDaug( 2 );
gamm->noLifeTime();
lep1->noLifeTime();
lep2->noLifeTime();
gamm->init( photnum, k );
lep1->init( l1num, p1 );
lep2->init( l2num, p2 );
EvtSpinDensity rho;
rho.setDiag( root_part->getSpinStates() );
// The amplitude calculation at the
// "maximum amplitude" kinematical configuration
CalcAmp( root_part, amp, formFactors, WilsCoeff, mu, Nf,
res_swch, ias, Egamma_min, CKM_A, CKM_lambda,
CKM_barrho, CKM_bareta );
// Now find the probability at this q2 and cos theta lepton point
double nikmax = rho.normalizedProb( amp.getSpinDensity() );
if ( nikmax > maxfoundprob ) {
maxfoundprob = nikmax;
EvtGenReport( EVTGEN_NOTICE, "EvtGen" )
<< "\n maxfoundprob ( s =" << s << ", t = " << t_for_s
<< " ) = " << maxfoundprob << "\n ijk =" << ijk
<< std::endl;
}
delete scalar_part;
// delete root_part;
delete gamm;
delete lep1;
delete lep2;
} // for(ijk=0; ijk<=max_ijk; ijk++)
} // i_list - variable loop
} // if(res_swch==0||res_swch==1)
else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbsTollVectorAmpNew::CalcMaxProb(...)"
<< "\n Unexpected value of the variable res_swch !!!"
<< "\n res_swch = " << res_swch << std::endl;
::abort();
}
if ( maxfoundprob <= 0.0 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbsTollVectorAmpNew::CalcMaxProb(...)"
<< "\n maxfoundprob = " << maxfoundprob << " <0 or =0!"
<< "\n res_swch = " << res_swch << std::endl;
::abort();
}
maxfoundprob *= 1.01;
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n **********************************************************************"
// << "\n The function Evtbs2llGammaAmp::CalcMaxProb(...) passed with arguments:"
// << "\n mu =" << mu << " Nf =" << Nf
// << " res_swch =" << res_swch
// << " ias =" << ias
// << "\n CKM_A = " << CKM_A
// << " CKM_lambda = " << CKM_lambda
// << "\n CKM_barrho = " << CKM_barrho
// << " CKM_bareta = " << CKM_bareta
// << "\n The distribution maximum maxfoundprob =" << maxfoundprob
// << "\n ijk = " << ijk_atmax
// << "\n **********************************************************************"
// << std::endl;
return maxfoundprob;
}
// Triangular function
double Evtbs2llGammaAmp::lambda( double a, double b, double c )
{
double l;
l = pow( a, 2.0 ) + pow( b, 2.0 ) + pow( c, 2.0 ) - 2.0 * a * b -
2.0 * a * c - 2.0 * b * c;
return l;
}
diff --git a/src/EvtGenModels/Evtbs2llGammaISRFSRAmp.cpp b/src/EvtGenModels/Evtbs2llGammaISRFSRAmp.cpp
index e23e02f..0617996 100644
--- a/src/EvtGenModels/Evtbs2llGammaISRFSRAmp.cpp
+++ b/src/EvtGenModels/Evtbs2llGammaISRFSRAmp.cpp
@@ -1,895 +1,895 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenModels/Evtbs2llGammaISRFSRAmp.hh"
#include "EvtGenBase/EvtAmp.hh"
#include "EvtGenBase/EvtComplex.hh"
#include "EvtGenBase/EvtDiracSpinor.hh"
#include "EvtGenBase/EvtGenKine.hh"
#include "EvtGenBase/EvtId.hh"
#include "EvtGenBase/EvtIdSet.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtPatches.hh"
#include "EvtGenBase/EvtReport.hh"
#include "EvtGenBase/EvtScalarParticle.hh"
#include "EvtGenBase/EvtTensor4C.hh"
#include "EvtGenBase/EvtVector4C.hh"
#include "EvtGenBase/EvtVectorParticle.hh"
#include "EvtGenModels/EvtbTosllWilsCoeffNLO.hh"
#include "EvtGenModels/Evtbs2llGammaFFMNT.hh"
#include <cstdlib>
// input: *parent - the pointer to the parent particle (B-meson, the
// object of the EvtParticle class);
// *formFactors - the pointer to instance of EvtbTosllGammaFF class object;
// *WilsCoeff - the pointer to the Standart Model Wilson Coefficients class;
// mu - the scale parameter, GeV;
// Nf - number of "effective" flavors (for b-quark Nf=5);
// sr - state radiation type:
// = 0 the ISR only,
// = 1 the FSR only,
// = 2 both ISR + FSR (== BSTOGLLMNT model);
// res_swch - resonant switching parameter:
// = 0 the resonant contribution switched OFF,
// = 1 the resonant contribution switched ON;
// ias - switching parameter for \alpha_s(M_Z) value:
// = 0 PDG 1sigma minimal alpha_s(M_Z),
// = 1 PDG average value alpha_s(M_Z),
// = 2 PDG 1sigma maximal alpha_s(M_Z).
// Egamma_min - photon energy cut, GeV;
// Wolfenstein parameterization for CKM matrix
// CKM_A, CKM_lambda, CKM_barrho, CKM_bareta
void Evtbs2llGammaISRFSRAmp::CalcAmp( EvtParticle* parent, EvtAmp& amp,
Evtbs2llGammaFF* formFactors,
EvtbTosllWilsCoeffNLO* WilsCoeff,
double mu, int Nf, int sr, int res_swch,
int ias, double Egamma_min, double CKM_A,
double CKM_lambda, double CKM_barrho,
double CKM_bareta, double mumumass_min )
{
// FILE *mytest;
int iG = 0; // photon is the first daughter particle
int il1 = 1,
il2 = 2; // leptons are the second and thirds daughter particles
EvtComplex unit1( 1.0, 0.0 ); // real unit
EvtComplex uniti( 0.0, 1.0 ); // imaginary unit
double M1 = parent->mass(); // B - meson mass, GeV
double ml = parent->getDaug( il1 )->mass(); // leptonic mass, GeV
double mq = 0.0; // light quark mass from the dispersion QM, GeV
double mc = formFactors->getQuarkMass(
4 ); // m_c mass from the dispersion QM, GeV
double mb = formFactors->getQuarkMass(
5 ); // m_b mass from the dispersion QM, GeV
double Mw = 80.403; // GeV W-boson mass, GeV
double mt = 174.2; // GeV t-quark mass, GeV
double fb = 0.0; // leptonic decay constant of B-meson, Gev
EvtComplex Vtb, Vtq, Vub, Vuq, Vcb,
Vcq; // V_{tb}, V_{tq}, V_{ub}, V_{uq}, V_{cb}, V_{cq}
EvtComplex CKM_factor; // V^*_{tq}*V_{tb}, where q={d,s}
EvtComplex lambda_qu; // V^*_{uq}*V_{ub}/V^*_{tq}*V_{tb}, where q={d,s}
EvtComplex lambda_qc; // V^*_{cq}*V_{cb}/V^*_{tq}*V_{tb}, where q={d,s}
double Relambda_qu, Imlambda_qu;
// to find charges of ell^+ and ell^- in the B-meson daughters
int charge1 = EvtPDL::chg3( parent->getDaug( il1 )->getId() );
int charge2 = EvtPDL::chg3( parent->getDaug( il2 )->getId() );
if ( charge1 == 0 || charge2 == 0 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function EvtbsTollGammaAmp::CalcAmp(...)"
<< "\n Error in the leptonic charge getting!"
<< "\n charge1 =" << charge1
<< "\n charge2 =" << charge2 << "\n charge gamma ="
<< EvtPDL::chg3( parent->getDaug( iG )->getId() )
<< "\n number of daughters =" << parent->getNDaug() << std::endl;
::abort();
}
EvtParticle* lepPlus = nullptr;
EvtParticle* lepMinus = nullptr;
lepPlus = ( charge1 > charge2 )
? parent->getDaug( il1 )
: parent->getDaug( il2 ); // positive charged
lepMinus = ( charge1 < charge2 )
? parent->getDaug( il1 )
: parent->getDaug( il2 ); // negative charged
EvtVector4R p = parent->getP4Restframe(); // B-meson momentum in the B-rest frame
EvtVector4R k =
parent->getDaug( iG )->getP4(); // 4-momentum of photon in the B-rest frame
EvtVector4R q = p - k; // transition 4-momentum q=p-k in the B-rest frame
EvtVector4R p_1; // 4-momentum of ell^+ in the B-rest frame
EvtVector4R p_2; // 4-momentum of ell^- in the B-rest frame
// the preparation of the leptonic 4-momentums in the B-rest frame
if ( charge1 > charge2 ) {
p_1 = parent->getDaug( il1 )->getP4();
p_2 = parent->getDaug( il2 )->getP4();
} else {
p_1 = parent->getDaug( il2 )->getP4();
p_2 = parent->getDaug( il1 )->getP4();
}
EvtVector4R p_minus_p_1 =
p - p_1; // transition momentum of the B-meson and antilepton p-p_1
EvtVector4R p_minus_p_2 =
p - p_2; // transition momentum of the B-meson and lepton p-p_2
double q2 = q.mass2(); // Mandelstam variable s=q^2
double p2 = p.mass2(); // p^2=M1^2
double t = p_minus_p_1.mass2(); // Mandelstam variable t=(p-p_1)^2
double u = p_minus_p_2.mass2(); // Mandelstam variable u=(p-p_2)^2
// scalar products
double pk = 0.5 * ( p2 - q2 ); // (p*k)
double p1k = 0.5 * ( pow( ml, 2.0 ) - u ); // (p1*k)
double p2k = 0.5 * ( pow( ml, 2.0 ) - t ); // (p2*k)
double hatq2 = q2 / ( M1 * M1 ); // \hat s = q^2/M_1^2
double Egam = 0.5 * M1 *
( 1 - hatq2 ); // photon energy in the B-meson rest frame
EvtVector4R hatp = p / M1;
EvtVector4R hatk = k / M1;
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n\n The function EvtbsTollGammaISRFSRAmp::CalcAmp(...)"
// << "\n q = p-k =" << p-k << " q^2 = " << (p-k).mass2()
// << "\n q = p1+p2 =" << p_1+p_2 << " q^2 = " << (p_1+p_2).mass2()
// << "\n m_ell =" << parent->getDaug(il1)->mass()
// << "\n m_ell =" << parent->getDaug(il2)->mass()
// << "\n m_gamma =" << parent->getDaug(iG)->mass()
// << std::endl;
EvtId idparent = parent->getId(); // B-meson Id
if ( idparent == EvtPDL::getId( std::string( "B_s0" ) ) ||
idparent == EvtPDL::getId( std::string( "anti-B_s0" ) ) ) {
mq = formFactors->getQuarkMass( 3 ); // m_s mass from the dispersion QM
fb = 0.24; // leptonic decay constant
// V_{ts}
Vtq = unit1 * ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) ) +
pow( CKM_lambda, 2.0 ) *
( CKM_barrho * unit1 + CKM_bareta * uniti ) /
sqrt( 1.0 - pow( CKM_lambda, 2.0 ) );
Vtq = -CKM_A * pow( CKM_lambda, 2.0 ) * Vtq;
// V_{us}
Vuq = CKM_lambda * unit1;
// V_{cs}
Vcq = unit1 - 0.5 * pow( CKM_lambda, 2.0 ) -
0.125 * pow( CKM_lambda, 4.0 ) * ( 1.0 + 4.0 * pow( CKM_A, 2.0 ) );
}
if ( idparent == EvtPDL::getId( std::string( "B0" ) ) ||
idparent == EvtPDL::getId( std::string( "anti-B0" ) ) ) {
mq = formFactors->getQuarkMass( 2 ); // m_d mass from the dispersion QM
fb = 0.20; // leptonic decay constant
// V_{td}
Vtq = unit1 - ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) ) *
( CKM_barrho * unit1 + CKM_bareta * uniti ) /
sqrt( 1.0 - pow( CKM_lambda, 2.0 ) );
Vtq = CKM_A * pow( CKM_lambda, 3.0 ) * Vtq;
// V_{ud}
Vuq = unit1 * ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) -
0.125 * pow( CKM_lambda, 4.0 ) );
// V_{cd}
Vcq = unit1 *
( -CKM_lambda +
0.5 * pow( CKM_A, 2.0 ) * pow( CKM_lambda, 5.0 ) *
( 1.0 - 2.0 * ( CKM_barrho * unit1 + CKM_bareta * uniti ) /
sqrt( 1.0 - pow( CKM_lambda, 2.0 ) ) ) );
}
if ( mq < 0.001 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function EvtbsTollGammaISRFSRAmp::CalcAmp(..// 4-momentum of ell^+.)"
<< "\n Error in the model set!"
<< " mq = " << mq << std::endl;
::abort();
}
Vtb = unit1 * ( 1.0 - 0.5 * pow( CKM_A * CKM_lambda * CKM_lambda,
2.0 ) ); // V_{tb}
Vub = CKM_A * pow( CKM_lambda, 3.0 ) *
( CKM_barrho * unit1 - CKM_bareta * uniti ) /
sqrt( 1.0 - pow( CKM_lambda, 2.0 ) ); // V_{ub}
Vcb = unit1 * CKM_A * pow( CKM_lambda, 2.0 ); // V_{cb}
CKM_factor = conj( Vtq ) * Vtb; // V^*_{tq}*V_{tb}
lambda_qu = conj( Vuq ) * Vub /
CKM_factor; // V^*_{uq}*V_{ub}/V^*_{tq}*V_{tb}
Relambda_qu = real( lambda_qu );
Imlambda_qu = imag( lambda_qu );
lambda_qc = conj( Vcq ) * Vcb /
CKM_factor; // V^*_{cq}*V_{cb}/V^*_{tq}*V_{tb}
// The Wilson Coefficients preparation according to the paper
// A.J.Buras, M.Munz, Phys.Rev.D52, p.189 (1995)
double c1, c2;
EvtComplex a1, c7gam, c9eff_b2q, c9eff_barb2barq, c10a;
// foton energy cut and removal of the J/psi amd psi' resonant area
if ( Egam < Egamma_min || ( res_swch == 1 && q2 >= 9.199 && q2 <= 15.333 ) ||
( q2 <= mumumass_min * mumumass_min ) ) {
c1 = 0.0;
c2 = 0.0;
a1 = unit1 * 0.0;
c7gam = unit1 * 0.0;
c9eff_b2q = unit1 * 0.0;
c9eff_barb2barq = unit1 * 0.0;
c10a = unit1 * 0.0;
} else {
c1 = WilsCoeff->C1( mu, Mw, Nf, ias );
c2 = WilsCoeff->C2( mu, Mw, Nf, ias );
a1 = unit1 * ( c1 + c2 / 3.0 );
c7gam = WilsCoeff->GetC7Eff( mu, Mw, mt, Nf, ias );
c9eff_b2q = WilsCoeff->GetC9Eff( 0, res_swch, ias, Nf, q2, mb, mq, mc, mu,
mt, Mw, ml, Relambda_qu, Imlambda_qu );
c9eff_barb2barq = WilsCoeff->GetC9Eff( 1, res_swch, ias, Nf, q2, mb, mq,
mc, mu, mt, Mw, ml, Relambda_qu,
Imlambda_qu );
c10a = WilsCoeff->GetC10Eff( mt, Mw );
}
EvtComplex Fv,
Fa; // The change of the sign is included in the amplitudes definition!
EvtComplex Ftv_b2q, Ftv_barb2barq;
EvtComplex Fta_b2q, Fta_barb2barq;
// foton energy cut and removal of the J/psi amd psi' resonant area
if ( Egam < Egamma_min || ( res_swch == 1 && q2 >= 9.199 && q2 <= 15.333 ) ||
( q2 <= mumumass_min * mumumass_min ) ) {
fb = 0.0;
Fa = unit1 * 0.0;
Fv = unit1 * 0.0;
Fta_b2q = unit1 * 0.0;
Fta_barb2barq = unit1 * 0.0;
Ftv_b2q = unit1 * 0.0;
Ftv_barb2barq = unit1 * 0.0;
} else {
if ( fb < 0.01 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function EvtbsTollGammaISRFSRAmp::CalcAmp(...)"
<< "\n Leptonic decay constant fb is not uninitialized in this function!"
<< " fb = " << fb << std::endl;
::abort();
}
// For \bar B^0_q -> l^+ l^- gamma
formFactors->getPhotonFF( 0, fb, parent->getId(), q2, M1, mb, mq, c7gam,
a1, lambda_qu, lambda_qc, Fv, Fa, Ftv_b2q,
Fta_b2q );
// For B^0_q -> l^+ l^- gamma
formFactors->getPhotonFF( 1, fb, parent->getId(), q2, M1, mb, mq, c7gam,
a1, lambda_qu, lambda_qc, Fv, Fa,
Ftv_barb2barq, Fta_barb2barq );
}
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n ============================================================================"
// << "\n ============================================================================"
// << "\n\n The function Evtbs2llGammaISRFSRAmp::CalcAmp(...) passed."
// << "\n Particle masses:"
// << "\n B - meson mass M1 = " << M1
// << "\n photon minimum E = " << Egamma_min
// << "\n q2 = " << q2
// << "\n leptonic mass ml = " << ml
// << "\n light quark mass = " << mq
// << "\n c - quark mass mc = " << mc
// << "\n b - quark mass mb = " << mb
// << "\n t - quark mass mt = " << mt
// << "\n W - boson mass Mw = " << Mw
// << "\n ============================================================================"
// << "\n Input parameters:"
// << "\n scale parameter mu = " << mu
// << "\n number of flavors Nf = " << Nf
// << "\n state radiation switching = " << sr
// << "\n resonant switching = " << res_swch
// << "\n parameter for alpha_s(M_Z) = " << ias
// << "\n photon energy cut (GeV) = " << Egamma_min
// << "\n ============================================================================"
// << "\n Form-factors"
// << "\n Egam = " << Egam
// << "\n Egamma_min = " << Egamma_min
// << "\n Fv = " << Fv
// << "\n Fa = " << Fa
// << "\n Ftv_b2q = " << Ftv_b2q
// << "\n Fta_b2q = " << Fta_b2q
// << "\n Ftv_barb2barq = " << Ftv_barb2barq
// << "\n Fta_barb2barq = " << Fta_barb2barq
// << "\n ============================================================================"
// << "\n Wilson Coefficients:"
// << "\n Egam = " << Egam
// << "\n Egamma_min = " << Egamma_min
// << "\n Re(c7gam) = " << real(c7gam)
// << " Im(c7gam) = " << imag(c7gam)
// << "\n Re(c9eff_b2q) = " << real(c9eff_b2q)
// << " Im(c9eff_b2q) = " << imag(c9eff_b2q)
// << "\n Re(c9eff_barb2barq) = " << real(c9eff_barb2barq)
// << " Im(c9eff_barb2barq) = " << imag(c9eff_barb2barq)
// << "\n Re(c10a) = " << real(c10a)
// << " Im(c10a) = " << imag(c10a)
// << std::endl;
// Hadronic matrix element coefficients
EvtComplex a_b2q, a_barb2barq, b_b2q, b_barb2barq, e_b2q, e_barb2barq,
f_b2q, f_barb2barq;
EvtComplex brammS, brammT;
a_b2q = c9eff_b2q * Fv + 2.0 * c7gam * Ftv_b2q * mb * M1 / q2;
a_barb2barq = c9eff_barb2barq * Fv +
2.0 * c7gam * Ftv_barb2barq * mb * M1 / q2;
b_b2q = ( c9eff_b2q * Fa + 2.0 * c7gam * Fta_b2q * mb * M1 / q2 ) * pk /
( M1 * M1 );
b_barb2barq = ( c9eff_barb2barq * Fa +
2.0 * c7gam * Fta_barb2barq * mb * M1 / q2 ) *
pk / ( M1 * M1 );
e_b2q = c10a * Fv;
e_barb2barq = e_b2q;
f_b2q = c10a * Fa * pk / ( M1 * M1 );
f_barb2barq = f_b2q;
brammS = 0.0; // in the Bq-meson rest frame!
brammT = 0.5 * c10a * ml * fb *
( 1.0 / p2k + 1.0 / p1k ); // for Bramsstrahlung
// The separation of the ISR and FSR contributions
if ( sr == 0 ) { // ISR only
brammS = 0.0;
brammT = 0.0;
}
if ( sr == 1 ) { // FSR only
a_b2q = 0.0;
a_barb2barq = 0.0;
b_b2q = 0.0;
b_barb2barq = 0.0;
e_b2q = 0.0;
e_barb2barq = 0.0;
f_b2q = 0.0;
f_barb2barq = 0.0;
}
EvtTensor4C T1, T2; // hadronic matrix element tensor structures
EvtVector4C E1, E2;
EvtComplex E3;
EvtVector4C epsG; // photon polarisation vector
int i; // photon polarisations counter
EvtVector4C lvc11, lvc12; // spin structures for
EvtVector4C lvc21, lvc22; // the leptonic vector current
EvtVector4C lac11, lac12; // spin structures for
EvtVector4C lac21, lac22; // the leptonic axial current
EvtComplex lsc11, lsc12; // spin structures for
EvtComplex lsc21, lsc22; // the leptonic scalar current
EvtTensor4C ltc11, ltc12; // spin structures for
EvtTensor4C ltc21, ltc22; // the leptonic tensor current
// B - and barB - mesons descriptors
- static EvtIdSet bmesons( "anti-B0", "anti-B_s0" );
- static EvtIdSet bbarmesons( "B0", "B_s0" );
+ static EvtIdSet bmesons{ "anti-B0", "anti-B_s0" };
+ static EvtIdSet bbarmesons{ "B0", "B_s0" };
EvtId parentID = parent->getId();
if ( bmesons.contains( parentID ) ) {
// The amplitude for the decay barB -> gamma ell^+ ell^- or
// b \bar q -> gamma ell^+ ell^-
T1 = -a_b2q * unit1 * dual( EvtGenFunctions::directProd( hatp, hatk ) ) -
b_b2q * uniti * EvtTensor4C::g();
T2 = -e_b2q * unit1 * dual( EvtGenFunctions::directProd( hatp, hatk ) ) -
f_b2q * uniti * EvtTensor4C::g();
// spin combinations for vector lepton current
lvc11 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
lvc21 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lvc12 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lvc22 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
lac11 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
lac21 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lac12 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lac22 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
lsc11 = EvtLeptonSCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
lsc21 = EvtLeptonSCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lsc12 = EvtLeptonSCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lsc22 = EvtLeptonSCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
// \epsilon^{\alpha\beta\mu\nu}*TCurrent_{\mu\nu}
ltc11 = dual( EvtLeptonTCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) ) );
ltc21 = dual( EvtLeptonTCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) ) );
ltc12 = dual( EvtLeptonTCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) ) );
ltc22 = dual( EvtLeptonTCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) ) );
// summing up photon polarisations
for ( i = 0; i < 2; i++ ) {
// conjaction of epsG (photon polarization vector)
EvtVector4C epsG = parent->getDaug( 0 )->epsParentPhoton( i ).conj();
// de-escalation T with epsG
E1 = T1.cont2( epsG );
E2 = T2.cont2( epsG );
E3 = ( epsG * hatp ) * brammS;
// foton energy cut and removal of the J/psi amd psi' resonant area
if ( Egam < Egamma_min ||
( res_swch == 1 && q2 >= 9.199 && q2 <= 15.333 ) ||
( q2 <= mumumass_min * mumumass_min ) ) {
CKM_factor = 0.0 * unit1;
}
// 1
amp.vertex( i, 0, 0,
CKM_factor *
( lvc11 * E1 + lac11 * E2 + uniti * lsc11 * E3 +
uniti * ( ( ltc11.cont2( hatp ) ) * epsG ) *
brammT ) );
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n 1" << CKM_factor*(lvc11*E1+lac11*E2+uniti*lsc11*E3+uniti*((ltc11.cont2(hatp))*epsG)*brammT)
// << std::endl;
// 2
amp.vertex( i, 0, 1,
CKM_factor *
( lvc12 * E1 + lac12 * E2 + uniti * lsc12 * E3 +
uniti * ( ( ltc12.cont2( hatp ) ) * epsG ) *
brammT ) );
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n 2" << CKM_factor*(lvc12*E1+lac12*E2+uniti*lsc12*E3+uniti*((ltc12.cont2(hatp))*epsG)*brammT)
// << std::endl;
// 3
amp.vertex( i, 1, 0,
CKM_factor *
( lvc21 * E1 + lac21 * E2 + uniti * lsc21 * E3 +
uniti * ( ( ltc21.cont2( hatp ) ) * epsG ) *
brammT ) );
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n 3" << CKM_factor*(lvc21*E1+lac21*E2+uniti*lsc21*E3+uniti*((ltc21.cont2(hatp))*epsG)*brammT)
// << std::endl;
// 4
amp.vertex( i, 1, 1,
CKM_factor *
( lvc22 * E1 + lac22 * E2 + uniti * lsc22 * E3 +
uniti * ( ( ltc22.cont2( hatp ) ) * epsG ) *
brammT ) );
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n 4" << CKM_factor*(lvc22*E1+lac22*E2+uniti*lsc22*E3+uniti*((ltc22.cont2(hatp))*epsG)*brammT)
// << std::endl;
}
} else {
if ( bbarmesons.contains( parentID ) ) {
// The amplitude for the decay B -> gamma ell^+ ell^- or
// q bar b -> gamma ell^+ ell^-
T1 = -a_barb2barq * unit1 *
dual( EvtGenFunctions::directProd( hatp, hatk ) ) +
b_barb2barq * uniti * EvtTensor4C::g();
T2 = -e_barb2barq * unit1 *
dual( EvtGenFunctions::directProd( hatp, hatk ) ) +
f_barb2barq * uniti * EvtTensor4C::g();
lvc11 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
lvc21 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lvc12 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lvc22 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
lac11 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
lac21 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lac12 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lac22 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
lsc11 = EvtLeptonSCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) );
lsc21 = EvtLeptonSCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) );
lsc12 = EvtLeptonSCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) );
lsc22 = EvtLeptonSCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) );
// \epsilon^{\alpha\beta\mu\nu}*TCurrent_{\mu\nu}
ltc11 = dual( EvtLeptonTCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 1 ) ) );
ltc21 = dual( EvtLeptonTCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 1 ) ) );
ltc12 = dual( EvtLeptonTCurrent( lepPlus->spParent( 1 ),
lepMinus->spParent( 0 ) ) );
ltc22 = dual( EvtLeptonTCurrent( lepPlus->spParent( 0 ),
lepMinus->spParent( 0 ) ) );
// summing up photon polarisations
for ( i = 0; i < 2; i++ ) {
EvtVector4C barepsG = parent->getDaug( 0 )->epsParentPhoton( i );
E1 = T1.cont2( barepsG );
E2 = T2.cont2( barepsG );
E3 = ( barepsG * hatp ) * brammS;
// foton energy cut and removal of the J/psi amd psi' resonant area
if ( Egam < Egamma_min ||
( res_swch == 1 && q2 >= 9.199 && q2 <= 15.333 ) ||
( q2 <= mumumass_min * mumumass_min ) ) {
CKM_factor = 0.0 * unit1;
}
amp.vertex(
i, 1, 1,
conj( CKM_factor ) *
( lvc11 * E1 + lac11 * E2 + uniti * lsc11 * E3 + // -?
uniti * ( ( ltc11.cont2( hatp ) ) * epsG ) * brammT ) );
amp.vertex(
i, 1, 0,
conj( CKM_factor ) *
( lvc12 * E1 + lac12 * E2 + uniti * lsc12 * E3 + // -?
uniti * ( ( ltc12.cont2( hatp ) ) * epsG ) * brammT ) );
amp.vertex(
i, 0, 1,
conj( CKM_factor ) *
( lvc21 * E1 + lac21 * E2 + uniti * lsc21 * E3 + // -?
uniti * ( ( ltc21.cont2( hatp ) ) * epsG ) * brammT ) );
amp.vertex(
i, 0, 0,
conj( CKM_factor ) *
( lvc22 * E1 + lac22 * E2 + uniti * lsc22 * E3 + // -?
uniti * ( ( ltc22.cont2( hatp ) ) * epsG ) * brammT ) );
}
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function Evtbs2llGammaISRFSRAmp::CalcAmp(...)"
<< "\n Wrong B-meson number" << std::endl;
::abort();
}
}
}
//
// The decays B -> Gamma ell^+ ell^- maximum probability calculation for the
// d^2\Gamma/dq^2 d\cos\theta distribution.
//
// \theta - the angle between the photon and ell^- directions in the
// B-meson rest frame.
//
// If ias=0 (nonresonant case), the maximum is achieved at q2
// B0s: q2 = 4*ml^2, Mphi^2, q_max^2;
// B0d: q2 = 4*ml^2, Mrho^2, Momega^2, q_max^2;
// If ias=1 (resonant case), the maximum in the same points, because the
// resonat area is remove
//
double Evtbs2llGammaISRFSRAmp::CalcMaxProb(
EvtId parnum, EvtId photnum, EvtId l1num, EvtId l2num,
Evtbs2llGammaFF* formFactors, EvtbTosllWilsCoeffNLO* WilsCoeff, double mu,
int Nf, int sr, int res_swch, int ias, double Egamma_min, double CKM_A,
double CKM_lambda, double CKM_barrho, double CKM_bareta, double mumumass_min )
{
double maxfoundprob = -100.0; // maximum of the probability
double M1 = EvtPDL::getMeanMass( parnum ); // B - meson mass
double ml = EvtPDL::getMeanMass( l1num ); // leptonic mass
double Mrho = EvtPDL::getMeanMass(
EvtPDL::getId( std::string( "rho0" ) ) ); // mass of the rho-meson, MeV
double Momega = EvtPDL::getMeanMass( EvtPDL::getId(
std::string( "omega" ) ) ); // mass of the omega-meson, MeV
double Mphi = EvtPDL::getMeanMass(
EvtPDL::getId( std::string( "phi" ) ) ); // mass of the phi-meson, MeV
// EvtGenReport(EVTGEN_NOTICE,"EvtGen")
// << "\n M1 = " << M1
// << "\n ml = " << ml
// << "\n Mrho = " << Mrho
// << "\n Momega = " << Momega
// << "\n Mphi = " << Mphi
// << "\n Egamma_min = " << Egamma_min
// << std::endl;
double list_of_max_q2_points[5];
list_of_max_q2_points[0] = pow( 2.0 * ml, 2.0 );
list_of_max_q2_points[1] = pow( Mrho, 2.0 );
list_of_max_q2_points[2] = pow( Momega, 2.0 );
list_of_max_q2_points[3] = pow( Mphi, 2.0 );
list_of_max_q2_points[4] =
pow( M1, 2.0 ) - 2.0 * M1 * Egamma_min; // q^2_max at photon energy cut
// if(list_of_max_points[4]<0){
// EvtGenReport(EVTGEN_ERROR,"EvtGen")
// << "\n\n In the function EvtbsTollGammaAmp::CalcScalarMaxProb(...)"
// << "\n Bad photon energy cut: Egamma_min > M1 in the rest frame of B-meson!"
// << "\n q2_max = " << list_of_max_points[4]
// << "\n M1 = " << M1
// << "\n Egamma_min = " << Egamma_min
// << std::endl;
// ::abort();
// }
if ( Egamma_min > Mrho ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function Evtbs2llGammaISRFSRAmp::CalcMaxProb(...)"
<< "\n Bad photon energy cut: Egamma_min > M_rho0 in the rest frame of B-meson."
<< "\n Mrho = " << Mrho << "\n Egamma_min = " << Egamma_min
<< std::endl;
::abort();
}
if ( Egamma_min <= 0 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function Evtbs2llGammaISRFSRAmp::CalcMaxProb(...)"
<< "\n Bad photon energy cut: Egamma_min <= 0 in the rest frame of B-meson."
<< "\n Egamma_min = " << Egamma_min << std::endl;
::abort();
}
if ( res_swch == 0 || res_swch == 1 ) {
int i_list;
for ( i_list = 0; i_list <= 4; i_list++ ) {
double s; // mandelstam variable "s";
double t_minus; // minimum and maximum of the mandelstam variable "t"
double t_plus; // as function of the mandelstam variable "s=q2";
double t_for_s;
int ijk; // counter for variable "t";
int max_ijk; // maximal value of this counter;
s = list_of_max_q2_points[i_list];
t_plus = pow( M1, 2.0 ) + 2.0 * pow( ml, 2.0 ) - s;
t_plus = t_plus + sqrt( 1.0 - 4.0 * pow( ml, 2.0 ) / s ) *
( pow( M1, 2.0 ) - s );
t_plus *= 0.5;
t_minus = pow( M1, 2.0 ) + 2.0 * pow( ml, 2.0 ) - s;
t_minus = t_minus - sqrt( 1.0 - 4.0 * pow( ml, 2.0 ) / s ) *
( pow( M1, 2.0 ) - s );
t_minus *= 0.5;
if ( fabs( t_plus - t_minus ) < 0.000001 )
t_minus = t_plus;
max_ijk = 1000;
double dt = ( t_plus - t_minus ) / ( (double)max_ijk );
if ( fabs( dt ) < 0.00001 )
dt = 0.0;
if ( dt < 0.0 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbsTollGammaISRFSRAmp::CalcScalarMaxProb(...)"
<< "\n dt = " << dt << " < 0."
<< "\n s = " << s << "\n t_plus = " << t_plus
<< "\n t_minus = " << t_minus << "\n M1 = " << M1
<< "\n ml = " << ml << std::endl;
::abort();
}
for ( ijk = 0; ijk <= max_ijk; ijk++ ) {
t_for_s = t_minus + dt * ( (double)ijk );
// B-meson rest frame particles and they kinematics inicialization
double Eg, El2;
Eg = ( pow( M1, 2.0 ) - s ) / ( 2.0 * M1 ); // photon energy
El2 = ( s + t_for_s - pow( ml, 2.0 ) ) /
( 2.0 * M1 ); // ell^- energy
double modl2;
modl2 = sqrt( pow( El2, 2.0 ) - pow( ml, 2.0 ) );
double cosBellminus; // angle between the B-meson and ell^- directions
cosBellminus = ( pow( ml, 2.0 ) + 2.0 * Eg * El2 - t_for_s ) /
( 2.0 * Eg * modl2 );
if ( ( fabs( cosBellminus ) > 1.0 ) &&
( fabs( cosBellminus ) <= 1.0001 ) ) {
EvtGenReport( EVTGEN_NOTICE, "EvtGen" )
<< "\n Debug in the function EvtbsTollGammaISRFSRAmp::CalcMaxProb(...):"
<< "\n cos(theta) = " << cosBellminus << std::endl;
cosBellminus = cosBellminus / fabs( cosBellminus );
}
if ( fabs( cosBellminus ) > 1.0001 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbsTollGammaISRFSRAmp::CalcMaxProb(...)"
<< "\n |cos(theta)| = " << fabs( cosBellminus ) << " > 1"
<< "\n s = " << s << "\n t_for_s = " << t_for_s
<< "\n t_plus = " << t_plus << "\n t_minus = " << t_minus
<< "\n dt = " << dt << "\n Eg = " << Eg
<< "\n El2 = " << El2 << "\n modl2 = " << modl2
<< "\n ml = " << ml << std::endl;
::abort();
}
EvtVector4R p, k, p1, p2;
p.set( M1, 0.0, 0.0, 0.0 );
k.set( Eg, Eg, 0.0, 0.0 );
p2.set( El2, modl2 * cosBellminus,
-modl2 * sqrt( 1.0 - pow( cosBellminus, 2.0 ) ), 0.0 );
p1 = p - k - p2;
// B-meson state preparation at the rest frame of B-meson
EvtScalarParticle* scalar_part;
EvtParticle* root_part;
scalar_part = new EvtScalarParticle;
scalar_part->noLifeTime();
scalar_part->init( parnum, p );
root_part = (EvtParticle*)scalar_part;
root_part->setDiagonalSpinDensity();
// Amplitude initialization
EvtId listdaug[3];
listdaug[0] = photnum;
listdaug[1] = l1num;
listdaug[2] = l2num;
EvtAmp amp;
amp.init( parnum, 3, listdaug );
// Daughters states preparation at the rest frame of B-meson
root_part->makeDaughters( 3, listdaug );
EvtParticle *gamm, *lep1, *lep2;
gamm = root_part->getDaug( 0 );
lep1 = root_part->getDaug( 1 );
lep2 = root_part->getDaug( 2 );
gamm->noLifeTime();
lep1->noLifeTime();
lep2->noLifeTime();
gamm->init( photnum, k );
lep1->init( l1num, p1 );
lep2->init( l2num, p2 );
EvtSpinDensity rho;
rho.setDiag( root_part->getSpinStates() );
// The amplitude calculation at the
// "maximum amplitude" kinematical configuration
CalcAmp( root_part, amp, formFactors, WilsCoeff, mu, Nf, sr,
res_swch, ias, Egamma_min, CKM_A, CKM_lambda,
CKM_barrho, CKM_bareta, mumumass_min );
// Now find the probability at this q2 and cos theta lepton point
double nikmax = rho.normalizedProb( amp.getSpinDensity() );
if ( nikmax > maxfoundprob ) {
double maxfoundprob_old;
maxfoundprob_old = maxfoundprob;
maxfoundprob = nikmax;
EvtGenReport( EVTGEN_NOTICE, "EvtGen" )
<< "\n maxfoundprob ( s =" << s << ", t = " << t_for_s
<< " ) = " << maxfoundprob
<< "\n maxfoundprob_old = " << maxfoundprob_old
<< "\n ijk =" << ijk << std::endl;
}
delete scalar_part;
// delete root_part;
delete gamm;
delete lep1;
delete lep2;
} // for(ijk=0; ijk<=max_ijk; ijk++)
} // i_list - variable loop
} // if(res_swch==0||res_swch==1)
else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function Evtbs2llGammaISRFSRAmp::CalcMaxProb(...)"
<< "\n Unexpected value of the variable res_swch !!!"
<< "\n res_swch = " << res_swch << std::endl;
::abort();
}
if ( maxfoundprob < 0.0 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function Evtbs2llGammaISRFSRAmp::CalcMaxProb(...)"
<< "\n maxfoundprob = " << maxfoundprob << " <0 or =0!"
<< "\n mu =" << mu << " Nf =" << Nf << "\n sr =" << sr
<< " res_swch =" << res_swch << " ias =" << ias
<< "\n Egamma_min =" << Egamma_min << "\n CKM_A = " << CKM_A
<< " CKM_lambda = " << CKM_lambda << "\n CKM_barrho = " << CKM_barrho
<< " CKM_bareta = " << CKM_bareta << std::endl;
::abort();
}
if ( maxfoundprob == 0.0 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function Evtbs2llGammaISRFSRAmp::CalcMaxProb(...)"
<< "\n maxfoundprob = " << maxfoundprob << " <0 or =0!"
<< "\n mu =" << mu << " Nf =" << Nf << "\n sr =" << sr
<< " res_swch =" << res_swch << " ias =" << ias
<< "\n Egamma_min =" << Egamma_min << "\n CKM_A = " << CKM_A
<< " CKM_lambda = " << CKM_lambda << "\n CKM_barrho = " << CKM_barrho
<< " CKM_bareta = " << CKM_bareta << std::endl;
maxfoundprob = 0.00000001;
}
maxfoundprob *= 1.01;
EvtGenReport( EVTGEN_NOTICE, "EvtGen" )
<< "\n **********************************************************************"
<< "\n The function Evtbs2llGammaISRFSRAmp::CalcMaxProb(...) passed with arguments:"
<< "\n mu =" << mu << " Nf =" << Nf << "\n sr =" << sr
<< " res_swch =" << res_swch << " ias =" << ias
<< "\n CKM_A = " << CKM_A << " CKM_lambda = " << CKM_lambda
<< "\n Egamma_min =" << Egamma_min << "\n CKM_barrho = " << CKM_barrho
<< " CKM_bareta = " << CKM_bareta
<< "\n The distribution maximum maxfoundprob =" << maxfoundprob
<< "\n **********************************************************************"
<< std::endl;
return maxfoundprob;
}
// Triangular function
double Evtbs2llGammaISRFSRAmp::lambda( double a, double b, double c )
{
double l;
l = pow( a, 2.0 ) + pow( b, 2.0 ) + pow( c, 2.0 ) - 2.0 * a * b -
2.0 * a * c - 2.0 * b * c;
return l;
}
diff --git a/src/EvtGenModels/EvtbsToLLLLAmp.cpp b/src/EvtGenModels/EvtbsToLLLLAmp.cpp
index 51717b7..9f9b115 100644
--- a/src/EvtGenModels/EvtbsToLLLLAmp.cpp
+++ b/src/EvtGenModels/EvtbsToLLLLAmp.cpp
@@ -1,822 +1,822 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenModels/EvtbsToLLLLAmp.hh"
#include "EvtGenBase/EvtAmp.hh"
#include "EvtGenBase/EvtComplex.hh"
#include "EvtGenBase/EvtDiracSpinor.hh"
#include "EvtGenBase/EvtGenKine.hh"
#include "EvtGenBase/EvtId.hh"
#include "EvtGenBase/EvtIdSet.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtPatches.hh"
#include "EvtGenBase/EvtReport.hh"
#include "EvtGenBase/EvtScalarParticle.hh"
#include "EvtGenBase/EvtTensor4C.hh"
#include "EvtGenBase/EvtVector4C.hh"
#include "EvtGenModels/EvtbTosllWilsCoeffNLO.hh"
#include "EvtGenModels/Evtbs2llGammaFFMNT.hh"
#include <cstdlib>
// input: *parent - the pointer to the parent particle (B-meson, the
// object of the EvtParticle class);
// *formFactors - the pointer to instance of EvtbTosllGammaFF class object;
// *WilsCoeff - the pointer to the Standart Model Wilson Coefficients class;
// mu - the scale parameter, GeV;
// Nf - number of "effective" flavors (for b-quark Nf=5);
// res_swch - resonant switching parameter:
// = 0 the resonant contribution switched OFF,
// = 1 the resonant contribution switched ON;
// ias - switching parameter for \alpha_s(M_Z) value:
// = 0 PDG 1sigma minimal alpha_s(M_Z),
// = 1 PDG average value alpha_s(M_Z),
// = 2 PDG 1sigma maximal alpha_s(M_Z).
// Wolfenstein parameterization for CKM matrix
// CKM_A, CKM_lambda, CKM_barrho, CKM_bareta
void EvtbsToLLLLAmp::CalcAmp( EvtParticle* parent, EvtAmp& amp,
Evtbs2llGammaFF* formFactors,
EvtbTosllWilsCoeffNLO* WilsCoeff, double mu,
int Nf, int res_swch, int ias, double CKM_A,
double CKM_lambda, double CKM_barrho,
double CKM_bareta )
{
// FILE *mytest;
int il1 = 0, il2 = 1, il3 = 2,
il4 = 3; // leptons are the first, second, thirds
// and fourth daughter particles
EvtComplex unit1( 1.0, 0.0 ); // real unit
EvtComplex uniti( 0.0, 1.0 ); // imaginary unit
double M1 = parent->mass(); // B - meson mass, GeV
double ml = parent->getDaug( il1 )->mass(); // leptonic mass, GeV
double mq = 0.0; // light quark mass from the dispersion QM, GeV
double mc = formFactors->getQuarkMass(
4 ); // m_c mass from the dispersion QM, GeV
double mb = formFactors->getQuarkMass(
5 ); // m_b mass from the dispersion QM, GeV
double Mw = 80.403; // GeV W-boson mass, GeV
double mt = 174.2; // GeV t-quark mass, GeV
double fb = 0.0; // leptonic decay constant of B-meson, Gev
EvtComplex Vtb, Vtq, Vub, Vuq, Vcb,
Vcq; // V_{tb}, V_{tq}, V_{ub}, V_{uq}, V_{cb}, V_{cq}
EvtComplex CKM_factor; // V^*_{tq}*V_{tb}, where q={d,s}
EvtComplex lambda_qu; // V^*_{uq}*V_{ub}/V^*_{tq}*V_{tb}, where q={d,s}
EvtComplex lambda_qc; // V^*_{cq}*V_{cb}/V^*_{tq}*V_{tb}, where q={d,s}
double Relambda_qu, Imlambda_qu;
//
// Setting of the mq and CKM matrix elements for different Bq-mesons tipes
//
EvtId idparent = parent->getId(); // Bq-meson Id
EvtId IdMu1, IdMu2, IdMu3, IdMu4;
if ( idparent == EvtPDL::getId( std::string( "B_s0" ) ) ||
idparent == EvtPDL::getId( std::string( "anti-B_s0" ) ) ) {
mq = formFactors->getQuarkMass( 3 ); // m_s mass from the dispersion QM
fb = 0.24; // leptonic decay constant
// V_{ts}
Vtq = unit1 * ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) ) +
pow( CKM_lambda, 2.0 ) *
( CKM_barrho * unit1 + CKM_bareta * uniti ) /
sqrt( 1.0 - pow( CKM_lambda, 2.0 ) );
Vtq = -CKM_A * pow( CKM_lambda, 2.0 ) * Vtq;
// V_{us}
Vuq = CKM_lambda * unit1;
// V_{cs}
Vcq = unit1 - 0.5 * pow( CKM_lambda, 2.0 ) -
0.125 * pow( CKM_lambda, 4.0 ) * ( 1.0 + 4.0 * pow( CKM_A, 2.0 ) );
}
if ( idparent == EvtPDL::getId( std::string( "B0" ) ) ||
idparent == EvtPDL::getId( std::string( "anti-B0" ) ) ) {
mq = formFactors->getQuarkMass( 2 ); // m_d mass from the dispersion QM
fb = 0.20; // leptonic decay constant
// V_{td}
Vtq = unit1 - ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) ) *
( CKM_barrho * unit1 + CKM_bareta * uniti ) /
sqrt( 1.0 - pow( CKM_lambda, 2.0 ) );
Vtq = CKM_A * pow( CKM_lambda, 3.0 ) * Vtq;
// V_{ud}
Vuq = unit1 * ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) -
0.125 * pow( CKM_lambda, 4.0 ) );
// V_{cd}
Vcq = unit1 *
( -CKM_lambda +
0.5 * pow( CKM_A, 2.0 ) * pow( CKM_lambda, 5.0 ) *
( 1.0 - 2.0 * ( CKM_barrho * unit1 + CKM_bareta * uniti ) /
sqrt( 1.0 - pow( CKM_lambda, 2.0 ) ) ) );
}
if ( mq < 0.001 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function EvtbsToLLLLAmp::CalcAmp(...)"
<< "\n Error in the mq setting!"
<< "\n mq = " << mq << "< 0.001"
<< "\n idparent = " << idparent << std::endl;
::abort();
}
Vtb = unit1 * ( 1.0 - 0.5 * pow( CKM_A * CKM_lambda * CKM_lambda,
2.0 ) ); // V_{tb}
Vub = CKM_A * pow( CKM_lambda, 3.0 ) *
( CKM_barrho * unit1 - CKM_bareta * uniti ) /
sqrt( 1.0 - pow( CKM_lambda, 2.0 ) ); // V_{ub}
Vcb = unit1 * CKM_A * pow( CKM_lambda, 2.0 ); // V_{cb}
CKM_factor = conj( Vtq ) * Vtb; // V^*_{tq}*V_{tb}
lambda_qu = conj( Vuq ) * Vub /
CKM_factor; // V^*_{uq}*V_{ub}/V^*_{tq}*V_{tb}
Relambda_qu = real( lambda_qu );
Imlambda_qu = imag( lambda_qu );
lambda_qc = conj( Vcq ) * Vcb /
CKM_factor; // V^*_{cq}*V_{cb}/V^*_{tq}*V_{tb}
//
// Setting the leptonic kinematical properties
//
// to find charges of ell^+ and ell^- in the B-meson daughters
int charge1 = ( EvtPDL::chg3( parent->getDaug( il1 )->getId() ) ) / 3;
int charge2 = ( EvtPDL::chg3( parent->getDaug( il2 )->getId() ) ) / 3;
int charge3 = ( EvtPDL::chg3( parent->getDaug( il3 )->getId() ) ) / 3;
int charge4 = ( EvtPDL::chg3( parent->getDaug( il4 )->getId() ) ) / 3;
if ( ( abs( charge1 ) != 1 ) || ( abs( charge2 ) != 1 ) ||
( abs( charge3 ) != 1 ) || ( abs( charge4 ) != 1 ) ||
( charge1 + charge2 + charge3 + charge4 != 0 ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function EvtbsToLLLLAmp::CalcAmp(...)"
<< "\n Error in the leptonic charge definition!"
<< "\n charge1 =" << charge1
<< "\n charge2 =" << charge2
<< "\n charge3 =" << charge3
<< "\n charge4 =" << charge4
<< "\n number of daughters =" << parent->getNDaug() << std::endl;
::abort();
}
EvtParticle* lep1Plus = nullptr;
EvtParticle* lep1Minus = nullptr;
EvtParticle* lep2Plus = nullptr;
EvtParticle* lep2Minus = nullptr;
EvtVector4R p; // B-meson momentum in the B-rest frame
EvtVector4R q; // first transition 4-momentum in the B-rest frame
EvtVector4R k; // second transition 4-momentum in the B-rest frame
double q2; // Mandelstam variable s=q^2
// Nondimentional 4-momentums
EvtVector4R hatp;
EvtVector4R hatq;
EvtVector4R hatk;
EvtVector4R qsecond; // first transition 4-momentum in the B-rest frame
EvtVector4R ksecond; // second transition 4-momentum in the B-rest frame
double q2second; // Mandelstam variable s=q^2
// Nondimentional 4-momentums
EvtVector4R hatpsecond;
EvtVector4R hatqsecond;
EvtVector4R hatksecond;
EvtVector4R k_1; // 4-momentum of ell^+ in the B-rest frame
EvtVector4R k_2; // 4-momentum of ell^- in the B-rest frame
EvtVector4R k_3; // 4-momentum of ell^+ in the B-rest frame
EvtVector4R k_4; // 4-momentum of ell^- in the B-rest frame
k_1.set( 0.0, 0.0, 0.0, 0.0 );
k_2.set( 0.0, 0.0, 0.0, 0.0 );
k_3.set( 0.0, 0.0, 0.0, 0.0 );
k_4.set( 0.0, 0.0, 0.0, 0.0 );
if ( ( charge1 + charge2 == 0 ) && ( charge3 + charge4 == 0 ) ) {
// positive charged lepton 1
lep1Plus = ( charge1 > charge2 ) ? parent->getDaug( il1 )
: parent->getDaug( il2 );
// negative charged lepton 1
lep1Minus = ( charge1 < charge2 ) ? parent->getDaug( il1 )
: parent->getDaug( il2 );
if ( charge1 > charge2 ) {
k_1 = parent->getDaug( il1 )->getP4();
k_2 = parent->getDaug( il2 )->getP4();
IdMu1 = parent->getDaug( il1 )->getId();
IdMu2 = parent->getDaug( il2 )->getId();
} else {
k_1 = parent->getDaug( il2 )->getP4();
k_2 = parent->getDaug( il1 )->getP4();
IdMu1 = parent->getDaug( il2 )->getId();
IdMu2 = parent->getDaug( il1 )->getId();
}
// positive charged lepton 2
lep2Plus = ( charge3 > charge4 ) ? parent->getDaug( il3 )
: parent->getDaug( il4 );
// negative charged lepton 2
lep2Minus = ( charge3 < charge4 ) ? parent->getDaug( il3 )
: parent->getDaug( il4 );
if ( charge3 > charge4 ) {
k_3 = parent->getDaug( il3 )->getP4();
k_4 = parent->getDaug( il4 )->getP4();
IdMu3 = parent->getDaug( il3 )->getId();
IdMu4 = parent->getDaug( il4 )->getId();
} else {
k_3 = parent->getDaug( il4 )->getP4();
k_4 = parent->getDaug( il3 )->getP4();
IdMu3 = parent->getDaug( il4 )->getId();
IdMu4 = parent->getDaug( il3 )->getId();
}
}
if ( ( charge1 + charge3 == 0 ) && ( charge2 + charge4 == 0 ) ) {
// positive charged lepton 1
lep1Plus = ( charge1 > charge3 ) ? parent->getDaug( il1 )
: parent->getDaug( il3 );
// negative charged lepton 1
lep1Minus = ( charge1 < charge3 ) ? parent->getDaug( il1 )
: parent->getDaug( il3 );
if ( charge1 > charge3 ) {
k_1 = parent->getDaug( il1 )->getP4();
k_2 = parent->getDaug( il3 )->getP4();
IdMu1 = parent->getDaug( il1 )->getId();
IdMu2 = parent->getDaug( il3 )->getId();
} else {
k_1 = parent->getDaug( il3 )->getP4();
k_2 = parent->getDaug( il1 )->getP4();
IdMu1 = parent->getDaug( il3 )->getId();
IdMu2 = parent->getDaug( il1 )->getId();
}
// positive charged lepton 2
lep2Plus = ( charge2 > charge4 ) ? parent->getDaug( il2 )
: parent->getDaug( il4 );
// negative charged lepton 2
lep2Minus = ( charge2 < charge4 ) ? parent->getDaug( il2 )
: parent->getDaug( il4 );
if ( charge2 > charge4 ) {
k_3 = parent->getDaug( il2 )->getP4();
k_4 = parent->getDaug( il4 )->getP4();
IdMu3 = parent->getDaug( il2 )->getId();
IdMu4 = parent->getDaug( il4 )->getId();
} else {
k_3 = parent->getDaug( il4 )->getP4();
k_4 = parent->getDaug( il2 )->getP4();
IdMu3 = parent->getDaug( il4 )->getId();
IdMu4 = parent->getDaug( il2 )->getId();
}
}
p = parent->getP4Restframe();
hatp = p / M1;
//
// The calculation of the FIRST part of the amplitude
//
q = k_1 + k_2;
k = k_3 + k_4;
q2 = q.mass2(); // Mandelstam variable s=q^2
hatq = q / M1;
hatk = k / M1;
// The Wilson Coefficients preparation according to the paper
// A.J.Buras, M.Munz, Phys.Rev.D52, p.189 (1995)
double c1, c2;
EvtComplex a1, c7gam, c9eff_b2q, c9eff_barb2barq, c10a;
// Excluded of the J/psi and psi' resonant area
if ( ( res_swch == 1 ) && ( q2 >= 9.199 ) && ( q2 <= 15.333 ) ) {
c1 = 0.0;
c2 = 0.0;
a1 = unit1 * 0.0;
c7gam = unit1 * 0.0;
c9eff_b2q = unit1 * 0.0;
c9eff_barb2barq = unit1 * 0.0;
c10a = unit1 * 0.0;
} else {
c1 = WilsCoeff->C1( mu, Mw, Nf, ias );
c2 = WilsCoeff->C2( mu, Mw, Nf, ias );
a1 = unit1 * ( c1 + c2 / 3.0 );
c7gam = WilsCoeff->GetC7Eff( mu, Mw, mt, Nf, ias );
c9eff_b2q = WilsCoeff->GetC9Eff( 0, res_swch, ias, Nf, q2, mb, mq, mc, mu,
mt, Mw, ml, Relambda_qu, Imlambda_qu );
c9eff_barb2barq = WilsCoeff->GetC9Eff( 1, res_swch, ias, Nf, q2, mb, mq,
mc, mu, mt, Mw, ml, Relambda_qu,
Imlambda_qu );
c10a = WilsCoeff->GetC10Eff( mt, Mw );
}
EvtComplex Fv,
Fa; // The change of the sign is included in the amplitudes definition!
EvtComplex Ftv_b2q, Ftv_barb2barq;
EvtComplex Fta_b2q, Fta_barb2barq;
// Excluded of the J/psi and psi' resonant area
if ( ( res_swch == 1 ) && ( q2 >= 9.199 ) && ( q2 <= 15.333 ) ) {
fb = 0.0;
Fa = unit1 * 0.0;
Fv = unit1 * 0.0;
Fta_b2q = unit1 * 0.0;
Fta_barb2barq = unit1 * 0.0;
Ftv_b2q = unit1 * 0.0;
Ftv_barb2barq = unit1 * 0.0;
} else {
if ( fb < 0.01 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function EvtbsToLLLLAmp::CalcAmp(...)"
<< "\n Leptonic decay constant fb is not uninitialized in this function!"
<< " fb = " << fb << std::endl;
::abort();
}
// For \bar B^0_q -> l^+ l^- gamma
formFactors->getPhotonFF( 0, fb, parent->getId(), q2, M1, mb, mq, c7gam,
a1, lambda_qu, lambda_qc, Fv, Fa, Ftv_b2q,
Fta_b2q );
// For B^0_q -> l^+ l^- gamma
formFactors->getPhotonFF( 1, fb, parent->getId(), q2, M1, mb, mq, c7gam,
a1, lambda_qu, lambda_qc, Fv, Fa,
Ftv_barb2barq, Fta_barb2barq );
}
// The functions for the hadronic matrix element calculation
EvtComplex a_b2q, a_barb2barq, b_b2q, b_barb2barq, c_b2q, c_barb2barq;
EvtComplex e_b2q, e_barb2barq, f_b2q, f_barb2barq, g_b2q, g_barb2barq;
a_b2q = c9eff_b2q * Fv + 2.0 * c7gam * Ftv_b2q * mb * M1 / q2;
a_barb2barq = c9eff_barb2barq * Fv +
2.0 * c7gam * Ftv_barb2barq * mb * M1 / q2;
b_b2q = ( c9eff_b2q * Fa + 2.0 * c7gam * Fta_b2q * mb * M1 / q2 ) *
( hatp * hatk );
b_barb2barq = ( c9eff_barb2barq * Fa +
2.0 * c7gam * Fta_barb2barq * mb * M1 / q2 ) *
( hatp * hatk );
c_b2q = c9eff_b2q * Fa + 2.0 * c7gam * Fta_b2q * mb * M1 / q2;
c_barb2barq = c9eff_barb2barq * Fa +
2.0 * c7gam * Fta_barb2barq * mb * M1 / q2;
e_b2q = c10a * Fv;
e_barb2barq = e_b2q;
f_b2q = c10a * Fa * ( hatp * hatk );
f_barb2barq = f_b2q;
g_b2q = c10a * Fa;
g_barb2barq = g_b2q;
//
// The calculation of the SECOND part of the amplitude
//
qsecond = k_1 + k_4;
ksecond = k_3 + k_2;
q2second = qsecond.mass2(); // Mandelstam variable s=q^2
hatqsecond = qsecond / M1;
hatksecond = ksecond / M1;
// Excluded of the J/psi and psi' resonant area
if ( ( res_swch == 1 ) && ( q2second >= 9.199 ) && ( q2second <= 15.333 ) ) {
c1 = 0.0;
c2 = 0.0;
a1 = unit1 * 0.0;
c7gam = unit1 * 0.0;
c9eff_b2q = unit1 * 0.0;
c9eff_barb2barq = unit1 * 0.0;
c10a = unit1 * 0.0;
} else {
c1 = WilsCoeff->C1( mu, Mw, Nf, ias );
c2 = WilsCoeff->C2( mu, Mw, Nf, ias );
a1 = unit1 * ( c1 + c2 / 3.0 );
c7gam = WilsCoeff->GetC7Eff( mu, Mw, mt, Nf, ias );
c9eff_b2q = WilsCoeff->GetC9Eff( 0, res_swch, ias, Nf, q2second, mb, mq,
mc, mu, mt, Mw, ml, Relambda_qu,
Imlambda_qu );
c9eff_barb2barq = WilsCoeff->GetC9Eff( 1, res_swch, ias, Nf, q2second,
mb, mq, mc, mu, mt, Mw, ml,
Relambda_qu, Imlambda_qu );
c10a = WilsCoeff->GetC10Eff( mt, Mw );
}
// Excluded of the J/psi and psi' resonant area
if ( ( res_swch == 1 ) && ( q2second >= 9.199 ) && ( q2second <= 15.333 ) ) {
fb = 0.0;
Fa = unit1 * 0.0;
Fv = unit1 * 0.0;
Fta_b2q = unit1 * 0.0;
Fta_barb2barq = unit1 * 0.0;
Ftv_b2q = unit1 * 0.0;
Ftv_barb2barq = unit1 * 0.0;
} else {
if ( fb < 0.01 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function EvtbsToLLLLAmp::CalcAmp(...)"
<< "\n Leptonic decay constant fb is not uninitialized in this function!"
<< " fb = " << fb << std::endl;
::abort();
}
// For \bar B^0_q -> l^+ l^- gamma
formFactors->getPhotonFF( 0, fb, parent->getId(), q2second, M1, mb, mq,
c7gam, a1, lambda_qu, lambda_qc, Fv, Fa,
Ftv_b2q, Fta_b2q );
// For B^0_q -> l^+ l^- gamma
formFactors->getPhotonFF( 1, fb, parent->getId(), q2second, M1, mb, mq,
c7gam, a1, lambda_qu, lambda_qc, Fv, Fa,
Ftv_barb2barq, Fta_barb2barq );
}
// The functions for the hadronic matrix element calculation
EvtComplex a_b2qsecond, a_barb2barqsecond, b_b2qsecond, b_barb2barqsecond,
c_b2qsecond, c_barb2barqsecond;
EvtComplex e_b2qsecond, e_barb2barqsecond, f_b2qsecond, f_barb2barqsecond,
g_b2qsecond, g_barb2barqsecond;
a_b2qsecond = c9eff_b2q * Fv + 2.0 * c7gam * Ftv_b2q * mb * M1 / q2second;
a_barb2barqsecond = c9eff_barb2barq * Fv +
2.0 * c7gam * Ftv_barb2barq * mb * M1 / q2second;
b_b2qsecond = ( c9eff_b2q * Fa + 2.0 * c7gam * Fta_b2q * mb * M1 / q2second ) *
( hatpsecond * hatksecond );
b_barb2barqsecond = ( c9eff_barb2barq * Fa +
2.0 * c7gam * Fta_barb2barq * mb * M1 / q2second ) *
( hatpsecond * hatksecond );
c_b2qsecond = c9eff_b2q * Fa + 2.0 * c7gam * Fta_b2q * mb * M1 / q2second;
c_barb2barqsecond = c9eff_barb2barq * Fa +
2.0 * c7gam * Fta_barb2barq * mb * M1 / q2second;
e_b2qsecond = c10a * Fv;
e_barb2barqsecond = e_b2qsecond;
f_b2qsecond = c10a * Fa * ( hatpsecond * hatksecond );
f_barb2barqsecond = f_b2qsecond;
g_b2qsecond = c10a * Fa;
g_barb2barqsecond = g_b2qsecond;
EvtTensor4C T1, T2; // Tensor structures for
EvtTensor4C T1second,
T2second; // the hadronic matrix element calculation
// B - and barB - mesons descriptors
- static EvtIdSet bmesons( "anti-B0", "anti-B_s0" );
- static EvtIdSet bbarmesons( "B0", "B_s0" );
+ static EvtIdSet bmesons{ "anti-B0", "anti-B_s0" };
+ static EvtIdSet bbarmesons{ "B0", "B_s0" };
EvtId parentID = parent->getId();
if ( bmesons.contains( parentID ) ) {
// The amplitude for the decay barB -> gamma ell^+ ell^- or
// b \bar q -> gamma ell^+ ell^-
T1 = a_b2q * unit1 * dual( EvtGenFunctions::directProd( hatq, hatk ) ) -
b_b2q * uniti * EvtTensor4C::g() +
c_b2q * uniti * EvtGenFunctions::directProd( hatk, hatq );
T2 = e_b2q * unit1 * dual( EvtGenFunctions::directProd( hatp, hatk ) ) -
f_b2q * uniti * EvtTensor4C::g() +
g_b2q * uniti * EvtGenFunctions::directProd( hatk, hatq );
T1second = a_b2qsecond * unit1 *
dual( EvtGenFunctions::directProd( hatqsecond,
hatksecond ) ) -
b_b2qsecond * uniti * EvtTensor4C::g() +
c_b2qsecond * uniti *
EvtGenFunctions::directProd( hatksecond, hatqsecond );
T2second = e_b2qsecond * unit1 *
dual( EvtGenFunctions::directProd( hatpsecond,
hatksecond ) ) -
f_b2qsecond * uniti * EvtTensor4C::g() +
g_b2qsecond * uniti *
EvtGenFunctions::directProd( hatksecond, hatqsecond );
int i1, i2, i3, i4; // leptonic spin structures counters
int leptonicspin[4]; // array for the saving of the leptonic spin configuration
// Tables for correspondings
// l^+(k_1) && lep1Plus && k_1 && i1
// l^-(k_2) && lep1Minus && k_2 && i2
// l^+(k_3) && lep2Plus && k_3 && i3
// l^-(k_4) && lep2Minus && k_4 && i4
for ( i2 = 0; i2 < 2; i2++ ) {
leptonicspin[0] = i2;
for ( i1 = 0; i1 < 2; i1++ ) {
leptonicspin[1] = i1;
for ( i4 = 0; i4 < 2; i4++ ) {
leptonicspin[2] = i4;
for ( i3 = 0; i3 < 2; i3++ ) {
leptonicspin[3] = i3;
EvtVector4C VL2L1, AL2L1, VL4L3;
EvtVector4C E1, E2;
EvtVector4C VL2L1second, AL2L1second, VL4L3second;
EvtVector4C E1second, E2second;
VL2L1 = EvtLeptonVCurrent( lep1Minus->spParent( i2 ),
lep1Plus->spParent( i1 ) );
AL2L1 = EvtLeptonACurrent( lep1Minus->spParent( i2 ),
lep1Plus->spParent( i1 ) );
VL4L3 = EvtLeptonVCurrent( lep2Minus->spParent( i4 ),
lep2Plus->spParent( i3 ) );
E1 = T1.cont2( VL4L3 );
E2 = T2.cont2( VL4L3 );
VL2L1second = EvtLeptonVCurrent(
lep2Minus->spParent( i2 ), lep1Plus->spParent( i1 ) );
AL2L1second = EvtLeptonACurrent(
lep2Minus->spParent( i2 ), lep1Plus->spParent( i1 ) );
VL4L3second = EvtLeptonVCurrent(
lep1Minus->spParent( i4 ), lep2Plus->spParent( i3 ) );
E1second = T1second.cont2( VL4L3second );
E2second = T2second.cont2( VL4L3second );
amp.vertex( leptonicspin,
CKM_factor * ( VL2L1 * E1 + AL2L1 * E2 +
VL2L1second * E1second +
AL2L1second * E2second ) );
// EvtGenReport(EVTGEN_ERROR,"EvtGen")
// << "\n\n ============================================================================"
// << "\n The matrix element (first + second) = "
// << CKM_factor*(VL2L1*E1+AL2L1*E2+VL2L1second*E1second+AL2L1second*E2second)
// << "\n The matrix element (only first) = "
// << CKM_factor*(VL2L1*E1+AL2L1*E2)
// << "============================================================================\n\n"
// << std::endl;
}
}
}
}
// EvtGenReport(EVTGEN_ERROR,"EvtGen") << "\n The function EvtbsToLLLLAmp::CalcAmp(...) passed with arguments:"
// << "\n ============================================================================"
// << "\n Input parameters:"
// << "\n mu = " << mu
// << "\n Nf =" << Nf
// << "\n res_swch = " << res_swch
// << "\n ias = " << ias
// << "\n CKM_A = " << CKM_A
// << "\n CKM_lambda = " << CKM_lambda
// << "\n CKM_barrho = " << CKM_barrho
// << "\n CKM_bareta = " << CKM_bareta
// << "\n CKM_factor = " << CKM_factor
// << "\n ============================================================================"
// << "\n Kinematics:"
// << "\n k_1 = " << k_1
// << "\n m_ell_1 =" << parent->getDaug(il1)->mass()
// << "\n k_2 = " << k_2
// << "\n m_ell_2 =" << parent->getDaug(il2)->mass()
// << "\n k_3 = " << k_3
// << "\n m_ell_3 =" << parent->getDaug(il3)->mass()
// << "\n k_4 = " << k_4
// << "\n m_ell_4 =" << parent->getDaug(il4)->mass()
// << "\n p = " << p
// << "\n q = " << q
// << "\n k = " << k
// << "\n ============================================================================"
// << "\n Form-factors"
// << "\n Fv = " << Fv
// << "\n Fa = " << Fa
// << "\n Ftv_b2q = " << Ftv_b2q
// << "\n Fta_b2q = " << Fta_b2q
// << "\n Ftv_barb2barq = " << Ftv_barb2barq
// << "\n Fta_barb2barq = " << Fta_barb2barq
// << "\n fb = " << fb
// << "\n ============================================================================"
// << "\n Wilson Coefficients:"
// << "\n Re(c7gam) = " << real(c7gam)
// << " Im(c7gam) = " << imag(c7gam)
// << "\n Re(c9eff_b2q) = " << real(c9eff_b2q)
// << " Im(c9eff_b2q) = " << imag(c9eff_b2q)
// << "\n Re(c9eff_barb2barq) = " << real(c9eff_barb2barq)
// << " Im(c9eff_barb2barq) = " << imag(c9eff_barb2barq)
// << "\n Re(c10a) = " << real(c10a)
// << " Im(c10a) = " << imag(c10a)
// << "\n ============================================================================"
// << "\n Functions in the matrix element:"
// << "\n a_b2q = " << a_b2q
// << "\n b_b2q = " << b_b2q
// << "\n c_b2q = " << c_b2q
// << "\n e_b2q = " << e_b2q
// << "\n f_b2q = " << f_b2q
// << "\n g_b2q = " << g_b2q
// << "\n ============================================================================"
// << "\n Partical Properties:"
// << "\n IdB = " << idparent << " == " << EvtPDL::getId(std::string("anti-B_s0"))
// << "\n IdMu1 = " << IdMu1 << " == " << EvtPDL::getId(std::string("mu+"))
// << "\n IdMu2 = " << IdMu2 << " == " << EvtPDL::getId(std::string("mu-"))
// << "\n IdMu3 = " << IdMu3 << " == " << EvtPDL::getId(std::string("mu+"))
// << "\n IdMu4 = " << IdMu4 << " == " << EvtPDL::getId(std::string("mu-"))
// << "\n\n\n\n"
// << std::endl;
} else {
if ( bbarmesons.contains( parentID ) ) {
// The amplitude for the decay B -> gamma ell^+ ell^- or
// q bar b -> gamma ell^+ ell^-
T1 = -a_barb2barq * unit1 *
dual( EvtGenFunctions::directProd( hatq, hatk ) ) -
b_barb2barq * uniti * EvtTensor4C::g() +
c_barb2barq * uniti * EvtGenFunctions::directProd( hatk, hatq );
T2 = -e_barb2barq * unit1 *
dual( EvtGenFunctions::directProd( hatq, hatk ) ) -
f_barb2barq * uniti * EvtTensor4C::g() +
g_barb2barq * uniti * EvtGenFunctions::directProd( hatk, hatq );
T1second = -a_barb2barqsecond * unit1 *
dual( EvtGenFunctions::directProd( hatqsecond,
hatksecond ) ) -
b_barb2barqsecond * uniti * EvtTensor4C::g() +
c_barb2barqsecond * uniti *
EvtGenFunctions::directProd( hatksecond, hatqsecond );
T2second = -e_barb2barqsecond * unit1 *
dual( EvtGenFunctions::directProd( hatpsecond,
hatksecond ) ) -
f_barb2barqsecond * uniti * EvtTensor4C::g() +
g_barb2barqsecond * uniti *
EvtGenFunctions::directProd( hatksecond, hatqsecond );
int i1, i2, i3, i4; // leptonic spin structures counters
int leptonicspin[4]; // array for the saving of the leptonic spin configuration
// Tables for correspondings
// l^+(k_1) && lep1Plus && k_1 && i1
// l^-(k_2) && lep1Minus && k_2 && i2
// l^+(k_3) && lep2Plus && k_3 && i3
// l^-(k_4) && lep2Minus && k_4 && i4
for ( i2 = 1; i2 > -1; i2-- ) {
leptonicspin[0] = i2;
for ( i1 = 1; i1 > -1; i1-- ) {
leptonicspin[1] = i1;
for ( i4 = 1; i4 > -1; i4-- ) {
leptonicspin[2] = i4;
for ( i3 = 1; i3 > -1; i3-- ) {
leptonicspin[3] = i3;
EvtVector4C VL2L1, AL2L1, VL4L3;
EvtVector4C E1, E2;
EvtVector4C VL2L1second, AL2L1second, VL4L3second;
EvtVector4C E1second, E2second;
VL2L1 = EvtLeptonVCurrent( lep1Minus->spParent( i2 ),
lep1Plus->spParent( i1 ) );
AL2L1 = EvtLeptonACurrent( lep1Minus->spParent( i2 ),
lep1Plus->spParent( i1 ) );
VL4L3 = EvtLeptonVCurrent( lep2Minus->spParent( i4 ),
lep2Plus->spParent( i3 ) );
E1 = T1.cont2( VL4L3 );
E2 = T2.cont2( VL4L3 );
VL2L1second =
EvtLeptonVCurrent( lep2Minus->spParent( i2 ),
lep1Plus->spParent( i1 ) );
AL2L1second =
EvtLeptonACurrent( lep2Minus->spParent( i2 ),
lep1Plus->spParent( i1 ) );
VL4L3second =
EvtLeptonVCurrent( lep1Minus->spParent( i4 ),
lep2Plus->spParent( i3 ) );
E1second = T1second.cont2( VL4L3second );
E2second = T2second.cont2( VL4L3second );
amp.vertex( leptonicspin,
conj( CKM_factor ) *
( VL2L1 * E1 + AL2L1 * E2 +
VL2L1second * E1second +
AL2L1second * E2second ) );
}
}
}
}
// EvtGenReport(EVTGEN_ERROR,"EvtGen") << "\n The function EvtbsToLLLLAmp::CalcAmp(...) passed with arguments:"
// << "\n ============================================================================"
// << "\n Input parameters:"
// << "\n mu = " << mu
// << "\n Nf =" << Nf
// << "\n res_swch = " << res_swch
// << "\n ias = " << ias
// << "\n CKM_A = " << CKM_A
// << "\n CKM_lambda = " << CKM_lambda
// << "\n CKM_barrho = " << CKM_barrho
// << "\n CKM_bareta = " << CKM_bareta
// << "\n CKM_factor = " << CKM_factor
// << "\n ============================================================================"
// << "\n Kinematics:"
// << "\n k_1 = " << k_1
// << "\n m_ell_1 =" << parent->getDaug(il1)->mass()
// << "\n k_2 = " << k_2
// << "\n m_ell_2 =" << parent->getDaug(il2)->mass()
// << "\n k_3 = " << k_3
// << "\n m_ell_3 =" << parent->getDaug(il3)->mass()
// << "\n k_4 = " << k_4
// << "\n m_ell_4 =" << parent->getDaug(il4)->mass()
// << "\n p = " << p
// << "\n q = " << q
// << "\n k = " << k
// << "\n ============================================================================"
// << "\n Form-factors"
// << "\n Fv = " << Fv
// << "\n Fa = " << Fa
// << "\n Ftv_b2q = " << Ftv_b2q
// << "\n Fta_b2q = " << Fta_b2q
// << "\n Ftv_barb2barq = " << Ftv_barb2barq
// << "\n Fta_barb2barq = " << Fta_barb2barq
// << "\n fb = " << fb
// << "\n ============================================================================"
// << "\n Wilson Coefficients:"
// << "\n Re(c7gam) = " << real(c7gam)
// << " Im(c7gam) = " << imag(c7gam)
// << "\n Re(c9eff_b2q) = " << real(c9eff_b2q)
// << " Im(c9eff_b2q) = " << imag(c9eff_b2q)
// << "\n Re(c9eff_barb2barq) = " << real(c9eff_barb2barq)
// << " Im(c9eff_barb2barq) = " << imag(c9eff_barb2barq)
// << "\n Re(c10a) = " << real(c10a)
// << " Im(c10a) = " << imag(c10a)
// << "\n ============================================================================"
// << "\n Functions in the matrix element:"
// << "\n a_barb2barq = " << a_barb2barq
// << "\n b_barb2barq = " << b_barb2barq
// << "\n c_barb2barq = " << c_barb2barq
// << "\n e_barb2barq = " << e_barb2barq
// << "\n f_barb2barq = " << f_barb2barq
// << "\n g_barb2barq = " << g_barb2barq
// << "\n ============================================================================"
// << "\n Partical Properties:"
// << "\n IdB = " << idparent << " == " << EvtPDL::getId(std::string("B_s0"))
// << "\n IdMu1 = " << IdMu1 << " == " << EvtPDL::getId(std::string("mu+"))
// << "\n IdMu2 = " << IdMu2 << " == " << EvtPDL::getId(std::string("mu-"))
// << "\n IdMu3 = " << IdMu3 << " == " << EvtPDL::getId(std::string("mu+"))
// << "\n IdMu4 = " << IdMu4 << " == " << EvtPDL::getId(std::string("mu-"))
// << "\n\n\n\n"
// << std::endl;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function EvtbsToLLLLAmp::CalcAmp(...)"
<< "\n Wrong Bq-meson number" << std::endl;
::abort();
}
}
}
//
// The decays Bq -> ell^+ ell^- ell^+ ell^- maximum probability calculation
//
double EvtbsToLLLLAmp::CalcMaxProb(
// EvtId parnum,
// EvtId l1num, EvtId l2num,
// EvtId l3num, EvtId l4num,
// Evtbs2llGammaFF *formFactors,
// EvtbTosllWilsCoeffNLO *WilsCoeff,
// double mu, int Nf,
// int res_swch, int ias,
// double CKM_A, double CKM_lambda,
// double CKM_barrho, double CKM_bareta
)
{
double maxfoundprob = 10.0; // maximum of the probability
return maxfoundprob;
}
// Triangular function
double EvtbsToLLLLAmp::lambda( double a, double b, double c )
{
double l;
l = pow( a, 2.0 ) + pow( b, 2.0 ) + pow( c, 2.0 ) - 2.0 * a * b -
2.0 * a * c - 2.0 * b * c;
return l;
}
diff --git a/src/EvtGenModels/EvtbsToLLLLHyperCPAmp.cpp b/src/EvtGenModels/EvtbsToLLLLHyperCPAmp.cpp
index 756b5ae..95977fd 100644
--- a/src/EvtGenModels/EvtbsToLLLLHyperCPAmp.cpp
+++ b/src/EvtGenModels/EvtbsToLLLLHyperCPAmp.cpp
@@ -1,605 +1,605 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
#include "EvtGenModels/EvtbsToLLLLHyperCPAmp.hh"
#include "EvtGenBase/EvtAmp.hh"
#include "EvtGenBase/EvtComplex.hh"
#include "EvtGenBase/EvtDiracSpinor.hh"
#include "EvtGenBase/EvtGenKine.hh"
#include "EvtGenBase/EvtId.hh"
#include "EvtGenBase/EvtIdSet.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtPatches.hh"
#include "EvtGenBase/EvtReport.hh"
#include "EvtGenBase/EvtScalarParticle.hh"
#include "EvtGenBase/EvtTensor4C.hh"
#include "EvtGenBase/EvtVector4C.hh"
#include <cstdlib>
// input: *parent - the pointer to the parent particle (B-meson, the
// object of the EvtParticle class);
// mS - the mass of the scalar sgoldstino "S" (GeV);
// mP - the mass of the pseudoscalar sgoldstino "P" (GeV);
// gammaS - the decay width of the scalar sgoldstino "S" (GeV);
// gammaP - the decay width of the pseudoscalar sgoldstino "P" (GeV);
// mLiiLR -
// Fc - coupling constant (GeV^2);
// mDijLL(RR) - parameters for \bar Bq-decays
// mDjiLL(RR) - parameters for Bq-decays (i <-> j!)
// d==1, s==2, b==3
//
void EvtbsToLLLLHyperCPAmp::CalcAmp( EvtParticle* parent, EvtAmp& amp,
double mS, double mP, double gammaS,
double gammaP, double mLiiLR, double Fc,
double mD23LL, double mD23RR, double mD32LL,
double mD32RR, double mD13LL, double mD13RR,
double mD31LL, double mD31RR )
{
// FILE *mytest;
int il1 = 0, il2 = 1, il3 = 2,
il4 = 3; // leptons are the first, second, thirds
// and fourth daughter particles
EvtComplex unit1( 1.0, 0.0 ); // real unit
EvtComplex uniti( 0.0, 1.0 ); // imaginary unit
parent->mass(); // B - meson mass, GeV
double fb = 0.0; // leptonic decay constant of B-meson, GeV
double Cl = 0.0; // LPL and LSL - vertexes
if ( Fc != 0.0 ) {
Cl = mLiiLR * mLiiLR / ( sqrt( 2 ) * Fc );
}
if ( Cl == 0.0 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function EvtbsToLLLLHyperCPAmp::CalcAmp(...)"
<< "\n Error in the Cl setting!"
<< "\n Cl = " << Cl << "\n mLiiLR = " << mLiiLR
<< "\n Fc = " << Fc << std::endl;
::abort();
}
EvtComplex MS = unit1 * mS -
uniti * gammaS /
2.0; // complex mass of the scalar sgoldstino
EvtComplex MP = unit1 * mP -
uniti * gammaP /
2.0; // complex mass of the pseudoscalar sgoldstino
//
// Setting of the different Bq-mesons tipes
//
EvtId idparent = parent->getId(); // Bq-meson Id
EvtId IdMu1, IdMu2, IdMu3, IdMu4;
double CB = 0.0;
if ( idparent == EvtPDL::getId( std::string( "B_s0" ) ) ) {
fb = 0.24; // leptonic decay constant
CB = mD32LL * mD32LL + mD32RR * mD32RR;
}
if ( idparent == EvtPDL::getId( std::string( "anti-B_s0" ) ) ) {
fb = 0.24; // leptonic decay constant
CB = mD23LL * mD23LL + mD23RR * mD23RR;
}
if ( idparent == EvtPDL::getId( std::string( "B0" ) ) ) {
fb = 0.20; // leptonic decay constant
CB = mD31LL * mD31LL + mD31RR * mD31RR;
}
if ( idparent == EvtPDL::getId( std::string( "anti-B0" ) ) ) {
fb = 0.20; // leptonic decay constant
CB = mD13LL * mD13LL + mD13RR * mD13RR;
}
if ( CB == 0.0 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function EvtbsToLLLLHyperCPAmp::CalcAmp(...)"
<< "\n Error in the CB setting!"
<< "\n CB = " << CB << "\n mD32LL = " << mD32LL
<< "\n mD32RR = " << mD32RR << "\n mD23LL = " << mD23LL
<< "\n mD23RR = " << mD23RR << "\n mD31LL = " << mD31LL
<< "\n mD31RR = " << mD31RR << "\n mD13LL = " << mD13LL
<< "\n mD13RR = " << mD13RR << "\n idparent = " << idparent
<< std::endl;
::abort();
}
//
// Setting the leptonic kinematical properties
//
// to find charges of ell^+ and ell^- in the B-meson daughters
int charge1 = ( EvtPDL::chg3( parent->getDaug( il1 )->getId() ) ) / 3;
int charge2 = ( EvtPDL::chg3( parent->getDaug( il2 )->getId() ) ) / 3;
int charge3 = ( EvtPDL::chg3( parent->getDaug( il3 )->getId() ) ) / 3;
int charge4 = ( EvtPDL::chg3( parent->getDaug( il4 )->getId() ) ) / 3;
if ( ( abs( charge1 ) != 1 ) || ( abs( charge2 ) != 1 ) ||
( abs( charge3 ) != 1 ) || ( abs( charge4 ) != 1 ) ||
( charge1 + charge2 + charge3 + charge4 != 0 ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function EvtbsToLLLLHyperCPAmp::CalcAmp(...)"
<< "\n Error in the leptonic charge definition!"
<< "\n charge1 =" << charge1
<< "\n charge2 =" << charge2
<< "\n charge3 =" << charge3
<< "\n charge4 =" << charge4
<< "\n number of daughters =" << parent->getNDaug() << std::endl;
::abort();
}
EvtParticle* lep1Plus = nullptr;
EvtParticle* lep1Minus = nullptr;
EvtParticle* lep2Plus = nullptr;
EvtParticle* lep2Minus = nullptr;
EvtVector4R p; // B-meson momentum in the B-rest frame
EvtVector4R q; // first transition 4-momentum in the B-rest frame
EvtVector4R k; // second transition 4-momentum in the B-rest frame
double q2; // Mandelstam variable s=q^2
double k2; // Mandelstam variable t=k^2
EvtVector4R qsecond; // first transition 4-momentum in the B-rest frame
EvtVector4R ksecond; // second transition 4-momentum in the B-rest frame
double q2second; // Mandelstam variable s=q^2
double k2second; // Mandelstam variable t=k^2
EvtVector4R k_1; // 4-momentum of ell^+ in the B-rest frame
EvtVector4R k_2; // 4-momentum of ell^- in the B-rest frame
EvtVector4R k_3; // 4-momentum of ell^+ in the B-rest frame
EvtVector4R k_4; // 4-momentum of ell^- in the B-rest frame
k_1.set( 0.0, 0.0, 0.0, 0.0 );
k_2.set( 0.0, 0.0, 0.0, 0.0 );
k_3.set( 0.0, 0.0, 0.0, 0.0 );
k_4.set( 0.0, 0.0, 0.0, 0.0 );
if ( ( charge1 + charge2 == 0 ) && ( charge3 + charge4 == 0 ) ) {
// positive charged lepton 1
lep1Plus = ( charge1 > charge2 ) ? parent->getDaug( il1 )
: parent->getDaug( il2 );
// negative charged lepton 1
lep1Minus = ( charge1 < charge2 ) ? parent->getDaug( il1 )
: parent->getDaug( il2 );
if ( charge1 > charge2 ) {
k_1 = parent->getDaug( il1 )->getP4();
k_2 = parent->getDaug( il2 )->getP4();
IdMu1 = parent->getDaug( il1 )->getId();
IdMu2 = parent->getDaug( il2 )->getId();
} else {
k_1 = parent->getDaug( il2 )->getP4();
k_2 = parent->getDaug( il1 )->getP4();
IdMu1 = parent->getDaug( il2 )->getId();
IdMu2 = parent->getDaug( il1 )->getId();
}
// positive charged lepton 2
lep2Plus = ( charge3 > charge4 ) ? parent->getDaug( il3 )
: parent->getDaug( il4 );
// negative charged lepton 2
lep2Minus = ( charge3 < charge4 ) ? parent->getDaug( il3 )
: parent->getDaug( il4 );
if ( charge3 > charge4 ) {
k_3 = parent->getDaug( il3 )->getP4();
k_4 = parent->getDaug( il4 )->getP4();
IdMu3 = parent->getDaug( il3 )->getId();
IdMu4 = parent->getDaug( il4 )->getId();
} else {
k_3 = parent->getDaug( il4 )->getP4();
k_4 = parent->getDaug( il3 )->getP4();
IdMu3 = parent->getDaug( il4 )->getId();
IdMu4 = parent->getDaug( il3 )->getId();
}
}
if ( ( charge1 + charge3 == 0 ) && ( charge2 + charge4 == 0 ) ) {
// positive charged lepton 1
lep1Plus = ( charge1 > charge3 ) ? parent->getDaug( il1 )
: parent->getDaug( il3 );
// negative charged lepton 1
lep1Minus = ( charge1 < charge3 ) ? parent->getDaug( il1 )
: parent->getDaug( il3 );
if ( charge1 > charge3 ) {
k_1 = parent->getDaug( il1 )->getP4();
k_2 = parent->getDaug( il3 )->getP4();
IdMu1 = parent->getDaug( il1 )->getId();
IdMu2 = parent->getDaug( il3 )->getId();
} else {
k_1 = parent->getDaug( il3 )->getP4();
k_2 = parent->getDaug( il1 )->getP4();
IdMu1 = parent->getDaug( il3 )->getId();
IdMu2 = parent->getDaug( il1 )->getId();
}
// positive charged lepton 2
lep2Plus = ( charge2 > charge4 ) ? parent->getDaug( il2 )
: parent->getDaug( il4 );
// negative charged lepton 2
lep2Minus = ( charge2 < charge4 ) ? parent->getDaug( il2 )
: parent->getDaug( il4 );
if ( charge2 > charge4 ) {
k_3 = parent->getDaug( il2 )->getP4();
k_4 = parent->getDaug( il4 )->getP4();
IdMu3 = parent->getDaug( il2 )->getId();
IdMu4 = parent->getDaug( il4 )->getId();
} else {
k_3 = parent->getDaug( il4 )->getP4();
k_4 = parent->getDaug( il2 )->getP4();
IdMu3 = parent->getDaug( il4 )->getId();
IdMu4 = parent->getDaug( il2 )->getId();
}
}
p = parent->getP4Restframe();
//
// The calculation of the FIRST part of the amplitude
//
q = k_1 + k_2;
k = k_3 + k_4;
q2 = q.mass2(); // Mandelstam variable s=q^2
k2 = k.mass2(); // Mandelstam variable t=k^2
//
// The calculation of the SECOND part of the amplitude
//
qsecond = k_1 + k_4;
ksecond = k_3 + k_2;
q2second = qsecond.mass2(); // Mandelstam variable s=q^2
k2second = ksecond.mass2(); // Mandelstam variable t=k^2
// B - and barB - mesons descriptors
- static EvtIdSet bmesons( "anti-B0", "anti-B_s0" );
- static EvtIdSet bbarmesons( "B0", "B_s0" );
+ static EvtIdSet bmesons{ "anti-B0", "anti-B_s0" };
+ static EvtIdSet bbarmesons{ "B0", "B_s0" };
EvtId parentID = parent->getId();
if ( bmesons.contains( parentID ) ) {
// The amplitude for the decay barB -> ell^+ ell^- ell^+ ell^- or
// b \bar q -> ell^+ ell^- ell^+ ell^-
int i1, i2, i3, i4; // leptonic spin structures counters
int leptonicspin[4]; // array for the saving of the leptonic spin configuration
// Tables for correspondings
// l^+(k_1) && lep1Plus && k_1 && i1
// l^-(k_2) && lep1Minus && k_2 && i2
// l^+(k_3) && lep2Plus && k_3 && i3
// l^-(k_4) && lep2Minus && k_4 && i4
for ( i2 = 0; i2 < 2; i2++ ) {
leptonicspin[0] = i2;
for ( i1 = 0; i1 < 2; i1++ ) {
leptonicspin[1] = i1;
for ( i4 = 0; i4 < 2; i4++ ) {
leptonicspin[2] = i4;
for ( i3 = 0; i3 < 2; i3++ ) {
leptonicspin[3] = i3;
EvtComplex SL2L1, PL4L3;
EvtComplex SL2L1second, PL4L3second;
SL2L1 = EvtLeptonSCurrent( lep1Minus->spParent( i2 ),
lep1Plus->spParent( i1 ) );
PL4L3 = EvtLeptonPCurrent( lep2Minus->spParent( i4 ),
lep2Plus->spParent( i3 ) );
SL2L1second = EvtLeptonSCurrent(
lep2Minus->spParent( i2 ), lep1Plus->spParent( i1 ) );
PL4L3second = EvtLeptonPCurrent(
lep1Minus->spParent( i4 ), lep2Plus->spParent( i3 ) );
amp.vertex(
leptonicspin,
Cl * Cl * CB * fb *
( SL2L1 * PL4L3 * ( q2 - k2 ) /
( ( q2 - MS * MS ) * ( k2 - MP * MP ) ) -
SL2L1second * PL4L3second *
( q2second - k2second ) /
( ( q2second - MS * MS ) *
( k2second - MP * MP ) ) ) /
( 4.0 * Fc * Fc ) );
}
}
}
}
// EvtGenReport(EVTGEN_ERROR,"EvtGen") << "\n The function EvtbsToLLLLHyperCPAmp::CalcAmp(...) passed with arguments:"
// << "\n ============================================================================"
// << "\n Input parameters:"
// << "\n mS = " << mS
// << "\n mP = " << mP
// << "\n gammaS = " << gammaS
// << "\n gammaP = " << gammaP
// << "\n mLiiLR = " << mLiiLR
// << "\n Fc = " << Fc
// << "\n mD23LL = " << mD23LL
// << "\n mD23RR = " << mD23RR
// << "\n mD32LL = " << mD32LL
// << "\n mD32RR = " << mD32RR
// << "\n mD13LL = " << mD13LL
// << "\n mD13RR = " << mD13RR
// << "\n mD31LL = " << mD31LL
// << "\n mD31RR = " << mD31RR
// << "\n ============================================================================"
// << "\n Kinematics:"
// << "\n k_1 = " << k_1
// << "\n m_ell_1 =" << parent->getDaug(il1)->mass()
// << "\n k_2 = " << k_2
// << "\n m_ell_2 =" << parent->getDaug(il2)->mass()
// << "\n k_3 = " << k_3
// << "\n m_ell_3 =" << parent->getDaug(il3)->mass()
// << "\n k_4 = " << k_4
// << "\n m_ell_4 =" << parent->getDaug(il4)->mass()
// << "\n p = " << p
// << "\n q = " << q
// << "\n k = " << k
// << "\n qsecond = " << qsecond
// << "\n ksecond = " << ksecond
// << "\n ============================================================================"
// << "\n Form-factors"
// << "\n fb = " << fb
// << "\n ============================================================================"
// << "\n Coefficients:"
// << "\n Cl = " << Cl
// << "\n CB = " << CB
// << "\n ============================================================================"
// << "\n Partical Properties:"
// << "\n IdB = " << idparent << " == " << EvtPDL::getId(std::string("anti-B_s0"))
// << "\n IdMu1 = " << IdMu1 << " == " << EvtPDL::getId(std::string("mu+"))
// << "\n IdMu2 = " << IdMu2 << " == " << EvtPDL::getId(std::string("mu-"))
// << "\n IdMu3 = " << IdMu3 << " == " << EvtPDL::getId(std::string("mu+"))
// << "\n IdMu4 = " << IdMu4 << " == " << EvtPDL::getId(std::string("mu-"))
// << "\n\n\n\n"
// << std::endl;
} else {
if ( bbarmesons.contains( parentID ) ) {
// The amplitude for the decay B -> ell^+ ell^- ell^+ ell^- or
// q bar b -> ell^+ ell^- ell^+ ell^-
int i1, i2, i3, i4; // leptonic spin structures counters
int leptonicspin[4]; // array for the saving of the leptonic spin configuration
// Tables for correspondings
// l^+(k_1) && lep1Plus && k_1 && i1
// l^-(k_2) && lep1Minus && k_2 && i2
// l^+(k_3) && lep2Plus && k_3 && i3
// l^-(k_4) && lep2Minus && k_4 && i4
for ( i2 = 1; i2 > -1; i2-- ) {
leptonicspin[0] = i2;
for ( i1 = 1; i1 > -1; i1-- ) {
leptonicspin[1] = i1;
for ( i4 = 1; i4 > -1; i4-- ) {
leptonicspin[2] = i4;
for ( i3 = 1; i3 > -1; i3-- ) {
leptonicspin[3] = i3;
EvtComplex SL2L1, PL4L3;
EvtComplex SL2L1second, PL4L3second;
SL2L1 = EvtLeptonSCurrent( lep1Minus->spParent( i2 ),
lep1Plus->spParent( i1 ) );
PL4L3 = EvtLeptonPCurrent( lep2Minus->spParent( i4 ),
lep2Plus->spParent( i3 ) );
SL2L1second =
EvtLeptonSCurrent( lep2Minus->spParent( i2 ),
lep1Plus->spParent( i1 ) );
PL4L3second =
EvtLeptonPCurrent( lep1Minus->spParent( i4 ),
lep2Plus->spParent( i3 ) );
amp.vertex( leptonicspin,
Cl * Cl * CB * fb *
( SL2L1 * PL4L3 * ( q2 - k2 ) /
( ( q2 - MS * MS ) *
( k2 - MP * MP ) ) -
SL2L1second * PL4L3second *
( q2second - k2second ) /
( ( q2second - MS * MS ) *
( k2second - MP * MP ) ) ) /
( 4.0 * Fc * Fc ) );
}
}
}
}
// EvtGenReport(EVTGEN_ERROR,"EvtGen") << "\n The function EvtbsToLLLLHyperCPAmp::CalcAmp(...) passed with arguments:"
// << "\n ============================================================================"
// << "\n Input parameters:"
// << "\n mS = " << mS
// << "\n mP = " << mP
// << "\n gammaS = " << gammaS
// << "\n gammaP = " << gammaP
// << "\n mLiiLR = " << mLiiLR
// << "\n Fc = " << Fc
// << "\n mD23LL = " << mD23LL
// << "\n mD23RR = " << mD23RR
// << "\n mD32LL = " << mD32LL
// << "\n mD32RR = " << mD32RR
// << "\n mD13LL = " << mD13LL
// << "\n mD13RR = " << mD13RR
// << "\n mD31LL = " << mD31LL
// << "\n mD31RR = " << mD31RR
// << "\n ============================================================================"
// << "\n Kinematics:"
// << "\n k_1 = " << k_1
// << "\n m_ell_1 =" << parent->getDaug(il1)->mass()
// << "\n k_2 = " << k_2
// << "\n m_ell_2 =" << parent->getDaug(il2)->mass()
// << "\n k_3 = " << k_3
// << "\n m_ell_3 =" << parent->getDaug(il3)->mass()
// << "\n k_4 = " << k_4
// << "\n m_ell_4 =" << parent->getDaug(il4)->mass()
// << "\n p = " << p
// << "\n q = " << q
// << "\n k = " << k
// << "\n qsecond = " << qsecond
// << "\n ksecond = " << ksecond
// << "\n ============================================================================"
// << "\n Form-factors"
// << "\n fb = " << fb
// << "\n ============================================================================"
// << "\n Coefficients:"
// << "\n Cl = " << Cl
// << "\n CB = " << CB
// << "\n ============================================================================"
// << "\n Partical Properties:"
// << "\n IdB = " << idparent << " == " << EvtPDL::getId(std::string("anti-B_s0"))
// << "\n IdMu1 = " << IdMu1 << " == " << EvtPDL::getId(std::string("mu+"))
// << "\n IdMu2 = " << IdMu2 << " == " << EvtPDL::getId(std::string("mu-"))
// << "\n IdMu3 = " << IdMu3 << " == " << EvtPDL::getId(std::string("mu+"))
// << "\n IdMu4 = " << IdMu4 << " == " << EvtPDL::getId(std::string("mu-"))
// << "\n\n\n\n"
// << std::endl;
} else {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function EvtbsToLLLLHyperCPAmp::CalcAmp(...)"
<< "\n Wrong Bq-meson number" << std::endl;
::abort();
}
}
}
//
// The decays Bq -> ell^+ ell^- ell^+ ell^- maximum probability calculation
//
double EvtbsToLLLLHyperCPAmp::CalcMaxProb(
EvtId parnum, EvtId l1num, EvtId /*l2num*/, EvtId /*l3num*/,
EvtId /*l4num*/, double mS, double mP, double gammaS, double gammaP,
double mLiiLR, double Fc, double mD23LL, double mD23RR, double mD32LL,
double mD32RR, double mD13LL, double mD13RR, double mD31LL, double mD31RR )
{
if ( Fc == 0.0 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function EvtbsToLLLLHyperCPAmp::CalcMaxProb"
<< "\n Error in the Fc setting!"
<< "\n Fc = " << Fc << "\n mD32LL = " << mD32LL
<< "\n mD32RR = " << mD32RR << "\n mD23LL = " << mD23LL
<< "\n mD23RR = " << mD23RR << "\n mD31LL = " << mD31LL
<< "\n mD31RR = " << mD31RR << "\n mD13LL = " << mD13LL
<< "\n mD13RR = " << mD13RR << "\n parnum = " << parnum
<< std::endl;
::abort();
}
double Cl = 0.0; // LPL and LSL - vertexes
if ( Fc != 0.0 ) {
Cl = mLiiLR * mLiiLR / ( sqrt( 2 ) * Fc );
}
if ( Cl == 0.0 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function EvtbsToLLLLHyperCPAmp::CalcMaxProb"
<< "\n Error in the Cl setting!"
<< "\n Cl = " << Cl << "\n mLiiLR = " << mLiiLR
<< "\n Fc = " << Fc << std::endl;
::abort();
}
//
// Setting of the different Bq-mesons tipes
//
double fb = 0.0;
double CB = 0.0;
if ( parnum == EvtPDL::getId( std::string( "B_s0" ) ) ) {
fb = 0.24; // leptonic decay constant
CB = mD32LL * mD32LL + mD32RR * mD32RR;
}
if ( parnum == EvtPDL::getId( std::string( "anti-B_s0" ) ) ) {
fb = 0.24; // leptonic decay constant
CB = mD23LL * mD23LL + mD23RR * mD23RR;
}
if ( parnum == EvtPDL::getId( std::string( "B0" ) ) ) {
fb = 0.20; // leptonic decay constant
CB = mD31LL * mD31LL + mD31RR * mD31RR;
}
if ( parnum == EvtPDL::getId( std::string( "anti-B0" ) ) ) {
fb = 0.20; // leptonic decay constant
CB = mD13LL * mD13LL + mD13RR * mD13RR;
}
if ( CB == 0.0 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n The function EvtbsToLLLLHyperCPAmp::CalcMaxProb"
<< "\n Error in the CB setting!"
<< "\n CB = " << CB << "\n mD32LL = " << mD32LL
<< "\n mD32RR = " << mD32RR << "\n mD23LL = " << mD23LL
<< "\n mD23RR = " << mD23RR << "\n mD31LL = " << mD31LL
<< "\n mD31RR = " << mD31RR << "\n mD13LL = " << mD13LL
<< "\n mD13RR = " << mD13RR << "\n parnum = " << parnum
<< std::endl;
::abort();
}
double M1 = EvtPDL::getMeanMass( parnum ); // B - meson mass
EvtPDL::getMeanMass( l1num ); // leptonic mass
// We find the maximum amplitude probability
double maxfoundprob = Cl * Cl * CB * fb *
fabs( mS * mS + mP * mP + M1 * M1 ) * 10000000.0 /
( 4.0 * Fc * Fc * mS * gammaS * mP * gammaP );
if ( maxfoundprob <= 0.0 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "\n\n In the function EvtbsToLLLLHyperCPAmp::CalcMaxProb"
<< "\n maxfoundprob = " << maxfoundprob << " < 0 or =0!"
<< "\n mS = " << mS << "\n mP = " << mP
<< "\n gammaS = " << gammaS << "\n gammaP = " << gammaP
<< "\n mLiiLR = " << mLiiLR << "\n Fc = " << Fc
<< "\n mD32LL = " << mD32LL << "\n mD32RR = " << mD32RR
<< "\n mD23LL = " << mD23LL << "\n mD23RR = " << mD23RR
<< "\n mD31LL = " << mD31LL << "\n mD31RR = " << mD31RR
<< "\n mD13LL = " << mD13LL << "\n mD13RR = " << mD13RR
<< "\n parnum = " << parnum << std::endl;
::abort();
}
EvtGenReport( EVTGEN_NOTICE, "EvtGen" )
<< "\n maxfoundprob (...) = " << maxfoundprob << std::endl;
maxfoundprob *= 1.01;
return maxfoundprob;
}
// Triangular function
double EvtbsToLLLLHyperCPAmp::lambda( double a, double b, double c )
{
double l;
l = pow( a, 2.0 ) + pow( b, 2.0 ) + pow( c, 2.0 ) - 2.0 * a * b -
2.0 * a * c - 2.0 * b * c;
return l;
}
diff --git a/test/evtgenlhc_test1.cc b/test/evtgenlhc_test1.cc
index 84885a0..dc6bbcb 100644
--- a/test/evtgenlhc_test1.cc
+++ b/test/evtgenlhc_test1.cc
@@ -1,5885 +1,5885 @@
/***********************************************************************
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
* *
* This file is part of EvtGen. *
* *
* EvtGen is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* EvtGen is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
//#@# Dalitz plot for D0 --> K- pi+ pi0 decay:
//#@# 1: Mass(K-, pi+)
//#@# 2: Mass(pi+,pi0)
//
// Description:
//
// This program invokes the EvtGen event generator package
// for testing various decay models that are implemented.
#include "EvtGen/EvtGen.hh"
#include "EvtGenBase/EvtAbsRadCorr.hh"
#include "EvtGenBase/EvtComplex.hh"
#include "EvtGenBase/EvtConst.hh"
#include "EvtGenBase/EvtDecayBase.hh"
#include "EvtGenBase/EvtDecayTable.hh"
#include "EvtGenBase/EvtDiracSpinor.hh"
#include "EvtGenBase/EvtGammaMatrix.hh"
#include "EvtGenBase/EvtIdSet.hh"
#include "EvtGenBase/EvtKine.hh"
#include "EvtGenBase/EvtMTRandomEngine.hh"
#include "EvtGenBase/EvtPDL.hh"
#include "EvtGenBase/EvtParser.hh"
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtParticleFactory.hh"
#include "EvtGenBase/EvtRadCorr.hh"
#include "EvtGenBase/EvtRandom.hh"
#include "EvtGenBase/EvtRandomEngine.hh"
#include "EvtGenBase/EvtReport.hh"
#include "EvtGenBase/EvtSecondary.hh"
#include "EvtGenBase/EvtSimpleRandomEngine.hh"
#include "EvtGenBase/EvtStdHep.hh"
#include "EvtGenBase/EvtTensor4C.hh"
#include "EvtGenBase/EvtVector4C.hh"
#include "EvtGenBase/EvtVector4R.hh"
#include "EvtGenBase/EvtVectorParticle.hh"
#ifdef EVTGEN_EXTERNAL
#include "EvtGenExternal/EvtExternalGenList.hh"
#endif
#include "TApplication.h"
#include "TFile.h"
#include "TH1.h"
#include "TH2.h"
#include "TROOT.h"
#include "TString.h"
#include "TTree.h"
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
using std::vector;
void runFile( int nevent, char* fname, EvtGen& myGenerator );
void runPrint( int nevent, char* fname, EvtGen& myGenerator );
void runFileVpho( int nevent, char* fname, EvtGen& myGenerator );
void runTest1( int nevent, EvtGen& myGenerator );
void runTest2( int nevent, EvtGen& myGenerator );
void runOmega( int nevent, EvtGen& myGenerator );
void runChi1Kstar( int nevent, EvtGen& myGenerator );
void runPi0Dalitz( int nevent, EvtGen& myGenerator );
void runMix( int nevent, EvtGen& myGenerator );
void runBMix( int nevent, EvtGen& myGenerator, std::string userFile,
std::string rootFile );
void runDDalitz( int nevent, EvtGen& myGenerator );
void runPiPiCPT( int nevent, EvtGen& myGenerator );
void runPiPiPiPi( int nevent, EvtGen& myGenerator );
void runD2Pi( int nevent, EvtGen& myGenerator );
void runJetsetTab3( int nevent, EvtGen& myGenerator );
void runHelAmp( int nevent, EvtGen& myGenerator, std::string userFile,
std::string rootFile );
void runHelAmp2( int nevent, EvtGen& myGenerator );
void runJpsiKs( int nevent, EvtGen& myGenerator );
void runDump( int nevent, EvtGen& myGenerator );
void runD1( int nevent, EvtGen& myGenerator );
void runGenericCont( int nevent, EvtGen& myGenerator );
void runPiPiPi( int nevent, EvtGen& myGenerator );
void runBHadronic( int nevent, EvtGen& myGenerator );
void runSingleB( int nevent, EvtGen& myGenerator );
void runA2Pi( int nevent, EvtGen& myGenerator );
void runAlias();
void runRepeat( int nevent );
void runPhotos( int nevent, EvtGen& myGenerator );
void runTrackMult( int nevent, EvtGen& myGenerator );
void runGeneric( int neventOrig, EvtGen& myGenerator, std::string listfile );
void runFinalStates( int nevent, EvtGen& myGenerator );
std::vector<std::string> findFinalState( EvtParticle* p );
void runKstarnunu( int nevent, EvtGen& myGenerator );
void runBsmix( int nevent, EvtGen& myGenerator );
void runTauTauPiPi( int nevent, EvtGen& myGenerator );
void runTauTauEE( int nevent, EvtGen& myGenerator );
void runTauTau2Pi2Pi( int nevent, EvtGen& myGenerator );
void runTauTau3Pi3Pi( int nevent, EvtGen& myGenerator );
void runJPsiKstar( int nevent, EvtGen& myGenerator, int modeInt );
void runSVVCPLH( int nevent, EvtGen& myGenerator );
void runSVSCPLH( int nevent, EvtGen& myGenerator );
void runSSDCP( int nevent, EvtGen& myGenerator );
void runKstarstargamma( int nevent, EvtGen& myGenerator );
void runDSTARPI( int nevent, EvtGen& myGenerator );
void runETACPHIPHI( int nevent, EvtGen& myGenerator );
void runVVPiPi( int nevent, EvtGen& myGenerator );
void runSVVHelAmp( int nevent, EvtGen& myGenerator );
void runSVVHelAmp2( int nevent, EvtGen& myGenerator );
void runPartWave( int nevent, EvtGen& myGenerator );
void runPartWave2( int nevent, EvtGen& myGenerator );
void runTwoBody( int nevent, EvtGen& myGenerator, std::string decfile,
std::string rootFile );
void runPiPi( int nevent, EvtGen& myGenerator );
void runA1Pi( int nevent, EvtGen& myGenerator );
void runCPTest( int nevent, EvtGen& myGenerator );
void runSemic( int nevent, EvtGen& myGenerator );
void runKstarll( int nevent, EvtGen& myGenerator );
void runKll( int nevent, EvtGen& myGenerator );
void runHll( int nevent, EvtGen& myGenerator, char* mode );
void runVectorIsr( int nevent, EvtGen& myGenerator );
void runBsquark( int nevent, EvtGen& myGenerator );
void runK3gamma( int nevent, EvtGen& myGenerator );
void runLambda( int nevent, EvtGen& myGenerator );
void runBtoXsgamma( int nevent, EvtGen& myGenerator );
void runBtoK1273gamma( int nevent, EvtGen& myGenerator );
void runCheckRotBoost();
void runMassCheck( int nevent, EvtGen& myGenerator, int partnum );
void runJpsiPolarization( int nevent, EvtGen& myGenerator );
void runDDK( int nevent, EvtGen& myGenerator );
void runPhspDecaytimeCut( int nevent, EvtGen& myGenerator );
int countInclusive( std::string name, EvtParticle* root, TH1F* mom = nullptr,
TH1F* mass = nullptr );
int countInclusiveParent( std::string name, EvtParticle* root, EvtIdSet setIds,
TH1F* mom = nullptr );
int countInclusiveSubTree( std::string name, EvtParticle* root, EvtIdSet setIds,
TH1F* mom = nullptr );
void runBaryonic( int nEvent, EvtGen& myGenerator );
void run3BPhspRegion( int nEvent, EvtGen& myGenerator );
void runFourBody( int nevent, EvtGen& myGenerator );
int main( int argc, char* argv[] )
{
// Define the random number generator
EvtRandomEngine* myRandomEngine = nullptr;
#ifdef EVTGEN_CPP11
// Use the Mersenne-Twister generator (C++11 only)
myRandomEngine = new EvtMTRandomEngine();
#else
myRandomEngine = new EvtSimpleRandomEngine();
#endif
if ( !TROOT::Initialized() ) {
static TROOT root( "RooTuple", "RooTuple ROOT in EvtGen" );
}
if ( argc == 1 ) {
EvtVector4R p( 0.0, 1.0, 0.0, 0.0 );
EvtVector4R k( 0.0, 0.0, 1.0, 0.0 );
EvtTensor4C T = dual( EvtGenFunctions::directProd( p, k ) );
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "p:" << p << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "k:" << k << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "T=dual(directProd(p,k)):" << T << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "T03:" << T.get( 0, 3 ) << std::endl;
return 1;
}
EvtAbsRadCorr* radCorrEngine = nullptr;
std::list<EvtDecayBase*> extraModels;
#ifdef EVTGEN_EXTERNAL
bool convertPythiaCodes( false );
bool useEvtGenRandom( true );
EvtExternalGenList genList( convertPythiaCodes, "", "gamma", useEvtGenRandom );
radCorrEngine = genList.getPhotosModel();
extraModels = genList.getListOfModels();
#endif
EvtGen myGenerator( "../DECAY.DEC", "../evt.pdl", myRandomEngine,
radCorrEngine, &extraModels );
if ( !strcmp( argv[1], "file" ) ) {
int nevent = atoi( argv[2] );
runFile( nevent, argv[3], myGenerator );
}
if ( !strcmp( argv[1], "print" ) ) {
int nevent = atoi( argv[2] );
runPrint( nevent, argv[3], myGenerator );
}
if ( !strcmp( argv[1], "filevpho" ) ) {
int nevent = atoi( argv[2] );
runFileVpho( nevent, argv[3], myGenerator );
}
if ( !strcmp( argv[1], "test1" ) ) {
int nevent = atoi( argv[2] );
runTest1( nevent, myGenerator );
}
if ( !strcmp( argv[1], "chi1kstar" ) ) {
int nevent = atoi( argv[2] );
runChi1Kstar( nevent, myGenerator );
}
if ( !strcmp( argv[1], "test2" ) ) {
int nevent = atoi( argv[2] );
runTest2( nevent, myGenerator );
}
if ( !strcmp( argv[1], "omega" ) ) {
int nevent = atoi( argv[2] );
runOmega( nevent, myGenerator );
}
if ( !strcmp( argv[1], "alias" ) ) {
runAlias();
}
if ( !strcmp( argv[1], "repeat" ) ) {
int nevent = atoi( argv[2] );
runRepeat( nevent );
}
if ( !strcmp( argv[1], "photos" ) ) {
int nevent = atoi( argv[2] );
runPhotos( nevent, myGenerator );
}
if ( !strcmp( argv[1], "trackmult" ) ) {
int nevent = atoi( argv[2] );
runTrackMult( nevent, myGenerator );
}
if ( !strcmp( argv[1], "generic" ) ) {
int nevent = atoi( argv[2] );
std::string listfile( "" );
if ( argc == 4 )
listfile = argv[3];
runGeneric( nevent, myGenerator, listfile );
}
if ( !strcmp( argv[1], "finalstates" ) ) {
int nevent = atoi( argv[2] );
runFinalStates( nevent, myGenerator );
}
if ( !strcmp( argv[1], "kstarnunu" ) ) {
int nevent = atoi( argv[2] );
runKstarnunu( nevent, myGenerator );
}
if ( !strcmp( argv[1], "bsmix" ) ) {
int nevent = atoi( argv[2] );
runBsmix( nevent, myGenerator );
}
if ( !strcmp( argv[1], "BtoXsgamma" ) ) {
int nevent = atoi( argv[2] );
runBtoXsgamma( nevent, myGenerator );
}
if ( !strcmp( argv[1], "BtoK1273gamma" ) ) {
int nevent = atoi( argv[2] );
runBtoK1273gamma( nevent, myGenerator );
}
if ( !strcmp( argv[1], "pi0dalitz" ) ) {
int nevent = atoi( argv[2] );
runPi0Dalitz( nevent, myGenerator );
}
if ( !strcmp( argv[1], "ddalitz" ) ) {
int nevent = atoi( argv[2] );
runDDalitz( nevent, myGenerator );
}
if ( !strcmp( argv[1], "kstarll" ) ) {
int nevent = atoi( argv[2] );
runKstarll( nevent, myGenerator );
}
if ( !strcmp( argv[1], "kll" ) ) {
int nevent = atoi( argv[2] );
runKll( nevent, myGenerator );
}
if ( !strcmp( argv[1], "hll" ) ) {
int nevent = atoi( argv[2] );
runHll( nevent, myGenerator, argv[3] );
}
if ( !strcmp( argv[1], "vectorisr" ) ) {
int nevent = atoi( argv[2] );
runVectorIsr( nevent, myGenerator );
}
if ( !strcmp( argv[1], "bsquark" ) ) {
int nevent = atoi( argv[2] );
runBsquark( nevent, myGenerator );
}
if ( !strcmp( argv[1], "k3gamma" ) ) {
int nevent = atoi( argv[2] );
runK3gamma( nevent, myGenerator );
}
if ( !strcmp( argv[1], "lambda" ) ) {
int nevent = atoi( argv[2] );
runLambda( nevent, myGenerator );
}
if ( !strcmp( argv[1], "tautaupipi" ) ) {
int nevent = atoi( argv[2] );
runTauTauPiPi( nevent, myGenerator );
}
if ( !strcmp( argv[1], "tautauee" ) ) {
int nevent = atoi( argv[2] );
runTauTauEE( nevent, myGenerator );
}
if ( !strcmp( argv[1], "tautau2pi2pi" ) ) {
int nevent = atoi( argv[2] );
runTauTau2Pi2Pi( nevent, myGenerator );
}
if ( !strcmp( argv[1], "tautau3pi3pi" ) ) {
int nevent = atoi( argv[2] );
runTauTau3Pi3Pi( nevent, myGenerator );
}
if ( !strcmp( argv[1], "jpsikstar" ) ) {
int nevent = atoi( argv[2] );
int modeInt = atoi( argv[3] );
runJPsiKstar( nevent, myGenerator, modeInt );
}
if ( !strcmp( argv[1], "svvcplh" ) ) {
int nevent = atoi( argv[2] );
runSVVCPLH( nevent, myGenerator );
}
if ( !strcmp( argv[1], "svscplh" ) ) {
int nevent = atoi( argv[2] );
runSVSCPLH( nevent, myGenerator );
}
if ( !strcmp( argv[1], "ssdcp" ) ) {
int nevent = atoi( argv[2] );
runSSDCP( nevent, myGenerator );
}
if ( !strcmp( argv[1], "kstarstargamma" ) ) {
int nevent = atoi( argv[2] );
runKstarstargamma( nevent, myGenerator );
}
if ( !strcmp( argv[1], "dstarpi" ) ) {
int nevent = atoi( argv[2] );
runDSTARPI( nevent, myGenerator );
}
if ( !strcmp( argv[1], "etacphiphi" ) ) {
int nevent = atoi( argv[2] );
runETACPHIPHI( nevent, myGenerator );
}
if ( !strcmp( argv[1], "vvpipi" ) ) {
int nevent = atoi( argv[2] );
runVVPiPi( nevent, myGenerator );
}
if ( !strcmp( argv[1], "svvhelamp" ) ) {
int nevent = atoi( argv[2] );
runSVVHelAmp( nevent, myGenerator );
}
if ( !strcmp( argv[1], "partwave" ) ) {
int nevent = atoi( argv[2] );
runPartWave( nevent, myGenerator );
}
if ( !strcmp( argv[1], "partwave2" ) ) {
int nevent = atoi( argv[2] );
runPartWave2( nevent, myGenerator );
}
if ( !strcmp( argv[1], "twobody" ) ) {
int nevent = atoi( argv[2] );
runTwoBody( nevent, myGenerator, argv[3], argv[4] );
}
if ( !strcmp( argv[1], "pipipi" ) ) {
int nevent = atoi( argv[2] );
runPiPiPi( nevent, myGenerator );
}
if ( !strcmp( argv[1], "bhadronic" ) ) {
int nevent = atoi( argv[2] );
runBHadronic( nevent, myGenerator );
}
if ( !strcmp( argv[1], "singleb" ) ) {
int nevent = atoi( argv[2] );
runSingleB( nevent, myGenerator );
}
if ( !strcmp( argv[1], "pipi" ) ) {
int nevent = atoi( argv[2] );
runPiPi( nevent, myGenerator );
}
if ( !strcmp( argv[1], "pipipipi" ) ) {
int nevent = atoi( argv[2] );
runPiPiPiPi( nevent, myGenerator );
}
if ( !strcmp( argv[1], "a2pi" ) ) {
int nevent = atoi( argv[2] );
runA2Pi( nevent, myGenerator );
}
if ( !strcmp( argv[1], "helamp" ) ) {
int nevent = atoi( argv[2] );
runHelAmp( nevent, myGenerator, argv[3], argv[4] );
}
if ( !strcmp( argv[1], "helamp2" ) ) {
int nevent = atoi( argv[2] );
runHelAmp2( nevent, myGenerator );
}
if ( !strcmp( argv[1], "d2pi" ) ) {
int nevent = atoi( argv[2] );
runD2Pi( nevent, myGenerator );
}
if ( !strcmp( argv[1], "a1pi" ) ) {
int nevent = atoi( argv[2] );
runA1Pi( nevent, myGenerator );
}
if ( !strcmp( argv[1], "cptest" ) ) {
int nevent = atoi( argv[2] );
runCPTest( nevent, myGenerator );
}
if ( !strcmp( argv[1], "pipicpt" ) ) {
int nevent = atoi( argv[2] );
runPiPiCPT( nevent, myGenerator );
}
if ( !strcmp( argv[1], "jpsiks" ) ) {
int nevent = atoi( argv[2] );
runJpsiKs( nevent, myGenerator );
}
if ( !strcmp( argv[1], "dump" ) ) {
int nevent = atoi( argv[2] );
runDump( nevent, myGenerator );
}
if ( !strcmp( argv[1], "genericcont" ) ) {
int nevent = atoi( argv[2] );
runGenericCont( nevent, myGenerator );
}
if ( !strcmp( argv[1], "d1" ) ) {
int nevent = atoi( argv[2] );
runD1( nevent, myGenerator );
}
if ( !strcmp( argv[1], "mix" ) ) {
int nevent = atoi( argv[2] );
runMix( nevent, myGenerator );
}
if ( !strcmp( argv[1], "bmix" ) ) {
int nevent = atoi( argv[2] );
runBMix( nevent, myGenerator, argv[3], argv[4] );
}
if ( !strcmp( argv[1], "semic" ) ) {
int nevent = atoi( argv[2] );
runSemic( nevent, myGenerator );
}
if ( !strcmp( argv[1], "ddk" ) ) {
int nevent = atoi( argv[2] );
runDDK( nevent, myGenerator );
}
if ( !strcmp( argv[1], "checkmass" ) ) {
int nevent = atoi( argv[2] );
int partnum = atoi( argv[3] );
runMassCheck( nevent, myGenerator, partnum );
}
if ( !strcmp( argv[1], "jpsipolarization" ) ) {
int nevent = atoi( argv[2] );
runJpsiPolarization( nevent, myGenerator );
}
if ( !strcmp( argv[1], "phspdecaytimecut" ) ) {
int nevent = atoi( argv[2] );
runPhspDecaytimeCut( nevent, myGenerator );
}
if ( !strcmp( argv[1], "3bodyPhsp" ) ) {
int nevent = atoi( argv[2] );
EvtRadCorr::setNeverRadCorr();
run3BPhspRegion( nevent, myGenerator );
}
if ( !strcmp( argv[1], "4bodyPhsp" ) ) {
int nevent = atoi( argv[2] );
EvtRadCorr::setNeverRadCorr();
runFourBody( nevent, myGenerator );
}
//*******************************************************
//test of the rotations and boosts performed in EvtGen.
// Added by Lange and Ryd Jan 5,2000.
//*******************************************************
if ( !strcmp( argv[1], "checkrotboost" ) ) {
runCheckRotBoost();
}
if ( !strcmp( argv[1], "baryonic" ) ) {
runBaryonic( atoi( argv[2] ), myGenerator );
}
delete myRandomEngine;
return 0;
}
void runFile( int nevent, char* fname, EvtGen& myGenerator )
{
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
int count;
char udecay_name[100];
strcpy( udecay_name, fname );
myGenerator.readUDecay( udecay_name );
count = 1;
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
root_part->deleteTree();
} while ( count++ < nevent );
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runPrint( int nevent, char* fname, EvtGen& myGenerator )
{
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
int count;
char udecay_name[100];
strcpy( udecay_name, fname );
myGenerator.readUDecay( udecay_name );
count = 1;
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
root_part->printTree();
root_part->deleteTree();
} while ( count++ < nevent );
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runFileVpho( int nevent, char* fname, EvtGen& myGenerator )
{
static EvtId VPHO = EvtPDL::getId( std::string( "vpho" ) );
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
int count;
char udecay_name[100];
strcpy( udecay_name, fname );
myGenerator.readUDecay( udecay_name );
count = 1;
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( VPHO,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
root_part->deleteTree();
} while ( count++ < nevent );
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
///////////////
void runJpsiPolarization( int nevent, EvtGen& myGenerator )
{
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
static EvtId JPSI = EvtPDL::getId( std::string( "J/psi" ) );
int count;
myGenerator.readUDecay( "exampleFiles/GENERIC.DEC" );
myGenerator.readUDecay( "exampleFiles/JPSITOLL.DEC" );
TFile* file = new TFile( "jpsipolar.root", "RECREATE" );
TH1F* coshel = new TH1F( "h1", "cos hel", 50, -1.0, 1.0 );
TH1F* coshelHigh = new TH1F( "h2", "cos hel pstar gt 1.1", 50, -1.0, 1.0 );
TH1F* coshelLow = new TH1F( "h3", "cos hel pstar lt 1.1", 50, -1.0, 1.0 );
count = 1;
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
EvtParticle* p = root_part;
do {
if ( p->getId() == JPSI ) {
EvtVector4R p4psi = p->getP4Lab();
EvtVector4R p4Daug = p->getDaug( 0 )->getP4Lab();
double dcostheta = EvtDecayAngle( p_init, p4psi, p4Daug );
coshel->Fill( dcostheta );
if ( p4psi.d3mag() > 1.1 ) {
coshelHigh->Fill( dcostheta );
} else {
coshelLow->Fill( dcostheta );
}
}
p = p->nextIter( root_part );
} while ( p != nullptr );
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runMassCheck( int nevent, EvtGen& /*myGenerator*/, int partnum )
{
int count;
static EvtId myPart = EvtPDL::evtIdFromStdHep( partnum );
TFile* file = new TFile( "checkmass.root", "RECREATE" );
TH1F* mass = new TH1F( "h1", "Mass", 500, 0.0, 2.5 );
count = 1;
do {
mass->Fill( EvtPDL::getMass( myPart ) );
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runPi0Dalitz( int nevent, EvtGen& myGenerator )
{
static EvtId PI0 = EvtPDL::getId( std::string( "pi0" ) );
TFile* file = new TFile( "pi0dalitz.root", "RECREATE" );
TH1F* q2 = new TH1F( "h1", "q2", 50, 0.0, 0.02 );
int count;
myGenerator.readUDecay( "exampleFiles/PI0DALITZ.DEC" );
count = 1;
do {
EvtVector4R p_init( EvtPDL::getMass( PI0 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( PI0,
p_init );
root_part->setDiagonalSpinDensity();
myGenerator.generateDecay( root_part );
EvtVector4R ep = root_part->getDaug( 0 )->getP4Lab();
EvtVector4R em = root_part->getDaug( 1 )->getP4Lab();
//EvtVector4R gamma=root_part->getDaug(2)->getP4Lab();
q2->Fill( ( ep + em ).mass2() );
// EvtGenReport(EVTGEN_INFO,"EvtGen") << ep << em << gamma <<std::endl;
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
//*******************************************************************************
void runTest1( int nevent, EvtGen& myGenerator )
{
// TFile *file=new TFile("test1.root", "RECREATE");
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
// int first=0;
// char **second;
// TApplication *theApp = new TApplication("App", &first, second);
TFile* file = new TFile( "test1.root", "RECREATE", "Example" );
TH1F* costhetaB = new TH1F( "hcosthetaB", "costhetaB", 50, -1.0, 1.0 );
TH1F* phiB = new TH1F( "hphiB", "phiB", 50, -EvtConst::pi, EvtConst::pi );
TH1F* Elep = new TH1F( "hEl", "E?l!", 50, 0.0, 2.5 );
TH1F* q2 = new TH1F( "hq2", "q^2!", 44, 0.0, 11.0 );
TH1F* ctv = new TH1F( "hctv", "ctv", 50, -1.0, 1.0 );
TH1F* chi_low_ctv = new TH1F( "hcostv1", "[h] for cos[Q]?V!\"L#0", 50, 0.0,
EvtConst::twoPi );
TH1F* chi_high_ctv = new TH1F( "hcostv2", "[h] for cos[Q]?V!\"G#0", 50, 0.0,
EvtConst::twoPi );
TH1F* dt = new TH1F( "hdt", "dt", 50, -5.0, 5.0 );
int count;
EvtVector4R p4b0, p4b0b, p4dstar, p4e, p4nu, p4d, p4pi, p4pip, p4pim;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/TEST1.DEC" );
// EvtGen myGenerator(decay_name,pdttable_name,myRandomEngine);
myGenerator.readUDecay( udecay_name );
double costhetaV;
count = 1;
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
p4b0 = root_part->getDaug( 0 )->getP4Lab();
p4b0b = root_part->getDaug( 1 )->getP4Lab();
p4dstar = root_part->getDaug( 0 )->getDaug( 0 )->getP4Lab();
p4e = root_part->getDaug( 0 )->getDaug( 1 )->getP4Lab();
p4nu = root_part->getDaug( 0 )->getDaug( 2 )->getP4Lab();
p4d = root_part->getDaug( 0 )->getDaug( 0 )->getDaug( 0 )->getP4Lab();
p4pi = root_part->getDaug( 0 )->getDaug( 0 )->getDaug( 1 )->getP4Lab();
p4pip = root_part->getDaug( 1 )->getDaug( 0 )->getP4Lab();
p4pim = root_part->getDaug( 1 )->getDaug( 1 )->getP4Lab();
costhetaB->Fill( p4b0.get( 3 ) / p4b0.d3mag() );
phiB->Fill( atan2( p4b0.get( 1 ), p4b0.get( 2 ) ) );
Elep->Fill( p4b0 * p4e / p4b0.mass() );
q2->Fill( ( p4e + p4nu ).mass2() );
dt->Fill( root_part->getDaug( 1 )->getLifetime() -
root_part->getDaug( 0 )->getLifetime() );
costhetaV = EvtDecayAngle( p4b0, p4d + p4pi, p4d );
ctv->Fill( costhetaV );
if ( costhetaV < 0.0 ) {
chi_low_ctv->Fill( EvtDecayAngleChi( p4b0, p4d, p4pi, p4e, p4nu ) );
} else {
chi_high_ctv->Fill( EvtDecayAngleChi( p4b0, p4d, p4pi, p4e, p4nu ) );
}
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
// delete theApp;
// hfile.write();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
//*******************************************************************************
void runDDK( int nevent, EvtGen& myGenerator )
{
// TFile *file=new TFile("test1.root", "RECREATE");
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
int count;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/GENERIC.DEC" );
myGenerator.readUDecay( udecay_name );
count = 1;
static EvtId kp = EvtPDL::getId( std::string( "K+" ) );
static EvtId km = EvtPDL::getId( std::string( "K-" ) );
static EvtId ks = EvtPDL::getId( std::string( "K_S0" ) );
static EvtId kl = EvtPDL::getId( std::string( "K_L0" ) );
static EvtId k0 = EvtPDL::getId( std::string( "K0" ) );
static EvtId kb = EvtPDL::getId( std::string( "anti-K0" ) );
static EvtId d0 = EvtPDL::getId( std::string( "D0" ) );
static EvtId dp = EvtPDL::getId( std::string( "D+" ) );
static EvtId dm = EvtPDL::getId( std::string( "D-" ) );
static EvtId db = EvtPDL::getId( std::string( "anti-D0" ) );
- static EvtIdSet theKs( kp, km, ks, kl, k0, kb );
- static EvtIdSet theDs( d0, dp, dm, db );
+ static EvtIdSet theKs{ kp, km, ks, kl, k0, kb };
+ static EvtIdSet theDs{ d0, dp, dm, db };
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
static EvtId B0B = EvtPDL::getId( std::string( "anti-B0" ) );
static EvtId BP = EvtPDL::getId( std::string( "B+" ) );
static EvtId BM = EvtPDL::getId( std::string( "B-" ) );
- static EvtIdSet theBs( B0B, B0, BP, BM );
+ static EvtIdSet theBs{ B0B, B0, BP, BM };
int nDDK = 0;
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
EvtParticle* theB01 = root_part->getDaug( 0 );
EvtParticle* theB02 = root_part->getDaug( 1 );
int nD = 0;
int nK = 0;
EvtParticle* p = theB01;
do {
EvtId type = p->getId();
EvtId typePar = p->getParent()->getId();
if ( theDs.contains( type ) )
nD++;
if ( theKs.contains( type ) && theBs.contains( typePar ) )
nK++;
p = p->nextIter( theB01 );
} while ( p != nullptr );
if ( nD == 2 && nK == 1 )
nDDK++;
nD = 0;
nK = 0;
p = theB02;
do {
EvtId type = p->getId();
EvtId typePar = p->getParent()->getId();
if ( theDs.contains( type ) )
nD++;
if ( theKs.contains( type ) && theBs.contains( typePar ) )
nK++;
p = p->nextIter( theB02 );
} while ( p != nullptr );
if ( nD == 2 && nK == 1 )
nDDK++;
root_part->deleteTree();
} while ( count++ < nevent );
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< nDDK << " " << ( count - 1 ) << " "
<< nDDK / float( 2 * ( count - 1 ) ) << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
//*******************************************************************************
void runTest2( int nevent, EvtGen& myGenerator )
{
TFile* file = new TFile( "test2.root", "RECREATE" );
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
TH1F* costhetaB = new TH1F( "h1", "cos[Q]?B!", 50, -1.0, 1.0 );
TH1F* phiB = new TH1F( "h2", "[f]?B!", 50, -EvtConst::pi, EvtConst::pi );
TH1F* dt = new TH1F( "h3", "[D]t", 100, -5.0, 5.0 );
TH1F* costhetaJpsi = new TH1F( "h4", "cos[Q]?J/[y]!", 50, -1.0, 1.0 );
TH1F* costhetaKstar = new TH1F( "h5", "cos[Q]?K*!", 50, -1.0, 1.0 );
TH1F* chi = new TH1F( "h6", "[h]", 50, 0.0, EvtConst::twoPi );
TH1F* chi1 = new TH1F( "h26", "[h] [D]t\"L#0", 50, 0.0, EvtConst::twoPi );
TH1F* chi2 = new TH1F( "h27", "[h] [D]t\"G#0", 50, 0.0, EvtConst::twoPi );
TH1F* costhetaomega = new TH1F( "h7", "costhetaomega", 50, -1.0, 1.0 );
TH1F* costhetaomega1 = new TH1F( "h20", "costhetaomega1", 50, -1.0, 1.0 );
TH1F* costhetaomega2 = new TH1F( "h21", "costhetaomega2", 50, -1.0, 1.0 );
TH1F* costhetaomega3 = new TH1F( "h22", "costhetaomega3", 50, -1.0, 1.0 );
TH1F* omegaamp = new TH1F( "h8", "omegaamp", 50, 0.0, 0.05 );
TH1F* omegaamp1 = new TH1F( "h9", "omegaamp1", 50, 0.0, 0.05 );
TH1F* omegaamp2 = new TH1F( "h10", "omegaamp2", 50, 0.0, 0.05 );
TH1F* omegaamp3 = new TH1F( "h11", "omegaamp3", 50, 0.0, 0.05 );
TH2F* chi1vscoskstarl = new TH2F( "h30", "[h] vs. cos[Q]?J/[y]! [D]t\"L#0",
20, 0.0, EvtConst::twoPi, 20, -1.0, 1.0 );
TH2F* chi1vscoskstarg = new TH2F( "h31", "[h] vs. cos[Q]?J/[y]! [D]t\"G#0",
20, 0.0, EvtConst::twoPi, 20, -1.0, 1.0 );
int count = 1;
EvtVector4R p4_b0, p4_b0b, p4_psi, p4_kstar, p4_mup, p4_mum;
EvtVector4R p4_kz, p4_pi0, p4_pi1, p4_pi2, p4_pi3, p4_omega;
EvtVector4R p4_pi1_omega, p4_pi2_omega, p4_pi3_omega;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/TEST2.DEC" );
//EvtGen myGenerator(decay_name,pdttable_name,myRandomEngine);
myGenerator.readUDecay( udecay_name );
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
p4_b0 = root_part->getDaug( 0 )->getP4Lab();
p4_b0b = root_part->getDaug( 1 )->getP4Lab();
p4_psi = root_part->getDaug( 1 )->getDaug( 0 )->getP4Lab();
p4_kstar = root_part->getDaug( 1 )->getDaug( 1 )->getP4Lab();
p4_mup = root_part->getDaug( 1 )->getDaug( 0 )->getDaug( 0 )->getP4Lab();
p4_mum = root_part->getDaug( 1 )->getDaug( 0 )->getDaug( 1 )->getP4Lab();
p4_kz = root_part->getDaug( 1 )->getDaug( 1 )->getDaug( 0 )->getP4Lab();
p4_pi0 = root_part->getDaug( 1 )->getDaug( 1 )->getDaug( 1 )->getP4Lab();
p4_omega = root_part->getDaug( 0 )->getDaug( 0 )->getP4Lab();
p4_pi1 = root_part->getDaug( 0 )->getDaug( 0 )->getDaug( 0 )->getP4Lab();
p4_pi2 = root_part->getDaug( 0 )->getDaug( 0 )->getDaug( 1 )->getP4Lab();
p4_pi3 = root_part->getDaug( 0 )->getDaug( 0 )->getDaug( 2 )->getP4Lab();
//get momentum in the omega restframe
p4_pi1_omega =
root_part->getDaug( 0 )->getDaug( 0 )->getDaug( 0 )->getP4();
p4_pi2_omega =
root_part->getDaug( 0 )->getDaug( 0 )->getDaug( 1 )->getP4();
p4_pi3_omega =
root_part->getDaug( 0 )->getDaug( 0 )->getDaug( 2 )->getP4();
EvtVector3R p3_perp =
cross( EvtVector3R( p4_pi2_omega.get( 0 ), p4_pi2_omega.get( 1 ),
p4_pi2_omega.get( 2 ) ),
EvtVector3R( p4_pi3_omega.get( 0 ), p4_pi3_omega.get( 1 ),
p4_pi3_omega.get( 2 ) ) );
EvtVector4R p4_perp( p3_perp.d3mag(), p3_perp.get( 0 ),
p3_perp.get( 1 ), p3_perp.get( 2 ) );
root_part->getDaug( 0 )->getDaug( 0 )->getDaug( 0 )->setP4( p4_perp );
p4_perp = root_part->getDaug( 0 )->getDaug( 0 )->getDaug( 0 )->getP4Lab();
EvtVector4R p4_perpprime = p4_omega - p4_perp;
double d_omegaamp = EvtVector3R( p4_pi1_omega.get( 0 ),
p4_pi1_omega.get( 1 ),
p4_pi1_omega.get( 2 ) ) *
p3_perp;
d_omegaamp *= d_omegaamp;
d_omegaamp *= 20.0;
double d_dt = root_part->getDaug( 1 )->getLifetime() -
root_part->getDaug( 0 )->getLifetime();
double d_costhetaJpsi = EvtDecayAngle( p4_b0b, p4_mup + p4_mum, p4_mup );
double d_costhetaKstar = EvtDecayAngle( p4_b0b, p4_pi0 + p4_kz, p4_pi0 );
double d_chi = EvtDecayAngleChi( p4_b0b, p4_pi0, p4_kz, p4_mup, p4_mum );
costhetaB->Fill( p4_b0.get( 3 ) / p4_b0.d3mag() );
phiB->Fill( atan2( p4_b0.get( 1 ), p4_b0.get( 2 ) ) );
dt->Fill( d_dt );
costhetaJpsi->Fill( d_costhetaJpsi );
costhetaKstar->Fill( d_costhetaKstar );
chi->Fill( d_chi );
if ( d_dt < 0.0 ) {
chi1->Fill( d_chi );
chi1vscoskstarl->Fill( d_chi, d_costhetaJpsi, 1.0 );
}
if ( d_dt > 0.0 ) {
chi2->Fill( d_chi );
chi1vscoskstarg->Fill( d_chi, d_costhetaJpsi, 1.0 );
}
double d_costhetaomega = EvtDecayAngle( p4_b0b, p4_perp + p4_perpprime,
p4_perp );
costhetaomega->Fill( d_costhetaomega );
if ( d_omegaamp < 0.001 )
costhetaomega1->Fill( d_costhetaomega );
if ( d_omegaamp > 0.02 )
costhetaomega2->Fill( d_costhetaomega );
if ( std::fabs( d_omegaamp - 0.015 ) < 0.005 )
costhetaomega3->Fill( d_costhetaomega );
omegaamp->Fill( d_omegaamp );
if ( d_costhetaomega < -0.5 )
omegaamp1->Fill( d_omegaamp );
if ( d_costhetaomega > 0.5 )
omegaamp2->Fill( d_omegaamp );
if ( std::fabs( d_costhetaomega ) < 0.5 )
omegaamp3->Fill( d_omegaamp );
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runOmega( int nevent, EvtGen& myGenerator )
{
TFile* file = new TFile( "omega.root", "RECREATE" );
static EvtId OMEGA = EvtPDL::getId( std::string( "omega" ) );
TH2F* dalitz = new TH2F( "h1", "E1 vs E2", 50, 0.0, 0.5, 50, 0.0, 0.5 );
int count = 1;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/OMEGA.DEC" );
myGenerator.readUDecay( udecay_name );
do {
EvtVector4R p_init( EvtPDL::getMeanMass( OMEGA ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( OMEGA,
p_init );
//root_part->setDiagonalSpinDensity();
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
dalitz->Fill( root_part->getDaug( 0 )->getP4().get( 0 ),
root_part->getDaug( 1 )->getP4().get( 0 ), 1.0 );
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runChi1Kstar( int nevent, EvtGen& myGenerator )
{
TFile* file = new TFile( "chi1kstar.root", "RECREATE" );
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
TH1F* costhetaChi1 = new TH1F( "h1", "cos[Q]?J/[x]!", 50, -1.0, 1.0 );
TH1F* costhetaKstar = new TH1F( "h2", "cos[Q]?K*!", 50, -1.0, 1.0 );
TH1F* chi = new TH1F( "h3", "[x]", 50, -EvtConst::pi, EvtConst::pi );
int count = 1;
EvtVector4R p4_b, p4_chi, p4_kstar, p4_gamma, p4_psi, p4_k, p4_p;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/CHI1KSTAR.DEC" );
myGenerator.readUDecay( udecay_name );
do {
EvtVector4R p_init( EvtPDL::getMass( B0 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( B0, p_init );
myGenerator.generateDecay( root_part );
p4_b = root_part->getP4Lab();
p4_chi = root_part->getDaug( 0 )->getP4Lab();
p4_kstar = root_part->getDaug( 1 )->getP4Lab();
p4_psi = root_part->getDaug( 0 )->getDaug( 0 )->getP4Lab();
p4_gamma = root_part->getDaug( 0 )->getDaug( 1 )->getP4Lab();
p4_k = root_part->getDaug( 1 )->getDaug( 0 )->getP4Lab();
p4_p = root_part->getDaug( 1 )->getDaug( 1 )->getP4Lab();
double d_costhetaChi1 = EvtDecayAngle( p4_b, p4_chi, p4_psi );
double d_costhetaKstar = EvtDecayAngle( p4_b, p4_kstar, p4_k );
double d_chi = EvtDecayAngleChi( p4_b, p4_k, p4_p, p4_psi, p4_gamma );
if ( d_chi > EvtConst::pi )
d_chi -= EvtConst::twoPi;
costhetaChi1->Fill( d_costhetaChi1 );
costhetaKstar->Fill( d_costhetaKstar );
chi->Fill( d_chi );
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runAlias()
{
EvtId idpip = EvtPDL::getId( std::string( "pi+" ) );
EvtPDL::alias( idpip, std::string( "my_pi+" ) );
EvtId myidpip = EvtPDL::getId( std::string( "my_pi+" ) );
EvtId idpim = EvtPDL::getId( std::string( "pi-" ) );
EvtPDL::alias( idpim, std::string( "my_pi-" ) );
EvtId myidpim = EvtPDL::getId( std::string( "my_pi-" ) );
EvtId idpi0 = EvtPDL::getId( std::string( "pi0" ) );
EvtPDL::alias( idpi0, std::string( "my_pi0" ) );
EvtId myidpi0 = EvtPDL::getId( std::string( "my_pi0" ) );
EvtPDL::aliasChgConj( myidpip, myidpim );
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "Id pi+:" << idpip << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "Id pi-:" << idpim << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "Id pi0:" << idpi0 << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "Id my_pi+:" << myidpip << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "Id my_pi-:" << myidpim << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "Id my_pi0:" << myidpi0 << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Chg conj pi+:" << EvtPDL::chargeConj( idpip ) << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Chg conj pi-:" << EvtPDL::chargeConj( idpim ) << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Chg conj pi0:" << EvtPDL::chargeConj( idpi0 ) << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Chg conj my_pi+:" << EvtPDL::chargeConj( myidpip ) << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Chg conj my_pi-:" << EvtPDL::chargeConj( myidpim ) << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Chg conj my_pi0:" << EvtPDL::chargeConj( myidpi0 ) << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runRepeat( int nevent )
{
int i;
for ( i = 0; i < nevent; i++ ) {
EvtDecayTable::getInstance()->readDecayFile(
std::string( "../DECAY.DEC" ) );
}
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runPhotos( int nevent, EvtGen& myGenerator )
{
static EvtId PSI = EvtPDL::getId( std::string( "J/psi" ) );
TFile* file = new TFile( "photos.root", "RECREATE" );
TH1F* mee = new TH1F( "h1", "mee", 60, 3.0, 3.12 );
int count = 1;
EvtVector4R e1, e2;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/PHOTOS.DEC" );
//EvtGen myGenerator(decay_name,pdttable_name,myRandomEngine);
myGenerator.readUDecay( udecay_name );
do {
EvtVector4R p_init( EvtPDL::getMass( PSI ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( PSI,
p_init );
root_part->setDiagonalSpinDensity();
myGenerator.generateDecay( root_part );
e1 = root_part->getDaug( 0 )->getP4Lab();
e2 = root_part->getDaug( 1 )->getP4Lab();
mee->Fill( ( e1 + e2 ).mass() );
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runFinalStates( int nevent, EvtGen& myGenerator )
{
//Parse the table of particles to find..
EvtParser parser;
parser.read( std::string( "exampleFiles/finalstates.list" ) );
std::vector<std::string> dList[20];
int dListNum[20];
std::vector<std::string>* dListItem = nullptr;
std::string dListName[20];
int ik, lk;
std::string tk = "";
int tline = -1;
std::string parent;
for ( ik = 0; ik < parser.getNToken(); ik++ ) {
lk = tline;
tline = parser.getLineofToken( ik );
tk = parser.getToken( ik );
if ( lk != tline && tline > 2 ) {
if ( tline > 1 ) {
dList[tline - 3] = *dListItem;
dListItem = new std::vector<std::string>;
dListNum[tline - 3] = 0;
dListName[tline - 2] = parser.getToken( ik );
}
} else {
if ( tline == 1 ) {
//This is the parent particle name
parent = parser.getToken( ik );
dListItem = new std::vector<std::string>;
} else {
//This is one of the daughters
if ( tline != 2 || ( lk == tline ) ) {
dListItem->push_back( parser.getToken( ik ) );
}
if ( tline == 2 && ( lk != tline ) ) {
dListName[tline - 2] = parser.getToken( ik );
}
}
}
}
dList[tline - 2] = *dListItem;
dListNum[tline - 2] = 0;
static EvtId parId = EvtPDL::getId( parent );
int count = 0;
do {
if ( count == 1000 * ( count / 1000 ) ) {
//if (count==1*(count/1)) {
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Event:" << count << std::endl;
//EvtGenReport(EVTGEN_INFO,"EvtGen") << HepRandom::getTheSeed()<<std::endl;
}
EvtVector4R p_init( EvtPDL::getMass( parId ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( parId,
p_init );
if ( parent == "Upsilon(4S)" ) {
root_part->setVectorSpinDensity();
} else {
root_part->setDiagonalSpinDensity();
}
myGenerator.generateDecay( root_part );
EvtParticle* p = root_part;
std::vector<std::string> fs = findFinalState( p );
int j;
for ( j = 0; j < ( tline - 1 ); j++ ) {
std::vector<std::string> temp = dList[j];
if ( temp.size() == fs.size() ) {
bool foundIt = true;
unsigned int k, l;
std::vector<bool> alreadyUsed( temp.size() );
for ( k = 0; k < temp.size(); k++ ) {
bool foundThisOne = false;
for ( l = 0; l < temp.size(); l++ ) {
if ( k == 0 )
alreadyUsed[l] = false;
if ( foundThisOne || alreadyUsed[l] )
continue;
if ( temp[k] == fs[l] ) {
alreadyUsed[l] = true;
foundThisOne = true;
// EvtGenReport(EVTGEN_INFO,"EvtGen") << "found daughter " << k << " " << l << std::endl;
}
}
if ( !foundThisOne )
foundIt = false;
}
if ( foundIt ) { //EvtGenReport(EVTGEN_INFO,"EvtGen") << "found a cand \n"; (histo1[j])->Fill(0.5);
//EvtGenReport(EVTGEN_INFO,"EvtGen") << "found one " << j << std::endl;
dListNum[j]++;
}
}
}
root_part->deleteTree();
count++;
} while ( count < nevent );
int j;
for ( j = 0; j < ( tline - 1 ); j++ )
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< dListName[j].c_str() << " " << j << " " << dListNum[j] << " "
<< count << " " << ( dListNum[j] / ( 1.0 * count ) ) << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
std::vector<std::string> findFinalState( EvtParticle* tree )
{
EvtParticle* p = tree;
std::vector<std::string> fs;
static EvtId ep = EvtPDL::getId( std::string( "e+" ) );
static EvtId em = EvtPDL::getId( std::string( "e-" ) );
static EvtId kp = EvtPDL::getId( std::string( "K+" ) );
static EvtId km = EvtPDL::getId( std::string( "K-" ) );
static EvtId mup = EvtPDL::getId( std::string( "mu+" ) );
static EvtId mum = EvtPDL::getId( std::string( "mu-" ) );
static EvtId pip = EvtPDL::getId( std::string( "pi+" ) );
static EvtId pim = EvtPDL::getId( std::string( "pi-" ) );
static EvtId pi0 = EvtPDL::getId( std::string( "pi0" ) );
static EvtId pr = EvtPDL::getId( std::string( "p+" ) );
static EvtId apr = EvtPDL::getId( std::string( "anti-p-" ) );
static EvtId ne = EvtPDL::getId( std::string( "n0" ) );
static EvtId ane = EvtPDL::getId( std::string( "anti-n0" ) );
do {
EvtId type = p->getId();
if ( type == ep )
fs.push_back( std::string( "e+" ) );
if ( type == em )
fs.push_back( std::string( "e-" ) );
if ( type == mup )
fs.push_back( std::string( "mu+" ) );
if ( type == mum )
fs.push_back( std::string( "mu-" ) );
if ( type == kp )
fs.push_back( std::string( "K+" ) );
if ( type == km )
fs.push_back( std::string( "K-" ) );
if ( type == pip )
fs.push_back( std::string( "pi+" ) );
if ( type == pim )
fs.push_back( std::string( "pi-" ) );
if ( type == pi0 )
fs.push_back( std::string( "pi0" ) );
if ( type == pr )
fs.push_back( std::string( "p+" ) );
if ( type == apr )
fs.push_back( std::string( "anti-p-" ) );
if ( type == ne )
fs.push_back( std::string( "n0" ) );
if ( type == ane )
fs.push_back( std::string( "anti-n0" ) );
p = p->nextIter();
} while ( p != nullptr );
return fs;
}
void runTrackMult( int nevent, EvtGen& myGenerator )
{
TFile* file = new TFile( "trackmult.root", "RECREATE" );
TH1F* trackAll = new TH1F( "trackAll", "trackAll", 12, 1.0, 25.0 );
TH1F* trackNoSL = new TH1F( "trackNoSL", "trackNoSL", 12, 1.0, 25.0 );
TH1F* track1SL = new TH1F( "track1SL", "track1SL", 12, 1.0, 25.0 );
TH1F* track2SL = new TH1F( "track2SL", "track2SL", 12, 1.0, 25.0 );
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
static EvtId B0B = EvtPDL::getId( std::string( "anti-B0" ) );
static EvtId BP = EvtPDL::getId( std::string( "B+" ) );
static EvtId BM = EvtPDL::getId( std::string( "B-" ) );
//look for these tracks in generic events
static EvtId ep = EvtPDL::getId( std::string( "e+" ) );
static EvtId em = EvtPDL::getId( std::string( "e-" ) );
static EvtId mup = EvtPDL::getId( std::string( "mu+" ) );
static EvtId mum = EvtPDL::getId( std::string( "mu-" ) );
static EvtId pip = EvtPDL::getId( std::string( "pi+" ) );
static EvtId pim = EvtPDL::getId( std::string( "pi-" ) );
static EvtId kp = EvtPDL::getId( std::string( "K+" ) );
static EvtId km = EvtPDL::getId( std::string( "K-" ) );
static EvtId pp = EvtPDL::getId( std::string( "p+" ) );
static EvtId pm = EvtPDL::getId( std::string( "anti-p-" ) );
- static EvtIdSet theTracks( ep, em, mup, mum, pip, pim, kp, km, pp, pm );
- static EvtIdSet theLeptons( ep, em, mup, mum );
- static EvtIdSet theBs( B0, B0B, BP, BM );
+ static EvtIdSet theTracks{ ep, em, mup, mum, pip, pim, kp, km, pp, pm };
+ static EvtIdSet theLeptons{ ep, em, mup, mum };
+ static EvtIdSet theBs{ B0, B0B, BP, BM };
int count = 1;
EvtParticle* p;
myGenerator.readUDecay( "exampleFiles/GENERIC.DEC" );
int totTracks = 0;
int totTracksNoSL = 0;
int totTracks1SL = 0;
int totTracks2SL = 0;
int totNoSL = 0;
int tot1SL = 0;
int tot2SL = 0;
do {
int evTracks = 0;
if ( count == 1000 * ( count / 1000 ) ) {
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << count << std::endl;
//EvtGenReport(EVTGEN_INFO,"EvtGen") << HepRandom::getTheSeed()<<std::endl;
}
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
p = root_part;
int howManySL = 0;
do {
if ( theTracks.contains( p->getId() ) ) {
totTracks += 1;
evTracks += 1;
}
if ( theLeptons.contains( p->getId() ) ) {
if ( p->getParent() ) {
if ( theBs.contains( p->getParent()->getId() ) )
howManySL += 1;
}
}
p = p->nextIter( root_part );
} while ( p != nullptr );
//Now need to figure out which histogram to book
trackAll->Fill( evTracks );
if ( howManySL == 0 ) {
trackNoSL->Fill( evTracks );
totNoSL += 1;
totTracksNoSL += evTracks;
}
if ( howManySL == 1 ) {
track1SL->Fill( evTracks );
tot1SL += 1;
totTracks1SL += evTracks;
}
if ( howManySL == 2 ) {
track2SL->Fill( evTracks );
tot2SL += 1;
totTracks2SL += evTracks;
}
root_part->deleteTree();
} while ( count++ < nevent );
double aveMulti = float( totTracks ) / float( nevent );
double aveMultiNoSL = float( totTracksNoSL ) / float( totNoSL );
double aveMulti1SL = float( totTracks1SL ) / float( tot1SL );
double aveMulti2SL = float( totTracks2SL ) / float( tot2SL );
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Your average multiplicity=" << aveMulti << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Your average multiplicity for no B->semileptonic events="
<< aveMultiNoSL << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Your average multiplicity for 1 B->semileptonic events="
<< aveMulti1SL << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Your average multiplicity for 2 B->semileptonic events="
<< aveMulti2SL << std::endl;
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runGeneric( int neventOrig, EvtGen& myGenerator, std::string listfile )
{
int nevent = abs( neventOrig );
//Parse the table of particles to find..
TFile* file = new TFile( "generic.root", "RECREATE" );
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
static EvtId VPHO = EvtPDL::getId( std::string( "vpho" ) );
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
static EvtId B0B = EvtPDL::getId( std::string( "anti-B0" ) );
static EvtId BP = EvtPDL::getId( std::string( "B+" ) );
static EvtId BM = EvtPDL::getId( std::string( "B-" ) );
- static EvtIdSet theBs( B0B, B0, BP, BM );
- static EvtIdSet theB0B( B0B );
- static EvtIdSet theB0( B0 );
- static EvtIdSet theBP( BP );
- static EvtIdSet theBM( BM );
+ static EvtIdSet theBs{ B0B, B0, BP, BM };
+ static EvtIdSet theB0B{ B0B };
+ static EvtIdSet theB0{ B0 };
+ static EvtIdSet theBP{ BP };
+ static EvtIdSet theBM{ BM };
static EvtId D0 = EvtPDL::getId( std::string( "D0" ) );
static EvtId D0B = EvtPDL::getId( std::string( "anti-D0" ) );
static EvtId DP = EvtPDL::getId( std::string( "D+" ) );
static EvtId DM = EvtPDL::getId( std::string( "D-" ) );
- static EvtIdSet theDs( D0B, D0, DP, DM );
- static EvtIdSet theD0B( D0B );
- static EvtIdSet theD0( D0 );
- static EvtIdSet theDP( DP );
- static EvtIdSet theDM( DM );
+ static EvtIdSet theDs{ D0B, D0, DP, DM };
+ static EvtIdSet theD0B{ D0B };
+ static EvtIdSet theD0{ D0 };
+ static EvtIdSet theDP{ DP };
+ static EvtIdSet theDM{ DM };
int count;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/GENERIC.DEC" );
myGenerator.readUDecay( udecay_name );
if ( listfile != "" ) {
EvtParser parser;
if ( parser.read( listfile ) != 0 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate." << std::endl;
exit( -1 );
}
std::vector<TH1F*> histo1( parser.getNToken() );
std::vector<TH1F*> histo2( parser.getNToken() );
std::vector<TH1F*> massHisto( parser.getNToken() );
int ik;
std::string tk, tkname;
for ( ik = 0; ik < ( parser.getNToken() / 2 ); ik++ ) {
tk = parser.getToken( 2 * ik );
tkname = parser.getToken( 1 + 2 * ik );
histo1[ik] = new TH1F( tkname.c_str(), tkname.c_str(), 30, 0.0, 3.0 );
char* directName;
directName = new char[( strlen( tkname.c_str() ) + 8 )];
directName = strcpy( directName, tkname.c_str() );
directName = strcat( directName, "Direct" );
histo2[ik] = new TH1F( directName, directName, 30, 0.0, 3.0 );
- delete directName;
+ delete[] directName;
char* massName;
massName = new char[( strlen( tkname.c_str() ) + 4 )];
massName = strcpy( massName, tkname.c_str() );
massName = strcat( massName, "Mass" );
massHisto[ik] = new TH1F( massName, massName, 3000, 0.0, 5.0 );
- delete massName;
+ delete[] massName;
}
count = 1;
std::vector<int> temp( parser.getNToken() / 2, 0 );
std::vector<int> tempB( parser.getNToken() / 2, 0 );
std::vector<int> tempB0B( parser.getNToken() / 2, 0 );
std::vector<int> tempB0( parser.getNToken() / 2, 0 );
std::vector<int> tempBP( parser.getNToken() / 2, 0 );
std::vector<int> tempBM( parser.getNToken() / 2, 0 );
std::vector<int> tempD( parser.getNToken() / 2, 0 );
std::vector<int> tempD0B( parser.getNToken() / 2, 0 );
std::vector<int> tempD0( parser.getNToken() / 2, 0 );
std::vector<int> tempDP( parser.getNToken() / 2, 0 );
std::vector<int> tempDM( parser.getNToken() / 2, 0 );
do {
//EvtGenReport(EVTGEN_INFO,"EvtGen") << "new event\n";
if ( count == 1000 * ( count / 1000 ) ) {
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << count << std::endl;
//EvtGenReport(EVTGEN_INFO,"EvtGen") << HepRandom::getTheSeed()<<std::endl;
}
EvtVector4R p_init( sqrt( EvtPDL::getMass( UPS4 ) *
EvtPDL::getMass( UPS4 ) +
5.9 * 5.9 ),
0.0, 0.0, 5.9 );
EvtParticle* root_part = nullptr;
if ( neventOrig > 0 ) {
root_part = EvtParticleFactory::particleFactory( UPS4, p_init );
} else {
root_part = EvtParticleFactory::particleFactory( VPHO, p_init );
}
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
//EvtStdHep stdhep;
//stdhep.init();
//root_part->makeStdHep(stdhep);
//EvtGenReport(EVTGEN_INFO,"EvtGen") <<stdhep<<std::endl;
//EvtGenReport(EVTGEN_INFO,"EvtGen") <<secondary<<std::endl;
std::string token;
int itok;
for ( itok = 0; itok < ( parser.getNToken() / 2 ); itok++ ) {
token = parser.getToken( 2 * itok );
//temp[itok]+=countInclusive(token,root_part);
temp[itok] += countInclusive( token, root_part, histo1[itok],
massHisto[itok] );
tempB[itok] += countInclusiveParent( token, root_part, theBs,
histo2[itok] );
tempB0[itok] += countInclusiveSubTree( token, root_part, theB0 );
tempB0B[itok] += countInclusiveSubTree( token, root_part, theB0B );
tempBP[itok] += countInclusiveSubTree( token, root_part, theBP );
tempBM[itok] += countInclusiveSubTree( token, root_part, theBM );
// tempD[itok]+=countInclusiveParent(token,root_part,theDs);
// tempD0[itok]+=countInclusiveSubTree(token,root_part,theD0);
// tempD0B[itok]+=countInclusiveSubTree(token,root_part,theD0B);
// tempDP[itok]+=countInclusiveSubTree(token,root_part,theDP);
// tempDM[itok]+=countInclusiveSubTree(token,root_part,theDM);
}
// numd0+=countInclusive("D0",root_part);
// numd0b+=countInclusive("anti-D0",root_part);
// numdp+=countInclusive("D+",root_part);
// numdm+=countInclusive("D-",root_part);
// root_part->printTree();
root_part->deleteTree();
} while ( count++ < nevent );
int itok;
std::string token;
for ( itok = 0; itok < ( parser.getNToken() / 2 ); itok++ ) {
token = parser.getToken( 2 * itok );
float br = 0.5 * float( temp[itok] ) / float( nevent );
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Found " << temp[itok] << " " << token.c_str() << " in "
<< nevent << " events. Average number of " << token.c_str()
<< " per B meson=" << br << std::endl;
br = 0.5 * float( tempB[itok] ) / float( nevent );
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Found " << tempB[itok] << " " << token.c_str()
<< " produced directly in decays of B mesons avg. br.fr.=" << br
<< std::endl;
br = 2.0 * float( tempB0[itok] ) / float( nevent );
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Found " << tempB0[itok] << " " << token.c_str()
<< " in decay tree of B0, br.fr.=" << br << std::endl;
br = 2.0 * float( tempB0B[itok] ) / float( nevent );
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Found " << tempB0B[itok] << " " << token.c_str()
<< " in decay tree of anti-B0, br.fr.=" << br << std::endl;
br = 2.0 * float( tempBP[itok] ) / float( nevent );
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Found " << tempBP[itok] << " " << token.c_str()
<< " in decay tree of B+, br.fr.=" << br << std::endl;
br = 2.0 * float( tempBM[itok] ) / float( nevent );
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Found " << tempBM[itok] << " " << token.c_str()
<< " in decay tree of B-, br.fr.=" << br << std::endl;
// br=0.5*float(tempD[itok])/float(numd0+numd0b+numdm+numdp);
// EvtGenReport(EVTGEN_INFO,"EvtGen") << "Found "<<tempD[itok]<<" "<<token
// << " produced directly in decays of D mesons avg. br.fr.="
// <<br<<std::endl;
// br=2.0*float(tempD0[itok])/float(numd0);
// EvtGenReport(EVTGEN_INFO,"EvtGen") << "Found "<<tempD0[itok]<<" "<<token
// << " in decay of D0, br.fr.="<<br<<std::endl;
// br=2.0*float(tempD0B[itok])/float(numd0b);
// EvtGenReport(EVTGEN_INFO,"EvtGen") << "Found "<<tempD0B[itok]<<" "<<token
// << " in decay of anti-D0, br.fr.="<<br<<std::endl;
// br=2.0*float(tempDP[itok])/float(numdp);
// EvtGenReport(EVTGEN_INFO,"EvtGen") << "Found "<<tempDP[itok]<<" "<<token
// << " in decay of D+, br.fr.="<<br<<std::endl;
// br=2.0*float(tempDM[itok])/float(numdm);
// EvtGenReport(EVTGEN_INFO,"EvtGen") << "Found "<<tempDM[itok]<<" "<<token
// << " in decay of D-, br.fr.="<<br<<std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "*******************************************\n";
}
} else {
count = 1;
do {
if ( count == 1000 * ( count / 1000 ) ) {
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << count << std::endl;
//EvtGenReport(EVTGEN_INFO,"EvtGen") << HepRandom::getTheSeed()<<std::endl;
}
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = nullptr;
if ( neventOrig > 0 ) {
root_part = EvtParticleFactory::particleFactory( UPS4, p_init );
} else {
root_part = EvtParticleFactory::particleFactory( VPHO, p_init );
}
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
root_part->deleteTree();
} while ( count++ < nevent );
}
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runKstarnunu( int nevent, EvtGen& myGenerator )
{
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
//static EvtId B0B=EvtPDL::getId(std::string("anti-B0"));
TFile* file = new TFile( "kstarnunu.root", "RECREATE" );
TH1F* q2 = new TH1F( "h1", "q2", 50, 0.0, 25.0 );
TH1F* enu = new TH1F( "h2", "Neutrino energy", 50, 0.0, 5.0 );
TH1F* x = new TH1F( "h3", "Total neutrino energy/B mass", 50, 0.5, 0.9 );
int count;
EvtVector4R kstar, nu, nub;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/KSTARNUNU.DEC" );
//EvtGen myGenerator(decay_name,pdttable_name,myRandomEngine);
myGenerator.readUDecay( udecay_name );
count = 1;
do {
EvtVector4R p_init( EvtPDL::getMass( B0 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( B0, p_init );
root_part->setDiagonalSpinDensity();
myGenerator.generateDecay( root_part );
kstar = root_part->getDaug( 0 )->getP4Lab();
nu = root_part->getDaug( 1 )->getP4Lab();
nub = root_part->getDaug( 2 )->getP4Lab();
q2->Fill( ( nu + nub ).mass2() );
enu->Fill( nu.get( 0 ) );
x->Fill( ( nu.get( 0 ) + nub.get( 0 ) ) / root_part->mass() );
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runBsmix( int nevent, EvtGen& myGenerator )
{
static EvtId BS0 = EvtPDL::getId( std::string( "B_s0" ) );
static EvtId BSB = EvtPDL::getId( std::string( "anti-B_s0" ) );
TFile* file = new TFile( "bsmix.root", "RECREATE" );
TH1F* tmix = new TH1F( "h1", "tmix (mm)", 100, 0.0, 5.0 );
TH1F* tnomix = new TH1F( "h2", "tnomix (mm)", 100, 0.0, 5.0 );
int count;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/BSMIX.DEC" );
//EvtGen myGenerator(decay_name,pdttable_name,myRandomEngine);
myGenerator.readUDecay( udecay_name );
count = 1;
do {
EvtVector4R p_init( EvtPDL::getMass( BS0 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( BS0,
p_init );
root_part->setDiagonalSpinDensity();
myGenerator.generateDecay( root_part );
double t = root_part->getLifetime();
int mix = 0;
if ( root_part->getNDaug() == 1 ) {
if ( root_part->getDaug( 0 )->getId() == BSB ) {
mix = 1;
}
}
if ( mix == 0 )
tnomix->Fill( t );
if ( mix == 1 )
tmix->Fill( t );
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runSemic( int nevent, EvtGen& myGenerator )
{
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
static EvtId EP = EvtPDL::getId( std::string( "e+" ) );
static EvtId EM = EvtPDL::getId( std::string( "e-" ) );
static EvtId DST0 = EvtPDL::getId( std::string( "D*0" ) );
static EvtId DSTB = EvtPDL::getId( std::string( "anti-D*0" ) );
static EvtId DSTP = EvtPDL::getId( std::string( "D*+" ) );
static EvtId DSTM = EvtPDL::getId( std::string( "D*-" ) );
static EvtId D0 = EvtPDL::getId( std::string( "D0" ) );
static EvtId D0B = EvtPDL::getId( std::string( "anti-D0" ) );
static EvtId DP = EvtPDL::getId( std::string( "D+" ) );
static EvtId DM = EvtPDL::getId( std::string( "D-" ) );
static EvtId D1P1P = EvtPDL::getId( std::string( "D_1+" ) );
static EvtId D1P1N = EvtPDL::getId( std::string( "D_1-" ) );
static EvtId D1P10 = EvtPDL::getId( std::string( "D_10" ) );
static EvtId D1P1B = EvtPDL::getId( std::string( "anti-D_10" ) );
static EvtId D3P2P = EvtPDL::getId( std::string( "D_2*+" ) );
static EvtId D3P2N = EvtPDL::getId( std::string( "D_2*-" ) );
static EvtId D3P20 = EvtPDL::getId( std::string( "D_2*0" ) );
static EvtId D3P2B = EvtPDL::getId( std::string( "anti-D_2*0" ) );
static EvtId D3P1P = EvtPDL::getId( std::string( "D'_1+" ) );
static EvtId D3P1N = EvtPDL::getId( std::string( "D'_1-" ) );
static EvtId D3P10 = EvtPDL::getId( std::string( "D'_10" ) );
static EvtId D3P1B = EvtPDL::getId( std::string( "anti-D'_10" ) );
static EvtId D3P0P = EvtPDL::getId( std::string( "D_0*+" ) );
static EvtId D3P0N = EvtPDL::getId( std::string( "D_0*-" ) );
static EvtId D3P00 = EvtPDL::getId( std::string( "D_0*0" ) );
static EvtId D3P0B = EvtPDL::getId( std::string( "anti-D_0*0" ) );
static EvtId D23S1P = EvtPDL::getId( std::string( "D*(2S)+" ) );
static EvtId D23S1N = EvtPDL::getId( std::string( "D*(2S)-" ) );
static EvtId D23S10 = EvtPDL::getId( std::string( "D*(2S)0" ) );
static EvtId D23S1B = EvtPDL::getId( std::string( "anti-D*(2S)0" ) );
- static EvtIdSet radExitDstar( D23S1P, D23S1N, D23S10, D23S1B );
+ static EvtIdSet radExitDstar{ D23S1P, D23S1N, D23S10, D23S1B };
TFile* file = new TFile( "semic.root", "RECREATE" );
TH1F* Dpe_q2 = new TH1F( "h11", "q2 for B0B ->D+ e- nu", 50, 0.0, 12.0 );
TH1F* Dpe_elep = new TH1F( "h12", "Elep for B0B ->D+ e- nu", 50, 0.0, 2.5 );
TH1F* Dme_q2 = new TH1F( "h13", "q2 for B0 ->D- e+ nu", 50, 0.0, 12.0 );
TH1F* Dme_elep = new TH1F( "h14", "Elep for B0 ->D- e+ nu", 50, 0.0, 2.5 );
TH1F* D0e_q2 = new TH1F( "h15", "q2 for B- ->D0 e- nu", 50, 0.0, 12.0 );
TH1F* D0e_elep = new TH1F( "h16", "Elep for B- ->D0 e- nu", 50, 0.0, 2.5 );
TH1F* D0Be_q2 = new TH1F( "h17", "q2 for B+ ->D0B e+ nu", 50, 0.0, 12.0 );
TH1F* D0Be_elep = new TH1F( "h18", "Elep for B+ ->D0B e+ nu", 50, 0.0, 2.5 );
TH1F* Dstpe_q2 = new TH1F( "h21", "q2 for B0B ->D*+ e- nu", 50, 0.0, 12.0 );
TH1F* Dstpe_elep = new TH1F( "h22", "Elep for B0B ->D*+ e- nu", 50, 0.0, 2.5 );
TH1F* Dstme_q2 = new TH1F( "h23", "q2 for B0 ->D*- e+ nu", 50, 0.0, 12.0 );
TH1F* Dstme_elep = new TH1F( "h24", "Elep for B0 ->D*- e+ nu", 50, 0.0, 2.5 );
TH1F* Dst0e_q2 = new TH1F( "h25", "q2 for B- ->D*0 e- nu", 50, 0.0, 12.0 );
TH1F* Dst0e_elep = new TH1F( "h26", "Elep for B*- ->D*0 e- nu", 50, 0.0, 2.5 );
TH1F* Dst0Be_q2 = new TH1F( "h27", "q2 for B+ ->D*0B e+ nu", 50, 0.0, 12.0 );
TH1F* Dst0Be_elep = new TH1F( "h28", "Elep for B+ ->D*0B e+ nu", 50, 0.0,
2.5 );
TH1F* D1P1pe_q2 = new TH1F( "h31", "q2 for B0B ->1P1+ e- nu", 50, 0.0, 12.0 );
TH1F* D1P1pe_elep = new TH1F( "h32", "Elep for B0B ->1P1+ e- nu", 50, 0.0,
2.5 );
TH1F* D1P1me_q2 = new TH1F( "h33", "q2 for B0 ->1P1- e+ nu", 50, 0.0, 12.0 );
TH1F* D1P1me_elep = new TH1F( "h34", "Elep for B0 ->1P1- e+ nu", 50, 0.0,
2.5 );
TH1F* D1P10e_q2 = new TH1F( "h35", "q2 for B- ->1P10 e- nu", 50, 0.0, 12.0 );
TH1F* D1P10e_elep = new TH1F( "h36", "Elep for B*- ->1P10 e- nu", 50, 0.0,
2.5 );
TH1F* D1P10Be_q2 = new TH1F( "h37", "q2 for B+ ->1P1B e+ nu", 50, 0.0, 12.0 );
TH1F* D1P10Be_elep = new TH1F( "h38", "Elep for B+ ->1P1B e+ nu", 50, 0.0,
2.5 );
TH1F* D3P0pe_q2 = new TH1F( "h41", "q2 for B0B ->3P0+ e- nu", 50, 0.0, 12.0 );
TH1F* D3P0pe_elep = new TH1F( "h42", "Elep for B0B ->3P0+ e- nu", 50, 0.0,
2.5 );
TH1F* D3P0me_q2 = new TH1F( "h43", "q2 for B0 ->3P0- e+ nu", 50, 0.0, 12.0 );
TH1F* D3P0me_elep = new TH1F( "h44", "Elep for B0 ->3P0- e+ nu", 50, 0.0,
2.5 );
TH1F* D3P00e_q2 = new TH1F( "h45", "q2 for B- ->3P00 e- nu", 50, 0.0, 12.0 );
TH1F* D3P00e_elep = new TH1F( "h46", "Elep for B*- ->3P00 e- nu", 50, 0.0,
2.5 );
TH1F* D3P00Be_q2 = new TH1F( "h47", "q2 for B+ ->3P0B e+ nu", 50, 0.0, 12.0 );
TH1F* D3P00Be_elep = new TH1F( "h48", "Elep for B+ ->3P0B e+ nu", 50, 0.0,
2.5 );
TH1F* D3P1pe_q2 = new TH1F( "h51", "q2 for B0B ->3P1+ e- nu", 50, 0.0, 12.0 );
TH1F* D3P1pe_elep = new TH1F( "h52", "Elep for B0B ->3P1+ e- nu", 50, 0.0,
2.5 );
TH1F* D3P1me_q2 = new TH1F( "h53", "q2 for B0 ->3P1- e+ nu", 50, 0.0, 12.0 );
TH1F* D3P1me_elep = new TH1F( "h54", "Elep for B0 ->3P1- e+ nu", 50, 0.0,
2.5 );
TH1F* D3P10e_q2 = new TH1F( "h55", "q2 for B- ->3P10 e- nu", 50, 0.0, 12.0 );
TH1F* D3P10e_elep = new TH1F( "h56", "Elep for B*- ->3P10 e- nu", 50, 0.0,
2.5 );
TH1F* D3P10Be_q2 = new TH1F( "h57", "q2 for B+ ->3P1B e+ nu", 50, 0.0, 12.0 );
TH1F* D3P10Be_elep = new TH1F( "h58", "Elep for B+ ->3P1B e+ nu", 50, 0.0,
2.5 );
TH1F* D3P2pe_q2 = new TH1F( "h61", "q2 for B0B ->3P2+ e- nu", 50, 0.0, 12.0 );
TH1F* D3P2pe_elep = new TH1F( "h62", "Elep for B0B ->3P2+ e- nu", 50, 0.0,
2.5 );
TH1F* D3P2me_q2 = new TH1F( "h63", "q2 for B0 ->3P2- e+ nu", 50, 0.0, 12.0 );
TH1F* D3P2me_elep = new TH1F( "h64", "Elep for B0 ->3P2- e+ nu", 50, 0.0,
2.5 );
TH1F* D3P20e_q2 = new TH1F( "h65", "q2 for B- ->3P20 e- nu", 50, 0.0, 12.0 );
TH1F* D3P20e_elep = new TH1F( "h66", "Elep for B*- ->3P20 e- nu", 50, 0.0,
2.5 );
TH1F* D3P20Be_q2 = new TH1F( "h67", "q2 for B+ ->3P2B e+ nu", 50, 0.0, 12.0 );
TH1F* D3P20Be_elep = new TH1F( "h68", "Elep for B+ ->3P2B e+ nu", 50, 0.0,
2.5 );
TH1F* phiL = new TH1F( "h69", "phi", 50, -3.1416, 3.1416 );
int count;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/SEMIC.DEC" );
//EvtGen myGenerator(decay_name,pdttable_name,myRandomEngine);
myGenerator.readUDecay( udecay_name );
count = 1;
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
int i;
for ( i = 0; i < 2; i++ ) {
EvtId meson = root_part->getDaug( i )->getDaug( 0 )->getId();
EvtId lepton = root_part->getDaug( i )->getDaug( 1 )->getId();
EvtVector4R lep = root_part->getDaug( i )->getDaug( 1 )->getP4Lab();
phiL->Fill( atan2( lep.get( 1 ), lep.get( 2 ) ) );
EvtVector4R nu = root_part->getDaug( i )->getDaug( 2 )->getP4Lab();
double q2 = ( lep + nu ).mass2();
double elep = root_part->getDaug( i )->getDaug( 1 )->getP4().get( 0 );
if ( meson == DP && lepton == EM ) {
Dpe_q2->Fill( q2 );
Dpe_elep->Fill( elep );
}
if ( meson == DM && lepton == EP ) {
Dme_q2->Fill( q2 );
Dme_elep->Fill( elep );
}
if ( meson == D0 && lepton == EM ) {
D0e_q2->Fill( q2 );
D0e_elep->Fill( elep );
}
if ( meson == D0B && lepton == EP ) {
D0Be_q2->Fill( q2 );
D0Be_elep->Fill( elep );
}
if ( meson == DSTP && lepton == EM ) {
Dstpe_q2->Fill( q2 );
Dstpe_elep->Fill( elep );
}
if ( meson == DSTM && lepton == EP ) {
Dstme_q2->Fill( q2 );
Dstme_elep->Fill( elep );
}
if ( meson == DST0 && lepton == EM ) {
Dst0e_q2->Fill( q2 );
Dst0e_elep->Fill( elep );
}
if ( meson == DSTB && lepton == EP ) {
Dst0Be_q2->Fill( q2 );
Dst0Be_elep->Fill( elep );
}
if ( meson == D1P1P && lepton == EM ) {
D1P1pe_q2->Fill( q2 );
D1P1pe_elep->Fill( elep );
}
if ( meson == D1P1N && lepton == EP ) {
D1P1me_q2->Fill( q2 );
D1P1me_elep->Fill( elep );
}
if ( meson == D1P10 && lepton == EM ) {
D1P10e_q2->Fill( q2 );
D1P10e_elep->Fill( elep );
}
if ( meson == D1P1B && lepton == EP ) {
D1P10Be_q2->Fill( q2 );
D1P10Be_elep->Fill( elep );
}
if ( meson == D3P0P && lepton == EM ) {
D3P0pe_q2->Fill( q2 );
D3P0pe_elep->Fill( elep );
}
if ( meson == D3P0N && lepton == EP ) {
D3P0me_q2->Fill( q2 );
D3P0me_elep->Fill( elep );
}
if ( meson == D3P00 && lepton == EM ) {
D3P00e_q2->Fill( q2 );
D3P00e_elep->Fill( elep );
}
if ( meson == D3P0B && lepton == EP ) {
D3P00Be_q2->Fill( q2 );
D3P00Be_elep->Fill( elep );
}
if ( meson == D3P1P && lepton == EM ) {
D3P1pe_q2->Fill( q2 );
D3P1pe_elep->Fill( elep );
}
if ( meson == D3P1N && lepton == EP ) {
D3P1me_q2->Fill( q2 );
D3P1me_elep->Fill( elep );
}
if ( meson == D3P10 && lepton == EM ) {
D3P10e_q2->Fill( q2 );
D3P10e_elep->Fill( elep );
}
if ( meson == D3P1B && lepton == EP ) {
D3P10Be_q2->Fill( q2 );
D3P10Be_elep->Fill( elep );
}
if ( meson == D3P2P && lepton == EM ) {
D3P2pe_q2->Fill( q2 );
D3P2pe_elep->Fill( elep );
}
if ( meson == D3P2N && lepton == EP ) {
D3P2me_q2->Fill( q2 );
D3P2me_elep->Fill( elep );
}
if ( meson == D3P20 && lepton == EM ) {
D3P20e_q2->Fill( q2 );
D3P20e_elep->Fill( elep );
}
if ( meson == D3P2B && lepton == EP ) {
D3P20Be_q2->Fill( q2 );
D3P20Be_elep->Fill( elep );
}
}
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runKstarll( int nevent, EvtGen& myGenerator )
{
TFile* file = new TFile( "kstkmm.root", "RECREATE" );
TH2F* _dalitz = new TH2F( "h1", "q^2! vs Elep", 70, 0.0, 3.5, 60, 0.0, 30.0 );
TH1F* _ctl = new TH1F( "h2", "ctl", 50, -1.0, 1.0 );
TH1F* _q2 = new TH1F( "h3", "q2", 50, 0.0, 25.0 );
TH1F* _q2low = new TH1F( "h4", "q2 (low)", 50, 0.0, 1.0 );
TH1F* _q2lowlow = new TH1F( "h5", "q2 (lowlow)", 50, 0.0, 0.00001 );
TH1F* _phi = new TH1F( "h6", "phi", 50, -EvtConst::pi, EvtConst::pi );
TH1F* _chi = new TH1F( "h7", "chi", 50, 0.0, EvtConst::twoPi );
TH1F* _chictl = new TH1F( "h8", "chictl", 50, 0.0, EvtConst::twoPi );
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
int count = 1;
EvtVector4R kstar, l1, l2;
EvtVector4R k, pi, b;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/KSTARLL.DEC" );
//EvtGen myGenerator(decay_name,pdttable_name,myRandomEngine);
myGenerator.readUDecay( udecay_name );
std::vector<double> q2low( 5 );
std::vector<double> q2high( 5 );
std::vector<int> counts( 5 );
//kee
//int n=4;
//q2low[0]=0.0; q2high[0]=4.5;
//q2low[1]=4.5; q2high[1]=8.41;
//q2low[2]=10.24; q2high[2]=12.96;
//q2low[3]=14.06; q2high[3]=30.0;
//kmm
//int n=4;
//q2low[0]=0.0; q2high[0]=4.5;
//q2low[1]=4.5; q2high[1]=9.0;
//q2low[2]=10.24; q2high[2]=12.96;
//q2low[3]=14.06; q2high[3]=30.0;
//K*ee
int n = 5;
q2low[0] = 0.0;
q2high[0] = 0.1;
q2low[1] = 0.1;
q2high[1] = 4.5;
q2low[2] = 4.5;
q2high[2] = 8.41;
q2low[3] = 10.24;
q2high[3] = 12.96;
q2low[4] = 14.06;
q2high[4] = 30.0;
//K*mm
//int n=5;
//q2low[0]=0.0; q2high[0]=0.1;
//q2low[1]=0.1; q2high[1]=4.5;
//q2low[2]=4.5; q2high[2]=9.0;
//q2low[3]=10.24; q2high[3]=12.96;
//q2low[4]=14.06; q2high[4]=30.0;
do {
EvtVector4R p_init( EvtPDL::getMass( B0 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( B0, p_init );
root_part->setDiagonalSpinDensity();
myGenerator.generateDecay( root_part );
// root_part->printTree();
//root_part->getDaug(0)->printTree();
//root_part->getDaug(1)->printTree();
//root_part->getDaug(2)->printTree();
kstar = root_part->getDaug( 0 )->getP4Lab();
l1 = root_part->getDaug( 1 )->getP4Lab();
l2 = root_part->getDaug( 2 )->getP4Lab();
b = root_part->getP4();
k = root_part->getDaug( 0 )->getDaug( 0 )->getP4Lab();
pi = root_part->getDaug( 0 )->getDaug( 1 )->getP4Lab();
double qsq = ( l1 + l2 ).mass2();
for ( int j = 0; j < n; j++ ) {
if ( qsq > q2low[j] && qsq < q2high[j] )
counts[j]++;
}
_q2->Fill( ( l1 + l2 ).mass2() );
_q2low->Fill( ( l1 + l2 ).mass2() );
_q2lowlow->Fill( ( l1 + l2 ).mass2() );
_ctl->Fill( EvtDecayAngle( ( l1 + l2 + kstar ), ( l1 + l2 ), l1 ) );
_dalitz->Fill( l1.get( 0 ), ( l1 + l2 ).mass2(), 1.0 );
root_part->deleteTree();
_phi->Fill( atan2( l1.get( 1 ), l1.get( 2 ) ) );
_chi->Fill( EvtDecayAngleChi( b, k, pi, l1, l2 ) );
if ( EvtDecayAngle( ( l1 + l2 + kstar ), ( l1 + l2 ), l1 ) > 0 ) {
_chictl->Fill( EvtDecayAngleChi( b, k, pi, l1, l2 ) );
}
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "count:" << count << " " << ( l1 + l2 ).mass2() << std::endl;
} while ( count++ < nevent );
for ( int j = 0; j < n; j++ ) {
std::cout << "[" << q2low[j] << ".." << q2high[j] << "]=" << counts[j]
<< std::endl;
}
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runKll( int nevent, EvtGen& myGenerator )
{
TFile* file = new TFile( "ksem.root", "RECREATE" );
TH2F* _dalitz = new TH2F( "h1", "q^2! vs Elep", 70, 0.0, 3.5, 60, 0.0, 30.0 );
TH1F* _ctl = new TH1F( "h2", "ctl", 50, -1.0, 1.0 );
TH1F* _q2 = new TH1F( "h3", "q2", 50, 0.0, 25.0 );
TH1F* _q2low = new TH1F( "h4", "q2 (low)", 50, 0.0, 1.0 );
TH1F* _q2lowlow = new TH1F( "h5", "q2 (lowlow)", 50, 0.0, 0.00001 );
TH1F* _phi = new TH1F( "h6", "phi", 50, -EvtConst::pi, EvtConst::pi );
// TH1F* _chi = new TH1F("h7","chi",50,0.0,EvtConst::twoPi);
// TH1F* _chictl = new TH1F("h8","chictl",50,0.0,EvtConst::twoPi);
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
int count = 1;
EvtVector4R k, l1, l2;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/KLL.DEC" );
//EvtGen myGenerator(decay_name,pdttable_name,myRandomEngine);
myGenerator.readUDecay( udecay_name );
std::vector<double> q2low( 5 );
std::vector<double> q2high( 5 );
std::vector<int> counts( 5 );
//kee
// int n=4;
//q2low[0]=0.0; q2high[0]=4.5;
//q2low[1]=4.5; q2high[1]=8.41;
//q2low[2]=10.24; q2high[2]=12.96;
//q2low[3]=14.06; q2high[3]=30.0;
//kmm
int n = 4;
q2low[0] = 0.0;
q2high[0] = 4.5;
q2low[1] = 4.5;
q2high[1] = 9.0;
q2low[2] = 10.24;
q2high[2] = 12.96;
q2low[3] = 14.06;
q2high[3] = 30.0;
//K*ee
//int n=5;
//q2low[0]=0.0; q2high[0]=0.1;
//q2low[1]=0.1; q2high[1]=4.5;
//q2low[2]=4.5; q2high[2]=8.41;
//q2low[3]=10.24; q2high[3]=12.96;
//q2low[4]=14.06; q2high[4]=30.0;
//K*mm
//int n=5;
//q2low[0]=0.0; q2high[0]=0.1;
//q2low[1]=0.1; q2high[1]=4.5;
//q2low[2]=4.5; q2high[2]=9.0;
//q2low[3]=10.24; q2high[3]=12.96;
//q2low[4]=14.06; q2high[4]=30.0;
do {
EvtVector4R p_init( EvtPDL::getMass( B0 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( B0, p_init );
root_part->setDiagonalSpinDensity();
myGenerator.generateDecay( root_part );
// root_part->printTree();
//root_part->getDaug(0)->printTree();
//root_part->getDaug(1)->printTree();
//root_part->getDaug(2)->printTree();
k = root_part->getDaug( 0 )->getP4Lab();
l1 = root_part->getDaug( 1 )->getP4Lab();
l2 = root_part->getDaug( 2 )->getP4Lab();
//b=root_part->getP4();
// k=root_part->getDaug(0)->getDaug(0)->getP4Lab();
// pi=root_part->getDaug(0)->getDaug(1)->getP4Lab();
double qsq = ( l1 + l2 ).mass2();
for ( int j = 0; j < n; j++ ) {
if ( qsq > q2low[j] && qsq < q2high[j] )
counts[j]++;
}
_q2->Fill( ( l1 + l2 ).mass2() );
_q2low->Fill( ( l1 + l2 ).mass2() );
_q2lowlow->Fill( ( l1 + l2 ).mass2() );
_ctl->Fill( EvtDecayAngle( ( l1 + l2 + k ), ( l1 + l2 ), l1 ) );
_dalitz->Fill( l1.get( 0 ), ( l1 + l2 ).mass2(), 1.0 );
root_part->deleteTree();
_phi->Fill( atan2( l1.get( 1 ), l1.get( 2 ) ) );
//_chi->Fill(EvtDecayAngleChi(b,k,pi,l1,l2));
//if (EvtDecayAngle((l1+l2+kstar),(l1+l2),l1)>0){
// _chictl->Fill(EvtDecayAngleChi(b,k,pi,l1,l2));
// }
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "count:" << count << " " << ( l1 + l2 ).mass2() << std::endl;
} while ( count++ < nevent );
for ( int j = 0; j < n; j++ ) {
std::cout << "[" << q2low[j] << ".." << q2high[j] << "]=" << counts[j]
<< std::endl;
}
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runHll( int nevent, EvtGen& myGenerator, char* mode )
{
TString modename = mode;
TString filename;
filename = modename;
filename = filename + "_nnlo.root";
TFile* file = new TFile( filename, "RECREATE" );
TString decname;
decname += modename;
decname.ToUpper();
decname = "exampleFiles/" + decname + ".DEC";
char udecay_name[100];
strcpy( udecay_name, decname );
TH2F* _dalitz = new TH2F( "h1", "q^2! vs Elep", 70, 0.0, 3.5, 60, 0.0, 30.0 );
TH1F* _ctl = new TH1F( "h2", "ctl", 50, -1.0, 1.0 );
TH1F* _q2 = new TH1F( "h3", "q2", 50, 0.0, 25.0 );
TH1F* _q2low = new TH1F( "h4", "q2 (low)", 50, 0.0, 1.0 );
TH1F* _q2lowlow = new TH1F( "h5", "q2 (lowlow)", 50, 0.0, 0.00001 );
TH1F* _phi = new TH1F( "h6", "phi", 50, -EvtConst::pi, EvtConst::pi );
TH1F* _chi = new TH1F( "h7", "chi", 50, 0.0, EvtConst::twoPi );
TH1F* _chictl = new TH1F( "h8", "chictl", 50, 0.0, EvtConst::twoPi );
EvtId B;
if ( modename == "kee" || modename == "kmm" || modename == "kstksee" ||
modename == "kstksmm" || modename == "piee" || modename == "pimm" ||
modename == "rhoee" || modename == "rhomm" ) {
B = EvtPDL::getId( std::string( "B+" ) );
} else {
B = EvtPDL::getId( std::string( "B0" ) );
}
int count = 1;
EvtVector4R b, h, l1, l2;
EvtVector4R hdaug1, hdaug2;
myGenerator.readUDecay( udecay_name );
std::vector<double> q2low( 7 );
std::vector<double> q2high( 7 );
std::vector<int> counts( 7 );
int n( 0 );
if ( modename == "kee" || modename == "ksee" || modename == "piee" ||
modename == "pi0ee" || modename == "etaee" || modename == "etapee" ) {
//kee
n = 6;
q2low[0] = 0.0;
q2high[0] = 4.5;
q2low[1] = 4.5;
q2high[1] = 8.41;
q2low[2] = 8.41;
q2high[2] = 10.24;
q2low[3] = 10.24;
q2high[3] = 12.96;
q2low[4] = 12.96;
q2high[4] = 14.06;
q2low[5] = 14.06;
q2high[5] = 30.0;
} else if ( modename == "kmm" || modename == "ksmm" || modename == "pimm" ||
modename == "pi0mm" || modename == "etamm" ||
modename == "etapmm" ) {
//kmm
n = 6;
q2low[0] = 0.0;
q2high[0] = 4.5;
q2low[1] = 4.5;
q2high[1] = 9.0;
q2low[2] = 9.0;
q2high[2] = 10.24;
q2low[3] = 10.24;
q2high[3] = 12.96;
q2low[4] = 12.96;
q2high[4] = 14.06;
q2low[5] = 14.06;
q2high[5] = 30.0;
} else if ( modename == "kstkee" || modename == "kstksee" ||
modename == "rhoee" || modename == "rho0ee" ||
modename == "omegaee" ) {
//K*ee
n = 7;
q2low[0] = 0.0;
q2high[0] = 0.1;
q2low[1] = 0.1;
q2high[1] = 4.5;
q2low[2] = 4.5;
q2high[2] = 8.41;
q2low[3] = 8.41;
q2high[3] = 10.24;
q2low[4] = 10.24;
q2high[4] = 12.96;
q2low[5] = 12.96;
q2high[5] = 14.06;
q2low[6] = 14.06;
q2high[6] = 30.0;
} else if ( modename == "kstkmm" || modename == "kstksmm" ||
modename == "rhomm" || modename == "rho0mm" ||
modename == "omegamm" ) {
//K*mm
n = 7;
q2low[0] = 0.0;
q2high[0] = 0.1;
q2low[1] = 0.1;
q2high[1] = 4.5;
q2low[2] = 4.5;
q2high[2] = 9.0;
q2low[3] = 9.0;
q2high[3] = 10.24;
q2low[4] = 10.24;
q2high[4] = 12.96;
q2low[5] = 12.96;
q2high[5] = 14.06;
q2low[6] = 14.06;
q2high[6] = 30.0;
}
float q2binlow[n + 1];
for ( int i = 0; i < n; i++ ) {
q2binlow[i] = q2low[i];
}
q2binlow[n] = 30.0;
TH1F* _q2var = new TH1F( "h9", "q2var", n, q2binlow );
do {
EvtVector4R p_init( EvtPDL::getMass( B ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( B, p_init );
root_part->setDiagonalSpinDensity();
myGenerator.generateDecay( root_part );
// root_part->printTree();
//root_part->getDaug(0)->printTree();
//root_part->getDaug(1)->printTree();
//root_part->getDaug(2)->printTree();
h = root_part->getDaug( 0 )->getP4Lab();
l1 = root_part->getDaug( 1 )->getP4Lab();
l2 = root_part->getDaug( 2 )->getP4Lab();
double qsq = ( l1 + l2 ).mass2();
for ( int j = 0; j < n; j++ ) {
if ( qsq > q2low[j] && qsq < q2high[j] )
counts[j]++;
}
_q2->Fill( ( l1 + l2 ).mass2() );
_q2var->Fill( ( l1 + l2 ).mass2() );
_q2low->Fill( ( l1 + l2 ).mass2() );
_q2lowlow->Fill( ( l1 + l2 ).mass2() );
_ctl->Fill( EvtDecayAngle( ( l1 + l2 + h ), ( l1 + l2 ), l1 ) );
_dalitz->Fill( l1.get( 0 ), ( l1 + l2 ).mass2(), 1.0 );
_phi->Fill( atan2( l1.get( 1 ), l1.get( 2 ) ) );
if ( modename == "kstkee" || modename == "kstkmm" ||
modename == "kstksee" || modename == "kstksmm" ||
modename == "rhoee" || modename == "rhomm" ||
modename == "rho0ee" || modename == "rho0mm" ) {
b = root_part->getP4();
hdaug1 = root_part->getDaug( 0 )->getDaug( 0 )->getP4Lab();
hdaug2 = root_part->getDaug( 0 )->getDaug( 1 )->getP4Lab();
_chi->Fill( EvtDecayAngleChi( b, hdaug1, hdaug2, l1, l2 ) );
if ( EvtDecayAngle( ( l1 + l2 + h ), ( l1 + l2 ), l1 ) > 0 ) {
_chictl->Fill( EvtDecayAngleChi( b, hdaug1, hdaug2, l1, l2 ) );
}
}
if ( count % 1000 == 0 ) {
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "count:" << count << " " << ( l1 + l2 ).mass2() << std::endl;
}
root_part->deleteTree();
} while ( count++ < nevent );
for ( int j = 0; j < n; j++ ) {
std::cout << "[" << q2low[j] << ".." << q2high[j] << "] = " << counts[j]
<< std::endl;
}
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runVectorIsr( int nevent, EvtGen& myGenerator )
{
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
static EvtId VPHO = EvtPDL::getId( std::string( "vpho" ) );
TFile* file = new TFile( "vectorisr.root", "RECREATE" );
TH1F* cosv = new TH1F( "h1", "Cos vector in e+e- frame", 50, -1.0, 1.0 );
TH1F* cosd1 = new TH1F( "h2", "Cos helang 1st dau of vector", 50, -1.0, 1.0 );
TH1F* cosd1d1 = new TH1F( "h3", "Cos helang 1st dau of 1st dau", 50, -1.0,
1.0 );
TH1F* cosd2d1 = new TH1F( "h4", "Cos helang 1st dau of 2nd dau", 50, -1.0,
1.0 );
TH2F* d1vsd1d1 = new TH2F( "h5", "Cos helangs d1 vs d1d1", 20, -1.0, 1.0,
20, -1.0, 1.0 );
TH2F* d2vsd2d1 = new TH2F( "h6", "Cos helangs d2 vs d2d1", 20, -1.0, 1.0,
20, -1.0, 1.0 );
TH2F* d1d1vsd2d1 = new TH2F( "h7", "Cos helangs d1d1 vs d2d1", 20, -1.0,
1.0, 20, -1.0, 1.0 );
TH1F* chidd = new TH1F( "h8", "Chi - angle between decay planes", 60, 0.,
360.0 );
TH2F* chi12vsd1d1 = new TH2F( "h9", "Chi 1-2 vs d1d1", 30, 0., 360.0, 20,
-1.0, 1.0 );
TH2F* chi12vsd2d1 = new TH2F( "h10", "Chi 1-2 vs d2d1", 30, 0., 360.0, 20,
-1.0, 1.0 );
TH2F* chi21vsd1d1 = new TH2F( "h11", "Chi 2-1 vs d1d1", 30, 0., 360.0, 20,
-1.0, 1.0 );
TH2F* chi21vsd2d1 = new TH2F( "h12", "Chi 2-1 vs d2d1", 30, 0., 360.0, 20,
-1.0, 1.0 );
int count = 1;
char udecay_name[100];
EvtVector4R cm, v, d1, d2, d1d1, d1d2, d2d1, d2d2;
strcpy( udecay_name, "exampleFiles/VECTORISR.DEC" );
myGenerator.readUDecay( udecay_name );
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( VPHO,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
cm = root_part->getP4Lab();
v = root_part->getDaug( 0 )->getP4Lab();
d1 = root_part->getDaug( 0 )->getDaug( 0 )->getP4Lab();
d2 = root_part->getDaug( 0 )->getDaug( 1 )->getP4Lab();
cosv->Fill( v.get( 3 ) / v.d3mag() );
double cosdecayd1 = EvtDecayAngle( cm, v, d1 );
double cosdecayd2 = EvtDecayAngle( cm, v, d2 );
cosd1->Fill( cosdecayd1 );
// now get daughters of the daughters
//
// first daughter of first daughter
if ( root_part->getDaug( 0 )->getDaug( 0 )->getNDaug() >= 2 ) {
d1d1 = root_part->getDaug( 0 )->getDaug( 0 )->getDaug( 0 )->getP4Lab();
double cosdecayd1d1 = EvtDecayAngle( v, d1, d1d1 );
cosd1d1->Fill( cosdecayd1d1 );
d1vsd1d1->Fill( cosdecayd1, cosdecayd1d1, 1.0 );
}
// first daughter of second daughter
if ( root_part->getDaug( 0 )->getDaug( 1 )->getNDaug() >= 2 ) {
d2d1 = root_part->getDaug( 0 )->getDaug( 1 )->getDaug( 0 )->getP4Lab();
double cosdecayd2d1 = EvtDecayAngle( v, d2, d2d1 );
cosd2d1->Fill( cosdecayd2d1 );
d2vsd2d1->Fill( cosdecayd2, cosdecayd2d1, 1.0 );
if ( root_part->getDaug( 0 )->getDaug( 0 )->getNDaug() >= 2 ) {
d1d1 =
root_part->getDaug( 0 )->getDaug( 0 )->getDaug( 0 )->getP4Lab();
double cosdecayd1d1 = EvtDecayAngle( v, d1, d1d1 );
d1d1vsd2d1->Fill( cosdecayd1d1, cosdecayd2d1, 1.0 );
//second daughters of daughters 1 and 2
d1d2 =
root_part->getDaug( 0 )->getDaug( 0 )->getDaug( 1 )->getP4Lab();
d2d2 =
root_part->getDaug( 0 )->getDaug( 1 )->getDaug( 1 )->getP4Lab();
double chi21 = 57.29578 *
EvtDecayAngleChi( v, d2d1, d2d2, d1d1, d1d2 );
double chi12 = 57.29578 *
EvtDecayAngleChi( v, d1d1, d1d2, d2d1, d2d2 );
chidd->Fill( chi12 );
chi12vsd1d1->Fill( chi12, cosdecayd1d1, 1.0 );
chi12vsd2d1->Fill( chi12, cosdecayd2d1, 1.0 );
chi21vsd1d1->Fill( chi21, cosdecayd1d1, 1.0 );
chi21vsd2d1->Fill( chi21, cosdecayd2d1, 1.0 );
}
}
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runBsquark( int nevent, EvtGen& myGenerator )
{
static EvtId VPHO = EvtPDL::getId( std::string( "vpho" ) );
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
static EvtId B0B = EvtPDL::getId( std::string( "anti-B0" ) );
TFile* file = new TFile( "bsquark.root", "RECREATE" );
TH1F* elep = new TH1F( "h1", "Elep", 50, 0.0, 1.5 );
TH1F* q2 = new TH1F( "h2", "q2", 50, 0.0, 3.0 );
TH2F* dalitz = new TH2F( "h3", "q2 vs. Elep", 50, 0.0, 1.5, 50, 0.0, 3.0 );
TH1F* elepbar = new TH1F( "h11", "Elep bar", 50, 0.0, 1.5 );
TH1F* q2bar = new TH1F( "h12", "q2 bar", 50, 0.0, 3.0 );
TH2F* dalitzbar = new TH2F( "h13", "q2 vs. Elep bar", 50, 0.0, 1.5, 50, 0.0,
3.0 );
int count = 1;
char udecay_name[100];
EvtVector4R cm, v, d1, d2, d1d1, d1d2, d2d1, d2d2;
strcpy( udecay_name, "exampleFiles/BSQUARK.DEC" );
myGenerator.readUDecay( udecay_name );
do {
EvtVector4R p_init( 10.55, 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( VPHO,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
EvtParticle* p = root_part->nextIter();
while ( p ) {
if ( p->getId() == B0 ) {
//EvtParticle *dstar=p->getDaug(0);
EvtParticle* lepton = p->getDaug( 1 );
EvtParticle* sneutrino = p->getDaug( 2 );
//EvtVector4R p4dstar=dstar->getP4();
EvtVector4R p4lepton = lepton->getP4();
EvtVector4R p4sneutrino = sneutrino->getP4();
elep->Fill( p4lepton.get( 0 ) );
q2->Fill( ( p4lepton + p4sneutrino ).mass2() );
dalitz->Fill( p4lepton.get( 0 ),
( p4lepton + p4sneutrino ).mass2(), 1.0 );
}
if ( p->getId() == B0B ) {
//EvtParticle *dstar=p->getDaug(0);
EvtParticle* lepton = p->getDaug( 1 );
EvtParticle* sneutrino = p->getDaug( 2 );
//EvtVector4R p4dstar=dstar->getP4();
EvtVector4R p4lepton = lepton->getP4();
EvtVector4R p4sneutrino = sneutrino->getP4();
elepbar->Fill( p4lepton.get( 0 ) );
q2bar->Fill( ( p4lepton + p4sneutrino ).mass2() );
dalitzbar->Fill( p4lepton.get( 0 ),
( p4lepton + p4sneutrino ).mass2(), 1.0 );
}
p = p->nextIter();
}
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runK3gamma( int nevent, EvtGen& myGenerator )
{
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
TFile* file = new TFile( "k3gamma.root", "RECREATE" );
TH1F* costheta = new TH1F( "h1", "cosTheta", 100, -1.0, 1.0 );
int count = 1;
char udecay_name[100];
EvtVector4R cm, v, d1, d2, d1d1, d1d2, d2d1, d2d2;
strcpy( udecay_name, "exampleFiles/K3GAMMA.DEC" );
myGenerator.readUDecay( udecay_name );
do {
EvtVector4R p_init( EvtPDL::getMass( B0 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( B0, p_init );
root_part->setDiagonalSpinDensity();
myGenerator.generateDecay( root_part );
EvtParticle* k3 = root_part->getDaug( 0 );
EvtParticle* k = k3->getDaug( 0 );
EvtVector4R p4b = root_part->getP4Lab();
EvtVector4R p4k3 = k3->getP4Lab();
EvtVector4R p4k = k->getP4Lab();
costheta->Fill( EvtDecayAngle( p4b, p4k3, p4k ) );
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runLambda( int nevent, EvtGen& myGenerator )
{
static EvtId LAMBDA = EvtPDL::getId( std::string( "Lambda0" ) );
TFile* file = new TFile( "lambda.root", "RECREATE" );
TH1F* costheta = new TH1F( "h1", "cosTheta", 100, -1.0, 1.0 );
int count = 1;
char udecay_name[100];
EvtVector4R cm, v, d1, d2, d1d1, d1d2, d2d1, d2d2;
strcpy( udecay_name, "exampleFiles/LAMBDA.DEC" );
myGenerator.readUDecay( udecay_name );
do {
EvtVector4R p_init( EvtPDL::getMass( LAMBDA ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( LAMBDA,
p_init );
EvtSpinDensity rho;
rho.setDim( 2 );
rho.set( 0, 0, 1.0 );
rho.set( 0, 1, 0.0 );
rho.set( 1, 0, 0.0 );
rho.set( 1, 1, 0.0 );
root_part->setSpinDensityForwardHelicityBasis( rho );
myGenerator.generateDecay( root_part );
EvtParticle* p = root_part->getDaug( 0 );
//EvtVector4R p4lambda=root_part->getP4Lab();
EvtVector4R p4p = p->getP4Lab();
costheta->Fill( p4p.get( 3 ) / p4p.d3mag() );
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runTauTauPiPi( int nevent, EvtGen& myGenerator )
{
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
static EvtId VPHO = EvtPDL::getId( std::string( "vpho" ) );
TFile* file = new TFile( "tautaupipi.root", "RECREATE" );
TH1F* cospi1 = new TH1F( "h1", "cos theta pi1", 50, -1.0, 1.0 );
TH1F* cospi2 = new TH1F( "h2", "cos theta pi2", 50, -1.0, 1.0 );
TH1F* costheta = new TH1F( "h3", "cos theta", 50, -1.0, 1.0 );
std::ofstream outmix;
outmix.open( "tautaupipi.dat" );
int count = 1;
EvtVector4R tau1, tau2, pi1, pi2;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/TAUTAUPIPI.DEC" );
myGenerator.readUDecay( udecay_name );
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( VPHO,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
tau1 = root_part->getDaug( 0 )->getP4Lab();
tau2 = root_part->getDaug( 1 )->getP4Lab();
pi1 = root_part->getDaug( 0 )->getDaug( 0 )->getP4Lab();
pi2 = root_part->getDaug( 1 )->getDaug( 0 )->getP4Lab();
cospi1->Fill( EvtDecayAngle( tau1 + tau2, tau1, pi1 ) );
cospi2->Fill( EvtDecayAngle( tau1 + tau2, tau2, pi2 ) );
costheta->Fill( tau1.get( 3 ) / tau1.d3mag() );
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
outmix.close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runTauTauEE( int nevent, EvtGen& myGenerator )
{
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
static EvtId VPHO = EvtPDL::getId( std::string( "vpho" ) );
TFile* file = new TFile( "tautauee.root", "RECREATE" );
TH1F* e1 = new TH1F( "h1", "e1", 55, 0.0, 5.5 );
TH1F* e2 = new TH1F( "h2", "e2", 55, 0.0, 5.5 );
TH2F* e1vse2 = new TH2F( "h3", "e1 vs e2", 55, 0.0, 5.5, 55, 0.0, 5.5 );
int count = 1;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/TAUTAUEE.DEC" );
myGenerator.readUDecay( udecay_name );
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( VPHO,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
e1->Fill( root_part->getDaug( 0 )->getDaug( 0 )->getP4Lab().get( 0 ) );
e2->Fill( root_part->getDaug( 1 )->getDaug( 0 )->getP4Lab().get( 0 ) );
e1vse2->Fill( root_part->getDaug( 0 )->getDaug( 0 )->getP4Lab().get( 0 ),
root_part->getDaug( 1 )->getDaug( 0 )->getP4Lab().get( 0 ),
1.0 );
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runTauTau2Pi2Pi( int nevent, EvtGen& myGenerator )
{
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
static EvtId VPHO = EvtPDL::getId( std::string( "vpho" ) );
TFile* file = new TFile( "tautau2pi2pi.root", "RECREATE" );
TH1F* e1 = new TH1F( "h1", "mrho", 200, 0.0, 2.0 );
TH1F* e2 = new TH1F( "h2", "coshel", 200, -1.0, 1.0 );
int count = 1;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/TAUTAU2PI2PI.DEC" );
myGenerator.readUDecay( udecay_name );
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( VPHO,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
EvtVector4R p4tau = root_part->getDaug( 0 )->getP4();
EvtVector4R p4rho = root_part->getDaug( 0 )->getDaug( 0 )->getP4() +
root_part->getDaug( 0 )->getDaug( 1 )->getP4();
EvtVector4R p4pi = root_part->getDaug( 0 )->getDaug( 0 )->getP4();
e1->Fill( p4rho.mass() );
double dcostheta = EvtDecayAngle( p4tau, p4rho, p4pi );
e2->Fill( dcostheta );
p4tau = root_part->getDaug( 1 )->getP4();
p4rho = root_part->getDaug( 1 )->getDaug( 0 )->getP4() +
root_part->getDaug( 1 )->getDaug( 1 )->getP4();
p4pi = root_part->getDaug( 1 )->getDaug( 0 )->getP4();
e1->Fill( p4rho.mass() );
dcostheta = EvtDecayAngle( p4tau, p4rho, p4pi );
e2->Fill( dcostheta );
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runTauTau3Pi3Pi( int nevent, EvtGen& myGenerator )
{
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
static EvtId VPHO = EvtPDL::getId( std::string( "vpho" ) );
TFile* file = new TFile( "tautau3pi3pi.root", "RECREATE" );
TH1F* e1 = new TH1F( "h1", "a1", 200, 0.0, 2.0 );
int count = 1;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/TAUTAU3PI3PI.DEC" );
myGenerator.readUDecay( udecay_name );
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( VPHO,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
EvtVector4R p4tau = root_part->getDaug( 0 )->getP4();
EvtVector4R p4a1 = root_part->getDaug( 0 )->getDaug( 0 )->getP4() +
root_part->getDaug( 0 )->getDaug( 1 )->getP4() +
root_part->getDaug( 0 )->getDaug( 2 )->getP4();
e1->Fill( p4a1.mass() );
p4tau = root_part->getDaug( 1 )->getP4();
p4a1 = root_part->getDaug( 1 )->getDaug( 0 )->getP4() +
root_part->getDaug( 1 )->getDaug( 1 )->getP4() +
root_part->getDaug( 1 )->getDaug( 2 )->getP4();
e1->Fill( p4a1.mass() );
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runJPsiKstar( int nevent, EvtGen& myGenerator, int modeInt )
{
std::ofstream outmix;
outmix.open( "jpsikstar.dat" );
int count = 1;
char udecay_name[100];
if ( modeInt == 0 )
strcpy( udecay_name, "exampleFiles/JPSIKSTAR.DEC" );
if ( modeInt == 1 )
strcpy( udecay_name, "exampleFiles/JPSIKSTAR1.DEC" );
if ( modeInt == 2 )
strcpy( udecay_name, "exampleFiles/JPSIKSTAR2.DEC" );
if ( modeInt == 3 )
strcpy( udecay_name, "exampleFiles/JPSIKSTAR3.DEC" );
if ( modeInt == 4 )
strcpy( udecay_name, "exampleFiles/JPSIKSTAR4.DEC" );
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
static EvtId B0B = EvtPDL::getId( std::string( "anti-B0" ) );
myGenerator.readUDecay( udecay_name );
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
EvtParticle *btag, *bcp;
if ( root_part->getDaug( 0 )->getNDaug() == 3 ) {
btag = root_part->getDaug( 0 );
bcp = root_part->getDaug( 1 );
} else {
bcp = root_part->getDaug( 0 );
btag = root_part->getDaug( 1 );
}
EvtId tag;
if ( btag->getId() == B0B ) {
tag = B0;
} else {
tag = B0B;
}
EvtParticle *p_b, *p_psi, *p_kstar, *p_pi0, *p_kz, *p_ep, *p_em;
EvtVector4R p4_b, p4_psi, p4_kstar, p4_pi0, p4_kz, p4_ep, p4_em;
p_b = bcp;
p_psi = p_b->getDaug( 0 );
p_kstar = p_b->getDaug( 1 );
p_pi0 = p_kstar->getDaug( 0 );
p_kz = p_kstar->getDaug( 1 );
p_ep = p_psi->getDaug( 0 );
p_em = p_psi->getDaug( 1 );
p4_b = p_b->getP4Lab();
p4_psi = p_psi->getP4Lab();
p4_kstar = p_kstar->getP4Lab();
p4_pi0 = p_pi0->getP4Lab();
p4_kz = p_kz->getP4Lab();
p4_ep = p_ep->getP4Lab();
p4_em = p_em->getP4Lab();
outmix << tag.getId() << " ";
outmix << root_part->getDaug( 0 )->getLifetime() << " ";
outmix << root_part->getDaug( 1 )->getLifetime() << " ";
outmix << EvtDecayAngle( p4_b, p4_ep + p4_em, p4_ep ) << " ";
outmix << EvtDecayAngle( p4_b, p4_pi0 + p4_kz, p4_pi0 ) << " ";
outmix << EvtDecayAngleChi( p4_b, p4_pi0, p4_kz, p4_ep, p4_em ) << "\n";
root_part->deleteTree();
} while ( count++ < nevent );
outmix.close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runSVVCPLH( int nevent, EvtGen& myGenerator )
{
TFile* file = new TFile( "svvcplh.root", "RECREATE" );
TH1F* t = new TH1F( "h1", "t", 50, 0.0, 5.0 );
TH1F* cospsi = new TH1F( "h2", "cos theta e+", 50, -1.0, 1.0 );
TH1F* cosphi = new TH1F( "h3", "cos theta k+", 50, -1.0, 1.0 );
TH1F* chi = new TH1F( "h4", "chi", 50, 0.0, 2.0 * EvtConst::pi );
int count = 1;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/SVVCPLH.DEC" );
myGenerator.readUDecay( udecay_name );
static EvtId BS0 = EvtPDL::getId( std::string( "B_s0" ) );
do {
EvtVector4R p_init( EvtPDL::getMass( BS0 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( BS0,
p_init );
root_part->setDiagonalSpinDensity();
myGenerator.generateDecay( root_part );
EvtParticle *p_b, *p_psi, *p_phi, *p_kp, *p_km, *p_ep, *p_em;
EvtVector4R p4_b, p4_psi, p4_phi, p4_kp, p4_km, p4_ep, p4_em;
p_b = root_part;
if ( p_b->getNDaug() == 1 )
p_b = p_b->getDaug( 0 );
p_psi = p_b->getDaug( 0 );
p_phi = p_b->getDaug( 1 );
p_kp = p_phi->getDaug( 0 );
p_km = p_phi->getDaug( 1 );
p_ep = p_psi->getDaug( 0 );
p_em = p_psi->getDaug( 1 );
p4_b = p_b->getP4Lab();
p4_psi = p_psi->getP4Lab();
p4_phi = p_phi->getP4Lab();
p4_kp = p_kp->getP4Lab();
p4_km = p_km->getP4Lab();
p4_ep = p_ep->getP4Lab();
p4_em = p_em->getP4Lab();
t->Fill( root_part->getLifetime() );
cospsi->Fill( EvtDecayAngle( p4_b, p4_ep + p4_em, p4_ep ) );
cosphi->Fill( EvtDecayAngle( p4_b, p4_kp + p4_km, p4_kp ) );
chi->Fill( EvtDecayAngleChi( p4_b, p4_kp, p4_km, p4_ep, p4_em ) );
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runSVSCPLH( int nevent, EvtGen& myGenerator )
{
TFile* file = new TFile( "svscplh.root", "RECREATE" );
TH1F* t = new TH1F( "h1", "t", 200, -5.0, 5.0 );
TH1F* tB0tag = new TH1F( "h2", "dt B0 tag (ps)", 200, -15.0, 15.0 );
TH1F* tB0Btag = new TH1F( "h3", "dt B0B tag (ps)", 200, -15.0, 15.0 );
TH1F* ctheta = new TH1F( "h4", "costheta", 50, -1.0, 1.0 );
int count = 1;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/SVSCPLH.DEC" );
myGenerator.readUDecay( udecay_name );
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
static EvtId B0B = EvtPDL::getId( std::string( "anti-B0" ) );
std::ofstream outmix;
outmix.open( "svscplh.dat" );
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
EvtParticle *p_tag, *p_cp, *p_jpsi, *p_ep;
EvtVector4R p4_tag, p4_cp, p4_jpsi, p4_ep;
p_tag = root_part->getDaug( 0 );
p_cp = root_part->getDaug( 1 );
p_jpsi = p_cp->getDaug( 0 );
p_ep = p_jpsi->getDaug( 0 );
p4_tag = p_tag->getP4Lab();
p4_cp = p_cp->getP4Lab();
p4_jpsi = p_jpsi->getP4Lab();
p4_ep = p_ep->getP4Lab();
double dt = p_cp->getLifetime() - p_tag->getLifetime();
dt = dt / ( 1e-12 * 3e11 );
t->Fill( dt );
if ( p_tag->getId() == B0 ) {
tB0tag->Fill( dt );
outmix << dt << " 1" << std::endl;
}
if ( p_tag->getId() == B0B ) {
tB0Btag->Fill( dt );
outmix << dt << " -1" << std::endl;
}
ctheta->Fill( EvtDecayAngle( p4_cp, p4_jpsi, p4_ep ) );
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
outmix.close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runSSDCP( int nevent, EvtGen& myGenerator )
{
TFile* file = new TFile( "ssdcp.root", "RECREATE" );
TH1F* t = new TH1F( "h1", "dt", 100, -15.0, 15.0 );
TH1F* tB0tag = new TH1F( "h2", "dt B0 tag (ps)", 100, -15.0, 15.0 );
TH1F* tB0Btag = new TH1F( "h3", "dt B0B tag (ps)", 100, -15.0, 15.0 );
int count = 1;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/SSDCP.DEC" );
myGenerator.readUDecay( udecay_name );
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
static EvtId B0B = EvtPDL::getId( std::string( "anti-B0" ) );
std::ofstream outmix;
do {
EvtVector4R pinit( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
pinit );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
EvtParticle *p_tag, *p_cp, *p_jpsi;
EvtVector4R p4_tag, p4_cp, p4_jpsi, p4_ep;
p_tag = root_part->getDaug( 0 );
p_cp = root_part->getDaug( 1 );
p_jpsi = p_cp->getDaug( 0 );
//p_ep=p_jpsi->getDaug(0);
p4_tag = p_tag->getP4Lab();
p4_cp = p_cp->getP4Lab();
p4_jpsi = p_jpsi->getP4Lab();
//p4_ep=p_ep->getP4Lab();
double dt = p_cp->getLifetime() - p_tag->getLifetime();
dt = dt / ( 1e-12 * EvtConst::c );
t->Fill( dt );
if ( p_tag->getId() == B0 ) {
tB0tag->Fill( dt );
}
if ( p_tag->getId() == B0B ) {
tB0Btag->Fill( dt );
}
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runKstarstargamma( int nevent, EvtGen& myGenerator )
{
TFile* file = new TFile( "kstarstargamma.root", "RECREATE" );
TH1F* m = new TH1F( "h1", "mkpi", 100, 0.5, 2.5 );
TH1F* ctheta = new TH1F( "h2", "ctheta", 100, -1.0, 1.0 );
int count = 1;
myGenerator.readUDecay( "exampleFiles/KSTARSTARGAMMA.DEC" );
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
std::ofstream outmix;
do {
EvtVector4R pinit( EvtPDL::getMass( B0 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( B0, pinit );
root_part->setDiagonalSpinDensity();
myGenerator.generateDecay( root_part );
EvtParticle *p_kaon, *p_pion;
EvtVector4R p4_kaon, p4_pion;
p_kaon = root_part->getDaug( 0 );
p_pion = root_part->getDaug( 1 );
p4_kaon = p_kaon->getP4Lab();
p4_pion = p_pion->getP4Lab();
m->Fill( ( p4_kaon + p4_pion ).mass() );
ctheta->Fill( EvtDecayAngle( pinit, p4_kaon + p4_pion, p4_kaon ) );
//EvtGenReport(EVTGEN_INFO,"EvtGen") << "ctheta:"<<EvtDecayAngle(pinit,p4_kaon+p4_pion,p4_kaon)<<std::endl;
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runDSTARPI( int nevent, EvtGen& myGenerator )
{
TFile* file = new TFile( "dstarpi.root", "RECREATE" );
TH1F* t = new TH1F( "h1", "dt", 100, -15.0, 15.0 );
TH1F* tB0tagpip = new TH1F( "h2", "dt B0 tag pi+ (ps)", 100, -15.0, 15.0 );
TH1F* tB0Btagpip = new TH1F( "h3", "dt B0B tag pi+(ps)", 100, -15.0, 15.0 );
TH1F* tB0tagpim = new TH1F( "h4", "dt B0 tag pi- (ps)", 100, -15.0, 15.0 );
TH1F* tB0Btagpim = new TH1F( "h5", "dt B0B tag pi- (ps)", 100, -15.0, 15.0 );
int count = 1;
myGenerator.readUDecay( "exampleFiles/DSTARPI.DEC" );
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
static EvtId B0B = EvtPDL::getId( std::string( "anti-B0" ) );
static EvtId PIP = EvtPDL::getId( std::string( "pi+" ) );
static EvtId PIM = EvtPDL::getId( std::string( "pi-" ) );
std::ofstream outmix;
do {
EvtVector4R pinit( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
pinit );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
EvtParticle *p_tag, *p_cp, *p_pi;
p_tag = root_part->getDaug( 0 );
p_cp = root_part->getDaug( 1 );
//p_dstar=p_cp->getDaug(1);
p_pi = p_cp->getDaug( 0 );
double dt = p_cp->getLifetime() - p_tag->getLifetime();
dt = dt / ( 1e-12 * EvtConst::c );
t->Fill( dt );
if ( p_tag->getId() == B0 ) {
if ( p_pi->getId() == PIP )
tB0tagpip->Fill( dt );
if ( p_pi->getId() == PIM )
tB0tagpim->Fill( dt );
}
if ( p_tag->getId() == B0B ) {
if ( p_pi->getId() == PIP )
tB0Btagpip->Fill( dt );
if ( p_pi->getId() == PIM )
tB0Btagpim->Fill( dt );
}
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runETACPHIPHI( int nevent, EvtGen& myGenerator )
{
TFile* file = new TFile( "etacphiphi.root", "RECREATE" );
TH2F* cosphi12 = new TH2F( "h1", "cos phi1 vs phi2", 50, -1.0, 1.0, 50,
-1.0, 1.0 );
TH1F* cosphi1 = new TH1F( "h2", "cos phi1", 50, -1.0, 1.0 );
TH1F* cosphi2 = new TH1F( "h3", "cos phi2", 50, -1.0, 1.0 );
TH1F* chi = new TH1F( "h4", "chi", 50, 0.0, 2.0 * EvtConst::pi );
int count = 1;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/ETACPHIPHI.DEC" );
myGenerator.readUDecay( udecay_name );
static EvtId ETAC = EvtPDL::getId( std::string( "eta_c" ) );
do {
EvtVector4R p_init( EvtPDL::getMass( ETAC ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( ETAC,
p_init );
root_part->setDiagonalSpinDensity();
myGenerator.generateDecay( root_part );
EvtParticle *p_etac, *p_phi1, *p_phi2, *p_kp1, *p_km1, *p_kp2, *p_km2;
EvtVector4R p4_etac, p4_phi1, p4_phi2, p4_kp1, p4_km1, p4_kp2, p4_km2;
p_etac = root_part;
p_phi1 = p_etac->getDaug( 0 );
p_phi2 = p_etac->getDaug( 1 );
p_kp1 = p_phi1->getDaug( 0 );
p_km1 = p_phi1->getDaug( 1 );
p_kp2 = p_phi2->getDaug( 0 );
p_km2 = p_phi2->getDaug( 1 );
p4_etac = p_etac->getP4Lab();
p4_phi1 = p_phi1->getP4Lab();
p4_phi2 = p_phi2->getP4Lab();
p4_kp1 = p_kp1->getP4Lab();
p4_km1 = p_km1->getP4Lab();
p4_kp2 = p_kp2->getP4Lab();
p4_km2 = p_km2->getP4Lab();
cosphi12->Fill( EvtDecayAngle( p4_etac, p4_phi1, p4_kp1 ),
EvtDecayAngle( p4_etac, p4_phi2, p4_kp2 ), 1.0 );
cosphi1->Fill( EvtDecayAngle( p4_etac, p4_phi1, p4_kp1 ) );
cosphi2->Fill( EvtDecayAngle( p4_etac, p4_phi2, p4_kp2 ) );
chi->Fill( EvtDecayAngleChi( p4_etac, p4_kp1, p4_km1, p4_kp2, p4_km2 ) );
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runVVPiPi( int nevent, EvtGen& myGenerator )
{
TFile* file = new TFile( "vvpipi.root", "RECREATE" );
TH1F* cospsi = new TH1F( "h1", "cos theta J/psi ", 50, -1.0, 1.0 );
TH1F* cose = new TH1F( "h2", "cos theta e+ ", 50, -1.0, 1.0 );
TH1F* mpipi = new TH1F( "h3", "m pipi ", 50, 0.0, 1.0 );
TH2F* cosevspsi = new TH2F( "h4", "cos theta e+vs cos thete J/psi ", 25,
-1.0, 1.0, 25, -1.0, 1.0 );
TH1F* cose1 = new TH1F( "h5", "cos theta e+ 1 ", 50, -1.0, 1.0 );
TH1F* cose2 = new TH1F( "h6", "cos theta e+ 2 ", 50, -1.0, 1.0 );
int count = 1;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/VVPIPI.DEC" );
myGenerator.readUDecay( udecay_name );
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
do {
EvtVector4R p_init( EvtPDL::getMass( B0 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( B0, p_init );
root_part->setDiagonalSpinDensity();
myGenerator.generateDecay( root_part );
EvtParticle *p_b, *p_psip, *p_psi, *p_ep, *p_pi1, *p_pi2;
EvtVector4R p4_b, p4_psip, p4_psi, p4_ep, p4_pi1, p4_pi2;
p_b = root_part;
p_psip = p_b->getDaug( 0 );
p_psi = p_psip->getDaug( 0 );
p_pi1 = p_psip->getDaug( 1 );
p_pi2 = p_psip->getDaug( 2 );
p_ep = p_psi->getDaug( 0 );
p4_b = p_b->getP4Lab();
p4_psip = p_psip->getP4Lab();
p4_psi = p_psi->getP4Lab();
p4_pi1 = p_pi1->getP4Lab();
p4_pi2 = p_pi2->getP4Lab();
p4_ep = p_ep->getP4Lab();
cospsi->Fill( EvtDecayAngle( p4_b, p4_psip, p4_psi ) );
cose->Fill( EvtDecayAngle( p4_psip, p4_psi, p4_ep ) );
mpipi->Fill( ( p4_pi1 + p4_pi2 ).mass() );
cosevspsi->Fill( EvtDecayAngle( p4_b, p4_psip, p4_psi ),
EvtDecayAngle( p4_psip, p4_psi, p4_ep ), 1.0 );
if ( std::fabs( EvtDecayAngle( p4_b, p4_psip, p4_psi ) ) > 0.95 ) {
cose1->Fill( EvtDecayAngle( p4_psip, p4_psi, p4_ep ) );
}
if ( std::fabs( EvtDecayAngle( p4_b, p4_psip, p4_psi ) ) < 0.05 ) {
cose2->Fill( EvtDecayAngle( p4_psip, p4_psi, p4_ep ) );
}
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runSVVHelAmp( int nevent, EvtGen& myGenerator )
{
TFile* file = new TFile( "svvhelamp.root", "RECREATE" );
TH1F* cospip = new TH1F( "h1", "cos theta pi+", 50, -1.0, 1.0 );
TH1F* cospim = new TH1F( "h2", "cos theta pi-", 50, -1.0, 1.0 );
TH1F* chi = new TH1F( "h3", "chi pi+ to pi- in D+ direction", 50, 0.0,
EvtConst::twoPi );
TH1F* chicospipp = new TH1F( "h4",
"chi pi+ to pi- in D+ direction (cospip>0)",
50, 0.0, EvtConst::twoPi );
TH1F* chicospipn = new TH1F( "h5", "chi pi+ to pi- in D+ direction (cospip<0",
50, 0.0, EvtConst::twoPi );
TH1F* chipp = new TH1F( "h6",
"chi pi+ to pi- in D+ direction (cospip>0,cospim>0)",
50, 0.0, EvtConst::twoPi );
TH1F* chipn = new TH1F( "h7",
"chi pi+ to pi- in D+ direction (cospip>0,cospim<0)",
50, 0.0, EvtConst::twoPi );
TH1F* chinp = new TH1F( "h8",
"chi pi+ to pi- in D+ direction (cospip<0,cospim>0)",
50, 0.0, EvtConst::twoPi );
TH1F* chinn = new TH1F( "h9",
"chi pi+ to pi- in D+ direction (cospip<0,cospim<0)",
50, 0.0, EvtConst::twoPi );
TH1F* chinnnn = new TH1F(
"h10", "chi pi+ to pi- in D+ direction (cospip<-0.5,cospim<-0.5)", 50,
0.0, EvtConst::twoPi );
int count = 1;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/SVVHELAMP.DEC" );
myGenerator.readUDecay( udecay_name );
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
do {
EvtVector4R p_init( EvtPDL::getMass( B0 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( B0, p_init );
root_part->setDiagonalSpinDensity();
myGenerator.generateDecay( root_part );
EvtParticle *p_b, *p_dstp, *p_dstm, *p_pip, *p_pim, *p_d0, *p_d0b;
EvtVector4R p4_b, p4_dstp, p4_dstm, p4_pip, p4_pim, p4_d0, p4_d0b;
p_b = root_part;
p_dstp = p_b->getDaug( 0 );
p_dstm = p_b->getDaug( 1 );
p_pip = p_dstp->getDaug( 1 );
p_pim = p_dstm->getDaug( 1 );
p_d0 = p_dstp->getDaug( 0 );
p_d0b = p_dstm->getDaug( 0 );
p4_b = p_b->getP4Lab();
p4_dstp = p_dstp->getP4Lab();
p4_dstm = p_dstm->getP4Lab();
p4_pip = p_pip->getP4Lab();
p4_pim = p_pim->getP4Lab();
p4_d0 = p_d0->getP4Lab();
p4_d0b = p_d0b->getP4Lab();
double costhpip = EvtDecayAngle( p4_b, p4_pip + p4_d0, p4_pip );
double costhpim = EvtDecayAngle( p4_b, p4_pim + p4_d0b, p4_pim );
double chiang = EvtDecayAngleChi( p4_b, p4_pip, p4_d0, p4_pim, p4_d0b );
cospip->Fill( costhpip );
cospim->Fill( costhpim );
chi->Fill( chiang );
if ( costhpip > 0 )
chicospipp->Fill( chiang );
if ( costhpip < 0 )
chicospipn->Fill( chiang );
if ( costhpip > 0 && costhpim > 0 )
chipp->Fill( chiang );
if ( costhpip > 0 && costhpim < 0 )
chipn->Fill( chiang );
if ( costhpip < 0 && costhpim > 0 )
chinp->Fill( chiang );
if ( costhpip < 0 && costhpim < 0 )
chinn->Fill( chiang );
if ( costhpip < -0.5 && costhpim < -0.5 )
chinnnn->Fill( chiang );
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runPartWave( int nevent, EvtGen& myGenerator )
{
TFile* file = new TFile( "partwave.root", "RECREATE" );
TH1F* cospip = new TH1F( "h1", "cos theta pi+", 50, -1.0, 1.0 );
TH1F* cospim = new TH1F( "h2", "cos theta pi-", 50, -1.0, 1.0 );
TH1F* chi = new TH1F( "h3", "chi pi+ to pi- in D+ direction", 50, 0.0,
EvtConst::twoPi );
TH1F* chicospipp = new TH1F( "h4",
"chi pi+ to pi- in D+ direction (cospip>0)",
50, 0.0, EvtConst::twoPi );
TH1F* chicospipn = new TH1F( "h5", "chi pi+ to pi- in D+ direction (cospip<0",
50, 0.0, EvtConst::twoPi );
TH1F* chipp = new TH1F( "h6",
"chi pi+ to pi- in D+ direction (cospip>0,cospim>0)",
50, 0.0, EvtConst::twoPi );
TH1F* chipn = new TH1F( "h7",
"chi pi+ to pi- in D+ direction (cospip>0,cospim<0)",
50, 0.0, EvtConst::twoPi );
TH1F* chinp = new TH1F( "h8",
"chi pi+ to pi- in D+ direction (cospip<0,cospim>0)",
50, 0.0, EvtConst::twoPi );
TH1F* chinn = new TH1F( "h9",
"chi pi+ to pi- in D+ direction (cospip<0,cospim<0)",
50, 0.0, EvtConst::twoPi );
TH1F* chinnnn = new TH1F(
"h10", "chi pi+ to pi- in D+ direction (cospip<-0.5,cospim<-0.5)", 50,
0.0, EvtConst::twoPi );
int count = 1;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/PARTWAVE.DEC" );
myGenerator.readUDecay( udecay_name );
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
do {
EvtVector4R p_init( EvtPDL::getMass( B0 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( B0, p_init );
root_part->setDiagonalSpinDensity();
myGenerator.generateDecay( root_part );
EvtParticle *p_b, *p_dstp, *p_dstm, *p_pip, *p_pim, *p_d0, *p_d0b;
EvtVector4R p4_b, p4_dstp, p4_dstm, p4_pip, p4_pim, p4_d0, p4_d0b;
p_b = root_part;
p_dstp = p_b->getDaug( 0 );
p_dstm = p_b->getDaug( 1 );
p_pip = p_dstp->getDaug( 1 );
p_pim = p_dstm->getDaug( 1 );
p_d0 = p_dstp->getDaug( 0 );
p_d0b = p_dstm->getDaug( 0 );
p4_b = p_b->getP4Lab();
p4_dstp = p_dstp->getP4Lab();
p4_dstm = p_dstm->getP4Lab();
p4_pip = p_pip->getP4Lab();
p4_pim = p_pim->getP4Lab();
p4_d0 = p_d0->getP4Lab();
p4_d0b = p_d0b->getP4Lab();
double costhpip = EvtDecayAngle( p4_b, p4_pip + p4_d0, p4_pip );
double costhpim = EvtDecayAngle( p4_b, p4_pim + p4_d0b, p4_pim );
double chiang = EvtDecayAngleChi( p4_b, p4_pip, p4_d0, p4_pim, p4_d0b );
cospip->Fill( costhpip );
cospim->Fill( costhpim );
chi->Fill( chiang );
if ( costhpip > 0 )
chicospipp->Fill( chiang );
if ( costhpip < 0 )
chicospipn->Fill( chiang );
if ( costhpip > 0 && costhpim > 0 )
chipp->Fill( chiang );
if ( costhpip > 0 && costhpim < 0 )
chipn->Fill( chiang );
if ( costhpip < 0 && costhpim > 0 )
chinp->Fill( chiang );
if ( costhpip < 0 && costhpim < 0 )
chinn->Fill( chiang );
if ( costhpip < -0.5 && costhpim < -0.5 )
chinnnn->Fill( chiang );
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runPartWave2( int nevent, EvtGen& myGenerator )
{
TFile file( "partwave2.root", "RECREATE" );
TH1F* cthetapi = new TH1F( "h1", "cos theta pi", 50, -1.0, 1.0 );
TH1F* cthetapi2 = new TH1F( "h2", "cos theta pi (|cosrho|<0.1)", 50, -1.0,
1.0 );
TH1F* cthetan = new TH1F( "h3", "cos thetan", 50, -1.0, 1.0 );
//TH1F* cthetan2 = new TH1F("h4","cos thetan costhetapi>0 ",
// 50,-1.0,1.0);
TH1F* cthetarho = new TH1F( "h4", "cos thetarho ", 50, -1.0, 1.0 );
int count = 1;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/PARTWAVE2.DEC" );
myGenerator.readUDecay( udecay_name );
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
do {
EvtVector4R p_init( EvtPDL::getMass( B0 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( B0, p_init );
root_part->setDiagonalSpinDensity();
myGenerator.generateDecay( root_part );
EvtParticle *p_b, *p_jpsi, *p_rho, *p_pi1, *p_pi2;
EvtVector4R p4_b, p4_jpsi, p4_rho, p4_pi1, p4_pi2;
p_b = root_part;
p_jpsi = root_part->getDaug( 0 );
p_rho = nullptr;
if ( p_jpsi->getDaug( 0 )->getNDaug() == 2 ) {
p_rho = p_jpsi->getDaug( 0 );
}
if ( p_jpsi->getDaug( 1 )->getNDaug() == 2 ) {
p_rho = p_jpsi->getDaug( 1 );
}
assert( p_rho != 0 );
p_pi1 = p_rho->getDaug( 0 );
p_pi2 = p_rho->getDaug( 1 );
p4_b = p_b->getP4Lab();
p4_jpsi = p_jpsi->getP4Lab();
p4_rho = p_rho->getP4Lab();
p4_pi1 = p_pi1->getP4Lab();
p4_pi2 = p_pi2->getP4Lab();
double costhetan = EvtDecayPlaneNormalAngle( p4_b, p4_jpsi, p4_pi1,
p4_pi2 );
//EvtGenReport(EVTGEN_INFO,"EvtGen") << "costhetan:"<<costhetan<<std::endl;
cthetan->Fill( costhetan );
double costhpi = EvtDecayAngle( p4_jpsi, p4_rho, p4_pi1 );
double costhrho = EvtDecayAngle( p4_b, p4_jpsi, p4_rho );
//EvtGenReport(EVTGEN_INFO,"EvtGen") << "costhetarho:"<<costhrho<<std::endl;
cthetarho->Fill( costhrho );
//if (((p4_rho.get(3)/p4_rho.d3mag()))<-0.95) cthetan2->Fill( costhetan );
cthetapi->Fill( costhpi );
if ( ( p4_rho.get( 3 ) / p4_rho.d3mag() ) > 0.9 ) {
cthetapi2->Fill( costhpi );
}
root_part->deleteTree();
} while ( count++ < nevent );
file.Write();
file.Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runTwoBody( int nevent, EvtGen& myGenerator, std::string decFile,
std::string rootFile )
{
TFile* file = new TFile( rootFile.c_str(), "RECREATE" );
int count = 0;
myGenerator.readUDecay( decFile.c_str() );
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
vector<TH1F*> histograms;
do {
EvtVector4R p_init( EvtPDL::getMass( B0 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( B0, p_init );
root_part->setDiagonalSpinDensity();
myGenerator.generateDecay( root_part );
//root_part->printTree();
myGenerator.generateDecay( root_part );
int nhist = 0;
EvtParticle* p = root_part;
do {
int nDaug = p->getNDaug();
if ( !( nDaug == 0 || nDaug == 2 ) ) {
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "nDaug=" << nDaug << " but can only handle 0 or 2!"
<< std::endl;
abort();
}
if ( nDaug == 2 ) {
if ( p->getParent() == nullptr ) {
EvtVector4R p4 = p->getDaug( 0 )->getP4();
double ctheta = p4.get( 3 ) / p4.d3mag();
double phi = atan2( p4.get( 2 ), p4.get( 1 ) );
if ( count == 0 ) {
histograms.push_back(
new TH1F( "h1", "cos theta", 50, -1.0, 1.0 ) );
histograms.push_back( new TH1F(
"h2", "phi", 50, -EvtConst::pi, EvtConst::pi ) );
}
histograms[nhist++]->Fill( ctheta );
histograms[nhist++]->Fill( phi );
} else {
double ctheta = EvtDecayAngle( p->getParent()->getP4Lab(),
p->getP4Lab(),
p->getDaug( 0 )->getP4Lab() );
if ( count == 0 ) {
// char* tmp=new char[10];
// std::ostrstream strm(tmp,9);
// strm << (nhist+1) << '\0'<< std::endl;
// histograms.push_back(new TH1F(TString("h")+tmp,TString("cos theta")+tmp,50,-1.0,1.0));
std::ostringstream strm;
strm << ( nhist + 1 );
histograms.push_back(
new TH1F( TString( "h" ) + strm.str().c_str(),
TString( "cos theta" ) + strm.str().c_str(),
50, -1.0, 1.0 ) );
}
histograms[nhist++]->Fill( ctheta );
if ( p->getDaug( 0 )->getNDaug() == 2 ) {
double costhetan = EvtDecayPlaneNormalAngle(
p->getParent()->getP4Lab(), p->getP4Lab(),
p->getDaug( 0 )->getDaug( 0 )->getP4Lab(),
p->getDaug( 0 )->getDaug( 1 )->getP4Lab() );
if ( count == 0 ) {
// char* tmp=new char[10];
// std::ostrstream strm(tmp,9);
// strm << (nhist+1) << '\0'<< std::endl;
// histograms.push_back(new TH1F(TString("h")+tmp,TString("cos thetan")+tmp,50,-1.0,1.0));
std::ostringstream strm;
strm << ( nhist + 1 );
histograms.push_back( new TH1F(
TString( "h" ) + strm.str().c_str(),
TString( "cos theta" ) + strm.str().c_str(), 50,
-1.0, 1.0 ) );
}
histograms[nhist++]->Fill( costhetan );
}
if ( p->getDaug( 1 )->getNDaug() == 2 ) {
double costhetan = EvtDecayPlaneNormalAngle(
p->getParent()->getP4Lab(), p->getP4Lab(),
p->getDaug( 1 )->getDaug( 0 )->getP4Lab(),
p->getDaug( 1 )->getDaug( 1 )->getP4Lab() );
if ( count == 0 ) {
// char* tmp=new char[10];
// std::ostrstream strm(tmp,9);
// strm << (nhist+1) << '\0'<< std::endl;
// histograms.push_back(new TH1F(TString("h")+tmp,TString("cos thetan")+tmp,50,-1.0,1.0));
std::ostringstream strm;
strm << ( nhist + 1 );
histograms.push_back( new TH1F(
TString( "h" ) + strm.str().c_str(),
TString( "cos theta" ) + strm.str().c_str(), 50,
-1.0, 1.0 ) );
}
histograms[nhist++]->Fill( costhetan );
}
}
}
p = p->nextIter( root_part );
} while ( p != nullptr );
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runPiPi( int nevent, EvtGen& myGenerator )
{
std::ofstream outmix;
outmix.open( "pipi.dat" );
TFile* file = new TFile( "pipi.root", "RECREATE" );
TH1F* tB0Hist = new TH1F( "h1", "dt in B->pipi with B0 tag", 50, -5.0, 5.0 );
TH1F* tB0BHist = new TH1F( "h2", "dt in B->pipi with B0B tag", 50, -5.0, 5.0 );
TH1F* tB0 = new TH1F( "h3", "t in B->pipi for B0 tag", 25, 0.0, 5.0 );
TH1F* tB0B = new TH1F( "h4", "t in B->pipi for B0B tag", 25, 0.0, 5.0 );
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/PIPI.DEC" );
//EvtGen myGenerator(decay_name,pdttable_name,myRandomEngine);
myGenerator.readUDecay( udecay_name );
EvtParticle *bcp, *btag;
int count = 1;
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
static EvtId B0B = EvtPDL::getId( std::string( "anti-B0" ) );
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
if ( root_part->getDaug( 0 )->getNDaug() == 3 ) {
btag = root_part->getDaug( 0 );
bcp = root_part->getDaug( 1 );
} else {
bcp = root_part->getDaug( 0 );
btag = root_part->getDaug( 1 );
}
EvtId tag; //cp tag
if ( btag->getId() == B0B ) {
tag = B0;
} else {
tag = B0B;
}
// int a1=bcp->getDaug(0)->getId();
if ( tag == B0 )
tB0Hist->Fill( bcp->getLifetime() - btag->getLifetime() );
if ( tag == B0 )
tB0->Fill( btag->getLifetime() );
if ( tag == B0B )
tB0BHist->Fill( bcp->getLifetime() - btag->getLifetime() );
if ( tag == B0B )
tB0B->Fill( btag->getLifetime() );
outmix << bcp->getLifetime() << " " << btag->getLifetime() << " "
<< tag.getId() << std::endl;
root_part->deleteTree();
} while ( count++ < nevent );
outmix.close();
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runA1Pi( int nevent, EvtGen& myGenerator )
{
std::ofstream outmix;
outmix.open( "a1pi.dat" );
int count = 1;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/A1PI.DEC" );
myGenerator.readUDecay( udecay_name );
EvtParticle *bcp, *btag;
EvtParticle *a1, *rho0, *pi1, *pi2, *pi3, *pi4;
EvtVector4R p4bcp, p4a1, p4rho0, p4pi1, p4pi2, p4pi3, p4pi4;
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
static EvtId B0B = EvtPDL::getId( std::string( "anti-B0" ) );
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
if ( root_part->getDaug( 0 )->getNDaug() == 3 ) {
btag = root_part->getDaug( 0 );
bcp = root_part->getDaug( 1 );
} else {
bcp = root_part->getDaug( 0 );
btag = root_part->getDaug( 1 );
}
a1 = bcp->getDaug( 0 );
pi1 = bcp->getDaug( 1 );
rho0 = a1->getDaug( 0 );
pi2 = a1->getDaug( 1 );
pi3 = rho0->getDaug( 0 );
pi4 = rho0->getDaug( 1 );
p4bcp = bcp->getP4Lab();
p4a1 = a1->getP4Lab();
p4pi1 = pi1->getP4Lab();
p4rho0 = rho0->getP4Lab();
p4pi2 = pi2->getP4Lab();
p4pi3 = pi3->getP4Lab();
p4pi4 = pi4->getP4Lab();
EvtId tag; //cp tag
if ( btag->getId() == B0B ) {
tag = B0;
} else {
tag = B0B;
}
outmix << bcp->getLifetime() << " " << btag->getLifetime() << " "
<< EvtDecayAngle( p4bcp, p4rho0 + p4pi2, p4rho0 ) << " "
<< EvtDecayAngle( p4a1, p4pi3 + p4pi4, p4pi3 ) << " "
<< EvtPDL::getStdHep( tag ) << std::endl;
root_part->deleteTree();
} while ( count++ < nevent );
outmix.close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runCPTest( int nevent, EvtGen& myGenerator )
{
std::ofstream outmix;
outmix.open( "cptest.dat" );
int count = 1;
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
static EvtId B0B = EvtPDL::getId( std::string( "anti-B0" ) );
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/CPTEST.DEC" );
//EvtGen myGenerator(decay_name,pdttable_name,myRandomEngine);
myGenerator.readUDecay( udecay_name );
EvtParticle *bcp, *btag;
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
if ( root_part->getDaug( 0 )->getNDaug() == 3 ) {
btag = root_part->getDaug( 0 );
bcp = root_part->getDaug( 1 );
} else {
bcp = root_part->getDaug( 0 );
btag = root_part->getDaug( 1 );
}
EvtId tag; //cp tag
if ( btag->getId() == B0B ) {
tag = B0;
} else {
tag = B0B;
}
outmix << bcp->getLifetime() << " " << btag->getLifetime() << " "
<< tag.getId() << std::endl;
root_part->deleteTree();
} while ( count++ < nevent );
outmix.close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runBtoXsgamma( int nevent, EvtGen& myGenerator )
{
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
TFile* file = new TFile( "BtoXsgamma.root", "RECREATE" );
int count = 1;
EvtParticle* root_part;
EvtVectorParticle* vector_part;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/BTOXSGAMMA.DEC" );
myGenerator.readUDecay( udecay_name );
// Plot kinematics for b->s,gamma
int strangeid, antistrangeid;
int Bmulti, bId1a, bId1b, bId2a, bId2b, b1Id, b2Id;
do {
vector_part = new EvtVectorParticle;
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
vector_part->init( UPS4, p_init );
root_part = (EvtParticle*)vector_part;
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
EvtParticle* B1 = root_part->getDaug( 0 );
Bmulti = B1->getNDaug();
if ( Bmulti == 1 )
B1 = B1->getDaug( 0 );
EvtId BId1a = B1->getDaug( 0 )->getId();
bId1a = EvtPDL::getStdHep( BId1a );
EvtId BId1b = B1->getDaug( 1 )->getId();
bId1b = EvtPDL::getStdHep( BId1b );
if ( Bmulti == 1 )
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "B1"
<< " bId1a=" << bId1a << " bId1b=" << bId1b
<< " ndaug=" << B1->getNDaug()
<< " Bid=" << EvtPDL::getStdHep( B1->getId() ) << std::endl;
EvtParticle* B2 = root_part->getDaug( 1 );
Bmulti = B2->getNDaug();
if ( Bmulti == 1 )
B2 = B2->getDaug( 0 ); // B has a daughter which is a string
EvtId BId2a = B2->getDaug( 0 )->getId();
bId2a = EvtPDL::getStdHep( BId2a );
EvtId BId2b = B2->getDaug( 1 )->getId();
bId2b = EvtPDL::getStdHep( BId2b );
if ( Bmulti == 1 )
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "B2"
<< " bId2a=" << bId2a << " bId2b=" << bId2b
<< " ndaug=" << B2->getNDaug()
<< " Bid=" << EvtPDL::getStdHep( B2->getId() ) << std::endl;
EvtId B1Id = B1->getId();
b1Id = EvtPDL::getStdHep( B1Id );
EvtId B2Id = B2->getId();
b2Id = EvtPDL::getStdHep( B2Id );
strangeid = 0;
antistrangeid = 0;
if ( ( b1Id == 511 ) || ( b1Id == -511 ) || ( b2Id == 511 ) ||
( b2Id == -511 ) ) {
strangeid = 30343;
antistrangeid = -30343;
} else if ( ( b1Id == 521 ) || ( b1Id == -521 ) || ( b2Id == 521 ) ||
( b2Id == -521 ) ) {
strangeid = 30353;
antistrangeid = -30353;
} else if ( ( b1Id == 531 ) || ( b1Id == -531 ) || ( b2Id == 531 ) ||
( b2Id == -531 ) ) {
strangeid = 30363;
antistrangeid = -30363;
}
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "bId1a " << bId1a << " bId1b " << bId1b << " bId2a " << bId2a
<< " bId2b " << bId2b << " for event " << count << std::endl;
EvtParticle* Bpeng = nullptr;
//int bnum=0;
int pengcount = 0;
if ( ( ( bId1a == strangeid ) && ( bId1b == 22 ) ) ||
( ( bId1a == antistrangeid ) && ( bId1b == 22 ) ) ||
( ( bId1b == strangeid ) && ( bId1a == 22 ) ) ||
( ( bId1b == antistrangeid ) && ( bId1a == 22 ) ) ) {
Bpeng = B1;
//bnum=1;
pengcount++;
}
if ( ( ( bId2a == strangeid ) && ( bId2b == 22 ) ) ||
( ( bId2a == antistrangeid ) && ( bId2b == 22 ) ) ||
( ( bId2b == strangeid ) && ( bId2a == 22 ) ) ||
( ( bId2b == antistrangeid ) && ( bId2a == 22 ) ) ) {
Bpeng = B2;
//bnum=2;
pengcount++;
}
if ( pengcount == 0 ) {
Bpeng = B1;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "No penguin decay for event " << count << std::endl;
//bnum=0;
} else if ( pengcount == 2 ) {
Bpeng = B1;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Two penguin decays in event " << count << std::endl;
//bnum=0;
}
Bmulti = Bpeng->getNDaug();
EvtParticle* Xs = Bpeng->getDaug( 0 );
//EvtParticle *gam = Bpeng->getDaug(1);
//EvtVector4R p4Xs = Xs->getP4Lab();
//EvtId BId = Bpeng->getId();
//EvtId XsId = Xs->getId();
int Xsmulti = Xs->getNDaug();
//EvtId gamId = gam->getId();
//int bId = EvtPDL::getStdHep(BId);
//int XId = EvtPDL::getStdHep(XsId);
//int gId = EvtPDL::getStdHep(gamId);
//float XsMass = p4Xs.mass();
//double gmass = p4gam.mass();
//double genergy = p4gam.get(0);
// debug stuff: EvtGenReport(EVTGEN_INFO,"EvtGen") << "bnum=" << bnum << " pengcount=" << pengcount << " bId=" << bId << " Bmulti=" << Bmulti << " XsId=" << XId << " gId=" << gId << std::endl;
//need to change this to root...I don't have the energy now
//tuple->column("bnum", bnum);
//tuple->column("pengcount", pengcount);
//tuple->column("bId", bId);
//tuple->column("Bmulti", Bmulti);
//tuple->column("XsId", XId);
//tuple->column("gId", gId);
//tuple->column("XsMass", XsMass);
//tuple->column("Xsmulti", Xsmulti, 0,"Xs", HTRange<int>(0,200));
//tuple->column("gmass", gmass);
//tuple->column("genergy", genergy);
//HTValOrderedVector<int> XDaugId, XDaugNephewId;
//HTValOrderedVector<float> XsDaugMass, XsDaugNephewMass;
int nTot( 0 );
for ( int i = 0; i < Xsmulti; i++ ) {
EvtParticle* XsDaug = Xs->getDaug( i );
//EvtVector4R p4XsDaug = XsDaug->getP4Lab();
EvtId XsDaugId = XsDaug->getId();
//XDaugId.push_back(EvtPDL::getStdHep(XsDaugId));
//XsDaugMass.push_back( p4XsDaug.mass());
int Daumulti = XsDaug->getNDaug();
if ( abs( EvtPDL::getStdHep( XsDaugId ) ) == 321 ||
EvtPDL::getStdHep( XsDaugId ) == 310 ||
EvtPDL::getStdHep( XsDaugId ) == 111 ||
abs( EvtPDL::getStdHep( XsDaugId ) ) == 211 || Daumulti == 0 ) {
nTot++;
//EvtVector4R p4XsDaugNephew = XsDaug->getP4Lab();
//EvtId XsDaugNephewId =XsDaug->getId() ;
//XDaugNephewId.push_back(EvtPDL::getStdHep(XsDaugId));
//XsDaugNephewMass.push_back( p4XsDaug.mass());
} else if ( Daumulti != 0 ) {
for ( int k = 0; k < Daumulti; k++ ) {
EvtParticle* XsDaugNephew = XsDaug->getDaug( k );
EvtId XsDaugNephewId = XsDaugNephew->getId();
int Nephmulti = XsDaugNephew->getNDaug();
if ( Nephmulti == 0 ||
abs( EvtPDL::getStdHep( XsDaugNephewId ) ) == 321 ||
EvtPDL::getStdHep( XsDaugNephewId ) == 310 ||
EvtPDL::getStdHep( XsDaugNephewId ) == 111 ||
abs( EvtPDL::getStdHep( XsDaugNephewId ) ) == 211 ) {
nTot++;
//EvtVector4R p4XsDaugNephew = XsDaugNephew->getP4Lab();
//XDaugNephewId.push_back(EvtPDL::getStdHep(XsDaugNephewId));
//XsDaugNephewMass.push_back( p4XsDaugNephew.mass());
} else {
for ( int g = 0; g < Nephmulti; g++ ) {
nTot++;
//EvtParticle *XsDaugNephewNephew = XsDaugNephew->getDaug(g);
//EvtVector4R p4XsDaugNephewNephew = XsDaugNephewNephew->getP4Lab();
//EvtId XsDaugNephewNephewId = XsDaugNephewNephew->getId();
//XDaugNephewId.push_back(EvtPDL::getStdHep(XsDaugNephewNephewId));
//XsDaugNephewMass.push_back( p4XsDaugNephewNephew.mass());
}
}
}
}
}
//tuple->column("XsDaugId", XDaugId,"Xsmulti", 0, "Xs");
//tuple->column("XsDaugMass", XsDaugMass,"Xsmulti", 0, "Xs");
//tuple->column("nTot", nTot, 0,"nTot", HTRange<int>(0,200));
//tuple->column("XsDaugNephewId", XDaugNephewId,"nTot", 0, "nTot");
//tuple->column("XsDaugNephewMass", XsDaugNephewMass,"nTot", 0, "nTot");
//tuple->dumpData();
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "End EvtGen. Ran on " << nevent << " events." << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runBtoK1273gamma( int nevent, EvtGen& myGenerator )
{
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
TFile* file = new TFile( "BtoK1273gamma.root", "RECREATE" );
//HepTuple *tuple = hfile.ntuple("BtoK1273gamma", 1);
int count = 1;
EvtParticle* root_part;
EvtVectorParticle* vector_part;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/BTOK1273GAMMA.DEC" );
myGenerator.readUDecay( udecay_name );
// Plot kinematics for b->s,gamma
int strangeid, antistrangeid;
int Bmulti, bId1a, bId1b, bId2a, bId2b, b1Id, b2Id;
do {
vector_part = new EvtVectorParticle;
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
vector_part->init( UPS4, p_init );
root_part = (EvtParticle*)vector_part;
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
EvtParticle* B1 = root_part->getDaug( 0 );
Bmulti = B1->getNDaug();
if ( Bmulti == 1 )
B1 = B1->getDaug( 0 );
EvtId BId1a = B1->getDaug( 0 )->getId();
bId1a = EvtPDL::getStdHep( BId1a );
EvtId BId1b = B1->getDaug( 1 )->getId();
bId1b = EvtPDL::getStdHep( BId1b );
if ( Bmulti == 1 )
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "B1"
<< " bId1a=" << bId1a << " bId1b=" << bId1b
<< " ndaug=" << B1->getNDaug()
<< " Bid=" << EvtPDL::getStdHep( B1->getId() ) << std::endl;
EvtParticle* B2 = root_part->getDaug( 1 );
Bmulti = B2->getNDaug();
if ( Bmulti == 1 )
B2 = B2->getDaug( 0 ); // B has a daughter which is a string
EvtId BId2a = B2->getDaug( 0 )->getId();
bId2a = EvtPDL::getStdHep( BId2a );
EvtId BId2b = B2->getDaug( 1 )->getId();
bId2b = EvtPDL::getStdHep( BId2b );
if ( Bmulti == 1 )
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "B2"
<< " bId2a=" << bId2a << " bId2b=" << bId2b
<< " ndaug=" << B2->getNDaug()
<< " Bid=" << EvtPDL::getStdHep( B2->getId() ) << std::endl;
EvtId B1Id = B1->getId();
b1Id = EvtPDL::getStdHep( B1Id );
EvtId B2Id = B2->getId();
b2Id = EvtPDL::getStdHep( B2Id );
strangeid = 0;
antistrangeid = 0;
if ( ( b1Id == 511 ) || ( b1Id == -511 ) || ( b2Id == 511 ) ||
( b2Id == -511 ) ) {
strangeid = 10313;
antistrangeid = -10313;
} else if ( ( b1Id == 521 ) || ( b1Id == -521 ) || ( b2Id == 521 ) ||
( b2Id == -521 ) ) {
strangeid = 10323;
antistrangeid = -10323;
}
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "bId1a " << bId1a << " bId1b " << bId1b << " bId2a " << bId2a
<< " bId2b " << bId2b << " for event " << count << std::endl;
EvtParticle* Bpeng = nullptr;
//int bnum=0;
int pengcount = 0;
if ( ( ( bId1a == strangeid ) && ( bId1b == 22 ) ) ||
( ( bId1a == antistrangeid ) && ( bId1b == 22 ) ) ||
( ( bId1b == strangeid ) && ( bId1a == 22 ) ) ||
( ( bId1b == antistrangeid ) && ( bId1a == 22 ) ) ) {
Bpeng = B1;
//bnum=1;
pengcount++;
}
if ( ( ( bId2a == strangeid ) && ( bId2b == 22 ) ) ||
( ( bId2a == antistrangeid ) && ( bId2b == 22 ) ) ||
( ( bId2b == strangeid ) && ( bId2a == 22 ) ) ||
( ( bId2b == antistrangeid ) && ( bId2a == 22 ) ) ) {
Bpeng = B2;
//bnum=2;
pengcount++;
}
if ( pengcount == 0 ) {
Bpeng = B1;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "No penguin decay for event " << count << std::endl;
//bnum=0;
} else if ( pengcount == 2 ) {
Bpeng = B1;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Two penguin decays in event " << count << std::endl;
//bnum=0;
}
Bmulti = Bpeng->getNDaug();
//EvtParticle *Ks = Bpeng->getDaug(0);
//EvtParticle *gam = Bpeng->getDaug(1);
//EvtVector4R p4Ks = Ks->getP4Lab();
//const EvtVector4R& p4gam = gam->getP4(); // gamma 4-mom in parent's rest frame
//EvtId BId = Bpeng->getId();
//EvtId KsId = Ks->getId();
//int Ksmulti = Ks->getNDaug();
//EvtId gamId = gam->getId();
//int bId = EvtPDL::getStdHep(BId);
//int XId = EvtPDL::getStdHep(KsId);
//int gId = EvtPDL::getStdHep(gamId);
//double KsMass = p4Ks.mass();
//double gmass = p4gam.mass();
//double genergy = p4gam.get(0);
// debug stuff: EvtGenReport(EVTGEN_INFO,"EvtGen") << "bnum=" << bnum << " pengcount=" << pengcount << " bId=" << bId << " Bmulti=" << Bmulti << " KsId=" << XId << " gId=" << gId << std::endl;
//tuple->column("bnum", bnum);
//tuple->column("pengcount", pengcount);
//tuple->column("bId", bId);
//tuple->column("Bmulti", Bmulti);
//tuple->column("KsId", XId);
//tuple->column("gId", gId);
//tuple->column("KsMass", KsMass);
//tuple->column("Ksmulti", Ksmulti);
//tuple->column("gmass", gmass);
//tuple->column("genergy", genergy);
//for(int i=0;i<Ksmulti;i++){
//EvtParticle *KsDaug = Ks->getDaug(i);
//EvtVector4R p4KsDaug = KsDaug->getP4Lab();
//EvtId KsDaugId = KsDaug->getId();
//int XDaugId = EvtPDL::getStdHep(KsDaugId);
//double KsDaugMass = p4KsDaug.mass();
//tuple->column("KsDaugId", XDaugId);
//tuple->column("KsDaugMass", KsDaugMass);
//}
//tuple->dumpData();
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "End EvtGen. Ran on " << nevent << " events." << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runCheckRotBoost()
{
EvtDiracSpinor sp1, sp2;
//Generate ryd/lange random spinors.
sp1.set( EvtComplex( 1.0, -2.0 ), EvtComplex( 3.0, 1.0 ),
EvtComplex( -4.5, 0.5 ), EvtComplex( 0.2, -0.5 ) );
sp2.set( EvtComplex( 0.1, -1.0 ), EvtComplex( 1.2, -0.5 ),
EvtComplex( 3.6, 1.8 ), EvtComplex( -0.2, -0.6 ) );
EvtComplex s = EvtLeptonSCurrent( sp1, sp2 );
EvtComplex p = EvtLeptonPCurrent( sp1, sp2 );
EvtVector4C a = EvtLeptonACurrent( sp1, sp2 );
EvtVector4C v = EvtLeptonVCurrent( sp1, sp2 );
EvtVector4C va = EvtLeptonVACurrent( sp1, sp2 );
EvtTensor4C t = EvtLeptonTCurrent( sp1, sp2 );
//start with boosts...
EvtVector4R ranBoost( 2.0, 0.4, -0.8, 0.3 );
EvtDiracSpinor sp1Boost = boostTo( sp1, ranBoost );
EvtDiracSpinor sp2Boost = boostTo( sp2, ranBoost );
EvtComplex sBoost = EvtLeptonSCurrent( sp1Boost, sp2Boost );
EvtComplex pBoost = EvtLeptonPCurrent( sp1Boost, sp2Boost );
EvtVector4C aBoost = EvtLeptonACurrent( sp1Boost, sp2Boost );
EvtVector4C vBoost = EvtLeptonVCurrent( sp1Boost, sp2Boost );
EvtVector4C vaBoost = EvtLeptonVACurrent( sp1Boost, sp2Boost );
EvtTensor4C tBoost = EvtLeptonTCurrent( sp1Boost, sp2Boost );
EvtVector4C aDirBoost = boostTo( a, ranBoost );
EvtVector4C vDirBoost = boostTo( v, ranBoost );
EvtVector4C vaDirBoost = boostTo( va, ranBoost );
EvtTensor4C tDirBoost( t );
tDirBoost.applyBoostTo( ranBoost );
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Comparing after doing a random boost" << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Scalar " << s << " " << sBoost << s - sBoost << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "PseudoScalar " << p << " " << pBoost << p - pBoost << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "AxialVector " << aDirBoost << " " << aBoost << aDirBoost - aBoost
<< std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Vector " << vDirBoost << " " << vBoost << vDirBoost - vBoost
<< std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "V-A " << vaDirBoost << " " << vaBoost << vaDirBoost - vaBoost
<< std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Tensor " << tDirBoost << " " << tBoost << tDirBoost - tBoost
<< std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Done comparing after doing a random boost" << std::endl;
//Now do rotations...
//start with boosts...
double alpha = 0.4;
double beta = -0.61;
double gamma = 3.0;
EvtDiracSpinor sp1Rot = rotateEuler( sp1, alpha, beta, gamma );
EvtDiracSpinor sp2Rot = rotateEuler( sp2, alpha, beta, gamma );
EvtComplex sRot = EvtLeptonSCurrent( sp1Rot, sp2Rot );
EvtComplex pRot = EvtLeptonPCurrent( sp1Rot, sp2Rot );
EvtVector4C aRot = EvtLeptonACurrent( sp1Rot, sp2Rot );
EvtVector4C vRot = EvtLeptonVCurrent( sp1Rot, sp2Rot );
EvtVector4C vaRot = EvtLeptonVACurrent( sp1Rot, sp2Rot );
EvtTensor4C tRot = EvtLeptonTCurrent( sp1Rot, sp2Rot );
EvtVector4C aDirRot( a );
EvtVector4C vDirRot( v );
EvtVector4C vaDirRot( va );
EvtTensor4C tDirRot( t );
aDirRot.applyRotateEuler( alpha, beta, gamma );
vDirRot.applyRotateEuler( alpha, beta, gamma );
vaDirRot.applyRotateEuler( alpha, beta, gamma );
tDirRot.applyRotateEuler( alpha, beta, gamma );
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Comparing after doing a random rotation" << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Scalar " << s << " " << sRot << s - sRot << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "PseudoScalar " << p << " " << pRot << p - pRot << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "AxialVector " << aDirRot << " "
<< aRot << aDirRot - aRot << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Vector " << vDirRot << " " << vRot << vDirRot - vRot << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "V-A " << vaDirRot << " " << vaRot << vaDirRot - vaRot << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Tensor " << tDirRot << " " << tRot << tDirRot - tRot << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Done comparing after doing a random rotation" << std::endl;
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
int countInclusive( std::string name, EvtParticle* root_part, TH1F* mom,
TH1F* mass )
{
EvtParticle* p = root_part;
int temp = 0;
EvtId searchFor = EvtPDL::getId( name );
do {
EvtId type = p->getId();
if ( type == searchFor ) {
temp += 1;
if ( mom )
mom->Fill( p->getP4Lab().d3mag() );
if ( mass )
mass->Fill( p->mass() );
//if ( theBs.contains(p->getParent()->getId()) ) {
//dirPsimom->Fill(p->getP4Lab().d3mag());
//}
//EvtGenReport(EVTGEN_INFO,"EvtGen") << "LANGE " << p->getP4Lab().d3mag() << " " << p->getP4Lab().get(3)/p->getP4Lab().d3mag() << std::endl;
}
p = p->nextIter( root_part );
} while ( p != nullptr );
return temp;
}
int countInclusiveSubTree( std::string name, EvtParticle* root_part,
EvtIdSet setIds, TH1F* /*mom*/ )
{
int temp = 0;
EvtParticle* p = root_part;
do {
if ( setIds.contains( p->getId() ) ) {
temp += countInclusive( name, p );
}
//p->printTree();
p = p->nextIter( root_part );
} while ( p != nullptr );
//EvtGenReport(EVTGEN_INFO,"EvtGen") << "done"<<std::endl;
return temp;
}
int countInclusiveParent( std::string name, EvtParticle* root_part,
EvtIdSet setIds, TH1F* mom )
{
EvtParticle* p = root_part;
int temp = 0;
EvtId searchFor = EvtPDL::getId( name );
do {
EvtId type = p->getId();
if ( type == searchFor ) {
if ( p->getParent() ) {
if ( setIds.contains( p->getParent()->getId() ) ) {
temp += 1;
if ( mom )
mom->Fill( p->getP4Lab().d3mag() );
}
}
}
p = p->nextIter( root_part );
} while ( p != nullptr );
return temp;
}
void runBMix( int nevent, EvtGen& myGenerator, std::string userFile,
std::string rootFile )
{
TFile* file = new TFile( rootFile.c_str(), "RECREATE" );
TH1F* b0_b0 = new TH1F( "h1", "dt B0-B0", 100, -15.0, 15.0 );
TH1F* b0b_b0b = new TH1F( "h2", "dt B0B-B0B", 100, -15.0, 15.0 );
TH1F* b0b_b0 = new TH1F( "h3", "dt B0B-B0", 100, -15.0, 15.0 );
TH1F* b0_b0b = new TH1F( "h4", "dt B0-B0B", 100, -15.0, 15.0 );
int count = 1;
myGenerator.readUDecay( userFile.c_str() );
EvtId b0 = EvtPDL::getId( "B0" );
EvtId b0b = EvtPDL::getId( "anti-B0" );
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
std::ofstream outmix;
TString outFileName( rootFile.c_str() );
outFileName.ReplaceAll( ".root", ".dat" );
outmix.open( outFileName.Data() );
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
EvtId id1 = root_part->getDaug( 0 )->getId();
EvtId id2 = root_part->getDaug( 1 )->getId();
double t1 = root_part->getDaug( 0 )->getLifetime();
double t2 = root_part->getDaug( 1 )->getLifetime();
double dt = ( t1 - t2 ) / ( 1e-12 * 3e11 );
if ( id1 == b0 && id2 == b0 ) {
b0_b0->Fill( dt );
outmix << dt << " 1" << std::endl;
}
if ( id1 == b0b && id2 == b0b ) {
b0b_b0b->Fill( dt );
outmix << dt << " 2" << std::endl;
}
if ( id1 == b0b && id2 == b0 ) {
b0b_b0->Fill( dt );
outmix << dt << " 0" << std::endl;
}
if ( id1 == b0 && id2 == b0b ) {
b0_b0b->Fill( dt );
outmix << dt << " 0" << std::endl;
}
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
outmix.close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runDDalitz( int nevent, EvtGen& myGenerator )
{
TFile* file = new TFile( "ddalitz.root", "RECREATE" );
TH2F* dalitz = new TH2F( "h1", "m^2!?[K-[p]+! vs m^2!?[K-[p]0!", 70, 0.0,
3.5, 70, 0.0, 3.5 );
TH2F* dalitz2 = new TH2F( "h5", "m^2!([p]^-![p]^0!) vs m^2!([K-[p]+!", 100,
0.0, 3.5, 100, 0.0, 2.0 );
TH1F* m12 = new TH1F( "h2", "m?[K-[p]+!", 100, 0.0, 3.0 );
TH1F* m13 = new TH1F( "h3", "m?[K-[p]0!", 100, 0.0, 3.0 );
TH1F* m23 = new TH1F( "h4", "m?[[p]+[p]0!", 100, 0.0, 2.0 );
int count;
myGenerator.readUDecay( "exampleFiles/DDALITZ.DEC" );
count = 1;
static EvtId D0 = EvtPDL::getId( std::string( "D0" ) );
std::ofstream outmix;
outmix.open( "ddalitz.dat" );
do {
EvtVector4R p_init( EvtPDL::getMass( D0 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( D0, p_init );
root_part->setDiagonalSpinDensity();
myGenerator.generateDecay( root_part );
EvtVector4R p1 = root_part->getDaug( 0 )->getP4Lab();
EvtVector4R p2 = root_part->getDaug( 1 )->getP4Lab();
EvtVector4R p3 = root_part->getDaug( 2 )->getP4Lab();
dalitz->Fill( ( p1 + p2 ).mass2(), ( p1 + p3 ).mass2(), 1.0 );
dalitz2->Fill( ( p1 + p2 ).mass2(), ( p2 + p3 ).mass2(), 1.0 );
m12->Fill( ( p1 + p2 ).mass2() );
m13->Fill( ( p1 + p3 ).mass2() );
m23->Fill( ( p2 + p3 ).mass2() );
outmix << ( p1 + p2 ).mass2() << " " << ( p2 + p3 ).mass2() << " "
<< ( p1 + p3 ).mass2() << std::endl;
root_part->deleteTree();
if ( count == nevent - 1 ) {
std::ofstream testi( "testi.dat" );
double val = m12->GetMean();
double errval = m12->GetMeanError();
testi << "evtgenlhc_test1 1 " << val << " " << errval
<< std::endl;
val = m23->GetMean();
errval = m23->GetMeanError();
testi << "evtgenlhc_test1 2 " << val << " " << errval
<< std::endl;
}
} while ( count++ < nevent );
file->Write();
file->Close();
outmix.close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runPiPiPi( int nevent, EvtGen& myGenerator )
{
std::ofstream outmix;
outmix.open( "pipipi.dat" );
int count;
EvtVector4R p4pip, p4pim, p4pi0;
myGenerator.readUDecay( "exampleFiles/PIPIPI.DEC" );
count = 1;
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
p4pip = root_part->getDaug( 0 )->getDaug( 0 )->getP4Lab();
p4pim = root_part->getDaug( 0 )->getDaug( 1 )->getP4Lab();
p4pi0 = root_part->getDaug( 0 )->getDaug( 2 )->getP4Lab();
outmix << root_part->getDaug( 0 )->getLifetime() << " "
<< root_part->getDaug( 1 )->getLifetime() << " ";
outmix << ( p4pip + p4pim ).mass2() << " " << ( p4pip + p4pi0 ).mass2()
<< std::endl;
root_part->deleteTree();
} while ( count++ < nevent );
outmix.close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runBHadronic( int nevent, EvtGen& myGenerator )
{
std::ofstream outmix;
outmix.open( "bhadronic.dat" );
int count;
myGenerator.readUDecay( "exampleFiles/BHADRONIC.DEC" );
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
count = 1;
do {
EvtVector4R p_init( EvtPDL::getMass( B0 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( B0, p_init );
root_part->setDiagonalSpinDensity();
myGenerator.generateDecay( root_part );
EvtParticle* p;
// root_part->printTree();
p = root_part;
do {
outmix << p->getId().getId() << " " << p->getP4Lab().d3mag()
<< std::endl;
p = p->nextIter();
} while ( p != nullptr );
root_part->deleteTree();
} while ( count++ < nevent );
outmix.close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runSingleB( int nevent, EvtGen& myGenerator )
{
int count;
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
count = 1;
do {
EvtVector4R p_init( EvtPDL::getMass( B0 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( B0, p_init );
root_part->setDiagonalSpinDensity();
myGenerator.generateDecay( root_part );
root_part->deleteTree();
} while ( count++ < nevent );
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runPiPiPiPi( int nevent, EvtGen& myGenerator )
{
std::ofstream outmix;
outmix.open( "pipipipi.dat" );
int count;
EvtVector4R p4pi1, p4pi2, p4pi3, p4pi4;
myGenerator.readUDecay( "exampleFiles/PIPIPIPI.DEC" );
count = 1;
EvtParticle *bcp, *btag;
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
static EvtId B0B = EvtPDL::getId( std::string( "anti-B0" ) );
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
if ( root_part->getDaug( 0 )->getNDaug() == 3 ) {
btag = root_part->getDaug( 0 );
bcp = root_part->getDaug( 1 );
} else {
bcp = root_part->getDaug( 0 );
btag = root_part->getDaug( 1 );
}
EvtId tag; //cp tag
if ( btag->getId() == B0B ) {
tag = B0;
} else {
tag = B0B;
}
p4pi1 = bcp->getDaug( 0 )->getP4Lab();
p4pi2 = bcp->getDaug( 1 )->getP4Lab();
p4pi3 = bcp->getDaug( 2 )->getP4Lab();
p4pi4 = bcp->getDaug( 3 )->getP4Lab();
EvtVector4R p4bcp, p4rho0, p4a2;
p4rho0 = p4pi1 + p4pi2;
p4a2 = p4rho0 + p4pi3;
p4bcp = p4a2 + p4pi4;
outmix << bcp->getLifetime() << " " << btag->getLifetime() << " "
<< tag.getId() << " " << ( p4pi1 + p4pi2 + p4pi3 ).mass() << " "
<< ( p4pi1 + p4pi2 ).mass() << " "
<< EvtDecayAngle( p4bcp, p4rho0 + p4pi3, p4rho0 ) << " "
<< EvtDecayAngle( p4a2, p4pi1 + p4pi2, p4pi1 ) << std::endl;
root_part->deleteTree();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "count:" << count << std::endl;
} while ( count++ < nevent );
outmix.close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runA2Pi( int nevent, EvtGen& myGenerator )
{
std::ofstream outmix;
outmix.open( "a2pi.dat" );
int count;
myGenerator.readUDecay( "exampleFiles/A2PI.DEC" );
EvtParticle *bcp, *btag;
EvtParticle *a2, *rho0, *pi1, *pi2, *pi3, *pi4;
EvtVector4R p4bcp, p4a2, p4rho0, p4pi1, p4pi2, p4pi3, p4pi4;
count = 1;
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
static EvtId B0B = EvtPDL::getId( std::string( "anti-B0" ) );
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
if ( root_part->getDaug( 0 )->getNDaug() == 3 ) {
btag = root_part->getDaug( 0 );
bcp = root_part->getDaug( 1 );
} else {
bcp = root_part->getDaug( 0 );
btag = root_part->getDaug( 1 );
}
a2 = bcp->getDaug( 0 );
pi1 = bcp->getDaug( 1 );
rho0 = a2->getDaug( 0 );
pi2 = a2->getDaug( 1 );
pi3 = rho0->getDaug( 0 );
pi4 = rho0->getDaug( 1 );
p4bcp = bcp->getP4Lab();
p4a2 = a2->getP4Lab();
p4pi1 = pi1->getP4Lab();
p4rho0 = rho0->getP4Lab();
p4pi2 = pi2->getP4Lab();
p4pi3 = pi3->getP4Lab();
p4pi4 = pi4->getP4Lab();
EvtId tag; //cp tag
if ( btag->getId() == B0B ) {
tag = B0;
} else {
tag = B0B;
}
outmix << bcp->getLifetime() << " " << btag->getLifetime() << " "
<< EvtDecayAngle( p4bcp, p4rho0 + p4pi2, p4rho0 ) << " "
<< EvtDecayAngle( p4a2, p4pi3 + p4pi4, p4pi3 ) << " "
<< EvtPDL::getStdHep( tag ) << std::endl;
root_part->deleteTree();
} while ( count++ < nevent );
outmix.close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runHelAmp( int nevent, EvtGen& myGenerator, std::string userFile,
std::string rootFile )
{
TFile* file = new TFile( rootFile.c_str(), "RECREATE" );
TH1F* costheta = new TH1F( "h1", "costheta", 100, -1.0, 1.0 );
TH1F* costheta2 = new TH1F( "h2", "costheta2", 100, -1.0, 1.0 );
int count;
myGenerator.readUDecay( userFile.c_str() );
count = 1;
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
EvtVector4R d14 = root_part->getDaug( 0 )->getP4Lab();
double c = d14.get( 3 ) / d14.d3mag();
costheta->Fill( c );
EvtVector4R p = root_part->getP4Lab();
EvtVector4R q = root_part->getDaug( 0 )->getP4Lab();
EvtVector4R d = root_part->getDaug( 0 )->getDaug( 0 )->getP4Lab();
costheta2->Fill( EvtDecayAngle( p, q, d ) );
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runHelAmp2( int nevent, EvtGen& myGenerator )
{
TFile* file = new TFile( "helamp2.root", "RECREATE" );
TH1F* costheta = new TH1F( "h1", "costheta", 100, -1.0, 1.0 );
int count;
myGenerator.readUDecay( "exampleFiles/HELAMP2.DEC" );
count = 1;
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
EvtVector4R p = root_part->getDaug( 0 )->getDaug( 0 )->getP4Lab();
EvtVector4R q =
root_part->getDaug( 0 )->getDaug( 0 )->getDaug( 0 )->getP4Lab();
EvtVector4R d = root_part->getDaug( 0 )
->getDaug( 0 )
->getDaug( 0 )
->getDaug( 0 )
->getP4Lab();
costheta->Fill( EvtDecayAngle( p, q, d ) );
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runD2Pi( int nevent, EvtGen& myGenerator )
{
TFile* file = new TFile( "d2pi.root", "RECREATE" );
TH1F* cospi = new TH1F( "h1", "cos[Q]?[p]!", 50, -1.0, 1.0 );
TH1F* ptpi = new TH1F( "h2", "Pt of pion", 50, 0.0, 1.5 );
TH1F* ppi = new TH1F( "h3", "P?[p]! in [Y](4S) rest frame", 50, 0.0, 1.5 );
int count;
myGenerator.readUDecay( "exampleFiles/D2PI.DEC" );
EvtParticle* b;
EvtParticle *d2, *pi;
EvtVector4R p4b, p4d2, p4pi;
count = 1;
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
b = root_part->getDaug( 0 );
d2 = b->getDaug( 0 );
pi = d2->getDaug( 1 );
p4b = b->getP4Lab();
p4d2 = d2->getP4Lab();
p4pi = pi->getP4Lab();
cospi->Fill( EvtDecayAngle( p4b, p4d2, p4pi ) );
ptpi->Fill( sqrt( p4pi.get( 2 ) * p4pi.get( 2 ) +
p4pi.get( 3 ) * p4pi.get( 3 ) ) );
ppi->Fill( p4pi.d3mag() );
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runPiPiCPT( int nevent, EvtGen& myGenerator )
{
std::ofstream outmix;
outmix.open( "pipicpt.dat" );
int count;
myGenerator.readUDecay( "exampleFiles/PIPICPT.DEC" );
EvtParticle *bcp, *btag;
count = 1;
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
static EvtId B0B = EvtPDL::getId( std::string( "anti-B0" ) );
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
if ( root_part->getDaug( 0 )->getNDaug() == 3 ) {
btag = root_part->getDaug( 0 );
bcp = root_part->getDaug( 1 );
} else {
bcp = root_part->getDaug( 0 );
btag = root_part->getDaug( 1 );
}
EvtId tag; //cp tag
if ( btag->getId() == B0B ) {
tag = B0;
} else {
tag = B0B;
}
outmix << bcp->getLifetime() << " " << btag->getLifetime() << " "
<< tag.getId() << std::endl;
root_part->deleteTree();
} while ( count++ < nevent );
outmix.close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runJpsiKs( int nevent, EvtGen& myGenerator )
{
std::ofstream outmix;
outmix.open( "jpsiks.dat" );
int count;
myGenerator.readUDecay( "exampleFiles/JPSIKS.DEC" );
EvtParticle *bcp, *btag;
count = 1;
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
static EvtId B0 = EvtPDL::getId( std::string( "B0" ) );
static EvtId B0B = EvtPDL::getId( std::string( "anti-B0" ) );
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
if ( root_part->getDaug( 0 )->getNDaug() == 3 ) {
btag = root_part->getDaug( 0 );
bcp = root_part->getDaug( 1 );
} else {
bcp = root_part->getDaug( 0 );
btag = root_part->getDaug( 1 );
}
EvtId tag; //cp tag
if ( btag->getId() == B0B ) {
tag = B0;
} else {
tag = B0B;
}
outmix << bcp->getLifetime() << " " << btag->getLifetime() << " "
<< tag.getId() << std::endl;
root_part->deleteTree();
} while ( count++ < nevent );
outmix.close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runDump( int nevent, EvtGen& myGenerator )
{
int count;
std::ofstream outmix;
outmix.open( "dump.dat" );
EvtParticle* p;
myGenerator.readUDecay( "exampleFiles/DUMP.DEC" );
count = 1;
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
static EvtId PIP = EvtPDL::getId( std::string( "pi+" ) );
static EvtId PIM = EvtPDL::getId( std::string( "pi-" ) );
static EvtId EP = EvtPDL::getId( std::string( "e+" ) );
static EvtId KP = EvtPDL::getId( std::string( "K+" ) );
static EvtId MUP = EvtPDL::getId( std::string( "mu+" ) );
static EvtId EM = EvtPDL::getId( std::string( "e-" ) );
static EvtId KM = EvtPDL::getId( std::string( "K-" ) );
static EvtId MUM = EvtPDL::getId( std::string( "mu-" ) );
static EvtId GAMM = EvtPDL::getId( std::string( "gamma" ) );
static EvtId K0L = EvtPDL::getId( std::string( "K_L0" ) );
do {
if ( count == 100 * ( count / 100 ) ) {
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << count << std::endl;
}
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
p = root_part;
EvtParticle* otherb = root_part->getDaug( 1 );
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "Event:" << count << std::endl;
root_part->printTree();
outmix << "B"
<< " " << otherb->getP4Lab().get( 0 ) << " "
<< otherb->getP4Lab().get( 1 ) << " "
<< otherb->getP4Lab().get( 2 ) << " "
<< otherb->getP4Lab().get( 3 ) << std::endl;
do {
if ( p->getId() == PIP || p->getId() == EP || p->getId() == KP ||
p->getId() == MUP ) {
outmix << "chg +1"
<< " " << p->getP4Lab().get( 1 ) << " "
<< p->getP4Lab().get( 2 ) << " "
<< p->getP4Lab().get( 3 ) << std::endl;
}
if ( p->getId() == PIM || p->getId() == EM || p->getId() == KM ||
p->getId() == MUM ) {
outmix << "chg -1"
<< " " << p->getP4Lab().get( 1 ) << " "
<< p->getP4Lab().get( 2 ) << " "
<< p->getP4Lab().get( 3 ) << std::endl;
}
if ( p->getId() == GAMM || p->getId() == K0L ) {
outmix << "neu"
<< " " << p->getP4Lab().get( 1 ) << " "
<< p->getP4Lab().get( 2 ) << " "
<< p->getP4Lab().get( 3 ) << std::endl;
}
p = p->nextIter();
} while ( p != nullptr );
outmix << "event" << std::endl;
root_part->deleteTree();
} while ( count++ < nevent );
outmix.close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runGenericCont( int nevent, EvtGen& myGenerator )
{
int count;
std::ofstream outmix;
outmix.open( "genericcont.dat" );
EvtParticle* p;
myGenerator.readUDecay( "exampleFiles/GENERIC.DEC" );
count = 1;
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
static EvtId VPHO = EvtPDL::getId( std::string( "vpho" ) );
do {
if ( count == 1000 * ( count / 1000 ) ) {
EvtGenReport( EVTGEN_DEBUG, "EvtGen" ) << count << std::endl;
}
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( VPHO,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
p = root_part;
do {
outmix << p->getId().getId() << " " << p->getP4Lab().d3mag()
<< std::endl;
p = p->nextIter();
} while ( p != nullptr );
//root_part->printTree();
root_part->deleteTree();
} while ( count++ < nevent );
outmix.close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runD1( int nevent, EvtGen& myGenerator )
{
std::ofstream outmix;
outmix.open( "d1.dat" );
int count = 1;
myGenerator.readUDecay( "exampleFiles/D1.DEC" );
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
EvtParticle *p_b, *p_d1, *p_e, *p_nu, *p_pi1, *p_dstar, *p_pi2, *p_d;
EvtVector4R p4_b, p4_d1, p4_e, p4_nu, p4_pi1, p4_dstar, p4_pi2, p4_d;
// code for analyzing B->D1 e nu ; D1 -> D* pi ; D* -> D pi
p_b = root_part->getDaug( 1 );
p_d1 = p_b->getDaug( 0 );
p_e = p_b->getDaug( 1 );
p_nu = p_b->getDaug( 2 );
p_dstar = p_d1->getDaug( 0 );
p_pi1 = p_d1->getDaug( 1 );
p_d = p_dstar->getDaug( 0 );
p_pi2 = p_dstar->getDaug( 1 );
p4_b = p_b->getP4Lab();
p4_d1 = p_d1->getP4Lab();
p4_e = p_e->getP4Lab();
p4_nu = p_nu->getP4Lab();
p4_dstar = p_dstar->getP4Lab();
p4_pi1 = p_pi1->getP4Lab();
p4_pi2 = p_pi2->getP4Lab();
p4_d = p_d->getP4Lab();
outmix << p4_e.get( 0 ) << " ";
outmix << ( p4_e + p4_nu ) * ( p4_e + p4_nu ) << " ";
outmix << EvtDecayAngle( p4_b, p4_e + p4_nu, p4_e ) << " ";
outmix << EvtDecayAngle( p4_b, p4_dstar + p4_pi1, p4_dstar ) << " ";
outmix << EvtDecayAngle( p4_d1, p4_d + p4_pi2, p4_d ) << " ";
outmix << EvtDecayAngleChi( p4_b, p4_e, p4_nu, p4_dstar, p4_pi1 ) << "\n";
root_part->deleteTree();
EvtGenReport( EVTGEN_DEBUG, "EvtGen" ) << "count:" << count << std::endl;
} while ( count++ < nevent );
outmix.close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runMix( int nevent, EvtGen& myGenerator )
{
std::ofstream outmix;
outmix.open( "mix.dat" );
int count = 1;
myGenerator.readUDecay( "exampleFiles/MIX.DEC" );
static EvtId UPS4 = EvtPDL::getId( std::string( "Upsilon(4S)" ) );
do {
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( UPS4,
p_init );
root_part->setVectorSpinDensity();
myGenerator.generateDecay( root_part );
outmix << root_part->getDaug( 0 )->getId().getId() << " ";
outmix << root_part->getDaug( 0 )->getLifetime() << " ";
outmix << root_part->getDaug( 1 )->getId().getId() << " ";
outmix << root_part->getDaug( 1 )->getLifetime() << "\n";
root_part->deleteTree();
} while ( count++ < nevent );
outmix.close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runBaryonic( int nEvent, EvtGen& myGenerator )
{
TFile* f = new TFile( "baryonic.root", "RECREATE" );
TH1D* q2Hist = new TH1D( "q2Hist", "q square", 50, 0.0, 25.00 );
EvtId BMINUS = EvtPDL::getId( "B-" );
EvtVector4R p_init( EvtPDL::getMass( BMINUS ), 0.0, 0.0, 0.0 );
EvtParticle* root_part;
myGenerator.readUDecay( "exampleFiles/BARYONIC.DEC" );
EvtVector4R l;
EvtVector4R p;
EvtVector4R g;
EvtVector4R sum;
for ( int i = 0; i < nEvent; ++i ) {
root_part = EvtParticleFactory::particleFactory( BMINUS, p_init );
root_part->setDiagonalSpinDensity();
myGenerator.generateDecay( root_part );
l = root_part->getDaug( 0 )->getP4Lab(); // lambda momentum
p = root_part->getDaug( 1 )->getP4Lab(); // pBar momentum
g = root_part->getDaug( 2 )->getP4Lab(); // gamma momentum
sum = p + g;
q2Hist->Fill( sum.mass2() );
root_part->deleteTree();
}
f->Write();
f->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runPhspDecaytimeCut( int nevent, EvtGen& myGenerator )
{
TFile* file = new TFile( "phspdecaytimecut.root", "RECREATE" );
TH1F* thist = new TH1F( "h1", "t [ps]", 100, 0.0, 10.0 );
int count = 1;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/PhspDecaytimeCut.DEC" );
myGenerator.readUDecay( udecay_name );
static EvtId B = EvtPDL::getId( std::string( "B+" ) );
std::ofstream outmix;
do {
EvtVector4R pinit( EvtPDL::getMass( B ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( B, pinit );
myGenerator.generateDecay( root_part );
double t = root_part->getLifetime() / ( 1e-12 * EvtConst::c );
thist->Fill( t );
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void run3BPhspRegion( int nevent, EvtGen& myGenerator )
{
TFile* file = new TFile( "3BodyPhspRegion.root", "RECREATE" );
TH1F* pxhist = new TH1F( "h1", "p_x ", 100, -3.0, 3.0 );
TH1F* pyhist = new TH1F( "h2", "p_y ", 100, -3.0, 3.0 );
TH1F* pzhist = new TH1F( "h3", "p_z ", 100, -3.0, 3.0 );
TH2F* dalitz = new TH2F( "h4", "Dalitz", 50, 12.5, 27., 50, 0.35, 4.8 );
TH2F* pxpyhist = new TH2F( "h5", "px-py", 50, -1.8, 1.8, 50, -1.8, 1.8 );
TH2F* pxpzhist = new TH2F( "h6", "px-pz", 50, -1.8, 1.8, 50, -1.8, 1.8 );
TH2F* pypzhist = new TH2F( "h7", "py-pz", 50, -1.8, 1.8, 50, -1.8, 1.8 );
int count = 1;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/3BodyPhspRegion.DEC" );
myGenerator.readUDecay( udecay_name );
static EvtId B = EvtPDL::getId( std::string( "B+" ) );
std::ofstream outmix;
do {
EvtVector4R pinit( EvtPDL::getMass( B ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( B, pinit );
myGenerator.generateDecay( root_part );
EvtParticle* daug1 = root_part->getDaug( 0 );
EvtParticle* daug2 = root_part->getDaug( 1 );
EvtParticle* daug3 = root_part->getDaug( 2 );
pxhist->Fill( daug1->getP4().get( 1 ) );
pyhist->Fill( daug1->getP4().get( 2 ) );
pzhist->Fill( daug1->getP4().get( 3 ) );
pxpyhist->Fill( daug1->getP4().get( 1 ), daug1->getP4().get( 2 ) );
pxpzhist->Fill( daug1->getP4().get( 1 ), daug1->getP4().get( 3 ) );
pypzhist->Fill( daug1->getP4().get( 2 ), daug1->getP4().get( 3 ) );
double m12 = ( daug1->getP4() + daug2->getP4() ).mass();
double m23 = ( daug2->getP4() + daug3->getP4() ).mass();
dalitz->Fill( m12 * m12, m23 * m23 );
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}
void runFourBody( int nevent, EvtGen& myGenerator )
{
TFile* file = new TFile( "fourBody.root", "RECREATE" );
double m12, m13, m14, m23, m24, m34, m123, m124, m234;
double mB, m1, m2, m3, m4;
double pBe, pBx, pBy, pBz;
double p1e, p1x, p1y, p1z;
double p2e, p2x, p2y, p2z;
double p3e, p3x, p3y, p3z;
double p4e, p4x, p4y, p4z;
double theta1, theta3, chi;
TTree* tree = new TTree( "tree", "" );
tree->Branch( "m12", &m12, "m12/D" );
tree->Branch( "m13", &m13, "m13/D" );
tree->Branch( "m14", &m14, "m14/D" );
tree->Branch( "m23", &m23, "m23/D" );
tree->Branch( "m24", &m24, "m24/D" );
tree->Branch( "m34", &m34, "m34/D" );
tree->Branch( "m123", &m123, "m123/D" );
tree->Branch( "m124", &m124, "m124/D" );
tree->Branch( "m234", &m234, "m234/D" );
tree->Branch( "mB", &mB, "mB/D" );
tree->Branch( "m1", &m1, "m1/D" );
tree->Branch( "m2", &m2, "m2/D" );
tree->Branch( "m3", &m3, "m3/D" );
tree->Branch( "m4", &m4, "m4/D" );
tree->Branch( "pBe", &pBe, "pBe/D" );
tree->Branch( "pBx", &pBx, "pBx/D" );
tree->Branch( "pBy", &pBy, "pBy/D" );
tree->Branch( "pBz", &pBz, "pBz/D" );
tree->Branch( "p1e", &p1e, "p1e/D" );
tree->Branch( "p1x", &p1x, "p1x/D" );
tree->Branch( "p1y", &p1y, "p1y/D" );
tree->Branch( "p1z", &p1z, "p1z/D" );
tree->Branch( "p2e", &p2e, "p2e/D" );
tree->Branch( "p2x", &p2x, "p2x/D" );
tree->Branch( "p2y", &p2y, "p2y/D" );
tree->Branch( "p2z", &p2z, "p2z/D" );
tree->Branch( "p3e", &p3e, "p3e/D" );
tree->Branch( "p3x", &p3x, "p3x/D" );
tree->Branch( "p3y", &p3y, "p3y/D" );
tree->Branch( "p3z", &p3z, "p3z/D" );
tree->Branch( "p4e", &p4e, "p4e/D" );
tree->Branch( "p4x", &p4x, "p4x/D" );
tree->Branch( "p4y", &p4y, "p4y/D" );
tree->Branch( "p4z", &p4z, "p4z/D" );
tree->Branch( "theta1", &theta1, "theta1/D" );
tree->Branch( "theta3", &theta3, "theta3/D" );
tree->Branch( "chi", &chi, "chi/D" );
int count = 1;
char udecay_name[100];
strcpy( udecay_name, "exampleFiles/4BodyPhsp.DEC" );
myGenerator.readUDecay( udecay_name );
static EvtId B = EvtPDL::getId( std::string( "B+" ) );
do {
EvtVector4R pinit( EvtPDL::getMass( B ), 0.0, 0.0, 0.0 );
EvtParticle* root_part = EvtParticleFactory::particleFactory( B, pinit );
myGenerator.generateDecay( root_part );
mB = root_part->mass();
m1 = root_part->getDaug( 0 )->mass();
m2 = root_part->getDaug( 1 )->mass();
m3 = root_part->getDaug( 2 )->mass();
m4 = root_part->getDaug( 3 )->mass();
EvtParticle* daug1 = root_part->getDaug( 0 );
EvtParticle* daug2 = root_part->getDaug( 1 );
EvtParticle* daug3 = root_part->getDaug( 2 );
EvtParticle* daug4 = root_part->getDaug( 3 );
m12 = ( daug1->getP4() + daug2->getP4() ).mass();
m13 = ( daug1->getP4() + daug3->getP4() ).mass();
m14 = ( daug1->getP4() + daug4->getP4() ).mass();
m23 = ( daug2->getP4() + daug3->getP4() ).mass();
m24 = ( daug2->getP4() + daug4->getP4() ).mass();
m34 = ( daug3->getP4() + daug4->getP4() ).mass();
m123 = ( daug1->getP4() + daug2->getP4() + daug3->getP4() ).mass();
m124 = ( daug1->getP4() + daug2->getP4() + daug4->getP4() ).mass();
m234 = ( daug2->getP4() + daug3->getP4() + daug4->getP4() ).mass();
pBe = root_part->getP4().get( 0 );
pBx = root_part->getP4().get( 1 );
pBy = root_part->getP4().get( 2 );
pBz = root_part->getP4().get( 3 );
p1e = daug1->getP4().get( 0 );
p1x = daug1->getP4().get( 1 );
p1y = daug1->getP4().get( 2 );
p1z = daug1->getP4().get( 3 );
p2e = daug2->getP4().get( 0 );
p2x = daug2->getP4().get( 1 );
p2y = daug2->getP4().get( 2 );
p2z = daug2->getP4().get( 3 );
p3e = daug3->getP4().get( 0 );
p3x = daug3->getP4().get( 1 );
p3y = daug3->getP4().get( 2 );
p3z = daug3->getP4().get( 3 );
p4e = daug4->getP4().get( 0 );
p4x = daug4->getP4().get( 1 );
p4y = daug4->getP4().get( 2 );
p4z = daug4->getP4().get( 3 );
theta1 = EvtDecayAngle( root_part->getP4(),
daug1->getP4() + daug2->getP4(), daug1->getP4() );
theta3 = EvtDecayAngle( root_part->getP4(),
daug3->getP4() + daug4->getP4(), daug3->getP4() );
chi = EvtDecayAngleChi( root_part->getP4(), daug1->getP4(),
daug2->getP4(), daug3->getP4(), daug4->getP4() );
tree->Fill();
root_part->deleteTree();
} while ( count++ < nevent );
file->Write();
file->Close();
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
}

File Metadata

Mime Type
text/x-diff
Expires
Mon, Jan 20, 11:31 PM (1 d, 9 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4242880
Default Alt Text
(937 KB)

Event Timeline