7#include "CLHEP/Units/SystemOfUnits.h"
22using Athena::Units::GeV;
23using Athena::Units::ns;
64 msg() << MSG::INFO <<
"Included calorimeter samplings: ";
67 if (idSamp != CaloSampling::Unknown) {
69 msg() << MSG::INFO <<
"\042" << sampling
81 samplingV.push_back(idSample);
88 <<
"Included calorimeter : \042"
91 const std::vector<CaloSampling::CaloSample>& samplingV = p.second;
101 return StatusCode::SUCCESS;
118 return StatusCode::FAILURE;
141 std::vector<CaloSampling::CaloSample> samplingV = p.second;
153 idSample = CaloSampling::Unknown;
157 if (
find(samplingV.begin(), samplingV.end(), idSample) != samplingV.end()) {
162 HWIdentifier id = cabling->createSignalChannelID((*cell)->ID());
172 msg() << MSG::INFO <<
"FEB IDs: ";
174 std::ostringstream os;
175 os << std::hex << febID;
176 msg() << MSG::INFO <<
" \042" << os.str() <<
"\042";
189 std::map<CaloSampling::CaloSample, double> sumEPerSampling, sumETimePerSampling;
190 std::map<HWIdentifier, double> sumEPerFeb, sumETimePerFeb;
191 double sumETotal = 0, sumETimeTotal = 0;
201 (
"Looping over CaloCells of calorimeter : \042"
204 std::vector<CaloSampling::CaloSample> samplingV = p.second;
217 idSample = CaloSampling::Unknown;
221 if (
find(samplingV.begin(), samplingV.end(), idSample) != samplingV.end()) {
226 HWIdentifier id = cabling->createSignalChannelID((*cell)->ID());
235 double energy = (*cell)->e();
236 double time = (*cell)->time();
237 if (fabs(time/ns -
float(
int(time/(25*ns))*25.)) > 0.001 && energy >
m_energy_cut) {
243 sumEPerSampling[idSample] += energy;
244 sumETimePerSampling[idSample] += energy * time;
246 sumEPerFeb[febID] += energy;
247 sumETimePerFeb[febID] += energy * time;
250 sumETimeTotal += energy * time;
254 (
"cell time = " << time/ns <<
" ns"
255 <<
"; energy = " << energy/
GeV <<
" GeV" );
266 if (
m_emId->is_lar_em((*cell)->ID()) ) {
290 double peakTime = (sumEPerSampling[idSample] > 0.) ? sumETimePerSampling[idSample]/sumEPerSampling[idSample] :
NOTIME;
300 double peakTime = (sumEPerFeb[febID] > 0.) ? sumETimePerFeb[febID]/sumEPerFeb[febID] :
NOTIME;
302 m_febId_feb->push_back(febID.get_identifier32().get_compact());
310 m_time = (sumETotal > 0.) ? sumETimeTotal/sumETotal : 0.;
314 return StatusCode::SUCCESS;
324 return StatusCode::SUCCESS;
436 return StatusCode::SUCCESS;
453 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
Wrapper to avoid constant divisions when using units.
ServiceHandle< StoreGateSvc > & evtStore()
const ServiceHandle< StoreGateSvc > & detStore() const
void addBranch(const std::string &branchname, T &obj, const std::string &leaflist)
CBNT_TBRecBase(const std::string &name, ISvcLocator *pSvcLocator)
std::map< CaloCell_ID::SUBCALO, std::vector< CaloSampling::CaloSample > > m_calosAndSamplings
std::map< CaloSampling::CaloSample, std::string > m_samplingToNameLookup
const LArOnlineID * m_onlineHelper
std::map< std::string, CaloSampling::CaloSample > m_samplingFromNameLookup
std::map< std::string, CaloCell_ID::SUBCALO > m_caloFromNameLookup
std::vector< long > * m_phi_cell
static const int NOENERGY
std::vector< float > * m_time_layer
std::map< int, std::string > m_slotToFebNameLookup
std::vector< long > * m_feedthrough_feb
std::vector< HWIdentifier > m_febIDs
virtual StatusCode CBNT_finalize() override
virtual StatusCode CBNT_initialize() override
std::vector< CaloSampling::CaloSample > m_samplingIndices
stores
std::vector< long > * m_febId_cell
std::vector< long > * m_layer_layer
std::vector< long > * m_layer_cell
std::vector< long > * m_febId_feb
std::vector< long > * m_eta_cell
Gaudi::Property< std::string > m_caloCellName
Gaudi::Property< std::string > m_tbphase
std::map< CaloSampling::CaloSample, CaloCell_ID::SUBCALO > m_caloLookup
std::vector< long > * m_slot_feb
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
virtual StatusCode CBNT_clear() override
Gaudi::Property< std::vector< std::string > > m_sampling_names
CBNT_Timing(const std::string &name, ISvcLocator *pSvcLocator)
std::vector< float > * m_time_cell
std::vector< float > * m_energy_cell
virtual StatusCode CBNT_execute() override
std::vector< float > * m_time_feb
StatusCode setupLookupTables()
internal helpers
Gaudi::Property< double > m_energy_cut
std::map< CaloCell_ID::SUBCALO, std::string > m_caloToNameLookup
Container class for CaloCell.
CaloCellContainer::const_iterator beginConstCalo(CaloCell_ID::SUBCALO caloNum) const
get const iterators on cell of just one calo
CaloCellContainer::const_iterator endConstCalo(CaloCell_ID::SUBCALO caloNum) const
CaloCell_Base_ID::SUBCALO SUBCALO
This class groups all DetDescr information related to a CaloCell.
CaloCell_ID::CaloSample getSampling() const
cell sampling
DataModel_detail::const_iterator< DataVector > const_iterator
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.
std::string find(const std::string &s)
return a remapped string