STEER/TFndHit.h

00001 // @(#)fROOT/STEER:$Name:  $:$Id: TFndHit.h,v 1.10 2007/09/05 11:09:42 Diego_Faso Exp $
00002 // Revision Author: Diego Faso <mailto:faso@to.infn.it>, 2005/06/24
00003 // Original Author: Piergiorgio Cerello <mailto:cerello@to.infn.it>, 2001
00004 
00005 #ifndef FROOT_TFndHit
00006 #define FROOT_TFndHit                                                                      
00007 
00009 //     Base class for the FINUDA HDT (Hit Data Tape) structure  //
00010 //                                                              //
00011 // - The HIT position is common for all FINUDA hits             //
00012 //                                                              //
00013 //                                                              //
00015 
00016 #include <Riostream.h>
00017 #include "TObject.h"
00018 #include "TFndDB.h"
00019 #include "TFndGeometry.h"
00020 
00021 #include "FROOT.h"
00022 using namespace FROOT;
00023 
00024 class TFndHit : public TObject {
00025 
00026  protected:
00027   Int_t fChannel; // corresponding to DB numbering (default is "-1")
00028   Double_t fPosLRS[3]; // Position in the Local Reference System (cm) [x,y,z] 
00029   Double_t fPosMRS[3]; // Position in the Main Reference System (cm) [x,y,z] 
00030   
00031  public:
00032   enum E_FndHit_BothChan_Flag { E_HIT_NO_CH=0, E_HIT_E_CH=1,E_HIT_P_CH=2,E_HIT_BOTH_CH=3 };
00033   TString GetBothFlagStr(E_FndHit_BothChan_Flag flag){
00034     switch(flag){
00035     case E_HIT_NO_CH : return "no-hit";
00036     case E_HIT_E_CH  : return "e-side";
00037     case E_HIT_P_CH  : return "p-side";
00038     case E_HIT_BOTH_CH  : return "both";
00039     default: TerminateFroot(0,"BUG: wrong call for TFndHit::GetBothFlagStr");
00040     }
00041   }  
00042   
00043 
00044   TFndHit(const Int_t &channel = -1);
00045   ~TFndHit();
00046 
00047   void SetChannel(const Int_t &channel) { fChannel = channel; }
00048   Int_t GetChannel() { return fChannel; }
00049 
00050   void SetLocalPosition(Double_t x,Double_t y,Double_t z) { fPosLRS[0] = x; fPosLRS[1] = y; fPosLRS[2] = z; }
00051   void GetLocalPosition(Double_t &x,Double_t &y,Double_t &z) { x = fPosLRS[0]; y = fPosLRS[1]; z = fPosLRS[2]; }
00052   Double_t GetLocal_X() { return fPosLRS[0]; }
00053   Double_t GetLocal_Y() { return fPosLRS[1]; }
00054   Double_t GetLocal_Z() { return fPosLRS[2]; }
00055 
00056   //  void SetMasterPosition(Double_t x,Double_t y,Double_t z) { fPosMRS[0] = x; fPosMRS[1] = y; fPosMRS[2] = z; }
00057   void GetMasterPosition(Double_t &x,Double_t &y,Double_t &z) { x = fPosMRS[0]; y = fPosMRS[1]; z = fPosMRS[2]; }
00058   Double_t GetMain_X() { return fPosMRS[0]; }
00059   Double_t GetMain_Y() { return fPosMRS[1]; }
00060   Double_t GetMain_Z() { return fPosMRS[2]; }
00061 
00062   virtual void PrintHit(Int_t depth=0) = 0; // pure virtual method to be defined in daughter classes
00063   virtual void PrintPosition(Int_t mode=0);  
00064 
00065   ClassDef(TFndHit,1) // The FINUDA Hit (base structure)
00066   };
00067 
00068 #endif // FROOT_TFndHit
00069 

Generated on Tue Oct 16 15:40:48 2007 by  doxygen 1.5.2