Changeset 3c40083 in git for external/Hector/H_EllipticAperture.cc
- Timestamp:
- Apr 16, 2014, 3:56:14 PM (11 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 64a4950
- Parents:
- f6b9fec
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/Hector/H_EllipticAperture.cc
rf6b9fec r3c40083 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 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 */ 18 11 19 12 /// \file H_EllipticAperture.cc … … 24 17 25 18 // ROOT #includes 26 #include "TEllipse.h"19 //#include "TEllipse.h" 27 20 28 21 // local #includes … … 32 25 using namespace std; 33 26 34 H_EllipticAperture::H_EllipticAperture(const int type, const float l, const float h, const float posx, const float posy) : 35 H_Aperture(type,l,h,0,0,posx,posy) { 36 /// @param type is the aperture type (ELLIPTIC or CIRCULAR) 37 /// @param l, h are the length and height of the elliptic shape 27 H_EllipticAperture::H_EllipticAperture(const float x1, const float x2, const float posx, const float posy) :H_Aperture(ELLIPTIC,x1,x2,0,0,posx,posy) { 28 /// @param x1, x2 are the length and height of the elliptic shape 38 29 /// @param posx, posy are the (x,y) coordinates of the center of the ellipse 39 40 if (type!= ELLIPTIC && type != CIRCULAR) {41 cout << "Warning: trying to define an EllipticalAperture which is neither elliptical nor circular." << endl;42 cout << "'Elliptical' type forced\n";43 type_ = ELLIPTIC;44 aptypestring = getApertureString();45 }46 }47 48 H_EllipticAperture::H_EllipticAperture(const float l, const float h, const float posx, const float posy) :49 H_Aperture(ELLIPTIC,l,h,0,0,posx,posy) {50 /// @param l, h are the length and height of the elliptic shape51 /// @param posx, posy are the (x,y) coordinates of the center of the ellipse52 }53 54 H_EllipticAperture* H_EllipticAperture::clone() const {55 return new H_EllipticAperture(x1,x2,fx,fy);56 30 } 57 31 … … 61 35 } 62 36 63 void H_EllipticAperture::draw( const float scale) const {64 TEllipse* te = new TEllipse(fx*scale,fy*scale,x1*scale,x2*scale);37 void H_EllipticAperture::draw() const { 38 /* Ellipse* te = new TEllipse(fx,fy,x1,x2); 65 39 te->SetFillStyle(3003); 66 te->SetLineColor(39); 67 te->SetFillColor(39); 68 te->Draw("f"); 40 te->SetLineColor(2); 41 te->SetFillColor(2); 42 te->Draw(); 43 return; 44 */ 45 } 46 47 void H_EllipticAperture::printProperties() const { 48 cout<< "Aperture shape:" << getTypeString() << ", ellipse axes : "<<x1<<", "<<x2<<endl; 49 cout << " \t Center : " << fx << "," << fy << endl; 69 50 return; 70 51 } 71 72 std::ostream& operator<< (std::ostream& os, const H_EllipticAperture& ap) {73 os<< "Aperture shape:" << ap.aptypestring << ", ellipse axes : "<< ap.x1 <<", " << ap.x2 << endl;74 os << " \t Center : " << ap.fx << "," << ap.fy << endl;75 return os;76 }
Note:
See TracChangeset
for help on using the changeset viewer.