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

CTB: code to read digits. More...

#include <ReadLArDigits.h>

Inheritance diagram for ReadLArDigits:
Collaboration diagram for ReadLArDigits:

Classes

class  SortDigits
 CTB: code to read digits. More...
 

Public Member Functions

 ReadLArDigits (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~ReadLArDigits ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
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

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

SG::ReadCondHandleKey< LArOnOffIdMappingm_cablingKey {this, "OnOffMap", "LArOnOffIdMap", "SG key for mapping object"}
 
int m_count
 
const LArEM_IDm_emId
 
const LArOnlineIDm_onlineHelper
 
std::ofstream m_outfile
 
SG::ReadHandleKey< LArDigitContainerm_containerKey { this, "ContainerKey", "FREE", "" }
 
std::string m_dumpFile
 
bool m_printCellLoc
 
bool m_printFebChan
 
NTuple::Tuple * m_ntuplePtr
 
NTuple::Item< long > m_cellIndex
 
NTuple::Array< long > m_layer
 
NTuple::Array< long > m_eta
 
NTuple::Array< long > m_phi
 
NTuple::Array< long > m_gain
 
NTuple::Array< long > m_barrel_ec
 
NTuple::Array< long > m_pos_neg
 
NTuple::Array< long > m_FT
 
NTuple::Array< long > m_slot
 
NTuple::Array< long > m_channel
 
NTuple::Matrix< long > m_samples
 
NTuple::Item< long > m_Nsamples
 
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

CTB: code to read digits.

Author
Walter Lampl

Definition at line 33 of file ReadLArDigits.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

◆ ReadLArDigits()

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

Definition at line 17 of file ReadLArDigits.cxx.

17  : AthAlgorithm(name, pSvcLocator),
18  m_emId(nullptr),
19  m_onlineHelper(nullptr),
20  m_ntuplePtr(nullptr)
21 
22 {m_count=0;
23  declareProperty("DumpFile",m_dumpFile="");
24  declareProperty("PrintCellLocation",m_printCellLoc=false);
25  declareProperty("PrintFebChan",m_printFebChan=true);
26 
27 }

◆ ~ReadLArDigits()

ReadLArDigits::~ReadLArDigits ( )

Definition at line 29 of file ReadLArDigits.cxx.

30 {//empty
31 }

Member Function Documentation

◆ 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 ReadLArDigits::execute ( )

Definition at line 85 of file ReadLArDigits.cxx.

86 {
87  m_count++;
88  ATH_MSG_VERBOSE( "======== executing event "<< m_count << " ========" );
89  ATH_MSG_VERBOSE( "Retrieving LArDigitContainer. Key= " << m_containerKey.key() );
90  const EventContext& ctx = Gaudi::Hive::currentContext();
92 
93  // View container copy.
94  LArDigitContainer larDigitCont (*larDigitContIn);
95 
97  const LArOnOffIdMapping* cabling{*cablingHdl};
98  if(!cabling) {
99  ATH_MSG_ERROR("Do not have mapping object " << m_cablingKey.key());
100  return StatusCode::FAILURE;
101  }
102 
103 
104  if (m_outfile.is_open()) {
105  SortDigits sortDigits(m_onlineHelper);
106  std::sort(larDigitCont.begin(),larDigitCont.end(),sortDigits);
107  }
108  unsigned cellCounter=0;
109  m_cellIndex=0;
110  if (!larDigitCont.empty())
111  m_Nsamples=larDigitCont.front()->samples().size();
112  else
113  m_Nsamples=0;
114  for (const LArDigit* digit : larDigitCont) {
115  HWIdentifier chid=digit->hardwareID();
116  const std::vector<short>& vSamples=digit->samples();
117  m_cellIndex++;
118  try {
119  const Identifier id=cabling->cnvToIdentifier(chid);
120  if (m_emId->is_lar_em(id))
121  {m_eta[cellCounter]=m_emId->eta(id);
122  m_phi[cellCounter]=m_emId->phi(id);
123  m_layer[cellCounter]=m_emId->sampling(id);
124  }
125  else {
126  m_eta[cellCounter]=0;
127  m_phi[cellCounter]=0;
128  m_layer[cellCounter]=0;
129  }
130  }
131  catch (LArID_Exception & except) {
132  m_eta[cellCounter]=-999;
133  m_phi[cellCounter]=-999;
134  m_layer[cellCounter]=-999;
135  }
136  m_barrel_ec[cellCounter]=m_onlineHelper->barrel_ec(chid);
137  m_pos_neg[cellCounter] = m_onlineHelper->pos_neg(chid);
138  m_FT[cellCounter] = m_onlineHelper->feedthrough(chid);
139  m_slot[cellCounter] = m_onlineHelper->slot(chid);
140  m_channel[cellCounter] = m_onlineHelper->channel(chid);
141  m_gain[cellCounter]=digit->gain();
142 
143  int nSamples=vSamples.size();
144  for (int i=0;i<nSamples && i<32;i++)
145  m_samples[cellCounter][i]=vSamples[i];
146 
147  if (m_outfile.is_open()) {
148  if (m_printCellLoc) {
149  if (m_eta[cellCounter]==-999 && m_phi[cellCounter]==-999 && m_layer[cellCounter]==-999)
150  m_outfile << "Cell l/e/p= <ILLEGAL IDENTIFIER> ";
151  else
152  m_outfile << "Cell l/e/p= " << m_layer[cellCounter] << "/" << m_eta[cellCounter]
153  << "/" << m_phi[cellCounter] << " ";
154  }
155  if (m_printFebChan)
156  m_outfile << "FebId= 0x" << std::hex << m_onlineHelper->feb_Id(chid).get_compact()
157  << std::dec << " Ch= " << m_channel[cellCounter] << " ";
158  for (int i=0;i<nSamples;i++) {
159  m_outfile << " " << vSamples[i];
160  }
161  m_outfile << " G=" << m_gain[cellCounter] << std::endl;
162  }
163  cellCounter++;
164  }
165  ATH_CHECK( ntupleSvc()->writeRecord(m_ntuplePtr) );
166 
167  if (m_count%1000==0)
168  ATH_MSG_INFO( "Event " << m_count << " contains " << cellCounter << " channels" );
169  return StatusCode::SUCCESS;
170 }

◆ 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 }

