87{
90
92 JLimit_t& numberOfEvents = inputFile.getLimit();
93 string detectorFile;
95 double Tmax_s;
97
98 try {
99
100 JParser<> zap(
"Example program to plot orientation data.");
101
102 zap[
'f'] =
make_field(inputFile,
"output of JBallarat[.sh]");
108
109 zap(argc, argv);
110 }
111 catch(const exception &error) {
112 FATAL(error.what() << endl);
113 }
114
115
117
118 try {
120 }
123 }
124
126
128 FATAL(
"No detector address map for detector identier " <<
detector.getID() << endl);
129 }
130
132
133
135
136 STATUS(
"loading input from file(s) " << inputFile <<
"... " << flush);
137
138 dynamics.load(inputFile);
139
141
142
144
146
147 if (router.getModule(module->first).getFloor() != 0) {
148
149 STATUS(
"Creating graphics for input data " << setw(10) << module->first << flush <<
'\r');
150
152
154
155 JGraph_t& z0 = Z0[module->first];
156
158
160
161 z0.put(i->getX(), getTwist(Q1 * Q0));
162 }
163 }
164 }
166
168
170
171 if (router.getModule(module->first).getFloor() != 0 && module->second.size() > 1u) {
172
173 STATUS(
"Creating graphics for input data " << setw(10) << module->first << flush <<
'\r');
174
175 TH1D* h1 = H1[module->first] =
new TH1D(
MAKE_CSTRING(
"U[" << module->first <<
"].twist"), NULL, 500, -180.0, +180.0);
176
178
181
182 h1->Fill(getTwist(Q1 * Q0.
conjugate()) * 180.0 / PI);
183 }
184 }
185 }
187
189
191
192 STATUS(
"Creating graphics for compiled data " << setw(10) << module->first << flush <<
'\r');
193
194 if (router.getModule(module->first).getFloor() != 0 && !module->second.empty()) {
195
197
199
200 const Double_t
xmin =
module->second.getXmin();
201 const Double_t
xmax =
module->second.getXmax();
202 const Int_t nx = (Int_t) ((xmax - xmin) / Tmax_s);
203
204 TH1D* h0 = H0[module->first] =
new TH1D(
MAKE_CSTRING(
"H[" << module->first <<
"].twist"), NULL, nx, xmin, xmax);
205
206 for (Int_t i = 1; i <= h0->GetXaxis()->GetNbins(); ++i) {
207
208 const Double_t
x = h0->GetXaxis()->GetBinCenter(i);
210
211 h0->SetBinContent(i, getTwist(Q));
212 }
213 }
214 }
216
219 const Int_t nx = (Int_t) ((xmax - xmin) / Tmax_s);
220
222
223 for (Int_t i = 1; i <= X0->GetXaxis()->GetNbins(); ++i) {
224
225 STATUS(
"Creating graphics for detector data " <<
FIXED(5,1) << (
double) (i * 100) / (
double) X0->GetXaxis()->GetNbins() <<
"%" << flush <<
'\r');
226
227 dynamics.update(X0->GetXaxis()->GetBinCenter(i));
228
229 for (JDetector::const_iterator module = dynamics.begin(); module != dynamics.end(); ++module) {
230
231 if (module->getFloor() != 0) {
232
233 TH1D* x0 = X0[module->getID()];
234
236
237 x0->SetBinContent(i, getTwist(Q));
238 }
239 }
240 }
242
243
245
247 out << *i->second;
248 }
249
251 out << *i->second;
252 }
253
254 out << X0;
255
258 }
259
260 out.Write();
261 out.Close();
262}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
#define MAKE_CSTRING(A)
Make C-string.
Router for direct addressing of module data in detector data structure.
Data structure for unit quaternion in three dimensions.
const JQuaternion3D & getQuaternion() const
Get quaternion.
JQuaternion3D & conjugate()
Conjugate quaternion.
Utility class to parse command line options.
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys.
General purpose class for object reading from a list of file names.
static JRotation getRotation
Function object to get rotation matrix to go from first to second module.
JDetectorBuilder & getDetectorBuilder()
Get detector builder.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
bool hasDetectorAddressMap(const int id)
Check if detector address map is available.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
JDAQUTCTimeRange getUTCTimeRange()
Get UTC time range.
Auxiliary data structure for floating point format specification.
Auxiliary interface for building detector.
const JModule & getModule(const int id=-1, const JLocation &location=JLocation()) const
Get module.
data_type::const_iterator const_iterator
Dynamic detector calibration.
Auxiliary data structure to build TGraph.
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.