Go to the documentation of this file.00001
00002 #ifndef TSTSTOPOLOGY_H_
00003 #define TSTSTOPOLOGY_H_
00004
00005 #include "TF1.h"
00006
00007 class TSTSTopology {
00008 public:
00009 enum ESTSSide { kPSide, kNSide, kNSides, kAllSides };
00010
00011
00012
00013 protected:
00014 static UInt_t const kNNxCh = 128;
00015
00016 struct TDetSideConn {
00017 UInt_t fDet;
00018 ESTSSide fSide;
00019 UInt_t fConn;
00020 Bool_t fSet;
00021
00022 TDetSideConn():
00023 fDet(0),
00024 fSide(kPSide),
00025 fConn(0),
00026 fSet(kFALSE)
00027 {}
00028 };
00029
00030 struct TRocNxChConn {
00031 UInt_t fRoc;
00032 UInt_t fNx;
00033 UInt_t fCh;
00034 UInt_t fConn;
00035 Bool_t fSet;
00036 TRocNxChConn() :
00037 fRoc( 0 ),
00038 fNx( 0 ),
00039 fCh( 0 ),
00040 fSet( kFALSE )
00041 {}
00042 };
00043
00044 std::vector< std::vector< TDetSideConn > > fRocNxConnections;
00045 std::vector< std::vector < std::vector < TF1 * > > > fMappings;
00046
00047
00048
00049
00050
00051
00052 Double_t GetStripNoCheck( UInt_t det, UInt_t side, UInt_t conn, UInt_t ch ) const;
00053 UInt_t GetStripCheckNegative( UInt_t det, UInt_t side, UInt_t conn, UInt_t ch ) const;
00054
00055 public:
00056 TSTSTopology() {}
00057 virtual ~TSTSTopology();
00058
00059 UInt_t GetRocArrSize() const;
00060 UInt_t GetNxArrSize() const;
00061 UInt_t GetNxArrSize( UInt_t roc ) const;
00062 UInt_t GetDetArrSize() const;
00063
00064 UInt_t GetStripArrSize( UInt_t det, UInt_t side ) const;
00065
00066
00067
00068
00069 static UInt_t GetNNxCh() { return kNNxCh;}
00070 void TestMapping( Bool_t doPrint = kFALSE ) const;
00071 Bool_t IsValidRoc( UInt_t roc ) const;
00072 Bool_t IsValidNx( UInt_t roc, UInt_t nx ) const;
00073 Bool_t IsValidCh( UInt_t ch ) const;
00074
00075 UInt_t GetDetector( UInt_t roc, UInt_t nx ) const;
00076 ESTSSide GetSide( UInt_t roc, UInt_t nx ) const;
00077 UInt_t GetConnector( UInt_t roc, UInt_t nx ) const;
00078 UInt_t GetStrip( UInt_t roc, UInt_t nx, UInt_t ch ) const;
00079 UInt_t GetStrip( UInt_t det, UInt_t side, UInt_t conn, UInt_t ch ) const;
00080 void SetConnection( UInt_t roc, UInt_t nx, UInt_t det, ESTSSide side, UInt_t conn );
00081 void SetMapping( UInt_t det, UInt_t side, UInt_t conn, const Char_t * mapping );
00082 Bool_t IsMappingSet( UInt_t det, UInt_t side, UInt_t conn ) const;
00083
00084 static Char_t GetSideName( UInt_t side ) { return ( side == kPSide ) ? 'p' : ( side == kNSide ) ? 'n' : 'x' ;}
00085 static ESTSSide OppositeSide( ESTSSide side) { return ( side == kPSide ) ? kNSide : kPSide; }
00086
00087 ClassDef( TSTSTopology, 1 )
00088 };
00089
00090
00091 #endif // #define TSTSTOPOLOGY_H_
00092