Jpp
15.0.0-rc.2
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
examples
JDetector
JModuleMapper.cc
Go to the documentation of this file.
1
2
#include <string>
3
#include <iostream>
4
#include <iomanip>
5
6
#include "TROOT.h"
7
#include "TFile.h"
8
#include "TProfile.h"
9
10
#include "
JDetector/JDetector.hh
"
11
#include "
JDetector/JDetectorToolkit.hh
"
12
#include "
JDetector/JModuleMapper.hh
"
13
14
#include "
Jeep/JParser.hh
"
15
#include "
Jeep/JMessage.hh
"
16
17
18
/**
19
* \file
20
*
21
* Example program to test JDETECTOR::JModuleMapper.
22
* \author mdejong
23
*/
24
int
main
(
int
argc,
char
**argv)
25
{
26
using namespace
std;
27
28
string
outputFile
;
29
string
detectorFile;
30
int
debug
;
31
32
try
{
33
34
JParser<>
zap(
"Example program to test module mapping."
);
35
36
zap[
'o'
] =
make_field
(
outputFile
) =
"mapper.root"
;
37
zap[
'a'
] =
make_field
(detectorFile);
38
zap[
'd'
] =
make_field
(
debug
) = 1;
39
40
zap(argc, argv);
41
}
42
catch
(
const
exception& error) {
43
FATAL
(error.what() << endl);
44
}
45
46
47
using namespace
JPP;
48
49
cout.tie(&cerr);
50
51
JDetector
detector
;
52
53
try
{
54
load
(detectorFile,
detector
);
55
}
56
catch
(
const
JException
& error) {
57
FATAL
(error);
58
}
59
60
61
TFile out(
outputFile
.c_str(),
"recreate"
);
62
63
TProfile
h1
(
"h1"
, NULL, 1001,-0.5, 1000.5);
64
65
JModuleMapper<>
mapper(
detector
);
66
67
for
(
int
i = 1; i <= h1.GetNbinsX(); ++i) {
68
69
const
double
x
= h1.GetBinCenter(i);
70
71
mapper.
configure
(
JMaximalDistance
(x));
72
73
for
(JDetector::const_iterator module =
detector
.begin(); module !=
detector
.end(); ++module) {
74
h1.Fill(x, (Double_t) mapper.
getList
(*module).size());
75
}
76
}
77
78
out.Write();
79
out.Close();
80
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1500
JLANG::JException
General exception.
Definition:
JException.hh:23
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
JDETECTOR::JModuleMapper::configure
void configure(JMatch_t match)
Configure this module mapper.
Definition:
JModuleMapper.hh:262
JDETECTOR::JDetector
Detector data structure.
Definition:
JDetector.hh:89
h1
then for HISTOGRAM in h0 h1
Definition:
JMatrixNZ.sh:71
outputFile
string outputFile
Definition:
JDAQTimesliceSelector.cc:37
JDetector.hh
Data structure for detector geometry and calibration.
x
then chmod x
Definition:
JEvtReweightMupageParameterScan.sh:388
JDETECTOR::JMaximalDistance
Auxiliary class to match modules according maximal distance.
Definition:
JModuleMapper.hh:117
JAANET::detector
Detector file.
Definition:
JHead.hh:196
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1961
debug
int debug
debug level
Definition:
JSirene.cc:63
JDETECTOR::JModuleMapper::getList
const container_type & getList(const JObjectID &id) const
Get list with module data matching given module.
Definition:
JModuleMapper.hh:245
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JDETECTOR::load
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
Definition:
JDetectorToolkit.hh:475
JParser.hh
Utility class to parse command line options.
JDETECTOR::JModuleMapper
Mapper for directly addressing of associated modules in the detector data structure.
Definition:
JModuleMapper.hh:162
JModuleMapper.hh
Map of associated modules in detector.
JDetectorToolkit.hh
detector
do set_variable DETECTOR_TXT $WORKDIR detector
Definition:
detector-XY:fit1d.sh:38
Generated by
1.8.5