SynAPSE  0.6.0
Synergistic Analysis of Phase Space Evolution
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
Aperture.hh
1 // C++ includes
2 #include <stdlib.h>
3 #include <iostream>
4 #include <string>
5 #include <vector>
6 #include <cfloat>
7 #include <cmath>
8 
9 // ROOT includes
10 #include "TCanvas.h"
11 #include "TGraph.h"
12 #include "TAxis.h"
13 #include "TText.h"
14 
15 // Other includes
16 #include "Assert.hh"
17 #include "Pitch.hh"
18 #include "GeometryHandler.hh"
19 
21 namespace Beam {
22 
28 class Aperture {
29  public:
31  Aperture();
32 
40  Aperture(std::vector<double> starts,
41  std::vector<double> ends,
42  std::vector<double> radii,
43  std::vector<std::string> names = std::vector<std::string>());
44 
46  Aperture(const Aperture& Aperture);
47 
49  Aperture& operator=(const Aperture& Aperture);
50 
52  ~Aperture();
53 
61  void Initialize(std::vector<double> starts = std::vector<double>(),
62  std::vector<double> ends = std::vector<double>(),
63  std::vector<double> radii = std::vector<double>(),
64  std::vector<std::string> names = std::vector<std::string>());
65 
70  void SetMICEDefault(const std::string& filename);
71 
79  void Add(double start, double end, double radius, std::string name = "");
80 
87  const double& Radius(double z) const;
88 
97  bool IsIn(double x, double y, double z) const;
98 
104  void Draw(std::string name="", double dz=1) const;
105 
106  private:
107  std::vector<double> _apertures;
108  std::vector<double> _starts;
109  std::vector<double> _ends;
110  std::vector<double> _radii;
111  std::vector<std::string> _names;
112 };
113 } // namespace Beam
~Aperture()
Destructor.
Definition: Aperture.cc:41
Aperture()
Default constructor, initilizes everything to 0.
Definition: Aperture.cc:5
bool IsIn(double x, double y, double z) const
Checks if the particle is within the apertures.
Definition: Aperture.cc:153
void SetMICEDefault(const std::string &filename)
Sets the default MICE apertures.
Definition: Aperture.cc:70
void Initialize(std::vector< double > starts=std::vector< double >(), std::vector< double > ends=std::vector< double >(), std::vector< double > radii=std::vector< double >(), std::vector< std::string > names=std::vector< std::string >())
Initializes the apertures.
Definition: Aperture.cc:43
Holds a set of beam line apertures.
Definition: Aperture.hh:28
std::vector< double > _starts
Starting points vector of the apertures.
Definition: Aperture.hh:108
std::vector< double > _apertures
Summary vector used to fetch the smallest.
Definition: Aperture.hh:107
std::vector< double > _ends
End points vector of the apertures.
Definition: Aperture.hh:109
Aperture & operator=(const Aperture &Aperture)
Equality operator.
Definition: Aperture.cc:28
void Add(double start, double end, double radius, std::string name="")
Adds a single aperture to the object.
Definition: Aperture.cc:85
std::vector< double > _radii
Radii of the apertures.
Definition: Aperture.hh:110
const double & Radius(double z) const
Checks the aperture radius at a given position along the beam line.
Definition: Aperture.cc:143
std::vector< std::string > _names
Names of the apertures.
Definition: Aperture.hh:111
void Draw(std::string name="", double dz=1) const
Draws the apertures on a canvas.
Definition: Aperture.cc:158