2   Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
 
    5 // implementation of TileRawDataContainer 
 
    7 #include "AthenaKernel/errorcheck.h"
 
    8 #include "Identifier/IdentifierHash.h"
 
    9 #include "TileConditions/TileCablingService.h"
 
   15 template <typename TCOLLECTION> 
 
   16 void TileRawDataContainer<TCOLLECTION>::initialize(bool createColl, TYPE type,
 
   17                                                     SG::OwnershipPolicy ownPolicy)
 
   19     // initialize HashFunc
 
   20     this->m_hashFunc.initialize(TileCablingService::getInstance()->getTileHWID(),type); 
 
   23         int ncoll = this->m_hashFunc.max();
 
   24         for(int i=0; i<ncoll;++i){
 
   25             TileFragHash::ID frag = this->m_hashFunc.identifier(i);
 
   26             TCOLLECTION * coll = new TCOLLECTION(frag,ownPolicy) ;
 
   27             StatusCode sc = this->addCollection(coll,static_cast<IdentifierHash>(i));
 
   29                 REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "TileRawDataContainer") <<
 
   30                     "Can not create collection for frag 0x" << MSG::hex << frag <<
 
   31                     " in container with CLID " << MSG::dec << this->clID() << endmsg;
 
   39 template <typename TCOLLECTION> 
 
   40 TileRawDataContainer<TCOLLECTION>::TileRawDataContainer(bool createColl,
 
   43                                                          SG::OwnershipPolicy ownPolicy)
 
   44     : MyBase(TileCablingService::getInstance()->getTileHWID()->drawer_hash_max())
 
   49     // initialize all the rest
 
   50     initialize(createColl,m_type,ownPolicy);
 
   54 template <typename TCOLLECTION> 
 
   55 TileRawDataContainer<TCOLLECTION>::TileRawDataContainer(bool createColl,
 
   56                                                          SG::OwnershipPolicy ownPolicy)
 
   57     : MyBase(TileCablingService::getInstance()->getTileHWID()->drawer_hash_max())
 
   58     , m_unit(TileRawChannelUnit::ADCcounts)
 
   59     , m_type(TileFragHash::Digitizer)
 
   62     // initialize all the rest
 
   63     initialize(createColl,m_type,ownPolicy); 
 
   68 template <typename TCOLLECTION> 
 
   69 void TileRawDataContainer<TCOLLECTION>::print() const
 
   71     std::cout << (std::string) (*this) << std::endl;
 
   74 template <typename TCOLLECTION> 
 
   75 TileRawDataContainer<TCOLLECTION>::operator std::string() const
 
   77     std::ostringstream text(std::ostringstream::out);
 
   80     text << " size = " << this->size() << std::endl;
 
   82     std::string result(text.str());
 
   83     std::string newline("\n");
 
   85     TContainer_const_iterator it1 = this->begin();
 
   86     TContainer_const_iterator it2 = this->end();
 
   88     const TCOLLECTION * coll;
 
   92         result += (std::string) (*coll) + newline;