◆ finalize()

StatusCode ReadLArDigits::finalize ( )

Definition at line 172 of file ReadLArDigits.cxx.

173 {
174  if (m_outfile.is_open())
175  m_outfile.close();
176  ATH_MSG_INFO( "finalize ReadLarDigits" );
177  return StatusCode::SUCCESS;
178 }

◆ initialize()

StatusCode ReadLArDigits::initialize ( )

Definition at line 33 of file ReadLArDigits.cxx.

34 {
35  ATH_MSG_INFO( "Initialize" );
36 
37  const CaloCell_ID* idHelper = nullptr;
38  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
39  m_emId=idHelper->em_idHelper();
40 
42  ATH_CHECK( detStore()->retrieve(m_onlineHelper, "LArOnlineID") );
43 
44  if (!m_dumpFile.empty())
45  m_outfile.open(m_dumpFile.c_str(),std::ios::out);
46  //Ntuple booking
47 
48 
49  NTupleFilePtr file1(ntupleSvc(),"/NTUPLES/FILE1");
50  if (!file1) {
51  ATH_MSG_ERROR( "Booking of NTuple failed" );
52  return StatusCode::FAILURE;
53  }
54  NTuplePtr nt(ntupleSvc(),"/NTUPLES/FILE1/LARDIGITS");
55  if (!nt) {
56  nt=ntupleSvc()->book("/NTUPLES/FILE1/LARDIGITS",CLID_ColumnWiseTuple,"LArDigits");
57  }
58  if (!nt) {
59  ATH_MSG_ERROR( "Booking of NTuple failed" );
60  return StatusCode::FAILURE;
61  }
62 
63  ATH_CHECK( nt->addItem("icell",m_cellIndex,0,3600) );
64  ATH_CHECK( nt->addItem("layer",m_cellIndex,m_layer) );
65  ATH_CHECK( nt->addItem("ieta",m_cellIndex,m_eta) );
66  ATH_CHECK( nt->addItem("iphi",m_cellIndex,m_phi) );
67  ATH_CHECK( nt->addItem("barrel_ec",m_cellIndex,m_barrel_ec) );
68  ATH_CHECK( nt->addItem("pos_neg",m_cellIndex,m_pos_neg) );
69  ATH_CHECK( nt->addItem("FT",m_cellIndex,m_FT) );
70  ATH_CHECK( nt->addItem("slot",m_cellIndex,m_slot) );
71  ATH_CHECK( nt->addItem("channel",m_cellIndex,m_channel) );
72  ATH_CHECK( nt->addItem("gain",m_cellIndex,m_gain) );
73  ATH_CHECK( nt->addItem("NSamples",m_Nsamples,0,32) );
74  ATH_CHECK( nt->addItem("Samples",m_cellIndex,m_samples,32) );
75 
77 
79  m_count=0;
80  ATH_MSG_INFO( "======== ReadLArDigits initialize successfully ========" );
81  return StatusCode::SUCCESS;
82 }

