Analysis  version 7.0 - august 2014
SpecExtern.hh
Go to the documentation of this file.
1 //======================================================================
2 /*! \file SpecExtern.hh
3  *
4  * Déclaration des fonctions de la classe SpecExtern qui décrit les
5  * spectres (histogrammes) constants provenant d'un fichier ROOT.
6  */
7 //======================================================================
8 
9 #ifndef SPEC_EXTERN_HH
10 #define SPEC_EXTERN_HH
11 
12 #include "SpecCalc.hh"
13 
14 
15 //======================================================================
16 /*! \class SpecExtern
17  *
18  * The class is used to use ROOT histograms from ROOT files
19  * in the list of spectra.
20  * The histogram is dupplicated and cannot be modified.
21  */
22 class SpecExtern : public SpecCalc
23 {
24 //----------------------------------------------------------------------
25  /*! \object_doc */
27 //----------------------------------------------------------------------
28 
29  protected:
30  string file_name; ///< Nom du fichier ROOT où est défini l'histogramme
31  string histo_name; ///< Nom de l'histogramme dans le fichier
32 
33  public:
34 
35 //----------------------------------------------------------------------
36 // CONSTRUCTEUR / AFFECTATION / DESTRUCTEUR
37 //----------------------------------------------------------------------
38 
39  // Constructeur
40  SpecExtern ( const string & h_name,
41  const string & f_name,
42  const string & s_name );
43 
44  // Constructeur de recopie
45  SpecExtern ( const SpecExtern & original );
46 
47  // Destructeur
48  virtual ~SpecExtern ();
49 
50 //----------------------------------------------------------------------
51 
52  public:
53  virtual void Reset ( );
54 
55  // Retourne l'identificateur du type de spectre.
56  u_int TypeId ( ) const;
57 
58  // Retourne le nom du type de spectre.
59  string Type ( ) const;
60 
61  // Retourne une chaîne décrivant le spectre.
62  virtual string Definition ( ) const;
63 
64  // Ecriture des données du spectre dans une chaîne de définition.
65  virtual string DefinitionString ( ) const;
66 
67  // Définition d'un spectre de type donné static Spectrum * NewSpectrumDef ( const string & name, const string & defstr, int & error ); // Retourne le nom de l'histogramme original. virtual string GetHistoName ( ) const; // Retourne le nom du fichier de l'histogramme original. virtual string GetHistoFileName ( ) const; //---------------------------------------------------------------------- // pour ROOT... public: /*! Définition à usage de ROOT... */ ClassDef(SpecExtern,0); } ; //====================================================================== // METHODES INLINE //====================================================================== /*! Remise à zéro du spectre: inopérant pour spectres calculés.*/ inline void SpecExtern::Reset ( ) { } /*! Retourne l'identificateur du type de spectre. */ inline u_int SpecExtern::TypeId ( ) const { return (spectrumTypeExtern); } /*! Retourne le nom du type de spectre. */ inline string SpecExtern::Type ( ) const { return (SPECTRUM_TYPE_TXT_EXTERN); } /*! Retourne le nom de l'histogramme original.*/ inline string SpecExtern::GetHistoName ( ) const { return (histo_name); } /*! Retourne le nom du fichier de l'histogramme original.*/ inline string SpecExtern::GetHistoFileName ( ) const { return (file_name); } //====================================================================== #endif
68  static Spectrum * NewSpectrumDef ( const string & name, const string & defstr, int & error );
69 
70  // Retourne le nom de l'histogramme original.
71  virtual string GetHistoName ( ) const;
72 
73  // Retourne le nom du fichier de l'histogramme original.
74  virtual string GetHistoFileName ( ) const;
75 
76 
77 //----------------------------------------------------------------------
78 // pour ROOT...
79  public:
80  /*! Définition à usage de ROOT... */
82 } ;
83 
84 
85 //======================================================================
86 // METHODES INLINE
87 //======================================================================
88 
89 /*! Remise à zéro du spectre: inopérant pour spectres calculés.*/
90 inline void SpecExtern::Reset ( )
91  { }
92 
93 /*! Retourne l'identificateur du type de spectre.
94  */
95 inline u_int SpecExtern::TypeId ( ) const
96  { return (spectrumTypeExtern); }
97 
98 /*! Retourne le nom du type de spectre.
99  */
100 inline string SpecExtern::Type ( ) const
101  { return (SPECTRUM_TYPE_TXT_EXTERN); }
102 
103 
104 /*! Retourne le nom de l'histogramme original.*/
105 inline string SpecExtern::GetHistoName ( ) const
106  { return (histo_name); }
107 
108 /*! Retourne le nom du fichier de l'histogramme original.*/
109 inline string SpecExtern::GetHistoFileName ( ) const
110  { return (file_name); }
111 
112 //======================================================================
113 #endif
virtual string GetHistoName() const
Definition: SpecExtern.hh:105
virtual string Definition() const
Definition: SpecExtern.cpp:140
virtual void Reset()
Definition: SpecExtern.hh:90
virtual string GetHistoFileName() const
Definition: SpecExtern.hh:109
virtual ~SpecExtern()
Definition: SpecExtern.cpp:130
Definition: Spectrum.hh:222
GObject(SpecExtern)
string Type() const
Definition: SpecExtern.hh:100
#define SPECTRUM_TYPE_TXT_EXTERN
Nom du type de spectre: Histo d&#39;un fichier externe.
Definition: Spectrum.hh:107
Definition: SpecExtern.hh:22
Definition: SpecCalc.hh:26
string file_name
Nom du fichier ROOT où est défini l&#39;histogramme.
Definition: SpecExtern.hh:30
ClassDef(SpecExtern, 0)
virtual string DefinitionString() const
Definition: SpecExtern.cpp:157
SpecExtern(const string &h_name, const string &f_name, const string &s_name)
Definition: SpecExtern.cpp:22
u_int TypeId() const
Definition: SpecExtern.hh:95
static Spectrum * NewSpectrumDef(const string &name, const string &defstr, int &error)
Definition: SpecExtern.cpp:178
string histo_name
Nom de l&#39;histogramme dans le fichier.
Definition: SpecExtern.hh:31