| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

HistoDecorator.cpp
Go to the documentation of this file.
1 // ============================================================================
2 // Include files
3 // ============================================================================
4 // GaudiAlg
5 // ============================================================================
6 #include "GaudiAlg/GaudiHistoAlg.h"
7 #include "GaudiAlg/GaudiHistoTool.h"
8 // ============================================================================
9 // GaudiPython
10 // ============================================================================
11 #include "GaudiPython/HistoDecorator.h"
12 #include "GaudiPython/Vector.h"
13 // ============================================================================
19 // ============================================================================
20 /* "plot"(book&fill) a sequence of data from the vector (implicit loop)
21 * (Expected to be more efficient)
22 * @param algo the algorithm
23 * @param data data
24 * @param title histogram title
25 * @param low low edge
26 * @param high high edge
27 * @param bins number of bins
28 */
29 // ============================================================================
30 AIDA::IHistogram1D* GaudiPython::HistoDecorator::plot1D( const GaudiHistoAlg& algo, const double data,
31 const std::string& title, const double low, const double high,
32 const unsigned long bins )
33 {
34 return algo.plot1D( data, title, low, high, bins );
35 }
36 // ============================================================================
37 /* "plot"(book&fill) a sequence of data from the vector (implicit loop)
38 * (Expected to be more efficient)
39 * @param algo the algorithm
40 * @param data data
41 * @param ID histogram ID
42 * @param title histogram title
43 * @param low low edge
44 * @param high high edge
45 * @param bins number of bins
46 */
47 // ============================================================================
48 AIDA::IHistogram1D* GaudiPython::HistoDecorator::plot1D( const GaudiHistoAlg& algo, const double data,
49 const GaudiAlg::HistoID& ID, const std::string& title,
50 const double low, const double high, const unsigned long bins )
51 {
52 return algo.plot1D( data, ID, title, low, high, bins );
53 }
54 // ============================================================================
55 /* "plot"(book&fill) a sequence of data from the vector (implicit loop)
56 * (Expected to be more efficient)
57 * @param algo the algorithm
58 * @param data data
59 * @param ID histogram ID
60 * @param title histogram title
61 * @param low low edge
62 * @param high high edge
63 * @param bins number of bins
64 */
65 // ============================================================================
66 AIDA::IHistogram1D* GaudiPython::HistoDecorator::plot1D( const GaudiHistoAlg& algo, const double data, const long ID,
67 const std::string& title, const double low, const double high,
68 const unsigned long bins )
69 {
70 return algo.plot1D( data, ID, title, low, high, bins );
71 }
72 // ============================================================================
73 /* "plot"(book&fill) a sequence of data from the vector (implicit loop)
74 * (Expected to be more efficient)
75 * @param algo the algorithm
76 * @param data data
77 * @param ID histogram ID
78 * @param title histogram title
79 * @param low low edge
80 * @param high high edge
81 * @param bins number of bins
82 */
83 // ============================================================================
84 AIDA::IHistogram1D* GaudiPython::HistoDecorator::plot1D( const GaudiHistoAlg& algo, const double data,
85 const std::string& ID, const std::string& title,
86 const double low, const double high, const unsigned long bins )
87 {
88 return algo.plot1D( data, ID, title, low, high, bins );
89 }
90 // ============================================================================
91 /* "plot"(book&fill) a sequence of data from the vector (implicit loop)
92 * (Expected to be more efficient)
93 * @param algo the algorithm
94 * @param data vector of data
95 * @param title histogram title
96 * @param low low edge
97 * @param high high edge
98 * @param bins number of bins
99 */
100 // ============================================================================
101 AIDA::IHistogram1D* GaudiPython::HistoDecorator::plot1D( const GaudiHistoAlg& algo, const GaudiPython::Vector& data,
102 const std::string& title, const double low, const double high,
103 const unsigned long bins )
104 {
105 return algo.plot( GaudiPython::_identity<GaudiPython::Vector::value_type>(), data.begin(), data.end(), title, low,
106 high, bins );
107 }
108 // ============================================================================
109 /* "plot"(book&fill) a sequence of data from the vector (implicit loop)
110 * (Expected to be more efficient)
111 * @param algo the algorithm
112 * @param data vector of data
113 * @param ID histogram ID
114 * @param title histogram title
115 * @param low low edge
116 * @param high high edge
117 * @param bins number of bins
118 */
119 // ============================================================================
120 AIDA::IHistogram1D* GaudiPython::HistoDecorator::plot1D( const GaudiHistoAlg& algo, const GaudiPython::Vector& data,
121 const GaudiAlg::HistoID& ID, const std::string& title,
122 const double low, const double high, const unsigned long bins )
123 {
124 return algo.plot( GaudiPython::_identity<GaudiPython::Vector::value_type>(), data.begin(), data.end(), ID, title, low,
125 high, bins );
126 }
127 // ============================================================================
128 /* "plot"(book&fill) a sequence of data from the vector (implicit loop)
129 * (Expected to be more efficient)
130 * @param algo the algorithm
131 * @param data vector of data
132 * @param ID histogram ID
133 * @param title histogram title
134 * @param low low edge
135 * @param high high edge
136 * @param bins number of bins
137 */
138 // ============================================================================
139 AIDA::IHistogram1D* GaudiPython::HistoDecorator::plot1D( const GaudiHistoAlg& algo, const GaudiPython::Vector& data,
140 const long ID, const std::string& title, const double low,
141 const double high, const unsigned long bins )
142 {
143 return algo.plot( GaudiPython::_identity<GaudiPython::Vector::value_type>(), data.begin(), data.end(), ID, title, low,
144 high, bins );
145 }
146 // ============================================================================
147 /* "plot"(book&fill) a sequence of data from the vector (implicit loop)
148 * (Expected to be more efficient)
149 * @param algo the algorithm
150 * @param data vector of data
151 * @param ID histogram ID
152 * @param title histogram title
153 * @param low low edge
154 * @param high high edge
155 * @param bins number of bins
156 */
157 // ============================================================================
158 AIDA::IHistogram1D* GaudiPython::HistoDecorator::plot1D( const GaudiHistoAlg& algo, const GaudiPython::Vector& data,
159 const std::string& ID, const std::string& title,
160 const double low, const double high, const unsigned long bins )
161 {
162 return algo.plot( GaudiPython::_identity<GaudiPython::Vector::value_type>(), data.begin(), data.end(), ID, title, low,
163 high, bins );
164 }
165 // ============================================================================
166 /* fill the 2D histogram (book on demand)
167 * @param valueX x value to be filled
168 * @param valueY y value to be filled
169 * @param title histogram title (must be unique within the algorithm)
170 * @param lowX low x limit for histogram
171 * @param highX high x limit for histogram
172 * @param lowY low y limit for histogram
173 * @param highY high y limit for histogram
174 * @param binsX number of bins in x
175 * @param binsY number of bins in y
176 * @param weight weight
177 * @return pointer to AIDA 2D histogram
178 */
179 // ============================================================================
180 AIDA::IHistogram2D* GaudiPython::HistoDecorator::plot2D( const GaudiHistoAlg& algo, const double valueX,
181 const double valueY, const std::string& title,
182 const double lowX, const double highX, const double lowY,
183 const double highY, const unsigned long binsX,
184 const unsigned long binsY, const double weight )
185 {
186 return algo.plot2D( valueX, valueY, title, lowX, highX, lowY, highY, binsX, binsY, weight );
187 }
188 // ============================================================================
203 // ============================================================================
204 AIDA::IHistogram2D* GaudiPython::HistoDecorator::plot2D( const GaudiHistoAlg& algo, const double valueX,
205 const double valueY, const GaudiAlg::HistoID& ID,
206 const std::string& title, const double lowX,
207 const double highX, const double lowY, const double highY,
208 const unsigned long binsX, const unsigned long binsY,
209 const double weight )
210 {
211 return algo.plot2D( valueX, valueY, ID, title, lowX, highX, lowY, highY, binsX, binsY, weight );
212 }
213 // ============================================================================
214 /* fill the 2D histogram (book on demand)
215 * @param valueX x value to be filled
216 * @param valueY y value to be filled
217 * @param ID Histogram ID to use
218 * @param title histogram title (must be unique within the algorithm)
219 * @param lowX low x limit for histogram
220 * @param highX high x limit for histogram
221 * @param lowY low y limit for histogram
222 * @param highY high y limit for histogram
223 * @param binsX number of bins in x
224 * @param binsY number of bins in y
225 * @param weight weight
226 * @return pointer to AIDA 2D histogram
227 */
228 // ============================================================================
229 AIDA::IHistogram2D* GaudiPython::HistoDecorator::plot2D( const GaudiHistoAlg& algo, const double valueX,
230 const double valueY, const long ID, const std::string& title,
231 const double lowX, const double highX, const double lowY,
232 const double highY, const unsigned long binsX,
233 const unsigned long binsY, const double weight )
234 {
235 return algo.plot2D( valueX, valueY, ID, title, lowX, highX, lowY, highY, binsX, binsY, weight );
236 }
237 // ============================================================================
238 /* fill the 2D histogram (book on demand)
239 * @param valueX x value to be filled
240 * @param valueY y value to be filled
241 * @param ID Histogram ID to use
242 * @param title histogram title (must be unique within the algorithm)
243 * @param lowX low x limit for histogram
244 * @param highX high x limit for histogram
245 * @param lowY low y limit for histogram
246 * @param highY high y limit for histogram
247 * @param binsX number of bins in x
248 * @param binsY number of bins in y
249 * @param weight weight
250 * @return pointer to AIDA 2D histogram
251 */
252 // ============================================================================
253 AIDA::IHistogram2D* GaudiPython::HistoDecorator::plot2D( const GaudiHistoAlg& algo, const double valueX,
254 const double valueY, const std::string& ID,
255 const std::string& title, const double lowX,
256 const double highX, const double lowY, const double highY,
257 const unsigned long binsX, const unsigned long binsY,
258 const double weight )
259 {
260 return algo.plot2D( valueX, valueY, ID, title, lowX, highX, lowY, highY, binsX, binsY, weight );
261 }
262 // ============================================================================
263 /* fill the 3D histogram (book on demand)
264 * @param valueX x value to be filled
265 * @param valueY y value to be filled
266 * @param valueZ z value to be filled
267 * @param title histogram title (must be unique within the algorithm)
268 * @param lowX low x limit for histogram
269 * @param highX high x limit for histogram
270 * @param lowY low y limit for histogram
271 * @param highY high y limit for histogram
272 * @param lowZ low z limit for histogram
273 * @param highZ high z limit for histogram
274 * @param binsX number of bins in x
275 * @param binsY number of bins in y
276 * @param binsZ number of bins in z
277 * @param weight weight
278 * @return pointer to AIDA 3D histogram
279 */
280 // ============================================================================
281 AIDA::IHistogram3D* GaudiPython::HistoDecorator::plot3D(
282 const GaudiHistoAlg& algo, const double valueX, const double valueY, const double valueZ, const std::string& title,
283 const double lowX, const double highX, const double lowY, const double highY, const double lowZ, const double highZ,
284 const unsigned long binsX, const unsigned long binsY, const unsigned long binsZ, const double weight )
285 {
286 return algo.plot3D( valueX, valueY, valueZ, title, lowX, highX, lowY, highY, lowZ, highZ, binsX, binsY, binsZ,
287 weight );
288 }
289 // ============================================================================
290 /* fill the 3D histogram (book on demand)
291 * @param valueX x value to be filled
292 * @param valueY y value to be filled
293 * @param valueZ z value to be filled
294 * @param title histogram title (must be unique within the algorithm)
295 * @param lowX low x limit for histogram
296 * @param highX high x limit for histogram
297 * @param lowY low y limit for histogram
298 * @param highY high y limit for histogram
299 * @param lowZ low z limit for histogram
300 * @param highZ high z limit for histogram
301 * @param binsX number of bins in x
302 * @param binsY number of bins in y
303 * @param binsZ number of bins in z
304 * @param weight weight
305 * @return pointer to AIDA 3D histogram
306 */
307 // ============================================================================
308 AIDA::IHistogram3D* GaudiPython::HistoDecorator::plot3D( const GaudiHistoAlg& algo, const double valueX,
309 const double valueY, const double valueZ,
310 const GaudiAlg::HistoID& ID, const std::string& title,
311 const double lowX, const double highX, const double lowY,
312 const double highY, const double lowZ, const double highZ,
313 const unsigned long binsX, const unsigned long binsY,
314 const unsigned long binsZ, const double weight )
315 {
316 return algo.plot3D( valueX, valueY, valueZ, ID, title, lowX, highX, lowY, highY, lowZ, highZ, binsX, binsY, binsZ,
317 weight );
318 }
319 // ============================================================================
320 /* fill the 3D histogram (book on demand)
321 * @param valueX x value to be filled
322 * @param valueY y value to be filled
323 * @param valueZ z value to be filled
324 * @param title histogram title (must be unique within the algorithm)
325 * @param lowX low x limit for histogram
326 * @param highX high x limit for histogram
327 * @param lowY low y limit for histogram
328 * @param highY high y limit for histogram
329 * @param lowZ low z limit for histogram
330 * @param highZ high z limit for histogram
331 * @param binsX number of bins in x
332 * @param binsY number of bins in y
333 * @param binsZ number of bins in z
334 * @param weight weight
335 * @return pointer to AIDA 3D histogram
336 */
337 // ============================================================================
338 AIDA::IHistogram3D* GaudiPython::HistoDecorator::plot3D( const GaudiHistoAlg& algo, const double valueX,
339 const double valueY, const double valueZ, const long ID,
340 const std::string& title, const double lowX,
341 const double highX, const double lowY, const double highY,
342 const double lowZ, const double highZ,
343 const unsigned long binsX, const unsigned long binsY,
344 const unsigned long binsZ, const double weight )
345 {
346 return algo.plot3D( valueX, valueY, valueZ, ID, title, lowX, highX, lowY, highY, lowZ, highZ, binsX, binsY, binsZ,
347 weight );
348 }
349 // ============================================================================
350 /* fill the 3D histogram (book on demand)
351 * @param valueX x value to be filled
352 * @param valueY y value to be filled
353 * @param valueZ z value to be filled
354 * @param title histogram title (must be unique within the algorithm)
355 * @param lowX low x limit for histogram
356 * @param highX high x limit for histogram
357 * @param lowY low y limit for histogram
358 * @param highY high y limit for histogram
359 * @param lowZ low z limit for histogram
360 * @param highZ high z limit for histogram
361 * @param binsX number of bins in x
362 * @param binsY number of bins in y
363 * @param binsZ number of bins in z
364 * @param weight weight
365 * @return pointer to AIDA 3D histogram
366 */
367 // ============================================================================
368 AIDA::IHistogram3D* GaudiPython::HistoDecorator::plot3D( const GaudiHistoAlg& algo, const double valueX,
369 const double valueY, const double valueZ,
370 const std::string& ID, const std::string& title,
371 const double lowX, const double highX, const double lowY,
372 const double highY, const double lowZ, const double highZ,
373 const unsigned long binsX, const unsigned long binsY,
374 const unsigned long binsZ, const double weight )
375 {
376 return algo.plot3D( valueX, valueY, valueZ, ID, title, lowX, highX, lowY, highY, lowZ, highZ, binsX, binsY, binsZ,
377 weight );
378 }
379 // ========================================================================
380 // 1D-profiles: by title
381 // ========================================================================
382 AIDA::IProfile1D* GaudiPython::HistoDecorator::profile1D( const GaudiHistoAlg& algo, const double valueX,
383 const double valueY, const std::string& title,
384 const double lowX, const double highX,
385 const unsigned long binsX, const std::string& opt,
386 const double lowY, const double highY, const double weight )
387 {
388 return algo.profile1D( valueX, valueY, title, lowX, highX, binsX, opt, lowY, highY, weight );
389 }
390 // ========================================================================
391 // 1D-profiles: by generic ID
392 // ========================================================================
393 AIDA::IProfile1D* GaudiPython::HistoDecorator::profile1D( const GaudiHistoAlg& algo, const double valueX,
394 const double valueY, const GaudiAlg::HistoID& ID,
395 const std::string& title, const double lowX,
396 const double highX, const unsigned long binsX,
397 const std::string& opt, const double lowY, const double highY,
398 const double weight )
399 {
400 return algo.profile1D( valueX, valueY, ID, title, lowX, highX, binsX, opt, lowY, highY, weight );
401 }
402 // ========================================================================
403 // 1D-profiles: by numeric ID
404 // ========================================================================
405 AIDA::IProfile1D* GaudiPython::HistoDecorator::profile1D( const GaudiHistoAlg& algo, const double valueX,
406 const double valueY, const long ID, const std::string& title,
407 const double lowX, const double highX,
408 const unsigned long binsX, const std::string& opt,
409 const double lowY, const double highY, const double weight )
410 {
411 return algo.profile1D( valueX, valueY, ID, title, lowX, highX, binsX, opt, lowY, highY, weight );
412 }
413 // ========================================================================
414 // 1D-profiles: by string ID
415 // ========================================================================
416 AIDA::IProfile1D* GaudiPython::HistoDecorator::profile1D( const GaudiHistoAlg& algo, const double valueX,
417 const double valueY, const std::string& ID,
418 const std::string& title, const double lowX,
419 const double highX, const unsigned long binsX,
420 const std::string& opt, const double lowY, const double highY,
421 const double weight )
422 {
423 return algo.profile1D( valueX, valueY, ID, title, lowX, highX, binsX, opt, lowY, highY, weight );
424 }
425 // ========================================================================
426 // 2D-profiles: by title
427 // ========================================================================
428 AIDA::IProfile2D* GaudiPython::HistoDecorator::profile2D( const GaudiHistoAlg& algo, const double valueX,
429 const double valueY, const double valueZ,
430 const std::string& title, const double lowX,
431 const double highX, const double lowY, const double highY,
432 const unsigned long binsX, const unsigned long binsY,
433 const double weight )
434 {
435 return algo.profile2D( valueX, valueY, valueZ, title, lowX, highX, lowY, highY, binsX, binsY, weight );
436 }
437 // ========================================================================
438 // 2D-profiles: by generic ID
439 // ========================================================================
440 AIDA::IProfile2D* GaudiPython::HistoDecorator::profile2D( const GaudiHistoAlg& algo, const double valueX,
441 const double valueY, const double valueZ,
442 const GaudiAlg::HistoID& ID, const std::string& title,
443 const double lowX, const double highX, const double lowY,
444 const double highY, const unsigned long binsX,
445 const unsigned long binsY, const double weight )
446 {
447 return algo.profile2D( valueX, valueY, valueZ, ID, title, lowX, highX, lowY, highY, binsX, binsY, weight );
448 }
449 // ========================================================================
450 // 2D-profiles: by numeric ID
451 // ========================================================================
452 AIDA::IProfile2D* GaudiPython::HistoDecorator::profile2D( const GaudiHistoAlg& algo, const double valueX,
453 const double valueY, const double valueZ, const long ID,
454 const std::string& title, const double lowX,
455 const double highX, const double lowY, const double highY,
456 const unsigned long binsX, const unsigned long binsY,
457 const double weight )
458 {
459 return algo.profile2D( valueX, valueY, valueZ, ID, title, lowX, highX, lowY, highY, binsX, binsY, weight );
460 }
461 // ========================================================================
462 // 2D-profiles: by string ID
463 // ========================================================================
464 AIDA::IProfile2D* GaudiPython::HistoDecorator::profile2D( const GaudiHistoAlg& algo, const double valueX,
465 const double valueY, const double valueZ,
466 const std::string& ID, const std::string& title,
467 const double lowX, const double highX, const double lowY,
468 const double highY, const unsigned long binsX,
469 const unsigned long binsY, const double weight )
470 {
471 return algo.profile2D( valueX, valueY, valueZ, ID, title, lowX, highX, lowY, highY, binsX, binsY, weight );
472 }
473 // ============================================================================
474 // get all histograms
475 // ============================================================================
476 namespace
477 {
479 // =========================================================================
480 template <typename Container, typename HISTO>
481 size_t fromMap( const Container& a, std::vector<GaudiAlg::ID>& b, std::vector<HISTO>& c )
482 {
483 b.clear();
484 c.clear();
485 for ( const auto& i : a ) {
486 if ( !i.second ) {
487 continue;
488 }
489 b.push_back( i.first );
490 c.push_back( i.second );
491 }
492 return b.size();
493 }
494 // ==========================================================================
495 }
496 // ============================================================================
497 size_t GaudiPython::HistoDecorator::_histos_a_( const GaudiHistoAlg* cmp, GaudiPython::HistoDecorator::IDs& ids,
498 GaudiPython::HistoDecorator::Histos1D& histos )
499 {
500 histos.clear();
501 ids.clear();
502 return cmp ? fromMap( cmp->histo1DMapID(), ids, histos ) : 0;
503 // ==========================================================================
504 }
505 // ============================================================================
506 size_t GaudiPython::HistoDecorator::_histos_t_( const GaudiHistoTool* cmp, GaudiPython::HistoDecorator::IDs& ids,
507 GaudiPython::HistoDecorator::Histos1D& histos )
508 {
509 histos.clear();
510 ids.clear();
511 return cmp ? fromMap( cmp->histo1DMapID(), ids, histos ) : 0;
512 // ==========================================================================
513 }
514 // ============================================================================
515 size_t GaudiPython::HistoDecorator::_histos_a_( const IAlgorithm* cmp, GaudiPython::HistoDecorator::IDs& ids,
516 GaudiPython::HistoDecorator::Histos1D& histos )
517 {
518 ids.clear();
519 histos.clear();
520 return cmp ? _histos_a_( dynamic_cast<const GaudiHistoAlg*>( cmp ), ids, histos ) : 0;
521 }
522 // ============================================================================
523 size_t GaudiPython::HistoDecorator::_histos_t_( const IAlgTool* cmp, GaudiPython::HistoDecorator::IDs& ids,
524 GaudiPython::HistoDecorator::Histos1D& histos )
525 {
526 ids.clear();
527 histos.clear();
528 return cmp ? _histos_t_( dynamic_cast<const GaudiHistoTool*>( cmp ), ids, histos ) : 0;
529 }
530 // ============================================================================
531 // 2D-histograms
532 // ============================================================================
533 size_t GaudiPython::HistoDecorator::_histos_a_( const GaudiHistoAlg* cmp, GaudiPython::HistoDecorator::IDs& ids,
534 GaudiPython::HistoDecorator::Histos2D& histos )
535 {
536 histos.clear();
537 ids.clear();
538 return cmp ? fromMap( cmp->histo2DMapID(), ids, histos ) : 0;
539 // ==========================================================================
540 }
541 // ============================================================================
542 size_t GaudiPython::HistoDecorator::_histos_t_( const GaudiHistoTool* cmp, GaudiPython::HistoDecorator::IDs& ids,
543 GaudiPython::HistoDecorator::Histos2D& histos )
544 {
545 histos.clear();
546 ids.clear();
547 return cmp ? fromMap( cmp->histo2DMapID(), ids, histos ) : 0;
548 // ==========================================================================
549 }
550 // ============================================================================
551 size_t GaudiPython::HistoDecorator::_histos_a_( const IAlgorithm* cmp, GaudiPython::HistoDecorator::IDs& ids,
552 GaudiPython::HistoDecorator::Histos2D& histos )
553 {
554 ids.clear();
555 histos.clear();
556 return cmp ? _histos_a_( dynamic_cast<const GaudiHistoAlg*>( cmp ), ids, histos ) : 0;
557 }
558 // ============================================================================
559 size_t GaudiPython::HistoDecorator::_histos_t_( const IAlgTool* cmp, GaudiPython::HistoDecorator::IDs& ids,
560 GaudiPython::HistoDecorator::Histos2D& histos )
561 {
562 ids.clear();
563 histos.clear();
564 return cmp ? _histos_t_( dynamic_cast<const GaudiHistoTool*>( cmp ), ids, histos ) : 0;
565 }
566 // ============================================================================
567 // 3D-histograms
568 // ============================================================================
569 size_t GaudiPython::HistoDecorator::_histos_a_( const GaudiHistoAlg* cmp, GaudiPython::HistoDecorator::IDs& ids,
570 GaudiPython::HistoDecorator::Histos3D& histos )
571 {
572 histos.clear();
573 ids.clear();
574 return cmp ? fromMap( cmp->histo3DMapID(), ids, histos ) : 0;
575 // ==========================================================================
576 }
577 // ============================================================================
578 size_t GaudiPython::HistoDecorator::_histos_t_( const GaudiHistoTool* cmp, GaudiPython::HistoDecorator::IDs& ids,
579 GaudiPython::HistoDecorator::Histos3D& histos )
580 {
581 histos.clear();
582 ids.clear();
583 return cmp ? fromMap( cmp->histo3DMapID(), ids, histos ) : 0;
584 // ==========================================================================
585 }
586 // ============================================================================
587 size_t GaudiPython::HistoDecorator::_histos_a_( const IAlgorithm* cmp, GaudiPython::HistoDecorator::IDs& ids,
588 GaudiPython::HistoDecorator::Histos3D& histos )
589 {
590 ids.clear();
591 histos.clear();
592 return cmp ? _histos_a_( dynamic_cast<const GaudiHistoAlg*>( cmp ), ids, histos ) : 0;
593 }
594 // ============================================================================
595 size_t GaudiPython::HistoDecorator::_histos_t_( const IAlgTool* cmp, GaudiPython::HistoDecorator::IDs& ids,
596 GaudiPython::HistoDecorator::Histos3D& histos )
597 {
598 ids.clear();
599 histos.clear();
600 return cmp ? _histos_t_( dynamic_cast<const GaudiHistoTool*>( cmp ), ids, histos ) : 0;
601 }
602 // ============================================================================
603 // 1D-profiles
604 // ============================================================================
605 size_t GaudiPython::HistoDecorator::_histos_a_( const GaudiHistoAlg* cmp, GaudiPython::HistoDecorator::IDs& ids,
606 GaudiPython::HistoDecorator::Profiles1D& histos )
607 {
608 histos.clear();
609 ids.clear();
610 return cmp ? fromMap( cmp->profile1DMapID(), ids, histos ) : 0;
611 // ==========================================================================
612 }
613 // ============================================================================
614 size_t GaudiPython::HistoDecorator::_histos_t_( const GaudiHistoTool* cmp, GaudiPython::HistoDecorator::IDs& ids,
615 GaudiPython::HistoDecorator::Profiles1D& histos )
616 {
617 histos.clear();
618 ids.clear();
619 return cmp ? fromMap( cmp->profile1DMapID(), ids, histos ) : 0;
620 // ==========================================================================
621 }
622 // ============================================================================
623 size_t GaudiPython::HistoDecorator::_histos_a_( const IAlgorithm* cmp, GaudiPython::HistoDecorator::IDs& ids,
624 GaudiPython::HistoDecorator::Profiles1D& histos )
625 {
626 ids.clear();
627 histos.clear();
628 return cmp ? _histos_a_( dynamic_cast<const GaudiHistoAlg*>( cmp ), ids, histos ) : 0;
629 }
630 // ============================================================================
631 size_t GaudiPython::HistoDecorator::_histos_t_( const IAlgTool* cmp, GaudiPython::HistoDecorator::IDs& ids,
632 GaudiPython::HistoDecorator::Profiles1D& histos )
633 {
634 ids.clear();
635 histos.clear();
636 return cmp ? _histos_t_( dynamic_cast<const GaudiHistoTool*>( cmp ), ids, histos ) : 0;
637 }
638 // ============================================================================
639 // 2D-profiles
640 // ============================================================================
641 size_t GaudiPython::HistoDecorator::_histos_a_( const GaudiHistoAlg* cmp, GaudiPython::HistoDecorator::IDs& ids,
642 GaudiPython::HistoDecorator::Profiles2D& histos )
643 {
644 histos.clear();
645 ids.clear();
646 return cmp ? fromMap( cmp->profile2DMapID(), ids, histos ) : 0;
647 // ==========================================================================
648 }
649 // ============================================================================
650 size_t GaudiPython::HistoDecorator::_histos_t_( const GaudiHistoTool* cmp, GaudiPython::HistoDecorator::IDs& ids,
651 GaudiPython::HistoDecorator::Profiles2D& histos )
652 {
653 histos.clear();
654 ids.clear();
655 return cmp ? fromMap( cmp->profile2DMapID(), ids, histos ) : 0;
656 // ==========================================================================
657 }
658 // ============================================================================
659 size_t GaudiPython::HistoDecorator::_histos_a_( const IAlgorithm* cmp, GaudiPython::HistoDecorator::IDs& ids,
660 GaudiPython::HistoDecorator::Profiles2D& histos )
661 {
662 ids.clear();
663 histos.clear();
664 return cmp ? _histos_a_( dynamic_cast<const GaudiHistoAlg*>( cmp ), ids, histos ) : 0;
665 }
666 // ============================================================================
667 size_t GaudiPython::HistoDecorator::_histos_t_( const IAlgTool* cmp, GaudiPython::HistoDecorator::IDs& ids,
668 GaudiPython::HistoDecorator::Profiles2D& histos )
669 {
670 ids.clear();
671 histos.clear();
672 return cmp ? _histos_t_( dynamic_cast<const GaudiHistoTool*>( cmp ), ids, histos ) : 0;
673 }
674 // ============================================================================
675
676 // ============================================================================
677 // The END
678 // ============================================================================
GaudiPython::HistoDecorator::profile2D
static AIDA::IProfile2D * profile2D(const GaudiHistoAlg &algo, const double valueX, const double valueY, const double valueZ, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const unsigned long binsX=50, const unsigned long binsY=50, const double weight=1.0)
Definition: HistoDecorator.cpp:428
GaudiPython::_identity
It is here due to &#39;missing&#39;(?) std::identity.
Definition: Vector.h:29
gaudirun.c
c
Definition: gaudirun.py:407
Vector.h
GaudiHistos::profile1D
AIDA::IProfile1D * profile1D(const double valueX, const double valueY, const std::string &title, const double lowX, const double highX, const unsigned long binsX=100, const std::string &opt="", const double lowY=-std::numeric_limits< double >::max(), const double highY=std::numeric_limits< double >::max(), const double weight=1.0) const
fill the 1D profile histogram (book on demand)
Definition: GaudiHistos_1DProfFixedBinning.icpp:117
GaudiPython::HistoDecorator::plot1D
static AIDA::IHistogram1D * plot1D(const GaudiHistoAlg &algo, const double data, const std::string &title, const double low, const double high, const unsigned long bins=100)
"plot"(book&fill) a sequence of data from the vector (implicit loop) (Expected to be more efficient) ...
Definition: HistoDecorator.cpp:30
GaudiHistos::plot
AIDA::IHistogram1D * plot(const double value, const std::string &title, const double low, const double high, const unsigned long bins=100, const double weight=1.0) const
fill the 1D histogram (book on demand)
Definition: GaudiHistos.h:154
GaudiPython::HistoDecorator::profile1D
static AIDA::IProfile1D * profile1D(const GaudiHistoAlg &algo, const double valueX, const double valueY, const std::string &title, const double lowX, const double highX, const unsigned long binsX=100, const std::string &opt="", const double lowY=-std::numeric_limits< double >::max(), const double highY=std::numeric_limits< double >::max(), const double weight=1.0)
Definition: HistoDecorator.cpp:382
GaudiHistos::profile2DMapID
const Profile2DMapID & profile2DMapID() const
get access to the map of 2D profile histograms index via a ID
Definition: GaudiHistos.h:2675
GaudiHistoTool.h
Header file for class : GaudiHistoTool.
GaudiHistoAlg
Simple class to extend the functionality of class GaudiAlgorithm.
Definition: GaudiHistoAlg.h:37
std::vector::end
T end(T...args)
GaudiHistoTool
Simple class to extend the functionality of class GaudiTool.
Definition: GaudiHistoTool.h:39
std::string
STL class.
std::vector::push_back
T push_back(T...args)
compareRootHistos.histos
list histos
Definition: compareRootHistos.py:13
GaudiHistos::histo1DMapID
const Histo1DMapID & histo1DMapID() const
get access to the map of all 1D histograms index via ID
Definition: GaudiHistos.h:2473
std::vector::clear
T clear(T...args)
IAlgorithm
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:28
HistoDecorator.h
GaudiPython::HistoDecorator::plot3D
static AIDA::IHistogram3D * plot3D(const GaudiHistoAlg &algo, const double valueX, const double valueY, const double valueZ, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const double lowZ, const double highZ, const unsigned long binsX=10, const unsigned long binsY=10, const unsigned long binsZ=10, const double weight=1.0)
fill the 3D histogram (book on demand)
Definition: HistoDecorator.cpp:281
std::vector::size
T size(T...args)
std::vector< double >
GaudiHistos::plot3D
AIDA::IHistogram3D * plot3D(const double valueX, const double valueY, const double valueZ, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const double lowZ, const double highZ, const unsigned long binsX=10, const unsigned long binsY=10, const unsigned long binsZ=10, const double weight=1.0) const
fill the 3D histogram (book on demand)
Definition: GaudiHistos_3DFixedBinning.icpp:123
GaudiPython::HistoDecorator::plot2D
static AIDA::IHistogram2D * plot2D(const GaudiHistoAlg &algo, const double valueX, const double valueY, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const unsigned long binsX=50, const unsigned long binsY=50, const double weight=1.0)
fill the 2D histogram (book on demand)
Definition: HistoDecorator.cpp:180
GaudiHistos::plot2D
AIDA::IHistogram2D * plot2D(const double valueX, const double valueY, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const unsigned long binsX=50, const unsigned long binsY=50, const double weight=1.0) const
fill the 2D histogram (book on demand)
Definition: GaudiHistos_2DFixedBinning.icpp:119
std::vector::begin
T begin(T...args)
GaudiHistos::profile1DMapID
const Profile1DMapID & profile1DMapID() const
get access to the map of 1D profile histograms index via a ID
Definition: GaudiHistos.h:2625
IAlgTool
The interface implemented by the AlgTool base class.
Definition: IAlgTool.h:23
GaudiHistoAlg.h
GaudiHistos::histo2DMapID
const Histo2DMapID & histo2DMapID() const
get access to the map of 2D histograms index via ID
Definition: GaudiHistos.h:2523
GaudiPython::HistoDecorator::_histos_a_
static size_t _histos_a_(const GaudiHistoAlg *cmp, IDs &ids, Histos1D &histos)
Definition: HistoDecorator.cpp:497
GaudiPython::HistoDecorator::_histos_t_
static size_t _histos_t_(const GaudiHistoTool *cmp, IDs &ids, Histos1D &histos)
Definition: HistoDecorator.cpp:506
GaudiHistos::profile2D
AIDA::IProfile2D * profile2D(const double valueX, const double valueY, const double valueZ, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const unsigned long binsX=50, const unsigned long binsY=50, const double weight=1.0) const
fill the 2D profile histogram (book on demand)
Definition: GaudiHistos_2DProfFixedBinning.icpp:116
GaudiHistos::plot1D
AIDA::IHistogram1D * plot1D(const double value, const std::string &title, const double low, const double high, const unsigned long bins=100, const double weight=1.0) const
fill the 1D histogram (book on demand)
Definition: GaudiHistos_1DFixedBinning.icpp:116
GaudiAlg::ID
ID class for Histogram and Ntuples.
Definition: GaudiHistoID.h:44
GaudiHistos::histo3DMapID
const Histo3DMapID & histo3DMapID() const
get access to the map of all 3D histograms index via a ID
Definition: GaudiHistos.h:2573