51 std::cout <<
"New event\n";
55 for(
const auto&
trigger: triggers)
57 std::cout <<
"On module " <<
trigger.Channel() <<
":\n";
58 const auto& hits =
trigger.Hits();
59 for(
const auto&
hit: hits)
61 std::cout <<
"\tGot a hit on strip " <<
hit.Channel() <<
"\n";
71 if(
hit.ADC() > stripToHits[id]) stripToHits[
id] =
hit.ADC();
84 for(
const auto& framePair: stripToHits)
88 if(framePair.second.size() > 1)
90 for(
const auto& planePair: framePair.second)
92 for(
const auto& modulePair: planePair.second)
95 if(modulePair.second.size() > 1)
97 auto layerPair = modulePair.second.begin();
98 auto& stripPairs = layerPair->second;
99 const auto firstMax = std::max_element(stripPairs.begin(), stripPairs.end(), [](
const auto& first,
const auto&
second)
101 return first.second <
second.second;
105 auto& secondStripPairs = layerPair->second;
106 const auto secondMax = std::max_element(secondStripPairs.begin(), secondStripPairs.end(), [](
const auto& first,
const auto&
second)
108 return first.second <
second.second;
111 if(firstMax->first.Overlaps(secondMax->first))
113 const auto& firstID = firstMax->first;
114 stripToOverlappingHits[firstID].push_back(*firstMax);
116 const auto& secondID = secondMax->first;
117 stripToOverlappingHits[secondID].push_back(*secondMax);
126 for(
const auto& framePair: stripToOverlappingHits)
128 if(framePair.second.size() > 1)
131 for(
const auto& planePair: framePair.second)
133 const std::vector<std::pair<CRT::StripID, int64_t>>& strips = planePair.second;
134 for(
const auto& stripPair: strips)
138 const auto&
id = stripPair.first;
139 auto foundStrip =
fStrips.find(stripPair.first);
140 if(foundStrip ==
fStrips.end())
145 auto& strip = foundStrip->second;
146 strip.fOverlappingADCs->Fill(stripPair.second);
std::map< CRT::ModuleID, DIRECTORY > fModuleToDir
detail::Node< void, uint8_t > FrameID
std::map< CRT::StripID, StripPlots > fStrips
Detector simulation of raw signals on wires.
std::unique_ptr< CRT::Geometry > fGeom
std::map< CRT::StripID, size_t > fStripToChannel
second_as<> second
Type of time stored in seconds, in double precision.
std::string to_string(ModuleType const mt)