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_RecRPObject.h

    rf6b9fec r3c40083  
    22#define _H_RecRPObject_
    33
    4   /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
    5  *                                                         *
    6 *                   --<--<--  A fast simulator --<--<--     *
    7 *                 / --<--<--     of particle   --<--<--     *
    8 *  ----HECTOR----<                                          *
    9 *                 \ -->-->-- transport through -->-->--     *
    10 *                   -->-->-- generic beamlines -->-->--     *
    11 *                                                           *
    12 * JINST 2:P09005 (2007)                                     *
    13 *      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
    14 *       http://www.fynu.ucl.ac.be/hector.html               *
    15 *                                                           *
    16 * Center for Cosmology, Particle Physics and Phenomenology  *
    17 *              Universite catholique de Louvain             *
    18 *                 Louvain-la-Neuve, Belgium                 *
    19  *                                                         *
    20    * * * * * * * * * * * * * * * * * * * * * * * * * * * */
     4/*
     5---- Hector the simulator ----
     6   A fast simulator of particles through generic beamlines.
     7   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
     8
     9        http://www.fynu.ucl.ac.be/hector.html
     10
     11   Centre de Physique des Particules et de Phénoménologie (CP3)
     12   Université Catholique de Louvain (UCL)
     13*/
    2114
    2215/// \file H_RecRPObject.h
    23 /// \brief Reconstructed information from objects detected by two roman pots
     16/// \brief Reconstructed information from objects detected by two roman pots 
    2417
    25 #include "TF1.h"
    26 #include <cmath>
    27 
    28 #include "H_BeamLine.h"
     18// local #includes
     19#include "H_Parameters.h"
     20#include "H_AbstractBeamLine.h"
     21#include <math.h>
     22using namespace std;
    2923
    3024#define NOT_YET_COMPUTED -666
     25// trivial (TM), angle compensation (AM) and position compensation (PM) methods
     26#define TM 1
     27#define AM 2
     28#define PM 3
    3129
    32 /// Reconstruction of parameters at IP using measurements with roman pots
     30/// Reconstructed information from objects detected by two roman pots
    3331class H_RecRPObject {
     32/// Uses (s1,x1,y1) and (s2,x2,y2) to compute the energy, the virtuality of the event, as well as the positions (x,y)  and angles (thx, thy) at IP.
    3433        public:
     34                /// Constructors, destructor and operators
     35                //@{
    3536                H_RecRPObject();
    36                 H_RecRPObject(const float, const float, const H_AbstractBeamLine* );
    37                 H_RecRPObject(const float, const float, const H_AbstractBeamLine& ); // old-fashioned -- to be deleted
     37                H_RecRPObject(const float, const float, const H_AbstractBeamLine& );
    3838                H_RecRPObject(const H_RecRPObject&);
    3939                H_RecRPObject& operator=(const H_RecRPObject&);
    40                 ~H_RecRPObject() {delete f_1; delete f_2; delete g_1; delete g_2;
    41                                   delete d_1; delete d_2; delete k_1; delete k_2;
    42                                   delete l_1; delete l_2;
    43                                   delete thebeam;};
     40                ~H_RecRPObject() {delete matrp1; delete matrp2; delete thebeam; return;};
     41                //@}
    4442
    45                 inline float getX1() const {return x1;};
    46                 inline float getX2() const {return x2;};
    47                 inline float getY1() const {return y1;};
    48                 inline float getY2() const {return y2;};
    49                 inline float getS1() const {return s1;};
    50                 inline float getS2() const {return s2;};
     43                /// Getters
     44                //@{
     45                inline float getX1() const {return x1; /*horizontal position at first roman pot, in \mu m */}
     46                inline float getY1() const {return y1; /*vertical position at first roman pot, in \mu m */}
     47                inline float getS1() const {return s1; /*longitudinal position of the first roman pot, in m, from IP*/}
     48                inline float getX2() const {return x2; /*horizontal position at second RP in \mu m*/}
     49                inline float getY2() const {return y2; /*vertical position at second RP in \mu m*/}
     50                inline float getS2() const {return s2; /*longitudinal position of the second RP, in m, from IP*/}
     51                inline float getTXRP() const {return URAD*atan((x2-x1)/((s2-s1)*URAD)); /* horizontal angle at first RP, in \mu rad*/ }
     52                inline float getTYRP() const {return URAD*atan((y2-y1)/((s2-s1)*URAD)); /* vertical angle at first RP, in \mu rad*/ }
     53                float getX0() {return (x0==NOT_YET_COMPUTED) ? computeX0():x0; /*reconstructed horizontal position at IP*/}
     54                float getY0() {return (y0==NOT_YET_COMPUTED) ? computeY0():y0; /*reconstructed vertical position at IP*/}
     55                float getTXIP() {return (thx==NOT_YET_COMPUTED) ? computeTX():thx; /*reconstructed horizontal angle at IP*/}
     56                float getTYIP() {return (thy==NOT_YET_COMPUTED) ? computeTY():thy; /*reconstructed vertical angle at IP*/}
     57                float getE(const unsigned int); /*returns the reconstructed energy*/
     58                float getE(); /*returns the reconstructed energy if already computed*/
     59                float getQ2() {return (virtuality==NOT_YET_COMPUTED) ? computeQ2():virtuality; /*returns the reconstructed virtuality*/}
     60                //@}
    5161
    52                 float getTX();
    53                 float getTY();
    54                 float getE();
    55                 float getE(int );
    56                 float getQ2();
    57                 float getPt();
     62                // Sets the proton hit positions
     63                void setPositions(const float, const float, const float, const float);
     64                // Shows the variable content.
     65                void printProperties() const;           
     66        protected:
     67                /// Measured particle coordinates at RP (X - horizontal and Y - vertical in [\f$ \mu \f$m], S -longitudinal in [m])
     68                //@{
     69                float x1, x2, y1, y2, s1, s2;
     70                //@}
    5871
    59                 void setPositions(const float, const float, const float, const float);
    60                 void setPosition_det1(const float, const float);
    61                 void setPosition_det2(const float, const float);
    62                 void setDetPos(const float, const float);
    63                 void setERange(const float, const float);
    64                 void computeERange();
    65                 void initialize();
    66                 void computeAll();
    67 
    68         protected:
    69 
    70                 float emin, emax;
    71                 float x1, x2, y1, y2, s1, s2;
    72                 float txip, tyip, energy, q2, pt;
    73                 H_AbstractBeamLine* thebeam;
    74                 TF1* f_1, *f_2;
    75                 TF1* g_1, *g_2;
    76                 TF1* d_1, *d_2;
    77                 TF1* k_1, *k_2;
    78                 TF1* l_1, *l_2;
    79         friend std::ostream& operator<< (std::ostream& os, const H_RecRPObject& rp);
     72                /// Reconstructed positions and angles at IP in [\f$ \mu m\f$] and [\f$ \mu rad\f$]
     73                //@{
     74                float x0, y0, thx, thy;
     75                //@}
     76       
     77                /// Reconstructed energy and virtuality at IP in GeV and GeV\f$^2\f$
     78                //@{
     79                float energy, virtuality;
     80                //@}
     81       
     82                float computeX0();
     83                float computeY0();     
     84                float computeTX();
     85                float computeTY();
     86                /// Energy reconstruction : trivial method
     87                float computeE_TM();
     88                /// Energy reconstruction : angle compensation method
     89                float computeE_AM();
     90                /// Energy reconstruction : position compensation method
     91                float computeE_PM();
     92                /// Virtuality reconstruction. Energy should be reconstructed before.
     93                float computeQ2();
     94                /// Calibrates the energy reconstruction with respect to the chromaticity of the transfer matrices
     95                float getECorrectionFactor(const unsigned int, const unsigned int );
     96                /// The beamline :
     97                H_AbstractBeamLine * thebeam;
     98                /// The matrices
     99                //@{
     100                TMatrix * matrp1;
     101                TMatrix * matrp2;
     102                //@}
     103                /// The correction factors
     104                //@{
     105                float corr1_TM, corr2_TM, corr1_AM, corr2_AM;
     106                //@}
    80107};
    81108
    82109#endif
    83 
Note: See TracChangeset for help on using the changeset viewer.