ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
JiveXML::CaloMBTSRetriever Class Reference

Retrieves all Calo Cluster objects. More...

#include <CaloMBTSRetriever.h>

Inheritance diagram for JiveXML::CaloMBTSRetriever:
Collaboration diagram for JiveXML::CaloMBTSRetriever:

Public Member Functions

 CaloMBTSRetriever (const std::string &type, const std::string &name, const IInterface *parent)
 Standard Constructor. More...
 
virtual StatusCode retrieve (ToolHandle< IFormatTool > &FormatTool)
 Retrieve all the data. More...
 
const DataMap getMBTSData (const TileCellContainer *tileMBTSCellContainer)
 Retrieve MBTS cell location and details. More...
 
virtual std::string dataTypeName () const
 Return the name of the data type. More...
 
StatusCode initialize ()
 Default AthAlgTool methods. 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 sysInitialize () override
 Perform system initialization for an algorithm. 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
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 Return the interface identifier. More...
 

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

ToolHandle< TileCondToolTimingm_tileToolTiming
 
ToolHandle< TileCondToolEmscalem_tileToolEmscale
 
const TileTBIDm_tileTBID
 
SG::ReadHandleKey< TileCellContainerm_sgKeyMBTS {this, "StoreGateKey", "MBTSContainer", "Name of the TileCellContainer"}
 properties: More...
 
SG::ReadHandleKey< TileDigitsContainerm_sgKeyTileDigits {this, "TileDigitsContainerKey", "", "Name of the TileDigitsContainer"}
 
SG::ReadHandleKey< TileRawChannelContainerm_sgKeyTileRawChannel {this, "TileRawChannelContainerKey", "", "Name of the TileRawChannelContainer"}
 
double m_mbtsThreshold
 
bool m_mbts
 
bool m_mbtsdigit
 
bool m_mbtsCellDetails
 
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

Retrieves all Calo Cluster objects.

Definition at line 46 of file CaloMBTSRetriever.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ CaloMBTSRetriever()

JiveXML::CaloMBTSRetriever::CaloMBTSRetriever ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Standard Constructor.

This is the standard AthAlgTool constructor.

Parameters
typeAlgTool type name
nameAlgTool instance name
parentAlgTools parent owning this tool

Definition at line 30 of file CaloMBTSRetriever.cxx.

30  :
32  m_tileTBID(nullptr)
33  {
34  //Only declare the interface
35  declareInterface<IDataRetriever>(this);
36 
37  declareProperty("MBTSThreshold", m_mbtsThreshold = 0.05);
38  declareProperty("RetrieveMBTS" , m_mbts = true);
39  declareProperty("DoMBTSDigits", m_mbtsdigit=false);
40  declareProperty("DoMBTSCellDetails", m_mbtsCellDetails = false);
41 
42  // TileDigitsContainer names: {"TileDigitsCnt","TileDigitsFlt"};
43  declareProperty("TileDigitsContainer" ,m_sgKeyTileDigits = "",
44  "Input collection to retrieve Tile digits, used when doTileDigit is True");
45 
46  // TileRawChannelContainer names: {"TileRawChannelOpt2","TileRawChannelOpt","TileRawChannelFixed",
47  // "TileRawChannelFitCool","TileRawChannelFit",
48  // "TileRawChannelCnt","TileRawChannelFlt"};
49  declareProperty("TileRawChannelContainer" ,m_sgKeyTileRawChannel = "",
50  "Input collection to retrieve Tile raw channels, used when DoMBTSCellDetails is True.");
51  }

Member Function Documentation

◆ dataTypeName()

virtual std::string JiveXML::CaloMBTSRetriever::dataTypeName ( ) const
inlinevirtual

Return the name of the data type.

Implements JiveXML::IDataRetriever.

Definition at line 59 of file CaloMBTSRetriever.h.

59 { return "MBTS"; };

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::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

◆ getMBTSData()

const DataMap JiveXML::CaloMBTSRetriever::getMBTSData ( const TileCellContainer tileMBTSCellContainer)

