Fork me on GitHub

Changeset 1365 in svn for trunk/external/Hector/H_Drift.cc


Ignore:
Timestamp:
Apr 16, 2014, 3:56:14 PM (10 years ago)
Author:
Pavel Demin
Message:

switch to a more stable Hector version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/external/Hector/H_Drift.cc

    r1360 r1365  
    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_Drift.cc
     
    2417#include "H_TransportMatrices.h"
    2518
    26 
    2719void H_Drift::init() {
    2820        // must be in public section
    29         element_mat.ResizeTo(MDIM,MDIM);
    3021        setTypeString();
    3122        setMatrix(0,MP,QP);
     
    3324}
    3425
    35 std::ostream& operator<< (std::ostream& os, const H_Drift& el) {
    36         os << el.typestring << el.name << "\t\t at s = " << el.fs << "\t length = " << el.element_length <<endl;
    37         if(el.element_aperture->getType()!=NONE) {
    38                 os << *(el.element_aperture) << endl;
     26void H_Drift::printProperties() const {
     27        cout << typestring << name;
     28        cout << "\t\t at s = " << fs;
     29        cout << "\t length = " << element_length;
     30        cout<<endl;
     31        if(element_aperture->getType()!=NONE) {
     32                cout <<"\t aperture type = " << element_aperture->getTypeString();
     33                element_aperture->printProperties();
    3934        }
    40         if(el.element_length<0 && VERBOSE) os <<"<H_Drift> ERROR : Interpenetration of elements !"<<endl;
    41         else if(el.element_length==0 && VERBOSE) os <<"<H_Drift> WARNING : 0-length "<< el.name << " !" << endl;
    42    return os;
     35        if(element_length<0)  { if(VERBOSE) cout<<"\t ERROR : Interpenetration of elements !"<<endl; }
     36        if(element_length==0) { if(VERBOSE) cout<<"\t WARNING : 0-length "<< name << " !" << endl; }
    4337}
    4438
    45 //void H_Drift::setMatrix(const float eloss, const float p_mass, const float p_charge) {
    46 void H_Drift::setMatrix(const float , const float , const float ) {
    47         element_mat = driftmat(element_length);
     39void H_Drift::setMatrix(const float eloss, const float p_mass, const float p_charge) const {
     40                *element_mat = driftmat(element_length);
    4841        return ;
    4942}
    50 
    51 H_Drift* H_Drift::clone() const {
    52         H_Drift* temp_drift = new H_Drift(name,fs,element_length);
    53         temp_drift->setX(xpos);
    54         temp_drift->setY(ypos);
    55         temp_drift->setTX(txpos);
    56         temp_drift->setTY(typos);
    57         temp_drift->setBetaX(betax);
    58         temp_drift->setBetaY(betay);
    59         return temp_drift;
    60 }
    61 
Note: See TracChangeset for help on using the changeset viewer.