14 , fPandoraProducer(
p.get<std::string>(
"PandoraProducer"))
15 , fSpacePointProducer(
p.get<std::string>(
"SpacePointProducer"))
16 , fOpHitProducer(
p.get<std::string>(
"OpHitProducer"))
17 , fOpHitARAProducer(
p.get<std::string>(
"OpHitARAProducer",
""))
20 , fClockData(art::ServiceHandle<detinfo::DetectorClocksService const>()->DataForJob())
21 , fTickPeriod(fClockData.OpticalClock().TickPeriod())
22 , fBeamWindowStart(
p.get<
double>(
"BeamWindowStart"))
23 , fBeamWindowEnd(
p.get<
double>(
"BeamWindowEnd"))
24 , fFlashStart(
p.get<
double>(
"FlashStart"))
25 , fFlashEnd(
p.get<
double>(
"FlashEnd"))
26 , fTimeBins(
unsigned(1/fTickPeriod * (fBeamWindowEnd - fBeamWindowStart)))
27 , fSelectNeutrino(
p.get<
bool>(
"SelectNeutrino",
true))
28 , fOnlyCollectionWires(
p.get<
bool>(
"OnlyCollectionWires",
true))
29 , fForceConcurrence(
p.get<
bool>(
"ForceConcurrence",
false))
30 , fUseUncoatedPMT(
p.get<
bool>(
"UseUncoatedPMT",
false))
31 , fUseOppVolMetric(
p.get<
bool>(
"UseOppVolMetric",
false))
32 , fUseARAPUCAS(
p.get<
bool>(
"UseARAPUCAS",
false))
33 , fStoreTrueNus(
p.get<
bool>(
"StoreTrueNus",
false))
34 , fStoreCheatMCT0(
p.get<
bool>(
"StoreCheatMCT0",
false))
36 , fInputFilename(
p.get<std::string>(
"InputFileName"))
37 , fNoAvailableMetrics(
p.get<
bool>(
"NoAvailableMetrics",
false))
38 , fMakeTree(
p.get<
bool>(
"MakeTree",
false))
39 , fChargeToNPhotonsShower(
p.get<
double>(
"ChargeToNPhotonsShower", 1.0))
40 , fChargeToNPhotonsTrack(
p.get<
double>(
"ChargeToNPhotonsTrack", 1.0))
41 , fMinHitQ(
p.get<
double>(
"MinHitQ", 0.0))
42 , fMinSpacePointQ(
p.get<
double>(
"MinSpacePointQ", 0.0))
43 , fMinParticleQ(
p.get<
double>(
"MinParticleQ", 0.0))
44 , fMinSliceQ(
p.get<
double>(
"MinSliceQ", 0.0))
45 , fMaxFlashes(
p.get<
unsigned>(
"MaxFlashes", 1))
46 , fMinOpHPE(
p.get<
double>(
"MinOpHPE", 0.0))
47 , fMinFlashPE(
p.get<
double>(
"MinFlashPE", 0.0))
48 , fDetector(detectorName(fGeometry->DetectorName()))
49 , fSBND((fDetector ==
"SBND") ?
true :
false )
50 , fICARUS((fDetector ==
"ICARUS") ?
true :
false )
51 ,
fPDMapAlgPtr(art::make_tool<opdet::PDMapAlg>(
p.get<fhicl::ParameterSet>(
"PDMapAlg")))
52 , fNTPC(fGeometry->NTPC())
53 , fCryostat(
p.get<
int>(
"Cryostat", 0))
54 , fGeoCryo(std::make_unique<geo::CryostatGeo>(fGeometry->Cryostat(fCryostat)))
55 , fWiresX_gl(wiresXGl())
56 , fDriftDistance(driftDistance())
57 , fXBins(
p.get<
double>(
"XBins"))
58 , fXBinWidth(fDriftDistance/fXBins)
59 , fRR_TF1_fit(
p.get<std::string>(
"rr_TF1_fit",
"pol3"))
60 , fRatio_TF1_fit(
p.get<std::string>(
"ratio_TF1_fit",
"pol3"))
61 , fYBins(
p.get<
unsigned>(
"YBins", 0.))
62 , fZBins(
p.get<
unsigned>(
"ZBins", 0.))
63 , fYLow(
p.get<
double>(
"YLow", 0.))
64 , fYHigh(
p.get<
double>(
"YHigh", 0.))
65 , fZLow(
p.get<
double>(
"ZLow", 0.))
66 , fZHigh(
p.get<
double>(
"ZHigh", 0.))
67 , fYBiasSlope(
p.get<
double>(
"YBiasSlope", 0.))
68 , fZBiasSlope(
p.get<
double>(
"ZBiasSlope", 0.))
69 , fOpDetNormalizer((fSBND) ? 4 : 1)
70 , fTermThreshold(
p.get<
double>(
"ThresholdTerm", 30.))
72 produces< std::vector<sbn::SimpleFlashMatch> >();
73 produces< art::Assns <recob::PFParticle, sbn::SimpleFlashMatch> >();
76 if(fFlashStart > 0. || fFlashEnd < 0.){
77 throw cet::exception(
"FlashPredict")
78 <<
"fFlashStart has to be non-positive, "
79 <<
"and fFlashEnd has to be non-negative.";
82 if(
p.get<
double>(
"DriftDistance") != driftDistance()){
83 mf::LogError(
"FlashPredict")
84 <<
"Provided driftDistance: " <<
p.get<
double>(
"DriftDistance")
85 <<
" is different than expected: " << driftDistance();
88 if(fSBND && !fICARUS) {
89 if(fUseOppVolMetric) {
90 throw cet::exception(
"FlashPredict")
91 <<
"UseOppVolMetric: " << std::boolalpha << fUseOppVolMetric <<
"\n"
92 <<
"Not supported on SBND. Stopping.";
94 fTPCPerDriftVolume = 1;
95 fDriftVolumes = fNTPC/fTPCPerDriftVolume;
97 else if(fICARUS && !fSBND) {
98 if(fUseUncoatedPMT || fUseARAPUCAS) {
99 throw cet::exception(
"FlashPredict")
100 <<
"UseUncoatedPMT: " << std::boolalpha << fUseUncoatedPMT <<
",\n"
101 <<
"UseARAPUCAS: " << std::boolalpha << fUseARAPUCAS <<
"\n"
102 <<
"Not supported on ICARUS. Stopping.\n";
104 fTPCPerDriftVolume = 2;
105 fDriftVolumes = fNTPC/fTPCPerDriftVolume;
108 throw cet::exception(
"FlashPredict")
109 <<
"Detector: " << fDetector
110 <<
", not supported. Stopping.\n";
113 if (fSBND && fCryostat != 0) {
114 throw cet::exception(
"FlashPredict")
115 <<
"SBND has only one cryostat. \n"
116 <<
"Check Detector and Cryostat parameter." << std::endl;
118 else if (fICARUS && fCryostat > 1) {
119 throw cet::exception(
"FlashPredict")
120 <<
"ICARUS has only two cryostats. \n"
121 <<
"Check Detector and Cryostat parameter." << std::endl;
124 if (fMakeTree) initTree();
128 consumes<std::vector<recob::PFParticle>>(fPandoraProducer);
129 consumes<std::vector<recob::Slice>>(fPandoraProducer);
130 consumes<art::Assns<recob::SpacePoint, recob::PFParticle>>(fPandoraProducer);
131 consumes<std::vector<recob::SpacePoint>>(fSpacePointProducer);
132 consumes<art::Assns<recob::Hit, recob::SpacePoint>>(fSpacePointProducer);
133 consumes<std::vector<recob::OpHit>>(fOpHitProducer);
134 if(fUseARAPUCAS && !fOpHitARAProducer.empty())
135 consumes<std::vector<recob::OpHit>>(fOpHitARAProducer);
142 std::unique_ptr< std::vector<sFM> >
143 sFM_v(
new std::vector<sFM>);
144 std::unique_ptr< art::Assns <recob::PFParticle, sFM> >
145 pfp_sFM_assn_v(
new art::Assns<recob::PFParticle, sFM>);
177 mf::LogInfo(
"FlashPredict")
178 <<
"No pfp neutrino on event. Skipping...";
181 for(
size_t pId=0; pId<pfps_h->size(); pId++) {
182 if(!pfps_h->at(pId).IsPrimary())
continue;
183 const art::Ptr<recob::PFParticle> pfp_ptr(pfps_h, pId);
188 evt.put(std::move(sFM_v));
189 evt.put(std::move(pfp_sFM_assn_v));
194 auto const& slice_h = evt.getValidHandle<std::vector<recob::Slice>>(
fPandoraProducer);
195 _slices = slice_h.product()->size();
197 mf::LogWarning(
"FlashPredict")
198 <<
"No recob:Slice on event. Skipping...";
201 for(
size_t pId=0; pId<pfps_h->size(); pId++) {
202 if(!pfps_h->at(pId).IsPrimary())
continue;
203 const art::Ptr<recob::PFParticle> pfp_ptr(pfps_h, pId);
208 evt.put(std::move(sFM_v));
209 evt.put(std::move(pfp_sFM_assn_v));
215 art::Handle<std::vector<recob::OpHit>> ophits_h;
217 if(!ophits_h.isValid()) {
218 mf::LogError(
"FlashPredict")
219 <<
"No optical hits from producer module "
223 for(
size_t pId=0; pId<pfps_h->size(); pId++) {
224 if(!pfps_h->at(pId).IsPrimary())
continue;
225 const art::Ptr<recob::PFParticle> pfp_ptr(pfps_h, pId);
230 evt.put(std::move(sFM_v));
231 evt.put(std::move(pfp_sFM_assn_v));
235 std::vector<recob::OpHit> opHits(ophits_h->size());
239 art::Handle<std::vector<recob::OpHit>> ophits_ara_h;
241 if(!ophits_ara_h.isValid()) {
242 mf::LogError(
"FlashPredict")
243 <<
"Non valid ophits from ARAPUCAS"
248 std::vector<recob::OpHit> opHitsARA(ophits_ara_h->size());
250 opHits.insert(opHits.end(),
251 opHitsARA.begin(), opHitsARA.end());
256 std::vector<recob::OpHit> opHitsRght, opHitsLeft;
257 const std::vector<SimpleFlash> simpleFlashes = (
fSBND) ?
259 if(simpleFlashes.empty()){
260 mf::LogWarning(
"FlashPredict")
261 <<
"\nNo OpHits in beam window,"
262 <<
"\nor the integral is less or equal to " <<
fMinFlashPE <<
" or 0."
266 for(
size_t pId=0; pId<pfps_h->size(); pId++) {
267 if(!pfps_h->at(pId).IsPrimary())
continue;
268 const art::Ptr<recob::PFParticle> pfp_ptr(pfps_h, pId);
273 evt.put(std::move(sFM_v));
274 evt.put(std::move(pfp_sFM_assn_v));
280 std::map<unsigned, FlashMetrics> flashMetricsMap;
281 for(
auto& chargeDigest : chargeDigestMap) {
283 const int pfpPDGC = chargeDigest.second.pfpPDGC;
284 const auto& pfp_ptr = chargeDigest.second.pfp_ptr;
285 const auto& qClusters = chargeDigest.second.qClusters;
286 const auto& tpcWithHits = chargeDigest.second.tpcWithHits;
288 if(chargeDigest.first < 0.){
289 mf::LogDebug(
"FlashPredict") <<
"Not a nu candidate slice. Skipping...";
291 mf::LogDebug(
"FlashPredict") <<
"Creating sFM and PFP-sFM association";
298 unsigned hitsInVolume = 0;
299 bool in_right =
false, in_left =
false;
300 for(
unsigned t : tpcWithHits){
308 mf::LogError(
"FlashPredict")
309 <<
"ERROR!!! tpcWithHits.size() " << tpcWithHits.size();
314 mf::LogWarning(
"FlashPredict") <<
"Clusters with No Charge. Skipping...";
316 mf::LogDebug(
"FlashPredict") <<
"Creating sFM and PFP-sFM association";
324 Score score = {std::numeric_limits<double>::max()};
325 bool hits_ophits_concurrence =
false;
326 for(
auto& simpleFlash : simpleFlashes) {
327 unsigned ophsInVolume = simpleFlash.ophsInVolume;
328 if(hitsInVolume != ophsInVolume){
344 hits_ophits_concurrence =
true;
346 unsigned flashUId = simpleFlash.ophsInVolume * 10 + simpleFlash.flashId;
347 bool mets_in_map = flashMetricsMap.find(flashUId) != flashMetricsMap.end();
351 mf::LogDebug(
"FlashPredict")
352 <<
"Reusing metrics previously computed, for flashUId " << flashUId;
355 flashMetricsMap[flashUId] = flash_tmp;
364 if(!hits_ophits_concurrence) {
366 "\nConsider setting ForceConcurrence to false to lower requirements";
367 mf::LogInfo(
"FlashPredict")
368 <<
"No OpHits where there's charge. Skipping..." << extra_message;
370 mf::LogDebug(
"FlashPredict") <<
"Creating sFM and PFP-sFM association";
377 printMetrics(
"ERROR", charge, flash, pfpPDGC, tpcWithHits, 0, mf::LogError(
"FlashPredict"));
379 mf::LogDebug(
"FlashPredict") <<
"Creating sFM and PFP-sFM association";
386 if(score.
total > 0. &&
387 score.
total < std::numeric_limits<double>::max()){
389 _mcT0 = chargeDigest.second.mcT0;
396 mf::LogDebug(
"FlashPredict") <<
"Creating sFM and PFP-sFM association";
397 Charge c{charge.
q, TVector3(charge.
x_gl, charge.
y, charge.
z)};
399 sFM_v->emplace_back(
sFM(
true, flash.
time, c, f, score));
403 mf::LogError(
"FlashPredict") <<
"ERROR: score <= 0. Dumping info."
409 printMetrics(
"ERROR", charge, flash, pfpPDGC, tpcWithHits, 0, mf::LogError(
"FlashPredict"));
416 evt.put(std::move(sFM_v));
417 evt.put(std::move(pfp_sFM_assn_v));
424 art::ServiceHandle<art::TFileService>
tfs;
467 cet::search_path sp(
"FW_SEARCH_PATH");
469 mf::LogError(
"FlashPredict")
470 <<
"Could not find the light-charge match root file '"
472 throw cet::exception(
"FlashPredict")
473 <<
"Could not find the light-charge match root file '"
476 mf::LogInfo(
"FlashPredict") <<
"Opening file with metrics: " <<
fname;
477 TFile *infile =
new TFile(fname.c_str(),
"READ");
478 auto metricsInFile = infile->GetListOfKeys();
479 if(!metricsInFile->Contains(
"dy_h1") ||
480 !metricsInFile->Contains(
"dz_h1") ||
481 !metricsInFile->Contains(
"rr_h1") ||
482 !metricsInFile->Contains(
"ratio_h1") ||
483 !metricsInFile->Contains(
"rr_fit_l") ||
484 !metricsInFile->Contains(
"rr_fit_m") ||
485 !metricsInFile->Contains(
"rr_fit_h") ||
486 !metricsInFile->Contains(
"ratio_fit_l") ||
487 !metricsInFile->Contains(
"ratio_fit_m") ||
488 !metricsInFile->Contains(
"ratio_fit_h"))
490 mf::LogError(
"FlashPredict")
491 <<
"The metrics file '" << fname <<
"' lacks at least one metric.";
492 throw cet::exception(
"FlashPredict")
493 <<
"The metrics file '" << fname <<
"'lacks at least one metric.";
496 TH1 *temphisto = (TH1*)infile->Get(
"dy_h1");
497 int bins = temphisto->GetNbinsX();
499 std::cout <<
" problem with input histos for dy " << bins <<
" bins " << std::endl;
505 for (
int ib = 1; ib <= bins; ++ib) {
506 fdYMeans.push_back(temphisto->GetBinContent(ib));
507 double tt = temphisto->GetBinError(ib);
509 std::cout <<
"zero value for bin spread in dy" << std::endl;
511 std::cout <<
"temphisto->GetBinContent(ib):\t" << temphisto->GetBinContent(ib) <<
"\n";
512 std::cout <<
"temphisto->GetBinError(ib):\t" << temphisto->GetBinError(ib) <<
"\n";
519 temphisto = (TH1*)infile->Get(
"dz_h1");
520 bins = temphisto->GetNbinsX();
522 std::cout <<
" problem with input histos for dz " << bins <<
" bins " << std::endl;
528 for (
int ib = 1; ib <= bins; ++ib) {
529 fdZMeans.push_back(temphisto->GetBinContent(ib));
530 double tt = temphisto->GetBinError(ib);
532 std::cout <<
"zero value for bin spread in dz" << std::endl;
534 std::cout <<
"temphisto->GetBinContent(ib):\t" << temphisto->GetBinContent(ib) <<
"\n";
535 std::cout <<
"temphisto->GetBinError(ib):\t" << temphisto->GetBinError(ib) <<
"\n";
542 temphisto = (TH1*)infile->Get(
"rr_h1");
543 bins = temphisto->GetNbinsX();
545 std::cout <<
" problem with input histos for rr " << bins <<
" bins " << std::endl;
551 for (
int ib = 1; ib <= bins; ++ib) {
552 double me = temphisto->GetBinContent(ib);
554 double tt = temphisto->GetBinError(ib);
556 std::cout <<
"zero value for bin spread in rr" << std::endl;
558 std::cout <<
"temphisto->GetBinContent(ib):\t" << temphisto->GetBinContent(ib) <<
"\n";
559 std::cout <<
"temphisto->GetBinError(ib):\t" << temphisto->GetBinError(ib) <<
"\n";
568 TF1* tempF1 = (TF1*)infile->Get(nold.c_str());
569 auto params = tempF1->GetParameters();
570 rrF.f = std::make_unique<TF1>(nnew.c_str(),
fRR_TF1_fit.c_str(),
572 rrF.f->SetParameters(params);
579 temphisto = (TH1*)infile->Get(
"ratio_h1");
580 bins = temphisto->GetNbinsX();
582 std::cout <<
" problem with input histos for ratio " << bins <<
" bins " << std::endl;
588 for (
int ib = 1; ib <= bins; ++ib) {
589 double me = temphisto->GetBinContent(ib);
591 double tt = temphisto->GetBinError(ib);
593 std::cout <<
"zero value for bin spread in ratio" << std::endl;
595 std::cout <<
"temphisto->GetBinContent(ib):\t" << temphisto->GetBinContent(ib) <<
"\n";
596 std::cout <<
"temphisto->GetBinError(ib):\t" << temphisto->GetBinError(ib) <<
"\n";
603 std::string nold =
"ratio_fit_" +
kSuffixes[
s];
604 std::string nnew =
"ratioFit_" +
kSuffixes[
s];
605 TF1* tempF1 = (TF1*)infile->Get(nold.c_str());
606 auto params = tempF1->GetParameters();
607 ratioF.f = std::make_unique<TF1>(nnew.c_str(),
fRatio_TF1_fit.c_str(),
609 ratioF.f->SetParameters(params);
616 TH2* tmp1_h2 = (TH2*)infile->Get(
"rr_h2");
617 fRRH2 = (TH2D*)tmp1_h2->Clone(
"fRRH2");
618 TH2* tmp2_h2 = (TH2*)infile->Get(
"ratio_h2");
619 fRatioH2 = (TH2D*)tmp2_h2->Clone(
"fRatioH2");
623 mf::LogInfo(
"FlashPredict") <<
"Finish loading metrics";
628 const std::vector<art::Ptr<simb::MCParticle>>& mcParticles)
630 auto clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataForJob();
633 for(
auto& mcp: mcParticles){
634 if(mcp->TrackId() == pidMaxEnergy){
635 return mcp->Position().T();
645 double xave = 0.;
double yave = 0.;
646 double zave = 0.;
double norm = 0.;
647 for (
auto& qp : qClusters) {
654 double charge_q =
norm;
655 double charge_x_gl = xave /
norm;
656 double charge_x =
foldXGl(charge_x_gl);
657 double charge_y = yave /
norm;
658 double charge_z = zave /
norm;
659 return {charge_x, charge_x_gl, charge_y, charge_z, charge_q,
true};
671 std::unique_ptr<TH1F> ophY = std::make_unique<TH1F>(
"ophY",
"",
fYBins,
fYLow,
fYHigh);
672 std::unique_ptr<TH1F> ophZ = std::make_unique<TH1F>(
"ophZ",
"",
fZBins,
fZLow,
fZHigh);
679 double sum_unPE = 0.;
680 double sum_visARA_PE = 0.;
681 double sum_PE2Y = 0.;
double sum_PE2Z = 0.;
682 double sum_PE2Y2 = 0.;
double sum_PE2Z2 = 0.;
684 for(
auto oph=opH_beg; oph!=opH_end; ++oph){
685 int opChannel = oph->OpChannel();
686 auto& opDet =
fGeometry->OpDetGeoFromOpChannel(opChannel);
687 auto opDetXYZ = opDet.GetCenter();
689 bool is_pmt_vis =
false, is_ara_vis =
false;
692 if(op_type ==
"pmt_uncoated") {
694 is_pmt_vis =
true, is_ara_vis =
false;
696 else if(op_type ==
"xarapuca_vis" || op_type ==
"arapuca_vis") {
697 is_pmt_vis =
false, is_ara_vis =
true;
702 double ophPE = oph->PE();
703 double ophPE2 = ophPE * ophPE;
707 sum_PE2Y += ophPE2 * opDetXYZ.Y();
708 sum_PE2Z += ophPE2 * opDetXYZ.Z();
709 sum_PE2Y2 += ophPE2 * opDetXYZ.Y() * opDetXYZ.Y();
710 sum_PE2Z2 += ophPE2 * opDetXYZ.Z() * opDetXYZ.Z();
712 ophY->Fill(opDetXYZ.Y(), ophPE);
713 ophZ->Fill(opDetXYZ.Z(), ophPE);
717 std::abs(peSumMax_wallX-opDetXYZ.X()) > 5.) sum_unPE += ophPE;
724 sum_visARA_PE += ophPE;
733 flash.
unpe = sum_unPE;
736 flash.
unpe += sum_visARA_PE;
739 flash.
yb = sum_PE2Y / sum_PE2;
740 flash.
zb = sum_PE2Z / sum_PE2;
741 flash.
rr = std::sqrt(
742 std::abs(sum_PE2Y2 + sum_PE2Z2 + sum_PE2 * (flash.
yb * flash.
yb + flash.
zb * flash.
zb)
743 - 2.0 * (flash.
yb * sum_PE2Y + flash.
zb * sum_PE2Z) ) / sum_PE2);
751 flash.
x = peSumMax_wallX;
754 flash.
y_skew = ophY->GetSkewness();
755 flash.
z_skew = ophZ->GetSkewness();
756 if(!std::isnan(flash.
h_x)){
757 double y_correction = 0.;
758 double z_correction = 0.;
759 const double skew_threshold = 10.;
772 flash.
y = flash.
yb - y_correction;
773 flash.
z = flash.
zb - z_correction;
779 std::string channels;
780 for(
auto oph=opH_beg; oph!=opH_end; ++oph) channels +=
std::to_string(oph->OpChannel()) +
' ';
783 mf::LogError(
"FlashPredict")
784 <<
"Really odd that I landed here, this shouldn't had happen.\n"
785 <<
"sum: \t" << sum <<
"\n"
786 <<
"sum_PE: \t" << sum_PE <<
"\n"
787 <<
"sum_unPE: \t" << sum_unPE <<
"\n"
789 <<
"opHits size: \t" <<
std::distance(opH_beg, opH_end) <<
"\n"
790 <<
"channels: \t" << channels << std::endl;
799 const std::set<unsigned>& tpcWithHits,
800 const int pdgc)
const
805 auto out = mf::LogWarning(
"FlashPredict");
819 double scr_ratio = 0.;
826 double cathode_tolerance = 40.;
827 if(x_gl_diff > x_diff + cathode_tolerance)
835 mf::LogDebug(
"FlashPredict")
836 <<
"score:\t" << score <<
"using " << tcount <<
" terms";
837 return {
score, scr_y, scr_z, scr_rr, scr_ratio};
842 double flash_rr,
double flash_ratio)
const
844 std::vector<double> rrXs;
845 double rr_hypoX, rr_hypoXWgt;
846 for(
const auto& rrF :
fRRFits){
847 if(rrF.min < flash_rr && flash_rr < rrF.max){
851 mf::LogWarning(
"FlashPredict")
852 <<
"Couldn't find root with fRRFits.\n"
853 <<
"min/_flash_rr/max:"
854 << rrF.min <<
"/" << flash_rr <<
"/" << rrF.max;
859 rr_hypoX = (rrXs[0] + rrXs[1])/2.;
860 double half_interval = (rrXs[1] - rrXs[0])/2.;
861 rr_hypoXWgt = 1./(half_interval*half_interval);
863 else if(rrXs.size() == 0){
868 if(flash_rr < fRRFits[2].min){
869 rr_hypoX = rrXs[0]/2.;
870 double half_interval = rrXs[0]/2.;
871 rr_hypoXWgt = 1./(half_interval*half_interval);
876 rr_hypoXWgt = 1./(half_interval*half_interval);
881 return {rr_hypoX, rr_hypoXWgt, rr_hypoX, 0.};
883 std::vector<double> ratioXs;
884 double ratio_hypoX, ratio_hypoXWgt;
886 if(ratioF.min < flash_ratio && flash_ratio < ratioF.max){
890 mf::LogWarning(
"FlashPredict")
891 <<
"Couldn't find root with fRatioFits.\n"
892 <<
"min/flash_ratio/max:"
893 << ratioF.min <<
"/" << flash_ratio <<
"/" << ratioF.max;
897 if(ratioXs.size() > 1){
898 ratio_hypoX = (ratioXs[0] + ratioXs[1])/2.;
899 double half_interval = (ratioXs[1] - ratioXs[0])/2.;
900 ratio_hypoXWgt = 1./(half_interval*half_interval);
902 else if(ratioXs.size() == 0){
907 if(flash_ratio < fRatioFits[2].min){
908 ratio_hypoX = ratioXs[0]/2.;
909 double half_interval = ratioXs[0]/2.;
910 ratio_hypoXWgt = 1./(half_interval*half_interval);
915 ratio_hypoXWgt = 1./(half_interval*half_interval);
919 double sum_weights = rr_hypoXWgt + ratio_hypoXWgt;
921 (rr_hypoX*rr_hypoXWgt + ratio_hypoX*ratio_hypoXWgt) / sum_weights;
922 double hypo_x_err = std::sqrt(sum_weights) / sum_weights;
923 return {hypo_x, hypo_x_err, rr_hypoX, ratio_hypoX};
928 double flash_rr,
double flash_ratio)
const
933 double sum_weights = rr_hypoXWgt + ratio_hypoXWgt;
935 (rr_hypoX*rr_hypoXWgt + ratio_hypoX*ratio_hypoXWgt) / sum_weights;
936 double hypo_x_err = std::sqrt(sum_weights) / sum_weights;
937 return {hypo_x, hypo_x_err, rr_hypoX, ratio_hypoX};
942 double metric_value,
const TH2D* metric_h2)
const
944 int bin = metric_h2->GetYaxis()->FindBin(metric_value);
945 int bins = metric_h2->GetNbinsY();
946 double metric_hypoX = -1.;
947 double metric_hypoXWgt = 0.;
949 while(0 < bin-bin_buff || bin+bin_buff <= bins){
950 int low_bin = (0 < bin-bin_buff) ? bin-bin_buff : 0;
951 int high_bin = (bin+bin_buff <= bins) ? bin+bin_buff : -1;
952 TH1D* metric_px = metric_h2->ProjectionX(
"metric_px", low_bin, high_bin);
954 metric_hypoX = metric_px->GetRandom();
956 double metric_rmsX = metric_px->GetRMS();
958 mf::LogDebug(
"FlashPredict")
959 <<
"metric_h2 projected on metric_value: "<< metric_value
961 <<
", bin_buff: " << bin_buff
962 <<
"; has " << metric_px->GetEntries() <<
" entries."
963 <<
"\nmetric_hypoX: " << metric_hypoX
964 <<
", metric_rmsX: " << metric_rmsX;
967 metric_hypoXWgt = 1/(metric_rmsX*metric_rmsX);
968 return {metric_hypoX, metric_hypoXWgt};
977 const art::Event&
evt,
978 const art::ValidHandle<std::vector<recob::PFParticle>>& pfps_h)
981 const art::FindManyP<recob::SpacePoint>
983 const auto& spacepoints_h =
985 const art::FindManyP<recob::Hit>
996 std::vector<art::Ptr<simb::MCParticle>> mcParticles;
1002 std::unordered_map<size_t, size_t> pfpMap;
1003 for(
size_t pId=0; pId<pfps_h->size(); pId++) {
1004 pfpMap[pfps_h->at(pId).Self()] = pId;
1039 for(
size_t pId=0; pId<pfps_h->size(); pId++) {
1040 if(!pfps_h->at(pId).IsPrimary())
continue;
1041 const art::Ptr<recob::PFParticle> pfp_ptr(pfps_h, pId);
1042 unsigned pfpPDGC =
std::abs(pfp_ptr->PdgCode());
1044 (pfpPDGC != 12) && (pfpPDGC != 14) && (pfpPDGC != 16)){
1045 chargeDigestMap[-10.-pId] =
1049 std::set<unsigned> tpcWithHits;
1051 std::vector<art::Ptr<recob::PFParticle>> particles_in_slice;
1052 addDaughters(pfpMap, pfp_ptr, pfps_h, particles_in_slice);
1055 std::vector<art::Ptr<recob::Hit>> hits_in_slice;
1057 for(
const auto& particle: particles_in_slice) {
1058 const auto particle_key = particle.key();
1059 const auto& particle_spacepoints = pfp_spacepoints_assns.at(particle_key);
1060 double particleQ = 0.;
1062 for(
const auto& spacepoint : particle_spacepoints) {
1063 const auto spacepoint_key = spacepoint.key();
1064 const auto& hits = spacepoint_hits_assns.at(spacepoint_key);
1066 hits_in_slice.insert(hits_in_slice.end(),
1067 hits.begin(), hits.end());
1069 const auto& pos = spacepoint->XYZ();
1070 double spacepointQ = 0.;
1072 for(
const auto&
hit : hits) {
1076 const double hitQ =
hit->Integral();
1078 spacepointQ += hitQ;
1079 hitsClusters.emplace_back(pos[0], pos[1], pos[2], hitQ);
1080 const auto itpc = wId.
TPC;
1081 tpcWithHits.insert(itpc);
1084 particleQ += spacepointQ;
1085 spsClusters.insert(spsClusters.end(),
1086 hitsClusters.begin(), hitsClusters.end());
1090 particleQ *= chargeToNPhots;
1092 sliceQ += particleQ;
1093 particlesClusters.insert(particlesClusters.end(),
1094 spsClusters.begin(), spsClusters.end());
1099 chargeDigestMap[sliceQ] =
1100 ChargeDigest(pId, pfpPDGC, pfp_ptr, particlesClusters, tpcWithHits, mcT0);
1102 return chargeDigestMap;
1107 const std::unordered_map<size_t, size_t>& pfpMap,
1108 const art::Ptr<recob::PFParticle>& pfp_ptr,
1109 const art::ValidHandle<std::vector<recob::PFParticle>>& pfps_h,
1110 std::vector<art::Ptr<recob::PFParticle>>& mothers_daughters)
const
1112 mothers_daughters.push_back(pfp_ptr);
1113 const auto daughters = pfp_ptr->Daughters();
1114 for(
const auto daughter : daughters) {
1115 const art::Ptr<recob::PFParticle> daughter_ptr(pfps_h, pfpMap.at(daughter));
1116 addDaughters(pfpMap, daughter_ptr, pfps_h, mothers_daughters);
1124 art::Handle<std::vector<simb::MCTruth> > mctruthList_h;
1125 std::vector<art::Ptr<simb::MCTruth> > mclist;
1126 if(evt.getByLabel(
"generator", mctruthList_h))
1127 art::fill_ptr_vector(mclist, mctruthList_h);
1128 unsigned true_nus = 0;
1129 for(
auto const& mc: mclist){
1130 if(mc->Origin() == simb::kBeamNeutrino) ++true_nus;
1139 const auto& c = chargeMetrics;
1148 const auto& f = flashMetrics;
1169 const double mean,
const double spread)
const
1177 const double mean,
const double spread)
const
1179 return std::abs(m - mean) / spread;
1185 const art::ValidHandle<std::vector<recob::PFParticle>>& pfps_h)
const
1187 for (
auto const&
p : (*pfps_h)) {
1188 unsigned pfpPDGC =
std::abs(
p.PdgCode());
1189 if ((pfpPDGC == 12) ||
1200 std::vector<recob::OpHit>& opHits,
1201 const art::Handle<std::vector<recob::OpHit>>& ophits_h)
const
1207 auto opHitInWindow =
1209 {
return ((oph.PeakTime() >
s) &&
1210 (oph.PeakTime() <
e) &&
1213 auto it = std::copy_if(ophits_h->begin(), ophits_h->end(), opHits.begin(),
1221 std::vector<recob::OpHit>& opHits,
1222 std::vector<recob::OpHit>& opHitsRght,
1223 std::vector<recob::OpHit>& opHitsLeft)
const
1225 std::unique_ptr<TH1D> opHitsTimeHist = std::make_unique<TH1D>(
1227 opHitsTimeHist->SetOption(
"HIST");
1228 opHitsTimeHist->SetDirectory(0);
1229 std::unique_ptr<TH1D> opHitsTimeHistRght = std::make_unique<TH1D>(
1231 opHitsTimeHistRght->SetOption(
"HIST");
1232 opHitsTimeHistRght->SetDirectory(0);
1233 std::unique_ptr<TH1D> opHitsTimeHistLeft = std::make_unique<TH1D>(
1235 opHitsTimeHistLeft->SetOption(
"HIST");
1236 opHitsTimeHistLeft->SetDirectory(0);
1238 opHits, opHitsRght, opHitsLeft,
1239 opHitsTimeHist, opHitsTimeHistRght, opHitsTimeHistLeft))
return {};
1241 bool oph_in_rght =
false, oph_in_left =
false;
1242 std::vector<FlashPredict::SimpleFlash> simpleFlashes;
1243 if(opHitsRght.size() > 0 && opHitsTimeHistRght->GetEntries() > 0){
1248 if(opHitsLeft.size() > 0 && opHitsTimeHistLeft->GetEntries() > 0){
1253 if(oph_in_rght && oph_in_left ){
1256 else if(!oph_in_rght && !oph_in_left){
1259 return simpleFlashes;
1265 std::vector<recob::OpHit>& opHits)
const
1267 std::unique_ptr<TH1D> opHitsTimeHist = std::make_unique<TH1D>(
1269 opHitsTimeHist->SetOption(
"HIST");
1270 opHitsTimeHist->SetDirectory(0);
1272 if(ophsInVolume == 0)
return {};
1274 std::vector<FlashPredict::SimpleFlash> simpleFlashes;
1277 return simpleFlashes;
1283 const std::vector<recob::OpHit>& opHits,
1284 std::vector<recob::OpHit>& opHitsRght,
1285 std::vector<recob::OpHit>& opHitsLeft,
1286 std::unique_ptr<TH1D>& opHitsTimeHist,
1287 std::unique_ptr<TH1D>& opHitsTimeHistRght,
1288 std::unique_ptr<TH1D>& opHitsTimeHistLeft)
const
1290 for(
const auto& oph : opHits) {
1291 auto ch = oph.OpChannel();
1294 opHitsTimeHist->Fill(oph.PeakTime(), oph.PE());
1296 opHitsRght.emplace_back(oph);
1297 opHitsTimeHistRght->Fill(oph.PeakTime(), oph.PE());
1300 opHitsLeft.emplace_back(oph);
1301 opHitsTimeHistLeft->Fill(oph.PeakTime(), oph.PE());
1304 if(opHitsTimeHist->GetEntries() <= 0 ||
1305 opHitsTimeHist->Integral() <= 0. ||
1306 opHitsTimeHist->Integral() <=
fMinFlashPE)
return false;
1307 if(opHitsTimeHistRght->GetEntries() <= 0 ||
1308 opHitsTimeHistRght->Integral() <= 0. ||
1310 opHitsTimeHistRght->Reset();
1311 if(opHitsTimeHistLeft->GetEntries() <= 0 ||
1312 opHitsTimeHistLeft->Integral() <= 0. ||
1314 opHitsTimeHistLeft->Reset();
1321 const std::vector<recob::OpHit>& opHits,
1322 std::unique_ptr<TH1D>& opHitsTimeHist)
const
1324 bool in_right =
false, in_left =
false;
1325 for(
auto const& oph : opHits) {
1326 auto ch = oph.OpChannel();
1327 auto opDetXYZ =
fGeometry->OpDetGeoFromOpChannel(ch).GetCenter();
1328 if(!
fGeoCryo->ContainsPosition(opDetXYZ))
continue;
1329 opHitsTimeHist->Fill(oph.PeakTime(), oph.PE());
1334 if(opHitsTimeHist->GetEntries() <= 0 ||
1335 opHitsTimeHist->Integral() <= 0. ||
1336 opHitsTimeHist->Integral() <=
fMinFlashPE)
return 0;
1345 std::vector<FlashPredict::SimpleFlash>& simpleFlashes,
1346 std::vector<recob::OpHit>& opHits,
1347 const unsigned ophsInVolume,
1348 std::unique_ptr<TH1D>& opHitsTimeHist)
const
1350 OpHitIt opH_beg = opHits.begin();
1351 for(
unsigned flashId=0; flashId<
fMaxFlashes; ++flashId){
1352 int ibin = opHitsTimeHist->GetMaximumBin();
1353 double maxpeak_time = opHitsTimeHist->GetBinCenter(ibin);
1355 double highedge = maxpeak_time +
fFlashEnd;
1356 mf::LogDebug(
"FlashPredict")
1357 <<
"light window " << lowedge <<
" " << highedge << std::endl;
1358 int lowedge_bin = opHitsTimeHist->FindBin(lowedge);
1359 int highedge_bin = opHitsTimeHist->FindBin(highedge);
1361 if (opHitsTimeHist->Integral(lowedge_bin, highedge_bin) <=
fMinFlashPE ||
1362 opHitsTimeHist->Integral(lowedge_bin, highedge_bin) <= 0. ){
1363 if(flashId == 0)
return false;
1367 for(
int i=lowedge_bin; i<highedge_bin; ++i){
1368 opHitsTimeHist->SetBinContent(i, 0.);
1370 auto peakInsideEdges =
1372 {
return ((lowedge <= oph.PeakTime()) && (oph.PeakTime() <= highedge)); };
1375 OpHitIt opH_end = std::partition(opH_beg, opHits.end(),
1377 simpleFlashes.emplace_back
1379 opH_beg, opH_end, maxpeak_time));
1388 if(detName.find(
"sbnd") != std::string::npos)
return "SBND";
1389 if(detName.find(
"icarus") != std::string::npos)
return "ICARUS";
1396 if(
fSBND)
return true;
1400 auto&
p =
fGeometry->OpDetGeoFromOpChannel(pdChannel).GetCenter();
1411 auto p =
fGeometry->OpDetGeoFromOpChannel(pdChannel).GetCenter();
1412 if(
fCryostat == 0)
p.SetX((
p.X() + 222.)/2. - 222.);
1413 if(
fCryostat == 1)
p.SetX((
p.X() - 222.)/2. + 222.);
1419 const std::set<unsigned>& tpcWithHits)
const
1422 if(tpcWithHits.size() ==
fNTPC)
return true;
1424 for(
auto itpc: tpcWithHits)
if(itpc == pdTPC)
return true;
1432 auto p =
fGeometry->OpDetGeoFromOpChannel(pdChannel).GetCenter();
1441 std::map<double, double> opdetX_PE {{-99999., 0.}};
1442 for(
auto oph=opH_beg; oph!=opH_end; ++oph){
1443 double ophPE = oph->PE();
1444 double ophPE2 = ophPE*ophPE;
1445 double opdetX =
fGeometry->OpDetGeoFromOpChannel(
1446 oph->OpChannel()).GetCenter().X();
1447 bool stored =
false;
1448 for(
auto&
m : opdetX_PE){
1455 if(!stored) opdetX_PE[opdetX] = ophPE2;
1457 auto maxIt = std::max_element(
1458 opdetX_PE.begin(), opdetX_PE.end(),
1459 [] (
const auto&
a,
const auto& b) ->
bool{
return a.second < b.second;});
1460 return maxIt->first;
1466 std::list<double> wiresX_gl;
1467 for (
size_t t = 0; t <
fNTPC; t++) {
1471 wiresX_gl.unique([](
double l,
double r) {
return std::abs(l - r) < 0.00001;});
1486 const double flash_x)
const
1493 if(((*
w<0) == (flash_x<0)) &&
std::abs(*
w - flash_x) < min) {
1500 return (wId % 2) ? (*wIt - hypo_x) : (*wIt + hypo_x);
1511 if(wxl < x_gl && x_gl<= wxh){
1512 double mid = (wxl + wxh)/2.;
1527 if(wxl < x && x<= wxh){
1528 double mid = (wxl + wxh)/2.;
1536 template <
typename Stream>
1539 std::ostringstream
m;
1540 m <<
"Bookkeeping\n";
1541 m <<
"----------------------------------------\n"
1543 <<
"\tEvents: \t " <<
bk.
events <<
"\n";
1560 m <<
"\t----------------------\n";
1564 <<
"----------------------------------------\n"
1577 <<
", scored as: " <<
k0VUVPEScr <<
" ERROR!\n";
1583 m <<
"\t----------------------\n";
1587 <<
"----------------------------------------";
1610 template <
typename Stream>
1615 const std::set<unsigned>& tpcWithHits,
1623 <<
"Big term " << metric <<
":\t" << term <<
"\n"
1624 <<
std::left << std::setw(12) << std::setfill(
' ')
1625 <<
"xbin: \t" << xbin <<
"\n"
1626 <<
"pfp.PdgCode:\t" << pdgc <<
"\n"
1627 <<
"tpcWithHits:\t" << tpcs <<
"\n"
1628 <<
"_slices: \t" << std::setw(8) <<
_slices <<
"\n"
1629 <<
"_true_nus: \t" << std::setw(8) <<
_true_nus <<
"\n"
1630 <<
"_mcT0: \t" << std::setw(8) <<
_mcT0 <<
"\n"
1631 <<
"charge metrics:\n" << charge.
dumpMetrics() <<
"\n"
1632 <<
"flash metrics:\n" << flash.
dumpMetrics() <<
"\n";
const bool fForceConcurrence
static constexpr int kNoPFPInEvt
double cheatMCT0(const std::vector< art::Ptr< recob::Hit >> &hits, const std::vector< art::Ptr< simb::MCParticle >> &mcParticles)
std::vector< double > fdZMeans
std::vector< double > fRRSpreads
double foldXGl(const double x_gl) const
static constexpr unsigned kActivityInRght
double y
score for y metric
static constexpr unsigned kRght
static constexpr int kNotANuScr
void printMetrics(const std::string metric, const ChargeMetrics &charge, const FlashMetrics &flash, const int pdgc, const std::set< unsigned > &tpcWithHits, const double term, Stream &&out) const
bool isPDInCryo(const int pdChannel) const
process_name opflash particleana ie x
const double fBeamWindowStart
bool isSBNDPDRelevant(const int pdChannel, const std::set< unsigned > &tpcWithHits) const
double z
score for z metric
unsigned driftVolume(const double x) const
const double fTermThreshold
const art::ServiceHandle< geo::Geometry > fGeometry
const std::array< std::string, 3 > kSuffixes
void updateChargeMetrics(const ChargeMetrics &chargeMetrics)
static constexpr unsigned kLeft
Geometry information for a single TPC.
BEGIN_PROLOG or score(default)}sbnd_crttrackmatchingalg_crID
static constexpr int kNoChrgScr
void copyOpHitsInBeamWindow(std::vector< recob::OpHit > &opHits, const art::Handle< std::vector< recob::OpHit >> &ophit_h) const
const art::InputTag fOpHitARAProducer
const art::InputTag fPandoraProducer
static constexpr unsigned kActivityInBoth
Score computeScore(const ChargeMetrics &charge, const FlashMetrics &flash, const std::set< unsigned > &tpcWithHits, const int pdgc) const
std::string detectorName(const std::string detName) const
bool pfpNeutrinoOnEvent(const art::ValidHandle< std::vector< recob::PFParticle >> &pfps_h) const
static constexpr double kNoScrQ
double ratio
score for ratio metric
tuple m
now if test mode generate materials, CRT shell, world, gdml header else just generate CRT shell for u...
std::string dumpMetrics() const
std::vector< double > fRatioMeans
constexpr details::BinObj< T > bin(T value)
Returns a wrapper to print the specified data in binary format.
std::tuple< double, double > xEstimateAndRMS(double metric_value, const TH2D *metric_h2) const
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
static constexpr int kQNoOpHScr
sbn::SimpleFlashMatch::Score Score
const std::list< double > fWiresX_gl
const double fBeamWindowEnd
sbn::SimpleFlashMatch::Charge Charge
unsigned trueNus(art::Event &evt) const
double distance(geo::Point_t const &point, CathodeDesc_t const &cathode)
Returns the distance of a point from the cathode.
const double fMinParticleQ
void printBookKeeping(Stream &&out)
std::vector< double > fdYMeans
const bool fUseUncoatedPMT
const std::string fInputFilename
static constexpr int kNoSlcInEvt
std::string dumpMetrics() const
std::tuple< double, double, double, double > hypoFlashX_fits(double flash_rr, double flash_ratio) const
TTree * _flashmatch_nuslice_tree
std::array< Fits, 3 > fRRFits
Point GetCenter() const
Returns the centre of the wire plane in world coordinates [cm].
unsigned icarusPDinTPC(const int pdChannel) const
const std::string fRR_TF1_fit
Collection of charge deposition 3D point (cluster)
double rr
score for rr metric
static constexpr double kEps
unsigned fTPCPerDriftVolume
double driftDistance() const
static constexpr double kNoScrTime
std::tuple< double, double, double, double > hypoFlashX_H2(double flash_rr, double flash_ratio) const
ChargeDigestMap makeChargeDigest(const art::Event &evt, const art::ValidHandle< std::vector< recob::PFParticle >> &pfps_h)
double scoreTerm(const double m, const double n, const double mean, const double spread) const
std::vector< SimpleFlash > makeSimpleFlashes(std::vector< recob::OpHit > &opHits, std::vector< recob::OpHit > &opHitsRght, std::vector< recob::OpHit > &opHitsLeft) const
std::vector< double > fdZSpreads
bool findSimpleFlashes(std::vector< SimpleFlash > &simpleFlashes, std::vector< recob::OpHit > &opHits, const unsigned ophsInVolume, std::unique_ptr< TH1D > &opHitsTimeHist) const
auto norm(Vector const &v)
Return norm of the specified vector.
FlashPredict(fhicl::ParameterSet const &p)
void produce(art::Event &evt) override
std::list< double > wiresXGl() const
double wallXWithMaxPE(const OpHitIt opH_beg, const OpHitIt opH_end) const
const bool fSelectNeutrino
static constexpr unsigned kActivityInLeft
bool CreateAssn(art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t index=UINT_MAX)
Creates a single one-to-one association.
sbn::SimpleFlashMatch::Flash Flash
const double fMinSpacePointQ
ChargeMetrics computeChargeMetrics(const flashmatch::QCluster_t &qClusters) const
const double fDriftDistance
void updateFlashMetrics(const FlashMetrics &flashMetrics)
double mean(const std::vector< short > &wf, size_t start, size_t nsample)
std::array< Fits, 3 > fRatioFits
void updateScore(const Score &score)
bool createOpHitsTimeHist(const std::vector< recob::OpHit > &opHits, std::vector< recob::OpHit > &opHitsRght, std::vector< recob::OpHit > &opHitsLeft, std::unique_ptr< TH1D > &opHitsTimeHist, std::unique_ptr< TH1D > &opHitsTimeHistRght, std::unique_ptr< TH1D > &opHitsTimeHistLeft) const
std::vector< double > fRRMeans
const art::InputTag fSpacePointProducer
sbn::SimpleFlashMatch sFM
static constexpr bool kNoScr
std::map< double, ChargeDigest, std::greater< double >> ChargeDigestMap
std::string to_string(WindowPattern const &pattern)
then echo File list $list not found else cat $list while read file do echo $file sed s
static constexpr double kNoScrPE
const double fChargeToNPhotonsTrack
geo::PlaneGeo const & LastPlane() const
Returns the last wire plane (the farther from TPC center).
std::vector< double > fdYSpreads
G4ID TrueParticleIDFromTotalTrueEnergy(detinfo::DetectorClocksData const &clockData, const std::vector< art::Ptr< recob::Hit >> &pHits, const bool rollupUnsavedIDs)
The G4 ID of the true particle which deposits the most energy in a vector of recob::Hit.
const art::InputTag fOpHitProducer
static bool IsTrack(const art::Ptr< recob::PFParticle > particle)
Determine whether a particle has been reconstructed as track-like.
const unsigned fOpDetNormalizer
const bool fOnlyCollectionWires
const std::string fRatio_TF1_fit
FlashMetrics computeFlashMetrics(const SimpleFlash &simpleFlash) const
double flashXGl(const double hypo_x, const double flash_x) const
std::vector< double > fRatioSpreads
art::ServiceHandle< art::TFileService > tfs
const bool fStoreCheatMCT0
std::vector< recob::OpHit >::iterator OpHitIt
static constexpr int kNoOpHInEvt
static constexpr unsigned kMinEntriesInProjection
const std::unique_ptr< opdet::PDMapAlg > fPDMapAlgPtr
TPCID_t TPC
Index of the TPC within its cryostat.
static constexpr int k0VUVPEScr
const bool fNoAvailableMetrics
double total
total score, sum of terms
static void CollectMCParticles(const art::Event &evt, const std::string &label, MCParticleVector &particleVector)
Collect a vector of MCParticle objects from the ART event record.
void addDaughters(const std::unordered_map< size_t, size_t > &pfpMap, const art::Ptr< recob::PFParticle > &pfp_ptr, const art::ValidHandle< std::vector< recob::PFParticle >> &pfps_h, std::vector< art::Ptr< recob::PFParticle >> &pfp_v) const
const std::unique_ptr< geo::CryostatGeo > fGeoCryo
const bool fUseOppVolMetric
unsigned sbndPDinTPC(const int pdChannel) const
BEGIN_PROLOG could also be cout
const double fChargeToNPhotonsShower
Signal from collection planes.
const unsigned fMaxFlashes