All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HistoDecorator.cpp
Go to the documentation of this file.
1 // $Id: HistoDecorator.cpp,v 1.5 2008/10/09 09:59:14 marcocle Exp $
2 // ============================================================================
3 // Include files
4 // ============================================================================
5 // GaudiAlg
6 // ============================================================================
9 // ============================================================================
10 // GaudiPython
11 // ============================================================================
12 #include "GaudiPython/Vector.h"
14 // ============================================================================
20 // ============================================================================
21 /* "plot"(book&fill) a sequence of data from the vector (implicit loop)
22  * (Expected to be more efficient)
23  * @param algo the algorithm
24  * @param data data
25  * @param title histogram title
26  * @param low low edge
27  * @param high high edge
28  * @param bins number of bins
29  */
30 // ============================================================================
31 AIDA::IHistogram1D* GaudiPython::HistoDecorator::plot1D
32 ( const GaudiHistoAlg& algo ,
33  const double data ,
34  const std::string& title ,
35  const double low ,
36  const double high ,
37  const unsigned long bins )
38 { return algo.plot1D( data , title , low , high , bins ) ; }
39 // ============================================================================
40 /* "plot"(book&fill) a sequence of data from the vector (implicit loop)
41  * (Expected to be more efficient)
42  * @param algo the algorithm
43  * @param data data
44  * @param ID histogram ID
45  * @param title histogram title
46  * @param low low edge
47  * @param high high edge
48  * @param bins number of bins
49  */
50 // ============================================================================
51 AIDA::IHistogram1D* GaudiPython::HistoDecorator::plot1D
52 ( const GaudiHistoAlg& algo ,
53  const double data ,
54  const GaudiAlg::HistoID& ID ,
55  const std::string& title ,
56  const double low ,
57  const double high ,
58  const unsigned long bins )
59 { return algo.plot1D( data , ID , title , low , high , bins ) ; }
60 // ============================================================================
61 /* "plot"(book&fill) a sequence of data from the vector (implicit loop)
62  * (Expected to be more efficient)
63  * @param algo the algorithm
64  * @param data data
65  * @param ID histogram ID
66  * @param title histogram title
67  * @param low low edge
68  * @param high high edge
69  * @param bins number of bins
70  */
71 // ============================================================================
72 AIDA::IHistogram1D* GaudiPython::HistoDecorator::plot1D
73 ( const GaudiHistoAlg& algo ,
74  const double data ,
75  const long ID ,
76  const std::string& title ,
77  const double low ,
78  const double high ,
79  const unsigned long bins )
80 { return algo.plot1D( data , ID , title , low , high , bins ) ; }
81 // ============================================================================
82 /* "plot"(book&fill) a sequence of data from the vector (implicit loop)
83  * (Expected to be more efficient)
84  * @param algo the algorithm
85  * @param data data
86  * @param ID histogram ID
87  * @param title histogram title
88  * @param low low edge
89  * @param high high edge
90  * @param bins number of bins
91  */
92 // ============================================================================
93 AIDA::IHistogram1D* GaudiPython::HistoDecorator::plot1D
94 ( const GaudiHistoAlg& algo ,
95  const double data ,
96  const std::string& ID ,
97  const std::string& title ,
98  const double low ,
99  const double high ,
100  const unsigned long bins )
101 { return algo.plot1D( data , ID , title , low , high , bins ) ; }
102 // ============================================================================
103 /* "plot"(book&fill) a sequence of data from the vector (implicit loop)
104  * (Expected to be more efficient)
105  * @param algo the algorithm
106  * @param data vector of data
107  * @param title histogram title
108  * @param low low edge
109  * @param high high edge
110  * @param bins number of bins
111  */
112 // ============================================================================
113 AIDA::IHistogram1D* GaudiPython::HistoDecorator::plot1D
114 ( const GaudiHistoAlg& algo ,
115  const GaudiPython::Vector& data ,
116  const std::string& title ,
117  const double low ,
118  const double high ,
119  const unsigned long bins )
120 {
121  return algo.plot
123  data.begin () ,
124  data.end () ,
125  title , low , 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
140 ( const GaudiHistoAlg& algo ,
141  const GaudiPython::Vector& data ,
142  const GaudiAlg::HistoID& ID ,
143  const std::string& title ,
144  const double low ,
145  const double high ,
146  const unsigned long bins )
147 {
148  return algo.plot
150  data.begin () ,
151  data.end () ,
152  ID , title , low , high , bins ) ;
153 }
154 // ============================================================================
155 /* "plot"(book&fill) a sequence of data from the vector (implicit loop)
156  * (Expected to be more efficient)
157  * @param algo the algorithm
158  * @param data vector of data
159  * @param ID histogram ID
160  * @param title histogram title
161  * @param low low edge
162  * @param high high edge
163  * @param bins number of bins
164  */
165 // ============================================================================
166 AIDA::IHistogram1D* GaudiPython::HistoDecorator::plot1D
167 ( const GaudiHistoAlg& algo ,
168  const GaudiPython::Vector& data ,
169  const long ID ,
170  const std::string& title ,
171  const double low ,
172  const double high ,
173  const unsigned long bins )
174 {
175  return algo.plot
177  data.begin () ,
178  data.end () ,
179  ID , title , low , high , bins ) ;
180 }
181 // ============================================================================
182 /* "plot"(book&fill) a sequence of data from the vector (implicit loop)
183  * (Expected to be more efficient)
184  * @param algo the algorithm
185  * @param data vector of data
186  * @param ID histogram ID
187  * @param title histogram title
188  * @param low low edge
189  * @param high high edge
190  * @param bins number of bins
191  */
192 // ============================================================================
193 AIDA::IHistogram1D* GaudiPython::HistoDecorator::plot1D
194 ( const GaudiHistoAlg& algo ,
195  const GaudiPython::Vector& data ,
196  const std::string& ID ,
197  const std::string& title ,
198  const double low ,
199  const double high ,
200  const unsigned long bins )
201 {
202  return algo.plot
204  data.begin () ,
205  data.end () ,
206  ID , title , low , high , bins ) ;
207 }
208 // ============================================================================
209 /* fill the 2D histogram (book on demand)
210  * @param valueX x value to be filled
211  * @param valueY y value to be filled
212  * @param title histogram title (must be unique within the algorithm)
213  * @param lowX low x limit for histogram
214  * @param highX high x limit for histogram
215  * @param lowY low y limit for histogram
216  * @param highY high y limit for histogram
217  * @param binsX number of bins in x
218  * @param binsY number of bins in y
219  * @param weight weight
220  * @return pointer to AIDA 2D histogram
221  */
222 // ============================================================================
223 AIDA::IHistogram2D* GaudiPython::HistoDecorator::plot2D
224 ( const GaudiHistoAlg& algo ,
225  const double valueX ,
226  const double valueY ,
227  const std::string& title ,
228  const double lowX ,
229  const double highX ,
230  const double lowY ,
231  const double highY ,
232  const unsigned long binsX ,
233  const unsigned long binsY ,
234  const double weight )
235 {
236  return algo.plot2D ( valueX , valueY ,
237  title ,
238  lowX , highX ,
239  lowY , highY ,
240  binsX , binsY , weight ) ;
241 }
242 // ============================================================================
257 // ============================================================================
258 AIDA::IHistogram2D* GaudiPython::HistoDecorator::plot2D
259 ( const GaudiHistoAlg& algo ,
260  const double valueX ,
261  const double valueY ,
262  const GaudiAlg::HistoID& ID ,
263  const std::string& title ,
264  const double lowX ,
265  const double highX ,
266  const double lowY ,
267  const double highY ,
268  const unsigned long binsX ,
269  const unsigned long binsY ,
270  const double weight )
271 {
272  return algo.plot2D ( valueX , valueY ,
273  ID , title ,
274  lowX , highX ,
275  lowY , highY ,
276  binsX , binsY , weight ) ;
277 }
278 // ============================================================================
279 /* fill the 2D histogram (book on demand)
280  * @param valueX x value to be filled
281  * @param valueY y value to be filled
282  * @param ID Histogram ID to use
283  * @param title histogram title (must be unique within the algorithm)
284  * @param lowX low x limit for histogram
285  * @param highX high x limit for histogram
286  * @param lowY low y limit for histogram
287  * @param highY high y limit for histogram
288  * @param binsX number of bins in x
289  * @param binsY number of bins in y
290  * @param weight weight
291  * @return pointer to AIDA 2D histogram
292  */
293 // ============================================================================
294 AIDA::IHistogram2D* GaudiPython::HistoDecorator::plot2D
295 ( const GaudiHistoAlg& algo ,
296  const double valueX ,
297  const double valueY ,
298  const long ID ,
299  const std::string& title ,
300  const double lowX ,
301  const double highX ,
302  const double lowY ,
303  const double highY ,
304  const unsigned long binsX ,
305  const unsigned long binsY ,
306  const double weight )
307 {
308  return algo.plot2D ( valueX , valueY ,
309  ID , title ,
310  lowX , highX ,
311  lowY , highY ,
312  binsX , binsY , weight ) ;
313 }
314 // ============================================================================
315 /* fill the 2D histogram (book on demand)
316  * @param valueX x value to be filled
317  * @param valueY y value to be filled
318  * @param ID Histogram ID to use
319  * @param title histogram title (must be unique within the algorithm)
320  * @param lowX low x limit for histogram
321  * @param highX high x limit for histogram
322  * @param lowY low y limit for histogram
323  * @param highY high y limit for histogram
324  * @param binsX number of bins in x
325  * @param binsY number of bins in y
326  * @param weight weight
327  * @return pointer to AIDA 2D histogram
328  */
329 // ============================================================================
330 AIDA::IHistogram2D* GaudiPython::HistoDecorator::plot2D
331 ( const GaudiHistoAlg& algo ,
332  const double valueX ,
333  const double valueY ,
334  const std::string& ID ,
335  const std::string& title ,
336  const double lowX ,
337  const double highX ,
338  const double lowY ,
339  const double highY ,
340  const unsigned long binsX ,
341  const unsigned long binsY ,
342  const double weight )
343 {
344  return algo.plot2D ( valueX , valueY ,
345  ID , title ,
346  lowX , highX ,
347  lowY , highY ,
348  binsX , binsY , weight ) ;
349 }
350 // ============================================================================
351 /* fill the 3D histogram (book on demand)
352  * @param valueX x value to be filled
353  * @param valueY y value to be filled
354  * @param valueZ z value to be filled
355  * @param title histogram title (must be unique within the algorithm)
356  * @param lowX low x limit for histogram
357  * @param highX high x limit for histogram
358  * @param lowY low y limit for histogram
359  * @param highY high y limit for histogram
360  * @param lowZ low z limit for histogram
361  * @param highZ high z limit for histogram
362  * @param binsX number of bins in x
363  * @param binsY number of bins in y
364  * @param binsZ number of bins in z
365  * @param weight weight
366  * @return pointer to AIDA 3D histogram
367  */
368 // ============================================================================
369 AIDA::IHistogram3D* GaudiPython::HistoDecorator::plot3D
370 ( const GaudiHistoAlg& algo ,
371  const double valueX ,
372  const double valueY ,
373  const double valueZ ,
374  const std::string& title ,
375  const double lowX ,
376  const double highX ,
377  const double lowY ,
378  const double highY ,
379  const double lowZ ,
380  const double highZ ,
381  const unsigned long binsX ,
382  const unsigned long binsY ,
383  const unsigned long binsZ ,
384  const double weight )
385 {
386  return algo. plot3D ( valueX , valueY , valueZ ,
387  title ,
388  lowX , highX ,
389  lowY , highY ,
390  lowZ , highZ ,
391  binsX , binsY , binsZ ,
392  weight ) ;
393 }
394 // ============================================================================
395 /* fill the 3D histogram (book on demand)
396  * @param valueX x value to be filled
397  * @param valueY y value to be filled
398  * @param valueZ z value to be filled
399  * @param title histogram title (must be unique within the algorithm)
400  * @param lowX low x limit for histogram
401  * @param highX high x limit for histogram
402  * @param lowY low y limit for histogram
403  * @param highY high y limit for histogram
404  * @param lowZ low z limit for histogram
405  * @param highZ high z limit for histogram
406  * @param binsX number of bins in x
407  * @param binsY number of bins in y
408  * @param binsZ number of bins in z
409  * @param weight weight
410  * @return pointer to AIDA 3D histogram
411  */
412 // ============================================================================
413 AIDA::IHistogram3D* GaudiPython::HistoDecorator::plot3D
414 ( const GaudiHistoAlg& algo ,
415  const double valueX ,
416  const double valueY ,
417  const double valueZ ,
418  const GaudiAlg::HistoID& ID ,
419  const std::string& title ,
420  const double lowX ,
421  const double highX ,
422  const double lowY ,
423  const double highY ,
424  const double lowZ ,
425  const double highZ ,
426  const unsigned long binsX ,
427  const unsigned long binsY ,
428  const unsigned long binsZ ,
429  const double weight )
430 {
431  return algo. plot3D ( valueX , valueY , valueZ ,
432  ID , title ,
433  lowX , highX ,
434  lowY , highY ,
435  lowZ , highZ ,
436  binsX , binsY , binsZ ,
437  weight ) ;
438 }
439 // ============================================================================
440 /* fill the 3D histogram (book on demand)
441  * @param valueX x value to be filled
442  * @param valueY y value to be filled
443  * @param valueZ z value to be filled
444  * @param title histogram title (must be unique within the algorithm)
445  * @param lowX low x limit for histogram
446  * @param highX high x limit for histogram
447  * @param lowY low y limit for histogram
448  * @param highY high y limit for histogram
449  * @param lowZ low z limit for histogram
450  * @param highZ high z limit for histogram
451  * @param binsX number of bins in x
452  * @param binsY number of bins in y
453  * @param binsZ number of bins in z
454  * @param weight weight
455  * @return pointer to AIDA 3D histogram
456  */
457 // ============================================================================
458 AIDA::IHistogram3D* GaudiPython::HistoDecorator::plot3D
459 ( const GaudiHistoAlg& algo ,
460  const double valueX ,
461  const double valueY ,
462  const double valueZ ,
463  const long ID ,
464  const std::string& title ,
465  const double lowX ,
466  const double highX ,
467  const double lowY ,
468  const double highY ,
469  const double lowZ ,
470  const double highZ ,
471  const unsigned long binsX ,
472  const unsigned long binsY ,
473  const unsigned long binsZ ,
474  const double weight )
475 {
476  return algo. plot3D ( valueX , valueY , valueZ ,
477  ID , title ,
478  lowX , highX ,
479  lowY , highY ,
480  lowZ , highZ ,
481  binsX , binsY , binsZ ,
482  weight ) ;
483 }
484 // ============================================================================
485 /* fill the 3D histogram (book on demand)
486  * @param valueX x value to be filled
487  * @param valueY y value to be filled
488  * @param valueZ z value to be filled
489  * @param title histogram title (must be unique within the algorithm)
490  * @param lowX low x limit for histogram
491  * @param highX high x limit for histogram
492  * @param lowY low y limit for histogram
493  * @param highY high y limit for histogram
494  * @param lowZ low z limit for histogram
495  * @param highZ high z limit for histogram
496  * @param binsX number of bins in x
497  * @param binsY number of bins in y
498  * @param binsZ number of bins in z
499  * @param weight weight
500  * @return pointer to AIDA 3D histogram
501  */
502 // ============================================================================
503 AIDA::IHistogram3D*
505 ( const GaudiHistoAlg& algo ,
506  const double valueX ,
507  const double valueY ,
508  const double valueZ ,
509  const std::string& ID ,
510  const std::string& title ,
511  const double lowX ,
512  const double highX ,
513  const double lowY ,
514  const double highY ,
515  const double lowZ ,
516  const double highZ ,
517  const unsigned long binsX ,
518  const unsigned long binsY ,
519  const unsigned long binsZ ,
520  const double weight )
521 {
522  return algo. plot3D ( valueX , valueY , valueZ ,
523  ID , title ,
524  lowX , highX ,
525  lowY , highY ,
526  lowZ , highZ ,
527  binsX , binsY , binsZ ,
528  weight ) ;
529 }
530 // ========================================================================
531 // 1D-profiles: by title
532 // ========================================================================
533 AIDA::IProfile1D*
535 ( const GaudiHistoAlg& algo ,
536  const double valueX ,
537  const double valueY ,
538  const std::string& title ,
539  const double lowX ,
540  const double highX ,
541  const unsigned long binsX ,
542  const std::string& opt ,
543  const double lowY ,
544  const double highY ,
545  const double weight )
546 {
547  return algo.profile1D
548  ( valueX , valueY , title , lowX , highX , binsX ,
549  opt , lowY , highY , weight ) ;
550 }
551 // ========================================================================
552 // 1D-profiles: by generic ID
553 // ========================================================================
554 AIDA::IProfile1D*
556 ( const GaudiHistoAlg& algo ,
557  const double valueX ,
558  const double valueY ,
559  const GaudiAlg::HistoID& ID ,
560  const std::string& title ,
561  const double lowX ,
562  const double highX ,
563  const unsigned long binsX ,
564  const std::string& opt ,
565  const double lowY ,
566  const double highY ,
567  const double weight )
568 {
569  return algo.profile1D
570  ( valueX , valueY , ID , title , lowX , highX , binsX ,
571  opt , lowY , highY , weight ) ;
572 }
573 // ========================================================================
574 // 1D-profiles: by numeric ID
575 // ========================================================================
576 AIDA::IProfile1D*
578 ( const GaudiHistoAlg& algo ,
579  const double valueX ,
580  const double valueY ,
581  const long ID ,
582  const std::string& title ,
583  const double lowX ,
584  const double highX ,
585  const unsigned long binsX ,
586  const std::string& opt ,
587  const double lowY ,
588  const double highY ,
589  const double weight )
590 {
591  return algo.profile1D
592  ( valueX , valueY , ID , title , lowX , highX , binsX ,
593  opt , lowY , highY , weight ) ;
594 }
595 // ========================================================================
596 // 1D-profiles: by string ID
597 // ========================================================================
598 AIDA::IProfile1D*
600 ( const GaudiHistoAlg& algo ,
601  const double valueX ,
602  const double valueY ,
603  const std::string& ID ,
604  const std::string& title ,
605  const double lowX ,
606  const double highX ,
607  const unsigned long binsX ,
608  const std::string& opt ,
609  const double lowY ,
610  const double highY ,
611  const double weight )
612 {
613  return algo.profile1D
614  ( valueX , valueY , ID , title , lowX , highX , binsX ,
615  opt , lowY , highY , weight ) ;
616 }
617 // ========================================================================
618 // 2D-profiles: by title
619 // ========================================================================
620 AIDA::IProfile2D*
622 ( const GaudiHistoAlg& algo ,
623  const double valueX ,
624  const double valueY ,
625  const double valueZ ,
626  const std::string& title ,
627  const double lowX ,
628  const double highX ,
629  const double lowY ,
630  const double highY ,
631  const unsigned long binsX ,
632  const unsigned long binsY ,
633  const double weight )
634 {
635  return algo.profile2D
636  ( valueX , valueY , valueZ ,
637  title ,
638  lowX , highX ,
639  lowY , highY ,
640  binsX , binsY , weight ) ;
641 }
642 // ========================================================================
643 // 2D-profiles: by generic ID
644 // ========================================================================
645 AIDA::IProfile2D*
647 ( const GaudiHistoAlg& algo ,
648  const double valueX ,
649  const double valueY ,
650  const double valueZ ,
651  const GaudiAlg::HistoID& ID ,
652  const std::string& title ,
653  const double lowX ,
654  const double highX ,
655  const double lowY ,
656  const double highY ,
657  const unsigned long binsX ,
658  const unsigned long binsY ,
659  const double weight )
660 {
661  return algo.profile2D
662  ( valueX , valueY , valueZ ,
663  ID , title ,
664  lowX , highX ,
665  lowY , highY ,
666  binsX , binsY , weight ) ;
667 }
668 // ========================================================================
669 // 2D-profiles: by numeric ID
670 // ========================================================================
671 AIDA::IProfile2D*
673 ( const GaudiHistoAlg& algo ,
674  const double valueX ,
675  const double valueY ,
676  const double valueZ ,
677  const long ID ,
678  const std::string& title ,
679  const double lowX ,
680  const double highX ,
681  const double lowY ,
682  const double highY ,
683  const unsigned long binsX ,
684  const unsigned long binsY ,
685  const double weight )
686 {
687  return algo.profile2D
688  ( valueX , valueY , valueZ ,
689  ID , title ,
690  lowX , highX ,
691  lowY , highY ,
692  binsX , binsY , weight ) ;
693 }
694 // ========================================================================
695 // 2D-profiles: by string ID
696 // ========================================================================
697 AIDA::IProfile2D*
699 ( const GaudiHistoAlg& algo ,
700  const double valueX ,
701  const double valueY ,
702  const double valueZ ,
703  const std::string& ID ,
704  const std::string& title ,
705  const double lowX ,
706  const double highX ,
707  const double lowY ,
708  const double highY ,
709  const unsigned long binsX ,
710  const unsigned long binsY ,
711  const double weight )
712 {
713  return algo.profile2D
714  ( valueX , valueY , valueZ ,
715  ID , title ,
716  lowX , highX ,
717  lowY , highY ,
718  binsX , binsY , weight ) ;
719 }
720 // ============================================================================
721 // get all histograms
722 // ============================================================================
723 namespace
724 {
726  template <class KEY, class HISTO>
727  size_t _getHistos
728  ( const GaudiUtils::HashMap<KEY,HISTO>& a ,
729  std::map<GaudiAlg::ID,HISTO>& b )
730  {
732  a.begin() ; a.end() != ih ; ++ih )
733  {
734  if ( 0 == ih->second ) { continue ; }
735  GaudiAlg::ID id ( ih->first ) ;
736  b [ id ] = ih->second ;
737  }
738  return b.size() ;
739  }
740  // =========================================================================
741  template <class HISTO>
742  size_t fromMap
743  ( const std::map<GaudiAlg::ID,HISTO>& a ,
744  std::vector<GaudiAlg::ID>& b ,
745  std::vector<HISTO>& c )
746  {
747  b.clear() ;
748  c.clear() ;
749  for ( typename std::map<GaudiAlg::ID,HISTO>::const_iterator it =
750  a.begin() ; a.end() != it ; ++it )
751  {
752  if ( 0 == it->second ) { continue ; }
753  b.push_back ( it->first ) ;
754  c.push_back ( it->second ) ;
755  }
756  return b.size () ;
757  }
758  // ==========================================================================
759 }
760 // ============================================================================
762 ( const GaudiHistoAlg* cmp ,
765 {
766  histos.clear() ;
767  ids .clear() ;
768  if ( 0 == cmp ) { return 0 ; } // RETURN
769  //
770  std::map<GaudiAlg::ID,AIDA::IHistogram1D*> _map ;
771  //
772  _getHistos ( cmp -> histo1DMapID () , _map ) ;
773  //
774  return fromMap ( _map , ids , histos ) ;
775  // ==========================================================================
776 }
777 // ============================================================================
779 ( const GaudiHistoTool* cmp ,
782 {
783  histos.clear() ;
784  ids .clear() ;
785  if ( 0 == cmp ) { return 0 ; } // RETURN
786  //
787  std::map<GaudiAlg::ID,AIDA::IHistogram1D*> _map ;
788  //
789  _getHistos ( cmp -> histo1DMapID () , _map ) ;
790  //
791  return fromMap ( _map , ids , histos ) ;
792  // ==========================================================================
793 }
794 // ============================================================================
796 ( const IAlgorithm* cmp ,
799 {
800  ids . clear() ;
801  histos . clear() ;
802  if ( 0 == cmp ) { return 0 ; } // RETURN
803  return _histos_a_ ( dynamic_cast<const GaudiHistoAlg*> ( cmp ) , ids, histos ) ;
804 }
805 // ============================================================================
807 ( const IAlgTool* cmp ,
810 {
811  ids . clear() ;
812  histos . clear() ;
813  if ( 0 == cmp ) { return 0 ; } // RETURN
814  return _histos_t_ ( dynamic_cast<const GaudiHistoTool*> ( cmp ) , ids, histos ) ;
815 }
816 // ============================================================================
817 // 2D-histograms
818 // ============================================================================
820 ( const GaudiHistoAlg* cmp ,
823 {
824  histos.clear() ;
825  ids .clear() ;
826  if ( 0 == cmp ) { return 0 ; } // RETURN
827  //
828  std::map<GaudiAlg::ID,AIDA::IHistogram2D*> _map ;
829  //
830  _getHistos ( cmp -> histo2DMapID () , _map ) ;
831  //
832  return fromMap ( _map , ids , histos ) ;
833  // ==========================================================================
834 }
835 // ============================================================================
837 ( const GaudiHistoTool* cmp ,
840 {
841  histos.clear() ;
842  ids .clear() ;
843  if ( 0 == cmp ) { return 0 ; } // RETURN
844  //
845  std::map<GaudiAlg::ID,AIDA::IHistogram2D*> _map ;
846  //
847  _getHistos ( cmp -> histo2DMapID () , _map ) ;
848  //
849  return fromMap ( _map , ids , histos ) ;
850  // ==========================================================================
851 }
852 // ============================================================================
854 ( const IAlgorithm* cmp ,
857 {
858  ids . clear() ;
859  histos . clear() ;
860  if ( 0 == cmp ) { return 0 ; } // RETURN
861  return _histos_a_ ( dynamic_cast<const GaudiHistoAlg*> ( cmp ) , ids, histos ) ;
862 }
863 // ============================================================================
865 ( const IAlgTool* cmp ,
868 {
869  ids . clear() ;
870  histos . clear() ;
871  if ( 0 == cmp ) { return 0 ; } // RETURN
872  return _histos_t_ ( dynamic_cast<const GaudiHistoTool*> ( cmp ) , ids, histos ) ;
873 }
874 // ============================================================================
875 // 3D-histograms
876 // ============================================================================
878 ( const GaudiHistoAlg* cmp ,
881 {
882  histos.clear() ;
883  ids .clear() ;
884  if ( 0 == cmp ) { return 0 ; } // RETURN
885  //
886  std::map<GaudiAlg::ID,AIDA::IHistogram3D*> _map ;
887  //
888  _getHistos ( cmp -> histo3DMapID () , _map ) ;
889  //
890  return fromMap ( _map , ids , histos ) ;
891  // ==========================================================================
892 }
893 // ============================================================================
895 ( const GaudiHistoTool* cmp ,
898 {
899  histos.clear() ;
900  ids .clear() ;
901  if ( 0 == cmp ) { return 0 ; } // RETURN
902  //
903  std::map<GaudiAlg::ID,AIDA::IHistogram3D*> _map ;
904  //
905  _getHistos ( cmp -> histo3DMapID () , _map ) ;
906  //
907  return fromMap ( _map , ids , histos ) ;
908  // ==========================================================================
909 }
910 // ============================================================================
912 ( const IAlgorithm* cmp ,
915 {
916  ids . clear() ;
917  histos . clear() ;
918  if ( 0 == cmp ) { return 0 ; } // RETURN
919  return _histos_a_ ( dynamic_cast<const GaudiHistoAlg*> ( cmp ) , ids, histos ) ;
920 }
921 // ============================================================================
923 ( const IAlgTool* cmp ,
926 {
927  ids . clear() ;
928  histos . clear() ;
929  if ( 0 == cmp ) { return 0 ; } // RETURN
930  return _histos_t_ ( dynamic_cast<const GaudiHistoTool*> ( cmp ) , ids, histos ) ;
931 }
932 // ============================================================================
933 // 1D-profiles
934 // ============================================================================
936 ( const GaudiHistoAlg* cmp ,
939 {
940  histos.clear() ;
941  ids .clear() ;
942  if ( 0 == cmp ) { return 0 ; } // RETURN
943  //
944  std::map<GaudiAlg::ID,AIDA::IProfile1D*> _map ;
945  //
946  _getHistos ( cmp -> profile1DMapID () , _map ) ;
947  //
948  return fromMap ( _map , ids , histos ) ;
949  // ==========================================================================
950 }
951 // ============================================================================
953 ( const GaudiHistoTool* cmp ,
956 {
957  histos.clear() ;
958  ids .clear() ;
959  if ( 0 == cmp ) { return 0 ; } // RETURN
960  //
961  std::map<GaudiAlg::ID,AIDA::IProfile1D*> _map ;
962  //
963  _getHistos ( cmp -> profile1DMapID () , _map ) ;
964  //
965  return fromMap ( _map , ids , histos ) ;
966  // ==========================================================================
967 }
968 // ============================================================================
970 ( const IAlgorithm* cmp ,
973 {
974  ids . clear() ;
975  histos . clear() ;
976  if ( 0 == cmp ) { return 0 ; } // RETURN
977  return _histos_a_ ( dynamic_cast<const GaudiHistoAlg*> ( cmp ) , ids, histos ) ;
978 }
979 // ============================================================================
981 ( const IAlgTool* cmp ,
984 {
985  ids . clear() ;
986  histos . clear() ;
987  if ( 0 == cmp ) { return 0 ; } // RETURN
988  return _histos_t_ ( dynamic_cast<const GaudiHistoTool*> ( cmp ) , ids, histos ) ;
989 }
990 // ============================================================================
991 // 2D-profiles
992 // ============================================================================
994 ( const GaudiHistoAlg* cmp ,
997 {
998  histos.clear() ;
999  ids .clear() ;
1000  if ( 0 == cmp ) { return 0 ; } // RETURN
1001  //
1002  std::map<GaudiAlg::ID,AIDA::IProfile2D*> _map ;
1003  //
1004  _getHistos ( cmp -> profile2DMapID () , _map ) ;
1005  //
1006  return fromMap ( _map , ids , histos ) ;
1007  // ==========================================================================
1008 }
1009 // ============================================================================
1011 ( const GaudiHistoTool* cmp ,
1014 {
1015  histos.clear() ;
1016  ids .clear() ;
1017  if ( 0 == cmp ) { return 0 ; } // RETURN
1018  //
1019  std::map<GaudiAlg::ID,AIDA::IProfile2D*> _map ;
1020  //
1021  _getHistos ( cmp -> profile2DMapID () , _map ) ;
1022  //
1023  return fromMap ( _map , ids , histos ) ;
1024  // ==========================================================================
1025 }
1026 // ============================================================================
1028 ( const IAlgorithm* cmp ,
1031 {
1032  ids . clear() ;
1033  histos . clear() ;
1034  if ( 0 == cmp ) { return 0 ; } // RETURN
1035  return _histos_a_ ( dynamic_cast<const GaudiHistoAlg*> ( cmp ) , ids, histos ) ;
1036 }
1037 // ============================================================================
1039 ( const IAlgTool* cmp ,
1042 {
1043  ids . clear() ;
1044  histos . clear() ;
1045  if ( 0 == cmp ) { return 0 ; } // RETURN
1046  return _histos_t_ ( dynamic_cast<const GaudiHistoTool*> ( cmp ) , ids, histos ) ;
1047 }
1048 // ============================================================================
1049 
1050 
1051 // ============================================================================
1052 // The END
1053 // ============================================================================
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)
It is here due to 'missing'(?) std::identity.
Definition: Vector.h:31
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)
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) ...
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
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)
tuple c
Definition: gaudirun.py:341
Header file for class : GaudiHistoTool.
std::vector< AIDA::IHistogram2D * > Histos2D
std::vector< GaudiAlg::ID > IDs
iterator end()
Definition: Map.h:131
std::vector< double > Vector
useful type definition for implicit loos
Definition: Vector.h:21
Simple class to extend the functionality of class GaudiTool.
string opt
print 'Summary: %32s [s] d d steps'%(summary.protocol,summary.type,summary.nevt,len(summary.data),)
Definition: ana.py:116
map_type::const_iterator const_iterator
Definition: Map.h:99
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:20
iterator begin()
Definition: Map.h:130
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)
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)
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)
std::vector< AIDA::IProfile2D * > Profiles2D
The interface implemented by the AlgTool base class.
Definition: IAlgTool.h:23
Common class providing an architecture-independent hash map.
Definition: HashMap.h:108
static size_t _histos_a_(const GaudiHistoAlg *cmp, IDs &ids, Histos1D &histos)
std::vector< AIDA::IHistogram1D * > Histos1D
Simple class to extend the functionality of class GaudiAlgorithm.
Definition: GaudiHistoAlg.h:38
std::vector< AIDA::IHistogram3D * > Histos3D
static size_t _histos_t_(const GaudiHistoTool *cmp, IDs &ids, Histos1D &histos)
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)
std::vector< AIDA::IProfile1D * > Profiles1D
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)
ID class for Histogram and Ntuples.
Definition: GaudiHistoID.h:46