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_TransportMatrices.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_TransportMatrices.cc
     
    3629
    3730extern double omega(const double k, const double l) {
    38                 // [l] = [m] and [k] = [1/m^2] for quadrupoles
     31                // [l] = [m] and [k] = [1/mï¿œ] for quadrupoles
    3932                // [omega] = [1]
    4033        return sqrt(fabs(k))*l;
     
    4235
    4336extern double radius(const double k) {
    44                 // [k] = [1/m^2] for quadrupoles
     37                // [k] = [1/mï¿œ] for quadrupoles
    4538                // [k] = [1/m]  for dipoles
    4639                // [radius(k)] = [m]
    47         if(k==0 && VERBOSE) cout<<"<H_TransportMatrices> ERROR : Dipole has no effect : results will be corrupted"<<endl;
     40        if(k==0 && VERBOSE) cout<<"ERROR : Dipole has no effect : results will be corrupted"<<endl;
    4841        // this is protected by the "if(k==0) -> driftmat" in every matrix below (ex vquatmat)
    4942        return (k==0) ? 1 : 1/k;
    5043}
    5144
    52 extern void printMatrix(TMatrix TMat) {
     45extern void printMatrix(TMatrix * TMat) {
    5346        char temp[20];
    5447        float * el = new float[MDIM*MDIM];
    55         el = (TMat.GetMatrixArray());
     48        el = (TMat->GetMatrixArray());
    5649
    5750        cout << endl << "\t";
     
    156149        double simp = r*2*sin(l/(2*r))*sin(l/(2*r))/BE;
    157150        double psy = ke*l/2.;
    158         float tefmat[MDIM*MDIM] = {1., tan(psy)*ke, 0., 0., 0., 0.,
     151        float tefmat[MDIM*MDIM] = {1., (float)(tan(psy)*ke), 0., 0., 0., 0.,
    159152                                    0., 1., 0., 0., 0., 0.,
    160                                     0., 0., 1., -tan(psy)*ke, 0., 0.,
     153                                    0., 0., 1., (float)(-tan(psy)*ke), 0., 0.,
    161154                                    0., 0., 0., 1., 0., 0.,
    162155                                    0., 0., 0., 0., 1., 0.,
     
    167160                                           0.,0.,1.,0., 0., 0.,
    168161                                   0.,0.,l,1., 0., 0.,
    169                                 simp, sin(l/r)/BE, 0., 0., 1., 0.,
     162                                (float)simp, (float)(sin(l/r)/BE), 0., 0., 1., 0.,
    170163                                0., 0., 0., 0., 0., 1. };
    171164        for(int i=0;i<MDIM*MDIM;i++) {
     
    216209                                          0.,0.,1.,0., 0., 0.,
    217210                                          0.,0.,l,1., 0., 0.,
    218                                           simp, sin(l/r)/BE, 0., 0., 1., 0.,
     211                                          simp, (float)(sin(l/r)/BE), 0., 0., 1., 0.,
    219212                                          0., 0., 0., 0., 0., 1.
    220213                                           };
     
    265258                           0.,0.,l ,1.,0.,0.,
    266259                           0.,0.,0.,0.,1.,0.,
    267                            l*tan(ke)/2.,ke, 0., 0., 0., 1.
     260                           (float)(l*tan(ke)/2.),ke, 0., 0., 0., 1.
    268261        };
    269262
     
    292285                           0.,0.,l ,1.,0.,0.,
    293286                           0.,0.,0.,0.,1.,0.,
    294                            0.,0.,l*tan(ke)/2.,ke, 0., 1.
     287                           0.,0.,(float)(l*tan(ke)/2.),ke, 0., 1.
    295288        };
    296289
Note: See TracChangeset for help on using the changeset viewer.