304 std::vector<art::Ptr<simb::MCTruth>> MCtruthlist;
308 int MCinteractions = MCtruthlist.size();
310 for (
int i=0; i<MCinteractions; i++){
311 MCtruth = MCtruthlist[i];
322 const TLorentzVector& nu_momentum = nu.
Nu().
Momentum(0);
339 int nParticles = MCtruthlist[0]->NParticles();
341 for (
int i=0; i<nParticles; i++){
354 const sim::ParticleList& plist = pi_serv->
ParticleList();
358 particle = ipar->second;
362 const TLorentzVector& lepton_momentum =particle->
Momentum(0);
363 const TLorentzVector& lepton_position =particle->
Position(0);
364 const TLorentzVector& lepton_positionEnd = particle->
EndPosition();
365 const TLorentzVector& lepton_momentumEnd = particle->
EndMomentum();
382 bool isFiducial =
false;
411 std::vector<art::Ptr<recob::Hit>> all_hits;
418 double ehit_total =0.0;
422 std::map<int,double> all_hits_trk_Q;
423 for (
size_t i=0; i < all_hits.size(); ++i) {
425 auto particles = fmhitmc.at(hit.
key());
426 auto hitmatch = fmhitmc.data(hit.
key());
427 double maxenergy = -1e9;
429 for (
size_t j = 0; j < particles.size(); ++j){
430 if (!particles[j])
continue;
434 if ( (hitmatch[j]->
energy) > maxenergy ){
435 maxenergy = hitmatch[j]->energy;
440 all_hits_trk_Q[hit_TrackId] += hit->
Integral();
449 double temp_sh_ehit_Q = 0.0;
450 double temp_sh_allHit_Q = 0.0;
451 int temp_sh_TrackId = -999;
455 std::vector<art::Ptr<recob::Shower>> showerlist;
465 std::map<int,double> showers_trk_Q;
470 std::map<int,double> sh_hits_trk_Q;
471 sh_hits_trk_Q.clear();
487 std::vector<art::Ptr<recob::Hit>> sh_hits;
497 std::vector<art::Ptr<recob::PFParticle> > pfps;
501 std::vector<art::Ptr<recob::Cluster> > clusters;
507 std::vector<art::Ptr<recob::PFParticle>> pfs = fmps.at(i);
508 for (
size_t ipf = 0; ipf<pfs.size(); ++ipf){
510 std::vector<art::Ptr<recob::Cluster>> clus = fmcp.at(pfs[ipf].
key());
511 for (
size_t iclu = 0; iclu<clus.size(); ++iclu){
513 std::vector<art::Ptr<recob::Hit>> hits = fmhc.at(clus[iclu].
key());
514 for (
size_t ihit = 0; ihit<hits.size(); ++ihit){
515 sh_hits.push_back(hits[ihit]);
533 sh_hits = sh_hitsAll.at(i);
538 for (
size_t k=0;
k < sh_hits.size(); ++
k) {
540 auto particles = fmhitmc.at(hit.
key());
541 auto hitmatch = fmhitmc.data(hit.
key());
542 double maxenergy = -1e9;
544 for (
size_t j = 0; j < particles.size(); ++j){
545 if (!particles[j])
continue;
549 if ( (hitmatch[j]->
energy) > maxenergy ){
550 maxenergy = hitmatch[j]->energy;
558 sh_hits_trk_Q[hit_TrackId] += hit->
Integral();
564 double maxshowerQ = -1.0e9;
568 if (
k->second > maxshowerQ) {
569 maxshowerQ =
k->second;
606 if (MClepton_reco && MClepton) {
608 if ((temp_sh_allHit_Q >= temp_sh_ehit_Q) && (temp_sh_ehit_Q > 0.0)) {
629 double temp_esh_1_allhit = -1.0e9;
630 int temp_shower_index = -999;
631 int temp_esh_index = 0;
645 temp_shower_index = i;
double esh_each_purity[MAX_SHOWERS]
double sh_direction_X[MAX_SHOWERS]
const TVector3 & ShowerStart() const
const TLorentzVector & Position(const int i=0) const
const simb::MCNeutrino & GetNeutrino() const
double MC_lepton_startEnergy
const TLorentzVector & EndPosition() const
double esh_1_completeness
double sh_start_Y[MAX_SHOWERS]
const simb::MCParticle * TrackIdToParticle_P(int id) const
const simb::MCParticle & Nu() const
int count_primary_e_in_Event
double sh_direction_Y[MAX_SHOWERS]
std::string fMCTruthModuleLabel
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
double MC_lepton_startMomentum[4]
const art::Ptr< simb::MCTruth > & ParticleToMCTruth_P(const simb::MCParticle *p) const
bool fHitShowerThroughPFParticle
int sh_TrackId[MAX_SHOWERS]
std::string fShowerModuleLabel
int InteractionType() const
const simb::MCParticle & Lepton() const
std::string fHitModuleLabel
double esh_each_completeness[MAX_SHOWERS]
int sh_hasPrimary_e[MAX_SHOWERS]
key_type key() const noexcept
bool insideFV(double vertex[4])
const TVector3 & Direction() const
double sh_start_Z[MAX_SHOWERS]
double sh_purity[MAX_SHOWERS]
Detector simulation of raw signals on wires.
const sim::ParticleList & ParticleList() const
double sh_ehit_Q[MAX_SHOWERS]
double MC_lepton_startXYZT[4]
double MC_lepton_endXYZT[4]
double sh_direction_Z[MAX_SHOWERS]
double sh_completeness[MAX_SHOWERS]
double MC_lepton_endMomentum[40]
double sh_allhit_Q[MAX_SHOWERS]
const TLorentzVector & Momentum(const int i=0) const
std::string fTruthMatchDataModuleLabel
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
const simb::MCParticle * TrackIdToMotherParticle_P(int id) const
Event generator information.
double sh_start_X[MAX_SHOWERS]
const TLorentzVector & EndMomentum() const
double sh_length[MAX_SHOWERS]