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) {
970 const int pdg =
std::abs(particle.pdg);
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);
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) {
1015 const int pdg =
std::abs(particle.pdg);
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;
double SmearHadron(const caf::SRTrueParticle &hadron, TRandom &rand)
double ContainedLength(const TVector3 &v0, const TVector3 &v1, const std::vector< geo::BoxBoundedGeo > &boxes)
SRVector3D start
Start position in the active TPC volume [cm].
bool contained
Whether contained.
double MinX() const
Returns the world x coordinate of the start of the box.
float ke
Fake-reco kinetic energy [GeV].
double SmearLepton(const caf::SRTrueParticle &lepton, TRandom &rand)
float len
Fake-reco particle length [cm].
double MaxX() const
Returns the world x coordinate of the end of the box.
The SRFakeRecoParticle is a faked reconstruction using estimates from the SBN proposal.
process_name pandoraGausCryo1 vertexChargeCryo1 vertexStubCryo1 xmin
int pid
Fake-reco particle ID.
int nhad
Number of hadrons.
float nuE
Fake-reco neutrino Energy [GeV].
double MinZ() const
Returns the world z coordinate of the start of the box.
float costh
Fake-reco cosine of angle w.r.t. beam direction.
float wgt
Weight for this interaction.
double MaxY() const
Returns the world y coordinate of the end of the box.
std::vector< SRFakeRecoParticle > hadrons
Fake-reco information on hadronic state.
SRVector3D end
End position in the active TPC volume [cm].
float startE
Energy at first pt in active TPC volume [GeV].
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 ...
double MaxZ() const
Returns the world z coordinate of the end of the box.
Representation of a simb::MCParticle, knows energy, direction,.
SRVector3D vtx
Interaction vertex in detector coordinates [cm].
SRFakeRecoParticle lepton
Fake-reco lepton information.
double MinY() const
Returns the world y coordinate of the start of the box.
bool ContainsPosition(geo::Point_t const &point, double wiggle=1.0) const
Returns whether this volume contains the specified point.
SRTrueParticlePlaneInfo plane[2][3]
Per-plane, per-cryostat deposition information.
float visE
Sum of energy deposited on plane [GeV].