Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // This file is part of HepMC
0004 // Copyright (C) 2014-2023 The HepMC collaboration (see AUTHORS for details)
0005 //
0006 #ifndef HEPMC3_PRINT_H
0007 #define HEPMC3_PRINT_H
0008 ///
0009 /// @file Print.h
0010 /// @brief Definition of static \b class Print
0011 ///
0012 
0013 #include "HepMC3/GenEvent.h"
0014 #include "HepMC3/GenRunInfo.h"
0015 #include "HepMC3/GenVertex.h"
0016 #include "HepMC3/GenParticle.h"
0017 
0018 namespace HepMC3 {
0019 
0020 
0021 class GenPdfInfo;
0022 class GenHeavyIon;
0023 class GenCrossSection;
0024 
0025 
0026 /// @brief Provides different printing formats
0027 class Print {
0028 public:
0029     /// @brief Print content of all GenEvent containers
0030     static void content(std::ostream& os, const GenEvent &event);
0031     /// @brief Print content of all GenEvent containers to std::cout
0032     inline static void content(const GenEvent &event) { content(std::cout, event); }
0033 
0034     /// @brief Print event in listing (HepMC2) format
0035     static void listing(std::ostream& os, const GenEvent &event, unsigned short precision = 2);
0036     /// @brief Print event in listing (HepMC2) format  to std::cout
0037     inline static void listing(const GenEvent &event, unsigned short precision = 2) {
0038         listing(std::cout, event, precision);
0039     }
0040 
0041     /// @brief Print runinfo in listing
0042     static void listing(std::ostream& os, const GenRunInfo &ri, unsigned short precision = 2);
0043     /// @brief Print runinfo in listing  to std::cout
0044     inline static void listing(const GenRunInfo &ri, unsigned short precision = 2) {
0045         listing(std::cout, ri, precision);
0046     }
0047 
0048     /// @brief Print one-line info
0049     static void line(std::ostream& os, const GenEvent &event, bool attributes=false);
0050     /// @brief Print one-line info to std::cout
0051     inline static void line(const GenEvent &event, bool attributes=false) {
0052         line(std::cout, event, attributes);
0053         std::cout<<std::endl;
0054     }
0055 
0056     /// @brief Print one-line info
0057     static void line(std::ostream& os, const GenRunInfo &RunInfo, bool attributes=false);
0058     /// @brief Print one-line info to std::cout
0059     inline static void line(const GenRunInfo &RunInfo, bool attributes=false) {
0060         line(std::cout, RunInfo, attributes);
0061         std::cout<<std::endl;
0062     }
0063 
0064     /// @brief Print one-line info
0065     static void line(std::ostream& os, const GenRunInfo::ToolInfo& t);
0066     /// @brief Print one-line info to std::cout
0067     inline static void line(const GenRunInfo::ToolInfo& t) {
0068         line(std::cout, t);
0069         std::cout << std::endl;
0070     }
0071 
0072 
0073 
0074     /// @brief Print one-line info
0075     static void line(std::ostream& os, ConstGenVertexPtr v, bool attributes=false);
0076     /// @brief Print one-line info to std::cout
0077     inline static void line(ConstGenVertexPtr v, bool attributes=false) {
0078         line(std::cout, v, attributes);
0079         std::cout << std::endl;
0080     }
0081 
0082     /// @brief Print one-line info
0083     static void line(std::ostream& os, GenVertexPtr v, bool attributes=false);
0084     /// @brief Print one-line info to std::cout
0085     inline static void line(GenVertexPtr v, bool attributes=false) {
0086         line(std::cout, v, attributes);
0087         std::cout << std::endl;
0088     }
0089 
0090     /// @brief Print one-line info
0091     static void line(std::ostream& os, const FourVector& p);
0092     /// @brief Print one-line info to std::cout
0093     inline static void line(const FourVector& p) {
0094         line(std::cout, p);
0095         std::cout << std::endl;
0096     }
0097 
0098     /// @brief Print one-line info
0099     static void line(std::ostream& os, ConstGenParticlePtr p, bool attributes=false);
0100     /// @brief Print one-line info to std::cout
0101     inline static void line(ConstGenParticlePtr p, bool attributes=false) {
0102         line(std::cout, p, attributes);
0103         std::cout << std::endl;
0104     }
0105 
0106     /// @brief Print one-line info
0107     static void line(std::ostream& os, GenParticlePtr p, bool attributes=false);
0108     /// @brief Print one-line info to std::cout
0109     inline static void line(GenParticlePtr p, bool attributes=false) {
0110         line(std::cout, p, attributes);
0111         std::cout << std::endl;
0112     }
0113 
0114 
0115     /// @brief Print one-line info
0116     static void line(std::ostream& os, std::shared_ptr<GenCrossSection> &cs);
0117     /// @brief Print one-line info to std::cout
0118     inline static void line(std::shared_ptr<GenCrossSection> &cs) {
0119         line(std::cout, cs);
0120         std::cout<<std::endl;
0121     }
0122 
0123     /// @brief Print one-line info
0124     static void line(std::ostream& os, std::shared_ptr<GenHeavyIon> &hi);
0125     /// @brief Print one-line info to std::cout
0126     inline static void line(std::shared_ptr<GenHeavyIon> &hi) {
0127         line(std::cout, hi);
0128         std::cout<<std::endl;
0129     }
0130 
0131     /// @brief Print one-line info
0132     static void line(std::ostream& os, std::shared_ptr<GenPdfInfo> &pi);
0133     /// @brief Print one-line info to std::cout
0134     inline static void line(std::shared_ptr<GenPdfInfo> &pi) {
0135         line(std::cout, pi);
0136         std::cout<<std::endl;
0137     }
0138 ///deleted copy assignment operator
0139     Print& operator = (const Print &) = delete;
0140 
0141 private:
0142     /// @brief Helper function for printing a vertex in listing format
0143     static void listing(std::ostream& os, ConstGenVertexPtr v);
0144 
0145 
0146     /// @brief Helper function for printing a particle in listing format
0147     static void listing(std::ostream& os, ConstGenParticlePtr p);
0148 
0149     /// @brief Destructor
0150     virtual ~Print() {}
0151 };
0152 } // namespace HepMC3
0153 
0154 #endif