7 |
// |
// |
8 |
// default position used only in CaloStrip for the moment |
// default position used only in CaloStrip for the moment |
9 |
// |
// |
10 |
#define CTX 121.1 |
// |
11 |
#define CTY 122.6 |
// old param |
12 |
|
// |
13 |
|
//#define CTX 121.1 |
14 |
|
//#define CTY 122.6 |
15 |
|
//#define CTZ -263.1 |
16 |
|
// |
17 |
|
// new param |
18 |
|
// |
19 |
|
//#define CTX 121.2 |
20 |
|
//#define CTY 122.9 |
21 |
|
//#define CTZ -263.1 |
22 |
|
// |
23 |
|
// new param using em showers (E. Taddei paramters) |
24 |
|
// |
25 |
|
#define CTX 120.6 |
26 |
|
#define CTY 122.3 |
27 |
#define CTZ -263.1 |
#define CTZ -263.1 |
28 |
// |
// |
29 |
|
// Mechanical positions (used with option --use-standard-alig) |
30 |
|
// |
31 |
|
#define MECHCTX 120.5 |
32 |
|
#define MECHCTY 121.5 |
33 |
|
#define MECHCTZ -261.81 |
34 |
|
// |
35 |
|
// just for testing purpose |
36 |
|
// |
37 |
|
//#define MECHCTX 0. |
38 |
|
//#define MECHCTY 0. |
39 |
|
//#define MECHCTZ -263.1 |
40 |
|
// |
41 |
|
#include <sstream> |
42 |
|
#include <fstream> |
43 |
|
#include <string.h> |
44 |
#include <TObject.h> |
#include <TObject.h> |
45 |
|
#include <TMath.h> |
46 |
#include <TClonesArray.h> |
#include <TClonesArray.h> |
47 |
#include <TArrayI.h> |
#include <TArrayI.h> |
48 |
|
#include <TSystem.h> |
49 |
|
#include <GLTables.h> |
50 |
// |
// |
51 |
extern "C" int millim_(Int_t *, Float_t *); |
extern "C" int millim_(Int_t *, Float_t *); |
52 |
struct shift { |
struct shift { |
83 |
// |
// |
84 |
void Clear(); |
void Clear(); |
85 |
// |
// |
86 |
Float_t GetXalig(){return CTX;}; ///< return X alignement paramenter |
Float_t GetXalig(){printf(" Obsolete! Use CaloStrip class instead\n");return CTX;}; ///< return X alignement paramenter |
87 |
Float_t GetYalig(){return CTY;}; ///< return Y alignement paramenter |
Float_t GetYalig(){printf(" Obsolete! Use CaloStrip class instead\n");return CTY;}; ///< return Y alignement paramenter |
88 |
Float_t GetZalig(){return CTZ;}; ///< return Z alignement paramenter |
Float_t GetZalig(){printf(" Obsolete! Use CaloStrip class instead\n");return CTZ;}; ///< return Z alignement paramenter |
89 |
// |
// |
90 |
CaloLevel1(); ///< Constructor. |
CaloLevel1(); ///< Constructor. |
91 |
// |
// |
99 |
class CaloStrip : public TObject { |
class CaloStrip : public TObject { |
100 |
|
|
101 |
private: |
private: |
102 |
CaloLevel1 *c1; |
CaloLevel1 *c1; //< pointer to level1 object |
103 |
Float_t fE; |
Float_t fE; //< energy in mip of the strip |
104 |
Float_t fX; |
Float_t fX; //< X position in cm of the strip |
105 |
Float_t fY; |
Float_t fY; //< Y position in cm of the strip |
106 |
Float_t fZ; |
Float_t fZ; //< Z position in cm of the strip |
107 |
Int_t fView; |
Int_t fView; ///< view [1-2] |
108 |
Int_t fPlane; |
Int_t fPlane; ///< plane [1-22] |
109 |
Int_t fStrip; |
Int_t fStrip; ///< strip [1-96] |
110 |
|
Bool_t ismech; ///< true = using mechanical alignement, false using experimental alignement parameters |
111 |
|
static Float_t UXal; ///< used X alignement parameter |
112 |
|
static Float_t UYal; ///< used Y alignement parameter |
113 |
|
static Float_t UZal; ///< used Z alignement parameter |
114 |
|
static Bool_t paramload; |
115 |
|
// |
116 |
|
|
117 |
public: |
public: |
118 |
// |
// |
119 |
// METHODS |
// METHODS |
120 |
// |
// |
|
// |
|
121 |
CaloStrip(); ///< Default Constructor. |
CaloStrip(); ///< Default Constructor. |
122 |
// |
// |
123 |
|
CaloStrip(Bool_t usemechanicalalignement); ///< Default Constructor. |
124 |
|
// |
125 |
CaloStrip(CaloLevel1 *c1); ///< Constructor. |
CaloStrip(CaloLevel1 *c1); ///< Constructor. |
126 |
// |
// |
127 |
Float_t GetE(){return fE;}; |
CaloStrip(CaloLevel1 *c1, Bool_t usemechanicalalignement); ///< Constructor. |
128 |
|
// |
129 |
|
Float_t GetE(){return fE;}; ///< Get energy in MIP for setted strip |
130 |
|
// |
131 |
|
Float_t GetX(){return fX;}; ///< Get X strip position |
132 |
|
Float_t GetY(){return fY;}; ///< Get Y strip position |
133 |
|
Float_t GetZ(){return fZ;}; /// Get Z strip position |
134 |
|
// |
135 |
|
Float_t GetXalig(){ return UXal;}; ///< return X alignement paramenter |
136 |
|
Float_t GetYalig(){ return UYal;}; ///< return Y alignement paramenter |
137 |
|
Float_t GetZalig(){ return UZal;}; ///< return Z alignement paramenter |
138 |
|
// |
139 |
|
Int_t GetView(){return (fView-1);}; ///< Get strip view [0-1] |
140 |
|
Int_t GetPlane(){return (fPlane-1);}; ///< Get strip plane [0-21] |
141 |
|
Int_t GetStrip(){return (fStrip-1);}; ///< Get strip number [0-95] |
142 |
|
// |
143 |
|
void Set(Int_t view, Int_t plane, Int_t strip); ///< Set strip giving view [0-1], plane [0-22] and number [0-95] |
144 |
// |
// |
145 |
Float_t GetX(){return fX;}; |
void Set(Float_t X, Float_t Y, Float_t Z); ///< Set strip giving position in PAMELA ref sys [cm] |
|
Float_t GetY(){return fY;}; |
|
|
Float_t GetZ(){return fZ;}; |
|
|
// |
|
|
Int_t GetView(){return (fView-1);}; |
|
|
Int_t GetPlane(){return (fPlane-1);}; |
|
|
Int_t GetStrip(){return (fStrip-1);}; |
|
146 |
// |
// |
147 |
void Set(Int_t view, Int_t plane, Int_t strip); |
void UseMechanicalAlig(){ ismech = true; UXal = MECHCTX; UYal = MECHCTY; UZal = MECHCTZ;}; ///< Tells CaloStrip to use mechanical alignement parameters |
148 |
void Set(Float_t X, Float_t Y, Float_t Z); |
void UseStandardAlig(); ///< Tells CaloStrip to use default parameters it will find querying the DB. If connection fails uses parameters hard-coded in this file |
149 |
|
void SetAlig(Float_t XALIG, Float_t YALIG, Float_t ZALIG){ ismech = false; UXal = XALIG; UYal = YALIG; UZal = ZALIG;};///< User defined alignement parameters |
150 |
|
Bool_t IsMechanicalAlig(){return ismech;}; ///< True is using mechanical alignement parameters, false otherwise |
151 |
// |
// |
152 |
void Clear(); ///< clear variables |
void Clear(); ///< clear variables |
153 |
// |
// |
154 |
CaloStrip* GetCaloStrip(){return this;}; ///< returns pointer to this object |
CaloStrip* GetCaloStrip(){return this;}; ///< returns pointer to this object |
155 |
// |
// |
156 |
ClassDef(CaloStrip,1); |
ClassDef(CaloStrip,2); |
157 |
// |
// |
158 |
}; |
}; |
159 |
|
|