Pixie16 Analysis Software Suite
Analysis code for processing of .ldf files
Plots.hpp
Go to the documentation of this file.
1 
5 #ifndef __PLOTS_HPP_
6 #define __PLOTS_HPP_
7 
8 #include <fstream>
9 #include <string>
10 #include <map>
11 #include <set>
12 #include <string>
13 
14 #include "Globals.hpp"
15 #include "PlotsRegister.hpp"
16 
20 extern "C" bool bantesti_(const int &, const int &, const int &);
22 extern "C" void count1cc_(const int &, const int &, const int &);
24 extern "C" void set2cc_(const int &, const int &, const int &, const int &);
25 
27 class Plots {
28 public:
33  Plots (int offset, int range, std::string name);
34 
36  int GetOffset() { return offset_; }
37 
40  void PrintNonEmpty(std::ofstream& hislog);
41 
44  bool CheckRange (int id) const;
45 
48  bool Exists (int id) const;
49 
52  bool Exists (const std::string &mne) const;
53 
54 
65  bool DeclareHistogram1D(int dammId, int xSize, const char* title,
66  int halfWordsPerChan, int xHistLength, int xLow, int xHigh,
67  const std::string &mne = "");
68 
76  bool DeclareHistogram1D(int dammId, int xSize, const char* title,
77  int halfWordsPerChan = 2, const std::string &mne = "");
78 
87  bool DeclareHistogram1D(int dammId, int xSize, const char* title,
88  int halfWordsPerChan, int contraction,
89  const std::string &mne = "");
90 
105  bool DeclareHistogram2D(int dammId, int xSize, int ySize, const char *title,
106  int halfWordsPerChan, int xHistLength, int xLow,
107  int xHigh, int yHistLength, int yLow, int yHigh,
108  const std::string &mne = "");
109 
118  bool DeclareHistogram2D(int dammId, int xSize, int ySize, const char* title,
119  int halfWordPerChan = 1,
120  const std::string &mne = "");
121 
132  bool DeclareHistogram2D(int dammId, int xSize, int ySize, const char* title,
133  int halfWordsPerChan, int xContraction,
134  int yContraction, const std::string &mne = "");
135 
143  bool Plot(int dammId, double val1, double val2 = -1, double val3 = -1,
144  const char* name="h");
145 
153  bool Plot(const std::string &mne, double val1, double val2 = -1,
154  double val3 = -1, const char* name="h");
155 
163  bool BananaTest(const int &id, const double &x, const double &y);
164 
165 private:
167 
168  int offset_;
170  int range_;
172  std::string name_;
174  std::set <int> idList;
176  std::map <std::string, int> mneList;
178  std::map <int, std::string> titleList;
182  int Round(double val) const;
183 };
184 #endif // __PLOTS_HPP_
int offset_
Definition: Plots.hpp:168
bool DeclareHistogram2D(int dammId, int xSize, int ySize, const char *title, int halfWordsPerChan, int xHistLength, int xLow, int xHigh, int yHistLength, int yLow, int yHigh, const std::string &mne="")
Declares a 2D histogram calls the C++ wrapper for DAMM.
static PlotsRegister * plots_register_
Instance of the plots register.
Definition: Plots.hpp:166
std::string name_
Definition: Plots.hpp:172
int range_
Definition: Plots.hpp:170
Holds ranges and offsets of all plots. Singleton class.
Definition: PlotsRegister.hpp:14
std::set< int > idList
Definition: Plots.hpp:174
int Round(double val) const
bool Plot(int dammId, double val1, double val2=-1, double val3=-1, const char *name="h")
Plots into histogram defined by dammId.
bool Exists(int id) const
Plots(int offset, int range, std::string name)
constant parameters used in pixie16 analysis
int GetOffset()
Definition: Plots.hpp:36
void set2cc_(const int &, const int &, const int &, const int &)
std::map< int, std::string > titleList
Definition: Plots.hpp:178
std::map< std::string, int > mneList
Definition: Plots.hpp:176
bool BananaTest(const int &id, const double &x, const double &y)
void PrintNonEmpty(std::ofstream &hislog)
bool CheckRange(int id) const
void count1cc_(const int &, const int &, const int &)
bool bantesti_(const int &, const int &, const int &)
bool DeclareHistogram1D(int dammId, int xSize, const char *title, int halfWordsPerChan, int xHistLength, int xLow, int xHigh, const std::string &mne="")
Declares a 1D histogram calls the C++ wrapper for DAMM.
Holds pointers to all Histograms.
Definition: Plots.hpp:27