ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
FPGATrackSimMatrixMergeAlgo Class Reference

#include <FPGATrackSimMatrixMergeAlgo.h>

Inheritance diagram for FPGATrackSimMatrixMergeAlgo:
Collaboration diagram for FPGATrackSimMatrixMergeAlgo:

Public Member Functions

 FPGATrackSimMatrixMergeAlgo (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~FPGATrackSimMatrixMergeAlgo ()=default
 
StatusCode initialize () override
 
StatusCode execute () override
 
StatusCode finalize () override
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

StatusCode bookHistograms ()
 
StatusCode copySliceTree (TFile *file)
 
void readFiles ()
 
void readTree (TTree *matrix_tree, int region)
 
std::vector< TTree * > createMatrixTrees ()
 
void fillMatrixTrees (std::vector< TTree * > const &matrixTrees)
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

std::vector< AccumulateMapm_sector_cum
 
ServiceHandle< ITHistSvc > m_tHistSvc {this,"THistSvc","THistSvc"}
 
Gaudi::Property< std::vector< std::string > > m_fpath {this, "file_path",{},"vector of files to merge"}
 
Gaudi::Property< bool > m_allregion {this, "allregion",false, "Run all regions?"}
 
Gaudi::Property< int > m_region {this, "region", 0, "Region to run"}
 
Gaudi::Property< int > m_nRegions {this, "nbank", 96, "Number of regions"}
 
Gaudi::Property< bool > m_Monitor {this, "Monitor", false, "flag to enable the monitor"}
 
int m_region_start = 0
 
int m_region_end = 0
 
int m_nFiles = 0
 
int m_nLayers = 0
 
int m_nDim = 0
 
int m_nDim2 = 0
 
TH1I * m_h_nSector = nullptr
 
TH1I * m_h_nHit = nullptr
 
TH1F * m_h_c = nullptr
 
TH1F * m_h_d = nullptr
 
TH1F * m_h_phi = nullptr
 
TH1F * m_h_coto = nullptr
 
TH1F * m_h_z = nullptr
 
DataObjIDColl m_extendedExtraObjects
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 34 of file FPGATrackSimMatrixMergeAlgo.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ FPGATrackSimMatrixMergeAlgo()

FPGATrackSimMatrixMergeAlgo::FPGATrackSimMatrixMergeAlgo ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 36 of file FPGATrackSimMatrixMergeAlgo.cxx.

36  :
37  AthAlgorithm(name, pSvcLocator)
38 {
39 }

◆ ~FPGATrackSimMatrixMergeAlgo()

virtual FPGATrackSimMatrixMergeAlgo::~FPGATrackSimMatrixMergeAlgo ( )
virtualdefault

Member Function Documentation

◆ bookHistograms()

StatusCode FPGATrackSimMatrixMergeAlgo::bookHistograms ( )
private

Definition at line 96 of file FPGATrackSimMatrixMergeAlgo.cxx.

97 {
98  m_h_nSector = new TH1I("h_nSector", "number of sectors in merged file", 100, 0, 10000);
99  ATH_CHECK(m_tHistSvc->regHist("/TRIGFPGATrackSimMATRIXOUT/h_nSector",m_h_nSector));
100 
101  m_h_nHit = new TH1I("h_nHit", "number of hits in sector", 100, 0, 10000);
102  ATH_CHECK(m_tHistSvc->regHist("/TRIGFPGATrackSimMATRIXOUT/h_nHit",m_h_nHit));
103 
104  m_h_c = new TH1F("h_c", "Truth curvature in sector",100,-1e-8,1e-8);
105  ATH_CHECK(m_tHistSvc->regHist("/TRIGFPGATrackSimMATRIXOUT/h_c",m_h_c));
106 
107  m_h_d = new TH1F("h_d", "Truth d0 in sector",100,-2.5,2.5);
108  ATH_CHECK(m_tHistSvc->regHist("/TRIGFPGATrackSimMATRIXOUT/h_d",m_h_d));
109 
110  m_h_phi = new TH1F("h_phi", "Truth phi in sector",100,0,6.3);
111  ATH_CHECK(m_tHistSvc->regHist("/TRIGFPGATrackSimMATRIXOUT/h_phi",m_h_phi));
112 
113  m_h_coto = new TH1F("h_coto", "Truth coto in sector",100,-4,4);
114  ATH_CHECK(m_tHistSvc->regHist("/TRIGFPGATrackSimMATRIXOUT/h_coto",m_h_coto));
115 
116  m_h_z = new TH1F("h_z", "Truth z in sector",100,-200,200);
117  ATH_CHECK(m_tHistSvc->regHist("/TRIGFPGATrackSimMATRIXOUT/h_z",m_h_z));
118 
119  return StatusCode::SUCCESS;
120 }

◆ copySliceTree()

StatusCode FPGATrackSimMatrixMergeAlgo::copySliceTree ( TFile *  file)
private

Definition at line 123 of file FPGATrackSimMatrixMergeAlgo.cxx.

124 {
128 
129  // Read old tree
130  TTree *old_tree = (TTree*)file->Get("slice");
131  old_tree->SetBranchAddress("c_max", &max.qOverPt);
132  old_tree->SetBranchAddress("c_min", &min.qOverPt);
133  old_tree->SetBranchAddress("c_slices", &nBins.qOverPt);
134 
135  old_tree->SetBranchAddress("phi_max", &max.phi);
136  old_tree->SetBranchAddress("phi_min", &min.phi);
137  old_tree->SetBranchAddress("phi_slices", &nBins.phi);
138 
139  old_tree->SetBranchAddress("d0_max", &max.d0);
140  old_tree->SetBranchAddress("d0_min", &min.d0);
141  old_tree->SetBranchAddress("d0_slices", &nBins.d0);
142 
143  old_tree->SetBranchAddress("z0_max", &max.z0);
144  old_tree->SetBranchAddress("z0_min", &min.z0);
145  old_tree->SetBranchAddress("z0_slices", &nBins.z0);
146 
147  old_tree->SetBranchAddress("eta_max", &max.eta);
148  old_tree->SetBranchAddress("eta_min", &min.eta);
149  old_tree->SetBranchAddress("eta_slices", &nBins.eta);
150 
151  old_tree->GetEntry(0);
152 
153  // Write new tree
154  TTree *new_tree = new TTree("slice", "Slice boundaries");
155  ATH_CHECK(m_tHistSvc->regTree("/TRIGFPGATrackSimMATRIXOUT/slice", new_tree));
156 
157  new_tree->Branch("c_max", &max.qOverPt);
158  new_tree->Branch("c_min", &min.qOverPt);
159  new_tree->Branch("c_slices", &nBins.qOverPt);
160 
161  new_tree->Branch("phi_max", &max.phi);
162  new_tree->Branch("phi_min", &min.phi);
163  new_tree->Branch("phi_slices", &nBins.phi);
164 
165  new_tree->Branch("d0_max", &max.d0);
166  new_tree->Branch("d0_min", &min.d0);
167  new_tree->Branch("d0_slices", &nBins.d0);
168 
169  new_tree->Branch("z0_max", &max.z0);
170  new_tree->Branch("z0_min", &min.z0);
171  new_tree->Branch("z0_slices", &nBins.z0);
172 
173  new_tree->Branch("eta_max", &max.eta);
174  new_tree->Branch("eta_min", &min.eta);
175  new_tree->Branch("eta_slices", &nBins.eta);
176 
177  new_tree->Fill();
178 
179  return StatusCode::SUCCESS;
180 }

◆ createMatrixTrees()

std::vector<TTree*> FPGATrackSimMatrixMergeAlgo::createMatrixTrees ( )
private

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode FPGATrackSimMatrixMergeAlgo::execute ( )
override

Definition at line 218 of file FPGATrackSimMatrixMergeAlgo.cxx.

219 {
220  // Do nothing; this class does not process events. The main algorithm is
221  // called in initialize() and finalize().
222  return StatusCode::SUCCESS;
223 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ fillMatrixTrees()

void FPGATrackSimMatrixMergeAlgo::fillMatrixTrees ( std::vector< TTree * > const matrixTrees)
private

◆ finalize()

StatusCode FPGATrackSimMatrixMergeAlgo::finalize ( )
override

Definition at line 229 of file FPGATrackSimMatrixMergeAlgo.cxx.

230 {
231  for (int region = m_region_start; region < m_region_end; region++)
232  {
233  // Create the tree
234  std::stringstream name;
235  std::stringstream title;
236  name << "am" << region;
237  title << "Ambank " << region << " parameters";
238  TTree* tree = new TTree(name.str().c_str(), title.str().c_str());
239  ATH_CHECK(m_tHistSvc->regTree(Form("/TRIGFPGATrackSimMATRIXOUT/%s",tree->GetName()), tree));
240 
241  ATH_MSG_INFO("Sectors found in region " << region << ": " << m_sector_cum[region].size());
242 
243 
244  // Fill the tree
246 
247  // Monitoring
248  if (m_Monitor)
249  {
250  ATH_MSG_INFO("Sectors found in region " << region << ": " << m_sector_cum[region].size());
251  m_h_nSector->Fill(m_sector_cum[region].size());
252  for (auto & sector_info : m_sector_cum[region])
253  {
254  double coverage = sector_info.second.track_bins.size();
255  m_h_nHit->Fill(coverage);
256  m_h_c->Fill(sector_info.second.pars.qOverPt / coverage);
257  m_h_d->Fill(sector_info.second.pars.d0 / coverage);
258  m_h_phi->Fill(sector_info.second.pars.phi / coverage);
259  m_h_coto->Fill(sector_info.second.pars.eta / coverage);
260  m_h_z->Fill(sector_info.second.pars.z0 / coverage);
261  }
262  }
263  }
264 
265  ATH_CHECK(m_tHistSvc->finalize());
266  return StatusCode::SUCCESS;
267 }

◆ initialize()

StatusCode FPGATrackSimMatrixMergeAlgo::initialize ( )
override

Definition at line 42 of file FPGATrackSimMatrixMergeAlgo.cxx.

43 {
44  ATH_MSG_DEBUG("initialize()");
45 
46  ATH_CHECK(m_tHistSvc.retrieve());
48 
49  m_nFiles = m_fpath.size();
50  ATH_MSG_INFO("Merging " << m_nFiles << " files");
51 
52  // Use the first valid file to extract some general information used to intialize
53  TFile *file = nullptr;
54  std::vector<std::string> files = m_fpath.value();
55  for (int iFile = 0; iFile < m_nFiles; iFile++) {
56  file = TFile::Open(files[iFile].c_str());
57  if (!file)
58  ATH_MSG_WARNING("Could not open " << files[iFile]);
59  else {
60  if (file->GetNkeys() != 0) break;
61  else file->Close();
62  }
63  }
64  if (!file) return StatusCode::FAILURE;
65 
66  // Get the number of layers and total dimension from a sample region
67  TTree *matrix_tree = (TTree*)file->Get(Form("am%d",m_region.value()));
68  matrix_tree->SetBranchAddress("nplanes", &m_nLayers);
69  matrix_tree->SetBranchAddress("ndim", &m_nDim);
70  matrix_tree->SetBranchAddress("ndim2", &m_nDim2);
71  matrix_tree->GetEntry(0);
72 
73  // Copy the slice tree into the merged file
75 
76  file->Close();
77 
78  // Setup the boundaries for the merge
79  if (m_allregion) {
80  m_region_start = 0;
82  }
83  else {
85  m_region_end = m_region + 1;
86  }
87 
88  m_sector_cum.resize(m_nRegions);
89 
90 
91  readFiles();
92  return StatusCode::SUCCESS;
93 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg() [1/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Algorithm >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ readFiles()

void FPGATrackSimMatrixMergeAlgo::readFiles ( )
private

Definition at line 184 of file FPGATrackSimMatrixMergeAlgo.cxx.

185 {
186  for (int iFile = 0; iFile < m_nFiles; iFile++)
187  {
188  // Open the file
189  const string &fpath = m_fpath[iFile];
190  ATH_MSG_INFO("Reading " << fpath);
191  TFile *file = TFile::Open(fpath.c_str());
192 
193  // Check if the file is valid
194  if (!file || file->GetNkeys() == 0)
195  {
196  ATH_MSG_WARNING("Invalid file: " << fpath);
197  continue;
198  }
199 
200  // Read each tree
201  for (int region = m_region_start; region < m_region_end; region++)
202  {
203  TTree *tree = (TTree*)file->Get(Form("am%d", region));
205  delete tree;
206  }
207 
208  file->Close();
209  delete file;
210  }
211 }

◆ readTree()

void FPGATrackSimMatrixMergeAlgo::readTree ( TTree *  matrix_tree,
int  region 
)
private

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< Algorithm > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_allregion

Gaudi::Property<bool> FPGATrackSimMatrixMergeAlgo::m_allregion {this, "allregion",false, "Run all regions?"}
private

Definition at line 61 of file FPGATrackSimMatrixMergeAlgo.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_fpath

Gaudi::Property<std::vector<std::string> > FPGATrackSimMatrixMergeAlgo::m_fpath {this, "file_path",{},"vector of files to merge"}
private

Definition at line 60 of file FPGATrackSimMatrixMergeAlgo.h.

◆ m_h_c

TH1F* FPGATrackSimMatrixMergeAlgo::m_h_c = nullptr
private

Definition at line 81 of file FPGATrackSimMatrixMergeAlgo.h.

◆ m_h_coto

TH1F* FPGATrackSimMatrixMergeAlgo::m_h_coto = nullptr
private

Definition at line 84 of file FPGATrackSimMatrixMergeAlgo.h.

◆ m_h_d

TH1F* FPGATrackSimMatrixMergeAlgo::m_h_d = nullptr
private

Definition at line 82 of file FPGATrackSimMatrixMergeAlgo.h.

◆ m_h_nHit

TH1I* FPGATrackSimMatrixMergeAlgo::m_h_nHit = nullptr
private

Definition at line 80 of file FPGATrackSimMatrixMergeAlgo.h.

◆ m_h_nSector

TH1I* FPGATrackSimMatrixMergeAlgo::m_h_nSector = nullptr
private

Definition at line 79 of file FPGATrackSimMatrixMergeAlgo.h.

◆ m_h_phi

TH1F* FPGATrackSimMatrixMergeAlgo::m_h_phi = nullptr
private

Definition at line 83 of file FPGATrackSimMatrixMergeAlgo.h.

◆ m_h_z

TH1F* FPGATrackSimMatrixMergeAlgo::m_h_z = nullptr
private

Definition at line 85 of file FPGATrackSimMatrixMergeAlgo.h.

◆ m_Monitor

Gaudi::Property<bool> FPGATrackSimMatrixMergeAlgo::m_Monitor {this, "Monitor", false, "flag to enable the monitor"}
private

Definition at line 64 of file FPGATrackSimMatrixMergeAlgo.h.

◆ m_nDim

int FPGATrackSimMatrixMergeAlgo::m_nDim = 0
private

Definition at line 72 of file FPGATrackSimMatrixMergeAlgo.h.

◆ m_nDim2

int FPGATrackSimMatrixMergeAlgo::m_nDim2 = 0
private

Definition at line 73 of file FPGATrackSimMatrixMergeAlgo.h.

◆ m_nFiles

int FPGATrackSimMatrixMergeAlgo::m_nFiles = 0
private

Definition at line 70 of file FPGATrackSimMatrixMergeAlgo.h.

◆ m_nLayers

int FPGATrackSimMatrixMergeAlgo::m_nLayers = 0
private

Definition at line 71 of file FPGATrackSimMatrixMergeAlgo.h.

◆ m_nRegions

Gaudi::Property<int> FPGATrackSimMatrixMergeAlgo::m_nRegions {this, "nbank", 96, "Number of regions"}
private

Definition at line 63 of file FPGATrackSimMatrixMergeAlgo.h.

◆ m_region

Gaudi::Property<int> FPGATrackSimMatrixMergeAlgo::m_region {this, "region", 0, "Region to run"}
private

Definition at line 62 of file FPGATrackSimMatrixMergeAlgo.h.

◆ m_region_end

int FPGATrackSimMatrixMergeAlgo::m_region_end = 0
private

Definition at line 68 of file FPGATrackSimMatrixMergeAlgo.h.

◆ m_region_start

int FPGATrackSimMatrixMergeAlgo::m_region_start = 0
private

Definition at line 67 of file FPGATrackSimMatrixMergeAlgo.h.

◆ m_sector_cum

std::vector<AccumulateMap> FPGATrackSimMatrixMergeAlgo::m_sector_cum
private

Definition at line 50 of file FPGATrackSimMatrixMergeAlgo.h.

◆ m_tHistSvc

ServiceHandle<ITHistSvc> FPGATrackSimMatrixMergeAlgo::m_tHistSvc {this,"THistSvc","THistSvc"}
private

Definition at line 55 of file FPGATrackSimMatrixMergeAlgo.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
FPGATrackSimMatrixMergeAlgo::m_nDim2
int m_nDim2
Definition: FPGATrackSimMatrixMergeAlgo.h:73
FPGATrackSimMatrixMergeAlgo::m_sector_cum
std::vector< AccumulateMap > m_sector_cum
Definition: FPGATrackSimMatrixMergeAlgo.h:50
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
FPGATrackSimMatrixMergeAlgo::readFiles
void readFiles()
Definition: FPGATrackSimMatrixMergeAlgo.cxx:184
FPGATrackSimTrackPars
Definition: FPGATrackSimTrackPars.h:22
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
FPGATrackSimMatrixMergeAlgo::m_nRegions
Gaudi::Property< int > m_nRegions
Definition: FPGATrackSimMatrixMergeAlgo.h:63
FPGATrackSimMatrixMergeAlgo::m_h_nSector
TH1I * m_h_nSector
Definition: FPGATrackSimMatrixMergeAlgo.h:79
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
FPGATrackSimMatrixMergeAlgo::m_nFiles
int m_nFiles
Definition: FPGATrackSimMatrixMergeAlgo.h:70
tree
TChain * tree
Definition: tile_monitor.h:30
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
FPGATrackSimMatrixMergeAlgo::m_tHistSvc
ServiceHandle< ITHistSvc > m_tHistSvc
Definition: FPGATrackSimMatrixMergeAlgo.h:55
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
FPGATrackSimMatrixMergeAlgo::m_h_phi
TH1F * m_h_phi
Definition: FPGATrackSimMatrixMergeAlgo.h:83
FPGATrackSimMatrixMergeAlgo::m_nDim
int m_nDim
Definition: FPGATrackSimMatrixMergeAlgo.h:72
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
FPGATrackSimMatrixMergeAlgo::readTree
void readTree(TTree *matrix_tree, int region)
FPGATrackSimMatrixMergeAlgo::m_h_coto
TH1F * m_h_coto
Definition: FPGATrackSimMatrixMergeAlgo.h:84
fillTree
void fillTree(AccumulateMap &map, TTree *tree, int nLayers, int nCoords)
Writes the contents of an AccumulateMap into the supplied tree (one entry per sector).
Definition: FPGATrackSimMatrixIO.cxx:226
FPGATrackSimMatrixMergeAlgo::m_region_start
int m_region_start
Definition: FPGATrackSimMatrixMergeAlgo.h:67
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
FPGATrackSimMatrixMergeAlgo::m_region_end
int m_region_end
Definition: FPGATrackSimMatrixMergeAlgo.h:68
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
FPGATrackSimMatrixMergeAlgo::m_allregion
Gaudi::Property< bool > m_allregion
Definition: FPGATrackSimMatrixMergeAlgo.h:61
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
FPGATrackSimMatrixMergeAlgo::m_h_nHit
TH1I * m_h_nHit
Definition: FPGATrackSimMatrixMergeAlgo.h:80
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
covarianceTool.title
title
Definition: covarianceTool.py:542
generateReferenceFile.files
files
Definition: generateReferenceFile.py:12
file
TFile * file
Definition: tile_monitor.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
FPGATrackSimMatrixMergeAlgo::m_h_z
TH1F * m_h_z
Definition: FPGATrackSimMatrixMergeAlgo.h:85
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
dumpTgcDigiJitter.nBins
list nBins
Definition: dumpTgcDigiJitter.py:29
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
FPGATrackSimMatrixMergeAlgo::m_nLayers
int m_nLayers
Definition: FPGATrackSimMatrixMergeAlgo.h:71
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
a
TList * a
Definition: liststreamerinfos.cxx:10
h
FPGATrackSimMatrixMergeAlgo::bookHistograms
StatusCode bookHistograms()
Definition: FPGATrackSimMatrixMergeAlgo.cxx:96
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
FPGATrackSimMatrixMergeAlgo::copySliceTree
StatusCode copySliceTree(TFile *file)
Definition: FPGATrackSimMatrixMergeAlgo.cxx:123
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
FPGATrackSimMatrixMergeAlgo::m_h_c
TH1F * m_h_c
Definition: FPGATrackSimMatrixMergeAlgo.h:81
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
FPGATrackSimMatrixMergeAlgo::m_fpath
Gaudi::Property< std::vector< std::string > > m_fpath
Definition: FPGATrackSimMatrixMergeAlgo.h:60
FPGATrackSimTrackParsI
Definition: FPGATrackSimTrackPars.h:56
FPGATrackSimMatrixMergeAlgo::m_h_d
TH1F * m_h_d
Definition: FPGATrackSimMatrixMergeAlgo.h:82
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
FPGATrackSimMatrixMergeAlgo::m_Monitor
Gaudi::Property< bool > m_Monitor
Definition: FPGATrackSimMatrixMergeAlgo.h:64
fitman.k
k
Definition: fitman.py:528
FPGATrackSimMatrixMergeAlgo::m_region
Gaudi::Property< int > m_region
Definition: FPGATrackSimMatrixMergeAlgo.h:62
ServiceHandle< ICondSvc >