Public Member Functions | Private Attributes | List of all members
triggersim::TemplateTriggerAna Class Reference
Inheritance diagram for triggersim::TemplateTriggerAna:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Public Member Functions

 TemplateTriggerAna (fhicl::ParameterSet const &p)
 
 TemplateTriggerAna (TemplateTriggerAna const &)=delete
 
 TemplateTriggerAna (TemplateTriggerAna &&)=delete
 
TemplateTriggerAnaoperator= (TemplateTriggerAna const &)=delete
 
TemplateTriggerAnaoperator= (TemplateTriggerAna &&)=delete
 
void analyze (art::Event const &evt) override
 
void reconfigure (fhicl::ParameterSet const &p)
 
void beginJob () override
 
void ResetVars ()
 
- Public Member Functions inherited from art::EDAnalyzer
 EDAnalyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDAnalyzer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Analyzer
virtual ~Analyzer () noexcept
 
 Analyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 Analyzer (Table< Config > const &config)
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
- Public Member Functions inherited from art::Observer
 ~Observer () noexcept
 
 Observer (Observer const &)=delete
 
 Observer (Observer &&)=delete
 
Observeroperator= (Observer const &)=delete
 
Observeroperator= (Observer &&)=delete
 
void registerProducts (ProductDescriptions &, ModuleDescription const &)
 
void fillDescriptions (ModuleDescription const &)
 
fhicl::ParameterSetID selectorConfig () const
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Private Attributes

std::string fTriggerLabel
 
TH1F * fTrigTypes
 
TTree * TrigAnaTree
 
int Run
 The run which the trigger was taken from. More...
 
int SubRun
 The SubRun which the trigger was taken from. More...
 
int Event
 The event which the trigger was taken from. More...
 
bool TrigDecision
 The decision of the trigger. More...
 
int TrigType
 The type of trigger decision which was made. More...
 
int TrigSubType
 The subtype of trigger decision which was made. More...
 

Additional Inherited Members

- Public Types inherited from art::EDAnalyzer
using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 
- Protected Member Functions inherited from art::Observer
std::string const & processName () const
 
bool wantAllEvents () const noexcept
 
bool wantEvent (ScheduleID id, Event const &e) const
 
Handle< TriggerResultsgetTriggerResults (Event const &e) const
 
 Observer (fhicl::ParameterSet const &config)
 
 Observer (std::vector< std::string > const &select_paths, std::vector< std::string > const &reject_paths, fhicl::ParameterSet const &config)
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Detailed Description

Definition at line 36 of file TemplateTriggerAna_module.cc.

Constructor & Destructor Documentation

triggersim::TemplateTriggerAna::TemplateTriggerAna ( fhicl::ParameterSet const &  p)
explicit

Definition at line 86 of file TemplateTriggerAna_module.cc.

87  :
88  EDAnalyzer(p)
89 {
90  this->reconfigure(p);
91 }
void reconfigure(fhicl::ParameterSet const &p)
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
p
Definition: test.py:223
triggersim::TemplateTriggerAna::TemplateTriggerAna ( TemplateTriggerAna const &  )
delete
triggersim::TemplateTriggerAna::TemplateTriggerAna ( TemplateTriggerAna &&  )
delete

Member Function Documentation

void triggersim::TemplateTriggerAna::analyze ( art::Event const &  evt)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 121 of file TemplateTriggerAna_module.cc.

121  {
122 
123  // --- Reset all of our variables...
124  ResetVars();
125 
126  // --- Get trigger data products out of the event...
127  auto triggers = evt.getValidHandle<std::vector<triggersim::BasicTrigger> >(fTriggerLabel);
128 
129  // --- Loop over trigger objects...
130  for(unsigned int i = 0; i < triggers->size(); ++i) {
131 
132  // --- Set our variables for the TTree...
133  Run = evt.run();
134  SubRun = evt.subRun();
135  Event = evt.event();
136 
137  TrigDecision = (*triggers)[i].TrigDecision();
138  TrigType = (*triggers)[i].TrigType();
139  TrigSubType = (*triggers)[i].TrigSubType();
140  // --- Print some info, and confirm to ourselves that our variables are correctly set...
141  std::cout << "\n----------Info for trigger " << i << ":"
142  << "\nTrigger Decision = " << (*triggers)[i].TrigDecision() << " " << TrigDecision
143  << "\nTrigger Type = " << (*triggers)[i].TrigType() << " " << TrigType
144  << "\nTrigger Sub-Type = " << (*triggers)[i].TrigSubType() << " " << TrigSubType
145  << "\nTrigger HardwareID = " << (*triggers)[i].TrigHardwareID()
146  << std::endl;
147 
148 
149  std::cout << "\nAnother way of printing out a trigger" << std::endl;
150  std::cout << (*triggers)[i] << std::endl;
151 
152  // --- Fill a histogram...
153  fTrigTypes->Fill((*triggers)[i].TrigType());
154 
155  // --- Fill a TTree...
156  TrigAnaTree -> Fill();
157  }
158 
159 }
unsigned int event
Definition: DataStructs.h:636
unsigned int run
Definition: DataStructs.h:637
int Event
The event which the trigger was taken from.
int TrigType
The type of trigger decision which was made.
int SubRun
The SubRun which the trigger was taken from.
int Run
The run which the trigger was taken from.
bool TrigDecision
The decision of the trigger.
unsigned int subRun
Definition: DataStructs.h:638
TCEvent evt
Definition: DataStructs.cxx:7
int TrigSubType
The subtype of trigger decision which was made.
QTextStream & endl(QTextStream &s)
void triggersim::TemplateTriggerAna::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 100 of file TemplateTriggerAna_module.cc.

