42 if(
debug_ > 0) std::cout <<
"[ECalDataProcessor] Running Process" << std::endl;
54 EVENT::LCCollection* hits{
nullptr};
56 hits =
static_cast<EVENT::LCCollection*
>(
event->getLCCollection(
hitCollLcio_.c_str()));
57 }
catch (EVENT::DataNotAvailableException e) {
58 std::cout << e.what() << std::endl;
62 IMPL::CalorimeterHitImpl* lc_hit{
nullptr};
65 std::map< std::pair<int,int>,
CalHit*> hit_map;
68 for (
int ihit=0; ihit < hits->getNumberOfElements(); ++ihit) {
71 IMPL::CalorimeterHitImpl* lc_hit
72 =
static_cast<IMPL::CalorimeterHitImpl*
>(hits->getElementAt(ihit));
76 int id0 = lc_hit->getCellID0();
79 int id1 =
static_cast<int>(10.0*lc_hit->getTime());
84 hit_map[ std::make_pair(id0,id1) ] = cal_hit;
90 cal_hit->
setTime(lc_hit->getTime());
102 EVENT::LCCollection* clusters{
nullptr};
105 clusters =
static_cast<EVENT::LCCollection*
>(
event->getLCCollection(
clusCollLcio_.c_str()));
107 catch (EVENT::DataNotAvailableException e)
109 std::cout << e.what() << std::endl;
113 for(
int icluster = 0; icluster < clusters->getNumberOfElements(); ++icluster) {
116 IMPL::ClusterImpl* lc_cluster =
static_cast<IMPL::ClusterImpl*
>(clusters->getElementAt(icluster));
125 cluster->
setEnergy(lc_cluster->getEnergy());
128 EVENT::CalorimeterHitVec lc_hits = lc_cluster->getCalorimeterHits();
135 CalHit* seed_hit{
nullptr};
136 for(
int ihit = 0; ihit < (int) lc_hits.size(); ++ihit) {
139 lc_hit =
static_cast<IMPL::CalorimeterHitImpl*
>(lc_hits[ihit]);
141 int id0=lc_hit->getCellID0();
142 int id1=(int)(10.0*lc_hit->getTime());
144 if (hit_map.find(std::make_pair(id0,id1)) == hit_map.end()) {
145 throw std::runtime_error(
"[ EcalDataProcessor ]: Hit not found in map, but is in the cluster.");
148 CalHit* cal_hit = hit_map[std::make_pair(id0,id1)];
151 if (senergy < lc_hit->getEnergy()) {
152 senergy = lc_hit->getEnergy();
167 if(
debug_ > 0) std::cout <<
"[ECalDataProcessor] End of process" << std::endl;