76 const art::Event*
event = evdb::EventHolder::Instance()->GetEvent();
81 for (
size_t imod = 0; imod < recoOpt->
fHitLabels.size(); ++imod)
86 event->getByLabel(which, hitVecHandle);
90 bool stillSearching(
true);
91 int fitParamsOffset(0);
94 for(
size_t hitIdx = 0; hitIdx < hitVecHandle->size(); hitIdx++)
101 stillSearching =
false;
103 else if (!stillSearching)
break;
105 if (stillSearching) fitParamsOffset++;
109 if (hitPtrVec.
empty())
continue;
113 const auto& fitParamVecs = hitResults->vectors();
116 std::vector<double> hitPeakTimeVec;
117 std::vector<double> hitTau1Vec;
118 std::vector<double> hitTau2Vec;
119 std::vector<double> hitPeakAmpVec;
120 std::vector<int> hitStartTVec;
121 std::vector<int> hitEndTVec;
122 std::vector<int> hitNMultiHitVec;
123 std::vector<int> hitLocalIdxVec;
126 for (
size_t idx = 0; idx < hitPtrVec.
size(); ++idx)
128 const auto& fitParams = fitParamVecs[fitParamsOffset + idx];
129 const auto&
hit = hitPtrVec[idx];
131 hitPeakTimeVec.push_back(fitParams[0]);
132 hitTau1Vec.push_back(fitParams[1]);
133 hitTau2Vec.push_back(fitParams[2]);
134 hitPeakAmpVec.push_back(fitParams[3]);
135 hitStartTVec.push_back(
hit->StartTick());
136 hitEndTVec.push_back(
hit->EndTick());
137 hitNMultiHitVec.push_back(
hit->Multiplicity());
138 hitLocalIdxVec.push_back(
hit->LocalIndex());
142 for(
size_t idx = 0; idx < hitPeakTimeVec.size(); idx++)
144 if (hitNMultiHitVec[idx] > 1 && hitLocalIdxVec[idx] == 0)
146 TPolyLine& p2 = view2D.AddPolyLine(1001,kRed,3,1);
149 for(
int j = 0; j<1001; ++j)
151 double x = hitStartTVec[idx] + j * (hitEndTVec[idx+hitNMultiHitVec[idx]-1]-hitStartTVec[idx])/1000;
152 double y =
EvalMultiExpoFit(x,idx,hitNMultiHitVec[idx],hitTau1Vec,hitTau2Vec,hitPeakAmpVec,hitPeakTimeVec);
153 p2.SetPoint(j, x, y);
162 TPolyLine& p1 = view2D.AddPolyLine(1001,kOrange+7,3,1);
165 for(
int j = 0; j<1001; ++j){
166 double x = hitStartTVec[idx - hitLocalIdxVec[idx]] + j * (hitEndTVec[idx + hitNMultiHitVec[idx] - hitLocalIdxVec[idx] - 1] - hitStartTVec[idx - hitLocalIdxVec[idx]]) / 1000;
167 double y =
EvalExpoFit(x,hitTau1Vec[idx],hitTau2Vec[idx],hitPeakAmpVec[idx],hitPeakTimeVec[idx]);
168 p1.SetPoint(j, x, y);
static std::unique_ptr< FVectorReader > create(const art::Event &evt, const art::InputTag &tag)
void push_back(Ptr< U > const &p)
Detector simulation of raw signals on wires.
std::vector< art::InputTag > fHitLabels
module labels that produced hits
LArSoft geometry interface.
Event finding and building.