Retrieve MBTS cell location and details.

Parameters
FormatToolthe tool that will create formated output from the DataMap

< Unit for TileRawChannels (ADC, pCb, etc.)

Definition at line 104 of file CaloMBTSRetriever.cxx.

104  {
105 
106  ATH_MSG_DEBUG( "getMBTSData()" );
107 
109 
110  DataVect energy; energy.reserve(tileMBTSCellContainer->size());
111  DataVect label; label.reserve(tileMBTSCellContainer->size());
112  DataVect phi; phi.reserve(tileMBTSCellContainer->size());
113  DataVect eta; eta.reserve(tileMBTSCellContainer->size());
114  DataVect sampling; sampling.reserve(tileMBTSCellContainer->size());
115  DataVect timeVec; timeVec.reserve(tileMBTSCellContainer->size());
116  DataVect quality; quality.reserve(tileMBTSCellContainer->size());
117  DataVect type; type.reserve(tileMBTSCellContainer->size());
118  DataVect channel; channel.reserve(tileMBTSCellContainer->size());
119  DataVect module; module.reserve(tileMBTSCellContainer->size());
120  DataVect cellPedestal; cellPedestal.reserve(tileMBTSCellContainer->size());
121  DataVect cellRawAmplitude; cellRawAmplitude.reserve(tileMBTSCellContainer->size());
122  DataVect cellRawTime; cellRawTime.reserve(tileMBTSCellContainer->size());
123  DataVect adcCounts; adcCounts.reserve(tileMBTSCellContainer->size() * 10);
124 
125  std::string adcCountsStr="adcCounts multiple=\"0\"";
126  const TileHWID* tileHWID = nullptr;
127  const TileInfo* tileInfo = nullptr;
128  const TileCablingService* cabling=nullptr;
131  bool offlineRch = false;
132 
133  if ( detStore()->retrieve(m_tileTBID).isFailure() ) {
134  ATH_MSG_ERROR( "in getMBTSData(), Could not retrieve m_tileTBID" );
135  }
136 
137  if ( detStore()->retrieve(tileHWID).isFailure() ) {
138  ATH_MSG_ERROR( "in getMBTSData(), Could not retrieve TileHWID" );
139  }
140 
141  if ( detStore()->retrieve(tileInfo, "TileInfo").isFailure() ) {
142  ATH_MSG_ERROR( "in getMBTSData(), Could not retrieve TileInfo" );
143  }
144 
146  if (m_mbtsCellDetails) {
147  RawChannelCnt = SG::makeHandle(m_sgKeyTileRawChannel);
148  if (!RawChannelCnt.isValid()){
149  ATH_MSG_WARNING( "Could not retrieve TileRawChannel " );
150  }
151  else{
152  RChUnit = RawChannelCnt->get_unit();
153  offlineRch = (RChUnit<TileRawChannelUnit::OnlineADCcounts &&
154  RawChannelCnt->get_type() != TileFragHash::OptFilterDsp);
155  }
156  }
157 
159  if (m_mbtsdigit) {
160  tileDigits = SG::makeHandle(m_sgKeyTileDigits);
161  if (!tileDigits.isValid()){
162  ATH_MSG_WARNING( "Could not retrieve TileDigits " );
163  }
164  }
165 
166  // from: TileCalorimeter/TileRec/src/TileCellToNtuple.cxx
167 
168  std::string MBTS_ID;
169  int nchan =0;
170  int nTileSamples=0;
171  const int max_chan=5216;
172  double energyMeV = 0.;
173  double phiMBTS = 0.;
174  double amplitude = 0.;
175  unsigned long int cellid;
176  std::map<unsigned long int,double> theMbtspedestal;
177  std::map<unsigned long int,double> theMbtsrawamp;
178  std::map<unsigned long int,double> theMbtsrawtime;
179  std::map<unsigned long int,std::vector<float> > theMbtsdigit;
180  std::string myCellRawTimeStr = "0.";
181 
182  //Loop over TileRawChannel to get Pedestal and raw amplitude and time
183 
184  if (m_mbtsCellDetails && RawChannelCnt.isValid()) {
185  if (offlineRch) {
186 
187  for (const auto rawChannel : *RawChannelCnt) {
188 
189  for (const auto cell : *rawChannel) {
190 
191  Identifier pmt_id = cell->pmt_ID();
192  if (!m_tileTBID->is_tiletb(pmt_id)) continue;
193 
194  Identifier id = cell->cell_ID();
195  cellid = id.get_identifier32().get_compact();
196  HWIdentifier hwid=cell->adc_HWID();
197  int adc = tileHWID->adc(hwid);
198  int channel = tileHWID->channel(hwid);
199  int drawer = tileHWID->drawer(hwid);
200  int ros = tileHWID->ros(hwid);
201  int drawerIdx = TileCalibUtils::getDrawerIdx(ros,drawer);
202 
203  amplitude = cell->amplitude();
204  //Change amplitude units to ADC counts
206  amplitude /= m_tileToolEmscale->channelCalib(drawerIdx, channel, adc, 1.0, TileRawChannelUnit::ADCcounts, RChUnit);
207  } else if (RChUnit > TileRawChannelUnit::OnlineADCcounts) {
208  amplitude = m_tileToolEmscale->undoOnlCalib(drawerIdx, channel, adc, amplitude, RChUnit);
209  }
210 
211  theMbtspedestal.insert(std::make_pair( cellid, cell->pedestal() ) );
212  theMbtsrawamp.insert(std::make_pair( cellid, amplitude ));
213  theMbtsrawtime.insert(std::make_pair( cellid, cell->time(cell->uncorrTime()) ));
214  break;
215 
216  }
217  }
218  }
219  }
220 
221  //Loop over TileDigits to retrieve MBTS digits
222 
223  if (m_mbtsdigit && tileDigits.isValid()) {
224 
225  //----- get tile digits--------------------------
226 
227  // tile digits loop
228  for (const auto digitChannel : *tileDigits) {
229 
230  for (const auto cell : *digitChannel) {
231 
232  Identifier pmt_id = cell->pmt_ID();
233  if (!m_tileTBID->is_tiletb(pmt_id)) continue;
234 
235  Identifier id = cell->cell_ID();
236  cellid = id.get_identifier32().get_compact();
237 
238  nTileSamples = cell->NtimeSamples();
239  std::vector<float> tileSamples = cell->samples();
240  theMbtsdigit.insert(std::make_pair( cellid, tileSamples));
241  break;
242 
243  }
244  }//for TileDigitContainer loop
245  } //if (m_mbtsdigit)
246 
247  //Loop Over TileCellContainer to retrieve MBTSCell information
248 
249  for (const auto cell : *tileMBTSCellContainer) {
250 
251  int qual = cell->quality();
252  if (cell->badcell()) qual = -qual;
253 
254  timeVec.push_back(DataType( cell->time() ));
255  quality.push_back(DataType( qual ));
256 
257  if ( cell->energy() >= m_mbtsThreshold ) {
258  energyMeV = cell->energy(); // roughly correct: energy unit is pC, which is 95% MeV
259  }else{
260  energyMeV = 0.;
261  }
262  energy.push_back(DataType( energyMeV )); // write in MeV
263 
264  Identifier id=cell->ID();
265 
266  //TileCell/type is "side" +/- 1
267  //TileCell/module is "phi" 0-7
268  //TileCell/channel is "eta" 0-1 zero is closer to beam pipe
269 
270  type.push_back(DataType( m_tileTBID->type(id) ));
271  channel.push_back(DataType( m_tileTBID->channel(id) ));
272  module.push_back(DataType( m_tileTBID->module(id) ));
273 
274  MBTS_ID = "type_" + DataType( m_tileTBID->type(id) ).toString() + "_ch_" +
275  DataType( m_tileTBID->channel(id) ).toString() + "_mod_" +
276  DataType( m_tileTBID->module(id) ).toString();
277 
278  label.push_back(DataType( MBTS_ID ));
279 
280  eta.push_back(DataType( 5.0*m_tileTBID->type(id) ));
281 
282  phiMBTS = (M_PI/8)+(2*M_PI/8)*int(m_tileTBID->module(id));
283  phi.push_back(DataType( phiMBTS ));
284  sampling.push_back(DataType( m_tileTBID->channel(id) ));
285 
286  if (m_mbtsCellDetails && RawChannelCnt.isValid()) {
287 
288  cellPedestal.push_back(DataType( theMbtspedestal[id.get_identifier32().get_compact()] ));
289  cellRawAmplitude.push_back(DataType( theMbtsrawamp[id.get_identifier32().get_compact()] ));
290  myCellRawTimeStr = DataType(theMbtsrawtime[id.get_identifier32().get_compact()]).toString();
291 
292  if ( myCellRawTimeStr.find("n") == 1 ) myCellRawTimeStr="0.";
293  cellRawTime.push_back( myCellRawTimeStr );
294 
295  // this can rarely be '-nan', but checking this each time may make code slow ?
296  }
297  else { // don't have TileRawChannel container (for DPF input)
298 
299  float maxTime = (tileInfo->NdigitSamples()/2) * 25;
300  int gain = cell->gain();
301 
302  if (gain<0 || gain>1) { //invalid gain - channel missing
303  cellRawAmplitude.push_back(DataType(0));
304  cellRawTime.push_back(DataType(0));
305  cellPedestal.push_back(DataType(0)); //There is no pedestal in DPD .
306  }
307  else {
308 
309  HWIdentifier hwid = tileHWID->adc_id(cabling->s2h_channel_id(id),gain);
310  int adc = tileHWID->adc(hwid);
311  int channel = tileHWID->channel(hwid);
312  int drawer = tileHWID->drawer(hwid);
313  int ros = tileHWID->ros(hwid);
314  int drawerIdx = TileCalibUtils::getDrawerIdx(ros,drawer);
315  float scale = m_tileToolEmscale->channelCalib(drawerIdx, channel, adc, 1.0,
317  float amp;
318 
319  if ( cell->energy() >= m_mbtsThreshold ) amp = cell->energy()/scale;
320  else amp = 0.0;
321  float time = cell->time();
322 
323  if ((qual != 0 || amp != 0.0) && (fabs(time) < maxTime && time != 0.0)) {
324  time += m_tileToolTiming->getSignalPhase(drawerIdx, channel, adc);
325  }
326 
327  cellRawAmplitude.push_back(DataType(amp));
328  cellRawTime.push_back(DataType(time));
329  cellPedestal.push_back(DataType(0)); //There is no pedestal in DPD . This line is temporary.
330  }
331  }
332 
333 
334  if (m_mbtsdigit && tileDigits.isValid()) {
335 
336  if ( !theMbtsdigit[id.get_identifier32().get_compact()].empty() ) {
337  for (int i=0; i<nTileSamples; i++) {
338  adcCountsStr="adcCounts multiple=\""+DataType(nTileSamples).toString()+"\"";
339  adcCounts.push_back(DataType( int(theMbtsdigit[id.get_identifier32().get_compact()][i]) ));
340  }
341  }
342  else {
343  for (int i=0; i<nTileSamples; i++) {
344  adcCountsStr="adcCounts multiple=\""+DataType(nTileSamples).toString()+"\"";
345  adcCounts.push_back(DataType(0));
346  }
347  }
348  }
349 
350 
351  ATH_MSG_DEBUG( "MBTS no: " << nchan << ", type_chan_mod: " << MBTS_ID
352  << ", energy MeV pC: " << energyMeV );
353 
354  nchan++;
355 
356  if (nchan >= max_chan) break;
357 
358  }//TileCell Loop
359 
360  if (!theMbtspedestal.empty()) theMbtspedestal.clear();
361  if (!theMbtsrawamp.empty() ) theMbtsrawamp.clear();
362  if (!theMbtsrawtime.empty()) theMbtsrawtime.clear();
363 
364  // write values into DataMap
365  DataMap["energy"] = energy;
366  DataMap["label"] = label;
367  DataMap["phi"] = phi;
368  DataMap["eta"] = eta;
369  DataMap["sampling"] = sampling;
370  DataMap["time"] = timeVec;
371  DataMap["quality"] = quality;
372  DataMap["type"] = type;
373  DataMap["channel"] = channel;
374  DataMap["module"] = module;
375  DataMap["cellPedestal"] = cellPedestal;
376  DataMap["cellRawAmplitude"] = cellRawAmplitude;
377  DataMap["cellRawTime"] = cellRawTime;
378  DataMap[adcCountsStr] = adcCounts;
379 
380  //Be verbose
381  ATH_MSG_DEBUG( dataTypeName() << " retrieved with " << phi.size() << " entries" );
382 
383  //All collections retrieved okay
384  return DataMap;
385 
386  } // getMBTSData

