| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

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

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
IHistoTool.h
Go to the documentation of this file.
1 // $Id: IHistoTool.h,v 1.3 2005/01/18 15:51:53 mato Exp $
2 // ============================================================================
3 #ifndef GAUDIALG_IHISTOTOOL_H
4 #define GAUDIALG_IHISTOTOOL_H 1
5 // ============================================================================
6 // Include files
7 // ============================================================================
8 // from STL
9 // ============================================================================
10 #include <string>
11 // ============================================================================
12 // from Gaudi
13 // ============================================================================
14 #include "GaudiKernel/IAlgTool.h"
15 #include "GaudiAlg/HistoID.h"
16 // ============================================================================
17
18 namespace AIDA
19 {
20 class IHistogram1D;
21 class IHistogram2D;
22 class IHistogram3D;
23 }
24
33 class GAUDI_API IHistoTool: virtual public IAlgTool
34 {
35 public:
37 DeclareInterfaceID(IHistoTool,2,0);
38
40 typedef Histos::HistoID HistoID ;
41
42 public:
43
44 // ================================= 1D Histograms ========================================
45
74 virtual AIDA::IHistogram1D* plot1D
75 ( const double value ,
76 const std::string& title ,
77 const double low ,
78 const double high ,
79 const unsigned long bins = 100 ,
80 const double weight = 1.0 ) const = 0 ;
81
95 AIDA::IHistogram1D* plot
96 ( const double value ,
97 const std::string& title ,
98 const double low ,
99 const double high ,
100 const unsigned long bins = 100 ,
101 const double weight = 1.0 ) const
102 {
103 return plot1D ( value, title, low, high, bins, weight );
104 }
105
146 virtual AIDA::IHistogram1D* plot1D
147 ( const double value ,
148 const HistoID& ID ,
149 const std::string& title ,
150 const double low ,
151 const double high ,
152 const unsigned long bins = 100 ,
153 const double weight = 1.0 ) const = 0 ;
154
169 AIDA::IHistogram1D* plot
170 ( const double value ,
171 const HistoID& ID ,
172 const std::string& title ,
173 const double low ,
174 const double high ,
175 const unsigned long bins = 100 ,
176 const double weight = 1.0 ) const
177 {
178 return plot1D ( value, ID, title, low, high, bins, weight );
179 };
180
181 // ================================= 2D Histograms ========================================
182
217 virtual AIDA::IHistogram2D* plot2D
218 ( const double valueX ,
219 const double valueY ,
220 const std::string& title ,
221 const double lowX ,
222 const double highX ,
223 const double lowY ,
224 const double highY ,
225 const unsigned long binsX = 50 ,
226 const unsigned long binsY = 50 ,
227 const double weight = 1.0 ) const = 0;
228
275 virtual AIDA::IHistogram2D* plot2D
276 ( const double valueX ,
277 const double valueY ,
278 const HistoID& ID ,
279 const std::string& title ,
280 const double lowX ,
281 const double highX ,
282 const double lowY ,
283 const double highY ,
284 const unsigned long binsX = 50 ,
285 const unsigned long binsY = 50 ,
286 const double weight = 1.0 ) const = 0;
287
288 // ================================= 3D Histograms ========================================
289
330 virtual AIDA::IHistogram3D* plot3D
331 ( const double valueX ,
332 const double valueY ,
333 const double valueZ ,
334 const std::string& title ,
335 const double lowX ,
336 const double highX ,
337 const double lowY ,
338 const double highY ,
339 const double lowZ ,
340 const double highZ ,
341 const unsigned long binsX = 10 ,
342 const unsigned long binsY = 10 ,
343 const unsigned long binsZ = 10 ,
344 const double weight = 1.0 ) const = 0;
345
398 virtual AIDA::IHistogram3D* plot3D
399 ( const double valueX ,
400 const double valueY ,
401 const double valueZ ,
402 const HistoID& ID ,
403 const std::string& title ,
404 const double lowX ,
405 const double highX ,
406 const double lowY ,
407 const double highY ,
408 const double lowZ ,
409 const double highZ ,
410 const unsigned long binsX = 10 ,
411 const unsigned long binsY = 10 ,
412 const unsigned long binsZ = 10 ,
413 const double weight = 1.0 ) const = 0;
414
415 public:
416
428 virtual AIDA::IHistogram1D* book1D
429 ( const std::string& title ,
430 const double low = 0 ,
431 const double high = 100 ,
432 const unsigned long bins = 100 ) const = 0 ;
433
446 AIDA::IHistogram1D* book
447 ( const std::string& title ,
448 const double low = 0 ,
449 const double high = 100 ,
450 const unsigned long bins = 100 ) const
451 {
452 return book1D( title, low, high, bins );
453 }
454
469 virtual AIDA::IHistogram2D* book2D
470 ( const std::string& title ,
471 const double lowX = 0 ,
472 const double highX = 100 ,
473 const unsigned long binsX = 50 ,
474 const double lowY = 0 ,
475 const double highY = 100 ,
476 const unsigned long binsY = 50 ) const = 0;
477
495 virtual AIDA::IHistogram3D* book3D
496 ( const std::string& title ,
497 const double lowX = 0 ,
498 const double highX = 100 ,
499 const unsigned long binsX = 10 ,
500 const double lowY = 0 ,
501 const double highY = 100 ,
502 const unsigned long binsY = 10 ,
503 const double lowZ = 0 ,
504 const double highZ = 100 ,
505 const unsigned long binsZ = 10 ) const = 0;
506
517 virtual AIDA::IHistogram1D* book1D
518 ( const HistoID& ID ,
519 const std::string& title = "" ,
520 const double low = 0 ,
521 const double high = 100 ,
522 const unsigned long bins = 100 ) const = 0 ;
523
537 AIDA::IHistogram1D* book
538 ( const HistoID& ID ,
539 const std::string& title = "" ,
540 const double low = 0 ,
541 const double high = 100 ,
542 const unsigned long bins = 100 ) const
543 {
544 return book1D( ID, title, low, high, bins );
545 }
546
557 virtual AIDA::IHistogram2D* book2D
558 ( const HistoID& ID ,
559 const std::string& title ,
560 const double lowX = 0 ,
561 const double highX = 100 ,
562 const unsigned long binsX = 100 ,
563 const double lowY = 0 ,
564 const double highY = 100 ,
565 const unsigned long binsY = 100 ) const = 0;
566
583 virtual AIDA::IHistogram3D* book3D
584 ( const HistoID& ID ,
585 const std::string& title ,
586 const double lowX = 0 ,
587 const double highX = 100 ,
588 const unsigned long binsX = 10 ,
589 const double lowY = 0 ,
590 const double highY = 100 ,
591 const unsigned long binsY = 10 ,
592 const double lowZ = 0 ,
593 const double highZ = 100 ,
594 const unsigned long binsZ = 10 ) const = 0;
595
603 virtual AIDA::IHistogram1D* fill
604 ( AIDA::IHistogram1D* histo ,
605 const double value ,
606 const double weight ,
607 const std::string& title = "") const = 0 ;
608
617 virtual AIDA::IHistogram2D* fill
618 ( AIDA::IHistogram2D* histo ,
619 const double valueX ,
620 const double valueY ,
621 const double weight ,
622 const std::string& title = "" ) const = 0 ;
623
633 virtual AIDA::IHistogram3D* fill
634 ( AIDA::IHistogram3D* histo ,
635 const double valueX ,
636 const double valueY ,
637 const double valueZ ,
638 const double weight ,
639 const std::string& title = "" ) const = 0 ;
640
644 virtual AIDA::IHistogram1D* histo1D ( const std::string& title ) const = 0 ;
645
653 AIDA::IHistogram1D* histo ( const std::string& title ) const
654 {
655 return histo1D( title );
656 };
657
661 virtual AIDA::IHistogram2D* histo2D ( const std::string& title ) const = 0;
662
663
667 virtual AIDA::IHistogram3D* histo3D ( const std::string& title ) const = 0;
668
672 virtual AIDA::IHistogram1D* histo1D ( const HistoID& ID ) const = 0 ;
673
681 AIDA::IHistogram1D* histo ( const HistoID& ID ) const
682 {
683 return histo1D( ID );
684 };
685
689 virtual AIDA::IHistogram2D* histo2D ( const HistoID& ID ) const = 0;
690
694 virtual AIDA::IHistogram3D* histo3D ( const HistoID& ID ) const = 0;
695
697 virtual bool histoExists ( const std::string& title ) const = 0 ;
698
700 virtual bool histoExists ( const HistoID& ID ) const = 0 ;
701
702 public: // non-virtual methods
703
753 template <class FUNCTION,class OBJECT>
754 AIDA::IHistogram1D* plot
755 ( const FUNCTION& func ,
756 OBJECT first ,
757 OBJECT last ,
758 const std::string& title ,
759 const double low ,
760 const double high ,
761 const unsigned long bins = 100 ) const
762 {
763 // retrieve or book the histogram
764 AIDA::IHistogram1D* h = histo1D ( title ) ;
765 if ( 0 == h ) { h = book1D ( title , low , high , bins ); }
766 while ( first != last && 0 != h )
767 { h = fill ( h , func( *first ) , 1.0 , title ) ; ++first ; }
768 return h ;
769 }
770
820 template <class FUNCTION,class OBJECT>
821 AIDA::IHistogram1D* plot
822 ( const FUNCTION& func ,
823 OBJECT first ,
824 OBJECT last ,
825 const HistoID& ID ,
826 const std::string& title ,
827 const double low ,
828 const double high ,
829 const unsigned long bins = 100 ) const
830 {
831 // retrieve or book the histogram
832 AIDA::IHistogram1D* h = histo1D ( ID ) ;
833 if ( 0 == h ) { h = book1D ( ID , title , low , high , bins ); }
834 while ( first != last && 0 != h )
835 { h = fill( h , func( *first ) , 1.0 , title ) ; ++first ; }
836 return h ;
837 }
838
893 template <class FUNCTION,class OBJECT,class WEIGHT>
894 AIDA::IHistogram1D* plot
895 ( const FUNCTION& func ,
896 OBJECT first ,
897 OBJECT last ,
898 const std::string& title ,
899 const double low ,
900 const double high ,
901 const unsigned long bins ,
902 const WEIGHT& weight ) const
903 {
904 // retrieve or book the histogram
905 AIDA::IHistogram1D* h = histo1D ( title ) ;
906 if ( 0 == h ) { h = book1D ( title , low , high , bins ); }
907 while( first != last && 0 != h )
908 { h = fill ( h ,
909 func ( *first ) ,
910 weight ( *first ) , title ) ; ++first ; }
911 return h ;
912 }
913
973 template <class FUNCTION,class OBJECT,class WEIGHT>
974 AIDA::IHistogram1D* plot
975 ( const FUNCTION& func ,
976 OBJECT first ,
977 OBJECT last ,
978 const HistoID& ID ,
979 const std::string& title ,
980 const double low ,
981 const double high ,
982 const unsigned long bins ,
983 const WEIGHT& weight ) const
984 {
985 // retrieve or book the histogram
986 AIDA::IHistogram1D* h = histo1D ( ID ) ;
987 if ( 0 == h ) { h = book1D ( ID , title , low , high , bins ); }
988 while( first != last && 0 != h )
989 { h = fill ( h ,
990 func ( *first ) ,
991 weight ( *first ) , title ) ; ++first ; }
992 return h ;
993 }
994
995 protected:
996
997 virtual ~IHistoTool() ;
998
999 };
1000
1001 #endif // GAUDIALG_IHISTOTOOL_H