#ifndef _TATOFparMap_H #define _TATOFparMap_H /*------------------------------------------+---------------------------------*/ #include #include "TString.h" #include "TATOFpara.h" static const int dim_slat = 256; // all set global static const int dim_geo = 32; // for static const int dim_cha = 128; // AsyEOSRoot - ALF, 01/2013 static const int dim_addr = dim_geo*dim_cha; // class TATOFparMapAddr { public: TATOFparMapAddr(); virtual ~TATOFparMapAddr(); void SetData(Int_t i_slat, Int_t i_type); Int_t Slat() const; Int_t Type() const; ClassDef(TATOFparMapAddr,1); private: Int_t fiSlat; // Int_t fiType; // }; //############################################################################## class TATOFparMapSlat { public: TATOFparMapSlat(); virtual ~TATOFparMapSlat(); void SetData(Int_t i_type, Int_t i_packid, Int_t i_slatid, Int_t i_adct, Int_t i_adcb, Int_t i_tdct, Int_t i_tdcb, Int_t i_thisleft, Int_t i_thisright, Int_t i_otherleft, Int_t i_otherright); Int_t Type() const; Int_t PackId() const; Int_t SlatId() const; Int_t AddressAdct() const; Int_t AddressAdcb() const; Int_t AddressTdct() const; Int_t AddressTdcb() const; Int_t NeighborThisLeft() const; Int_t NeighborThisRight() const; Int_t NeighborOtherLeft() const; Int_t NeighborOtherRight() const; ClassDef(TATOFparMapSlat,1); private: Int_t fiType; // Int_t fiPackId; // Int_t fiSlatId; // Int_t fiAddrAdct; // Int_t fiAddrAdcb; // Int_t fiAddrTdct; // Int_t fiAddrTdcb; // Int_t fiThisLeft; // Int_t fiThisRight; // Int_t fiOtherLeft; // Int_t fiOtherRight; // }; //############################################################################## class TATOFparMap : public TATOFpara { public: //static const int dim_slat = 256; //static const int dim_geo = 32; //static const int dim_cha = 128; //static const int dim_addr = dim_geo*dim_cha; /*enum { dim_slat = 256, // ugly, to make root happy ... dim_geo = 32, dim_cha = 128, dim_addr = dim_geo*dim_cha // now put outside, global for AsyEOSRoot - ALF, 01/2013 };*/ TATOFparMap(); virtual ~TATOFparMap(); Bool_t SetupSlat(Int_t i_slat, Int_t i_type, Int_t i_packid, Int_t i_slatid, Int_t i_adct_g, Int_t i_adct_c, Int_t i_adcb_g, Int_t i_adcb_c, Int_t i_tdct_g, Int_t i_tdct_c, Int_t i_tdcb_g, Int_t i_tdcb_c, Int_t i_thisleft, Int_t i_thisright, Int_t i_otherleft, Int_t i_otherright); Bool_t FromFile(const TString& name); Int_t MaxAddress() const; Int_t MaxSlat() const; const TATOFparMapAddr& AddrInfo(Int_t i_addr) const; const TATOFparMapSlat& SlatInfo(Int_t i_slat) const; virtual void Clear(Option_t* opt=""); virtual void ToStream(ostream& os = cout, Option_t* option = "") const; static Int_t PackAddress(Int_t i_g, Int_t i_c); static Int_t GeoFromAddress(Int_t i_addr); static Int_t ChaFromAddress(Int_t i_addr); Bool_t CheckMap2(Int_t i_addr) const; Int_t SlatFromAddress(Int_t i_addr) const; // ALF, 01/2013 Int_t TypeFromAddress(Int_t i_addr) const; // ALF, 01/2013 Int_t TypeFromSlat(Int_t i_slat) const; // ALF, 01/2013 Int_t NeighborThisLeftFromSlat(Int_t i_slat) const; // ALF, 01/2013 Int_t NeighborThisRightFromSlat(Int_t i_slat) const; // ALF, 01/2013 Int_t NeighborOtherLeftFromSlat(Int_t i_slat) const; // ALF, 01/2013 Int_t NeighborOtherRightFromSlat(Int_t i_slat) const; // ALF, 01/2013 ClassDef(TATOFparMap,1); private: Bool_t CheckSlat(Int_t i_slat) const; Bool_t CheckAddr(Int_t i_g, Int_t i_c) const; Bool_t CheckMap(Int_t i_addr, Int_t i_slat) const; // private: //vector fAddrInfo; // now defined outside, global //vector fSlatInfo; }; static vector fAddrInfo(dim_addr); // has to be set global visible for static vector fSlatInfo(dim_slat); // AsyEOSRoot - ALF, 01/2013 #include "TATOFparMap.icc" #endif