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
aff933f6
Commit
aff933f6
authored
12 years ago
by
Bertram Kopf
Browse files
Options
Downloads
Patches
Plain Diff
added histos for pbarp test tools
parent
10431536
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Examples/pbarp/pbarpHist.cc
+56
-6
56 additions, 6 deletions
Examples/pbarp/pbarpHist.cc
Examples/pbarp/pbarpHist.hh
+4
-4
4 additions, 4 deletions
Examples/pbarp/pbarpHist.hh
with
60 additions
and
10 deletions
Examples/pbarp/pbarpHist.cc
+
56
−
6
View file @
aff933f6
#include
<getopt.h>
#include
<fstream>
#include
<algorithm>
#include
<boost/algorithm/string.hpp>
#include
"Examples/pbarp/pbarpHist.hh"
#include
"Examples/pbarp/pbarpEnv.hh"
...
...
@@ -33,9 +34,41 @@ pbarpHist::pbarpHist(boost::shared_ptr<AbsLhNew> theLh, fitParamsNew& theFitPara
std
::
vector
<
EvtDataNew
*>::
const_iterator
it
=
dataList
.
begin
();
while
(
it
!=
dataList
.
end
())
{
fillMassHists
((
*
it
),
1.
);
double
weight
=
(
*
it
)
->
evtWeight
;
fillMassHists
((
*
it
),
weight
,
_massDataHistMap
);
++
it
;
}
const
std
::
vector
<
EvtDataNew
*>
mcList
=
theEvtList
->
getMcVecs
();
it
=
mcList
.
begin
();
while
(
it
!=
mcList
.
end
())
{
double
evtWeight
=
(
*
it
)
->
evtWeight
;
fillMassHists
((
*
it
),
evtWeight
,
_massMcHistMap
);
double
fitWeight
=
theLh
->
calcEvtIntensity
(
(
*
it
),
theFitParams
);
fillMassHists
((
*
it
),
evtWeight
*
fitWeight
,
_massFitHistMap
);
++
it
;
}
double
integralDataWoWeight
=
(
double
)
theEvtList
->
getDataVecs
().
size
();
Info
<<
"No of data events without weight "
<<
integralDataWoWeight
;
// << endmsg;
double
integralDataWWeight
=
(
double
)
theEvtList
->
NoOfWeightedDataEvts
();
Info
<<
"No of data events with weight "
<<
integralDataWWeight
;
// << endmsg;
double
integralMC
=
(
double
)
theEvtList
->
NoOfWeightedMcEvts
();
Info
<<
"No of MC events "
<<
integralMC
;
// << endmsg;
Info
<<
"scaling factor "
<<
integralDataWWeight
/
integralMC
;
// << endmsg;
double
scaleFactor
=
integralDataWWeight
/
integralMC
;
std
::
map
<
boost
::
shared_ptr
<
massHistData
>
,
TH1F
*
,
pawian
::
Collection
::
SharedPtrLess
>::
iterator
itMassMap
;
for
(
itMassMap
=
_massFitHistMap
.
begin
();
itMassMap
!=
_massFitHistMap
.
end
();
++
itMassMap
){
itMassMap
->
second
->
Scale
(
scaleFactor
);
}
}
pbarpHist
::~
pbarpHist
(){
...
...
@@ -51,17 +84,34 @@ void pbarpHist::initRootStuff(){
std
::
vector
<
std
::
vector
<
std
::
string
>
>::
iterator
itVecStr
;
for
(
itVecStr
=
histMassNameVec
.
begin
();
itVecStr
!=
histMassNameVec
.
end
();
++
itVecStr
){
boost
::
shared_ptr
<
massHistData
>
tmpMassHistData
(
new
massHistData
(
*
itVecStr
));
std
::
string
histName
=
"data"
+
tmpMassHistData
->
_name
;
TH1F
*
currentMassHist
=
new
TH1F
(
histName
.
c_str
(),
histName
.
c_str
(),
100.
,
0.
,
2.
);
_massHistMap
[
tmpMassHistData
]
=
currentMassHist
;
std
::
string
tmpBaseName
=
tmpMassHistData
->
_name
;
boost
::
replace_all
(
tmpBaseName
,
"+"
,
"p"
);
boost
::
replace_all
(
tmpBaseName
,
"-"
,
"m"
);
std
::
string
histName
=
"data"
+
tmpBaseName
;
std
::
string
histDescription
=
"M("
+
tmpMassHistData
->
_name
+
") (data)"
;
TH1F
*
currentMassDataHist
=
new
TH1F
(
histName
.
c_str
(),
histDescription
.
c_str
(),
100.
,
0.
,
2.
);
currentMassDataHist
->
Sumw2
();
_massDataHistMap
[
tmpMassHistData
]
=
currentMassDataHist
;
histName
=
"MC"
+
tmpBaseName
;
histDescription
=
"M("
+
tmpMassHistData
->
_name
+
") (MC)"
;
TH1F
*
currentMassMcHist
=
new
TH1F
(
histName
.
c_str
(),
histDescription
.
c_str
(),
100.
,
0.
,
2.
);
currentMassMcHist
->
Sumw2
();
_massMcHistMap
[
tmpMassHistData
]
=
currentMassMcHist
;
histName
=
"Fit"
+
tmpBaseName
;
histDescription
=
"M("
+
tmpMassHistData
->
_name
+
") (fit)"
;
TH1F
*
currentMassFitHist
=
new
TH1F
(
histName
.
c_str
(),
histDescription
.
c_str
(),
100.
,
0.
,
2.
);
currentMassFitHist
->
Sumw2
();
_massFitHistMap
[
tmpMassHistData
]
=
currentMassFitHist
;
}
}
void
pbarpHist
::
fillMassHists
(
EvtDataNew
*
theData
,
double
weight
){
void
pbarpHist
::
fillMassHists
(
EvtDataNew
*
theData
,
double
weight
,
std
::
map
<
boost
::
shared_ptr
<
massHistData
>
,
TH1F
*
,
pawian
::
Collection
::
SharedPtrLess
>&
toFill
){
std
::
map
<
boost
::
shared_ptr
<
massHistData
>
,
TH1F
*
,
pawian
::
Collection
::
SharedPtrLess
>::
iterator
it
;
for
(
it
=
_massHistMap
.
begin
();
it
!=
_massHistMap
.
end
();
++
it
){
for
(
it
=
toFill
.
begin
();
it
!=
toFill
.
end
();
++
it
){
//get relevant 4 vecs
Vector4
<
double
>
combined4Vec
(
0.
,
0.
,
0.
,
0.
);
...
...
This diff is collapsed.
Click to expand it.
Examples/pbarp/pbarpHist.hh
+
4
−
4
View file @
aff933f6
...
...
@@ -60,7 +60,6 @@ struct massHistData {
class
TFile
;
//class TH2F;
class
TH1F
;
// class TNtuple;
class
pbarpHist
{
...
...
@@ -72,12 +71,13 @@ public:
protected:
private:
void
fillMassHists
(
EvtDataNew
*
theData
,
double
weight
);
void
fillMassHists
(
EvtDataNew
*
theData
,
double
weight
,
std
::
map
<
boost
::
shared_ptr
<
massHistData
>
,
TH1F
*
,
pawian
::
Collection
::
SharedPtrLess
>&
toFill
);
TFile
*
_theTFile
;
std
::
map
<
boost
::
shared_ptr
<
massHistData
>
,
TH1F
*
,
pawian
::
Collection
::
SharedPtrLess
>
_massHistMap
;
std
::
map
<
boost
::
shared_ptr
<
massHistData
>
,
TH1F
*
,
pawian
::
Collection
::
SharedPtrLess
>
_massDataHistMap
;
std
::
map
<
boost
::
shared_ptr
<
massHistData
>
,
TH1F
*
,
pawian
::
Collection
::
SharedPtrLess
>
_massMcHistMap
;
std
::
map
<
boost
::
shared_ptr
<
massHistData
>
,
TH1F
*
,
pawian
::
Collection
::
SharedPtrLess
>
_massFitHistMap
;
void
initRootStuff
();
};
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