/[PAMELA software]/DarthVader/CalorimeterLevel2/inc/CaloLevel1.h
ViewVC logotype

Annotation of /DarthVader/CalorimeterLevel2/inc/CaloLevel1.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (hide annotations) (download)
Fri Nov 9 10:38:23 2007 UTC (17 years, 1 month ago) by mocchiut
Branch: MAIN
Changes since 1.10: +3 -0 lines
File MIME type: text/plain
Strip saturation coded in the level1 class, new method added to retrieve the information, backward compatibility preserved

1 mocchiut 1.1 /**
2     * \file inc/CaloLevel1.h
3     * \author Emiliano Mocchiutti
4     */
5     #ifndef CaloLevel1_h
6     #define CaloLevel1_h
7     //
8     // default position used only in CaloStrip for the moment
9     //
10 mocchiut 1.4 //
11     // old param
12     //
13     //#define CTX 121.1
14     //#define CTY 122.6
15     //#define CTZ -263.1
16     //
17     // new param
18     //
19 mocchiut 1.8 //#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 mocchiut 1.1 #define CTZ -263.1
28     //
29 mocchiut 1.4 // Mechanical positions (used with option --use-standard-alig)
30     //
31 mocchiut 1.9 #define MECHCTX 120.5
32     #define MECHCTY 121.5
33 mocchiut 1.4 #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 mocchiut 1.1 #include <TObject.h>
45 mocchiut 1.4 #include <TMath.h>
46 mocchiut 1.1 #include <TClonesArray.h>
47     #include <TArrayI.h>
48 mocchiut 1.4 #include <TSystem.h>
49     #include <GLTables.h>
50 mocchiut 1.1 //
51     extern "C" int millim_(Int_t *, Float_t *);
52     struct shift {
53     Float_t shift;
54     };
55     //
56    
57     /**
58     * \brief Calorimeter level1 class
59     *
60     * This class contains level1 calorimeter variables
61     *
62     **/
63     class CaloLevel1 : public TObject {
64    
65     private:
66    
67     public:
68     //
69     Int_t istrip; ///< total number of strip hit
70     //
71     // Number of strip with energy > emip and their value coded with view plane and strip number:
72     // view x[y] plane PP strip SS with energy mmmm.iip = +[-] ( PP*10^6 + SS*10^4 + mmmm.iip )
73     //
74     TArrayI estrip; ///< MIP values for each strip with energy > emin coded with view plane and strip number. NOTICE: precision is limited to the 5 most significative ciphers
75     //
76     CaloLevel1* GetCaloLevel1(){return this;}; ///< returns pointer to this object
77     //
78     //
79     Float_t GetEstrip(Int_t view, Int_t plane, Int_t strip); ///< returns saved MIP value for the indicated strip.
80     Float_t DecodeEstrip(Int_t entry, Int_t &view, Int_t &plane, Int_t &strip); ///< returns saved MIP value for the entry number "entry" of the TArrayI.
81 mocchiut 1.11 Float_t DecodeEstrip(Int_t entry, Int_t &view, Int_t &plane, Int_t &strip, Bool_t &saturated); ///< returns saved MIP value for the entry number "entry" of the TArrayI.
82 mocchiut 1.2 Float_t qtotpl(Int_t nplane); ///< Returns energy released on plane nplane (where 0<= nplane <= 43, 0 = 1Y, 1 = 1X, 2 = 2Y, 3 = 2X, etc. etc.).
83     Float_t qtotpl(Int_t view, Int_t plane); ///< Returns energy released on view "view" (0 = X, 1 = Y) and plane "plane" ( 0 <= plane <= 21 ).
84 mocchiut 1.11 Float_t qtotpl(Int_t nplane, Bool_t &saturation); ///< Returns energy released on plane nplane (where 0<= nplane <= 43, 0 = 1Y, 1 = 1X, 2 = 2Y, 3 = 2X, etc. etc.).
85     Float_t qtotpl(Int_t view, Int_t plane, Bool_t &saturation); ///< Returns energy released on view "view" (0 = X, 1 = Y) and plane "plane" ( 0 <= plane <= 21 ).
86 mocchiut 1.1 //
87     void Clear();
88     //
89 mocchiut 1.6 Float_t GetXalig(){printf(" Obsolete! Use CaloStrip class instead\n");return CTX;}; ///< return X alignement paramenter
90     Float_t GetYalig(){printf(" Obsolete! Use CaloStrip class instead\n");return CTY;}; ///< return Y alignement paramenter
91     Float_t GetZalig(){printf(" Obsolete! Use CaloStrip class instead\n");return CTZ;}; ///< return Z alignement paramenter
92 mocchiut 1.3 //
93 mocchiut 1.1 CaloLevel1(); ///< Constructor.
94     //
95     ClassDef(CaloLevel1,1);
96     };
97    
98     /**
99     * \brief Calorimeter strip class, needed to perform operation on a strip level, for example to retrieve the position of the strips or to retrieve the closest strip to a cerain position
100     *
101     */
102     class CaloStrip : public TObject {
103    
104     private:
105 mocchiut 1.4 CaloLevel1 *c1; //< pointer to level1 object
106     Float_t fE; //< energy in mip of the strip
107     Float_t fX; //< X position in cm of the strip
108     Float_t fY; //< Y position in cm of the strip
109     Float_t fZ; //< Z position in cm of the strip
110     Int_t fView; ///< view [1-2]
111     Int_t fPlane; ///< plane [1-22]
112     Int_t fStrip; ///< strip [1-96]
113     Bool_t ismech; ///< true = using mechanical alignement, false using experimental alignement parameters
114 mocchiut 1.7 static Float_t UXal; ///< used X alignement parameter
115     static Float_t UYal; ///< used Y alignement parameter
116     static Float_t UZal; ///< used Z alignement parameter
117     static Bool_t paramload;
118     //
119 mocchiut 1.1
120     public:
121     //
122     // METHODS
123     //
124     CaloStrip(); ///< Default Constructor.
125     //
126 mocchiut 1.5 CaloStrip(Bool_t usemechanicalalignement); ///< Default Constructor.
127     //
128 mocchiut 1.1 CaloStrip(CaloLevel1 *c1); ///< Constructor.
129     //
130 mocchiut 1.5 CaloStrip(CaloLevel1 *c1, Bool_t usemechanicalalignement); ///< Constructor.
131     //
132 mocchiut 1.4 Float_t GetE(){return fE;}; ///< Get energy in MIP for setted strip
133     //
134     Float_t GetX(){return fX;}; ///< Get X strip position
135     Float_t GetY(){return fY;}; ///< Get Y strip position
136     Float_t GetZ(){return fZ;}; /// Get Z strip position
137     //
138     Float_t GetXalig(){ return UXal;}; ///< return X alignement paramenter
139     Float_t GetYalig(){ return UYal;}; ///< return Y alignement paramenter
140     Float_t GetZalig(){ return UZal;}; ///< return Z alignement paramenter
141     //
142 mocchiut 1.6 Int_t GetView(){return (fView-1);}; ///< Get strip view [0-1]
143 mocchiut 1.10 Int_t GetPlane(){return (fPlane-1);}; ///< Get strip plane [0-21]
144 mocchiut 1.6 Int_t GetStrip(){return (fStrip-1);}; ///< Get strip number [0-95]
145 mocchiut 1.4 //
146     void Set(Int_t view, Int_t plane, Int_t strip); ///< Set strip giving view [0-1], plane [0-22] and number [0-95]
147 mocchiut 1.1 //
148 mocchiut 1.4 void Set(Float_t X, Float_t Y, Float_t Z); ///< Set strip giving position in PAMELA ref sys [cm]
149 mocchiut 1.1 //
150 mocchiut 1.4 void UseMechanicalAlig(){ ismech = true; UXal = MECHCTX; UYal = MECHCTY; UZal = MECHCTZ;}; ///< Tells CaloStrip to use mechanical alignement parameters
151     void UseStandardAlig(); ///< Tells CaloStrip to use default parameters it will find querying the DB. If connection fails uses parameters hard-coded in this file
152     void SetAlig(Float_t XALIG, Float_t YALIG, Float_t ZALIG){ ismech = false; UXal = XALIG; UYal = YALIG; UZal = ZALIG;};///< User defined alignement parameters
153     Bool_t IsMechanicalAlig(){return ismech;}; ///< True is using mechanical alignement parameters, false otherwise
154 mocchiut 1.1 //
155     void Clear(); ///< clear variables
156     //
157     CaloStrip* GetCaloStrip(){return this;}; ///< returns pointer to this object
158     //
159 mocchiut 1.4 ClassDef(CaloStrip,2);
160 mocchiut 1.1 //
161     };
162    
163     #endif

  ViewVC Help
Powered by ViewVC 1.1.23