Belle II Software  release-08-01-10
SoftwareTriggerResultPrinterModule.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #pragma once
9 
10 #include <framework/core/Module.h>
11 
12 #include <mdst/dataobjects/SoftwareTriggerResult.h>
13 #include <mdst/dataobjects/TRGSummary.h>
14 #include <framework/datastore/StoreObjPtr.h>
15 #include <framework/dataobjects/EventMetaData.h>
16 
17 #include <string>
18 #include <memory>
19 
20 class TFile;
21 class TTree;
22 
23 namespace Belle2 {
28  namespace SoftwareTrigger {
33  public:
36 
39 
41  void initialize() override;
42 
44  void event() override;
45 
47  void terminate() override;
48 
49  private:
51  std::string m_param_outputFileName = "software_trigger_results.root";
52 
60  std::unique_ptr<TFile> m_debugOutputFile;
62  std::unique_ptr<TTree> m_debugTTree;
64  std::map<std::string, std::map<SoftwareTriggerCutResult, unsigned int>> m_passedEventsPerTrigger;
66  std::map<std::string, std::map<SoftwareTriggerCutResult, unsigned int>> m_passedEventsPerTriggerNonPrescaled;
68  std::map<std::string, unsigned int> m_prescales;
70  unsigned int m_numberOfEvents = 0;
71  };
72  }
74 }
Base class for Modules.
Definition: Module.h:72
Write out the software trigger results in an easily accessible summary table.
StoreObjPtr< TRGSummary > m_l1Result
Store Object for reading the l1 result.
std::map< std::string, std::map< SoftwareTriggerCutResult, unsigned int > > m_passedEventsPerTriggerNonPrescaled
Internal map of summed results.
void event() override
Write out the cuts if wanted and sum them up.
std::string m_param_outputFileName
Output file name for the debug output.
void terminate() override
Store and delete the ttree if it was created. Print out the summed results.
std::map< std::string, std::map< SoftwareTriggerCutResult, unsigned int > > m_passedEventsPerTrigger
Internal map of summed results.
std::map< std::string, unsigned int > m_prescales
Internal map of prescales.
StoreObjPtr< EventMetaData > m_eventMetaDataPtr
EventMetaData is used by processEvent()/processCore().
virtual ~SoftwareTriggerResultPrinterModule()=default
default virtual constructor because this is a derived class using virtual methods
StoreObjPtr< SoftwareTriggerResult > m_resultStoreObjectPointer
Store Object for reading the trigger decision.
std::unique_ptr< TFile > m_debugOutputFile
TFile to store the debug TTree.
unsigned int m_numberOfEvents
Internal counter for the number of seen events.
std::unique_ptr< TTree > m_debugTTree
TTree to store the debug output.
SoftwareTriggerResultPrinterModule()
Create a new module instance and set the parameters.
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
Abstract base class for different kinds of events.