StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTrigTreeMaker.h
1 /*
2  * Created by S. Gliske, Aug 2012
3  *
4  * Description: makes a tree with all the triggers per each event,
5  * with the option of cutting on the (hardware) trigger.
6  *
7  */
8 
9 #ifndef StTrigTreeMaker_H_
10 #define StTrigTreeMaker_H_
11 
12 #include <set>
13 #include <Rtypes.h>
14 #include <TTree.h>
15 #include <TFile.h>
16 
17 #include "StMaker.h"
18 #include "StRoot/StTriggerUtilities/StTriggerSimuMaker.h"
19 
20 class TrigSet;
21 
22 class StTrigTreeMaker_t : public StMaker {
23  public:
25  StTrigTreeMaker_t( const Char_t *myName = "TrigTreeMaker", const Char_t* filenameOut = "trigTree.root", Bool_t isMC = 0, Bool_t useSimu = 1 );
26 
28  virtual ~StTrigTreeMaker_t();
29 
31  Int_t Init();
32 
34  Int_t Make();
35 
37  void Clear(Option_t *opts="");
38 
40  Int_t Finish();
41 
42  void addTrigger( UInt_t trig );
43  void removeTrigger( UInt_t trig );
44 
48 
49  protected:
51  Bool_t mIsMC;
52 
54  Bool_t mUseSimuTrg;
55 
57  std::string mFilename;
58 
60  TFile *mFile;
61  TTree *mTree;
62 
63  // list of triggers for which to write out all triggers
64  std::set< UInt_t > mTriggerSet;
65 
66  // the triggers to save to the root file
67  TrigSet *mTrigSet;
68 
69  private:
70  // for ROOT
71  ClassDef( StTrigTreeMaker_t, 1 );
72 };
73 
74 inline void StTrigTreeMaker_t::addTrigger( UInt_t trig ){ mTriggerSet.insert( trig ); };
75 inline void StTrigTreeMaker_t::removeTrigger( UInt_t trig ){ mTriggerSet.erase( trig ); };
76 
77 /*
78  * $Id: StTrigTreeMaker.h,v 1.1 2012/11/26 19:06:11 sgliske Exp $
79  * $Log: StTrigTreeMaker.h,v $
80  * Revision 1.1 2012/11/26 19:06:11 sgliske
81  * moved from offline/users/sgliske/StRoot/StEEmcPool/StEEmcTreeMaker to StRoot/StEEmcPool/StEEmcTreeMaker
82  *
83  *
84  */
85 
86 #endif
Bool_t mIsMC
whether is Monte Carlo or data
void Clear(Option_t *opts="")
Clear for next event.
Int_t Init()
Initialize.
virtual ~StTrigTreeMaker_t()
deconstructor
Int_t Finish()
Write everything to file.
Int_t Make()
Build an event.
TFile * mFile
TFiles/TTrees for writing.
std::string mFilename
filenames
StTrigTreeMaker_t(const Char_t *myName="TrigTreeMaker", const Char_t *filenameOut="trigTree.root", Bool_t isMC=0, Bool_t useSimu=1)
constructor
Bool_t mUseSimuTrg
whether to use MuDst (hardware) triggers or simulated (software) triggers