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
b60b3f63
Commit
b60b3f63
authored
12 years ago
by
Bertram Kopf
Browse files
Options
Downloads
Patches
Plain Diff
few modifications in PwaUtils/PwaGen.cc
parent
b68a9acc
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Examples/pbarp/pbarpReactionApp.cc
+9
-0
9 additions, 0 deletions
Examples/pbarp/pbarpReactionApp.cc
PwaUtils/PwaGen.cc
+37
-6
37 additions, 6 deletions
PwaUtils/PwaGen.cc
PwaUtils/PwaGen.hh
+3
-0
3 additions, 0 deletions
PwaUtils/PwaGen.hh
with
49 additions
and
6 deletions
Examples/pbarp/pbarpReactionApp.cc
+
9
−
0
View file @
b60b3f63
...
@@ -42,6 +42,7 @@
...
@@ -42,6 +42,7 @@
#include
"PwaUtils/StreamFitParmsBase.hh"
#include
"PwaUtils/StreamFitParmsBase.hh"
#include
"PwaUtils/PwaFcnBase.hh"
#include
"PwaUtils/PwaFcnBase.hh"
#include
"PwaUtils/PwaCovMatrix.hh"
#include
"PwaUtils/PwaCovMatrix.hh"
#include
"PwaUtils/PwaGen.hh"
#include
"Utils/PawianCollectionUtils.hh"
#include
"Utils/PawianCollectionUtils.hh"
#include
"Utils/ErrLogUtils.hh"
#include
"Utils/ErrLogUtils.hh"
#include
"pbarpUtils/pbarpEnv.hh"
#include
"pbarpUtils/pbarpEnv.hh"
...
@@ -202,6 +203,14 @@ int main(int __argc,char *__argv[]){
...
@@ -202,6 +203,14 @@ int main(int __argc,char *__argv[]){
fitParams
theStartparams
=
theParamStreamer
.
getFitParamVal
();
fitParams
theStartparams
=
theParamStreamer
.
getFitParamVal
();
fitParams
theErrorparams
=
theParamStreamer
.
getFitParamErr
();
fitParams
theErrorparams
=
theParamStreamer
.
getFitParamErr
();
if
(
mode
==
"gen"
){
boost
::
shared_ptr
<
PwaGen
>
pwaGenPtr
(
new
PwaGen
(
pbarpEnv
::
instance
()));
pwaGenPtr
->
generate
(
theLhPtr
,
theStartparams
);
theFitParamBase
->
printParams
(
theStartparams
);
return
1
;
}
PwaFcnBase
theFcn
(
theLhPtr
,
theFitParamBase
,
outputFileNameSuffix
);
PwaFcnBase
theFcn
(
theLhPtr
,
theFitParamBase
,
outputFileNameSuffix
);
MnUserParameters
upar
;
MnUserParameters
upar
;
theFitParamBase
->
setMnUsrParams
(
upar
,
theStartparams
,
theErrorparams
);
theFitParamBase
->
setMnUsrParams
(
upar
,
theStartparams
,
theErrorparams
);
...
...
This diff is collapsed.
Click to expand it.
PwaUtils/PwaGen.cc
+
37
−
6
View file @
b60b3f63
...
@@ -58,12 +58,40 @@ PwaGen::PwaGen(AbsEnv* theEnv) :
...
@@ -58,12 +58,40 @@ PwaGen::PwaGen(AbsEnv* theEnv) :
,
_finalStateParticles
(
theEnv
->
finalStateParticles
())
,
_finalStateParticles
(
theEnv
->
finalStateParticles
())
,
_stream
(
new
std
::
ofstream
(
"evtGen.dat"
))
,
_stream
(
new
std
::
ofstream
(
"evtGen.dat"
))
,
_genWithModel
(
true
)
,
_genWithModel
(
true
)
,
_unitScaleFactor
(
1.
)
,
_energyFirst
(
false
)
,
_useEvtWeight
(
theEnv
->
parser
()
->
useEvtWeight
())
{
{
_theTFile
=
new
TFile
(
"EvtGen.root"
,
"recreate"
);
_theTFile
=
new
TFile
(
"EvtGen.root"
,
"recreate"
);
inv01MassH1
=
new
TH1F
(
"inv01MassH1"
,
"inv01MassH1"
,
500
,
0.
,
3.
);
inv01MassH1
=
new
TH1F
(
"inv01MassH1"
,
"inv01MassH1"
,
500
,
0.
,
3.
);
inv02MassH1
=
new
TH1F
(
"inv02MassH1"
,
"inv02MassH1"
,
500
,
0.
,
3.
);
inv02MassH1
=
new
TH1F
(
"inv02MassH1"
,
"inv02MassH1"
,
500
,
0.
,
3.
);
inv12MassH1
=
new
TH1F
(
"inv12MassH1"
,
"inv12MassH1"
,
500
,
0.
,
3.
);
inv12MassH1
=
new
TH1F
(
"inv12MassH1"
,
"inv12MassH1"
,
500
,
0.
,
3.
);
_genWithModel
=
theEnv
->
parser
()
->
generateWithModel
();
_genWithModel
=
theEnv
->
parser
()
->
generateWithModel
();
std
::
string
unit
=
theEnv
->
parser
()
->
unitInFile
();
if
(
unit
==
"GEV"
){
_unitScaleFactor
=
1.
;
}
else
if
(
unit
==
"MEV"
){
_unitScaleFactor
=
1000.
;
}
else
{
Alert
<<
"unit "
<<
unit
<<
" does not exist!!!"
<<
endmsg
;
exit
(
0
);
}
std
::
string
order
=
theEnv
->
parser
()
->
orderInFile
();
if
(
order
==
"E Px Py Pz"
){
_energyFirst
=
true
;
}
else
if
(
order
==
"Px Py Pz E"
){
_energyFirst
=
false
;
}
else
{
Alert
<<
"order "
<<
order
<<
" does not exist!!!"
<<
endmsg
;
exit
(
0
);
}
}
}
PwaGen
::~
PwaGen
()
PwaGen
::~
PwaGen
()
...
@@ -125,7 +153,6 @@ void PwaGen::generate(boost::shared_ptr<AbsLh> theLh, fitParams& theFitParams){
...
@@ -125,7 +153,6 @@ void PwaGen::generate(boost::shared_ptr<AbsLh> theLh, fitParams& theFitParams){
}
}
currentEvtList
.
rewind
();
currentEvtList
.
rewind
();
std
::
cout
<<
"currentEvtList.size():
\t
"
<<
currentEvtList
.
size
()
<<
std
::
endl
;
boost
::
shared_ptr
<
EvtDataBaseList
>
eventListPtr
(
new
EvtDataBaseList
(
_absEnv
));
boost
::
shared_ptr
<
EvtDataBaseList
>
eventListPtr
(
new
EvtDataBaseList
(
_absEnv
));
...
@@ -133,8 +160,6 @@ void PwaGen::generate(boost::shared_ptr<AbsLh> theLh, fitParams& theFitParams){
...
@@ -133,8 +160,6 @@ void PwaGen::generate(boost::shared_ptr<AbsLh> theLh, fitParams& theFitParams){
double
evtWeightSum
=
0.
;
double
evtWeightSum
=
0.
;
eventListPtr
->
read4Vecs
(
currentEvtList
,
dataList
,
evtWeightSum
,
100000
,
noOfAllGenEvts
-
100000
);
eventListPtr
->
read4Vecs
(
currentEvtList
,
dataList
,
evtWeightSum
,
100000
,
noOfAllGenEvts
-
100000
);
std
::
cout
<<
"dataList.size():
\t
"
<<
dataList
.
size
()
<<
std
::
endl
;
theLh
->
updateFitParams
(
theFitParams
);
theLh
->
updateFitParams
(
theFitParams
);
std
::
vector
<
EvtData
*>::
const_iterator
itEvt
;
std
::
vector
<
EvtData
*>::
const_iterator
itEvt
;
...
@@ -157,7 +182,7 @@ void PwaGen::generate(boost::shared_ptr<AbsLh> theLh, fitParams& theFitParams){
...
@@ -157,7 +182,7 @@ void PwaGen::generate(boost::shared_ptr<AbsLh> theLh, fitParams& theFitParams){
while
(
itEvt
!=
dataList
.
end
())
while
(
itEvt
!=
dataList
.
end
())
{
{
double
fitWeight
=
theLh
->
calcEvtIntensity
(
*
itEvt
,
theFitParams
);
double
fitWeight
=
theLh
->
calcEvtIntensity
(
*
itEvt
,
theFitParams
);
std
::
cout
<<
(
*
itEvt
)
->
evtNo
<<
"
\t
fitWeight:
\t
"
<<
fitWeight
<<
std
::
endl
;
DebugMsg
<<
(
*
itEvt
)
->
evtNo
<<
"
\t
fitWeight:
\t
"
<<
fitWeight
<<
endmsg
;
if
(
maxFitWeight
<
fitWeight
)
maxFitWeight
=
fitWeight
;
if
(
maxFitWeight
<
fitWeight
)
maxFitWeight
=
fitWeight
;
++
itEvt
;
++
itEvt
;
}
}
...
@@ -199,11 +224,17 @@ void PwaGen::addEvt(EventList& evtList, EvtVector4R* evt4Vec4Rs,int evtNumber){
...
@@ -199,11 +224,17 @@ void PwaGen::addEvt(EventList& evtList, EvtVector4R* evt4Vec4Rs,int evtNumber){
void
PwaGen
::
dumpAscii
(
EvtData
*
evtData
){
void
PwaGen
::
dumpAscii
(
EvtData
*
evtData
){
if
(
_useEvtWeight
)
*
_stream
<<
1.000
<<
std
::
endl
;
std
::
vector
<
Particle
*
>
fsParticles
=
_absEnv
->
finalStateParticles
();
std
::
vector
<
Particle
*
>
fsParticles
=
_absEnv
->
finalStateParticles
();
std
::
vector
<
Particle
*
>::
const_iterator
fspIter
=
fsParticles
.
begin
();
std
::
vector
<
Particle
*
>::
const_iterator
fspIter
=
fsParticles
.
begin
();
for
(
;
fspIter
!=
fsParticles
.
end
();
++
fspIter
)
{
for
(
;
fspIter
!=
fsParticles
.
end
();
++
fspIter
)
{
Vector4
<
double
>
tmp4vec
=
evtData
->
FourVecsString
[
(
*
fspIter
)
->
name
()
];
Vector4
<
double
>
tmp4vec
=
evtData
->
FourVecsString
[
(
*
fspIter
)
->
name
()
];
*
_stream
<<
std
::
setprecision
(
8
)
<<
tmp4vec
.
Px
()
<<
"
\t
"
<<
tmp4vec
.
Py
()
<<
"
\t
"
<<
tmp4vec
.
Pz
()
<<
"
\t
"
<<
tmp4vec
.
E
()
<<
std
::
endl
;
if
(
_energyFirst
){
*
_stream
<<
std
::
setprecision
(
8
)
<<
tmp4vec
.
E
()
*
_unitScaleFactor
<<
tmp4vec
.
Px
()
*
_unitScaleFactor
<<
"
\t
"
<<
tmp4vec
.
Py
()
*
_unitScaleFactor
<<
"
\t
"
<<
tmp4vec
.
Pz
()
*
_unitScaleFactor
<<
"
\t
"
<<
std
::
endl
;
}
else
{
*
_stream
<<
std
::
setprecision
(
8
)
<<
tmp4vec
.
Px
()
*
_unitScaleFactor
<<
"
\t
"
<<
tmp4vec
.
Py
()
*
_unitScaleFactor
<<
"
\t
"
<<
tmp4vec
.
Pz
()
*
_unitScaleFactor
<<
"
\t
"
<<
tmp4vec
.
E
()
*
_unitScaleFactor
<<
std
::
endl
;
}
}
}
}
}
This diff is collapsed.
Click to expand it.
PwaUtils/PwaGen.hh
+
3
−
0
View file @
b60b3f63
...
@@ -74,4 +74,7 @@ protected:
...
@@ -74,4 +74,7 @@ protected:
TH1F
*
inv02MassH1
;
TH1F
*
inv02MassH1
;
TH1F
*
inv12MassH1
;
TH1F
*
inv12MassH1
;
bool
_genWithModel
;
bool
_genWithModel
;
double
_unitScaleFactor
;
bool
_energyFirst
;
bool
_useEvtWeight
;
};
};
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