49 NTupleFilePtr file1(
ntupleSvc(),
"/NTUPLES/FILE1");
52 return StatusCode::FAILURE;
54 NTuplePtr nt(
ntupleSvc(),
"/NTUPLES/FILE1/LARDIGITS");
56 nt=
ntupleSvc()->book(
"/NTUPLES/FILE1/LARDIGITS",CLID_ColumnWiseTuple,
"LArDigits");
60 return StatusCode::FAILURE;
80 ATH_MSG_INFO(
"======== ReadLArDigits initialize successfully ========" );
81 return StatusCode::SUCCESS;
90 const EventContext& ctx = Gaudi::Hive::currentContext();
100 return StatusCode::FAILURE;
108 unsigned cellCounter=0;
110 if (!larDigitCont.
empty())
114 for (
const LArDigit* digit : larDigitCont) {
116 const std::vector<short>& vSamples=digit->samples();
119 const Identifier id=cabling->cnvToIdentifier(chid);
120 if (
m_emId->is_lar_em(
id))
126 m_eta[cellCounter]=0;
127 m_phi[cellCounter]=0;
132 m_eta[cellCounter]=-999;
133 m_phi[cellCounter]=-999;
141 m_gain[cellCounter]=digit->gain();
143 int nSamples=vSamples.size();
144 for (
int i=0;i<nSamples && i<32;i++)
149 if (
m_eta[cellCounter]==-999 &&
m_phi[cellCounter]==-999 &&
m_layer[cellCounter]==-999)
150 m_outfile <<
"Cell l/e/p= <ILLEGAL IDENTIFIER> ";
153 <<
"/" <<
m_phi[cellCounter] <<
" ";
157 << std::dec <<
" Ch= " <<
m_channel[cellCounter] <<
" ";
158 for (
int i=0;i<nSamples;i++) {
169 return StatusCode::SUCCESS;
177 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
Handle class for reading from StoreGate.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
Helper class for offline cell identifiers.
const LArEM_ID * em_idHelper() const
access to EM idHelper
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
const T * front() const
Access the first element in the collection as an rvalue.
bool empty() const noexcept
Returns true if the collection is empty.
Container class for LArDigit.
Liquid Argon digit base class.
const std::vector< short > & samples() const
Exception class for LAr Identifiers.
CTB: code to read digits.
SortDigits(const LArOnlineID *onlineHelper)
const LArOnlineID * m_onlineHelper
NTuple::Array< long > m_channel
NTuple::Matrix< long > m_samples
NTuple::Array< long > m_phi
NTuple::Tuple * m_ntuplePtr
NTuple::Array< long > m_layer
NTuple::Array< long > m_barrel_ec
ReadLArDigits(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
NTuple::Array< long > m_gain
NTuple::Item< long > m_cellIndex
SG::ReadHandleKey< LArDigitContainer > m_containerKey
NTuple::Array< long > m_slot
NTuple::Array< long > m_pos_neg
const LArOnlineID * m_onlineHelper
NTuple::Array< long > m_eta
NTuple::Array< long > m_FT
NTuple::Item< long > m_Nsamples
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.