Fork me on GitHub

source: git/external/Hector/H_RecRPObject.h@ 0e2f49b

ImprovedOutputFile Timing dual_readout llp
Last change on this file since 0e2f49b was 3c40083, checked in by pavel <pavel@…>, 11 years ago

switch to a more stable Hector version

  • Property mode set to 100644
File size: 4.2 KB
Line 
1#ifndef _H_RecRPObject_
2#define _H_RecRPObject_
3
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*/
14
15/// \file H_RecRPObject.h
16/// \brief Reconstructed information from objects detected by two roman pots
17
18// local #includes
19#include "H_Parameters.h"
20#include "H_AbstractBeamLine.h"
21#include <math.h>
22using namespace std;
23
24#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
29
30/// Reconstructed information from objects detected by two roman pots
31class 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.
33 public:
34 /// Constructors, destructor and operators
35 //@{
36 H_RecRPObject();
37 H_RecRPObject(const float, const float, const H_AbstractBeamLine& );
38 H_RecRPObject(const H_RecRPObject&);
39 H_RecRPObject& operator=(const H_RecRPObject&);
40 ~H_RecRPObject() {delete matrp1; delete matrp2; delete thebeam; return;};
41 //@}
42
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 //@}
61
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 //@}
71
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 //@}
107};
108
109#endif
Note: See TracBrowser for help on using the repository browser.