ATLAS Offline Software
LArSimpleShapeDumper.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 
8 #include "GaudiKernel/MsgStream.h"
11 
12 
13 LArSimpleShapeDumper::LArSimpleShapeDumper(const std::string & name, ISvcLocator * pSvcLocator) :
14  AthAlgorithm(name, pSvcLocator),
15  m_onlineHelper(nullptr)
16 {
17 }
18 
19 
21 {
22 }
23 
24 
26 {
27  ATH_CHECK( detStore()->retrieve(m_onlineHelper, "LArOnlineID") );
28  ATH_CHECK( detStore()->regHandle(m_shape, "LArShape") );
29  return StatusCode::SUCCESS;
30 }
31 
32 
34 {
35  static bool first = true;
36  if (first) {
37  first = false;
38  if (!m_shape || !m_shape.cptr()) {
39  ATH_MSG_FATAL ( "Could not retrieve shape object, abort!" );
40  return StatusCode::FAILURE;
41  }
42  const LArShapeComplete* shapeObj = dynamic_cast<const LArShapeComplete*>(m_shape.cptr());
43  if (!shapeObj) {
44  ATH_MSG_FATAL ( "Shape object is not of type LArShapeComplete ?!" );
45  return StatusCode::FAILURE;
46  }
47  for (unsigned int k = 0; k < 195073; k++) {
49  for (int g = 0; g < 3; g++) {
51  if (shapeObj->nTimeBins(channelID, gain) == 0) {
53  ( "Shape object for channel " << k
54  << " (" << (m_onlineHelper->barrel_ec(channelID) ? "EMEC" : "EMB")
55  << "_" << (m_onlineHelper->pos_neg(channelID) ? "C" : "A")
56  << " FT = " << m_onlineHelper->feedthrough(channelID)
57  << ", slot = " << m_onlineHelper->slot(channelID)
58  << ", channel = " << m_onlineHelper->channel(channelID)
59  << ") and gain " << g << " has no shape data!" );
60  }
61  }
62  }
63  }
64  return StatusCode::SUCCESS;
65 }
66 
67 
69 {
70  return StatusCode::SUCCESS;
71 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
LArSimpleShapeDumper::LArSimpleShapeDumper
LArSimpleShapeDumper(const std::string &name, ISvcLocator *pSvcLocator)
Definition: LArSimpleShapeDumper.cxx:13
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
LArSimpleShapeDumper::finalize
virtual StatusCode finalize() override
Definition: LArSimpleShapeDumper.cxx:68
LArSimpleShapeDumper::~LArSimpleShapeDumper
~LArSimpleShapeDumper()
Definition: LArSimpleShapeDumper.cxx:20
DataHandle::cptr
const_pointer_type cptr() const
safer explicit ptr accessor
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
LArShapeComplete
This class implements the ILArShape interface.
Definition: LArShapeComplete.h:26
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:1961
LArSimpleShapeDumper.h
LArShapeComplete.h
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:1942
LArSimpleShapeDumper::execute
virtual StatusCode execute() override
Definition: LArSimpleShapeDumper.cxx:33
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
LArSimpleShapeDumper::m_onlineHelper
const LArOnlineID * m_onlineHelper
Definition: LArSimpleShapeDumper.h:44
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:1967
python.CaloCondTools.g
g
Definition: CaloCondTools.py:15
LArSimpleShapeDumper::initialize
virtual StatusCode initialize() override
Definition: LArSimpleShapeDumper.cxx:25
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArOnlineID_Base::channel_Id
HWIdentifier channel_Id(int barrel_ec, int pos_neg, int feedthrough, int slot, int channel) const
create channel identifier from fields
Definition: LArOnlineID_Base.cxx:1569
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:1954
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LArShapeComplete::nTimeBins
virtual unsigned nTimeBins(const HWIdentifier &CellID, int gain) const
Definition: LArShapeComplete.cxx:72
AthAlgorithm
Definition: AthAlgorithm.h:47
ILArShape.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
CaloGain::CaloGain
CaloGain
Definition: CaloGain.h:11
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:1948
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
DeMoScan.first
bool first
Definition: DeMoScan.py:534
IdentifierHash
Definition: IdentifierHash.h:38
LArSimpleShapeDumper::m_shape
const DataHandle< ILArShape > m_shape
Definition: LArSimpleShapeDumper.h:45
StoreGateSvc.h
fitman.k
k
Definition: fitman.py:528