101 {
102  // --- Make a handle to the TFileService - the thing that handles all the histogram and TTree outputs...
104  // --- Now we can declare the histrogram which we want to make.
105  fTrigTypes = tfs->make<TH1F>("fTrigTypes","Trigger Types;trig type;count",
106  101,-0.5,100.5);
107 
108  // --- Now we want to declare our TTree, and set the names of the variables in it...
109  TrigAnaTree = tfs->make<TTree>("TrigAnaTree", "Analysis tree from triggers");
110  TrigAnaTree -> Branch( "Run" , &Run );
111  TrigAnaTree -> Branch( "SubRun" , &SubRun );
112  TrigAnaTree -> Branch( "Event" , &Event );
113  TrigAnaTree -> Branch( "TrigDecision", &TrigDecision );
114  TrigAnaTree -> Branch( "TrigType" , &TrigType );
115  TrigAnaTree -> Branch( "TrigSubType" , &TrigSubType );
116 }
int Event
The event which the trigger was taken from.
int TrigType
The type of trigger decision which was made.
int SubRun
The SubRun which the trigger was taken from.
int Run
The run which the trigger was taken from.
bool TrigDecision
The decision of the trigger.
int TrigSubType
The subtype of trigger decision which was made.
TemplateTriggerAna& triggersim::TemplateTriggerAna::operator= ( TemplateTriggerAna const &  )
delete
TemplateTriggerAna& triggersim::TemplateTriggerAna::operator= ( TemplateTriggerAna &&  )
delete
void triggersim::TemplateTriggerAna::reconfigure ( fhicl::ParameterSet const &  p)

Definition at line 94 of file TemplateTriggerAna_module.cc.

95 {
96  fTriggerLabel = p.get<std::string> ("TriggerLabel");
97 }
std::string string
Definition: nybbler.cc:12
p
Definition: test.py:223
void triggersim::TemplateTriggerAna::ResetVars ( )

Definition at line 76 of file TemplateTriggerAna_module.cc.

76  {
77  Run = -1;
78  SubRun = -1;
79  Event = -1;
80  TrigDecision = false;
81  TrigType = -1;
82  TrigSubType = -1;
83 }
int Event
The event which the trigger was taken from.
int TrigType
The type of trigger decision which was made.
int SubRun
The SubRun which the trigger was taken from.
int Run
The run which the trigger was taken from.
bool TrigDecision
The decision of the trigger.
int TrigSubType
The subtype of trigger decision which was made.

Member Data Documentation

int triggersim::TemplateTriggerAna::Event
private

The event which the trigger was taken from.

Definition at line 69 of file TemplateTriggerAna_module.cc.

std::string triggersim::TemplateTriggerAna::fTriggerLabel
private

Definition at line 60 of file TemplateTriggerAna_module.cc.

TH1F* triggersim::TemplateTriggerAna::fTrigTypes
private

Definition at line 63 of file TemplateTriggerAna_module.cc.

int triggersim::TemplateTriggerAna::Run
private

The run which the trigger was taken from.

Definition at line 67 of file TemplateTriggerAna_module.cc.

int triggersim::TemplateTriggerAna::SubRun
private

The SubRun which the trigger was taken from.

Definition at line 68 of file TemplateTriggerAna_module.cc.

TTree* triggersim::TemplateTriggerAna::TrigAnaTree
private

Definition at line 66 of file TemplateTriggerAna_module.cc.

bool triggersim::TemplateTriggerAna::TrigDecision
private

The decision of the trigger.

Definition at line 70 of file TemplateTriggerAna_module.cc.

int triggersim::TemplateTriggerAna::TrigSubType
private

The subtype of trigger decision which was made.

Definition at line 72 of file TemplateTriggerAna_module.cc.

int triggersim::TemplateTriggerAna::TrigType
private

The type of trigger decision which was made.

Definition at line 71 of file TemplateTriggerAna_module.cc.


The documentation for this class was generated from the following file: