ATLAS Offline Software
PixelRDO_ContainerCnv_p0.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
10 
11 #include "MsgUtil.h"
12 
13 #include <string>
14 #include <iostream>
15 #include <sstream>
16 
17 
18 //================================================================
20  std::unique_ptr<PixelRDO_Container> trans(std::make_unique<PixelRDO_Container>(m_pixId->wafer_hash_max()));
21 
22  MSG_DEBUG(log,"Read RDO vector, size " << persObj->size());
23 
26  for (; it != last; ++it) {
27 
28  // Old persistent format used collection templated on the specific raw data type
29  const InDetRawDataCollection<Pixel1RawData>* rdoCollOld = *it;
30 
31  if(!rdoCollOld) {
32  throw std::runtime_error("Got NULL collection reading old format PixelRDO_Container");
33  }
34 
35  // Ugly cast... The new format does not need it in its converters.
36  const InDetRawDataCollection<PixelRDORawData>* rdoColl = reinterpret_cast<const InDetRawDataCollection<PixelRDORawData> *>(rdoCollOld);
37 
38  // Add to the container
39  if (trans->addCollection( rdoColl, rdoColl->identifyHash() ).isFailure()) {
40  log << MSG::FATAL << "[p0] Pixel RDOs could not be added to the container!" << endmsg;
41  throw std::runtime_error("PixelRDO_ContainerCnv_p0::createTransient(): Pixel RDOs could not be added to the container!");
42  }
43  }
44 
45  return(trans.release());
46 }
47 
48 //================================================================
49 
50 
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
PixelRDO_ContainerCnv_p0::m_pixId
const PixelID * m_pixId
Definition: PixelRDO_ContainerCnv_p0.h:20
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
IdentifiableContainerMT::addCollection
virtual StatusCode addCollection(const T *coll, IdentifierHash hashId) override final
insert collection into container with id hash if IDC should not take ownership of collection,...
Definition: IdentifiableContainerMT.h:300
skel.it
it
Definition: skel.GENtoEVGEN.py:396
InDetRawDataContainer
Definition: InDetRawDataContainer.h:27
InDetRawDataCollection::identifyHash
virtual IdentifierHash identifyHash() const override final
PixelRDO_Collection.h
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
InDetRawDataCollection
Definition: InDetRawDataCollection.h:31
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
PixelID::wafer_hash_max
size_type wafer_hash_max(void) const
Definition: PixelID.cxx:907
PixelRDO_Container.h
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
PixelRDO_ContainerCnv_p0::createTransient
virtual PixelRDO_Container * createTransient(const PixelRDO_Container_p0 *persObj, MsgStream &log)
Definition: PixelRDO_ContainerCnv_p0.cxx:19
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
MSG_DEBUG
#define MSG_DEBUG(log, x)
Definition: MsgUtil.h:15
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
PixelRDO_ContainerCnv_p0.h
MsgUtil.h