7#include "CLHEP/Units/SystemOfUnits.h"
22using Athena::Units::GeV;
23using Athena::Units::ns;
92 msg() << MSG::INFO <<
"Included calorimeter samplings: ";
95 if (idSamp != CaloSampling::Unknown) {
97 msg() << MSG::INFO <<
"\042" << sampling
109 samplingV.push_back(idSample);
116 <<
"Included calorimeter : \042"
118 <<
"\042 samplings:";
119 const std::vector<CaloSampling::CaloSample>& samplingV = p.second;
129 return StatusCode::SUCCESS;
146 return StatusCode::FAILURE;
169 std::vector<CaloSampling::CaloSample> samplingV = p.second;
181 idSample = CaloSampling::Unknown;
185 if (
find(samplingV.begin(), samplingV.end(), idSample) != samplingV.end()) {
190 HWIdentifier id = cabling->createSignalChannelID((*cell)->ID());
200 msg() << MSG::INFO <<
"FEB IDs: ";
202 std::ostringstream os;
203 os << std::hex << febID;
204 msg() << MSG::INFO <<
" \042" << os.str() <<
"\042";
217 std::map<CaloSampling::CaloSample, double> sumEPerSampling, sumETimePerSampling;
218 std::map<HWIdentifier, double> sumEPerFeb, sumETimePerFeb;
219 double sumETotal = 0, sumETimeTotal = 0;
229 (
"Looping over CaloCells of calorimeter : \042"
232 std::vector<CaloSampling::CaloSample> samplingV = p.second;
245 idSample = CaloSampling::Unknown;
249 if (
find(samplingV.begin(), samplingV.end(), idSample) != samplingV.end()) {
254 HWIdentifier id = cabling->createSignalChannelID((*cell)->ID());
263 double energy = (*cell)->e();
264 double time = (*cell)->time();
265 if (fabs(time/ns -
float(
int(time/(25*ns))*25.)) > 0.001 && energy >
m_energy_cut) {
271 sumEPerSampling[idSample] += energy;
272 sumETimePerSampling[idSample] += energy * time;
274 sumEPerFeb[febID] += energy;
275 sumETimePerFeb[febID] += energy * time;
278 sumETimeTotal += energy * time;
282 (
"cell time = " << time/ns <<
" ns"
283 <<
"; energy = " << energy/
GeV <<
" GeV" );
294 if (
m_emId->is_lar_em((*cell)->ID()) ) {
318 double peakTime = (sumEPerSampling[idSample] > 0.) ? sumETimePerSampling[idSample]/sumEPerSampling[idSample] :
NOTIME;
328 double peakTime = (sumEPerFeb[febID] > 0.) ? sumETimePerFeb[febID]/sumEPerFeb[febID] :
NOTIME;
330 m_febId_feb->push_back(febID.get_identifier32().get_compact());
338 m_time = (sumETotal > 0.) ? sumETimeTotal/sumETotal : 0.;
342 return StatusCode::SUCCESS;
352 return StatusCode::SUCCESS;
464 return StatusCode::SUCCESS;
481 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Wrapper to avoid constant divisions when using units.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
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
std::string m_caloCellName
virtual StatusCode CBNT_initialize() override
std::vector< CaloSampling::CaloSample > m_samplingIndices
stores
std::vector< std::string > m_sampling_names
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
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
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
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