Fork me on GitHub

source: git/external/Hector/H_RectangularAperture.cc@ 127644a

Last change on this file since 127644a was 3c40083, checked in by pavel <pavel@…>, 11 years ago

switch to a more stable Hector version

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2---- Hector the simulator ----
3 A fast simulator of particles through generic beamlines.
4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
5
6 http://www.fynu.ucl.ac.be/hector.html
7
8 Centre de Physique des Particules et de Phénoménologie (CP3)
9 Université Catholique de Louvain (UCL)
10*/
11
12/// \file H_RectangularAperture.cc
13/// \brief Defines the rectangular aperture of beamline elements.
14
15// C++ #includes
16#include <iostream>
17
18// C #includes
19#include <cmath> // needed for fabs
20
21// ROOT #includes
22//#include "TPave.h"
23
24// local #includes
25#include "H_RectangularAperture.h"
26using namespace std;
27
28H_RectangularAperture::H_RectangularAperture(const float x1, const float x2, const float posx, const float posy) :H_Aperture(RECTANGULAR,x1,x2,0,0,posx,posy) {
29 /// @param x1, x2 are the length and height of the rectangular shape
30 /// @param posx, posy are the (x,y) coordinates of the center of the rectangular shape
31}
32
33bool H_RectangularAperture::isInside(const float x, const float y) const {
34 /// @param x, y are the (x,y) coordinates of the proton, in [m]
35 return (fabs(x-fx)<x1&&fabs(y-fy)<x2);
36}
37
38void H_RectangularAperture::draw() const {
39/* TPave* tp = new TPave(fx-x1,fy-x2,fx+x1,fy+x2,1);
40 tp->SetFillStyle(3003);
41 tp->SetLineColor(2);
42 tp->SetFillColor(2);
43 tp->Draw();
44 return;
45*/
46}
47void H_RectangularAperture::printProperties() const {
48 cout << "Aperture shape:" << getTypeString() << ", rectangle Sides : "<<x1<<", "<<x2<<endl;
49 cout << " \t Center : " << fx << "," << fy << endl;
50 return;
51}
Note: See TracBrowser for help on using the repository browser.