Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
dunesim
dunesim
EventGenerator
ProtoDUNEbeamDataProducts
ProtoDUNEbeamsim.cxx
Go to the documentation of this file.
1
/////////////////////////////////////////////////////////
2
///////// ProtoDUNEbeamsim.cxx///////////////////////////
3
///////// Caroline Zhang carolineligezhang@gmail.com/////
4
///////// August 2017 ///////////////////////////////////
5
/////////////////////////////////////////////////////////
6
// Modified by Pablo and Leigh H. Howard,
7
// pablo.fer@cern.ch
8
// July 2018
9
/////////////////////////////////////////////////////////
10
11
#include <iostream>
12
#include <fstream>
13
#include "
dunesim/EventGenerator/ProtoDUNEbeamDataProducts/ProtoDUNEbeamsim.h
"
14
#include <string.h>
15
#include <time.h>
16
#include <cmath>
17
#include <iomanip>
18
19
#include "
messagefacility/MessageLogger/MessageLogger.h
"
20
21
namespace
sim
{
22
23
//--------------------------constructors-----------------------------------------------
24
ProtoDUNEbeamsim::ProtoDUNEbeamsim
(){}
25
26
//-------------------------------default destructor------------------------------------------
27
ProtoDUNEbeamsim::~ProtoDUNEbeamsim
(){ }
28
29
// Leigh - I have encapsulated each beam instrument into a ProtoDUNEBeamInstrument object.
30
// The below provides the interface for these.
31
void
ProtoDUNEbeamsim::AddInstrument
(
ProtoDUNEBeamInstrument
newInst){
32
33
bool
alreadyExists =
false
;
34
for
(
auto
const
&inst :
fAllInstruments
){
35
if
(newInst.
GetInstrumentName
() == inst.GetInstrumentName()){
36
alreadyExists =
true
;
37
break
;
38
}
39
}
40
41
if
(!alreadyExists){
42
fAllInstruments.push_back(newInst);
43
}
44
else
{
45
mf::LogError
(
"ProtoDUNEbeamsim"
) <<
"Beam Instrument "
<< newInst.
GetInstrumentName
() <<
" already exists."
<<
std::endl
;
46
}
47
48
}
49
50
ProtoDUNEBeamInstrument
ProtoDUNEbeamsim::GetInstrument
(
std::string
name
)
const
{
51
ProtoDUNEBeamInstrument
temp
;
52
bool
found
=
false
;
53
for
(
auto
const
inst :
fAllInstruments
){
54
if
(name == inst.GetInstrumentName()){
55
temp = inst;
56
found =
true
;
57
break
;
58
}
59
}
60
61
if
(!found){
62
mf::LogWarning
(
"ProtoDUNEbeamsim"
) <<
"Beam Instrument "
<< name <<
" not found, returning empty object."
<<
std::endl
;
63
}
64
65
return
temp
;
66
}
67
}
// namespace
68
69
70
71
72
73
name
static QCString name
Definition:
declinfo.cpp:673
string
std::string string
Definition:
nybbler.cc:12
sim::ProtoDUNEBeamInstrument::GetInstrumentName
std::string GetInstrumentName() const
Definition:
ProtoDUNEBeamInstrument.h:63
mf::LogError
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
Definition:
MessageLogger.h:211
sim::ProtoDUNEBeamInstrument
Definition:
ProtoDUNEBeamInstrument.h:18
MessageLogger.h
sim::ProtoDUNEbeamsim::GetInstrument
ProtoDUNEBeamInstrument GetInstrument(std::string name) const
Definition:
ProtoDUNEbeamsim.cxx:50
submit_ppfxjobs.temp
temp
Definition:
submit_ppfxjobs.py:110
ProtoDUNEbeamsim.h
sim
Code to link reconstructed objects back to the MC truth information.
Definition:
PedestalAdditionService.h:17
sim::ProtoDUNEbeamsim::fAllInstruments
std::vector< ProtoDUNEBeamInstrument > fAllInstruments
Definition:
ProtoDUNEbeamsim.h:42
mf::LogWarning
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
Definition:
MessageLogger.h:210
ValidateOpDetReco.found
bool found
Definition:
ValidateOpDetReco.py:358
sim::ProtoDUNEbeamsim::~ProtoDUNEbeamsim
~ProtoDUNEbeamsim()
Definition:
ProtoDUNEbeamsim.cxx:27
sim::ProtoDUNEbeamsim::AddInstrument
void AddInstrument(ProtoDUNEBeamInstrument newInst)
Definition:
ProtoDUNEbeamsim.cxx:31
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
sim::ProtoDUNEbeamsim::ProtoDUNEbeamsim
ProtoDUNEbeamsim()
Definition:
ProtoDUNEbeamsim.cxx:24
Generated by
1.8.11