Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F19301375
D108.1759171173.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D108.1759171173.diff
View Options
diff --git a/EvtGenBase/EvtTensorParticle.hh b/EvtGenBase/EvtTensorParticle.hh
--- a/EvtGenBase/EvtTensorParticle.hh
+++ b/EvtGenBase/EvtTensorParticle.hh
@@ -24,6 +24,8 @@
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtTensor4C.hh"
+#include <array>
+
class EvtTensorParticle : public EvtParticle {
public:
EvtTensorParticle() = default;
@@ -42,7 +44,7 @@
double gamma ) const override;
private:
- EvtTensor4C eps[5]; //eps1,eps2,eps3,eps4,eps5;
+ std::array<EvtTensor4C, 5> eps; //eps1,eps2,eps3,eps4,eps5;
EvtTensorParticle( const EvtTensorParticle& tensor );
EvtTensorParticle& operator=( const EvtTensorParticle& tensor );
diff --git a/EvtGenBase/EvtVectorParticle.hh b/EvtGenBase/EvtVectorParticle.hh
--- a/EvtGenBase/EvtVectorParticle.hh
+++ b/EvtGenBase/EvtVectorParticle.hh
@@ -25,6 +25,9 @@
#include "EvtGenBase/EvtVector4C.hh"
#include "EvtGenBase/EvtVector4R.hh"
+#include <array>
+#include <cassert>
+
class EvtId;
class EvtVectorParticle : public EvtParticle {
@@ -37,15 +40,22 @@
const EvtVector4C&, const EvtVector4C& );
EvtVector4C epsParent( int i ) const override
{
+ assert( i >= 0 && i < _eps.size() );
+
return boostTo( _eps[i], this->getP4() );
}
- EvtVector4C eps( int i ) const override { return _eps[i]; }
+ EvtVector4C eps( int i ) const override
+ {
+ assert( i >= 0 && i < _eps.size() );
+
+ return _eps[i];
+ }
EvtSpinDensity rotateToHelicityBasis() const override;
EvtSpinDensity rotateToHelicityBasis( double alpha, double beta,
double gamma ) const override;
private:
- EvtVector4C _eps[3];
+ std::array<EvtVector4C, 3> _eps;
EvtVectorParticle( const EvtVectorParticle& vector );
EvtVectorParticle& operator=( const EvtVectorParticle& vector );
diff --git a/History.md b/History.md
--- a/History.md
+++ b/History.md
@@ -17,6 +17,9 @@
Updated EvtPhiDalitz model to use helicity amplitudes and fixed the indices used in
EvtVector3R::dot(), courtesy of Arnau Brossa Gonzalo & Antonio Romero Vidal (LHCb).
+2 Feb 2024 Fernando Abudinen
+* D108: Bugfix protect polarisation vector for vector and tensor particles against wrong indices
+
31 Oct 2023 Fernando Abudinen
* D102: Bugfix probmax issue for X38722-+\_PSI\_GAMMA model
- Calculation of amplitude moved to dedicated calcAmp function and fixed initialisation.
diff --git a/src/EvtGenBase/EvtTensorParticle.cpp b/src/EvtGenBase/EvtTensorParticle.cpp
--- a/src/EvtGenBase/EvtTensorParticle.cpp
+++ b/src/EvtGenBase/EvtTensorParticle.cpp
@@ -27,6 +27,7 @@
#include "EvtGenBase/EvtVector4C.hh"
#include "EvtGenBase/EvtVector4R.hh"
+#include <cassert>
#include <iostream>
#include <math.h>
#include <stdlib.h>
@@ -84,15 +85,15 @@
EvtTensor4C EvtTensorParticle::epsTensorParent( int i ) const
{
- EvtTensor4C temp = eps[i];
+ assert( i >= 0 && i < eps.size() );
- temp.applyBoostTo( this->getP4() );
- return temp;
+ return boostTo( eps[i], this->getP4() );
} //epsParent
EvtTensor4C EvtTensorParticle::epsTensor( int i ) const
{
+ assert( i >= 0 && i < eps.size() );
return eps[i];
} //eps
diff --git a/src/EvtGenModels/EvtBcToNPi.cpp b/src/EvtGenModels/EvtBcToNPi.cpp
--- a/src/EvtGenModels/EvtBcToNPi.cpp
+++ b/src/EvtGenModels/EvtBcToNPi.cpp
@@ -301,7 +301,7 @@
2 * I * FV * dual( EvtGenFunctions::directProd( p, k ) );
EvtVector4C Heps = H.cont2( hardCur );
- for ( int i = 0; i < 4; i++ ) {
+ for ( int i = 0; i < 3; i++ ) {
EvtVector4C eps = root_particle->getDaug( 0 )
->epsParent( i )
.conj(); // psi-meson polarization vector
diff --git a/src/EvtGenModels/EvtBcVNpi.cpp b/src/EvtGenModels/EvtBcVNpi.cpp
--- a/src/EvtGenModels/EvtBcVNpi.cpp
+++ b/src/EvtGenModels/EvtBcVNpi.cpp
@@ -183,7 +183,7 @@
H.addDirProd( ( a0f - a3f ) * 2.0 * ( m_meson / Q2 ) * p4b, p4b - p4meson );
EvtVector4C Heps = H.cont2( hardCur );
- for ( int i = 0; i < 4; i++ ) {
+ for ( int i = 0; i < 3; i++ ) {
EvtVector4C eps = root_particle->getDaug( 0 )
->epsParent( i )
.conj(); // psi-meson polarization vector
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Sep 29, 7:39 PM (21 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6558106
Default Alt Text
D108.1759171173.diff (4 KB)
Attached To
Mode
D108: Protect eps and epsParent against wrong indices
Attached
Detach File
Event Timeline
Log In to Comment