75 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
76 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
77 art::ServiceHandle<geo::Geometry const> geo;
80 const art::Event*
event = evdb::EventHolder::Instance()->GetEvent();
85 for (
size_t imod = 0; imod < recoOpt->fHitLabels.size(); ++imod)
87 art::InputTag
const which = recoOpt->fHitLabels[imod];
89 art::Handle< std::vector<recob::Hit> > hitVecHandle;
90 event->getByLabel(which, hitVecHandle);
93 art::PtrVector<recob::Hit> hitPtrVec;
94 bool stillSearching(
true);
95 int fitParamsOffset(0);
98 for(
size_t hitIdx = 0; hitIdx < hitVecHandle->size(); hitIdx++)
100 art::Ptr<recob::Hit>
hit(hitVecHandle, hitIdx);
102 if (
hit->Channel() == channel)
104 hitPtrVec.push_back(
hit);
105 stillSearching =
false;
107 else if (!stillSearching)
break;
109 if (stillSearching) fitParamsOffset++;
113 if (hitPtrVec.empty())
continue;
117 const auto& fitParamVecs = hitResults->vectors();
120 std::vector<double> hitPeakTimeVec;
121 std::vector<double> hitTau1Vec;
122 std::vector<double> hitTau2Vec;
123 std::vector<double> hitPeakAmpVec;
124 std::vector<int> hitStartTVec;
125 std::vector<int> hitEndTVec;
126 std::vector<int> hitNMultiHitVec;
127 std::vector<int> hitLocalIdxVec;
130 for (
size_t idx = 0; idx < hitPtrVec.size(); ++idx)
132 const auto& fitParams = fitParamVecs[fitParamsOffset + idx];
133 const auto&
hit = hitPtrVec[idx];
135 hitPeakTimeVec.push_back(fitParams[0]);
136 hitTau1Vec.push_back(fitParams[1]);
137 hitTau2Vec.push_back(fitParams[2]);
138 hitPeakAmpVec.push_back(fitParams[3]);
139 hitStartTVec.push_back(
hit->StartTick());
140 hitEndTVec.push_back(
hit->EndTick());
141 hitNMultiHitVec.push_back(
hit->Multiplicity());
142 hitLocalIdxVec.push_back(
hit->LocalIndex());
146 for(
size_t idx = 0; idx < hitPeakTimeVec.size(); idx++)
148 if (hitNMultiHitVec[idx] > 1 && hitLocalIdxVec[idx] == 0)
150 TPolyLine& p2 = view2D.AddPolyLine(1001,kRed,3,1);
153 for(
int j = 0; j<1001; ++j)
155 double x = hitStartTVec[idx] + j * (hitEndTVec[idx+hitNMultiHitVec[idx]-1]-hitStartTVec[idx])/1000;
156 double y =
EvalMultiExpoFit(x,idx,hitNMultiHitVec[idx],hitTau1Vec,hitTau2Vec,hitPeakAmpVec,hitPeakTimeVec);
157 p2.SetPoint(j, x, y);
166 TPolyLine&
p1 = view2D.AddPolyLine(1001,kOrange+7,3,1);
169 for(
int j = 0; j<1001; ++j){
170 double x = hitStartTVec[idx - hitLocalIdxVec[idx]] + j * (hitEndTVec[idx + hitNMultiHitVec[idx] - hitLocalIdxVec[idx] - 1] - hitStartTVec[idx - hitLocalIdxVec[idx]]) / 1000;
171 double y =
EvalExpoFit(x,hitTau1Vec[idx],hitTau2Vec[idx],hitPeakAmpVec[idx],hitPeakTimeVec[idx]);
172 p1.SetPoint(j, x, y);
process_name opflash particleana ie x
static std::unique_ptr< FVectorReader > create(const art::Event &evt, const art::InputTag &tag)
process_name opflash particleana ie ie y
physics associatedGroupsWithLeft p1