Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Pawian
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PWA
Pawian
Commits
bb15f5af
Commit
bb15f5af
authored
1 year ago
by
Bertram Kopf
Browse files
Options
Downloads
Patches
Plain Diff
some modifications in TensorDecAmps for better performance
parent
7a43ae0d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
PwaUtils/AbsXdecAmp.cc
+2
-0
2 additions, 0 deletions
PwaUtils/AbsXdecAmp.cc
PwaUtils/AbsXdecAmp.hh
+1
-0
1 addition, 0 deletions
PwaUtils/AbsXdecAmp.hh
PwaUtils/TensorDecAmps.cc
+9
-42
9 additions, 42 deletions
PwaUtils/TensorDecAmps.cc
PwaUtils/TensorDecAmps.hh
+2
-4
2 additions, 4 deletions
PwaUtils/TensorDecAmps.hh
with
14 additions
and
46 deletions
PwaUtils/AbsXdecAmp.cc
+
2
−
0
View file @
bb15f5af
...
...
@@ -64,6 +64,7 @@ AbsXdecAmp::AbsXdecAmp(std::shared_ptr<AbsDecay> theDec, ChannelID channelID) :
,
_enabledlamFsDaughter2
(
false
)
,
_J
(
theDec
->
motherJPC
()
->
J
)
,
_isFormationAmp
(
false
)
,
_withDecayAmps
(
true
)
{
if
(
theDec
->
type
()
==
"FormationDecay"
){
_isFormationAmp
=
true
;
...
...
@@ -72,6 +73,7 @@ AbsXdecAmp::AbsXdecAmp(std::shared_ptr<AbsDecay> theDec, ChannelID channelID) :
else
{
_jpcDecsName
=
_JPCPtr
->
jpcname
()
+
"To"
+
theDec
->
daughter1Part
()
->
name
()
+
"_"
+
theDec
->
daughter2Part
()
->
name
();
}
if
(
_daughter1IsStable
&&
_daughter2IsStable
)
_withDecayAmps
=
false
;
}
AbsXdecAmp
::~
AbsXdecAmp
()
...
...
This diff is collapsed.
Click to expand it.
PwaUtils/AbsXdecAmp.hh
+
1
−
0
View file @
bb15f5af
...
...
@@ -130,5 +130,6 @@ protected:
intUShortShortComplFloatMap
_cachedAmpIdMap
;
// std::map<std::thread::id, std::map<unsigned short, complex<float> > > _cachedDynIdMap;
std
::
map
<
unsigned
short
,
complex
<
float
>
>
_cachedDynIdMap
;
bool
_withDecayAmps
;
virtual
void
initialize
();
};
This diff is collapsed.
Click to expand it.
PwaUtils/TensorDecAmps.cc
+
9
−
42
View file @
bb15f5af
...
...
@@ -106,7 +106,7 @@ complex<double> TensorDecAmps::XdecAmp(const Spin& lamX, EvtData* theData, AbsXd
result
=
lsLoop
(
grandmaAmp
,
lamX
,
theData
,
_lam1MinProj
,
_lam1MaxProj
,
_lam2MinProj
,
_lam2MaxProj
,
true
);
_lam2MaxProj
,
_withDecayAmps
);
if
(
_cacheAmps
){
// _cachedAmpMap[evtNo][_absDyn->grandMaKey(grandmaAmp)][currentSpinIndex]=result;
...
...
@@ -140,9 +140,9 @@ complex<double> TensorDecAmps::lsLoop(AbsXdecAmp* grandmaAmp, Spin lamX, EvtData
complex
<
double
>
tmpResult
(
0.
,
0.
);
for
(
Spin
lambda1
=
lam1Min
;
lambda1
<=
lam1Max
;
++
lambda1
){
for
(
Spin
lambda2
=
lam2Min
;
lambda2
<=
lam2Max
;
++
lambda2
){
Id3StringType
IdLamXLam1Lam2
=
FunctionUtils
::
spin3Index
(
lamX
,
lambda1
,
lambda2
);
complex
<
double
>
amp
=
theMagExpi
*
current3SpinMap
.
at
(
IdLamXLam1Lam2
);
if
(
withDecs
)
amp
*=
dAmps
.
at
(
lambda1
-
lam1Min
).
at
(
lambda2
-
lam2Min
);
Id3StringType
IdLamXLam1Lam2
=
FunctionUtils
::
spin3Index
(
lamX
,
lambda1
,
lambda2
);
complex
<
double
>
amp
=
theMagExpi
*
current3SpinMap
.
at
(
IdLamXLam1Lam2
);
if
(
withDecs
)
amp
*=
dAmps
.
at
(
lambda1
-
lam1Min
).
at
(
lambda2
-
lam2Min
);
tmpResult
+=
amp
;
}
}
...
...
@@ -159,34 +159,6 @@ complex<double> TensorDecAmps::lsLoop(AbsXdecAmp* grandmaAmp, Spin lamX, EvtData
}
// void TensorDecAmps::getDefaultParams(fitParCol& fitVal, fitParCol& fitErr){
// std::map< std::shared_ptr<const LScomb>, double, pawian::Collection::SharedPtrLess > currentMagValMap;
// std::map< std::shared_ptr<const LScomb>, double, pawian::Collection::SharedPtrLess > currentPhiValMap;
// std::map< std::shared_ptr<const LScomb>, double, pawian::Collection::SharedPtrLess > currentMagErrMap;
// std::map< std::shared_ptr<const LScomb>, double, pawian::Collection::SharedPtrLess > currentPhiErrMap;
// std::vector< std::shared_ptr<const LScomb> >::const_iterator itLS;
// for(itLS=_LSs.begin(); itLS!=_LSs.end(); ++itLS){
// currentMagValMap[*itLS]=_factorMag;
// currentPhiValMap[*itLS]=0.;
// currentMagErrMap[*itLS]=_factorMag/3.;
// currentPhiErrMap[*itLS]=0.3;
// }
// fitVal.MagsLS[_key]=currentMagValMap;
// fitVal.PhisLS[_key]=currentPhiValMap;
// fitErr.MagsLS[_key]=currentMagErrMap;
// fitErr.PhisLS[_key]=currentPhiErrMap;
// _absDyn->getDefaultParams(fitVal, fitErr);
// if(!_daughter1IsStable) _decAmpDaughter1->getDefaultParams(fitVal, fitErr);
// if(!_daughter2IsStable) _decAmpDaughter2->getDefaultParams(fitVal, fitErr);
// }
void
TensorDecAmps
::
fillDefaultParams
(
std
::
shared_ptr
<
AbsPawianParameters
>
fitPar
){
std
::
vector
<
std
::
shared_ptr
<
const
LScomb
>
>::
const_iterator
itLS
;
...
...
@@ -220,9 +192,11 @@ void TensorDecAmps::fillParamNameList(){
for
(
itLS
=
_LSs
.
begin
();
itLS
!=
_LSs
.
end
();
++
itLS
){
std
::
string
magName
=
(
*
itLS
)
->
name
()
+
_key
+
"Mag"
;
_paramNameList
.
push_back
(
magName
);
_lsMagNameMap
[
*
itLS
]
=
magName
;
std
::
string
phiName
=
(
*
itLS
)
->
name
()
+
_key
+
"Phi"
;
_paramNameList
.
push_back
(
phiName
);
_lsPhiNameMap
[
*
itLS
]
=
phiName
;
}
}
...
...
@@ -235,16 +209,9 @@ void TensorDecAmps::updateFitParams(std::shared_ptr<AbsPawianParameters> fitPar)
std
::
vector
<
std
::
shared_ptr
<
const
LScomb
>
>::
const_iterator
itLS
;
for
(
itLS
=
_LSs
.
begin
();
itLS
!=
_LSs
.
end
();
++
itLS
){
//magnitude
std
::
string
magName
=
(
*
itLS
)
->
name
()
+
_key
+
"Mag"
;
std
::
string
phiName
=
(
*
itLS
)
->
name
()
+
_key
+
"Phi"
;
double
theMag
=
fabs
(
fitPar
->
Value
(
magName
));
double
thePhi
=
fitPar
->
Value
(
phiName
);
_currentParamMags
[
*
itLS
]
=
theMag
;
_currentParamPhis
[
*
itLS
]
=
thePhi
;
complex
<
double
>
expi
(
cos
(
thePhi
),
sin
(
thePhi
));
_currentParamMagExpi
[
*
itLS
]
=
theMag
*
expi
;
double
theMag
=
fabs
(
fitPar
->
Value
(
_lsMagNameMap
.
at
(
*
itLS
)));
double
thePhi
=
fitPar
->
Value
(
_lsPhiNameMap
.
at
(
*
itLS
));
_currentParamMagExpi
[
*
itLS
]
=
std
::
polar
(
theMag
,
thePhi
);
}
_absDyn
->
updateFitParams
(
fitPar
);
...
...
This diff is collapsed.
Click to expand it.
PwaUtils/TensorDecAmps.hh
+
2
−
4
View file @
bb15f5af
...
...
@@ -74,12 +74,10 @@ public:
protected
:
std
::
vector
<
std
::
shared_ptr
<
const
LScomb
>
>
_LSs
;
double
_factorMag
;
std
::
map
<
std
::
shared_ptr
<
const
LScomb
>
,
double
,
pawian
::
Collection
::
SharedPtrLess
>
_
currentPar
amMa
gs
;
std
::
map
<
std
::
shared_ptr
<
const
LScomb
>
,
double
,
pawian
::
Collection
::
SharedPtrLess
>
_
currentParamPhis
;
std
::
map
<
std
::
shared_ptr
<
const
LScomb
>
,
std
::
string
,
pawian
::
Collection
::
SharedPtrLess
>
_
lsMagN
am
e
Ma
p
;
std
::
map
<
std
::
shared_ptr
<
const
LScomb
>
,
std
::
string
,
pawian
::
Collection
::
SharedPtrLess
>
_
lsPhiNameMap
;
std
::
map
<
std
::
shared_ptr
<
const
LScomb
>
,
complex
<
double
>
,
pawian
::
Collection
::
SharedPtrLess
>
_currentParamMagExpi
;
// std::map<std::thread::id, std::map<Spin, complex<double> > > _cachedDynLSMap;
std
::
map
<
unsigned
short
,
std
::
map
<
Spin
,
complex
<
double
>
>
>
_cachedDynIdLSMap
;
virtual
complex
<
double
>
lsLoop
(
AbsXdecAmp
*
grandmaAmp
,
Spin
lamX
,
EvtData
*
theData
,
Spin
lam1Min
,
Spin
lam1Max
,
Spin
lam2Min
,
Spin
lam2Max
,
bool
withDecs
);
private
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment