Page MenuHomeHEPForge

D133.id.diff
No OneTemporary

D133.id.diff

diff --git a/History.md b/History.md
--- a/History.md
+++ b/History.md
@@ -11,6 +11,9 @@
===
## R02-0X-00
+7 Oct 2024 Thomas Latham
+* D133: Fix bug in rotation to helicity basis for tensor particles
+
4 Oct 2024 Heather Ratcliffe, Thomas Latham, Fernando Abudinen
* D132: Introduce thread safety
- Protect statics: make them const or thread\_local
diff --git a/src/EvtGenBase/EvtTensorParticle.cpp b/src/EvtGenBase/EvtTensorParticle.cpp
--- a/src/EvtGenBase/EvtTensorParticle.cpp
+++ b/src/EvtGenBase/EvtTensorParticle.cpp
@@ -142,11 +142,11 @@
{
EvtTensor4C es[5];
- static thread_local EvtVector4C eplus(
- 0.0, -1.0 / sqrt( 2.0 ), EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
- static thread_local EvtVector4C ezero( 0.0, 0.0, 0.0, 1.0 );
- static thread_local EvtVector4C eminus(
- 0.0, 1.0 / sqrt( 2.0 ), EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
+ EvtVector4C eplus( 0.0, -1.0 / sqrt( 2.0 ),
+ EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
+ EvtVector4C ezero( 0.0, 0.0, 0.0, 1.0 );
+ EvtVector4C eminus( 0.0, 1.0 / sqrt( 2.0 ),
+ EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
eplus.applyRotateEuler( alpha, beta, gamma );
ezero.applyRotateEuler( alpha, beta, gamma );
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -52,7 +52,7 @@
# install the decay files, macros, scripts, etc.
install(DIRECTORY exampleFiles DESTINATION ${CMAKE_INSTALL_DATADIR}/EvtGen/test)
install(DIRECTORY jsonFiles DESTINATION ${CMAKE_INSTALL_DATADIR}/EvtGen/test)
- install(FILES do_tests runTests.py makeSrcDepsJson makeModelsJson
+ install(FILES do_tests runMany1evtJobs.py runTests.py makeSrcDepsJson makeModelsJson
DESTINATION ${CMAKE_INSTALL_DATADIR}/EvtGen/test
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
else()
diff --git a/test/checkJsonFiles.py b/test/checkJsonFiles.py
--- a/test/checkJsonFiles.py
+++ b/test/checkJsonFiles.py
@@ -42,6 +42,10 @@
'K*-' : [ 'Kst-', 'Kstm', 'Kst', 'Kstar' ],
'K*0' : [ 'Kst0', 'Kstz', 'Kst', 'Kstar0' ],
'anti-K*0' : [ 'Kst0', 'Kstz', 'Kst', 'Kstar0' ],
+ 'K_2*0' : [ 'Kst2', 'Kst2z' ],
+ 'anti-K_2*0' : [ 'Kst2', 'Kst2z' ],
+ 'K_2*+' : [ 'Kst2', 'Kst2p' ],
+ 'K_2*-' : [ 'Kst2', 'Kst2m' ],
'K_1+' : [ 'K1+', 'K1p', 'K1' ],
'K_1-' : [ 'K1-', 'K1m', 'K1' ],
'K\'_1+' : [ 'Kprime1+', 'Kprime1p', 'Kprime1' ],
diff --git a/test/jsonFiles/HELAMP=TSS__Bd_Kst2gamma_Kpi.json b/test/jsonFiles/HELAMP=TSS__Bd_Kst2gamma_Kpi.json
new file mode 100644
--- /dev/null
+++ b/test/jsonFiles/HELAMP=TSS__Bd_Kst2gamma_Kpi.json
@@ -0,0 +1,18 @@
+{
+ "parent" : "B0",
+ "daughters" : ["K_2*0", "gamma"],
+ "grand_daughters" : [["K+", "pi-"], []],
+ "models" : ["HELAMP", "TSS", ""],
+ "parameters" : [["1.0", "0.0", "1.0", "0.0"], [], []],
+ "do_conjugate_decay" : [true, true, true],
+ "extras" : ["noFSR"],
+ "events" : 10000,
+ "histograms" : [
+ {"variable" : "prob", "title" : "Prob(HELAMP,B)", "d1" : 0, "d2" : 0, "nbins" : 100, "xmin" : 0.0, "xmax" : 1.0},
+ {"variable" : "prob_daug1", "title" : "Prob(TSS,K_{2}^{*0})", "d1" : 0, "d2" : 0, "nbins" : 100, "xmin" : 0.0, "xmax" : 1.0},
+ {"variable" : "parMass", "title" : "m(B0)", "d1" : 0, "d2" : 0, "nbins" : 100, "xmin" : 5.27, "xmax" : 5.29},
+ {"variable" : "mass", "title" : "m(K_{2}^{*0})", "d1" : 1, "d2" : 0, "nbins" : 100, "xmin" : 1.0, "xmax" : 1.8},
+ {"variable" : "cosHel", "title" : "cosHel(K_{2}^{*0})", "d1" : 1, "d2" : 0, "nbins" : 100, "xmin" : -1.0, "xmax" : 1.0}
+ ],
+ "outfile" : "HELAMP=TSS__Bd_Kst2gamma_Kpi.root"
+}
diff --git a/test/jsonFiles/HELAMP=VSS__Bd_Kstgamma_Kpi.json b/test/jsonFiles/HELAMP=VSS__Bd_Kstgamma_Kpi.json
new file mode 100644
--- /dev/null
+++ b/test/jsonFiles/HELAMP=VSS__Bd_Kstgamma_Kpi.json
@@ -0,0 +1,18 @@
+{
+ "parent" : "B0",
+ "daughters" : ["K*0", "gamma"],
+ "grand_daughters" : [["K+", "pi-"], []],
+ "models" : ["HELAMP", "VSS", ""],
+ "parameters" : [["1.0", "0.0", "1.0", "0.0"], [], []],
+ "do_conjugate_decay" : [true, true, true],
+ "extras" : ["noFSR"],
+ "events" : 10000,
+ "histograms" : [
+ {"variable" : "prob", "title" : "Prob(HELAMP,B)", "d1" : 0, "d2" : 0, "nbins" : 100, "xmin" : 0.0, "xmax" : 1.0},
+ {"variable" : "prob_daug1", "title" : "Prob(VSS,K^{*0})", "d1" : 0, "d2" : 0, "nbins" : 100, "xmin" : 0.0, "xmax" : 1.0},
+ {"variable" : "parMass", "title" : "m(B0)", "d1" : 0, "d2" : 0, "nbins" : 100, "xmin" : 5.27, "xmax" : 5.29},
+ {"variable" : "mass", "title" : "m(K^{*0})", "d1" : 1, "d2" : 0, "nbins" : 100, "xmin" : 1.0, "xmax" : 1.8},
+ {"variable" : "cosHel", "title" : "cosHel(K^{*0})", "d1" : 1, "d2" : 0, "nbins" : 100, "xmin" : -1.0, "xmax" : 1.0}
+ ],
+ "outfile" : "HELAMP=VSS__Bd_Kstgamma_Kpi.root"
+}
diff --git a/test/runMany1evtJobs.py b/test/runMany1evtJobs.py
new file mode 100644
--- /dev/null
+++ b/test/runMany1evtJobs.py
@@ -0,0 +1,48 @@
+#!/usr/bin/env python
+#SBATCH --partition=epp
+#SBATCH --ntasks=1
+#SBATCH --cpus-per-task=1
+#SBATCH --mem-per-cpu=3997
+#SBATCH --time=12:00:00
+
+import os
+import json
+import subprocess
+import tempfile
+
+nevents = 10000
+testname = 'HELAMP=TSS__Bd_Kst2gamma_Kpi'
+
+j = None
+with open( 'jsonFiles/config/default.json' ) as jsonFile :
+ j = json.load( jsonFile )
+
+with tempfile.TemporaryDirectory() as tmpdirname :
+ for i in range(nevents) :
+
+ if i % 100 == 0 :
+ print(f'Events remaining: {nevents - i}', flush=True)
+
+ j['rng_seed'] = 1000000*(i+1)
+ j['outfile'] = f'{tmpdirname}/{testname}_{i+1}.root'
+ j['events'] = 1
+
+ with open( f'{tmpdirname}/tmp.json', 'w' ) as jsonFile :
+ json.dump( j, jsonFile )
+
+ result = subprocess.run(['./testDecayModel', 'jsonFiles/{testname}.json', f'{tmpdirname}/tmp.json'], text=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+
+ #logFileName = j['outfile'].replace('.root', '.out')
+ #with open( logFileName, 'w' ) as logFile :
+ #logFile.write( result.stdout )
+
+ cmd_args = ['hadd', '-ff', '{testname}.root']
+
+ tmpdirlisting = os.listdir(f'{tmpdirname}')
+ inputfiles = [ f'{tmpdirname}/{file}' for file in tmpdirlisting if file.endswith('.root') ]
+ cmd_args.extend( inputfiles )
+
+ result = subprocess.run(cmd_args, text=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+
+ with open( 'hadd.log', 'w' ) as logFile :
+ logFile.write( result.stdout )

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 18, 5:33 PM (13 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3799638
Default Alt Text
D133.id.diff (6 KB)

Event Timeline