Fork me on GitHub

Ignore:
Timestamp:
Apr 16, 2014, 3:56:14 PM (11 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_RectangularCollimator.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_RectangularCollimator.cc
     
    3124}
    3225
    33 H_RectangularCollimator::H_RectangularCollimator(const double s, const double l) :H_Drift(s,l){
    34         type = RCOLLIMATOR;
    35         init();
     26H_RectangularCollimator::H_RectangularCollimator(const double s, const double l) :H_OpticalElement(RCOLLIMATOR,s,0.,l){
     27                init();
    3628        return;
    3729}
    3830
    39 H_RectangularCollimator::H_RectangularCollimator(const string& nameE, const double s, const double l) :H_Drift(nameE,s,l){
    40         type = RCOLLIMATOR;
    41         init();
     31H_RectangularCollimator::H_RectangularCollimator(const string nameE, const double s, const double l) :H_OpticalElement(nameE,RCOLLIMATOR,s,0.,l){
     32                init();
    4233        return;
    4334}
    4435
    45 std::ostream& operator<< (std::ostream& os, const H_RectangularCollimator& el) {
    46         os << el.typestring << el.name << "\t\t at s = " << el.fs << "\t length = " << el.element_length <<endl;
    47         if(el.element_aperture->getType()!=NONE) {
    48                 os << *(el.element_aperture) << endl;
     36void H_RectangularCollimator::printProperties() const {
     37        cout << typestring << name;
     38        cout << "\t\t at s = " << fs;
     39        cout << "\t length = " << element_length;
     40        cout<<endl;
     41        if(element_aperture->getType()!=NONE) {
     42                cout <<"\t aperture type = " << element_aperture->getTypeString();
     43                        element_aperture->printProperties();
    4944        }
    5045
    51         if(el.element_length<0 && VERBOSE) os <<"<H_RectangularCollimator> ERROR : Interpenetration of elements !"<<endl;
    52         else if(el.element_length==0 && VERBOSE) os <<"<H_RectangularCollimator> WARNING : 0-length "<< el.name << " !" << endl;
    53    return os;
     46        if(element_length<0)  { if(VERBOSE) cout<<"\t ERROR : Interpenetration of elements !"<<endl; }
     47        if(element_length==0) { if(VERBOSE) cout<<"\t WARNING : 0-length "<< name << " !" << endl; }
    5448}
    5549
    56 //void H_RectangularCollimator::setMatrix(const float eloss, const float p_mass, const float p_charge) {
    57 void H_RectangularCollimator::setMatrix(const float , const float , const float ) {
    58         element_mat = driftmat(element_length);
     50void H_RectangularCollimator::setMatrix(const float eloss, const float p_mass, const float p_charge) const {
     51        //      cout<<"\t WARNING : H_RectangularCollimator matrices not yet implemented ! " << endl;
     52                *element_mat = driftmat(element_length);
    5953        return ;
    6054}
    61 
    62 H_RectangularCollimator* H_RectangularCollimator::clone() const {
    63         H_RectangularCollimator* temp_coll = new H_RectangularCollimator(name,fs,element_length);
    64         temp_coll->setAperture(element_aperture);
    65         temp_coll->setX(xpos);
    66         temp_coll->setY(ypos);
    67         temp_coll->setTX(txpos);
    68         temp_coll->setTY(typos);
    69         temp_coll->setBetaX(betax);
    70         temp_coll->setBetaY(betay);
    71         return temp_coll;
    72 }
    73 
Note: See TracChangeset for help on using the changeset viewer.