herwig is hosted by Hepforge, IPPP Durham
Herwig++  2.7.0
Histogram2Output.h
00001 // -*- C++ -*-
00002 
00003 // (C) 2007-2009 Simon Plaetzer -- sp@particle.uni-karlsruhe.de
00004 
00005 #ifndef Analysis2_Histogram2Output_H
00006 #define Analysis2_Histogram2Output_H
00007 //
00008 // This is the declaration of the Histogram2Output class.
00009 //
00010 
00011 #include "ThePEG/Interface/Interfaced.h"
00012 #include "Histogram2Output.fh"
00013 
00014 #include "ThePEG/Persistency/PersistentOStream.h"
00015 #include "ThePEG/Persistency/PersistentIStream.h"
00016 
00017 #include "Histogram2.h"
00018 
00019 namespace Analysis2 {
00020 
00021 using namespace ThePEG;
00022 
00028 namespace HistogramOutput {
00030   const unsigned int Default   = 0;
00032   const unsigned int Frame     = 1;
00034   const unsigned int Errorbars = 1 << 1;
00036   const unsigned int Xlog      = 1 << 2;
00038   const unsigned int Ylog      = 1 << 3;
00040   const unsigned int Smooth    = 1 << 4;
00042   const unsigned int Rawcount  = 1 << 5;
00043 }
00044 
00049 struct Histogram2Options {
00050 
00054   inline Histogram2Options ()
00055     : plotFlags(0), channelFlags(0), title(""), datatitle(""),
00056       xlabel(""), ylabel (""), differential(true) {}
00057   
00061   inline Histogram2Options (int pFlags,
00062                             int cFlags = 0,
00063                             string t = "",
00064                             string dt = "",
00065                             string x = "",
00066                             string y = "",
00067                             bool diff = true)
00068     : plotFlags(pFlags), channelFlags(cFlags), title(t),
00069       datatitle(dt), xlabel(x), ylabel (y), differential(diff) {}
00070   
00072   int plotFlags;
00073 
00075   int channelFlags;
00076 
00078   string title;
00079 
00081   string datatitle;
00082   
00084   string xlabel;
00085 
00087   string ylabel;
00088 
00090   bool differential;
00091   
00092 };
00093 
00102 class Histogram2Output: public Interfaced {
00103 
00104 public:
00105 
00111   inline Histogram2Output();
00112 
00116   inline Histogram2Output(const Histogram2Output &);
00117 
00121   virtual ~Histogram2Output();
00123 
00124 public:
00125 
00132   void initialize (const string& name);
00133 
00138   virtual void put (Histogram2Ptr, const Histogram2Options&, const string& dataChannel);
00139 
00147   virtual inline void initialize ();
00148 
00156   virtual inline void finalize ();
00157 
00158 protected:
00159 
00163   virtual ostream& currentOStream ();
00164 
00168   inline string prefix () const;
00169 
00173   inline string mctitle () const;
00174 
00175 public:
00176 
00183   void persistentOutput(PersistentOStream & os) const;
00184 
00190   void persistentInput(PersistentIStream & is, int version);
00192 
00199   static void Init();
00200 
00201 protected:
00202 
00209   inline virtual IBPtr clone() const;
00210 
00215   inline virtual IBPtr fullclone() const;
00217 
00218 
00219 // If needed, insert declarations of virtual function defined in the
00220 // InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
00221 
00222 
00223 protected:
00224 
00231   inline virtual void doinitrun();
00232 
00237   inline virtual void dofinish();
00239 
00240 
00241 private:
00242 
00246   string _prefix;
00247 
00251   string _mctitle;
00252 
00256   ofstream _out;
00257 
00262   static ClassDescription<Histogram2Output> initHistogram2Output;
00263 
00268   Histogram2Output & operator=(const Histogram2Output &);
00269 
00270 };
00271 
00275 inline PersistentOStream& operator << (PersistentOStream& os, const Histogram2Options& options);
00276 
00280 inline PersistentIStream& operator >> (PersistentIStream& is, Histogram2Options& options);
00281 
00282 }
00283 
00284 #include "ThePEG/Utilities/ClassTraits.h"
00285 
00286 namespace ThePEG {
00287 
00292 template <>
00293 struct BaseClassTrait<Analysis2::Histogram2Output,1> {
00295   typedef Interfaced NthBase;
00296 };
00297 
00300 template <>
00301 struct ClassTraits<Analysis2::Histogram2Output>
00302   : public ClassTraitsBase<Analysis2::Histogram2Output> {
00304   static string className() { return "Analysis2::Histogram2Output"; }
00312   static string library() { return "Analysis2.so"; }
00313 };
00314 
00317 }
00318 
00319 #include "Histogram2Output.icc"
00320 #ifndef ThePEG_TEMPLATES_IN_CC_FILE
00321 // #include "Histogram2Output.tcc"
00322 #endif
00323 
00324 #endif /* Analysis2_Histogram2Output_H */