ATLAS Offline Software
GoodRunsListSelectionTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // $Id$
6 // Dear emacs, this is -*- c++ -*-
7 #ifndef GoodRunsLists_GoodRunsListSelectionTool_H
8 #define GoodRunsLists_GoodRunsListSelectionTool_H
9 
10 // System include(s):
11 #include <vector>
12 #include <string>
13 
14 // Framework include(s):
15 #include "AsgTools/AsgTool.h"
18 
19 // Local include(s):
22 
23 #ifndef XAOD_STANDALONE
25 #endif
26 
36 #ifndef XAOD_STANDALONE
38 #endif
39  public asg::AsgTool {
40 
41  // Declare the proper constructor(s) for Athena:
43 
44 public:
45  GoodRunsListSelectionTool( const std::string& name =
46  "GoodRunsListsSelectionTool" );
47 
49  virtual StatusCode initialize();
50 
53 
55  virtual bool passRunLB( const std::vector< std::string >& grlnameVec =
56  std::vector< std::string >(),
57  const std::vector< std::string >& brlnameVec =
58  std::vector< std::string >() ) const;
59 
61  virtual bool passRunLB( const xAOD::EventInfo& event,
62  const std::vector< std::string >& grlnameVec =
63  std::vector< std::string >(),
64  const std::vector< std::string >& brlnameVec =
65  std::vector< std::string >() ) const;
66 
68  virtual bool passRunLB( int runNumber, int lumiBlockNr,
69  const std::vector< std::string >& grlnameVec =
70  std::vector< std::string >(),
71  const std::vector< std::string >& brlnameVec =
72  std::vector< std::string >() ) const;
73 
75  virtual const Root::TGRLCollection& getGRLCollection() const {
76  return m_grlcollection;
77  }
78 
80  virtual const Root::TGRLCollection& getBRLCollection() const {
81  return m_brlcollection;
82  }
83 
84 #ifndef XAOD_STANDALONE
85  virtual bool eventPassesFilter() const;
88 #endif
89 
91 
92 protected:
95  const std::vector< std::string >& files );
96 
97  Gaudi::Property<std::vector<std::string>> m_goodrunslistVec{this, "GoodRunsListVec", {}};
98  Gaudi::Property<std::vector<std::string>> m_blackrunslistVec{this, "BlackRunsListVec", {}};
99 
102 
103  Gaudi::Property<int> m_boolop{this, "BoolOperation", 0};
104  Gaudi::Property<bool> m_passthrough{this, "PassThrough", true};
105  Gaudi::Property<bool> m_rejectanybrl{this, "RejectBlackRunsInEventSelector", false};
106  Gaudi::Property<bool> m_useRandomRunNumber{this, "UseRandomRunNumber", false};
107 
109  {this, "RandomRunNumber", "EventInfo.RandomRunNumber"};
111  {this, "RandomLumiBlock", "EventInfo.RandomLumiBlockNumber"};
112 
113 }; // class GoodRunsListSelectionTool
114 
115 #endif // GoodRunsLists_GoodRunsListSelectionTool_H
IGoodRunsListSelectionTool.h
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
PropertyWrapper.h
GoodRunsListSelectionTool::initialize
virtual StatusCode initialize()
Initialize AlgTool.
Definition: GoodRunsListSelectionTool.cxx:19
TGRLCollection.h
GoodRunsListSelectionTool
Tool implementing the GRL selection.
Definition: GoodRunsListSelectionTool.h:39
ASG_TOOL_CLASS2
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
Definition: AsgToolMacros.h:77
GoodRunsListSelectionTool::m_rejectanybrl
Gaudi::Property< bool > m_rejectanybrl
Definition: GoodRunsListSelectionTool.h:105
GoodRunsListSelectionTool::readXMLs
StatusCode readXMLs(Root::TGRLCollection &grl, const std::vector< std::string > &files)
Helper function reading in the specified files into a GRL object.
Definition: GoodRunsListSelectionTool.cxx:145
GoodRunsListSelectionTool::getGRLCollection
virtual const Root::TGRLCollection & getGRLCollection() const
Get the good runs list used by the tool.
Definition: GoodRunsListSelectionTool.h:75
GoodRunsListSelectionTool::eventPassesFilter
virtual bool eventPassesFilter() const
ISkimmingTool method: will retrieve eventInfo from storegate and use that with above methods.
Definition: GoodRunsListSelectionTool.cxx:193
DerivationFramework::ISkimmingTool
Definition: ISkimmingTool.h:25
IGoodRunsListSelectionTool
Main tools implementing this interface: GoodRunsListSelectionTool (source code: DataQuality/GoodRunsL...
Definition: PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/IGoodRunsListSelectionTool.h:26
GoodRunsListSelectionTool::m_useRandomRunNumber
Gaudi::Property< bool > m_useRandomRunNumber
Definition: GoodRunsListSelectionTool.h:106
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
grl
Definition: ZLumiScripts/grid/grl.py:1
GoodRunsListSelectionTool::m_brlcollection
Root::TGRLCollection m_brlcollection
Definition: GoodRunsListSelectionTool.h:101
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
generateReferenceFile.files
files
Definition: generateReferenceFile.py:12
GoodRunsListSelectionTool::m_goodrunslistVec
Gaudi::Property< std::vector< std::string > > m_goodrunslistVec
Definition: GoodRunsListSelectionTool.h:97
Root::TGRLCollection
Definition: TGRLCollection.h:29
GoodRunsListSelectionTool::GoodRunsListSelectionTool
GoodRunsListSelectionTool(const std::string &name="GoodRunsListsSelectionTool")
Definition: GoodRunsListSelectionTool.cxx:16
GoodRunsListSelectionTool::m_boolop
Gaudi::Property< int > m_boolop
Definition: GoodRunsListSelectionTool.h:103
GoodRunsListSelectionTool::m_randomRunNumberKey
SG::ReadDecorHandleKey< xAOD::EventInfo > m_randomRunNumberKey
Definition: GoodRunsListSelectionTool.h:109
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
GoodRunsListSelectionTool::m_blackrunslistVec
Gaudi::Property< std::vector< std::string > > m_blackrunslistVec
Definition: GoodRunsListSelectionTool.h:98
GoodRunsListSelectionTool::getBRLCollection
virtual const Root::TGRLCollection & getBRLCollection() const
Get the bad runs list used by the tool.
Definition: GoodRunsListSelectionTool.h:80
GoodRunsListSelectionTool::m_grlcollection
Root::TGRLCollection m_grlcollection
Definition: GoodRunsListSelectionTool.h:100
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
GoodRunsListSelectionTool::passRunLB
virtual bool passRunLB(const std::vector< std::string > &grlnameVec=std::vector< std::string >(), const std::vector< std::string > &brlnameVec=std::vector< std::string >()) const
Check if the current event passes the selection.
Definition: GoodRunsListSelectionTool.cxx:51
SG::ReadDecorHandleKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Definition: StoreGate/StoreGate/ReadDecorHandleKey.h:85
AsgTool.h
GoodRunsListSelectionTool::m_passthrough
Gaudi::Property< bool > m_passthrough
Definition: GoodRunsListSelectionTool.h:104
ISkimmingTool.h
GoodRunsListSelectionTool::m_randomLumiBlockKey
SG::ReadDecorHandleKey< xAOD::EventInfo > m_randomLumiBlockKey
Definition: GoodRunsListSelectionTool.h:111