Fork me on GitHub

Changeset 3c40083 in git for external/Hector/H_RomanPot.cc


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_RomanPot.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_RomanPot.cc
     
    3225}
    3326
    34 H_RomanPot::H_RomanPot(const double s, const double app) :H_Drift(s,RP_LENGTH){
    35                 type = RP;
     27H_RomanPot::H_RomanPot(const double s, const double app) :H_OpticalElement(RP,s,0.,RP_LENGTH){
    3628                init();
    37                 if(element_aperture) delete element_aperture;
    38                 element_aperture = new H_RectangularAperture(app,RP_HEIGHT,0,0);
     29                H_RectangularAperture* rapp = new H_RectangularAperture(app,RP_HEIGHT,0,0);
     30                setAperture(rapp);
    3931}
    4032
    41 H_RomanPot::H_RomanPot(const string& nameE, const double s, const double app) :H_Drift(nameE,s,RP_LENGTH){
    42                 type = RP;
     33H_RomanPot::H_RomanPot(const string nameE, const double s, const double app) :H_OpticalElement(nameE,RP,s,0.,RP_LENGTH){
    4334                init();
    44                 if(element_aperture) delete element_aperture;
    45                 element_aperture = new H_RectangularAperture(app,RP_HEIGHT,0,0);
     35                H_RectangularAperture* rapp = new H_RectangularAperture(app,RP_HEIGHT,0,0);
     36                setAperture(rapp);
    4637}
    4738
    48 std::ostream& operator<< (std::ostream& os, const H_RomanPot& el) {
    49         os << el.typestring << el.name << "\t\t at s = " << el.fs;
    50         if(el.element_aperture->getType()!=NONE) {
    51                 os << *(el.element_aperture) << endl;
    52         }
    53    return os;
     39void H_RomanPot::printProperties() const {
     40                cout << typestring << name;
     41                cout << "\t\t at s = " << fs;
     42                if(element_aperture->getType()!=NONE) {
     43                        cout <<"\t aperture type = " << element_aperture->getTypeString();
     44                        element_aperture->printProperties();
     45                }
     46
     47                cout<<endl;
    5448}
    5549
    56 void H_RomanPot::setMatrix(const float eloss, const float p_mass, const float p_charge) {
    57                 element_mat = driftmat(0);
     50void H_RomanPot::setMatrix(const float eloss, const float p_mass, const float p_charge) const {
     51                *element_mat = driftmat(0);
    5852        return ;
    5953}
    60 
    61 H_RomanPot* H_RomanPot::clone() const {
    62         H_RomanPot* temp_rp = new H_RomanPot(name,fs,element_length);
    63         temp_rp->setAperture(element_aperture);
    64         temp_rp->setX(xpos);
    65         temp_rp->setY(ypos);
    66         temp_rp->setTX(txpos);
    67         temp_rp->setTY(typos);
    68         temp_rp->setBetaX(betax);
    69         temp_rp->setBetaY(betay);
    70         return temp_rp;
    71 }
    72 
Note: See TracChangeset for help on using the changeset viewer.