Gaudi Framework, version v22r0

Home   Generated: 9 Feb 2011

HistoDecorator.cpp

Go to the documentation of this file.
00001 // $Id: HistoDecorator.cpp,v 1.5 2008/10/09 09:59:14 marcocle Exp $
00002 // ============================================================================
00003 // Include files
00004 // ============================================================================
00005 // GaudiAlg
00006 // ============================================================================
00007 #include "GaudiAlg/GaudiHistoAlg.h"
00008 #include "GaudiAlg/GaudiHistoTool.h"
00009 // ============================================================================
00010 // GaudiPython
00011 // ============================================================================
00012 #include "GaudiPython/Vector.h"
00013 #include "GaudiPython/HistoDecorator.h"
00014 // ============================================================================
00020 // ============================================================================
00021 /*  "plot"(book&fill) a sequence of data from the vector (implicit loop)
00022  *  (Expected to be more efficient)
00023  *  @param algo the algorithm
00024  *  @param data  data
00025  *  @param title histogram title
00026  *  @param low   low edge
00027  *  @param high  high edge
00028  *  @param bins  number of bins
00029  */
00030 // ============================================================================
00031 AIDA::IHistogram1D*   GaudiPython::HistoDecorator::plot1D
00032 ( const GaudiHistoAlg&         algo  ,
00033   const double                 data  ,
00034   const std::string&           title ,
00035   const double                 low   ,
00036   const double                 high  ,
00037   const unsigned long          bins  )
00038 { return algo.plot1D( data , title , low , high , bins ) ; }
00039 // ============================================================================
00040 /*  "plot"(book&fill) a sequence of data from the vector (implicit loop)
00041  *  (Expected to be more efficient)
00042  *  @param algo the algorithm
00043  *  @param data data
00044  *  @param ID   histogram ID
00045  *  @param title histogram title
00046  *  @param low   low edge
00047  *  @param high  high edge
00048  *  @param bins  number of bins
00049  */
00050 // ============================================================================
00051 AIDA::IHistogram1D*   GaudiPython::HistoDecorator::plot1D
00052 ( const GaudiHistoAlg&         algo  ,
00053   const double                 data  ,
00054   const GaudiAlg::HistoID&     ID    ,
00055   const std::string&           title ,
00056   const double                 low   ,
00057   const double                 high  ,
00058   const unsigned long          bins  )
00059 { return algo.plot1D( data , ID , title , low , high , bins ) ; }
00060 // ============================================================================
00061 /*  "plot"(book&fill) a sequence of data from the vector (implicit loop)
00062  *  (Expected to be more efficient)
00063  *  @param algo the algorithm
00064  *  @param data data
00065  *  @param ID   histogram ID
00066  *  @param title histogram title
00067  *  @param low   low edge
00068  *  @param high  high edge
00069  *  @param bins  number of bins
00070  */
00071 // ============================================================================
00072 AIDA::IHistogram1D*   GaudiPython::HistoDecorator::plot1D
00073 ( const GaudiHistoAlg&         algo  ,
00074   const double                 data  ,
00075   const long                   ID    ,
00076   const std::string&           title ,
00077   const double                 low   ,
00078   const double                 high  ,
00079   const unsigned long          bins  )
00080 { return algo.plot1D( data , ID , title , low , high , bins ) ; }
00081 // ============================================================================
00082 /*  "plot"(book&fill) a sequence of data from the vector (implicit loop)
00083  *  (Expected to be more efficient)
00084  *  @param algo the algorithm
00085  *  @param data data
00086  *  @param ID   histogram ID
00087  *  @param title histogram title
00088  *  @param low   low edge
00089  *  @param high  high edge
00090  *  @param bins  number of bins
00091  */
00092 // ============================================================================
00093 AIDA::IHistogram1D*   GaudiPython::HistoDecorator::plot1D
00094 ( const GaudiHistoAlg&         algo  ,
00095   const double                 data  ,
00096   const std::string&           ID    ,
00097   const std::string&           title ,
00098   const double                 low   ,
00099   const double                 high  ,
00100   const unsigned long          bins  )
00101 { return algo.plot1D( data , ID , title , low , high , bins ) ; }
00102 // ============================================================================
00103 /*  "plot"(book&fill) a sequence of data from the vector (implicit loop)
00104  *  (Expected to be more efficient)
00105  *  @param algo the algorithm
00106  *  @param data vector of data
00107  *  @param title histogram title
00108  *  @param low   low edge
00109  *  @param high  high edge
00110  *  @param bins  number of bins
00111  */
00112 // ============================================================================
00113 AIDA::IHistogram1D*   GaudiPython::HistoDecorator::plot1D
00114 ( const GaudiHistoAlg&         algo  ,
00115   const GaudiPython::Vector&   data  ,
00116   const std::string&           title ,
00117   const double                 low   ,
00118   const double                 high  ,
00119   const unsigned long          bins  )
00120 {
00121   return algo.plot
00122     ( GaudiPython::_identity<GaudiPython::Vector::value_type>() ,
00123       data.begin ()              ,
00124       data.end   ()              ,
00125       title , low , high , bins  ) ;
00126 }
00127 // ============================================================================
00128 /*  "plot"(book&fill) a sequence of data from the vector (implicit loop)
00129  *  (Expected to be more efficient)
00130  *  @param algo the algorithm
00131  *  @param data vector of data
00132  *  @param ID   histogram ID
00133  *  @param title histogram title
00134  *  @param low   low edge
00135  *  @param high  high edge
00136  *  @param bins  number of bins
00137  */
00138 // ============================================================================
00139 AIDA::IHistogram1D*   GaudiPython::HistoDecorator::plot1D
00140 ( const GaudiHistoAlg&         algo   ,
00141   const GaudiPython::Vector&   data   ,
00142   const GaudiAlg::HistoID&     ID     ,
00143   const std::string&           title  ,
00144   const double                 low    ,
00145   const double                 high   ,
00146   const unsigned long          bins   )
00147 {
00148   return algo.plot
00149     ( GaudiPython::_identity<GaudiPython::Vector::value_type>() ,
00150       data.begin ()                       ,
00151       data.end   ()                       ,
00152       ID , title , low , high , bins      ) ;
00153 }
00154 // ============================================================================
00155 /*  "plot"(book&fill) a sequence of data from the vector (implicit loop)
00156  *  (Expected to be more efficient)
00157  *  @param algo the algorithm
00158  *  @param data vector of data
00159  *  @param ID   histogram ID
00160  *  @param title histogram title
00161  *  @param low   low edge
00162  *  @param high  high edge
00163  *  @param bins  number of bins
00164  */
00165 // ============================================================================
00166 AIDA::IHistogram1D*   GaudiPython::HistoDecorator::plot1D
00167 ( const GaudiHistoAlg&         algo   ,
00168   const GaudiPython::Vector&   data   ,
00169   const long                   ID     ,
00170   const std::string&           title  ,
00171   const double                 low    ,
00172   const double                 high   ,
00173   const unsigned long          bins   )
00174 {
00175   return algo.plot
00176     ( GaudiPython::_identity<GaudiPython::Vector::value_type>() ,
00177       data.begin ()                       ,
00178       data.end   ()                       ,
00179       ID , title , low , high , bins      ) ;
00180 }
00181 // ============================================================================
00182 /*  "plot"(book&fill) a sequence of data from the vector (implicit loop)
00183  *  (Expected to be more efficient)
00184  *  @param algo the algorithm
00185  *  @param data vector of data
00186  *  @param ID   histogram ID
00187  *  @param title histogram title
00188  *  @param low   low edge
00189  *  @param high  high edge
00190  *  @param bins  number of bins
00191  */
00192 // ============================================================================
00193 AIDA::IHistogram1D*   GaudiPython::HistoDecorator::plot1D
00194 ( const GaudiHistoAlg&         algo   ,
00195   const GaudiPython::Vector&   data   ,
00196   const std::string&           ID     ,
00197   const std::string&           title  ,
00198   const double                 low    ,
00199   const double                 high   ,
00200   const unsigned long          bins   )
00201 {
00202   return algo.plot
00203     ( GaudiPython::_identity<GaudiPython::Vector::value_type>() ,
00204       data.begin ()                       ,
00205       data.end   ()                       ,
00206       ID , title , low , high , bins      ) ;
00207 }
00208 // ============================================================================
00209 /*  fill the 2D histogram (book on demand)
00210  *  @param valueX x value to be filled
00211  *  @param valueY y value to be filled
00212  *  @param title histogram title (must be unique within the algorithm)
00213  *  @param lowX  low x limit for histogram
00214  *  @param highX high x limit for histogram
00215  *  @param lowY  low y limit for histogram
00216  *  @param highY high y limit for histogram
00217  *  @param binsX  number of bins in x
00218  *  @param binsY  number of bins in y
00219  *  @param weight weight
00220  *  @return pointer to AIDA 2D histogram
00221  */
00222 // ============================================================================
00223 AIDA::IHistogram2D*  GaudiPython::HistoDecorator::plot2D
00224 ( const GaudiHistoAlg&      algo    ,
00225   const double              valueX  ,
00226   const double              valueY  ,
00227   const std::string&        title   ,
00228   const double              lowX    ,
00229   const double              highX   ,
00230   const double              lowY    ,
00231   const double              highY   ,
00232   const unsigned long       binsX   ,
00233   const unsigned long       binsY   ,
00234   const double              weight  )
00235 {
00236   return algo.plot2D ( valueX , valueY ,
00237                        title  ,
00238                        lowX   , highX  ,
00239                        lowY   , highY  ,
00240                        binsX  , binsY  , weight ) ;
00241 }
00242 // ============================================================================
00257 // ============================================================================
00258 AIDA::IHistogram2D*  GaudiPython::HistoDecorator::plot2D
00259 ( const GaudiHistoAlg&      algo    ,
00260   const double              valueX  ,
00261   const double              valueY  ,
00262   const GaudiAlg::HistoID&  ID      ,
00263   const std::string&        title   ,
00264   const double              lowX    ,
00265   const double              highX   ,
00266   const double              lowY    ,
00267   const double              highY   ,
00268   const unsigned long       binsX   ,
00269   const unsigned long       binsY   ,
00270   const double              weight  )
00271 {
00272   return algo.plot2D ( valueX , valueY ,
00273                        ID     , title  ,
00274                        lowX   , highX  ,
00275                        lowY   , highY  ,
00276                        binsX  , binsY  , weight ) ;
00277 }
00278 // ============================================================================
00279 /*  fill the 2D histogram (book on demand)
00280  *  @param valueX x value to be filled
00281  *  @param valueY y value to be filled
00282  *  @param ID     Histogram ID to use
00283  *  @param title histogram title (must be unique within the algorithm)
00284  *  @param lowX  low x limit for histogram
00285  *  @param highX high x limit for histogram
00286  *  @param lowY  low y limit for histogram
00287  *  @param highY high y limit for histogram
00288  *  @param binsX  number of bins in x
00289  *  @param binsY  number of bins in y
00290  *  @param weight weight
00291  *  @return pointer to AIDA 2D histogram
00292  */
00293 // ============================================================================
00294 AIDA::IHistogram2D*  GaudiPython::HistoDecorator::plot2D
00295 ( const GaudiHistoAlg&      algo    ,
00296   const double              valueX  ,
00297   const double              valueY  ,
00298   const long                ID      ,
00299   const std::string&        title   ,
00300   const double              lowX    ,
00301   const double              highX   ,
00302   const double              lowY    ,
00303   const double              highY   ,
00304   const unsigned long       binsX   ,
00305   const unsigned long       binsY   ,
00306   const double              weight  )
00307 {
00308   return algo.plot2D ( valueX , valueY ,
00309                        ID     , title  ,
00310                        lowX   , highX  ,
00311                        lowY   , highY  ,
00312                        binsX  , binsY  , weight ) ;
00313 }
00314 // ============================================================================
00315 /*  fill the 2D histogram (book on demand)
00316  *  @param valueX x value to be filled
00317  *  @param valueY y value to be filled
00318  *  @param ID     Histogram ID to use
00319  *  @param title histogram title (must be unique within the algorithm)
00320  *  @param lowX  low x limit for histogram
00321  *  @param highX high x limit for histogram
00322  *  @param lowY  low y limit for histogram
00323  *  @param highY high y limit for histogram
00324  *  @param binsX  number of bins in x
00325  *  @param binsY  number of bins in y
00326  *  @param weight weight
00327  *  @return pointer to AIDA 2D histogram
00328  */
00329 // ============================================================================
00330 AIDA::IHistogram2D*  GaudiPython::HistoDecorator::plot2D
00331 ( const GaudiHistoAlg&      algo    ,
00332   const double              valueX  ,
00333   const double              valueY  ,
00334   const std::string&        ID      ,
00335   const std::string&        title   ,
00336   const double              lowX    ,
00337   const double              highX   ,
00338   const double              lowY    ,
00339   const double              highY   ,
00340   const unsigned long       binsX   ,
00341   const unsigned long       binsY   ,
00342   const double              weight  )
00343 {
00344   return algo.plot2D ( valueX , valueY ,
00345                        ID     , title  ,
00346                        lowX   , highX  ,
00347                        lowY   , highY  ,
00348                        binsX  , binsY  , weight ) ;
00349 }
00350 // ============================================================================
00351 /*  fill the 3D histogram (book on demand)
00352  *  @param valueX x value to be filled
00353  *  @param valueY y value to be filled
00354  *  @param valueZ z value to be filled
00355  *  @param title histogram title (must be unique within the algorithm)
00356  *  @param lowX  low x limit for histogram
00357  *  @param highX high x limit for histogram
00358  *  @param lowY  low y limit for histogram
00359  *  @param highY high y limit for histogram
00360  *  @param lowZ  low z limit for histogram
00361  *  @param highZ high z limit for histogram
00362  *  @param binsX number of bins in x
00363  *  @param binsY number of bins in y
00364  *  @param binsZ number of bins in z
00365  *  @param weight weight
00366  *  @return pointer to AIDA 3D histogram
00367  */
00368 // ============================================================================
00369 AIDA::IHistogram3D*  GaudiPython::HistoDecorator::plot3D
00370 ( const GaudiHistoAlg&      algo   ,
00371   const double        valueX       ,
00372   const double        valueY       ,
00373   const double        valueZ       ,
00374   const std::string&  title        ,
00375   const double        lowX         ,
00376   const double        highX        ,
00377   const double        lowY         ,
00378   const double        highY        ,
00379   const double        lowZ         ,
00380   const double        highZ        ,
00381   const unsigned long binsX        ,
00382   const unsigned long binsY        ,
00383   const unsigned long binsZ        ,
00384   const double        weight       )
00385 {
00386   return algo. plot3D ( valueX , valueY , valueZ ,
00387                         title                    ,
00388                         lowX   , highX  ,
00389                         lowY   , highY  ,
00390                         lowZ   , highZ  ,
00391                         binsX  , binsY  , binsZ  ,
00392                         weight                   ) ;
00393 }
00394 // ============================================================================
00395 /*  fill the 3D histogram (book on demand)
00396  *  @param valueX x value to be filled
00397  *  @param valueY y value to be filled
00398  *  @param valueZ z value to be filled
00399  *  @param title histogram title (must be unique within the algorithm)
00400  *  @param lowX  low x limit for histogram
00401  *  @param highX high x limit for histogram
00402  *  @param lowY  low y limit for histogram
00403  *  @param highY high y limit for histogram
00404  *  @param lowZ  low z limit for histogram
00405  *  @param highZ high z limit for histogram
00406  *  @param binsX number of bins in x
00407  *  @param binsY number of bins in y
00408  *  @param binsZ number of bins in z
00409  *  @param weight weight
00410  *  @return pointer to AIDA 3D histogram
00411  */
00412 // ============================================================================
00413 AIDA::IHistogram3D*  GaudiPython::HistoDecorator::plot3D
00414 ( const GaudiHistoAlg&      algo   ,
00415   const double        valueX       ,
00416   const double        valueY       ,
00417   const double        valueZ       ,
00418   const GaudiAlg::HistoID&  ID     ,
00419   const std::string&  title        ,
00420   const double        lowX         ,
00421   const double        highX        ,
00422   const double        lowY         ,
00423   const double        highY        ,
00424   const double        lowZ         ,
00425   const double        highZ        ,
00426   const unsigned long binsX        ,
00427   const unsigned long binsY        ,
00428   const unsigned long binsZ        ,
00429   const double        weight       )
00430 {
00431   return algo. plot3D ( valueX , valueY , valueZ ,
00432                         ID     , title  ,
00433                         lowX   , highX  ,
00434                         lowY   , highY  ,
00435                         lowZ   , highZ  ,
00436                         binsX  , binsY  , binsZ  ,
00437                         weight                   ) ;
00438 }
00439 // ============================================================================
00440 /*  fill the 3D histogram (book on demand)
00441  *  @param valueX x value to be filled
00442  *  @param valueY y value to be filled
00443  *  @param valueZ z value to be filled
00444  *  @param title histogram title (must be unique within the algorithm)
00445  *  @param lowX  low x limit for histogram
00446  *  @param highX high x limit for histogram
00447  *  @param lowY  low y limit for histogram
00448  *  @param highY high y limit for histogram
00449  *  @param lowZ  low z limit for histogram
00450  *  @param highZ high z limit for histogram
00451  *  @param binsX number of bins in x
00452  *  @param binsY number of bins in y
00453  *  @param binsZ number of bins in z
00454  *  @param weight weight
00455  *  @return pointer to AIDA 3D histogram
00456  */
00457 // ============================================================================
00458 AIDA::IHistogram3D*  GaudiPython::HistoDecorator::plot3D
00459 ( const GaudiHistoAlg&      algo   ,
00460   const double        valueX       ,
00461   const double        valueY       ,
00462   const double        valueZ       ,
00463   const long          ID           ,
00464   const std::string&  title        ,
00465   const double        lowX         ,
00466   const double        highX        ,
00467   const double        lowY         ,
00468   const double        highY        ,
00469   const double        lowZ         ,
00470   const double        highZ        ,
00471   const unsigned long binsX        ,
00472   const unsigned long binsY        ,
00473   const unsigned long binsZ        ,
00474   const double        weight       )
00475 {
00476   return algo. plot3D ( valueX , valueY , valueZ ,
00477                         ID     , title  ,
00478                         lowX   , highX  ,
00479                         lowY   , highY  ,
00480                         lowZ   , highZ  ,
00481                         binsX  , binsY  , binsZ  ,
00482                         weight                   ) ;
00483 }
00484 // ============================================================================
00485 /*  fill the 3D histogram (book on demand)
00486  *  @param valueX x value to be filled
00487  *  @param valueY y value to be filled
00488  *  @param valueZ z value to be filled
00489  *  @param title histogram title (must be unique within the algorithm)
00490  *  @param lowX  low x limit for histogram
00491  *  @param highX high x limit for histogram
00492  *  @param lowY  low y limit for histogram
00493  *  @param highY high y limit for histogram
00494  *  @param lowZ  low z limit for histogram
00495  *  @param highZ high z limit for histogram
00496  *  @param binsX number of bins in x
00497  *  @param binsY number of bins in y
00498  *  @param binsZ number of bins in z
00499  *  @param weight weight
00500  *  @return pointer to AIDA 3D histogram
00501  */
00502 // ============================================================================
00503 AIDA::IHistogram3D*
00504 GaudiPython::HistoDecorator::plot3D
00505 ( const GaudiHistoAlg&      algo   ,
00506   const double        valueX       ,
00507   const double        valueY       ,
00508   const double        valueZ       ,
00509   const std::string&  ID           ,
00510   const std::string&  title        ,
00511   const double        lowX         ,
00512   const double        highX        ,
00513   const double        lowY         ,
00514   const double        highY        ,
00515   const double        lowZ         ,
00516   const double        highZ        ,
00517   const unsigned long binsX        ,
00518   const unsigned long binsY        ,
00519   const unsigned long binsZ        ,
00520   const double        weight       )
00521 {
00522   return algo. plot3D ( valueX , valueY , valueZ ,
00523                         ID     , title  ,
00524                         lowX   , highX  ,
00525                         lowY   , highY  ,
00526                         lowZ   , highZ  ,
00527                         binsX  , binsY  , binsZ  ,
00528                         weight                   ) ;
00529 }
00530 // ========================================================================
00531 // 1D-profiles: by title
00532 // ========================================================================
00533 AIDA::IProfile1D*
00534 GaudiPython::HistoDecorator::profile1D
00535 ( const GaudiHistoAlg&   algo   ,
00536   const double           valueX ,
00537   const double           valueY ,
00538   const std::string&     title  ,
00539   const double           lowX   ,
00540   const double           highX  ,
00541   const unsigned long    binsX  ,
00542   const std::string&     opt    ,
00543   const double           lowY   ,
00544   const double           highY  ,
00545   const double           weight )
00546 {
00547   return algo.profile1D
00548     ( valueX , valueY , title , lowX , highX , binsX ,
00549       opt , lowY , highY , weight ) ;
00550 }
00551 // ========================================================================
00552 // 1D-profiles: by generic ID
00553 // ========================================================================
00554 AIDA::IProfile1D*
00555 GaudiPython::HistoDecorator::profile1D
00556 ( const GaudiHistoAlg&     algo   ,
00557   const double             valueX ,
00558   const double             valueY ,
00559   const GaudiAlg::HistoID& ID     ,
00560   const std::string&       title  ,
00561   const double             lowX   ,
00562   const double             highX  ,
00563   const unsigned long      binsX  ,
00564   const std::string&       opt    ,
00565   const double             lowY   ,
00566   const double             highY  ,
00567   const double             weight )
00568 {
00569   return algo.profile1D
00570     ( valueX , valueY , ID , title , lowX , highX , binsX ,
00571       opt , lowY , highY , weight ) ;
00572 }
00573 // ========================================================================
00574 // 1D-profiles: by numeric ID
00575 // ========================================================================
00576 AIDA::IProfile1D*
00577 GaudiPython::HistoDecorator::profile1D
00578 ( const GaudiHistoAlg&   algo   ,
00579   const double           valueX ,
00580   const double           valueY ,
00581   const long             ID     ,
00582   const std::string&     title  ,
00583   const double           lowX   ,
00584   const double           highX  ,
00585   const unsigned long    binsX  ,
00586   const std::string&     opt    ,
00587   const double           lowY   ,
00588   const double           highY  ,
00589   const double           weight )
00590 {
00591   return algo.profile1D
00592     ( valueX , valueY , ID , title , lowX , highX , binsX ,
00593       opt , lowY , highY , weight ) ;
00594 }
00595 // ========================================================================
00596 // 1D-profiles: by string ID
00597 // ========================================================================
00598 AIDA::IProfile1D*
00599 GaudiPython::HistoDecorator::profile1D
00600 ( const GaudiHistoAlg&   algo   ,
00601   const double           valueX ,
00602   const double           valueY ,
00603   const std::string&     ID     ,
00604   const std::string&     title  ,
00605   const double           lowX   ,
00606   const double           highX  ,
00607   const unsigned long    binsX  ,
00608   const std::string&     opt    ,
00609   const double           lowY   ,
00610   const double           highY  ,
00611   const double           weight )
00612 {
00613   return algo.profile1D
00614     ( valueX , valueY , ID , title , lowX , highX , binsX ,
00615       opt , lowY , highY , weight ) ;
00616 }
00617 // ========================================================================
00618 // 2D-profiles: by title
00619 // ========================================================================
00620 AIDA::IProfile2D*
00621 GaudiPython::HistoDecorator::profile2D
00622 ( const GaudiHistoAlg&   algo   ,
00623   const double           valueX ,
00624   const double           valueY ,
00625   const double           valueZ ,
00626   const std::string&     title  ,
00627   const double           lowX   ,
00628   const double           highX  ,
00629   const double           lowY   ,
00630   const double           highY  ,
00631   const unsigned long    binsX  ,
00632   const unsigned long    binsY  ,
00633   const double           weight )
00634 {
00635   return algo.profile2D
00636     ( valueX , valueY , valueZ ,
00637       title  ,
00638       lowX   , highX  ,
00639       lowY   , highY  ,
00640       binsX  , binsY  , weight  ) ;
00641 }
00642 // ========================================================================
00643 // 2D-profiles: by generic ID
00644 // ========================================================================
00645 AIDA::IProfile2D*
00646 GaudiPython::HistoDecorator::profile2D
00647 ( const GaudiHistoAlg&     algo   ,
00648   const double             valueX ,
00649   const double             valueY ,
00650   const double             valueZ ,
00651   const GaudiAlg::HistoID& ID     ,
00652   const std::string&       title  ,
00653   const double             lowX   ,
00654   const double             highX  ,
00655   const double             lowY   ,
00656   const double             highY  ,
00657   const unsigned long      binsX  ,
00658   const unsigned long      binsY  ,
00659   const double             weight )
00660 {
00661   return algo.profile2D
00662     ( valueX , valueY , valueZ ,
00663       ID     , title  ,
00664       lowX   , highX  ,
00665       lowY   , highY  ,
00666       binsX  , binsY  , weight  ) ;
00667 }
00668 // ========================================================================
00669 // 2D-profiles: by numeric ID
00670 // ========================================================================
00671 AIDA::IProfile2D*
00672 GaudiPython::HistoDecorator::profile2D
00673 ( const GaudiHistoAlg&   algo   ,
00674   const double           valueX ,
00675   const double           valueY ,
00676   const double           valueZ ,
00677   const long             ID     ,
00678   const std::string&     title  ,
00679   const double           lowX   ,
00680   const double           highX  ,
00681   const double           lowY   ,
00682   const double           highY  ,
00683   const unsigned long    binsX  ,
00684   const unsigned long    binsY  ,
00685   const double           weight )
00686 {
00687   return algo.profile2D
00688     ( valueX , valueY , valueZ ,
00689       ID     , title  ,
00690       lowX   , highX  ,
00691       lowY   , highY  ,
00692       binsX  , binsY  , weight  ) ;
00693 }
00694 // ========================================================================
00695 // 2D-profiles: by string ID
00696 // ========================================================================
00697 AIDA::IProfile2D*
00698 GaudiPython::HistoDecorator::profile2D
00699 ( const GaudiHistoAlg&   algo   ,
00700   const double           valueX ,
00701   const double           valueY ,
00702   const double           valueZ ,
00703   const std::string&     ID     ,
00704   const std::string&     title  ,
00705   const double           lowX   ,
00706   const double           highX  ,
00707   const double           lowY   ,
00708   const double           highY  ,
00709   const unsigned long    binsX  ,
00710   const unsigned long    binsY  ,
00711   const double           weight )
00712 {
00713   return algo.profile2D
00714     ( valueX , valueY , valueZ ,
00715       ID     , title  ,
00716       lowX   , highX  ,
00717       lowY   , highY  ,
00718       binsX  , binsY  , weight  ) ;
00719 }
00720 // ============================================================================
00721 // get all histograms
00722 // ============================================================================
00723 namespace
00724 {
00726   template <class KEY, class HISTO>
00727   size_t _getHistos
00728   ( const GaudiUtils::HashMap<KEY,HISTO>& a ,
00729     std::map<GaudiAlg::ID,HISTO>&         b )
00730   {
00731     for  ( typename GaudiUtils::HashMap<KEY,HISTO>::const_iterator ih =
00732              a.begin() ; a.end() != ih ; ++ih )
00733     {
00734       if ( 0 == ih->second ) { continue ; }
00735       GaudiAlg::ID id ( ih->first ) ;
00736       b [ id ] = ih->second ;
00737     }
00738     return b.size() ;
00739   }
00740   // =========================================================================
00741   template <class HISTO>
00742   size_t fromMap
00743   ( const std::map<GaudiAlg::ID,HISTO>&  a ,
00744     std::vector<GaudiAlg::ID>&           b ,
00745     std::vector<HISTO>&                  c )
00746   {
00747     b.clear() ;
00748     c.clear() ;
00749      for ( typename std::map<GaudiAlg::ID,HISTO>::const_iterator it =
00750              a.begin() ; a.end() != it ; ++it )
00751      {
00752        if ( 0 == it->second ) { continue ; }
00753        b.push_back ( it->first  ) ;
00754        c.push_back ( it->second ) ;
00755      }
00756     return b.size () ;
00757   }
00758   // ==========================================================================
00759 }
00760 // ============================================================================
00761 size_t GaudiPython::HistoDecorator::_histos_a_
00762 ( const GaudiHistoAlg*                   cmp    ,
00763   GaudiPython::HistoDecorator::IDs&      ids    ,
00764   GaudiPython::HistoDecorator::Histos1D& histos )
00765 {
00766   histos.clear() ;
00767   ids   .clear() ;
00768   if ( 0 == cmp ) { return 0 ; }                                      // RETURN
00769   //
00770   std::map<GaudiAlg::ID,AIDA::IHistogram1D*> _map ;
00771   //
00772   _getHistos ( cmp -> histo1DMapID () , _map ) ;
00773   //
00774   return fromMap ( _map , ids , histos ) ;
00775   // ==========================================================================
00776 }
00777 // ============================================================================
00778 size_t GaudiPython::HistoDecorator::_histos_t_
00779 ( const GaudiHistoTool*                  cmp    ,
00780   GaudiPython::HistoDecorator::IDs&      ids    ,
00781   GaudiPython::HistoDecorator::Histos1D& histos )
00782 {
00783   histos.clear() ;
00784   ids   .clear() ;
00785   if ( 0 == cmp ) { return 0 ; }                                      // RETURN
00786   //
00787   std::map<GaudiAlg::ID,AIDA::IHistogram1D*> _map ;
00788   //
00789   _getHistos ( cmp -> histo1DMapID () , _map ) ;
00790   //
00791   return fromMap ( _map , ids , histos ) ;
00792   // ==========================================================================
00793 }
00794 // ============================================================================
00795 size_t GaudiPython::HistoDecorator::_histos_a_
00796 ( const IAlgorithm*                        cmp    ,
00797   GaudiPython::HistoDecorator::IDs&        ids    ,
00798   GaudiPython::HistoDecorator::Histos1D&   histos )
00799 {
00800   ids    . clear() ;
00801   histos . clear() ;
00802   if ( 0 == cmp ) { return 0 ; }                                      // RETURN
00803   return _histos_a_ ( dynamic_cast<const GaudiHistoAlg*> ( cmp ) , ids, histos ) ;
00804 }
00805 // ============================================================================
00806 size_t GaudiPython::HistoDecorator::_histos_t_
00807 ( const IAlgTool*                          cmp    ,
00808   GaudiPython::HistoDecorator::IDs&        ids    ,
00809   GaudiPython::HistoDecorator::Histos1D&   histos )
00810 {
00811   ids    . clear() ;
00812   histos . clear() ;
00813   if ( 0 == cmp ) { return 0 ; }                                      // RETURN
00814   return _histos_t_ ( dynamic_cast<const GaudiHistoTool*> ( cmp ) , ids, histos ) ;
00815 }
00816 // ============================================================================
00817 //                                                                2D-histograms
00818 // ============================================================================
00819 size_t GaudiPython::HistoDecorator::_histos_a_
00820 ( const GaudiHistoAlg*                   cmp    ,
00821   GaudiPython::HistoDecorator::IDs&      ids    ,
00822   GaudiPython::HistoDecorator::Histos2D& histos )
00823 {
00824   histos.clear() ;
00825   ids   .clear() ;
00826   if ( 0 == cmp ) { return 0 ; }                                      // RETURN
00827   //
00828   std::map<GaudiAlg::ID,AIDA::IHistogram2D*> _map ;
00829   //
00830   _getHistos ( cmp -> histo2DMapID () , _map ) ;
00831   //
00832   return fromMap ( _map , ids , histos ) ;
00833   // ==========================================================================
00834 }
00835 // ============================================================================
00836 size_t GaudiPython::HistoDecorator::_histos_t_
00837 ( const GaudiHistoTool*                  cmp    ,
00838   GaudiPython::HistoDecorator::IDs&      ids    ,
00839   GaudiPython::HistoDecorator::Histos2D& histos )
00840 {
00841   histos.clear() ;
00842   ids   .clear() ;
00843   if ( 0 == cmp ) { return 0 ; }                                      // RETURN
00844   //
00845   std::map<GaudiAlg::ID,AIDA::IHistogram2D*> _map ;
00846   //
00847   _getHistos ( cmp -> histo2DMapID () , _map ) ;
00848   //
00849   return fromMap ( _map , ids , histos ) ;
00850   // ==========================================================================
00851 }
00852 // ============================================================================
00853 size_t GaudiPython::HistoDecorator::_histos_a_
00854 ( const IAlgorithm*                        cmp    ,
00855   GaudiPython::HistoDecorator::IDs&        ids    ,
00856   GaudiPython::HistoDecorator::Histos2D&   histos )
00857 {
00858   ids    . clear() ;
00859   histos . clear() ;
00860   if ( 0 == cmp ) { return 0 ; }                                      // RETURN
00861   return _histos_a_ ( dynamic_cast<const GaudiHistoAlg*> ( cmp ) , ids, histos ) ;
00862 }
00863 // ============================================================================
00864 size_t GaudiPython::HistoDecorator::_histos_t_
00865 ( const IAlgTool*                          cmp    ,
00866   GaudiPython::HistoDecorator::IDs&        ids    ,
00867   GaudiPython::HistoDecorator::Histos2D&   histos )
00868 {
00869   ids    . clear() ;
00870   histos . clear() ;
00871   if ( 0 == cmp ) { return 0 ; }                                      // RETURN
00872   return _histos_t_ ( dynamic_cast<const GaudiHistoTool*> ( cmp ) , ids, histos ) ;
00873 }
00874 // ============================================================================
00875 //                                                                3D-histograms
00876 // ============================================================================
00877 size_t GaudiPython::HistoDecorator::_histos_a_
00878 ( const GaudiHistoAlg*                   cmp    ,
00879   GaudiPython::HistoDecorator::IDs&      ids    ,
00880   GaudiPython::HistoDecorator::Histos3D& histos )
00881 {
00882   histos.clear() ;
00883   ids   .clear() ;
00884   if ( 0 == cmp ) { return 0 ; }                                      // RETURN
00885   //
00886   std::map<GaudiAlg::ID,AIDA::IHistogram3D*> _map ;
00887   //
00888   _getHistos ( cmp -> histo3DMapID () , _map ) ;
00889   //
00890   return fromMap ( _map , ids , histos ) ;
00891   // ==========================================================================
00892 }
00893 // ============================================================================
00894 size_t GaudiPython::HistoDecorator::_histos_t_
00895 ( const GaudiHistoTool*                  cmp    ,
00896   GaudiPython::HistoDecorator::IDs&      ids    ,
00897   GaudiPython::HistoDecorator::Histos3D& histos )
00898 {
00899   histos.clear() ;
00900   ids   .clear() ;
00901   if ( 0 == cmp ) { return 0 ; }                                      // RETURN
00902   //
00903   std::map<GaudiAlg::ID,AIDA::IHistogram3D*> _map ;
00904   //
00905   _getHistos ( cmp -> histo3DMapID () , _map ) ;
00906   //
00907   return fromMap ( _map , ids , histos ) ;
00908   // ==========================================================================
00909 }
00910 // ============================================================================
00911 size_t GaudiPython::HistoDecorator::_histos_a_
00912 ( const IAlgorithm*                        cmp    ,
00913   GaudiPython::HistoDecorator::IDs&        ids    ,
00914   GaudiPython::HistoDecorator::Histos3D&   histos )
00915 {
00916   ids    . clear() ;
00917   histos . clear() ;
00918   if ( 0 == cmp ) { return 0 ; }                                      // RETURN
00919   return _histos_a_ ( dynamic_cast<const GaudiHistoAlg*> ( cmp ) , ids, histos ) ;
00920 }
00921 // ============================================================================
00922 size_t GaudiPython::HistoDecorator::_histos_t_
00923 ( const IAlgTool*                          cmp    ,
00924   GaudiPython::HistoDecorator::IDs&        ids    ,
00925   GaudiPython::HistoDecorator::Histos3D&   histos )
00926 {
00927   ids    . clear() ;
00928   histos . clear() ;
00929   if ( 0 == cmp ) { return 0 ; }                                      // RETURN
00930   return _histos_t_ ( dynamic_cast<const GaudiHistoTool*> ( cmp ) , ids, histos ) ;
00931 }
00932 // ============================================================================
00933 //                                                                  1D-profiles
00934 // ============================================================================
00935 size_t GaudiPython::HistoDecorator::_histos_a_
00936 ( const GaudiHistoAlg*                     cmp    ,
00937   GaudiPython::HistoDecorator::IDs&        ids    ,
00938   GaudiPython::HistoDecorator::Profiles1D& histos )
00939 {
00940   histos.clear() ;
00941   ids   .clear() ;
00942   if ( 0 == cmp ) { return 0 ; }                                      // RETURN
00943   //
00944   std::map<GaudiAlg::ID,AIDA::IProfile1D*> _map ;
00945   //
00946   _getHistos ( cmp -> profile1DMapID () , _map ) ;
00947   //
00948   return fromMap ( _map , ids , histos ) ;
00949   // ==========================================================================
00950 }
00951 // ============================================================================
00952 size_t GaudiPython::HistoDecorator::_histos_t_
00953 ( const GaudiHistoTool*                    cmp    ,
00954   GaudiPython::HistoDecorator::IDs&        ids    ,
00955   GaudiPython::HistoDecorator::Profiles1D& histos )
00956 {
00957   histos.clear() ;
00958   ids   .clear() ;
00959   if ( 0 == cmp ) { return 0 ; }                                      // RETURN
00960   //
00961   std::map<GaudiAlg::ID,AIDA::IProfile1D*> _map ;
00962   //
00963   _getHistos ( cmp -> profile1DMapID () , _map ) ;
00964   //
00965   return fromMap ( _map , ids , histos ) ;
00966   // ==========================================================================
00967 }
00968 // ============================================================================
00969 size_t GaudiPython::HistoDecorator::_histos_a_
00970 ( const IAlgorithm*                        cmp    ,
00971   GaudiPython::HistoDecorator::IDs&        ids    ,
00972   GaudiPython::HistoDecorator::Profiles1D& histos )
00973 {
00974   ids    . clear() ;
00975   histos . clear() ;
00976   if ( 0 == cmp ) { return 0 ; }                                      // RETURN
00977   return _histos_a_ ( dynamic_cast<const GaudiHistoAlg*> ( cmp ) , ids, histos ) ;
00978 }
00979 // ============================================================================
00980 size_t GaudiPython::HistoDecorator::_histos_t_
00981 ( const IAlgTool*                          cmp    ,
00982   GaudiPython::HistoDecorator::IDs&        ids    ,
00983   GaudiPython::HistoDecorator::Profiles1D& histos )
00984 {
00985   ids    . clear() ;
00986   histos . clear() ;
00987   if ( 0 == cmp ) { return 0 ; }                                      // RETURN
00988   return _histos_t_ ( dynamic_cast<const GaudiHistoTool*> ( cmp ) , ids, histos ) ;
00989 }
00990 // ============================================================================
00991 //                                                                  2D-profiles
00992 // ============================================================================
00993 size_t GaudiPython::HistoDecorator::_histos_a_
00994 ( const GaudiHistoAlg*                     cmp    ,
00995   GaudiPython::HistoDecorator::IDs&        ids    ,
00996   GaudiPython::HistoDecorator::Profiles2D& histos )
00997 {
00998   histos.clear() ;
00999   ids   .clear() ;
01000   if ( 0 == cmp ) { return 0 ; }                                      // RETURN
01001   //
01002   std::map<GaudiAlg::ID,AIDA::IProfile2D*> _map ;
01003   //
01004   _getHistos ( cmp -> profile2DMapID () , _map ) ;
01005   //
01006   return fromMap ( _map , ids , histos ) ;
01007   // ==========================================================================
01008 }
01009 // ============================================================================
01010 size_t GaudiPython::HistoDecorator::_histos_t_
01011 ( const GaudiHistoTool*                    cmp    ,
01012   GaudiPython::HistoDecorator::IDs&        ids    ,
01013   GaudiPython::HistoDecorator::Profiles2D& histos )
01014 {
01015   histos.clear() ;
01016   ids   .clear() ;
01017   if ( 0 == cmp ) { return 0 ; }                                      // RETURN
01018   //
01019   std::map<GaudiAlg::ID,AIDA::IProfile2D*> _map ;
01020   //
01021   _getHistos ( cmp -> profile2DMapID () , _map ) ;
01022   //
01023   return fromMap ( _map , ids , histos ) ;
01024   // ==========================================================================
01025 }
01026 // ============================================================================
01027 size_t GaudiPython::HistoDecorator::_histos_a_
01028 ( const IAlgorithm*                        cmp    ,
01029   GaudiPython::HistoDecorator::IDs&        ids    ,
01030   GaudiPython::HistoDecorator::Profiles2D& histos )
01031 {
01032   ids    . clear() ;
01033   histos . clear() ;
01034   if ( 0 == cmp ) { return 0 ; }                                      // RETURN
01035   return _histos_a_ ( dynamic_cast<const GaudiHistoAlg*> ( cmp ) , ids, histos ) ;
01036 }
01037 // ============================================================================
01038 size_t GaudiPython::HistoDecorator::_histos_t_
01039 ( const IAlgTool*                          cmp    ,
01040   GaudiPython::HistoDecorator::IDs&        ids    ,
01041   GaudiPython::HistoDecorator::Profiles2D& histos )
01042 {
01043   ids    . clear() ;
01044   histos . clear() ;
01045   if ( 0 == cmp ) { return 0 ; }                                      // RETURN
01046   return _histos_t_ ( dynamic_cast<const GaudiHistoTool*> ( cmp ) , ids, histos ) ;
01047 }
01048 // ============================================================================
01049 
01050 
01051 // ============================================================================
01052 // The END
01053 // ============================================================================
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated at Wed Feb 9 16:24:59 2011 for Gaudi Framework, version v22r0 by Doxygen version 1.6.2 written by Dimitri van Heesch, © 1997-2004