4 #include "RecoUtils/RecoUtils.h"
12 const std::map<int, caf::HitsEnergy> &all_hits_map);
15 const std::vector<art::Ptr<simb::MCTruth>> &neutrinos,
21 const std::vector<geoalgo::AABox> &boxes);
24 const std::vector<art::Ptr<sim::MCTrack>> &mctracks,
25 const std::vector<geo::BoxBoundedGeo> &volumes,
29 const std::vector<caf::SRTrueParticle> &srparticle,
30 const std::vector<geo::BoxBoundedGeo> &volumes,
38 TVector3 nuVtx = mc.GetNeutrino().Nu().Trajectory().Position(0).Vect();
40 return (trkStart - nuVtx).Mag() <
distance;
45 const TDatabasePDG *
PDGTable = TDatabasePDG::Instance();
47 if (pdg < 1000000000) {
48 TParticlePDG* ple = PDGTable->GetParticle(pdg);
49 if (ple == NULL)
return -1;
50 return ple->Mass() * 1000.0;
54 int p = (pdg % 10000000) / 10000;
55 int n = (pdg % 10000) / 10 - p;
56 return (PDGTable->GetParticle(2212)->Mass() * p +
57 PDGTable->GetParticle(2112)->Mass() *
n) * 1000.0;
62 const double smearing = 0.15;
66 const double smeared_E = rand.Gaus(true_E, smearing * true_E / std::sqrt(true_E));
67 return std::max(smeared_E, 0.0);
71 const double smearing = 0.05;
73 const double smeared_E = rand.Gaus(true_E, smearing * true_E);
74 return std::max(smeared_E, 0.0);
81 const double& start =
m(0, 0);
82 v.insert(v.end(), &start, &start + m.GetNoElements());
91 std::map<std::string, unsigned int>& weightPSetIndex)
100 weightPSetIndex[cafpset.
name] = srglobal.
wgts.size()-1;
104 const std::vector<float>& vals = it.second;
112 cafpset.
map.emplace_back(cafparam, vals);
119 const std::map<int, caf::HitsEnergy> &id_hits_map,
120 const std::vector<caf::SRTrueParticle> &particles,
135 const std::map<int, caf::HitsEnergy> &id_hits_map,
136 const std::vector<caf::SRTrueParticle> &particles,
148 const std::map<int, caf::HitsEnergy> &id_hits_map,
149 const std::vector<caf::SRTrueParticle> &particles,
161 const std::vector<art::Ptr<simb::MCTruth>> &neutrinos,
171 if (tmatch.
index >= 0) {
177 <<
" with match frac: " << tmatch.
pur << std::endl;
183 const std::vector<geo::BoxBoundedGeo> &active_volumes,
197 for (
int icryo = 0; icryo < (int)active_volumes.size(); icryo++) {
198 if (active_volumes[icryo].ContainsPosition(truth.
decay_pos.Vect())) {
204 srtruth.
M = truth.
mass;
220 srtruth.
C1 = truth.
C1;
221 srtruth.
C2 = truth.
C2;
222 srtruth.
C3 = truth.
C3;
223 srtruth.
C4 = truth.
C4;
224 srtruth.
C5 = truth.
C5;
239 const std::vector<art::Ptr<simb::MCTruth>> &neutrinos,
244 const std::vector<caf::SRTrueParticle> &srparticles,
245 const std::vector<art::Ptr<sim::MCTrack>> &mctracks,
246 const std::vector<geo::BoxBoundedGeo> &volumes, TRandom &rand)
249 if(tmatch.
index >= 0) {
259 const simb::MCFlux &mcflux,
260 const simb::GTruth& gtruth,
261 const std::vector<caf::SRTrueParticle> &srparticles,
262 const std::map<
int,
std::vector<art::Ptr<recob::Hit>>> &id_to_truehit_map,
264 const std::vector<geo::BoxBoundedGeo> &active_volumes) {
266 srneutrino.
index = i;
268 for (
int c = 0; c < 2; c++) {
274 for (
int p = 0;
p < 3;
p++) {
275 srneutrino.
plane[c][
p] = init;
281 if(part.interaction_id == (
int)i) {
285 for(
int p = 0;
p < 3; ++
p) {
286 for (
int i_cryo = 0; i_cryo < 2; i_cryo++) {
287 srneutrino.
plane[i_cryo][
p].
visE += part.plane[i_cryo][
p].visE;
292 srneutrino.
nprim = srneutrino.
prim.size();
296 std::vector<std::array<std::set<unsigned>, 3>> planehitIDs(2);
297 for (
unsigned i_part = 0; i_part < srparticles.size(); i_part++) {
298 if (srparticles[i_part].start_process ==
caf::kG4primary && srparticles[i_part].interaction_id == (
int)i) {
299 int track_id = srparticles[i_part].G4ID;
301 if (!id_to_truehit_map.count(track_id))
continue;
302 for (
const art::Ptr<recob::Hit> &
h: id_to_truehit_map.at(track_id)) {
303 if (!
h->WireID())
continue;
304 planehitIDs[
h->WireID().Cryostat][
h->WireID().Plane].insert(
h.key());
309 for(
int p = 0;
p < 3; ++
p) {
310 for (
int i_cryo = 0; i_cryo < 2; i_cryo++) {
318 std::vector<std::array<std::set<unsigned>, 3>> planehitIDs(2);
319 for (
unsigned i_part = 0; i_part < srparticles.size(); i_part++) {
320 if (srparticles[i_part].interaction_id == (
int)i) {
321 int track_id = srparticles[i_part].G4ID;
323 if (!id_to_truehit_map.count(track_id))
continue;
324 for (
const art::Ptr<recob::Hit> &
h: id_to_truehit_map.at(track_id)) {
325 if (!
h->WireID())
continue;
326 planehitIDs[
h->WireID().Cryostat][
h->WireID().Plane].insert(
h.key());
331 for(
int p = 0;
p < 3; ++
p) {
332 for (
int i_cryo = 0; i_cryo < 2; i_cryo++) {
333 srneutrino.
plane[i_cryo][
p].
nhit = planehitIDs[i_cryo][
p].size();
339 srneutrino.
npiplus = gtruth.fNumPiPlus;
340 srneutrino.
npiminus = gtruth.fNumPiMinus;
341 srneutrino.
npizero = gtruth.fNumPi0;
342 srneutrino.
nproton = gtruth.fNumProton;
343 srneutrino.
nneutron = gtruth.fNumNeutron;
344 srneutrino.
ischarm = gtruth.fIsCharm;
346 srneutrino.
resnum = gtruth.fResNum;
347 srneutrino.
xsec = gtruth.fXsec;
350 srneutrino.
initpdg = mcflux.fntype;
351 srneutrino.
baseline = mcflux.fdk2gen + mcflux.fgen2vtx;
360 float Pmass =
PDGMass(mcflux.fptype) / 1000.;
361 srneutrino.
parent_dcy_E = sqrt(mcflux.fpdpx*mcflux.fpdpx + mcflux.fpdpy*mcflux.fpdpy + mcflux.fpdpz*mcflux.fpdpz + Pmass*Pmass);
364 if (mctruth->NeutrinoSet()) {
366 const simb::MCNeutrino&
nu = mctruth->GetNeutrino();
369 srneutrino.
pdg = nu.Nu().PdgCode();
371 srneutrino.
hitnuc = nu.HitNuc();
376 srneutrino.
Q2 = nu.QSqr();
377 srneutrino.
w = nu.W();
378 srneutrino.
E = nu.Nu().EndMomentum().Energy();
379 srneutrino.
momentum = nu.Nu().EndMomentum().Vect();
380 srneutrino.
position = nu.Nu().Position().Vect();
381 srneutrino.
time = nu.Nu().Position().T() / 1000. ;
384 const simb::MCParticle& lepton = nu.Lepton();
385 TLorentzVector q_labframe;
386 q_labframe = nu.Nu().EndMomentum() - lepton.Momentum(0);
387 srneutrino.
q0_lab = q_labframe.E();
388 srneutrino.
modq_lab = q_labframe.P();
391 for (
unsigned i_part = 0; i_part < srneutrino.
prim.size(); i_part++) {
392 if (srneutrino.
prim[i_part].pdg == lepton.PdgCode()) {
395 srneutrino.
prim[0] = srneutrino.
prim[i_part];
396 srneutrino.
prim[i_part] = temp;
402 for (
int icryo = 0; icryo < 2; icryo++) {
403 if (active_volumes[icryo].ContainsPosition(nu.Nu().Position().Vect())) {
416 const std::map<std::string, unsigned int>& weightPSetIndex)
418 for(
auto& it: wgtmap){
419 if(weightPSetIndex.count(it.first) == 0){
420 std::cout <<
"CAFMaker: Unknown EventWeightMap name '" << it.first <<
"'" << std::endl;
421 std::cout <<
"Known names from EventWeightParameterSet:" << std::endl;
422 for(
auto k: weightPSetIndex)
std::cout <<
" " <<
k.first << std::endl;
426 const unsigned int idx = weightPSetIndex.at(it.first);
427 if(idx >= srint.
wgt.size()) srint.
wgt.resize(idx+1);
428 srint.
wgt[idx].univ = it.second;
435 const std::vector<geo::BoxBoundedGeo> &active_volumes,
436 const std::vector<std::vector<geo::BoxBoundedGeo>> &tpc_volumes,
437 const std::map<
int,
std::vector<std::pair<geo::WireID, const sim::IDE *>>> &id_to_ide_map,
438 const std::map<
int,
std::vector<art::Ptr<recob::Hit>>> &id_to_truehit_map,
441 const std::vector<art::Ptr<simb::MCTruth>> &neutrinos,
444 std::vector<std::pair<geo::WireID, const sim::IDE *>>
empty;
445 const std::vector<std::pair<geo::WireID, const sim::IDE *>> &particle_ides = id_to_ide_map.count(particle.TrackId()) ? id_to_ide_map.at(particle.TrackId()) : empty;
447 std::vector<art::Ptr<recob::Hit>> emptyHits;
448 const std::vector<art::Ptr<recob::Hit>> &particle_hits = id_to_truehit_map.count(particle.TrackId()) ? id_to_truehit_map.at(particle.TrackId()) : emptyHits;
455 for (
unsigned c = 0; c < 2; c++) {
460 for (
int p = 0;
p < 3;
p++) {
461 srparticle.
plane[c][
p] = init;
465 for (
auto const &ide_pair: particle_ides) {
467 const sim::IDE *ide = ide_pair.second;
474 for (
const art::Ptr<recob::Hit>
h: particle_hits) {
483 srparticle.
cont_tpc = particle.NumberTrajectoryPoints() > 0;
484 srparticle.
contained = particle.NumberTrajectoryPoints() > 0;
487 int entry_point = -1;
489 int cryostat_index = -1;
492 for (
unsigned j = 0; j < particle.NumberTrajectoryPoints(); j++) {
493 for (
unsigned i = 0; i < active_volumes.size(); i++) {
494 if (active_volumes.at(i).ContainsPosition(particle.Position(j).Vect())) {
500 if (entry_point != -1)
break;
503 if (entry_point > 0) {
504 srparticle.
wallin =
GetWallCross(active_volumes.at(cryostat_index), particle.Position(entry_point).Vect(), particle.Position(entry_point-1).Vect());
510 std::vector<geo::BoxBoundedGeo> volumes;
511 if (entry_point >= 0) {
512 volumes = tpc_volumes.at(cryostat_index);
513 for (
unsigned i = 0; i < volumes.size(); i++) {
514 if (volumes[i].ContainsPosition(particle.Position(entry_point).Vect())) {
516 srparticle.
cont_tpc = entry_point == 0;
532 std::vector<geoalgo::AABox> aa_volumes;
533 if (entry_point >= 0) {
541 if (entry_point >= 0) {
543 const simb::MCTrajectory &trajectory = particle.Trajectory();
544 TVector3 pos = trajectory.Position(entry_point).Vect();
545 for (
unsigned i = entry_point+1; i < particle.NumberTrajectoryPoints(); i++) {
546 TVector3 this_point = trajectory.Position(i).Vect();
551 for (
unsigned j = 0; j < volumes.size(); j++) {
552 if (volumes[j].ContainsPosition(this_point) && tpc_index >= 0 && j != ((unsigned)tpc_index)) {
560 srparticle.
cont_tpc = volumes[tpc_index].ContainsPosition(this_point);
564 srparticle.
contained = active_volumes.at(cryostat_index).ContainsPosition(this_point);
570 if (!active_volumes.at(cryostat_index).ContainsPosition(this_point) && active_volumes.at(cryostat_index).ContainsPosition(pos)) {
574 pos = trajectory.Position(i).Vect();
577 if (exit_point < 0 && entry_point >= 0) {
578 exit_point = particle.NumberTrajectoryPoints() - 1;
580 if (exit_point >= 0 && ((
unsigned)exit_point) < particle.NumberTrajectoryPoints() - 1) {
581 srparticle.
wallout =
GetWallCross(active_volumes.at(cryostat_index), particle.Position(exit_point).Vect(), particle.Position(exit_point+1).Vect());
585 srparticle.
pdg = particle.PdgCode();
587 srparticle.
gen = particle.NumberTrajectoryPoints() ? particle.Position().Vect() : TVector3(-9999, -9999, -9999);
588 srparticle.
genT = particle.NumberTrajectoryPoints() ? particle.Position().T() / 1000. : -9999;
589 srparticle.
genp = particle.NumberTrajectoryPoints() ? particle.Momentum().Vect(): TVector3(-9999, -9999, -9999);
590 srparticle.
genE = particle.NumberTrajectoryPoints() ? particle.Momentum().E(): -9999;
592 srparticle.
start = (entry_point >= 0) ? particle.Position(entry_point).Vect(): TVector3(-9999, -9999, -9999);
593 srparticle.
startT = (entry_point >= 0) ? particle.Position(entry_point).T() / 1000. : -9999;
594 srparticle.
end = (exit_point >= 0) ? particle.Position(exit_point).Vect(): TVector3(-9999, -9999, -9999);
595 srparticle.
endT = (exit_point >= 0) ? particle.Position(exit_point).T() / 1000. : -9999;
597 srparticle.
startp = (entry_point >= 0) ? particle.Momentum(entry_point).Vect() : TVector3(-9999, -9999, -9999);
598 srparticle.
startE = (entry_point >= 0) ? particle.Momentum(entry_point).E() : -9999.;
599 srparticle.
endp = (exit_point >= 0) ? particle.Momentum(exit_point).Vect() : TVector3(-9999, -9999, -9999);
600 srparticle.
endE = (exit_point >= 0) ? particle.Momentum(exit_point).E() : -9999.;
605 srparticle.
G4ID = particle.TrackId();
606 srparticle.
parent = particle.Mother();
610 if (entry_point >= 0) {
611 for (
unsigned c = 0; c < active_volumes.size(); c++) {
612 if (active_volumes[c].ContainsPosition(particle.Position(entry_point).Vect())) {
620 for (
int i_d = 0; i_d < particle.NumberDaughters(); i_d++) {
621 srparticle.
daughters.push_back(particle.Daughter(i_d));
627 art::Ptr<simb::MCTruth> truth = inventory_service.
TrackIdToMCTruth_P(particle.TrackId());
628 for (
unsigned i = 0; i < neutrinos.size(); i++) {
629 if (truth.get() == neutrinos[i].get()) {
637 const std::vector<caf::SRTrueParticle> &srparticles,
638 const std::vector<art::Ptr<sim::MCTrack>> &mctracks,
639 const std::vector<geo::BoxBoundedGeo> &volumes,
641 std::vector<caf::SRFakeReco> &srfakereco) {
643 for (
const art::Ptr<simb::MCTruth> mctruth: mctruths) {
644 bool do_fill =
false;
646 do_fill =
FRFillNumuCC(*mctruth, mctracks, volumes, rand, this_fakereco);
647 if(!do_fill) do_fill =
FRFillNueCC(*mctruth, srparticles, volumes, rand, this_fakereco);
652 if (do_fill) srfakereco.push_back(this_fakereco);
660 std::map<int, caf::HitsEnergy> ret;
662 for (
const art::Ptr<recob::Hit>
h : allHits) {
664 ++ret[hit_trackID].nHits;
668 ret[ide_trackID].totE += ide.energy;
676 std::map<int, std::vector<art::Ptr<recob::Hit>>> ret;
677 for (
const art::Ptr<recob::Hit>
h: allHits) {
679 ret[
abs(ID)].push_back(
h);
686 std::map<int, std::vector<std::pair<geo::WireID, const sim::IDE*>>> ret;
688 for (
const art::Ptr<sim::SimChannel> sc : simchannels) {
691 std::vector<geo::WireID> maybewire = geo.
ChannelToWire(channel);
693 if (maybewire.size()) thisWire = maybewire[0];
695 for (
const auto &item : sc->TDCIDEMap()) {
696 for (
const sim::IDE &ide: item.second) {
698 ret[
abs(ide.
trackID)].push_back({thisWire, &ide});
711 const std::vector<art::Ptr<sim::MCTrack>> &mctracks,
712 const std::vector<geo::BoxBoundedGeo> &volumes,
726 float hadron_smearing = 0.05;
727 float lepton_contained_smearing = 0.02;
728 std::function<float (float)> lepton_exiting_smearing = [](
float length) {
731 return -A * TMath::Log(B * length);
735 float hadronic_energy_threshold = 0.021;
738 float contained_length_cut = 50.;
739 float exiting_length_cut = 100.;
744 if (!mctruth.NeutrinoSet())
return false;
748 for (
unsigned i = 0; i < volumes.size(); i++) {
751 if (FV.ContainsPosition(mctruth.GetNeutrino().Nu().Position().Vect())) {
757 if (cryo_index == -1)
return false;
759 std::vector<geoalgo::AABox> aa_volumes;
767 if (
abs(mctruth.GetNeutrino().Nu().PdgCode()) == 14 && mctruth.GetNeutrino().CCNC() == 0) {
768 for (
int i = 0; i < (int)mctracks.size(); i++) {
769 if (
isFromNuVertex(mctruth, *mctracks[i]) &&
abs(mctracks[i]->PdgCode()) == 13 && mctracks[i]->Process() ==
"primary") {
770 if (lepton_ind == -1 || mctracks[lepton_ind]->Start().E() < mctracks[i]->Start().E()) {
777 else if (mctruth.GetNeutrino().CCNC() == 1) {
778 for (
int i = 0; i < (int)mctracks.size(); i++) {
779 if (
isFromNuVertex(mctruth, *mctracks[i]) &&
abs(mctracks[i]->PdgCode()) == 211 && mctracks[i]->Process() ==
"primary") {
780 if (lepton_ind == -1 || mctracks[lepton_ind]->Start().E() < mctracks[i]->Start().E()) {
788 if (lepton_ind == -1)
return false;
793 fake_lepton.
pid = 13;
796 if (vol.ContainsPosition(mctracks[lepton_ind]->Start().Position().Vect()) && vol.ContainsPosition(mctracks[lepton_ind]->Start().Position().Vect())) {
800 fake_lepton.
len =
ContainedLength(mctracks[lepton_ind]->Start().Position().Vect(), mctracks[lepton_ind]->End().Position().Vect(), aa_volumes);
801 fake_lepton.
costh = mctracks[lepton_ind]->Start().Position().Vect().CosTheta();
804 if (fake_lepton.
contained && fake_lepton.
len < contained_length_cut)
return false;
805 if (!fake_lepton.
contained && fake_lepton.
len < exiting_length_cut)
return false;
809 float smearing = fake_lepton.
contained ? lepton_contained_smearing : lepton_exiting_smearing(fake_lepton.
len);
810 float ke = (mctracks[lepton_ind]->Start().E() -
PDGMass(mctracks[lepton_ind]->PdgCode())) / 1000. ;
811 fake_lepton.
ke = rand.Gaus(ke, smearing * ke);
812 fake_lepton.
ke = std::max(fake_lepton.
ke, 0.f);
815 std::vector<caf::SRFakeRecoParticle> hadrons;
817 for (
int i = 0; i < (int)mctracks.size(); i++) {
819 && (
abs(mctracks[i]->PdgCode()) == 211 ||
abs(mctracks[i]->PdgCode()) == 321 ||
abs(mctracks[i]->PdgCode()) == 2212)
820 && mctracks[i]->Process() ==
"primary"
824 hadron.
pid =
abs(mctracks[i]->PdgCode());
827 if (vol.ContainsPosition(mctracks[i]->Start().Position().Vect()) && vol.ContainsPosition(mctracks[i]->Start().Position().Vect())) {
831 hadron.
len =
ContainedLength(mctracks[i]->Start().Position().Vect(), mctracks[i]->Start().Position().Vect(), aa_volumes);
832 hadron.
costh = mctracks[i]->Start().Position().Vect().CosTheta();
834 float ke = (mctracks[i]->Start().E() -
PDGMass(mctracks[i]->PdgCode())) / 1000. ;
835 if (ke < hadronic_energy_threshold)
continue;
837 hadron.
ke = rand.Gaus(ke, hadron_smearing * ke);
838 hadron.
ke = std::max(hadron.
ke, 0.f);
840 hadrons.push_back(hadron);
845 fakereco.
nuE = fake_lepton.
ke;
850 fakereco.
lepton = fake_lepton;
854 TVector3
vertex = mctruth.GetNeutrino().Nu().Position().Vect();
855 fakereco.
vtx.
x = vertex.X();
856 fakereco.
vtx.
y = vertex.Y();
857 fakereco.
vtx.
z = vertex.Z();
860 if (
abs(mctruth.GetNeutrino().Nu().PdgCode()) == 14 && mctruth.GetNeutrino().CCNC() == 0) {
874 const std::vector<caf::SRTrueParticle> &srparticles,
875 const std::vector<geo::BoxBoundedGeo> &volumes,
905 const float hadronic_energy_threshold = 0.021;
910 if (!mctruth.NeutrinoSet())
return false;
912 TVector3 nuVtx = mctruth.GetNeutrino().Nu().Position().Vect();
916 for (
unsigned i = 0; i < volumes.size(); i++) {
919 if (FV.ContainsPosition(nuVtx)) {
925 if (cryo_index == -1)
return false;
927 std::vector<geoalgo::AABox> aa_volumes;
936 std::vector<const caf::SRTrueParticle*> lepton_candidates;
937 for(
const auto& particle: srparticles) {
939 const float distance_from_vertex = std::hypot(nuVtx.X() - particle.start.x,
940 nuVtx.Y() - particle.start.y,
941 nuVtx.Z() - particle.start.z);
942 if((pdg == 11 || pdg == 22) && distance_from_vertex < 5) {
943 const auto parent = std::find_if(srparticles.begin(), srparticles.end(),
945 return particle.parent ==
std::abs(parent_candidate.G4ID);
947 if((parent == srparticles.end()
950 lepton_candidates.push_back(&particle);
954 if(lepton_candidates.size() != 1)
return false;
958 fake_lepton.
pid = 11;
967 std::vector<caf::SRFakeRecoParticle> fake_hadrons;
968 float hadronic_E = 0.0;
969 for(
const auto& particle: srparticles) {
972 const float distance_from_vertex = std::hypot(nuVtx.X() - particle.start.x,
973 nuVtx.Y() - particle.start.y,
974 nuVtx.Z() - particle.start.z);
976 if((pdg == 2212 || pdg == 211 || pdg == 321) && distance_from_vertex < 5
977 && particle.start_process ==
caf::kG4primary && ke > hadronic_energy_threshold) {
980 fake_hadron.
len =
ContainedLength(TVector3(particle.start), TVector3(particle.end), aa_volumes);
983 if(vol.ContainsPosition(TVector3(particle.start))
984 && vol.ContainsPosition(TVector3(particle.end))) {
988 fake_hadron.
costh = TVector3(particle.start).CosTheta();
991 fake_hadrons.push_back(fake_hadron);
1000 if(lepton->
pdg == 22 && hadronic_E > 0.05 && (TVector3(lepton->
end) - nuVtx).Mag() > 3)
1005 double weight = 1.0;
1006 if(lepton->
pdg == 22) weight *= 0.06;
1012 if(
std::abs(mctruth.GetNeutrino().Nu().PdgCode()) == 14 && mctruth.GetNeutrino().CCNC() == 0) {
1014 for(
const auto& particle: srparticles) {
1016 const float distance_from_vertex = std::hypot(nuVtx.X() - particle.start.x,
1017 nuVtx.Y() - particle.start.y,
1018 nuVtx.Z() - particle.start.z);
1019 if(pdg == 13 && distance_from_vertex < 5 && particle.start_process ==
caf::kG4primary
1020 && (muon == NULL || muon->
startE < particle.startE))
1032 fakereco.
nuE = fake_lepton.
ke +
PDGMass(11) / 1000 + hadronic_E;
1035 fakereco.
lepton = fake_lepton;
1036 fakereco.
hadrons = fake_hadrons;
1039 fakereco.
vtx.
x = nuVtx.X();
1040 fakereco.
vtx.
y = nuVtx.Y();
1041 fakereco.
vtx.
z = nuVtx.Z();
1044 fakereco.
wgt *= weight;
1053 TVector3 direction = (p1 - p0) * ( 1. / (p1 - p0).Mag());
1054 std::vector<TVector3> intersections = volume.
GetIntersections(p0, direction);
1056 assert(intersections.size() == 2);
1059 int intersection_i = ((intersections[0] - p0).Mag() < (intersections[1] - p0).Mag()) ? 0 : 1;
1062 if (
abs(intersections[intersection_i].
X() - volume.
MinX()) < eps) {
1066 else if (
abs(intersections[intersection_i].
X() - volume.
MaxX()) < eps) {
1070 else if (
abs(intersections[intersection_i].Y() - volume.
MinY()) < eps) {
1074 else if (
abs(intersections[intersection_i].Y() - volume.
MaxY()) < eps) {
1078 else if (
abs(intersections[intersection_i].Z() - volume.
MinZ()) < eps) {
1082 else if (
abs(intersections[intersection_i].Z() - volume.
MaxZ()) < eps) {
1095 #define MATCH_PROCESS(name) if (process_name == #name) {return caf::kG4 ## name;}
1096 #define MATCH_PROCESS_NAMED(strname, id) if (process_name == #strname) {return caf::kG4 ## id;}
1162 std::cerr <<
"Error: Process name with no match (" << process_name <<
")\n";
1165 #undef MATCH_PROCESS
1166 #undef MATCH_PROCESS_NAMED
1172 const std::vector<geoalgo::AABox> &boxes) {
1176 if ((v0 - v1).Mag() < 1
e-6)
return 0;
1189 for (
auto const &box: boxes) {
1190 int n_contained = box.Contain(p0) + box.Contain(p1);
1192 if (n_contained == 2) {
1193 length = (v1 - v0).Mag();
1197 if (n_contained == 1) {
1202 if (intersections.size() == 0) {
1205 bool p0_edge = algo.
SqDist(p0, box) <
tol;
1206 bool p1_edge = algo.
SqDist(p1, box) <
tol;
1207 assert(p0_edge || p1_edge);
1211 if ((p0_edge && box.Contain(p0)) || (box.Contain(p1) && p1_edge))
1214 else if ((p0_edge && box.Contain(p1)) || (box.Contain(p0) && p1_edge)) {
1215 length = (v1 - v0).Mag();
1227 else if (intersections.size() == 2) {
1228 length += (intersections.at(0).ToTLorentzVector().Vect() - intersections.at(1).ToTLorentzVector().Vect()).Mag();
1232 else if (intersections.size() == 1) {
1234 TVector3 int_tv(intersections.at(0).ToTLorentzVector().Vect());
1235 length += ( box.Contain(p0) ? (v0 - int_tv).Mag() : (v1 - int_tv).Mag() );
1240 if (n_contained == 0) {
1242 if (!(intersections.size() == 0 || intersections.size() == 2)) {
1247 bool p0_edge = algo.
SqDist(p0, box) <
tol;
1248 bool p1_edge = algo.
SqDist(p1, box) <
tol;
1250 TVector3 vint = intersections.at(0).ToTLorentzVector().Vect();
1252 bool p0_int = (v0 - vint).Mag() <
tol;
1253 bool p1_int = (v1 - vint).Mag() <
tol;
1255 assert((p0_int && p0_edge) != (p1_int && p1_edge));
1260 if (p0_edge && p1_edge) {
1261 length += (v0 - v1).Mag();
1267 else if (intersections.size() == 2) {
1268 TVector3 start(intersections.at(0).ToTLorentzVector().Vect());
1269 TVector3
end(intersections.at(1).ToTLorentzVector().Vect());
1270 length += (start -
end).Mag();
1280 const std::map<int, caf::HitsEnergy> &all_hits_map) {
1282 art::ServiceHandle<cheat::BackTrackerService> bt_serv;
1294 for (
auto const &pair: matches) {
1296 match.
G4ID = pair.first;
1297 match.
energy = pair.second / 1000. ;
1302 match.
hit_purity = (hits.size() != 0) ? track_matched_hits.
nHits / (
float) hits.size() : 0.;
1307 ret.matches.push_back(match);
1311 std::sort(ret.matches.begin(), ret.matches.end(),
1313 return a.
energy > b.energy;
1317 bool found_bestmatch =
false;
1318 if (ret.matches.size()) {
1319 ret.bestmatch = ret.matches.at(0);
1320 for (
unsigned i_part = 0; i_part < particles.size(); i_part++) {
1321 if (particles[i_part].
G4ID == ret.bestmatch.G4ID) {
1322 ret.p = particles[i_part];
1323 found_bestmatch =
true;
1330 if (found_bestmatch) {
1331 double match_total_energy = 0.;
1332 for (
int p = 0;
p < 3;
p++) {
1333 for (
int c = 0; c < 2; c++) {
1334 match_total_energy += ret.p.plane[c][
p].visE;
1338 ret.eff = ret.matches[0].energy / match_total_energy;
1339 ret.pur = ret.matches[0].energy / ret.visEintrk;
1342 if (!hits.empty()) {
1343 icryo = hits[0]->WireID().Cryostat;
1347 if (icryo >= 0 && icryo < 2) {
1348 float match_cryo_energy = ret.p.plane[icryo][0].visE + ret.p.plane[icryo][1].visE + ret.p.plane[icryo][2].visE;
1349 ret.eff_cryo = ret.matches[0].energy / match_cryo_energy;
1362 ret.nmatches = ret.matches.size();
1368 const std::vector<art::Ptr<simb::MCTruth>> &truths,
1375 if (truths.empty()) {
1385 std::vector<float> matching_energy(truths.size(), 0.);
1386 for (
auto const &pair: matches) {
1387 art::Ptr<simb::MCTruth> truth;
1395 for (
unsigned ind = 0; ind < truths.size(); ind++) {
1396 if (truth == truths[ind]) {
1397 matching_energy[ind] += pair.second;
1403 float cosmic_energy = total_energy;
1404 for (
float E: matching_energy) cosmic_energy -=
E;
1406 float matching_frac = *std::max_element(matching_energy.begin(), matching_energy.end()) / total_energy;
1407 int index = (matching_frac > 0.5) ?
std::distance(matching_energy.begin(), std::max_element(matching_energy.begin(), matching_energy.end())) : -1;
1413 ret.
pur = matching_energy[index] / total_energy;
1415 double totVisE = 0.;
1416 for (
int p = 0;
p < 3;
p++) {
1417 for (
int c = 0; c < 2; c++) {
1418 totVisE += srmc.
nu[index].plane[c][
p].visE;
1422 ret.
eff = (matching_energy[index] / 1000.) / totVisE;
1426 if (!hits.empty()) {
1427 icryo = hits[0]->WireID().Cryostat;
1431 ret.
eff_cryo = (matching_energy[index] / 1000.) /
1432 (srmc.
nu[index].plane[icryo][0].visE + srmc.
nu[index].plane[icryo][1].visE + srmc.
nu[index].plane[icryo][2].visE);
TrackID_t trackID
Geant4 supplied track ID.
float imp_weight
Importance weight from flux file.
double SmearHadron(const caf::SRTrueParticle &hadron, TRandom &rand)
unsigned int npiplus
Number of 's after neutrino reaction, before FSI.
float genweight
Weight, if any, assigned by the generator.
std::map< int, std::vector< std::pair< geo::WireID, const sim::IDE * > > > PrepSimChannels(const std::vector< art::Ptr< sim::SimChannel >> &simchannels, const geo::GeometryCore &geo)
SRTruthMatch tmatch
Matching information between truth and reco objects.
int initpdg
Initial PDG code of probe neutrino.
unsigned int nneutron
Number of neutrons after neutrino reaction, before FSI.
SRTrackTruth truth
truth information
bool isseaquark
Did neutrino scatter off a sea quark.
Algorithm to compute various geometrical relation among geometrical objects. In particular functions ...
std::map< std::string, std::vector< float > > EventWeightMap
Container for event-level weights.
float genE
Energy at generation pt [GeV].
float fMean
Gaussian mean.
double ContainedLength(const TVector3 &v0, const TVector3 &v1, const std::vector< geo::BoxBoundedGeo > &boxes)
SRVector3D parent_dcy_mom
Neutrino parent momentum at decay [GeV; beam coordinates].
unsigned parent
ID's of parent particle from this particle.
double ray_weight
Weight associated with the Portal hitting the detector.
float inelasticityY
Inelasticity y.
std::vector< sim::TrackIDE > HitToTrackIDEs(detinfo::DetectorClocksData const &clockData, recob::Hit const &hit) const
BEGIN_PROLOG could also be cerr
SRVector3D start
Start position in the active TPC volume [cm].
void FillTrueNeutrino(const art::Ptr< simb::MCTruth > mctruth, const simb::MCFlux &mcflux, const simb::GTruth >ruth, const std::vector< caf::SRTrueParticle > &srparticles, const std::map< int, std::vector< art::Ptr< recob::Hit >>> &id_to_truehit_map, caf::SRTrueInteraction &srneutrino, size_t i, const std::vector< geo::BoxBoundedGeo > &active_volumes)
void FillStubTruth(const std::vector< art::Ptr< recob::Hit >> &hits, const std::map< int, caf::HitsEnergy > &id_hits_map, const std::vector< caf::SRTrueParticle > &particles, const detinfo::DetectorClocksData &clockData, caf::SRStub &srstub, bool allowEmpty)
bool contained
Whether contained.
The SRTrueInteraction is a representation of neutrino interaction information.
SRVector3D position
Neutrino interaction position.
float xsec
xsec for thrown interaction, in 1/GeV^2, as stored by the GENIE spline
int resnum
Resonance number, straight from GENIE.
int nprim
Number of primary daughters.
SRVector3D prod_vtx
Neutrino production vertex [cm; beam coordinates].
double SqDist(const Line_t &line, const Point_t &pt) const
float E
True energy [GeV].
float fWidth
Gaussian sigma.
double MinX() const
Returns the world x coordinate of the start of the box.
caf::SRTruthMatch MatchSlice2Truth(const std::vector< art::Ptr< recob::Hit >> &hits, const std::vector< art::Ptr< simb::MCTruth >> &neutrinos, const caf::SRTruthBranch &srtruth, const cheat::ParticleInventoryService &inventory_service, const detinfo::DetectorClocksData &clockData)
Representation of a simple 3D line segment Defines a finite 3D straight line by having the start and ...
std::string fName
Parameter name.
An SRTruthMatch contains overarching information for a slice.
float endT
End time last point in the active [us – t=0 is spill time].
int cryostat
Cryostat that the particle enters first – -1 if it does not enter a Cryostat.
G4ID TrueParticleID(detinfo::DetectorClocksData const &clockData, const art::Ptr< recob::Hit > &pHit, const bool rollupUnsavedIDs)
The G4 ID of the true particle which deposits the most energy in the recob::Hit.
SRVector3D startp
Momentum at first point in the active TPC volume [GeV/c].
float ke
Fake-reco kinetic energy [GeV].
double SmearLepton(const caf::SRTrueParticle &lepton, TRandom &rand)
float eff
Slice efficiency for this interaction.
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
CryostatID_t Cryostat
Index of cryostat.
SRTrueInteraction truth
Truth information on the slice.
double time
Decay time [us].
genie_interaction_type_ genie_inttype
Following LARSoft MCNeutrino::InteractionType()
float len
Fake-reco particle length [cm].
double MaxX() const
Returns the world x coordinate of the end of the box.
unsigned int nproton
Number of protons after neutrino reaction, before FSI.
process_name use argoneut_mc_hitfinder track
The SRFakeRecoParticle is a faked reconstruction using estimates from the SBN proposal.
then echo echo For and will not be changed by echo further linking echo echo B echo The symbol is in the uninitialized data multiple common symbols may appear with the echo same name If the symbol is defined the common echo symbols are treated as undefined references For more echo details on common see the discussion of warn common echo in *Note Linker see the discussion of warn common echo in *Note Linker such as a global int variable echo as opposed to a large global array echo echo I echo The symbol is an indirect reference to another symbol This echo is a GNU extension to the a out object file format which is echo rarely used echo echo N echo The symbol is a debugging symbol echo echo R echo The symbol is in a read only data section echo echo S echo The symbol is in an uninitialized data section for small echo objects echo echo T echo The symbol is in the the normal defined echo symbol is used with no error When a weak undefined symbol echo is linked and the symbol is not the value of the echo weak symbol becomes zero with no error echo echo W echo The symbol is a weak symbol that has not been specifically echo tagged as a weak object symbol When a weak defined symbol echo is linked with a normal defined the normal defined echo symbol is used with no error When a weak undefined symbol echo is linked and the symbol is not the value of the echo weak symbol becomes zero with no error echo echo echo The symbol is a stabs symbol in an a out object file In echo this the next values printed are the stabs other echo the stabs desc and the stab type Stabs symbols are echo used to hold debugging information For more echo see *Note or object file format specific echo echo For Mac OS X
double flux_weight
Weight associated with the production of the Portal.
void FillSliceTruth(const std::vector< art::Ptr< recob::Hit >> &hits, const std::vector< art::Ptr< simb::MCTruth >> &neutrinos, const caf::SRTruthBranch &srmc, const cheat::ParticleInventoryService &inventory_service, const detinfo::DetectorClocksData &clockData, caf::SRSlice &srslice, bool allowEmpty)
float visEintrk
True total deposited energy associated with this Track across all 3 planes [GeV]. NOTE: this energy i...
caf::SRVector3D momentum
Portal momentum [GeV].
std::vector< SRWeightPSet > wgts
bool isFromNuVertex(const simb::MCTruth &mc, const sim::MCTrack &track, float distance=5.0)
double decay_length
Mean decay length of particle.
g4_process_
Which G4 process ?
float visEinslc
True deposited energy in slice [GeV].
tuple m
now if test mode generate materials, CRT shell, world, gdml header else just generate CRT shell for u...
float hit_completeness
The fraction of the best true particle's hits contained by the reconstructed object.
int parent_pdg
PDG Code of parent particle ID.
std::vector< int > HitToTrackIds(detinfo::DetectorClocksData const &clockData, recob::Hit const &hit) const
float eff_cryo
Slice efficiency for this interaction for energy in the slice's cryostat.
float energy
Total energy matching between reco track and true particle across all three planes [GeV]...
std::map< int, caf::HitsEnergy > SetupIDHitEnergyMap(const std::vector< art::Ptr< recob::Hit >> &allHits, const detinfo::DetectorClocksData &clockData, const cheat::BackTrackerService &backtracker)
bool contained
Whether the particle is contained in a single active volume.
caf::mevprtlchannel_ gen
Generator physics channel for this event.
Wall_t wallout
Wall of cryostat particle exits (wNone if stopping in detector)
process_name pandoraGausCryo1 vertexChargeCryo1 vertexStubCryo1 xmin
int pdg
PDG code of probe neutrino.
std::vector< std::pair< int, float > > AllTrueParticleIDEnergyMatches(const detinfo::DetectorClocksData &clockData, const std::vector< art::Ptr< recob::Hit > > &hits, bool rollup_unsaved_ids=1)
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
std::vector< SRTrueParticle > prim
Primary daughters, lepton comes first in vector.
caf::SRVector3D position
Decay location [cm].
TMatrixD * fCovarianceMatrix
Covariance matrix for correlated throws (optional)
std::vector< SRTrueInteraction > nu
Vector of true nu or cosmic.
ReweightType fRWType
Type of throws (the same for all parameters in a set)
unsigned int nhitprim
Number of hits from primary particles on plane.
size_t fCovIndex
Index in the covariance matrix (if any)
bool ischarm
Is a charmed quark in interaction.
double distance(geo::Point_t const &point, CathodeDesc_t const &cathode)
Returns the distance of a point from the cathode.
void FillShowerTruth(const std::vector< art::Ptr< recob::Hit >> &hits, const std::map< int, caf::HitsEnergy > &id_hits_map, const std::vector< caf::SRTrueParticle > &particles, const detinfo::DetectorClocksData &clockData, caf::SRShower &srshower, bool allowEmpty)
unsigned int nhit
Number of hits on plane.
bool crosses_tpc
Whether the particle crosses a TPC boundary.
int pid
Fake-reco particle ID.
A single parameter to be reweighted.
SRVector3D genp
Momentum at generation point [GeV/c].
caf::g4_process_ GetG4ProcessID(const std::string &name)
Ionization at a point of the TPC sensitive volume.
const art::Ptr< simb::MCTruth > & TrackIdToMCTruth_P(int id) const
g4_process_ end_process
End G4 process of the particle.
float length
Trajectory length in active TPC volume the particle first enters [cm].
double M
Portal Mass [GeV].
SRVector3D momentum
Neutrino three-momentum.
std::vector< SRWeightMapEntry > map
float energy
energy deposited by ionization by this track ID and time [MeV]
bool FRFillNueCC(const simb::MCTruth &mctruth, const std::vector< caf::SRTrueParticle > &srparticle, const std::vector< geo::BoxBoundedGeo > &volumes, TRandom &rand, caf::SRFakeReco &fakereco)
Container for a set of reweightable parameters.
int nhad
Number of hadrons.
auto end(FixedBins< T, C > const &) noexcept
float nuE
Fake-reco neutrino Energy [GeV].
double MinZ() const
Returns the world z coordinate of the start of the box.
bool FRFillNumuCC(const simb::MCTruth &mctruth, const std::vector< art::Ptr< sim::MCTrack >> &mctracks, const std::vector< geo::BoxBoundedGeo > &volumes, TRandom &rand, caf::SRFakeReco &fakereco)
float bjorkenX
Bjorken x = (k-k')^2/(2*p.q) [Dimensionless].
std::map< EventWeightParameter, std::vector< float > > fParameterMap
Mapping of definitions to the set of values.
unsigned int npizero
Number of 's after neutrino reaction, before FSI.
bool isnc
same as LArSoft "ccnc" - 0=CC, 1=NC
void FillFakeReco(const std::vector< art::Ptr< simb::MCTruth >> &mctruths, const std::vector< caf::SRTrueParticle > &srparticles, const std::vector< art::Ptr< sim::MCTrack >> &mctracks, const std::vector< geo::BoxBoundedGeo > &volumes, TRandom &rand, std::vector< caf::SRFakeReco > &srfakereco)
float startT
Start time of first TPC point [us – t=0 is spill time].
caf::SRVector3D enter
Entry position of particle into Active Volume.
float costh
Fake-reco cosine of angle w.r.t. beam direction.
void FillMeVPrtlTruth(const evgen::ldm::MeVPrtlTruth &truth, const std::vector< geo::BoxBoundedGeo > &active_volumes, caf::SRMeVPrtl &srtruth)
float genT
Start time of gen point [us – t=0 is spill time].
int GetShowerPrimary(const int g4ID)
float endE
Energy at last pt in active TPC volume [GeV].
float wgt
Weight for this interaction.
PlaneID_t Plane
Index of the plane within its TPC.
float energy_purity
The fraction of the reconstructed object's energy that originates from the best true particle...
Description of geometry of one entire detector.
size_t fNuniverses
Number of universes (i.e. random throws)
float w
Hadronic invariant mass W.
An SRSlice contains overarching information for a slice.
double E
Portal Energy [GeV].
SRTrueInteractionPlaneInfo plane[2][3]
Per-plane, per-cryostat deposition information.
float pur
Slice purity for this interaction.
int index
Index of the matched true neutrino interaction (-1 if not matched to neutrino)
SRTrackTruth truth
truth information
caf::SRTrackTruth MatchTrack2Truth(const detinfo::DetectorClocksData &clockData, const std::vector< caf::SRTrueParticle > &particles, const std::vector< art::Ptr< recob::Hit >> &hits, const std::map< int, caf::HitsEnergy > &all_hits_map)
double MaxY() const
Returns the world y coordinate of the end of the box.
float q0_lab
q0, lab frame
void FillTrueG4Particle(const simb::MCParticle &particle, const std::vector< geo::BoxBoundedGeo > &active_volumes, const std::vector< std::vector< geo::BoxBoundedGeo >> &tpc_volumes, const std::map< int, std::vector< std::pair< geo::WireID, const sim::IDE * >>> &id_to_ide_map, const std::map< int, std::vector< art::Ptr< recob::Hit >>> &id_to_truehit_map, const cheat::BackTrackerService &backtracker, const cheat::ParticleInventoryService &inventory_service, const std::vector< art::Ptr< simb::MCTruth >> &neutrinos, caf::SRTrueParticle &srparticle)
int G4ID
ID of the particle match, taken from G4 */.
std::vector< SRFakeRecoParticle > hadrons
Fake-reco information on hadronic state.
bool iscc
CC (true) or NC/interference (false)
float parent_dcy_E
Neutrino parent energy at decay [GeV].
int interaction_id
Neutrino interaction ID of the source of this particle (-1 if cosmic)
SRVector3D end
End position in the active TPC volume [cm].
float startE
Energy at first pt in active TPC volume [GeV].
g4_process_ start_process
Start G4 process of the particle.
float baseline
Distance from decay to interaction [m].
int cryostat
Cryostat that the decay occurs in.
void CopyTMatrixDToVector(const TMatrixD &m, std::vector< float > &v)
process_name can override from command line with o or output muon
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
static const TDatabasePDG * PDGTable(new TDatabasePDG)
SRVector3D endp
Momentum at last point in the active TPC volume [GeV/c].
void FillTrackTruth(const std::vector< art::Ptr< recob::Hit >> &hits, const std::map< int, caf::HitsEnergy > &id_hits_map, const std::vector< caf::SRTrueParticle > &particles, const detinfo::DetectorClocksData &clockData, caf::SRTrack &srtrack, bool allowEmpty)
Contains all timing reference information for the detector.
void FillSliceFakeReco(const std::vector< art::Ptr< recob::Hit >> &hits, const std::vector< art::Ptr< simb::MCTruth >> &neutrinos, const caf::SRTruthBranch &srmc, const cheat::ParticleInventoryService &inventory_service, const detinfo::DetectorClocksData &clockData, caf::SRSlice &srslice, const std::vector< caf::SRTrueParticle > &srparticles, const std::vector< art::Ptr< sim::MCTrack >> &mctracks, const std::vector< geo::BoxBoundedGeo > &volumes, TRandom &rand)
Wall_t wallin
Wall of cryostat particle enters (wNone if starting in detector)
std::map< int, std::vector< art::Ptr< recob::Hit > > > PrepTrueHits(const std::vector< art::Ptr< recob::Hit >> &allHits, const detinfo::DetectorClocksData &clockData, const cheat::BackTrackerService &backtracker)
caf::SRVector3D exit
Exit position of particle into Active Volume.
float hit_purity
The fraction of the reconstructed object's hits that originate from the best true particle...
double MaxZ() const
Returns the world z coordinate of the end of the box.
#define MATCH_PROCESS(name)
int G4ID
ID of the particle (taken from G4 – -1 if this particle is not propogated by G4)
std::vector< float > covmx
Vectors of reconstructed vertices found by various algorithms.
TLorentzVector mevprtl_start
std::vector< TVector3 > GetIntersections(TVector3 const &TrajectoryStart, TVector3 const &TrajectoryDirect) const
Calculates the entry and exit points of a trajectory on the box surface.
std::string fName
Name of the parameter set.
unsigned int npiminus
Number of 's after neutrino reaction, before FSI.
Representation of a simb::MCParticle, knows energy, direction,.
int index
Index of the matched true neutrino interaction (-1 if not matched to neutrino)
const MCStep & Start() const
caf::SRVector3D start
Start position of Portal in detector coordinates [cm].
float TotalHitEnergy(const detinfo::DetectorClocksData &clockData, const std::vector< art::Ptr< recob::Hit > > &hits)
int parent_dcy_mode
Parent hadron/muon decay mode.
float energy_completeness
The fraction of the best true particle's energy contained by the reconstructed object.
SRVector3D gen
Generation position [cm].
genie_interaction_mode_ genie_mode
Interaction mode (as for LArSoft MCNeutrino::Mode() )
float visEcosmic
True slice deposited energy from cosmics.
unsigned int ChannelID_t
Type representing the ID of a readout channel.
SRVector3D vtx
Interaction vertex in detector coordinates [cm].
const TLorentzVector & Position() const
Match from a reconstructed track to a true particle */.
std::vector< SRMultiverse > wgt
Systematic weights.
bool cont_tpc
Whether the particle is contained in a single TPC.
std::vector< Point_t > Intersection(const AABox_t &box, const HalfLine_t &line, bool back=false) const
Intersection between a HalfLine and an AABox.
std::vector< unsigned > daughters
ID's of daughter particles from this particle.
SRFakeRecoParticle lepton
Fake-reco lepton information.
void FillEventWeight(const sbn::evwgh::EventWeightMap &wgtmap, caf::SRTrueInteraction &srint, const std::map< std::string, unsigned int > &weightPSetIndex)
double MinY() const
Returns the world y coordinate of the start of the box.
bool empty(FixedBins< T, C > const &) noexcept
The SRFakeReco is a faked reconstruction using estimates from the SBN proposal.
Ionization energy from a Geant4 track.
void FillSRGlobal(const sbn::evwgh::EventWeightParameterSet &pset, caf::SRGlobal &srglobal, std::map< std::string, unsigned int > &weightPSetIndex)
int cryostat
Cryostat the the Interaction originates in. -1 if it originates outside a cryostat.
float visE
Sum of energy deposited on plane [GeV].
float modq_lab
|q|, lab frame
SRTrueParticlePlaneInfo plane[2][3]
Per-plane, per-cryostat deposition information.
TLorentzVector mevprtl_mom
physics associatedGroupsWithLeft p1
BEGIN_PROLOG could also be cout
#define MATCH_PROCESS_NAMED(strname, id)
double decay_weight
Weight associated with the Portal decaying.
float visE
Sum of energy deposited on plane [GeV].
SRTrackTruth truth
truth information TODO: make seperate showe info class
unsigned int nhit
Number of hits on plane.
caf::Wall_t GetWallCross(const geo::BoxBoundedGeo &volume, const TVector3 p0, const TVector3 p1)
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG process_name