StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TrigSet.h
1 /*
2  * Created by S. Gliske, Aug 2012
3  *
4  * Description: Container to hold the set of triggers.
5  *
6  */
7 
8 #ifndef TrigSet_H_
9 #define TrigSet_H_
10 
11 #include <Rtypes.h>
12 #include <TObject.h>
13 
14 #include <set>
15 #include <vector>
16 
17 class TrigSet : public TObject {
18  public:
19  TrigSet();
20  virtual ~TrigSet();
21  void Clear( const Option_t* opt = "" );
22 
23  // modifier
24  void insert( const std::vector< UInt_t >& trigVec );
25 
26  // accessors
27  Bool_t isTrig( UInt_t trig ) const;
28  Int_t numOfTrigs() const;
29  void copyToVector( std::vector< UInt_t >& vec ) const;
30 
31  // needs to be called after being read from a TTree or TFile
32  void resync() const;
33 
34  protected:
35  Int_t nTrigs; // number of triggers
36  UInt_t *mTrigArray; //[nTrigs] array of triggers
37 
38  mutable std::set< UInt_t > mTrigSet;
39 
40  private:
41  ClassDef( TrigSet, 1 );
42 };
43 
44 // inline functions
45 inline Int_t TrigSet::numOfTrigs() const { return nTrigs; };
46 inline Bool_t TrigSet::isTrig( UInt_t trig ) const { return mTrigSet.count( trig ); };
47 
48 #endif
49 
50 /*
51  * $Id: TrigSet.h,v 1.1 2012/11/26 19:04:31 sgliske Exp $
52  * $Log: TrigSet.h,v $
53  * Revision 1.1 2012/11/26 19:04:31 sgliske
54  * moved from offline/users/sgliske/StRoot/StEEmcPool/EEmcTreeContainers to StRoot/StEEmcPool/EEmcTreeContainers
55  *
56  *
57  */