--- DarthVader/CalorimeterLevel2/inc/CaloLevel1.h 2007/03/20 13:15:38 1.3 +++ DarthVader/CalorimeterLevel2/inc/CaloLevel1.h 2007/03/26 14:02:03 1.4 @@ -7,13 +7,40 @@ // // default position used only in CaloStrip for the moment // -#define CTX 121.1 -#define CTY 122.6 +// +// 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 // +// Mechanical positions (used with option --use-standard-alig) +// +#define MECHCTX 121. +#define MECHCTY 122. +#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 { @@ -66,14 +93,18 @@ 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 + Float_t UXal; ///< used X alignement parameter + Float_t UYal; ///< used Y alignement parameter + Float_t UZal; ///< used Z alignement parameter public: // @@ -84,24 +115,34 @@ // CaloStrip(CaloLevel1 *c1); ///< Constructor. // - Float_t GetE(){return fE;}; + 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(){printf(" Obsolete! Use CaloStrip class instead\n"); return (fView-1);}; ///< Get strip view [0-1] + Int_t GetPlane(){printf(" Obsolete! Use CaloStrip class instead\n");return (fPlane-1);}; ///< Get strip plane [0-22] + Int_t GetStrip(){printf(" Obsolete! Use CaloStrip class instead\n");return (fStrip-1);}; ///< Get strip number [0-95] + // + void Set(Int_t view, Int_t plane, Int_t strip); ///< Set strip giving view [0-1], plane [0-22] and number [0-95] // - Float_t GetX(){return fX;}; - 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);}; + 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 // CaloStrip* GetCaloStrip(){return this;}; ///< returns pointer to this object // - ClassDef(CaloStrip,1); + ClassDef(CaloStrip,2); // };