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

#include <TBLArRawChannelBuilder.h>

Inheritance diagram for TBLArRawChannelBuilder:
Collaboration diagram for TBLArRawChannelBuilder:

Public Member Functions

 TBLArRawChannelBuilder (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual StatusCode initialize () override
 
virtual StatusCode execute () override
 
virtual 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

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,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
 
const LArEM_IDm_emId
 
const LArFCAL_IDm_fcalId
 
const LArHEC_IDm_hecId
 
const LArOnlineIDm_onlineHelper
 
LArRawOrdering m_larRawOrdering
 
std::string m_DataLocation
 
std::string m_ChannelContainerName
 
int m_imaxSamp
 
std::string m_mode
 
float m_cubicAdcCut
 
float m_ADCtoMeVFCAL [3]
 
float m_ADCtoMeVHEC [2]
 
float m_ADCtoMeVEMECInner [2]
 
float m_ADCtoMeVEMECOuter [2]
 
float m_ADCtoMeVEMB [2]
 
unsigned int m_iPedestal
 
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 25 of file TBLArRawChannelBuilder.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

◆ TBLArRawChannelBuilder()

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

Definition at line 15 of file TBLArRawChannelBuilder.cxx.

15  :
16  AthAlgorithm(name, pSvcLocator),
17  m_emId(0),
18  m_fcalId(0),
19  m_hecId(0),
20  m_onlineHelper(0),
21  m_DataLocation("FREE"),
22  m_ChannelContainerName("LArRawChannels"),
24  m_ADCtoMeVHEC(),
27  m_ADCtoMeVEMB(),
28  m_iPedestal(0) // jobO ?
29 {
30  //m_useIntercept={false,false,false,false};
31  declareProperty("LArRawChannelContainerName",m_ChannelContainerName);
32  declareProperty("DataLocation", m_DataLocation );
33  declareProperty("maxSamp",m_imaxSamp=8);
34  declareProperty("RecoMode",m_mode="CUBIC");
35  declareProperty("CubicAdcCut",m_cubicAdcCut=50.0);
36 }

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 TBLArRawChannelBuilder::execute ( )
overridevirtual

Definition at line 67 of file TBLArRawChannelBuilder.cxx.

67  {
68  ATH_MSG_DEBUG ( "In execute" );
69 
71  const LArOnOffIdMapping* cabling{*cablingHdl};
72  if(!cabling) {
73  ATH_MSG_ERROR( "Do not hame cabling mapping from key " << m_cablingKey.key() );
74  return StatusCode::FAILURE;
75  }
76 
77  //Pointer to input data container
78  const LArDigitContainer* digitContainer;//Pointer to LArDigitContainer
79 
80  //Retrieve Digit Container
81  ATH_CHECK( evtStore()->retrieve(digitContainer,m_DataLocation) );
82  ATH_MSG_DEBUG ( "1) LArDigitContainer container size = " << digitContainer->size() );
83 
84  ATH_MSG_DEBUG ( "2) LArDigitContainer container size = " << digitContainer->size() );
85  if( digitContainer->size() < 1 ) {
86  ATH_MSG_INFO ( "Empty LArDigitContainer container." );
87  return StatusCode::SUCCESS;
88  }
89 
90  //Prepare LArRawChannelContainer
91  ATH_MSG_DEBUG ( "Making new LArRawChannelContainer " << digitContainer->size() );
92  LArRawChannelContainer* larRawChannelContainer=new LArRawChannelContainer();
93  larRawChannelContainer->reserve(digitContainer->size());
94  ATH_CHECK( evtStore()->record(larRawChannelContainer,m_ChannelContainerName) );
95 
96  //Now all data is available, start loop over Digit Container
97  ATH_MSG_DEBUG ( "Loop over Digit Container " );
98 
99  for (const LArDigit* digit : *digitContainer) {
100 
101  //Get data from LArDigit
102  const std::vector<short>& samples = digit->samples();
103  unsigned int nSamples = samples.size();
104  const HWIdentifier chid = digit->channelID();
105  const CaloGain::CaloGain gain = digit->gain();
106 
107  //>>>> PL June 20, 2004: subtract pedestal first, assume first sample ->JO?
108  std::vector<float> mySamples;
109  mySamples.resize(samples.size());
110  // FIXME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! only for 5 leading noise samples!
111  float thePedestal = (float)samples[m_iPedestal];
112  // log << MSG::INFO
113  // << "pedestal " << thePedestal << endmsg;
114  for ( unsigned int i=0; i<samples.size(); i++ )
115  {
116  mySamples[i] = ((float)samples[i]) - thePedestal;
117  }
118  //<<<<
119 
120  float GainFactor;
121  if( gain == CaloGain::LARLOWGAIN ) {
122  GainFactor = 9.8*9.8;
123  } else if (gain == CaloGain::LARMEDIUMGAIN ) {
124  GainFactor = 9.8;
125  } else if (gain == CaloGain::LARHIGHGAIN ) {
126  GainFactor = 1.0;
127  } else {
128  GainFactor = 1.0;
129  ATH_MSG_ERROR ( "Channel " << chid << "unknown gain: " << gain );
130  }
131 
132  // Find peak time sample
133  float maxADCPeak = 0.;
134  unsigned int iPeakSamp = 0;
135  for( unsigned i=0;i<nSamples;i++ ) {
136  if ( maxADCPeak < mySamples[i] )
137  {
138  maxADCPeak = mySamples[i];
139  iPeakSamp = i;
140  }
141  }
142 
143  bool CubicFailed = false;
144  float ADCPeak=0.;
145  float time=-999.;
146 
147  // maximum amplitude/variable time slice method
148  if( m_mode == "MAX" )
149  {
150  ADCPeak = maxADCPeak;
151  time = ((float)iPeakSamp+0.5) * 25.0 * nanosecond;
152  }
153 
154  // cubic extrapolation for selected channels
155  else if ( m_mode == "CUBIC" &&
156  ! ( CubicFailed = maxADCPeak <= m_cubicAdcCut ) )
157  {
158  // linear extrapolation table
159  unsigned int it0;
160  const float invT[4][4]
161  = { { 1, 0, 0, 0},
162  { -1.83333, 3, -1.5, 0.333333},
163  { 1, -2.5, 2, -0.5},
164  {-0.166666, 0.5, -0.5, 0.166666} };
165 
166  // peak slice very early
167  if ( iPeakSamp <= 1 )
168  {
169  it0 = m_iPedestal + 1;
170  }
171  // peak slice very late
172  else if ( iPeakSamp >= nSamples - 2 )
173  {
174  it0 = nSamples - 4;
175  }
176  // peak in safe region
177  else
178  {
179  it0 = ( mySamples[iPeakSamp-2] > mySamples[iPeakSamp+2] )
180  ? iPeakSamp - 2
181  : iPeakSamp - 1;
182  }
183 
184  // 4 samples to be used start at 0 <= t0 <= nsamples-4
185  float A[4] = {0, 0, 0, 0};
186  float dtmax = 0.0;
187  float disc;
188  // S = TA -> A = inv(T)S
189  for (int ia = 0; ia < 4; ia++)
190  for (int it = 0; it < 4; it++)
191  A[ia] += invT[ia][it] * mySamples[it0+it];
192 
193  // fit parameters
194  disc = A[2]*A[2] - 3*A[1]*A[3];
195  if ( ! ( CubicFailed = ( disc < 0 || A[3] == 0 ) ) )
196  {
197  dtmax = (-A[2]-sqrt(disc))/(3*A[3]);
198  if ( ! ( CubicFailed = ( dtmax < 0 || dtmax > 3 ) ) )
199  {
200  time = (float(it0) + dtmax) * 25.0 * nanosecond; // nsec
201  for(int ia = 0; ia < 4; ia++)
202  ADCPeak += A[ia] * pow(dtmax, ia);
203  }
204  }
205  }
207  ( "Flag: "
208  << CubicFailed
209  << " Mode: "
210  << m_mode
211  << " Signal: "
212  << ADCPeak
213  << " Peak: "
214  << maxADCPeak
215  );
216 
217  // fixed time slice or insufficient signal for cubic fit
218  if(m_mode == "FIXED" || CubicFailed )
219  {
220  ADCPeak = mySamples[m_imaxSamp];
221  time = (float(m_imaxSamp)+0.5) * 25.0 * nanosecond;
222  }
223 
224 
225  // Now must get subdetector ID and feed in here ...
226  float ADCtoMeV = 10.0;
227  const Identifier id = cabling->cnvToIdentifier(chid);
228  if (m_emId->is_em_barrel(id)) {
229  // m_emId->sampling(id);
230  ADCtoMeV = m_ADCtoMeVEMB[0];
231  ATH_MSG_DEBUG ( " in EMB s="<<m_emId->sampling(id)<<", using ADCtoMeV = " << ADCtoMeV );
232  } else if (m_emId->is_em_endcap_inner(id)) {
233  int samp = m_emId->sampling(id);
234  if (samp > 0) {
235  ADCtoMeV = m_ADCtoMeVEMECInner[samp-1];
236  ATH_MSG_DEBUG ( " in EMEC inner s="<<m_emId->sampling(id)<<", using ADCtoMeV = " << ADCtoMeV );
237  }
238  } else if (m_emId->is_em_endcap_outer(id)) {
239  int samp = m_emId->sampling(id);
240  if (samp > 0) {
241  ADCtoMeV = m_ADCtoMeVEMECOuter[samp-1];
242  ATH_MSG_DEBUG ( " in EMEC outer s="<<m_emId->sampling(id)<<", using ADCtoMeV = " << ADCtoMeV );
243  }
244  } else if (m_fcalId->is_lar_fcal(id)) {
245  int module = m_fcalId->module(id);
246  if (module > 0) {
247  ADCtoMeV = m_ADCtoMeVFCAL[module-1];
248  ATH_MSG_DEBUG ( " in FCAL m=" << m_fcalId->module(id)<<", using ADCtoMeV = " << ADCtoMeV );
249  }
250  } else if (m_hecId->is_lar_hec(id)) {
251  // m_layer[m_cellIndex]=m_hecId->sampling(id);
252  ADCtoMeV = m_ADCtoMeVHEC[0];
253  ATH_MSG_DEBUG ( " in HEC s="<<m_hecId->sampling(id)<<", using ADCtoMeV = " << ADCtoMeV );
254  }
255 
256  float Energy = ADCPeak * ADCtoMeV * GainFactor;
257  uint16_t quality=0;
258  uint16_t provenance=0x2000;
259 
260  //Make LArRawChannel Object with new data
261  LArRawChannel larRawChannel(chid,(int)Energy,(int)time,quality, provenance, gain);
262  larRawChannelContainer->add(larRawChannel); //Add to container
263 
264  }// End loop over LArDigits
265 
266  ATH_MSG_DEBUG ( "Finished loop over Digit Container " );
267 
268  // larRawChannelContainer->print();
269 
270  ATH_MSG_DEBUG ( "sorted RawChannelContainer, now lock it " );
271  // lock raw channel container
272  ATH_CHECK( evtStore()->setConst(larRawChannelContainer) );
273 
274  return StatusCode::SUCCESS;
275 }

◆ 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 TBLArRawChannelBuilder::finalize ( )
overridevirtual

Definition at line 277 of file TBLArRawChannelBuilder.cxx.

278 {
279  ATH_MSG_INFO ( "TBLArRawChannelBuilder finished." );
280  return StatusCode::SUCCESS;
281 }

◆ initialize()

StatusCode TBLArRawChannelBuilder::initialize ( )
overridevirtual

Definition at line 38 of file TBLArRawChannelBuilder.cxx.

38  {
39  ATH_MSG_DEBUG ( "In Initialize." );
40 
41  const CaloCell_ID* caloId = nullptr;
42  ATH_CHECK( detStore()->retrieve (caloId, "CaloCell_ID") );
43  m_emId=caloId->em_idHelper();
44  m_fcalId=caloId->fcal_idHelper();
45  m_hecId=caloId->hec_idHelper();
46 
48 
49  ATH_CHECK( detStore()->retrieve(m_onlineHelper, "LArOnlineID") );
50 
51  m_ADCtoMeVFCAL[0] = 87.0 * MeV; // FCAL1 High gain
52  m_ADCtoMeVFCAL[1] = 117.0 * MeV; // FCAL2 High gain
53  m_ADCtoMeVFCAL[2] = 193.0 * MeV; // FCAL3 High gain
54  m_ADCtoMeVHEC[0] = 136.0 / 9.8 * MeV; // HEC 1 Medium gain from Monika. Need / 9.8 ??
55  m_ADCtoMeVHEC[1] = 136.0 / 9.8 * MeV; // HEC 2 Medium gain from Monika. Need / 9.8 ??
56  m_ADCtoMeVEMECInner[0] = 25.22 * MeV; // EMEC High gain from Pascal, approximate
57  m_ADCtoMeVEMECInner[1] = 19.4 * MeV; // EMEC High gain from Pascal, approximate
58  m_ADCtoMeVEMECOuter[0] = 16.0 * MeV; // EMEC High gain from Monika, approximate
59  m_ADCtoMeVEMECOuter[1] = 16.0 * MeV; // EMEC High gain from Monika, approximate
60  m_ADCtoMeVEMB[0] = 15.0 * MeV; // EMB High gain from Isabelle, approximate
61  m_ADCtoMeVEMB[1] = 15.0 * MeV; // EMB High gain from Isabelle, approximate
62 
63  return StatusCode::SUCCESS;
64 }

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

float TBLArRawChannelBuilder::m_ADCtoMeVEMB[2]
private

Definition at line 56 of file TBLArRawChannelBuilder.h.

◆ m_ADCtoMeVEMECInner

float TBLArRawChannelBuilder::m_ADCtoMeVEMECInner[2]
private

Definition at line 54 of file TBLArRawChannelBuilder.h.

◆ m_ADCtoMeVEMECOuter

float TBLArRawChannelBuilder::m_ADCtoMeVEMECOuter[2]
private

Definition at line 55 of file TBLArRawChannelBuilder.h.

◆ m_ADCtoMeVFCAL

float TBLArRawChannelBuilder::m_ADCtoMeVFCAL[3]
private

Definition at line 52 of file TBLArRawChannelBuilder.h.

◆ m_ADCtoMeVHEC

float TBLArRawChannelBuilder::m_ADCtoMeVHEC[2]
private

Definition at line 53 of file TBLArRawChannelBuilder.h.

◆ m_cablingKey

SG::ReadCondHandleKey<LArOnOffIdMapping> TBLArRawChannelBuilder::m_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
private

Definition at line 37 of file TBLArRawChannelBuilder.h.

◆ m_ChannelContainerName

std::string TBLArRawChannelBuilder::m_ChannelContainerName
private

Definition at line 47 of file TBLArRawChannelBuilder.h.

◆ m_cubicAdcCut

float TBLArRawChannelBuilder::m_cubicAdcCut
private

Definition at line 50 of file TBLArRawChannelBuilder.h.

◆ m_DataLocation

std::string TBLArRawChannelBuilder::m_DataLocation
private

Definition at line 47 of file TBLArRawChannelBuilder.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_emId

const LArEM_ID* TBLArRawChannelBuilder::m_emId
private

Definition at line 39 of file TBLArRawChannelBuilder.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_fcalId

const LArFCAL_ID* TBLArRawChannelBuilder::m_fcalId
private

Definition at line 40 of file TBLArRawChannelBuilder.h.

◆ m_hecId

const LArHEC_ID* TBLArRawChannelBuilder::m_hecId
private

Definition at line 41 of file TBLArRawChannelBuilder.h.

◆ m_imaxSamp

int TBLArRawChannelBuilder::m_imaxSamp
private

Definition at line 48 of file TBLArRawChannelBuilder.h.

◆ m_iPedestal

unsigned int TBLArRawChannelBuilder::m_iPedestal
private

Definition at line 58 of file TBLArRawChannelBuilder.h.

◆ m_larRawOrdering

LArRawOrdering TBLArRawChannelBuilder::m_larRawOrdering
private

Definition at line 44 of file TBLArRawChannelBuilder.h.

◆ m_mode

std::string TBLArRawChannelBuilder::m_mode
private

Definition at line 49 of file TBLArRawChannelBuilder.h.

◆ m_onlineHelper

const LArOnlineID* TBLArRawChannelBuilder::m_onlineHelper
private

Definition at line 42 of file TBLArRawChannelBuilder.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
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
python.SystemOfUnits.nanosecond
int nanosecond
Definition: SystemOfUnits.py:119
CaloCell_ID::em_idHelper
const LArEM_ID * em_idHelper() const
access to EM idHelper
Definition: CaloCell_ID.h:63
AtlasDetectorID::is_lar_fcal
bool is_lar_fcal(Identifier id) const
Definition: AtlasDetectorID.h:839
TBLArRawChannelBuilder::m_mode
std::string m_mode
Definition: TBLArRawChannelBuilder.h:49
LArEM_Base_ID::is_em_endcap_outer
bool is_em_endcap_outer(const Identifier id) const
test if the id belongs to the EM Endcap outer wheel
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Energy
std::vector< double > Energy
Definition: CalibHitToCaloCell.h:23
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
python.SystemOfUnits.MeV
int MeV
Definition: SystemOfUnits.py:154
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
skel.it
it
Definition: skel.GENtoEVGEN.py:396
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
LArFCAL_Base_ID::module
int module(const Identifier id) const
module [1,3]
LArEM_Base_ID::sampling
int sampling(const Identifier id) const
return sampling according to :
TBLArRawChannelBuilder::m_ADCtoMeVEMECInner
float m_ADCtoMeVEMECInner[2]
Definition: TBLArRawChannelBuilder.h:54
TBLArRawChannelBuilder::m_iPedestal
unsigned int m_iPedestal
Definition: TBLArRawChannelBuilder.h:58
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
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
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
CaloCell_ID::hec_idHelper
const LArHEC_ID * hec_idHelper() const
access to HEC idHelper
Definition: CaloCell_ID.h:69
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
TBLArRawChannelBuilder::m_ADCtoMeVHEC
float m_ADCtoMeVHEC[2]
Definition: TBLArRawChannelBuilder.h:53
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
TBLArRawChannelBuilder::m_cubicAdcCut
float m_cubicAdcCut
Definition: TBLArRawChannelBuilder.h:50
python.PyAthena.module
module
Definition: PyAthena.py:131
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
A
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
TBLArRawChannelBuilder::m_ADCtoMeVEMB
float m_ADCtoMeVEMB[2]
Definition: TBLArRawChannelBuilder.h:56
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
TBLArRawChannelBuilder::m_imaxSamp
int m_imaxSamp
Definition: TBLArRawChannelBuilder.h:48
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
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
TBLArRawChannelBuilder::m_ADCtoMeVFCAL
float m_ADCtoMeVFCAL[3]
Definition: TBLArRawChannelBuilder.h:52
LArRawChannelContainer::add
void add(const LArRawChannel &rc)
Definition: LArRawChannelContainer.h:35
lumiFormat.i
int i
Definition: lumiFormat.py:85
LArRawChannel
Liquid Argon ROD output object base class.
Definition: LArRawChannel.h:40
LArRawChannelContainer
Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Old LArRawChannelContainer
Definition: LArTPCnv.cxx:86
TBLArRawChannelBuilder::m_DataLocation
std::string m_DataLocation
Definition: TBLArRawChannelBuilder.h:47
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TBLArRawChannelBuilder::m_onlineHelper
const LArOnlineID * m_onlineHelper
Definition: TBLArRawChannelBuilder.h:42
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TBLArRawChannelBuilder::m_hecId
const LArHEC_ID * m_hecId
Definition: TBLArRawChannelBuilder.h:41
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TBLArRawChannelBuilder::m_ChannelContainerName
std::string m_ChannelContainerName
Definition: TBLArRawChannelBuilder.h:47
AtlasDetectorID::is_lar_hec
bool is_lar_hec(Identifier id) const
Definition: AtlasDetectorID.h:829
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::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
TBLArRawChannelBuilder::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition: TBLArRawChannelBuilder.h:37
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
CaloGain::LARHIGHGAIN
@ LARHIGHGAIN
Definition: CaloGain.h:18
LArEM_Base_ID::is_em_endcap_inner
bool is_em_endcap_inner(const Identifier id) const
test if the id belongs to the EM Endcap inner wheel
CaloGain::CaloGain
CaloGain
Definition: CaloGain.h:11
CaloGain::LARMEDIUMGAIN
@ LARMEDIUMGAIN
Definition: CaloGain.h:18
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
a
TList * a
Definition: liststreamerinfos.cxx:10
h
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
LArEM_Base_ID::is_em_barrel
bool is_em_barrel(const Identifier id) const
test if the id belongs to the EM barrel
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
LArHEC_Base_ID::sampling
int sampling(const Identifier id) const
return sampling [0,3] (only 0 for supercells)
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
TBLArRawChannelBuilder::m_ADCtoMeVEMECOuter
float m_ADCtoMeVEMECOuter[2]
Definition: TBLArRawChannelBuilder.h:55
LArDigitContainer
Container class for LArDigit.
Definition: LArDigitContainer.h:24
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
LArDigits2NtupleDumper.nSamples
nSamples
Definition: LArDigits2NtupleDumper.py:70
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
CaloGain::LARLOWGAIN
@ LARLOWGAIN
Definition: CaloGain.h:18
TBLArRawChannelBuilder::m_fcalId
const LArFCAL_ID * m_fcalId
Definition: TBLArRawChannelBuilder.h:40
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
readCCLHist.float
float
Definition: readCCLHist.py:83
CaloCell_ID::fcal_idHelper
const LArFCAL_ID * fcal_idHelper() const
access to FCAL idHelper
Definition: CaloCell_ID.h:75
fitman.k
k
Definition: fitman.py:528
LArRawChannelContainer
Container for LArRawChannel (IDC using LArRawChannelCollection)
Definition: LArRawChannelContainer.h:26
ServiceHandle< ICondSvc >
LArOnOffIdMapping
Definition: LArOnOffIdMapping.h:20
Identifier
Definition: IdentifierFieldParser.cxx:14
TBLArRawChannelBuilder::m_emId
const LArEM_ID * m_emId
Definition: TBLArRawChannelBuilder.h:39