Jpp
19.0.0
the software that should make you happy
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
software
JAcoustics
JEditDisable.cc
Go to the documentation of this file.
1
#include <iostream>
2
#include <iomanip>
3
#include <vector>
4
#include <set>
5
6
#include "
JAcoustics/JTransmission_t.hh
"
7
8
#include "
JDetector/JDetector.hh
"
9
#include "
JDetector/JDetectorToolkit.hh
"
10
#include "
JDetector/JModuleRouter.hh
"
11
12
#include "
JSupport/JMeta.hh
"
13
14
#include "
Jeep/JContainer.hh
"
15
#include "
Jeep/JPrint.hh
"
16
#include "
Jeep/JParser.hh
"
17
#include "
Jeep/JMessage.hh
"
18
19
/**
20
* \author mdejong
21
*
22
* Auxiliary program to merge disable files.
23
*
24
*/
25
int
main
(
int
argc,
char
**argv)
26
{
27
using namespace
std;
28
using namespace
JPP;
29
30
typedef
JContainer< vector<JTransmission_t> > container_type;
31
32
string
inputFile;
33
string
outputFile
;
34
string
detectorFile;
35
bool
squash;
36
int
debug
;
37
38
try
{
39
40
JParser<>
zap(
"Auxiliary program to merge disable files."
);
41
42
zap[
'f'
] =
make_field
(inputFile,
"disable input file"
);
43
zap[
'o'
] =
make_field
(
outputFile
,
"disable output file"
);
44
zap[
'a'
] =
make_field
(detectorFile,
"detector file"
) =
""
;
45
zap[
'q'
] =
make_field
(squash,
"squash meta data"
);
46
zap[
'd'
] =
make_field
(
debug
) = 1;
47
48
zap(argc, argv);
49
}
50
catch
(
const
exception &error) {
51
FATAL
(error.what() << endl);
52
}
53
54
55
container_type
data
;
56
57
data
.load(inputFile.c_str());
58
59
if
(squash) {
60
data
.comment.clear();
61
}
62
63
data
.comment.add(JMeta(argc, argv));
64
65
if
(!
data
.empty()) {
66
67
if
(detectorFile !=
""
) {
68
69
JDetector
detector
;
70
71
try
{
72
load
(detectorFile, detector);
73
}
74
catch
(
const
JException& error) {
75
FATAL
(error);
76
}
77
78
const
JModuleRouter router(detector);
79
80
for
(container_type::iterator
i
=
data
.begin();
i
!=
data
.end(); ) {
81
if
(router.hasModule(
i
->rx))
82
++
i
;
83
else
84
i
=
data
.erase(
i
);
85
}
86
}
87
}
88
89
data
.store(
outputFile
.c_str());
90
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1711
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
outputFile
string outputFile
Definition:
JDAQTimesliceSelector.cc:37
JDetector.hh
Data structure for detector geometry and calibration.
i
then rm i
Definition:
JEvtReweightMupageParameterScan.sh:309
JPrint.hh
I/O formatting auxiliaries.
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:2158
JMeta.hh
ROOT I/O of application specific meta data.
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JModuleRouter.hh
Direct access to module in detector data structure.
JDETECTOR::load
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
Definition:
JDetectorToolkit.hh:484
JParser.hh
Utility class to parse command line options.
JTransmission_t.hh
Acoustic transmission identifier.
JDetectorToolkit.hh
applications.data
tuple data
Definition:
applications.py:8
detector
do set_variable DETECTOR_TXT $WORKDIR detector
Definition:
detector-XY:fit1d.sh:38
JContainer.hh
Container I/O.
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
Generated by
1.8.5