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
5d8e53d1
Commit
5d8e53d1
authored
13 years ago
by
Bertram Kopf
Browse files
Options
Downloads
Patches
Plain Diff
added AbsLh class
parent
cd724e41
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
PwaUtils/AbsLh.cc
+61
-0
61 additions, 0 deletions
PwaUtils/AbsLh.cc
PwaUtils/AbsLh.hh
+54
-0
54 additions, 0 deletions
PwaUtils/AbsLh.hh
with
115 additions
and
0 deletions
PwaUtils/AbsLh.cc
0 → 100644
+
61
−
0
View file @
5d8e53d1
#include
<getopt.h>
#include
<fstream>
#include
<string>
#include
"PwaUtils/AbsLh.hh"
#include
"qft++/relativistic-quantum-mechanics/Utils.hh"
#include
"ErrLogger/ErrLogger.hh"
AbsLh
::
AbsLh
(
boost
::
shared_ptr
<
const
EvtDataBaseList
>
theEvtList
)
:
_evtListPtr
(
theEvtList
)
{
_evtDataVec
=
_evtListPtr
->
getDataVecs
();
_evtMCVec
=
_evtListPtr
->
getMcVecs
();
}
AbsLh
::
AbsLh
(
boost
::
shared_ptr
<
AbsLh
>
theAbsLhPtr
)
:
_evtListPtr
(
theAbsLhPtr
->
getEventList
())
{
_evtDataVec
=
_evtListPtr
->
getDataVecs
();
_evtMCVec
=
_evtListPtr
->
getMcVecs
();
}
AbsLh
::~
AbsLh
()
{
}
double
AbsLh
::
calcLogLh
(
fitParams
&
theParamVal
){
double
logLH
=
0.
;
double
logLH_data
=
0.
;
double
weightSum
=
0.
;
std
::
vector
<
EvtData
*>::
iterator
iterd
;
for
(
iterd
=
_evtDataVec
.
begin
();
iterd
!=
_evtDataVec
.
end
();
++
iterd
){
double
intensity
=
calcEvtIntensity
((
*
iterd
),
theParamVal
);
if
(
intensity
>
0.
)
logLH_data
+=
((
*
iterd
)
->
evtWeight
)
*
log
(
intensity
);
weightSum
+=
(
*
iterd
)
->
evtWeight
;
}
double
LH_mc
=
0.
;
std
::
vector
<
EvtData
*>::
iterator
iterm
;
for
(
iterm
=
_evtMCVec
.
begin
();
iterm
!=
_evtMCVec
.
end
();
++
iterm
){
double
intensity
=
calcEvtIntensity
((
*
iterm
),
theParamVal
);
LH_mc
+=
intensity
;
}
double
logLH_mc_Norm
=
0.
;
if
(
LH_mc
>
0.
)
logLH_mc_Norm
=
log
(
LH_mc
/
_evtMCVec
.
size
());
logLH
=
weightSum
*
(
LH_mc
/
_evtMCVec
.
size
()
-
1
)
*
(
LH_mc
/
_evtMCVec
.
size
()
-
1
)
-
2.
*
logLH_data
+
2.
*
weightSum
*
logLH_mc_Norm
;
Info
<<
"current LH = "
<<
logLH
<<
endmsg
;
return
logLH
;
}
This diff is collapsed.
Click to expand it.
PwaUtils/AbsLh.hh
0 → 100644
+
54
−
0
View file @
5d8e53d1
#ifndef _AbsLh_H
#define _AbsLh_H
#include
<iostream>
#include
<vector>
#include
<complex>
#include
<cassert>
#include
<boost/shared_ptr.hpp>
#include
"PwaUtils/EvtDataBaseList.hh"
#include
"PwaUtils/FitParamsBase.hh"
class
AbsLh
{
public:
// create/copy/destroy:
///Constructor
AbsLh
(
boost
::
shared_ptr
<
const
EvtDataBaseList
>
);
AbsLh
(
boost
::
shared_ptr
<
AbsLh
>
);
/** Destructor */
virtual
~
AbsLh
();
virtual
AbsLh
*
clone_
()
const
=
0
;
// Getters:
virtual
double
calcLogLh
(
fitParams
&
theParamVal
);
virtual
double
calcEvtIntensity
(
EvtData
*
theData
,
fitParams
&
theParamVal
)
=
0
;
virtual
boost
::
shared_ptr
<
const
EvtDataBaseList
>
getEventList
()
const
{
return
_evtListPtr
;}
virtual
void
print
(
std
::
ostream
&
os
)
const
=
0
;
protected
:
boost
::
shared_ptr
<
const
EvtDataBaseList
>
_evtListPtr
;
std
::
vector
<
EvtData
*>
_evtDataVec
;
std
::
vector
<
EvtData
*>
_evtMCVec
;
private
:
};
#endif
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