---+ Using TrigConfBunchCrossingTool from EventLoop The following explains the procedure on how to setup the TrigConfBunchCrossingTool to access BC information from inside EventLoop. This has been tested in AnalysisBase 2.4.28 with TrigBunchCrossingTool -00-04-20. ---++ Small fix in TrigBunchCrossingTool A local instance of the TrigBunchCrossingTool is required as a minor change needs to be applied within the tool to make it work within EventLoop <pre>rc checkout_pkg TrigBunchCrossingTool</pre> Now open TrigBunchCrossingTool /Root/TrigConfBunchCrossingTool.cxx. Line 47 reads <verbatim>m_configTool( "TrigConf::xAODConfigTool" ) {</verbatim> and change this to <verbatim>m_configTool( "xAODConfigTool" ) {</verbatim> ---++ Setting up the tool in EventLoop Include the needed dependencies in cmt/Makefile.RootCore <verbatim>PACKAGE_DEP = [...] TrigBunchCrossingTool TrigConfxAOD TrigConfHLTDat</verbatim> where [...] stands for all other dependencies. In the *.h file of the package we add the following three headers <verbatim>#include "TrigConfxAOD/xAODConfigTool.h" #include "TrigConfInterfaces/ITrigConfigTool.h" #include "TrigBunchCrossingTool/TrigConfBunchCrossingTool.h"</verbatim> and in public: declare both a new instance of the trigger configuration tool and the BC tool <verbatim>xAODConfigTool *m_configTool; //! Trig::TrigConfBunchCrossingTool *m_trigConfBunchCrossingTool; //!</verbatim> Now we look into the packages source code in *.cxx. Add the following lines to the initialize() function: <verbatim>// Trigger configuration tool m_configTool = new xAODConfigTool("xAODConfigTool"); ToolHandle<TrigConf::ITrigConfigTool> configHandle( m_configTool ); ANA_CHECK( configHandle->initialize() ); // BunchCrossingTool m_trigConfBunchCrossingTool = new Trig::TrigConfBunchCrossingTool("TrigConfBunchCrossingTool"); m_trigConfBunchCrossingTool->setProperty( "OutputLevel", MSG::INFO); ANA_CHECK( m_trigConfBunchCrossingTool->initialize() );</verbatim> ---++ Using the BC tool Bunch crossing information can be easily read in the execute(), e.g. to check whether a BC was filled ones needs to put in the BCID of the collision <verbatim>const bool result = m_trigConfBunchCrossingTool->isFilled( eventInfo->bcid() );</verbatim> The available functions can be seen from TrigBunchCrossingTool /TrigBunchCrossingTool/BunchCrossingToolBase.h -- Main.JochenJensHeinrich - 2017-05-10
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
WYSIWYG
|
M
ore topic actions
Topic revision: r1 - 2017-05-10
-
JochenJensHeinrich
Home
Plugins
Sandbox for tests
Support
Alice
Atlas
CMS
LHCb
Public Webs
Sandbox Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
P
P
View
Raw View
PDF version
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Cern Search
TWiki Search
Google Search
Sandbox
All webs
E
dit
A
ttach
Copyright &© 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use
Discourse
or
Send feedback