Go to the documentation of this file.00001
00002 #ifndef TSTSTOPOLOGY_H_
00003 #define TSTSTOPOLOGY_H_
00004
00005 #include "Rtypes.h"
00006
00007 class TSTSTopology {
00008 public:
00009 enum ESTSSide { kPSide, kNSide, kNSides };
00010 enum ESTSOddEvenConnectors { kOddConnectors, kEvenConnectors };
00011
00012
00013 protected:
00014 static Int_t const kNDetectors = 3;
00015 static Int_t const kRocArrSize = 7;
00016 static Int_t const kNxArrSize = 3;
00017
00018 static Int_t const kNAdcBins = 4096;
00019 static Int_t const kNCh = 128;
00020 static Int_t const kInvalidDetectorId = -1;
00021 static Int_t const kIrrelevantNxId = -2;
00022
00023 std::vector< Int_t > fValidRocs;
00024 std::vector< std::vector< Int_t > > fValidNxs;
00025 std::vector< Int_t > fNStrips;
00026 std::vector< Int_t > fRoc2Detector;
00027 std::vector< ESTSSide > fRoc2Side;
00028 std::vector< std::vector< ESTSOddEvenConnectors > > fNx2Conn;
00029
00030
00031
00032
00033
00034
00035
00036 Int_t fNRocs;
00037 Int_t fNNxs;
00038
00039
00040
00041 Int_t GetStrip_Dem0b( ESTSSide side, ESTSOddEvenConnectors conn, Int_t nxCh ) const;
00042 Int_t GetStrip_Dem2b4( ESTSSide side, ESTSOddEvenConnectors conn, Int_t nxCh ) const;
00043 Int_t GetStrip_DemFsd( ESTSSide side, ESTSOddEvenConnectors conn, Int_t nxCh ) const;
00044
00045 public:
00046 TSTSTopology();
00047 ~TSTSTopology();
00048 Int_t GetRocArrSize() const { return kRocArrSize; }
00049 Int_t GetNxArrSize() const { return kNxArrSize; }
00050 Int_t GetNAdcBins() const { return kNAdcBins; }
00051 Int_t GetNCh() const { return kNCh;}
00052 static Int_t GetNDetectors() { return kNDetectors; }
00053 ESTSSide GetNSides() const { return kNSides; }
00054 Int_t GetNStrips( Int_t detId ) const { return fNStrips.at( detId ); }
00055 Int_t GetNRocs() const { return fNRocs; }
00056 Int_t GetNNxs() const { return fNNxs; }
00057 Bool_t IsValidRoc( Int_t rocId ) const { return fValidRocs.at( rocId ); }
00058 Bool_t IsValidNx( Int_t rocId, Int_t nxId ) const { return fValidNxs.at( rocId ).at( nxId ); }
00059 Bool_t IsValidCh( Int_t ch ) const { return ch >= 0 && ch < kNCh; }
00060 Bool_t IsValidDet( Int_t det ) const { return det >= 0 && det < GetNDetectors(); }
00061 Int_t GetDetector( Int_t rocId, Int_t nxId = kIrrelevantNxId ) const { return fRoc2Detector.at( rocId ); }
00062 ESTSSide GetSide( Int_t rocId, Int_t nxId = kIrrelevantNxId ) const { return fRoc2Side.at( rocId ); }
00063 static Char_t GetSideName( Int_t side ) { return ( side == kPSide ) ? 'p' : ( side == kNSide ) ? 'n' : 'x' ;}
00064 ESTSOddEvenConnectors GetOddEvenConn( Int_t rocId, Int_t nxId ) const { return fNx2Conn.at( rocId ).at( nxId ); }
00065
00066 Int_t GetStrip( Int_t rocId, Int_t nxId, Int_t nxCh ) const;
00067
00068
00069
00070 };
00071
00072
00073 #endif // #define TSTSTOPOLOGY_H_
00074