--- DarthVader/CalorimeterLevel2/inc/CaloLevel1.h 2007/03/20 13:15:38 1.3 +++ DarthVader/CalorimeterLevel2/inc/CaloLevel1.h 2007/12/05 09:51:29 1.15 @@ -7,13 +7,52 @@ // // default position used only in CaloStrip for the moment // -#define CTX 121.1 -#define CTY 122.6 -#define CTZ -263.1 // +// old param +// +//#define CTX 121.1 +//#define CTY 122.6 +//#define CTZ -263.1 +// +// new param +// +//#define CTX 121.2 +//#define CTY 122.9 +//#define CTZ -263.1 +// +// new param using em showers (E. Taddei paramters) +// +//#define CTX 120.6 +//#define CTY 122.3 +//#define CTZ -263.1 +// +// new param using inclined protons and looking for Z alignment +// +#define CTX 120.6 +#define CTY 122.3 +#define CTZ -261.596 +// +// Mechanical positions (used with option --use-standard-alig) +// +#define MECHCTX 120.5 +#define MECHCTY 121.5 +#define MECHCTZ -261.81 +// +// just for testing purpose +// +//#define MECHCTX 0. +//#define MECHCTY 0. +//#define MECHCTZ -263.1 +// +#include +#include +#include #include +#include #include #include +#include +#include // extern "C" int millim_(Int_t *, Float_t *); struct shift { @@ -45,14 +84,17 @@ // Float_t GetEstrip(Int_t view, Int_t plane, Int_t strip); ///< returns saved MIP value for the indicated strip. 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. + 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. 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.). 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 ). + 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.). + 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 ). // - void Clear(); + void Clear(Option_t *t=""); // - Float_t GetXalig(){return CTX;}; ///< return X alignement paramenter - Float_t GetYalig(){return CTY;}; ///< return Y alignement paramenter - Float_t GetZalig(){return CTZ;}; ///< return Z alignement paramenter + Float_t GetXalig(){printf(" Obsolete! Use CaloStrip class instead\n");return CTX;}; ///< return X alignement paramenter + Float_t GetYalig(){printf(" Obsolete! Use CaloStrip class instead\n");return CTY;}; ///< return Y alignement paramenter + Float_t GetZalig(){printf(" Obsolete! Use CaloStrip class instead\n");return CTZ;}; ///< return Z alignement paramenter // CaloLevel1(); ///< Constructor. // @@ -66,42 +108,61 @@ class CaloStrip : public TObject { private: - CaloLevel1 *c1; - Float_t fE; - Float_t fX; - Float_t fY; - Float_t fZ; - Int_t fView; - Int_t fPlane; - Int_t fStrip; + CaloLevel1 *c1; //< pointer to level1 object + Float_t fE; //< energy in mip of the strip + Float_t fX; //< X position in cm of the strip + Float_t fY; //< Y position in cm of the strip + Float_t fZ; //< Z position in cm of the strip + Int_t fView; ///< view [1-2] + Int_t fPlane; ///< plane [1-22] + Int_t fStrip; ///< strip [1-96] + Bool_t ismech; ///< true = using mechanical alignement, false using experimental alignement parameters + static Float_t UXal; ///< used X alignement parameter + static Float_t UYal; ///< used Y alignement parameter + static Float_t UZal; ///< used Z alignement parameter + static Bool_t paramload; + // public: // // METHODS // - // CaloStrip(); ///< Default Constructor. // + CaloStrip(Bool_t usemechanicalalignement); ///< Default Constructor. + // CaloStrip(CaloLevel1 *c1); ///< Constructor. // - Float_t GetE(){return fE;}; + CaloStrip(CaloLevel1 *c1, Bool_t usemechanicalalignement); ///< Constructor. + // + Float_t GetE(){return fE;}; ///< Get energy in MIP for setted strip + // + Float_t GetX(){return fX;}; ///< Get X strip position + Float_t GetY(){return fY;}; ///< Get Y strip position + Float_t GetZ(){return fZ;}; /// Get Z strip position + // + Float_t GetXalig(){ return UXal;}; ///< return X alignement paramenter + Float_t GetYalig(){ return UYal;}; ///< return Y alignement paramenter + Float_t GetZalig(){ return UZal;}; ///< return Z alignement paramenter + // + Int_t GetView(){return (fView-1);}; ///< Get strip view [0-1] + Int_t GetPlane(){return (fPlane-1);}; ///< Get strip plane [0-21] + Int_t GetStrip(){return (fStrip-1);}; ///< Get strip number [0-95] // - Float_t GetX(){return fX;}; - Float_t GetY(){return fY;}; - Float_t GetZ(){return fZ;}; + void Set(Int_t view, Int_t plane, Int_t strip); ///< Set strip giving view [0-1], plane [0-22] and number [0-95] // - Int_t GetView(){return (fView-1);}; - Int_t GetPlane(){return (fPlane-1);}; - Int_t GetStrip(){return (fStrip-1);}; + void Set(Float_t X, Float_t Y, Float_t Z); ///< Set strip giving position in PAMELA ref sys [cm] // - void Set(Int_t view, Int_t plane, Int_t strip); - void Set(Float_t X, Float_t Y, Float_t Z); + void UseMechanicalAlig(){ ismech = true; UXal = MECHCTX; UYal = MECHCTY; UZal = MECHCTZ;}; ///< Tells CaloStrip to use mechanical alignement parameters + void UseStandardAlig(); ///< Tells CaloStrip to use default parameters it will find querying the DB. If connection fails uses parameters hard-coded in this file + void SetAlig(Float_t XALIG, Float_t YALIG, Float_t ZALIG){ ismech = false; UXal = XALIG; UYal = YALIG; UZal = ZALIG;};///< User defined alignement parameters + Bool_t IsMechanicalAlig(){return ismech;}; ///< True is using mechanical alignement parameters, false otherwise // - void Clear(); ///< clear variables + void Clear(Option_t *t=""); ///< clear variables // CaloStrip* GetCaloStrip(){return this;}; ///< returns pointer to this object // - ClassDef(CaloStrip,1); + ClassDef(CaloStrip,2); // };