Fork me on GitHub

Ignore:
Timestamp:
Apr 16, 2014, 3:56:14 PM (10 years ago)
Author:
pavel <pavel@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
64a4950
Parents:
f6b9fec
Message:

switch to a more stable Hector version

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*/
    1811
    1912/// \file H_EllipticAperture.cc
     
    2417
    2518// ROOT #includes
    26 #include "TEllipse.h"
     19//#include "TEllipse.h"
    2720
    2821// local #includes
     
    3225using namespace std;
    3326
    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
     27H_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
    3829        /// @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 shape
    51         /// @param posx, posy are the (x,y) coordinates of the center of the ellipse
    52 }
    53 
    54 H_EllipticAperture* H_EllipticAperture::clone() const {
    55         return new H_EllipticAperture(x1,x2,fx,fy);
    5630}
    5731
     
    6135}
    6236
    63 void H_EllipticAperture::draw(const float scale) const {
    64         TEllipse* te = new TEllipse(fx*scale,fy*scale,x1*scale,x2*scale);
     37void H_EllipticAperture::draw() const {
     38/*      Ellipse* te = new TEllipse(fx,fy,x1,x2);
    6539        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
     47void H_EllipticAperture::printProperties() const {
     48        cout<< "Aperture shape:" << getTypeString() << ", ellipse axes : "<<x1<<", "<<x2<<endl;
     49        cout << " \t Center : " << fx << "," << fy << endl;
    6950        return;
    7051}
    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.