49 : myThreshold(0.05E-3),
51 produces<EcalTBHodoscopeRawInfo>();
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
void setHit(unsigned int i, bool status)
#define DEFINE_FWK_MODULE(type)
T const * product() const
void produce(edm::Event &event, const edm::EventSetup &eventSetup) override
Produce digis out of raw data.
Log< level::Error, false > LogError
TBHodoActiveVolumeRawInfoProducer(const edm::ParameterSet &ps)
Constructor.
Namespace of DDCMS conversion namespace.
~TBHodoActiveVolumeRawInfoProducer() override=default
Destructor.
std::unique_ptr< EcalTBHodoscopeGeometry > theTBHodoGeom_
edm::EDGetTokenT< edm::PCaloHitContainer > m_EcalToken