133 MF_LOG_DEBUG(
"CRTGoodEvent") <<
"Is this Fragment good? " << ((frag.good_event())?
"true":
"false") <<
"\n";
137 std::vector<CRT::Hit> hits;
140 for(
size_t hitNum = 0; hitNum < frag.num_hits(); ++hitNum)
142 const auto hit = *(frag.hit(hitNum));
144 <<
"ADC: " <<
hit.adc <<
"\n";
146 size_t offline_channel =
hit.channel;
147 if (frag.module_num() == 14 ||
148 frag.module_num() == 15 ||
149 frag.module_num() == 8 ||
150 frag.module_num() == 9 ||
151 frag.module_num() == 10 ||
152 frag.module_num() == 11 ||
153 frag.module_num() == 4 ||
154 frag.module_num() == 5 ||
155 frag.module_num() == 30 ||
156 frag.module_num() == 31 ||
157 frag.module_num() == 24 ||
158 frag.module_num() == 25 ||
159 frag.module_num() == 26 ||
160 frag.module_num() == 27 ||
161 frag.module_num() == 20 ||
162 frag.module_num() == 21){
164 offline_channel = (31-
hit.channel)*2;
167 offline_channel = (63-
hit.channel)*2+1;
172 offline_channel =
hit.channel*2;
175 offline_channel = (
hit.channel-32)*2+1;
179 if (offline_channel%2==0) ++offline_channel;
180 else --offline_channel;
181 hits.emplace_back(offline_channel,
hit.adc);
187 MF_LOG_DEBUG(
"CRTFragments") <<
"Module: " << frag.module_num() <<
"\n" 188 <<
"Number of hits: " << frag.num_hits() <<
"\n" 189 <<
"Fifty MHz time: " << frag.fifty_mhz_time() <<
"\n";
193 triggers->emplace_back(
fChannelMap.at(frag.module_num()), frag.fifty_mhz_time(),
std::move(hits));
195 catch(
const std::out_of_range&
e)
197 mf::LogWarning(
"Bad CRT Channel") <<
"Got CRT channel number " << frag.module_num() <<
" that is greater than the number of boards" 198 <<
" in the channel map: " <<
fChannelMap.size() <<
". Throwing out this Trigger.\n";
202 const auto& plots =
fSyncPlots[frag.module_num()];
203 const double deltaT = (frag.fifty_mhz_time() -
fEarliestTime)*1.6e-8;
204 if(deltaT > 0 && deltaT < 1e6)
207 plots.fLowerTimeVersusTime->SetPoint(plots.fLowerTimeVersusTime->GetN(), deltaT, frag.raw_backend_time());
211 mf::LogWarning(
"SyncPlots") <<
"Got time difference " << deltaT <<
" that was not included in sync plots.\n" 212 <<
"lhs is " << frag.fifty_mhz_time() <<
", and rhs is " <<
fEarliestTime <<
".\n" 213 <<
"Hardware raw time is " << frag.raw_backend_time() <<
".\n";
std::vector< PerModule > fSyncPlots
std::vector< size_t > fChannelMap
Detector simulation of raw signals on wires.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning