9#include "Identifier/Identifier.h"
14#include "CaloGeoHelpers/CaloSampling.h"
22#include "GaudiKernel/ITHistSvc.h"
23#include "GaudiKernel/ServiceHandle.h"
40 m_ADC.reserve(250000);
51 CHECK( histSvc.retrieve() );
52 m_tree =
new TTree(
"myTree",
"myTree");
72 m_tree->Branch(
"ADC",
m_ADC.data(),
"ADC[ncells][32]/F");
84 return StatusCode::SUCCESS;
90 return StatusCode::SUCCESS;
99 ATH_MSG_ERROR(
"Do not have cabling object LArOnOffIdMapping" );
100 return StatusCode::FAILURE;
122 std::vector<const LArDigit*> IndexDigit;
123 int nCell =
m_calo_id->calo_cell_hash_max();
124 IndexDigit.resize(nCell,
nullptr);
131 for (; first_digit != end_digit; ++first_digit)
134 Identifier id = cabling->cnvToIdentifier(hwid);
144 std::vector<int> iflag_cell;
145 iflag_cell.resize(nCell,0);
150 for (; first_cell != end_cell; ++first_cell)
154 double et = (*first_cell)->et();
159 if ((
m_calo_id->calo_sample(cellID)==CaloSampling::CaloSample::EMB2 ||
m_calo_id->calo_sample(cellID)==CaloSampling::CaloSample::EME2)
163 myList.
select((*first_cell)->eta(),(*first_cell)->phi(),0.10);
164 for (
const CaloCell* cell : myList) {
166 int index2 = (int)(
m_calo_id->calo_cell_hash(cellID2));
167 iflag_cell[index2]=1;
173 first_cell = cell_container->
begin();
174 for (; first_cell != end_cell; ++first_cell) {
179 if (iflag_cell[
index]==1 ){
193 HWIdentifier hwid = cabling->createSignalChannelID(cellID);
199 if (barrel_ec<2 && pos_neg<2 && FT<32 && slot<16 && channel<128)
200 myid = (channel) | (slot << 7) | (FT<<11) | (pos_neg << 16) | (barrel_ec << 17);
202 ATH_MSG_WARNING(
"Why we have such cell: "<<barrel_ec<<
" "<<pos_neg<<
" "<<FT<<
" "<<slot<<
" "<<channel<<
" | "<<myid);
207 pedestal = larPedestal->
pedestal(hwid,(*first_cell)->gain());
213 if (IndexDigit[
index]) {
214 const std::vector<short>& vSamples=(IndexDigit[
index])->samples();
215 int nsamples = vSamples.size();
216 for (
int i=0;i<std::min(32,nsamples);i++) {
229 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
#define CHECK(...)
Evaluate an expression and check for errors.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
ServiceHandle< StoreGateSvc > & evtStore()
const ServiceHandle< StoreGateSvc > & detStore() const
Container class for CaloCell.
void select(double eta, double phi, double deta, double dphi)
Data object for each calorimeter readout cell.
This class provides the client interface for accessing the detector description information common to...
This class initializes the Calo (LAr and Tile) offline identifiers.
const CaloCell_ID * getCaloCell_ID(void) const
Access to IdHelper.
DataModel_detail::const_iterator< DataVector > const_iterator
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.
virtual float pedestal(const HWIdentifier &id, int gain) const =0
value_type get_compact() const
Get the compact id.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
Container class for LArDigit.
const LArOnlineID * m_lar_online_id
virtual StatusCode finalize()
std::vector< std::array< float,32 > > m_ADC
std::vector< int > m_GainCell
std::vector< int > m_QuaCell
std::vector< int > m_HwidCell
Gaudi::Property< double > m_etcut
std::vector< int > m_ChidCell
virtual StatusCode initialize()
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Gaudi::Property< std::string > m_outStream
std::vector< float > m_TCell
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
virtual StatusCode execute()
std::vector< float > m_EtaCell
std::vector< int > m_ProvCell
std::vector< float > m_PhiCell
std::vector< float > m_ECell
LArReadCells(const std::string &name, ISvcLocator *pSvcLocator)
Gaudi::Property< double > m_etcut2
std::vector< int > m_LayerCell
SG::ReadCondHandleKey< ILArPedestal > m_pedestalKey
const CaloCell_ID * m_calo_id
uint32_t lumiBlock() const
The current event's luminosity block number.
uint32_t bcid() const
The bunch crossing ID of the event.
@ LAr
The LAr calorimeter.
@ Error
The sub-detector issued an error.
uint32_t runNumber() const
The current event's run number.
EventFlagErrorState errorState(EventFlagSubDet subDet) const
Get the error state for a particular sub-detector.
uint64_t eventNumber() const
The current event's event number.
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring
EventInfo_v1 EventInfo
Definition of the latest event info version.
Extra patterns decribing particle interation process.