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