ATLAS Offline Software
TreeCacheModule.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 
9 //
10 // includes
11 //
12 
14 
15 #include <EventLoop/Job.h>
16 #include <EventLoop/ModuleData.h>
17 #include <TTree.h>
18 
19 //
20 // method implementations
21 //
22 
23 namespace EL
24 {
25  namespace Detail
26  {
29  {
30  if (data.m_inputTree)
31  {
32  double cacheSize = data.m_metaData->castDouble (Job::optCacheSize, 0);
33  if (cacheSize > 0)
34  data.m_inputTree->SetCacheSize (cacheSize);
35  double cacheLearnEntries = data.m_metaData->castDouble (Job::optCacheLearnEntries, 0);
36  if (cacheLearnEntries > 0)
37  data.m_inputTree->SetCacheLearnEntries (cacheLearnEntries);
38  }
39  return StatusCode::SUCCESS;
40  }
41 
42 
43 
46  {
47  if (data.m_metaData->castBool (Job::optPrintPerFileStats, false))
48  {
49  ANA_MSG_INFO ("file stats for: " << data.m_inputFileUrl);
50  data.m_inputTree->PrintCacheStats ();
51  }
52  return StatusCode::SUCCESS;
53  }
54  }
55 }
EL::Detail::TreeCacheModule::onCloseInputFile
virtual StatusCode onCloseInputFile(ModuleData &data) override
actions before closing an input file
Definition: TreeCacheModule.cxx:45
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
EL::Detail::ModuleData
the data the EventLoop core classes are sharing with the Module implementation
Definition: ModuleData.h:64
EL::Job::optPrintPerFileStats
static const std::string optPrintPerFileStats
description: the option to turn on printing of i/o statistics at the end of each file rationale: whil...
Definition: Job.h:416
Job.h
TreeCacheModule.h
EL::Detail::TreeCacheModule::onNewInputFile
virtual StatusCode onNewInputFile(ModuleData &data) override
actions after opening a new input file
Definition: TreeCacheModule.cxx:28
EL::Job::optCacheSize
static const std::string optCacheSize
description: this option allows to configure the TTreeCache size for this job.
Definition: Job.h:309
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ANA_MSG_INFO
#define ANA_MSG_INFO(xmsg)
Macro printing info messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:290
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition: AlgorithmWorkerData.h:24
EL::Job::optCacheLearnEntries
static const std::string optCacheLearnEntries
description: this option allows to configure the number of tree entries used for learning cache behav...
Definition: Job.h:324
xAOD::DiTauJetParameters::Detail
Detail
Definition: DiTauDefs.h:38
ModuleData.h