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
ddb78918
Commit
ddb78918
authored
10 years ago
by
Bertram Kopf
Browse files
Options
Downloads
Patches
Plain Diff
bug fix for calculating BIC values in qaMode
parent
6b10ad26
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
AppUtils/AppBase.cc
+44
-43
44 additions, 43 deletions
AppUtils/AppBase.cc
with
44 additions
and
43 deletions
AppUtils/AppBase.cc
+
44
−
43
View file @
ddb78918
...
...
@@ -263,13 +263,14 @@ void AppBase::qaModeSimple(EventList& dataEventList, EventList& mcEventList, std
int
evtCount
=
0
;
double
integralDataWoWeight
=
(
double
)
dataEventList
.
size
();
double
evtWeightSumData
=
theLHData
.
weightSum
;
double
evtWeightSumData
=
0.
;
dataEventList
.
rewind
();
while
((
anEvent
=
dataEventList
.
nextEvent
())){
EvtData
*
currentDataEvt
=
evtDataBaseList
->
convertEvent
(
anEvent
,
evtCount
);
absLh
->
addDataToLogLh
(
currentDataEvt
,
currentParams
,
theLHData
);
histPtr
->
fillEvt
(
currentDataEvt
,
currentDataEvt
->
evtWeight
,
"data"
);
evtWeightSumData
+=
currentDataEvt
->
evtWeight
;
delete
currentDataEvt
;
evtCount
++
;
if
(
evtCount
%
1000
==
0
)
Info
<<
evtCount
<<
" data events calculated"
<<
endmsg
;
...
...
@@ -301,48 +302,48 @@ void AppBase::qaModeSimple(EventList& dataEventList, EventList& mcEventList, std
// if(i!=-1)
// continue;
if
(
i
==-
1
){
double
theLh
=
absLh
->
mergeLogLhData
(
theLHData
);
// double evtWeightSumData=theLHData.weightSum;
double
BICcriterion
=
2.
*
theLh
+
noOfFreeFitParams
*
log
(
evtWeightSumData
);
double
AICcriterion
=
2.
*
theLh
+
2.
*
noOfFreeFitParams
;
double
AICccriterion
=
AICcriterion
+
2.
*
noOfFreeFitParams
*
(
noOfFreeFitParams
+
1
)
/
(
evtWeightSumData
-
noOfFreeFitParams
-
1
);
// double integralDataWoWeight=(double) dataEventList.size();
// std::ostringstream qaSummaryFileName;
// std::string outputFileNameSuffix= GlobalEnv::instance()->outputFileNameSuffix();
// qaSummaryFileName << "qaSummarySimple" << outputFileNameSuffix << ".dat";
// std::ofstream theQaStream ( qaSummaryFileName.str().c_str() );
Info
<<
"logLh
\t
"
<<
theLh
;
theQaStream
<<
"logLh
\t
"
<<
theLh
<<
"
\n
"
;
Info
<<
"noOfFreeFitParams:
\t
"
<<
noOfFreeFitParams
;
theQaStream
<<
"noOfFreeFitParams
\t
"
<<
noOfFreeFitParams
<<
"
\n
"
;
Info
<<
"BIC:
\t
"
<<
BICcriterion
;
theQaStream
<<
"BIC:
\t
"
<<
BICcriterion
<<
"
\n
"
;
Info
<<
"AICa:
\t
"
<<
AICcriterion
;
theQaStream
<<
"AICa:
\t
"
<<
AICcriterion
<<
"
\n
"
;
Info
<<
"AICc:
\t
"
<<
AICccriterion
;
theQaStream
<<
"AICc:
\t
"
<<
AICccriterion
<<
"
\n
"
;
Info
<<
"No of data events without weight "
<<
integralDataWoWeight
;
theQaStream
<<
"No of data events without weight "
<<
integralDataWoWeight
<<
"
\n
"
;
Info
<<
"No of data events with weight "
<<
evtWeightSumData
;
theQaStream
<<
"No of data events with weight "
<<
evtWeightSumData
<<
"
\n
"
;
Info
<<
"No of MC events "
<<
theLHData
.
num_mc
;
theQaStream
<<
"No of MC events "
<<
theLHData
.
num_mc
<<
"
\n
"
;
Info
<<
"scaling factor "
<<
scaleFactor
;
theQaStream
<<
"scaling factor "
<<
scaleFactor
<<
"
\n
"
;
Info
<<
"no of fitted events with scaling factor: "
<<
integralFitWeight
*
scaleFactor
;
theQaStream
<<
"no of fitted events with scaling factor: "
<<
integralFitWeight
*
scaleFactor
<<
"
\n
"
;
}
double
theLh
=
absLh
->
mergeLogLhData
(
theLHData
);
// double evtWeightSumData=theLHData.weightSum;
double
BICcriterion
=
2.
*
theLh
+
noOfFreeFitParams
*
log
(
evtWeightSumData
);
double
AICcriterion
=
2.
*
theLh
+
2.
*
noOfFreeFitParams
;
double
AICccriterion
=
AICcriterion
+
2.
*
noOfFreeFitParams
*
(
noOfFreeFitParams
+
1
)
/
(
evtWeightSumData
-
noOfFreeFitParams
-
1
);
// double integralDataWoWeight=(double) dataEventList.size();
// std::ostringstream qaSummaryFileName;
// std::string outputFileNameSuffix= GlobalEnv::instance()->outputFileNameSuffix();
// qaSummaryFileName << "qaSummarySimple" << outputFileNameSuffix << ".dat";
// std::ofstream theQaStream ( qaSummaryFileName.str().c_str() );
Info
<<
"logLh
\t
"
<<
theLh
;
theQaStream
<<
"logLh
\t
"
<<
theLh
<<
"
\n
"
;
Info
<<
"noOfFreeFitParams:
\t
"
<<
noOfFreeFitParams
;
theQaStream
<<
"noOfFreeFitParams
\t
"
<<
noOfFreeFitParams
<<
"
\n
"
;
Info
<<
"BIC:
\t
"
<<
BICcriterion
;
theQaStream
<<
"BIC:
\t
"
<<
BICcriterion
<<
"
\n
"
;
Info
<<
"AICa:
\t
"
<<
AICcriterion
;
theQaStream
<<
"AICa:
\t
"
<<
AICcriterion
<<
"
\n
"
;
Info
<<
"AICc:
\t
"
<<
AICccriterion
;
theQaStream
<<
"AICc:
\t
"
<<
AICccriterion
<<
"
\n
"
;
Info
<<
"No of data events without weight "
<<
integralDataWoWeight
;
theQaStream
<<
"No of data events without weight "
<<
integralDataWoWeight
<<
"
\n
"
;
Info
<<
"No of data events with weight "
<<
evtWeightSumData
;
theQaStream
<<
"No of data events with weight "
<<
evtWeightSumData
<<
"
\n
"
;
Info
<<
"No of MC events "
<<
theLHData
.
num_mc
;
theQaStream
<<
"No of MC events "
<<
theLHData
.
num_mc
<<
"
\n
"
;
Info
<<
"scaling factor "
<<
scaleFactor
;
theQaStream
<<
"scaling factor "
<<
scaleFactor
<<
"
\n
"
;
Info
<<
"no of fitted events with scaling factor: "
<<
integralFitWeight
*
scaleFactor
;
theQaStream
<<
"no of fitted events with scaling factor: "
<<
integralFitWeight
*
scaleFactor
<<
"
\n
"
;
}
else
{
//i>-1
Info
<<
"contribution no "
<<
i
;
Info
<<
"No of data events without weight "
<<
integralDataWoWeight
;
...
...
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