ATLAS Offline Software
LArRawDetSelector.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 
9 #include "GaudiKernel/Bootstrap.h"
10 #include "GaudiKernel/ISvcLocator.h"
11 #include "GaudiKernel/MsgStream.h"
12 #include "GaudiKernel/IMessageSvc.h"
13 #include "StoreGate/StoreGateSvc.h"
14 
16  : m_onlineID(nullptr),
17  m_caloCellID(nullptr),
18  m_em(false),
19  m_hec(false),
20  m_fcal(false)
21 {
22 
23  ISvcLocator* svcLoc = Gaudi::svcLocator( );
24 
25  IMessageSvc* msgSvc;
26 
27  StatusCode sc=svcLoc->service("MessageSvc", msgSvc);
28  if (sc.isFailure()) {
29  std::cerr << "LArRawDetSelector: Could not get MessageSvc!" << std::endl;
30  return;
31  }
32 
33  MsgStream log(msgSvc,"LArRawDetSelector");
34 
35  StoreGateSvc* sg;
36  if(svcLoc->service( "DetectorStore",sg).isFailure()) {
37  log << MSG::ERROR << "Faild to get DetectorStore" << endmsg;
38  return;
39  }
40  if(sg->retrieve(m_onlineID).isFailure()) {
41  log << MSG::ERROR << "Faild to get LArOnlineID helper" << endmsg;
42  return;
43  }
44  if(sg->retrieve(m_caloCellID).isFailure()) {
45  log << MSG::ERROR << "Faild to get LArOnlineID helper" << endmsg;
46  return;
47  }
48  }
49 
51 
52  m_em = m_caloCellID->is_lar_em(id) ;
55 
56 }
57 
59 
61  m_hec = m_onlineID->isHECchannel(chid);
63 
64 }
65 
66 
67 
69 
70  const HWIdentifier chid=rc->identify();
71 
72  if(m_em && (m_onlineID->isEMBchannel(chid) || m_onlineID->isEMECchannel(chid))) return true;
73 
74  if(m_hec && m_onlineID->isHECchannel(chid)) return true;
75 
76  if(m_fcal && m_onlineID->isFCALchannel(chid)) return true;
77 
78  return false;
79 }
80 
LArRawDetSelector::m_em
bool m_em
Definition: LArRawDetSelector.h:37
LArRawDetSelector::select
virtual bool select(const LArRawChannel *rawchan)
Definition: LArRawDetSelector.cxx:68
AtlasDetectorID::is_lar_fcal
bool is_lar_fcal(Identifier id) const
Definition: AtlasDetectorID.h:839
LArRawDetSelector::setDet
void setDet(const Identifier &id)
Definition: LArRawDetSelector.cxx:50
LArRawDetSelector::m_caloCellID
const CaloCell_ID * m_caloCellID
Definition: LArRawDetSelector.h:36
LArRawDetSelector::m_fcal
bool m_fcal
Definition: LArRawDetSelector.h:39
HWIdentifier
Definition: HWIdentifier.h:13
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
StoreGateSvc::retrieve
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
LArRawDetSelector::m_hec
bool m_hec
Definition: LArRawDetSelector.h:38
LArOnlineID_Base::isFCALchannel
bool isFCALchannel(const HWIdentifier id) const
Definition: LArOnlineID_Base.cxx:1657
LArRawDetSelector::LArRawDetSelector
LArRawDetSelector(const LArRawChannelContainer *c=NULL)
Definition: LArRawDetSelector.cxx:15
AtlasDetectorID.h
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
LArOnlineID::isEMECchannel
bool isEMECchannel(const HWIdentifier id) const override final
Definition: LArOnlineID.cxx:774
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
LArRawChannel
Liquid Argon ROD output object base class.
Definition: LArRawChannel.h:40
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AtlasDetectorID::is_lar_hec
bool is_lar_hec(Identifier id) const
Definition: AtlasDetectorID.h:829
LArOnlineID_Base::isEMBchannel
bool isEMBchannel(const HWIdentifier id) const
Definition: LArOnlineID_Base.cxx:1652
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
LArRawDetSelector.h
LArOnlineID::isHECchannel
bool isHECchannel(const HWIdentifier id) const override final
Definition: LArOnlineID.cxx:734
LArRawDetSelector::m_onlineID
const LArOnlineID * m_onlineID
Definition: LArRawDetSelector.h:35
StoreGateSvc.h
AtlasDetectorID::is_lar_em
bool is_lar_em(Identifier id) const
Definition: AtlasDetectorID.h:818
LArRawChannelContainer
Container for LArRawChannel (IDC using LArRawChannelCollection)
Definition: LArRawChannelContainer.h:26