◆ 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.

◆ 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_barrel_ec

NTuple::Array<long> ReadLArDigits::m_barrel_ec
private

Definition at line 62 of file ReadLArDigits.h.

◆ m_cablingKey

SG::ReadCondHandleKey<LArOnOffIdMapping> ReadLArDigits::m_cablingKey {this, "OnOffMap", "LArOnOffIdMap", "SG key for mapping object"}
private

Definition at line 46 of file ReadLArDigits.h.

◆ m_cellIndex

NTuple::Item<long> ReadLArDigits::m_cellIndex
private

Definition at line 60 of file ReadLArDigits.h.

◆ m_channel

NTuple::Array<long> ReadLArDigits::m_channel
private

Definition at line 62 of file ReadLArDigits.h.

◆ m_containerKey

SG::ReadHandleKey<LArDigitContainer> ReadLArDigits::m_containerKey { this, "ContainerKey", "FREE", "" }
private

Definition at line 51 of file ReadLArDigits.h.

◆ m_count

int ReadLArDigits::m_count
private

Definition at line 47 of file ReadLArDigits.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_dumpFile

std::string ReadLArDigits::m_dumpFile
private

Definition at line 53 of file ReadLArDigits.h.

◆ m_emId

const LArEM_ID* ReadLArDigits::m_emId
private

Definition at line 48 of file ReadLArDigits.h.

◆ m_eta

NTuple::Array<long> ReadLArDigits::m_eta
private

Definition at line 61 of file ReadLArDigits.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_FT

NTuple::Array<long> ReadLArDigits::m_FT
private

Definition at line 62 of file ReadLArDigits.h.

◆ m_gain

NTuple::Array<long> ReadLArDigits::m_gain
private

Definition at line 61 of file ReadLArDigits.h.

◆ m_layer

NTuple::Array<long> ReadLArDigits::m_layer
private

Definition at line 61 of file ReadLArDigits.h.

◆ m_Nsamples

NTuple::Item<long> ReadLArDigits::m_Nsamples
private

Definition at line 64 of file ReadLArDigits.h.

◆ m_ntuplePtr

NTuple::Tuple* ReadLArDigits::m_ntuplePtr
private

Definition at line 58 of file ReadLArDigits.h.

◆ m_onlineHelper

const LArOnlineID* ReadLArDigits::m_onlineHelper
private

Definition at line 49 of file ReadLArDigits.h.

◆ m_outfile

std::ofstream ReadLArDigits::m_outfile
private

Definition at line 50 of file ReadLArDigits.h.

◆ m_phi

NTuple::Array<long> ReadLArDigits::m_phi
private

Definition at line 61 of file ReadLArDigits.h.

◆ m_pos_neg

NTuple::Array<long> ReadLArDigits::m_pos_neg
private

Definition at line 62 of file ReadLArDigits.h.

◆ m_printCellLoc

bool ReadLArDigits::m_printCellLoc
private

Definition at line 54 of file ReadLArDigits.h.

◆ m_printFebChan

bool ReadLArDigits::m_printFebChan
private

Definition at line 55 of file ReadLArDigits.h.

◆ m_samples

NTuple::Matrix<long> ReadLArDigits::m_samples
private

Definition at line 63 of file ReadLArDigits.h.

◆ m_slot

NTuple::Array<long> ReadLArDigits::m_slot
private