◆ initialize()

StatusCode JiveXML::CaloMBTSRetriever::initialize ( )

Default AthAlgTool methods.

Initialise the ToolSvc.

Definition at line 57 of file CaloMBTSRetriever.cxx.

57  {
58 
59  ATH_MSG_DEBUG( "Initialising Tool" );
60 
61  ATH_CHECK(m_sgKeyMBTS.initialize());
62 
63  //=== get TileCondToolTiming
64  ATH_CHECK( m_tileToolTiming.retrieve() );
65 
66  //=== get TileCondToolEmscale
67  ATH_CHECK( m_tileToolEmscale.retrieve() );
68 
70 
72 
73  return StatusCode::SUCCESS;
74  }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ interfaceID()

const InterfaceID & JiveXML::IDataRetriever::interfaceID ( )
inlinestaticinherited

Return the interface identifier.

Definition at line 40 of file IDataRetriever.h.

40 { return IID_IDataRetriever; }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::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< AlgTool >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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  }

◆ retrieve()

StatusCode JiveXML::CaloMBTSRetriever::retrieve ( ToolHandle< IFormatTool > &  FormatTool)
virtual

Retrieve all the data.

MBTS data retrieval from chosen collection.

Implements JiveXML::IDataRetriever.

Definition at line 79 of file CaloMBTSRetriever.cxx.

