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
bc80563a
Commit
bc80563a
authored
8 years ago
by
Bertram Kopf
Browse files
Options
Downloads
Patches
Plain Diff
added missing class EventReaderScattering
parent
fd5abbc1
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
Event/EventReaderScattering.cc
+115
-0
115 additions, 0 deletions
Event/EventReaderScattering.cc
Event/EventReaderScattering.hh
+54
-0
54 additions, 0 deletions
Event/EventReaderScattering.hh
with
169 additions
and
0 deletions
Event/EventReaderScattering.cc
0 → 100644
+
115
−
0
View file @
bc80563a
//************************************************************************//
// //
// Copyright 2017 Bertram Kopf (bertram@ep1.rub.de) //
// Julian Pychy (julian@ep1.rub.de) //
// - Ruhr-Universität Bochum //
// //
// This file is part of Pawian. //
// //
// Pawian is free software: you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation, either version 3 of the License, or //
// (at your option) any later version. //
// //
// Pawian is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with Pawian. If not, see <http://www.gnu.org/licenses/>. //
// //
//************************************************************************//
// EventReaderScattering class definition file. -*- C++ -*-
// Copyright 2017 Bertram Kopf
#include
"Event/EventReaderScattering.hh"
#include
"Event/EventList.hh"
#include
"Event/Event.hh"
#include
"ErrLogger/ErrLogger.hh"
EventReaderScattering
::
EventReaderScattering
()
:
EventReaderDefault
()
{
_order
=
std
::
string
(
"Mass Phi PhiErr Eta EtaErr"
);
numParticles
=
1
;
}
EventReaderScattering
::
EventReaderScattering
(
const
std
::
vector
<
std
::
string
>&
files
,
int
particles
,
int
skip
,
bool
useWeight
)
:
EventReaderDefault
(
files
,
particles
,
skip
,
useWeight
)
{
_order
=
std
::
string
(
"Mass Phi PhiErr Eta EtaErr"
);
numParticles
=
1
;
}
EventReaderScattering
::~
EventReaderScattering
()
{}
bool
EventReaderScattering
::
fill
(
EventList
&
evtList
,
int
evtStart
,
int
evtStop
)
{
int
currentEvtNo
=-
1
;
while
(
currentFile
!=
fileNames
.
end
())
{
currentStream
.
open
(
currentFile
->
c_str
());
if
(
!
currentStream
)
{
Alert
<<
"can not open "
<<
*
currentFile
;
// << endmsg;
exit
(
1
);
}
while
(
!
currentStream
.
eof
())
{
currentEvtNo
++
;
double
m
,
phi
,
phiErr
,
mu
,
muErr
;
Event
*
newEvent
=
new
Event
(
currentEvtNo
);
currentStream
>>
m
>>
phi
>>
phiErr
>>
mu
>>
muErr
;
double
scaledMass
=
m
/
_unitScaleFactor
;
newEvent
->
addParticle
(
scaledMass
,
0.
,
0.
,
0.
);
newEvent
->
addScatterInfo
(
phi
,
phiErr
,
mu
,
muErr
);
Vector4
<
double
>
tmp
=
newEvent
->
p4
(
0
);
bool
acceptEvt
=
true
;
if
(
_useMassRange
){
std
::
vector
<
std
::
shared_ptr
<
MassRangeCut
>
>::
iterator
itMassRangeCut
;
for
(
itMassRangeCut
=
_massRangeCuts
.
begin
();
itMassRangeCut
!=
_massRangeCuts
.
end
();
++
itMassRangeCut
){
if
(
scaledMass
<
(
*
itMassRangeCut
)
->
massMin
()
||
scaledMass
>
(
*
itMassRangeCut
)
->
massMax
()){
acceptEvt
=
false
;
break
;
}
}
}
if
(
!
acceptEvt
||
currentEvtNo
<
evtStart
||
currentEvtNo
>
evtStop
){
if
(
!
acceptEvt
)
currentEvtNo
--
;
delete
newEvent
;
continue
;
}
if
(
!
currentStream
.
fail
())
{
InfoMsg
<<
"added data point (event) for pi pi scattering no: "
<<
newEvent
->
eventNo
()
<<
"
\n
m: "
<<
newEvent
->
p4
(
0
)
->
Mass
()
<<
"
\n
phi: "
<<
newEvent
->
Phase
()
<<
"
\t
phi error: "
<<
newEvent
->
PhaseErr
()
<<
"
\n
eta: "
<<
newEvent
->
Eta
()
<<
"
\t
eta error: "
<<
newEvent
->
EtaErr
()
<<
"
\n
"
<<
endmsg
;
evtList
.
add
(
newEvent
);
// for (parts = 0; parts < linesToSkip; parts++)
// currentStream >> m >> phi >> phiErr >> mu >> muErr;
}
}
if
(
currentEvtNo
==
0
){
Alert
<<
"No events have been read in from File: "
<<
*
currentFile
<<
" !
\n
No events in massRange? Wrong order of particles? currentEvtNo = "
<<
currentEvtNo
;
exit
(
1
);
}
currentStream
.
close
();
++
currentFile
;
}
evtList
.
rewind
();
return
true
;
// success
}
void
EventReaderScattering
::
setOrder
(
const
std
::
string
&
theOrder
){
}
This diff is collapsed.
Click to expand it.
Event/EventReaderScattering.hh
0 → 100644
+
54
−
0
View file @
bc80563a
//************************************************************************//
// //
// Copyright 2017 Bertram Kopf (bertram@ep1.rub.de) //
// - Ruhr-Universität Bochum //
// //
// This file is part of Pawian. //
// //
// Pawian is free software: you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation, either version 3 of the License, or //
// (at your option) any later version. //
// //
// Pawian is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with Pawian. If not, see <http://www.gnu.org/licenses/>. //
// //
//************************************************************************//
// EventReaderScattering class definition file. -*- C++ -*-
// Copyright 2017 Bertram Kopf
#pragma once
#include
"Event/EventReaderDefault.hh"
#include
<string>
#include
<vector>
#include
<iostream>
#include
<fstream>
#include
<cstdlib>
#include
<utility>
class
EventList
;
class
EventReaderScattering
:
public
EventReaderDefault
{
public:
EventReaderScattering
();
EventReaderScattering
(
const
std
::
vector
<
std
::
string
>&
files
,
int
particles
,
int
skip
,
bool
useWeight
=
false
);
virtual
~
EventReaderScattering
();
virtual
bool
fill
(
EventList
&
evtList
,
int
evtStart
=
0
,
int
evtStop
=
1000000
);
virtual
void
setOrder
(
const
std
::
string
&
theOrder
);
protected:
};
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