Definition at line 62 of file ReadLArDigits.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:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
LArEM_Base_ID::phi
int phi(const Identifier id) const
return phi according to :
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CaloCell_ID::em_idHelper
const LArEM_ID * em_idHelper() const
access to EM idHelper
Definition: CaloCell_ID.h:63
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
LArOnlineID_Base::slot
int slot(const HWIdentifier id) const
Return the slot number of a hardware cell identifier: slot = [1,15] Slot-ID in top part of the crat...
Definition: LArOnlineID_Base.cxx:1957
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
ReadLArDigits::m_channel
NTuple::Array< long > m_channel
Definition: ReadLArDigits.h:62
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
Identifier::get_compact
value_type get_compact() const
Get the compact id.
LArEM_Base_ID::sampling
int sampling(const Identifier id) const
return sampling according to :
ReadLArDigits::m_cellIndex
NTuple::Item< long > m_cellIndex
Definition: ReadLArDigits.h:60
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
checkRpcDigits.digit
digit
Definition: checkRpcDigits.py:186
HWIdentifier
Definition: HWIdentifier.h:13
LArOnlineID_Base::barrel_ec
int barrel_ec(const HWIdentifier id) const
Return the position barrel or endcap of a hardware cell identifier: barrel_ec = [0,...
Definition: LArOnlineID_Base.cxx:1938
LArEM_Base_ID::eta
int eta(const Identifier id) const
return eta according to :
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
ReadLArDigits::m_layer
NTuple::Array< long > m_layer
Definition: ReadLArDigits.h:61
LArOnlineID_Base::channel
int channel(const HWIdentifier id) const
Return the channel number of a hardware cell identifier channel = [0,127] in all FEB.
Definition: LArOnlineID_Base.cxx:1963
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
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
ReadLArDigits::m_printCellLoc
bool m_printCellLoc
Definition: ReadLArDigits.h:54
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
LArDigit
Liquid Argon digit base class.
Definition: LArDigit.h:25
lumiFormat.i
int i
Definition: lumiFormat.py:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ReadLArDigits::m_slot
NTuple::Array< long > m_slot
Definition: ReadLArDigits.h:62
LArOnlineID_Base::pos_neg
int pos_neg(const HWIdentifier id) const
Return the side of a hardware cell identifier pos_neg = [0,1] positive-side or negative-side Barrel...
Definition: LArOnlineID_Base.cxx:1950
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CaloCell_ID
Helper class for offline cell identifiers.
Definition: CaloCell_ID.h:34
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
ReadLArDigits::m_ntuplePtr
NTuple::Tuple * m_ntuplePtr
Definition: ReadLArDigits.h:58
LArOnlineID_Base::feb_Id
HWIdentifier feb_Id(int barrel_ec, int pos_neg, int feedthrough, int slot) const
Create feb_Id from fields.
Definition: LArOnlineID_Base.cxx:1479
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
ReadLArDigits::m_barrel_ec
NTuple::Array< long > m_barrel_ec
Definition: ReadLArDigits.h:62
ReadLArDigits::m_eta
NTuple::Array< long > m_eta
Definition: ReadLArDigits.h:61
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ReadLArDigits::m_outfile
std::ofstream m_outfile
Definition: ReadLArDigits.h:50
ReadLArDigits::m_count
int m_count
Definition: ReadLArDigits.h:47
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
ReadLArDigits::m_containerKey
SG::ReadHandleKey< LArDigitContainer > m_containerKey
Definition: ReadLArDigits.h:52
ReadLArDigits::m_pos_neg
NTuple::Array< long > m_pos_neg
Definition: ReadLArDigits.h:62
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
LArOnlineID_Base::feedthrough
int feedthrough(const HWIdentifier id) const
Return the feedthrough of a hardware cell identifier : feedthrough = [0,31] Barrel - A/C side or H/...
Definition: LArOnlineID_Base.cxx:1944
ReadLArDigits::m_dumpFile
std::string m_dumpFile
Definition: ReadLArDigits.h:53
a
TList * a
Definition: liststreamerinfos.cxx:10
h
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
ReadLArDigits::m_Nsamples
NTuple::Item< long > m_Nsamples
Definition: ReadLArDigits.h:64
ReadLArDigits::m_samples
NTuple::Matrix< long > m_samples
Definition: ReadLArDigits.h:63
ReadLArDigits::m_onlineHelper
const LArOnlineID * m_onlineHelper
Definition: ReadLArDigits.h:49
ReadLArDigits::m_phi
NTuple::Array< long > m_phi
Definition: ReadLArDigits.h:61
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
LArDigitContainer
Container class for LArDigit.
Definition: LArDigitContainer.h:24
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
ReadLArDigits::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition: ReadLArDigits.h:46
LArDigits2NtupleDumper.nSamples
nSamples
Definition: LArDigits2NtupleDumper.py:70
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
ReadLArDigits::m_printFebChan
bool m_printFebChan
Definition: ReadLArDigits.h:55
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
beamspotnt.nt
def nt
Definition: bin/beamspotnt.py:1063
ReadLArDigits::m_emId
const LArEM_ID * m_emId
Definition: ReadLArDigits.h:48
ntupleSvc
INTupleSvc * ntupleSvc()
Definition: ServiceAccessor.h:14
ReadLArDigits::m_gain
NTuple::Array< long > m_gain
Definition: ReadLArDigits.h:61
AtlasDetectorID::is_lar_em
bool is_lar_em(Identifier id) const
Definition: AtlasDetectorID.h:818
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
LArID_Exception
Exception class for LAr Identifiers.
Definition: LArID_Exception.h:20
ReadLArDigits::m_FT
NTuple::Array< long > m_FT
Definition: ReadLArDigits.h:62
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >
LArOnOffIdMapping
Definition: LArOnOffIdMapping.h:20
Identifier
Definition: IdentifierFieldParser.cxx:14