StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StGmtStripCollection.h
1 
13 #ifndef StGmtStripCollection_hh
14 #define StGmtStripCollection_hh
15 
16 // STAR headers
17 #include "StObject.h"
18 #include "StContainers.h"
19 #include "StGmtStrip.h"
20 
21 //________________
23  public:
25  StGmtStripCollection( short module = 0 );
26 
29 
30  // WARNING: never use getStripVec().push_back() or equivelants.
31  // Instead use StGmtStripCollection::getStrip to add a new strip.
32 
34  StSPtrVecGmtStrip& getStripVec() { return mStripVec; }
36  const StSPtrVecGmtStrip& getStripVec() const { return mStripVec; }
37 
38  // sort internal vector by geoId
39  void sortByGeoId();
40 
41  // sort internal vector by coordinate number
42  void sortByCoord();
43  // sort internal vector by coordinate number
44  void partialSortByCoord();
45 
46  // sort internal vector by layer (X first then Y)
47  void sortByLayer();
48 
49  // remove all hits with negative geoIds
50  void removeFlagged();
51 
52  // size of internal vector
53  size_t getNumStrips() const;
54 
55  // modify/access the moduleId
56  short getModule() const;
57  void setModule( short module );
58 
59  // Clear
60  void Clear( Option_t *opt = "" );
61 
62  // Get pointer to a strip -- note: this is the only way to modify a
63  // strip. New strip is created if it does not exist, but only
64  // using StGmtStrip() constructor. Ownership is retained by the
65  // collection.
66 
67  StGmtStrip* getStrip( int Id );
68  StGmtStrip* getSortedStrip( int Id );
69 
70  protected:
72  static bool hitGeoIdLessThan( const StGmtStrip* h1, const StGmtStrip* h2 );
74  static bool hitCoordLessThan( const StGmtStrip* h1, const StGmtStrip* h2 );
76  static bool hitLayerLessThan( const StGmtStrip* h1, const StGmtStrip* h2 );
77 
79  Short_t mModule;
81  StSPtrVecGmtStrip mStripVec;
82 
85  StPtrVecGmtStrip mStripElecIdVec;
88  StPtrVecGmtStrip mStripGeoIdVec;
89 
90  private:
91  ClassDef(StGmtStripCollection,1)
92 };
93 
94 inline size_t StGmtStripCollection::getNumStrips() const {
95  return mStripVec.size();
96 };
97 
98 inline void StGmtStripCollection::setModule( short moduleId ) {
99  mModule = moduleId;
100 };
101 
102 inline short StGmtStripCollection::getModule() const {
103  return mModule;
104 };
105 
106 #endif // #define StGmtStripCollection_hh
static bool hitCoordLessThan(const StGmtStrip *h1, const StGmtStrip *h2)
Function used for sorting strips by coordinate number.
StSPtrVecGmtStrip & getStripVec()
Access vector with strips.
~StGmtStripCollection()
Destructor.
static bool hitGeoIdLessThan(const StGmtStrip *h1, const StGmtStrip *h2)
Function used for sorting strips by geoId.
StPtrVecGmtStrip mStripElecIdVec
StGmtStripCollection(short module=0)
Constructer.
static bool hitLayerLessThan(const StGmtStrip *h1, const StGmtStrip *h2)
Function used for sorting strips by X then Y.
StPtrVecGmtStrip mStripGeoIdVec
const StSPtrVecGmtStrip & getStripVec() const
Access vector with strips.
StSPtrVecGmtStrip mStripVec
Vector with strips.
Short_t mModule
Module ID.
Holds data for the strip in GMT.
Definition: StGmtStrip.h:21