79  {
80 
81  ATH_MSG_DEBUG( "in retrieve()" );
82 
84  if (!cellContainerMBTS.isValid()){
85  ATH_MSG_WARNING( "Could not retrieve MBTS Cells " );
86  }
87  else{
88  if (m_mbts) {
89  DataMap data = getMBTSData(&(*cellContainerMBTS));
90  ATH_CHECK( FormatTool->AddToEvent(dataTypeName(), m_sgKeyMBTS.key(), &data) );
91  ATH_MSG_DEBUG( "MBTS retrieved" );
92  }
93  }
94 
95  //MBTS cells retrieved okay
96  return StatusCode::SUCCESS;
97  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_mbts

bool JiveXML::CaloMBTSRetriever::m_mbts
private

Definition at line 78 of file CaloMBTSRetriever.h.

◆ m_mbtsCellDetails

bool JiveXML::CaloMBTSRetriever::m_mbtsCellDetails
private

Definition at line 80 of file CaloMBTSRetriever.h.

◆ m_mbtsdigit

bool JiveXML::CaloMBTSRetriever::m_mbtsdigit
private

Definition at line 79 of file CaloMBTSRetriever.h.

◆ m_mbtsThreshold

double JiveXML::CaloMBTSRetriever::m_mbtsThreshold
private

Definition at line 77 of file CaloMBTSRetriever.h.

◆ m_sgKeyMBTS

SG::ReadHandleKey<TileCellContainer> JiveXML::CaloMBTSRetriever::m_sgKeyMBTS {this, "StoreGateKey", "MBTSContainer", "Name of the TileCellContainer"}
private

properties:

Definition at line 74 of file CaloMBTSRetriever.h.

◆ m_sgKeyTileDigits

SG::ReadHandleKey<TileDigitsContainer> JiveXML::CaloMBTSRetriever::m_sgKeyTileDigits {this, "TileDigitsContainerKey", "", "Name of the TileDigitsContainer"}
private

Definition at line 75 of file CaloMBTSRetriever.h.

◆ m_sgKeyTileRawChannel

SG::ReadHandleKey<TileRawChannelContainer> JiveXML::CaloMBTSRetriever::m_sgKeyTileRawChannel {this, "TileRawChannelContainerKey", "", "Name of the TileRawChannelContainer"}
private

Definition at line 76 of file CaloMBTSRetriever.h.

◆ m_tileTBID

const TileTBID* JiveXML::CaloMBTSRetriever::m_tileTBID
private

Definition at line 71 of file CaloMBTSRetriever.h.

◆ m_tileToolEmscale

ToolHandle<TileCondToolEmscale> JiveXML::CaloMBTSRetriever::m_tileToolEmscale
private
Initial value:
{this,
"TileCondToolEmscale", "TileCondToolEmscale", "Tile EM scale calibration tool"}

Definition at line 68 of file CaloMBTSRetriever.h.

◆ m_tileToolTiming

ToolHandle<TileCondToolTiming> JiveXML::CaloMBTSRetriever::m_tileToolTiming
private
Initial value:
{this,
"TileCondToolTiming", "TileCondToolTiming", "Tile timing tool"}

Definition at line 65 of file CaloMBTSRetriever.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
JiveXML::CaloMBTSRetriever::m_tileTBID
const TileTBID * m_tileTBID
Definition: CaloMBTSRetriever.h:71
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
TileTBID::is_tiletb
bool is_tiletb(const Identifier &id) const
Test ID if it is TileTBID.
Definition: TileTBID.cxx:86
TileCablingService::getInstance
static const TileCablingService * getInstance()
get pointer to service instance
Definition: TileCablingService.cxx:24
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
TileInfo::NdigitSamples
int NdigitSamples() const
Returns the number of sammples (digits) per event.
Definition: TileInfo.h:75
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
JiveXML::CaloMBTSRetriever::m_sgKeyTileDigits
SG::ReadHandleKey< TileDigitsContainer > m_sgKeyTileDigits
Definition: CaloMBTSRetriever.h:75
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
JiveXML::DataVect
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
Definition: DataType.h:58
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
DataType
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType
Definition: RoIBResultByteStreamTool.cxx:25
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
M_PI
#define M_PI
Definition: ActiveFraction.h:11
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
PlotCalibFromCool.nchan
nchan
Definition: PlotCalibFromCool.py:564
JiveXML::CaloMBTSRetriever::m_mbts
bool m_mbts
Definition: CaloMBTSRetriever.h:78
TileRawChannelUnit::OnlineADCcounts
@ OnlineADCcounts
Definition: TileRawChannelUnit.h:21
TileInfo
Definition: TileInfo.h:49
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
TileTBID::type
int type(const Identifier &id) const
extract type field from TileTB identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:146
JiveXML::DataMap
std::map< std::string, DataVect > DataMap
Definition: DataType.h:59
HWIdentifier
Definition: HWIdentifier.h:13
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
TileFragHash::OptFilterDsp
@ OptFilterDsp
Definition: TileFragHash.h:34
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
Example_ReadSampleNoise.drawer
drawer
Definition: Example_ReadSampleNoise.py:39
TileTBID::module
int module(const Identifier &id) const
extract module field from TileTB identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:150
TileHWID::channel
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
Definition: TileHWID.h:189
AthCommonDataStore< AthCommonMsg< AlgTool > >::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
TileHWID::ros
int ros(const HWIdentifier &id) const
extract ros field from HW identifier
Definition: TileHWID.h:167
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:269
python.PyAthena.module
module
Definition: PyAthena.py:134
TileHWID
Helper class for TileCal online (hardware) identifiers.
Definition: TileHWID.h:49
JiveXML::CaloMBTSRetriever::m_mbtsdigit
bool m_mbtsdigit
Definition: CaloMBTSRetriever.h:79
TileHWID::adc
int adc(const HWIdentifier &id) const
extract adc field from HW identifier
Definition: TileHWID.h:193
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
lumiFormat.i
int i
Definition: lumiFormat.py:92
JiveXML::CaloMBTSRetriever::dataTypeName
virtual std::string dataTypeName() const
Return the name of the data type.
Definition: CaloMBTSRetriever.h:59
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TileRawChannelUnit::MegaElectronVolts
@ MegaElectronVolts
Definition: TileRawChannelUnit.h:20
test_pyathena.parent
parent
Definition: test_pyathena.py:15
JiveXML::CaloMBTSRetriever::m_tileToolEmscale
ToolHandle< TileCondToolEmscale > m_tileToolEmscale
Definition: CaloMBTSRetriever.h:68
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< AlgTool > >::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
maskDeadModules.ros
ros
Definition: maskDeadModules.py:35
TileCablingService
Definition: TileCablingService.h:23
TileRawChannelUnit::UNIT
UNIT
Definition: TileRawChannelUnit.h:16
TileTBID::channel
int channel(const Identifier &id) const
extract channel field from TileTB identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:154
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
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
JiveXML::CaloMBTSRetriever::retrieve
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.
Definition: CaloMBTSRetriever.cxx:79
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
JiveXML::CaloMBTSRetriever::m_sgKeyMBTS
SG::ReadHandleKey< TileCellContainer > m_sgKeyMBTS
properties:
Definition: CaloMBTSRetriever.h:74
TileRawDataContainer::get_type
TYPE get_type() const
Definition: TileRawDataContainer.h:62
JiveXML::CaloMBTSRetriever::m_tileToolTiming
ToolHandle< TileCondToolTiming > m_tileToolTiming
Definition: CaloMBTSRetriever.h:65
TileHWID::adc_id
HWIdentifier adc_id(int ros, int drawer, int channel, int adc) const
adc HWIdentifer
Definition: TileHWID.cxx:228
JiveXML::CaloMBTSRetriever::m_sgKeyTileRawChannel
SG::ReadHandleKey< TileRawChannelContainer > m_sgKeyTileRawChannel
Definition: CaloMBTSRetriever.h:76
a
TList * a
Definition: liststreamerinfos.cxx:10
JiveXML::CaloMBTSRetriever::getMBTSData
const DataMap getMBTSData(const TileCellContainer *tileMBTSCellContainer)
Retrieve MBTS cell location and details.
Definition: CaloMBTSRetriever.cxx:104
h
TileHWID::drawer
int drawer(const HWIdentifier &id) const
extract drawer field from HW identifier
Definition: TileHWID.h:171
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
ReadFloatFromCool.adc
adc
Definition: ReadFloatFromCool.py:48
TileRawDataContainer::get_unit
UNIT get_unit() const
Definition: TileRawDataContainer.h:60
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
max_chan
const int max_chan
Definition: TileCellIDCToNtuple.cxx:35
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
JiveXML::CaloMBTSRetriever::m_mbtsCellDetails
bool m_mbtsCellDetails
Definition: CaloMBTSRetriever.h:80
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
beamspotman.qual
qual
Definition: beamspotman.py:481
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
TileCalibUtils::getDrawerIdx
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
Definition: TileCalibUtils.cxx:60
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
TileRawChannelUnit::ADCcounts
@ ADCcounts
Definition: TileRawChannelUnit.h:17
fitman.k
k
Definition: fitman.py:528
JiveXML::CaloMBTSRetriever::m_mbtsThreshold
double m_mbtsThreshold
Definition: CaloMBTSRetriever.h:77