Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4Plotter.hh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // Guy Barrand 25th September 2021
0027 //
0028 
0029 #ifndef G4PLOTTER_HH
0030 #define G4PLOTTER_HH
0031 
0032 #include "G4String.hh"
0033 
0034 #include <utility>
0035 #include <vector>
0036 
0037 namespace tools {namespace histo {class h1d;}}
0038 namespace tools {namespace histo {class h2d;}}
0039 
0040 class G4Plotter {
0041 public:  
0042   using RegionStyle     = std::pair<unsigned int,G4String>;
0043   using Parameter       = std::pair<G4String,G4String>;
0044   using RegionParameter = std::pair<unsigned int,Parameter>;
0045   using Region_h1d      = std::pair<unsigned int,tools::histo::h1d*>;
0046   using Region_h2d      = std::pair<unsigned int,tools::histo::h2d*>;
0047   using Region_h1       = std::pair<unsigned int,int>;
0048   using Region_h2       = std::pair<unsigned int,int>;
0049 
0050   G4Plotter();
0051   virtual ~G4Plotter() = default;
0052   G4Plotter(const G4Plotter&);
0053   G4Plotter& operator = (const G4Plotter&);
0054 
0055   void SetLayout(unsigned int colums,unsigned int rows);
0056   void AddStyle(const G4String& style);
0057   void AddRegionStyle(unsigned int region,const G4String& style);
0058   void AddRegionParameter(unsigned int region,const G4String& parameter,const G4String& value);
0059   void AddRegionHistogram(unsigned int region,tools::histo::h1d* histo);
0060   void AddRegionHistogram(unsigned int region,tools::histo::h2d* histo);
0061   void AddRegionH1(unsigned int region,int id);
0062   void AddRegionH2(unsigned int region,int id);
0063   void Reset();
0064   void Clear();
0065   void ClearRegion(unsigned int region);
0066 
0067   unsigned int GetColumns() const {return fColumns;}
0068   unsigned int GetRows() const {return fRows;}
0069   const std::vector<G4String>& GetStyles() const {return fStyles;}
0070   const std::vector<RegionStyle>& GetRegionStyles() const {return fRegionStyles;}
0071   const std::vector<RegionParameter>& GetRegionParameters() const {return fRegionParameters;}
0072   const std::vector<Region_h1d>& GetRegionH1Ds() const {return fRegion_h1ds;}
0073   const std::vector<Region_h2d>& GetRegionH2Ds() const {return fRegion_h2ds;}
0074 
0075   const std::vector<Region_h1>& GetRegionH1s() const {return fRegion_h1s;}
0076   const std::vector<Region_h2>& GetRegionH2s() const {return fRegion_h2s;}
0077 
0078 private:
0079   unsigned int fColumns{1};
0080   unsigned int fRows{1};
0081   std::vector<G4String> fStyles;
0082   std::vector<RegionStyle> fRegionStyles;
0083   std::vector<RegionParameter> fRegionParameters;
0084   std::vector<Region_h1d> fRegion_h1ds;
0085   std::vector<Region_h2d> fRegion_h2ds;
0086   std::vector<Region_h1>  fRegion_h1s;
0087   std::vector<Region_h2>  fRegion_h2s;
0088 };
0089 
0090 #endif