StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StIstRawHitCollection.h
1 // $Id: StIstRawHitCollection.h,v 1.10 2016/01/07 22:15:29 smirnovd Exp $
2 
3 #ifndef StIstRawHitCollection_hh
4 #define StIstRawHitCollection_hh
5 
6 #include "StObject.h"
7 #include "StIstRawHit.h"
8 #include <algorithm>
9 
10 
19 {
20 public:
21  //constructors
22  StIstRawHitCollection(int ladder = 0);
23  //deconstructor
25 
26  vector<StIstRawHit *> &getRawHitVec();
27  const vector<StIstRawHit *> &getRawHitVec() const;
28 
29  //sort internal vector by raw hit geometry ID
30  void sortByGeoId();
31 
32  //size of internal vector
33  size_t getNumRawHits() const;
34 
35  //modify/access the ladder
36  unsigned char getLadder() const;
37  void setLadder( int ladder );
38 
39  //clear
40  void Clear( Option_t *opt = "" );
41  using StObject::Print;
42  void Print(int nTimeBins) const;
43 
44  //get pointer to a raw hit by channel ID
45  StIstRawHit *getRawHit( int elecId );
46 
49  void addRawHit(StIstRawHit* istRawHit);
50 
51 protected:
52  //function used for sorting raw hits by geoId
53  static bool rawHitIdLessThan( const StIstRawHit *h1, const StIstRawHit *h2 );
54 
55  //data members
56  unsigned char mLadder;
57  std::vector<StIstRawHit *> mRawHitVec;
58 
59  //temporary copy of the pointers to add raw hit indexed by elec Id.
60  std::vector<StIstRawHit *> mRawHitElecIdVec;
61 
62 private:
63  ClassDef(StIstRawHitCollection, 1);
64 };
65 
66 #endif
void addRawHit(StIstRawHit *istRawHit)