Produce digis out of raw data.
64 LogDebug(
"EcalTBHodo") <<
"total # caloHits: " << caloHits->size();
66 edm::LogError(
"EcalTBHodo") <<
"Error! can't get the caloHitContainer ";
73 std::map<unsigned int, double> energyMap;
75 for (
auto &&aHit : *caloHits) {
76 double thisHitEne = aHit.energy();
78 std::map<unsigned int, double>::iterator itmap = energyMap.find(aHit.id());
79 if (itmap == energyMap.end())
80 energyMap.insert(pair<unsigned int, double>(aHit.id(), thisHitEne));
82 (*itmap).second += thisHitEne;
89 product->setPlanes(nPlanes);
91 bool firedChannels[4][64];
92 for (
int iPlane = 0; iPlane < nPlanes; ++iPlane) {
93 for (
int iFiber = 0; iFiber < nFibers; ++iFiber) {
94 firedChannels[iPlane][iFiber] = 0.;
97 for (std::map<unsigned int, double>::const_iterator itmap = energyMap.begin(); itmap != energyMap.end(); ++itmap) {
100 firedChannels[myHodoDetId.
planeId()][myHodoDetId.
fibrId()] =
true;
103 for (
int iPlane = 0; iPlane < nPlanes; ++iPlane) {
106 for (
int iFiber = 0; iFiber < nFibers; ++iFiber) {
107 planeHit.setHit(iFiber, firedChannels[iPlane][iFiber]);
109 product->setPlane((
unsigned int)iPlane, planeHit);
112 LogDebug(
"EcalTBHodo") << (*product);
std::vector< PCaloHit > PCaloHitContainer
T const * product() const
Log< level::Error, false > LogError
std::unique_ptr< EcalTBHodoscopeGeometry > theTBHodoGeom_
edm::EDGetTokenT< edm::PCaloHitContainer > m_EcalToken