3 #include "art/Framework/Principal/Event.h"
5 #include "TPrincipal.h"
18 namespace single_photon
23 std::vector<double>t_wire;
24 std::vector<double>t_tick;
27 std::vector<double>all_wire;
28 std::vector<double>all_tick;
29 std::vector<double>all_dist;
32 for(
size_t h = 0;
h< hitz.size();
h++){
34 double h_wire = (double)
hit->WireID().Wire;
35 double h_tick = (double)
hit->PeakTime();
37 double dd =sqrt(pow(h_wire*0.3-vertex_wire*0.3,2)+pow(h_tick/25.0- vertex_tick/25.0,2));
38 all_wire.push_back(h_wire);
39 all_tick.push_back(h_tick);
40 all_dist.push_back(dd);
44 size_t max_e = std::min((
size_t)Npts,hitz.size());
46 for(
size_t i =0; i<max_e; i++){
47 t_wire.push_back(all_wire[sorted_in[hitz.size()-1-i]]);
48 t_tick.push_back(all_tick[sorted_in[hitz.size()-1-i]]);
51 return new TGraph(t_wire.size(),&t_wire[0],&t_tick[0]);
56 score.
n_hits = hits.size();
58 std::vector<double> t_wires;
59 std::vector<double> t_ticks;
64 double n_max_pca = 0.9999;
98 std::map<int,bool> wire_count;
99 std::map<int,bool> tick_count;
102 double h_tick = (double)
h->PeakTime();
103 double h_wire = (double)
h->WireID().Wire;
125 double dd =sqrt(pow(h_wire*0.3-vertex_wire*0.3,2)+pow(h_tick/25.0- vertex_tick/25.0,2));
136 t_wires.push_back(h_wire);
137 t_ticks.push_back(h_tick);
139 if(wire_count.count((
int)h_wire)<1){
140 wire_count[((int)h_wire)] =
true;
143 if(tick_count.count((
int)h_tick)<1){
144 tick_count[((int)h_tick)] =
true;
163 TPrincipal* principal =
new TPrincipal(2,
"D");
164 double mod_wire = 1.0;
165 double mod_tick = 1.0;
167 for(
int i = 0; i < score.
n_hits; i++){
168 std::vector<double> tmp_pts = {t_wires[i]*mod_wire, t_ticks[i]/mod_tick};
169 principal->AddRow(&tmp_pts[0]);
171 principal->MakePrincipals();
174 TVectorD * eigenval = (TVectorD*) principal->GetEigenValues();
176 TMatrixD * covar = (TMatrixD*) principal->GetCovarianceMatrix();
178 score.
pca_0 = (*eigenval)(0);
179 score.
pca_1 = (*eigenval)(1);
185 score.
pca_theta = atan((*covar)[0][0]/(*covar)[0][1])*180.0/3.14159;
188 double slope = ((*covar)[0][0]/(*covar)[0][1]);
190 score.
impact_parameter = fabs(slope*vertex_wire*mod_wire +vertex_tick/mod_tick+c)/sqrt(slope*slope+1.0*1.0);
193 if(score.
n_wires < n_min_wires || score.
n_ticks < n_min_ticks || score.
pca_0 >= n_max_pca){
206 const std::vector<art::Ptr<recob::Shower>>& showers, std::map<art::Ptr<recob::Shower>, art::Ptr<recob::PFParticle>> & showerToPFParticleMap,
const std::map<art::Ptr<recob::PFParticle>,
std::vector<art::Ptr<recob::Hit>> > & pfParticleToHitsMap,
double eps){
209 for(
size_t s =0;
s< showers.size();
s++){
210 art::Ptr<recob::Shower>
shower = showers[
s];
211 art::Ptr<recob::PFParticle> pfp = showerToPFParticleMap.at(shower);
212 std::vector<art::Ptr<recob::Hit>> showerhits = pfParticleToHitsMap.at(pfp);
214 bool in_primary_shower =
false;
215 for(
size_t h = 0;
h< hitz.size();
h++){
217 double h_wire = (double)
hit->WireID().Wire;
218 double h_tick = (double)
hit->PeakTime();
221 for(
auto &sh: showerhits){
223 if(sh->View() !=
hit->View())
continue;
225 double sh_wire = (double)sh->WireID().Wire;
226 double sh_tick = (double)sh->PeakTime();
229 double dist = sqrt(pow(sh_wire*0.3-h_wire*0.3,2)+pow(sh_tick/25.0-h_tick/25.0,2));
232 in_primary_shower =
true;
240 if(in_primary_shower){
253 art::FindManyP<simb::MCParticle,anab::BackTrackerHitMatchingData>& mcparticles_per_hit,
254 std::vector<art::Ptr<simb::MCParticle>>& mcParticleVector,
256 std::map<
int ,art::Ptr<simb::MCParticle>> & MCParticleToTrackIdMap,
260 std::vector<double> ans;
263 std::vector<double> vec_fraction_matched;
264 std::map<std::string,bool> map_is_shower_process = {{
"compt",
true},{
"FastScintillation",
true},{
"eBrem",
true},{
"phot",
true},{
"eIoni",
true},{
"conv",
true},{
"annihil",
true}};
265 bool reco_verbose =
false;
267 std::unordered_map<int,double> objide;
271 double maxe=-1, tote=0;
273 std::vector<double> total_energy_on_plane = {0.0,0.0,0.0};
274 art::Ptr<simb::MCParticle> best_matched_mcparticle;
275 std::vector<art::Ptr<simb::MCParticle>> particle_vec;
276 std::vector<anab::BackTrackerHitMatchingData const *> match_vec;
278 int n_associated_mcparticle_hits = 0;
279 int n_not_associated_hits = 0;
282 std::vector<art::Ptr<simb::MCParticle>> asso_mcparticles_vec;
283 std::map<art::Ptr<simb::MCParticle>, std::vector<double>> map_asso_mcparticles_energy;
284 bool found_a_match =
false;
287 for(
size_t i_h=0; i_h < hitz.size(); ++i_h){
288 int which_plane = (int)hitz[i_h]->View();
289 particle_vec.clear(); match_vec.clear();
291 mcparticles_per_hit.get(hitz[i_h].key(), particle_vec, match_vec);
294 if(particle_vec.size()>0) n_associated_mcparticle_hits++;
295 if(particle_vec.size()==0) n_not_associated_hits++;
298 for(
size_t i_p=0; i_p<particle_vec.size(); ++i_p){
300 objide[ particle_vec[i_p]->TrackId()] += match_vec[i_p]->energy;
303 if(std::find(asso_mcparticles_vec.begin(), asso_mcparticles_vec.end(), particle_vec[i_p]) == asso_mcparticles_vec.end()){
304 asso_mcparticles_vec.push_back(particle_vec[i_p]);
305 map_asso_mcparticles_energy[particle_vec[i_p]] = {0.0,0.0,0.0};
306 map_asso_mcparticles_energy[particle_vec[i_p]][which_plane] = match_vec[i_p]->energy;
308 map_asso_mcparticles_energy[particle_vec[i_p]][which_plane] += match_vec[i_p]->energy;
311 tote += match_vec[i_p]->energy;
312 total_energy_on_plane[which_plane]+=match_vec[i_p]->energy;
316 if( objide[ particle_vec[i_p]->TrackId()] > maxe ){
317 maxe = objide[ particle_vec[i_p]->TrackId() ];
318 best_matched_mcparticle = particle_vec[i_p];
319 found_a_match =
true;
327 double fraction_num_hits_overlay = (double)n_not_associated_hits/(
double)hitz.size();
333 if(n_associated_mcparticle_hits == 0){
335 found_a_match =
false;
337 return {0,0,0,0,0,0,0};
346 std::map<int, art::Ptr<simb::MCParticle>> mother_MCP_map;
348 std::vector<art::Ptr<simb::MCParticle>> marks_mother_vector;
349 std::map<art::Ptr<simb::MCParticle>, std::vector<double>> marks_mother_energy_fraction_map;
351 int this_mcp_id = -1;
352 int last_mcp_id = -1;
355 int num_bt_mothers =0;
359 for(
auto mcp:asso_mcparticles_vec){
361 if(reco_verbose)
std::cout<<
"-----------------------------Start L1 Loop --------------------------------------------------"<<std::endl;
367 this_mcp_id = mcp->TrackId();
368 last_mcp_id = this_mcp_id;
373 while(this_mcp_id >= 0 ){
374 art::Ptr<simb::MCParticle> this_mcp = MCParticleToTrackIdMap[this_mcp_id];
378 if (this_mcp.isNull()){
380 this_mcp_id = last_mcp_id;
388 last_mcp_id = this_mcp_id;
389 this_mcp_id = this_mcp->Mother();
392 if(map_is_shower_process.count(this_mcp->Process()) > 0){
395 }
else if(this_mcp->Process()==
"primary"){
397 if(reco_verbose)
std::cout<<
"L1: Backtracked to primary! breaking"<<std::endl;
398 this_mcp_id = last_mcp_id;
401 if(reco_verbose)
std::cout<<
"L1: Backtracked to a particle created in "<<this_mcp->EndProcess()<<
"! breaking"<<std::endl;
402 this_mcp_id = last_mcp_id;
408 if (this_mcp_id >= 0){
410 mother_MCP_map[this_mcp_id] = MCParticleToTrackIdMap[this_mcp_id];
414 for(
size_t k=0;
k< marks_mother_vector.size();
k++){
416 if(marks_mother_vector[
k]==MCParticleToTrackIdMap[this_mcp_id]){
417 marks_mother_energy_fraction_map[marks_mother_vector[
k]][0] += map_asso_mcparticles_energy[mcp][0];
418 marks_mother_energy_fraction_map[marks_mother_vector[
k]][1] += map_asso_mcparticles_energy[mcp][1];
419 marks_mother_energy_fraction_map[marks_mother_vector[
k]][2] += map_asso_mcparticles_energy[mcp][2];
425 marks_mother_vector.push_back(MCParticleToTrackIdMap[this_mcp_id]);
426 marks_mother_energy_fraction_map[marks_mother_vector.back()] = {0.0,0.0,0.0};
427 marks_mother_energy_fraction_map[marks_mother_vector.back()][0] = map_asso_mcparticles_energy[mcp][0];
428 marks_mother_energy_fraction_map[marks_mother_vector.back()][1] = map_asso_mcparticles_energy[mcp][1];
429 marks_mother_energy_fraction_map[marks_mother_vector.back()][2] = map_asso_mcparticles_energy[mcp][2];
435 if(reco_verbose)
std::cout<<
"L1: error, the mother mother id was "<<this_mcp_id <<std::endl;
439 if(reco_verbose)
std::cout<<
"-----------------------------End L1 Loop --------------------------------------------------"<<std::endl;
445 if(reco_verbose)
std::cout<<
"recoMC()\t||\t the number of source mother particles is "<<mother_MCP_map.size()<<
" of which : "<<marks_mother_vector.size()<<
" are unique!"<<std::endl;
447 if(reco_verbose)
std::cout<<
"---------------------------- L2-------------------------------"<<std::endl;
449 double best_mother_index = 0;
450 double best_mother_energy = -9999;
451 int best_mother_plane = -99;
453 for(
size_t p=0;
p< marks_mother_vector.size();
p++){
454 art::Ptr<simb::MCParticle> mother = marks_mother_vector[
p];
455 std::vector<double> mother_energy_recod = marks_mother_energy_fraction_map[mother];
456 if(reco_verbose)
std::cout<<
"L2: Mother candidate "<<
p<<
" TrackID "<<mother->TrackId()<<
" Process: "<<mother->Process()<<
" EndProcess: "<<mother->EndProcess()<<std::endl;
457 if(reco_verbose)
std::cout<<
"L2: Mother candidate "<<
p<<
" Energy "<<mother->E()<<
" Reco'd Energy: "<<mother_energy_recod[0]<<
" | "<<mother_energy_recod[1]<<
" | "<<mother_energy_recod[2]<<
" Fraction: ("<<mother_energy_recod[0]/(1000*mother->E())*100.0<<
"% , "<<mother_energy_recod[1]/(1000*mother->E())*100.0<<
"% , "<<mother_energy_recod[2]/(1000*mother->E())*100.0<<
"% )"<<std::endl;
459 if( mother_energy_recod[0] > best_mother_energy){
460 best_mother_index =
p;
461 best_mother_energy = mother_energy_recod[0];
462 best_mother_plane = 0;
465 if( mother_energy_recod[1] > best_mother_energy){
466 best_mother_index =
p;
467 best_mother_energy = mother_energy_recod[1];
468 best_mother_plane = 1;
471 if( mother_energy_recod[2] > best_mother_energy){
472 best_mother_index =
p;
473 best_mother_energy = mother_energy_recod[2];
474 best_mother_plane = 2;
479 if(marks_mother_vector.size()!=0){
481 std::cout<<
"recoMC()\t||\t The `BEST` mother is a "<<marks_mother_vector[best_mother_index]->PdgCode()<<
" at "<<best_mother_index<<
" on plane: "<<best_mother_plane<<std::endl;
482 for(
int l=0; l<3; l++){
483 std::cout<<
"recoMC()\t||\t It represents "<<marks_mother_energy_fraction_map[marks_mother_vector[best_mother_index]][l]/total_energy_on_plane[l]*100.0<<
"% of the energy on plane: "<<l<<
" which is "<<total_energy_on_plane[l] <<std::endl;
488 if(reco_verbose)
std::cout<<
"---------------------------- L2-------------------------------"<<std::endl;
489 const art::Ptr<simb::MCParticle> match = marks_mother_vector[best_mother_index];
491 std::vector<double> corrected_vertex(3), corrected_start(3);
495 art::Ptr<simb::MCParticle> match_mother = MCParticleToTrackIdMap[match->Mother()];
497 if (match_mother.isNull()){
501 par_pdg = match_mother->PdgCode();
504 ans = {1,(double)match->PdgCode(), (double)par_pdg, (
double)match->TrackId(), match->E(), fraction_num_hits_overlay, best_mother_energy/total_energy_on_plane.at(best_mother_plane)};
524 std::map<art::Ptr<recob::Shower>, art::Ptr<recob::PFParticle>> & NormalShowerToPFParticleMap,
526 std::map<art::Ptr<recob::Track>,
527 art::Ptr<recob::PFParticle>> & NormalTrackToPFParticleMap,
528 art::Event
const &
evt,
533 std::string sss3dlabel =
"pandoraShower";
535 art::ValidHandle<std::vector<recob::Shower>>
const & allShowerHandle = evt.getValidHandle<std::vector<recob::Shower>>(sss3dlabel);
536 std::vector<art::Ptr<recob::Shower>> allShowerVector;
537 art::fill_ptr_vector(allShowerVector,allShowerHandle);
538 std::cout<<
"We have "<<showers.size()<<
" showers in primary slice and "<<allShowerVector.size()<<
" in full event."<<std::endl;
540 art::FindManyP<recob::Hit> hits_per_shower(allShowerHandle, evt, sss3dlabel);
541 std::map<art::Ptr<recob::Shower>, std::vector<art::Ptr<recob::Hit>> > showerToHitsMap;
542 for(
size_t i=0; i< allShowerVector.size(); ++i){
543 showerToHitsMap[allShowerVector[i]] = hits_per_shower.at(allShowerVector[i].key());
546 art::FindOneP<recob::PFParticle> pfparticle_per_shower(allShowerHandle, evt, sss3dlabel);
547 std::map<art::Ptr<recob::Shower>, art::Ptr<recob::PFParticle> > showerToPFParticleMap;
548 for(
size_t i=0; i< allShowerVector.size(); ++i){
549 showerToPFParticleMap[allShowerVector[i]] = pfparticle_per_shower.at(allShowerVector[i].key());
552 art::ValidHandle<std::vector<recob::PFParticle>>
const & pfParticleHandle = evt.getValidHandle<std::vector<recob::PFParticle>>(
"pandora");
553 std::vector<art::Ptr<recob::PFParticle>> allPFParticleVector;
554 art::fill_ptr_vector(allPFParticleVector,pfParticleHandle);
559 size_t n_all_shr = allShowerVector.size();
562 if(showers.size()==0)
return;
564 auto primary_shower = showers.front();
566 std::cout<<
"PandoraAllOutcomesShower has "<<n_all_shr<<
" Showers in total. "<<std::endl;
567 for(
auto &shr: allShowerVector){
572 auto pfp = showerToPFParticleMap[shr];
578 std::vector<std::string> interested = {
"IsClearCosmic",
"TrackScore",
"NuScore",
"IsNeutrino",
"SliceIndex"};
605 bool is_matched =
false;
607 for(
auto &
s: showers){
610 if(
s->ShowerStart().X() == shr->ShowerStart().X() || pfp->Self()== NormalShowerToPFParticleMap[
s]->Self()){
619 if(pfp->Self()== NormalTrackToPFParticleMap[
s]->Self()){
634 double shr_score = 0.0;
635 int is_clear_cosmic_slice = 0 ;
671 std::string base =
"sss3d_";
672 std::vector<std::string> mod = {
"ioc_ranked",
"invar_ranked"};
693 std::string base2d =
"sss_";
694 std::vector<std::string> mod2d = {
"ioc_ranked",
"conv_ranked",
"invar_ranked"};
730 std::vector<size_t> ranked_invar = sort_indexes_rev<double>((inv));
738 for(
int j=0; j<to_consider; j++){
743 for(
int j=0; j<to_consider; j++){
748 for(
int j=0; j<to_consider; j++){
749 int rk = ranked_en[ranked_en.size()-1-j];
753 for(
int j=0; j<to_consider; j++){
789 std::vector<int> nplans(3,0);
790 std::vector<std::vector<int>> indexmap(3);
797 std::vector<std::vector<int>> uniq_candidates;
803 indexmap[ip].push_back(i);
810 bool contain_ij =
false;
811 bool contain_ji =
false;
815 if(contain_ij && contain_ji){
816 uniq_candidates.push_back({i,j});
822 for(
int i = 0; i< (int)uniq_candidates.size(); i++){
825 bool new_plane =
true;
826 for(
auto &pp:uniq_candidates[i]){
831 bool contain_ik =
false;
832 bool contain_ki =
false;
833 bool contain_jk =
false;
834 bool contain_kj =
false;
841 if((contain_ik&&contain_ki) || (contain_jk&&contain_kj)){
842 uniq_candidates[i].push_back(
k);
850 for(
int i = 0; i< (int)uniq_candidates.size(); i++){
851 for(
auto &j: uniq_candidates[i]){
852 used_candidates[j]++;
857 for(
int i = 0; i< (int)used_candidates.size(); i++){
858 if(used_candidates[i]==0) uniq_candidates.push_back({i});
862 std::vector<std::vector<int>> uniq_candidates2;
863 uniq_candidates2.push_back(uniq_candidates.front());
865 for(
int i = 1; i< (int)uniq_candidates.size(); i++){
868 for(
int j = 0; j< (int)uniq_candidates2.size(); j++){
869 perm = marks_compare_vec_nonsense<int>(uniq_candidates[i], uniq_candidates2[j]);
872 if(!perm) uniq_candidates2.push_back(uniq_candidates[i]);
877 for(
int i = 0; i< (int)uniq_candidates2.size(); i++){
879 for(
auto &j: uniq_candidates2[i])
std::cout<<
" "<<j;
884 std::vector<bool> candidate_pass(uniq_candidates2.size(),
false);
885 std::vector<double> candidates_en(uniq_candidates2.size(),0);
886 std::vector<double> candidates_ioc(uniq_candidates2.size(),0);
887 std::vector<double> candidates_conv(uniq_candidates2.size(),0);
888 std::vector<double> candidates_pca(uniq_candidates2.size(),0);
889 std::vector<double> candidates_angle_to_shower(uniq_candidates2.size(),0);
890 std::vector<int> candidates_num_planes(uniq_candidates2.size(),0);
891 std::vector<double> candidates_eff_invar(uniq_candidates2.size(),0);
892 std::vector<double> candidates_eff_invar_diff(uniq_candidates2.size(),0);
897 for(
int j=0; j<(int)uniq_candidates2.size();j++){
898 int nt=uniq_candidates2[j].size();
901 double mean_min_dist = 0.0;
902 double max_min_dist = 0.0;
904 double mean_energy = 0.0;
906 double mean_impact = 0.0;
907 double mean_conv = 0.0;
908 double min_conv = 999;
910 double min_impact = 999;
911 double mean_invar = 0.0;
912 double mean_invar_diff = 0.0;
915 double min_angle = 999;
921 for(
int c=0; c< nt;++c){
922 int ic = uniq_candidates2[j][c];
927 double eff_invar_diff = fabs(eff_invar-139.5);
936 mean_invar +=eff_invar/(double)nt;
937 mean_invar_diff +=eff_invar_diff/(double)nt;
946 std::cout<<
"======== Mean En "<<mean_energy<<
" mean dist "<<mean_min_dist<<
" meanimpact "<<mean_impact<<
" minimpact/maxdist : "<<min_impact/max_min_dist<<
" invar "<<mean_invar<<std::endl;
947 candidates_ioc[j]=min_impact/max_min_dist;
948 candidates_en[j]=mean_energy;
949 candidates_conv[j] = min_conv;
950 candidates_pca[j] = max_pca;
951 candidates_angle_to_shower[j] = min_angle;
952 candidates_num_planes[j] =nt;
953 candidates_eff_invar_diff[j] = mean_invar_diff;
954 candidates_eff_invar[j] = mean_invar;
959 std::vector<size_t> ranked_ioc = sort_indexes_rev<double>(candidates_ioc);
960 std::vector<size_t> ranked_invar = sort_indexes_rev<double>(candidates_eff_invar_diff);
961 std::vector<size_t> ranked_conv = sort_indexes_rev<double>(candidates_conv);
963 std::cout<<
"========== Ranking ======== "<<std::endl;
998 std::pair<bool, std::vector<double>>
clusterCandidateOverlap(
const std::vector<int> & candidate_indices,
const std::vector<int>& cluster_planes,
const std::vector<double>& cluster_max_ticks,
const std::vector<double>& cluster_min_ticks){
1000 size_t size = candidate_indices.size();
1002 throw std::runtime_error(
"clusterCandidateOverlap: No cluster candidates to analyze time overlap for..");
1007 std::vector<double> max_ticks;
1008 std::vector<double> min_ticks;
1009 std::vector<double> tick_length;
1011 for(
auto i : candidate_indices){
1012 planes.push_back(cluster_planes[i]);
1014 max_ticks.push_back(cluster_max_ticks[i]);
1015 min_ticks.push_back(cluster_min_ticks[i]);
1016 tick_length.push_back(cluster_max_ticks[i] - cluster_min_ticks[i]);
1021 if( size == 2 && planes[0] == planes[1])
1022 return {
false, std::vector<double>(2, -1.0)};
1023 if( size == 3 && (planes[0] == planes[1] || planes[1] == planes[2] || planes[0] == planes[2]))
1024 return {
false, std::vector<double>(3, -1.0)};
1027 double tick_overlap = DBL_MAX;
1030 for(
auto max_e : max_ticks)
1031 for(
auto min_e : min_ticks)
1032 if(max_e - min_e < tick_overlap)
1033 tick_overlap = max_e - min_e;
1036 if(tick_overlap < 0)
1037 return {
false, std::vector<double>(
size, -1.0)};
1039 std::vector<double> overlap_fraction;
1040 for(
auto l: tick_length){
1041 overlap_fraction.push_back( l==0? 1.0 : tick_overlap/l);
1043 return {
true, overlap_fraction};
1048 std::pair<int, std::pair<std::vector<std::vector<double>>, std::vector<double>>>
GroupClusterCandidate(
int num_clusters,
const std::vector<int>& cluster_planes,
const std::vector<double>& cluster_max_ticks,
const std::vector<double>& cluster_min_ticks){
1049 std::cout <<
"group_cluster_candidate\t|| Total of " << num_clusters <<
" to be grouped" << std::endl;
1051 int num_cluster_groups=0;
1052 std::vector<std::vector<double>> grouped_cluster_indices;
1053 std::vector<double> cluster_group_timeoverlap_fraction;
1054 if(num_clusters <= 1)
1055 return {num_cluster_groups, {grouped_cluster_indices, cluster_group_timeoverlap_fraction}};
1057 for(
int i = 0; i != num_clusters -1; ++i){
1058 for(
int j = i+1; j != num_clusters; ++j){
1062 if( pair_result.first){
1064 ++num_cluster_groups;
1065 grouped_cluster_indices.push_back({(double)i,(
double)j});
1066 double min_frac = *std::min_element(pair_result.second.cbegin(), pair_result.second.cend());
1067 cluster_group_timeoverlap_fraction.push_back(min_frac);
1068 std::cout <<
"Grouped cluster candidate: (" << i <<
", " << j <<
") | Minimum time tick overlap fraction: " << min_frac << std::endl;
1071 for(
int k = j+1;
k!= num_clusters; ++
k){
1073 if(tri_result.first){
1074 ++num_cluster_groups;
1075 grouped_cluster_indices.push_back({(double)i,(
double)j,(double)
k});
1076 min_frac = *std::min_element(tri_result.second.cbegin(), tri_result.second.cend());
1077 cluster_group_timeoverlap_fraction.push_back(min_frac);
1078 std::cout <<
"Grouped cluster candidate: (" << i <<
", " << j <<
", " <<
k <<
") | Minimum time tick overlap fraction: " << min_frac << std::endl;
1085 std::cout <<
"GroupClusterCandidate\t|| Formed " << num_cluster_groups <<
" cluster groups" << std::endl;
1087 return {num_cluster_groups, {grouped_cluster_indices, cluster_group_timeoverlap_fraction}};
1101 std::vector<PandoraPFParticle> all_PPFPs,
1103 const std::vector<art::Ptr<recob::Shower>>& showers,
1108 int total_track_hits =0;
1109 int total_shower_hits =0;
1110 int nu_slice_id = -999;
1112 std::vector< art::Ptr<recob::Hit> > associated_hits;
1113 std::vector< art::Ptr<recob::Hit> > unassociated_hits;
1114 std::vector< art::Ptr<recob::Hit> > unassociated_hits_plane0;
1115 std::vector< art::Ptr<recob::Hit> > unassociated_hits_plane1;
1116 std::vector< art::Ptr<recob::Hit> > unassociated_hits_plane2;
1118 std::vector< std::map<size_t, std::vector< art::Ptr<recob::Hit> >> > v_newClusterToHitsMap(3);
1120 std::vector<art::Ptr<recob::Hit>> slicehits;
1123 for(
size_t t =0; t<
tracks.size(); t++){
1132 std::vector<art::Ptr<recob::Hit>> tmp_slicehits = ppfp->
pSliceHits;
1133 std::vector<art::Ptr<recob::Hit>> trackhits = ppfp->
pPFPHits;
1135 if(ppfp->
get_IsNeutrino()) slicehits.insert(slicehits.end(), tmp_slicehits.begin(), tmp_slicehits.end());
1137 std::cout <<
"*SSS: track "<< t <<
" is in slice "<< sliceid <<
" which has "<< tmp_slicehits.size() <<
" hits. This track has "<< trackhits.size() <<
" of them. " << std::endl;
1138 total_track_hits += trackhits.size();
1148 for(
auto &
h: trackhits){
1149 associated_hits.push_back(
h);
1157 for(
size_t s =0;
s< showers.size();
s++){
1158 art::Ptr<recob::Shower>
shower = showers[
s];
1166 if(sliceid<0)
continue;
1171 std::cout<<
"*SSS: shower "<<
s <<
" is in slice "<< sliceid <<
" which has "<< tmp_slicehits.size() <<
" hits. This shower has "<< showerhits.size() <<
" of them. "<< std::endl;
1172 total_shower_hits+=showerhits.size();
1174 for(
auto &
h: showerhits){
1175 associated_hits.push_back(
h);
1183 std::cout<<
"*SSS: So in total we have "<<total_shower_hits<<
" shower hits and "<<total_track_hits<<
" track hits"<<
" associatedHits total: "<<associated_hits.size()<<std::endl;
1187 if(nu_slice_id >= 0){
1190 std::cout<<
"*SSS: So that leaves "<<slicehits.size()-total_shower_hits-total_track_hits<<
" hits not included in tracks and showers"<<std::endl;
1193 std::cout<<
"ERROR!! Number of unassociated hits is negative, i.e: num_associated: "<<vars.
m_sss_num_associated_hits<<
" and total slice hits: "<<slicehits.size()<<std::endl;
1200 for(
auto &
h: slicehits){
1202 bool is_associated =
false;
1203 for(
auto &
a: associated_hits){
1205 is_associated =
true;
1211 unassociated_hits.push_back(
h);
1212 auto plane_view =
h->View();
1213 switch((
int)plane_view){
1215 unassociated_hits_plane0.push_back(
h);
1218 unassociated_hits_plane1.push_back(
h);
1221 unassociated_hits_plane2.push_back(
h);
1229 std::vector<std::vector<art::Ptr<recob::Hit>>> unassociated_hits_all = {unassociated_hits_plane0,unassociated_hits_plane1,unassociated_hits_plane2};
1231 std::cout<<
" *associated_hits.size() "<<associated_hits.size()<<
" unassociated_hits.size() "<<unassociated_hits.size()<<
" p0: "<<unassociated_hits_plane0.size()<<
" p1: "<<unassociated_hits_plane1.size()<<
" p2: "<<unassociated_hits_plane2.size()<<std::endl;
1238 TCanvas *can =
new TCanvas(print_name.c_str(), print_name.c_str(),3000,800);
1239 can->Divide(4, 1, 0.0, 0.1);
1241 double tick_max = 0;
1242 double tick_min = 1
e10;
1243 std::vector<double> chan_max(3,0);
1244 std::vector<double> chan_min(3,1
e10);
1247 TCanvas *histcan =
new TCanvas((
"hists_"+print_name).c_str(),
"Distances from the track", 600, 400);
1248 histcan->Divide(3, 2, 0.005, 0.1);
1250 TH1D *s_hist0 =
new TH1D(
"shower hits hist plane0",
"Showers Plane 0", 30, 0.0, 30.0);
1251 TH1D *s_hist1 =
new TH1D(
"shower hist plane1",
"Showers Plane 1", 30, 0.0, 30.0);
1252 TH1D *s_hist2 =
new TH1D(
"shower hist plane2",
"Showers Plane 2", 30, 0.0, 30.0);
1253 std::vector<TH1D *> s_hists = {s_hist0, s_hist1, s_hist2};
1255 TH1D *u_hist0 =
new TH1D(
"unassociated hits hist plane0",
"Unassoc Plane 0", 30, 0.0, 30.0);
1256 TH1D *u_hist1 =
new TH1D(
"unassociated hits hist plane1",
"Unassoc Plane 1", 30, 0.0, 30.0);
1257 TH1D *u_hist2 =
new TH1D(
"unassociated hits hist plane2",
"Unassoc Plane 2", 30, 0.0, 30.0);
1258 std::vector<TH1D *> u_hists = {u_hist0, u_hist1, u_hist2};
1261 std::cout <<
"Isolation: Acquiring track hit coordinates" << std::endl;
1263 std::vector<std::vector<TGraph *>> pts_trk(
tracks.size(), std::vector<TGraph *>(3) );
1269 std::vector<TGraph*> t_pts(3);
1270 std::vector<std::vector<double>> t_vec_t(3);
1271 std::vector<std::vector<double>> t_vec_c(3);
1273 for(
auto &th: trackhits){
1274 double wire = (double)th->WireID().Wire;
1275 t_vec_c[(int)th->View()].push_back(wire);
1277 double time = (double)th->PeakTime();
1278 t_vec_t[(int)th->View()].push_back(time);
1280 tick_max = std::max(tick_max, time);
1281 tick_min = std::min(tick_min, time);
1282 chan_max[(int)th->View()] = std::max( chan_max[(
int)th->View()], wire);
1283 chan_min[(int)th->View()] = std::min( chan_min[(
int)th->View()], wire);
1287 t_pts[0] =
new TGraph(t_vec_c[0].
size(), &(t_vec_c[0])[0], &(t_vec_t[0])[0]);
1288 t_pts[1] =
new TGraph(t_vec_c[1].
size(), &(t_vec_c[1])[0], &(t_vec_t[1])[0]);
1289 t_pts[2] =
new TGraph(t_vec_c[2].
size(), &(t_vec_c[2])[0], &(t_vec_t[2])[0]);
1292 std::cout <<
"Isolation: plane0 track hits = " << t_vec_t[0].size() << std::endl;
1293 std::cout <<
"Isolation: plane1 track hits = " << t_vec_t[1].size() << std::endl;
1294 std::cout <<
"Isolation: plane2 track hits = " << t_vec_t[2].size() << std::endl;
1297 std::cout <<
"Isolation: Acquiring shower hit coordinates and comparing with track hits " << std::endl;
1300 std::vector<std::vector<TGraph *>> pts_shr( showers.size(), std::vector<TGraph *>(3) );
1303 std::vector<std::map< art::Ptr< recob::Hit>,
double >> sh_dist(3);
1305 std::vector< std::pair<art::Ptr< recob::Hit >,
double > > max_min_hit(3);
1311 std::vector<TGraph*> t_pts_s(3);
1312 std::vector<std::vector<double>> vec_t(3);
1313 std::vector<std::vector<double>> vec_c(3);
1314 std::vector<int> num_shr_hits(3);
1316 for(
auto &sh: showerhits){
1317 int plane = (int)sh->View();
1318 num_shr_hits[plane] += 1;
1320 double minDist = 999.9;
1323 if (t_vec_c[(
int)sh->View()].size() != 0){
1324 double wire = (double)sh->WireID().Wire;
1325 vec_c[(int)sh->View()].push_back(wire);
1326 double time = (double)sh->PeakTime();
1327 vec_t[(int)sh->View()].push_back(time);
1329 for (
unsigned int th = 0; th < t_vec_c[(int)sh->View()].size(); th++){
1330 dist = sqrt( pow (time/25 - (t_vec_t[(
int)sh->View()])[th]/25, 2) + pow( wire*0.3 - (t_vec_c[(
int)sh->View()])[th]*0.3, 2) );
1331 if (dist < minDist) {
1336 s_hists[(int)sh->View()]->Fill(minDist);
1339 if (sh_dist[plane].
size() < 10){
1340 (sh_dist[plane])[sh] = minDist;
1341 max_min_hit[plane] = (*std::max_element(sh_dist[plane].
begin(), sh_dist[plane].
end(),
map_max_fn));
1343 else{
if (minDist < max_min_hit[plane].
second){
1344 sh_dist[plane].erase(max_min_hit[plane].
first);
1345 (sh_dist[plane])[sh] = minDist;
1346 max_min_hit[plane] = (*std::max_element(sh_dist[plane].
begin(), sh_dist[plane].
end(),
map_max_fn));
1350 tick_max = std::max(tick_max, (
double)sh->PeakTime());
1351 tick_min = std::min(tick_min, (
double)sh->PeakTime());
1352 chan_max[(int)sh->View()] = std::max( chan_max[(
int)sh->View()], wire);
1353 chan_min[(int)sh->View()] = std::min( chan_min[(
int)sh->View()], wire);
1358 t_pts_s[0] =
new TGraph(vec_c[0].
size(), &(vec_c[0])[0], &(vec_t[0])[0]);
1359 t_pts_s[1] =
new TGraph(vec_c[1].
size(), &(vec_c[1])[0], &(vec_t[1])[0]);
1360 t_pts_s[2] =
new TGraph(vec_c[2].
size(), &(vec_c[2])[0], &(vec_t[2])[0]);
1362 pts_shr[0] = t_pts_s;
1365 for(
int plane = 0; plane < 3; plane++){
1366 if (num_shr_hits[plane] == 0){
1371 else if (t_vec_t[plane].
size() > 0) {
1372 auto abs_min = (*std::min_element(sh_dist[plane].
begin(), sh_dist[plane].
end(),
map_min_fn));
1391 s_hists[0]->GetXaxis()->SetTitle(
"distance from shower hit to closest track hit [cm]");
1395 s_hists[1]->GetXaxis()->SetTitle(
"distance from shower hit to closest track hit [cm]");
1399 s_hists[2]->GetXaxis()->SetTitle(
"distance from shower hit to closest track hit [cm]");
1404 std::cout <<
"Isolation: Acquiring unassociated hits coordinates and comparing with track hits" << std::endl;
1407 std::vector<TGraph *> g_unass(3);
1409 std::vector<std::vector<std::vector<double>>> pts_to_recluster(3);
1411 std::vector<std::map<int, art::Ptr<recob::Hit>>> mapPointIndexToHit(3);
1413 std::vector<double> minDist_tot(3);
1414 std::vector<double> minWire(3);
1415 std::vector<double> minTime(3);
1417 for(
int plane = 0; plane < 3; plane++){
1418 minDist_tot[plane] = 999;
1419 std::vector<double> vec_t;
1420 std::vector<double> vec_c;
1422 for(
auto &uh: unassociated_hits_all[plane]){
1424 if (t_vec_c[plane].
size() == 0)
break;
1426 double wire = (double)uh->WireID().Wire;
1427 vec_c.push_back(wire);
1428 double time = (double)uh->PeakTime();
1429 vec_t.push_back(time);
1431 double minDist = 999.9;
1433 for (
unsigned int th = 0; th < t_vec_c[(int)uh->View()].size(); th++){
1434 dist = sqrt( pow (time/25 - (t_vec_t[(
int)uh->View()])[th]/25, 2) + pow( wire*0.3 - (t_vec_c[(
int)uh->View()])[th]*0.3, 2) );
1435 if (dist < minDist) { minDist =
dist; }
1437 u_hists[(int)uh->View()]->Fill(minDist);
1439 if (minDist < minDist_tot[plane]) {
1440 minDist_tot[plane] = minDist;
1441 minWire[plane] = wire;
1442 minTime[plane] = time;
1446 std::vector<double> pt = {wire, vec_t.back()};
1447 pts_to_recluster[(int)uh->View()].push_back(pt);
1448 mapPointIndexToHit[(int)uh->View()][pts_to_recluster[(int)uh->View()].size()-1] = uh;
1452 g_unass[plane] =
new TGraph(vec_c.size(), &vec_c[0], &vec_t[0]);
1456 for(
int plane = 0; plane < 3; plane++){
1457 if (t_vec_t[plane].
size() > 0 && unassociated_hits_all[plane].size() > 0){
1476 u_hists[0]->GetXaxis()->SetTitle(
"distance from unassoc hit to closest track hit [cm]");
1480 u_hists[1]->GetXaxis()->SetTitle(
"distance from unassoc hit to closest track hit [cm]");
1484 u_hists[2]->GetXaxis()->SetTitle(
"distance from unassoc hit to closest track hit [cm]");
1497 double plot_point_size = 0.6;
1499 std::vector<int> tcols = {kRed-7, kBlue-7, kGreen-3, kOrange-3, kCyan-3, kMagenta-3, kGreen+1 , kRed+1};
1501 if(showers.size()+
tracks.size() > tcols.size()){
1502 for(
int i =0; i< (int)(showers.size()+
tracks.size() - tcols.size() +2); i++){
1503 tcols.push_back(tcols[(
int)paras.
rangen->Uniform(0,7)]+(int)paras.
rangen->Uniform(-5,5));
1507 std::cout<<
"*Tick Min: "<<tick_min<<
" Max: "<<tick_max<<std::endl;
1508 auto const TPC = (*paras.
s_geom).begin_TPC();
1510 int fCryostat = ID.Cryostat;
1512 std::cout<<
TPC.ID()<<
"*= the beginning TPC ID" <<std::endl;
1513 std::cout<<
"*the cryostat id = "<<fCryostat<<std::endl;
1514 std::cout<<
"*the tpc id = "<<fTPC<<std::endl;
1519 std::vector<double> vertex_time(3);
1520 std::vector<double> vertex_wire(3);
1523 std::vector<TGraph*> g_vertex(3);
1524 for(
int i=0; i<3; i++){
1525 TPad * pader = (TPad*)can->cd(i+1);
1527 if(i==0 ) pader->SetLeftMargin(0.1);
1532 vertex_time[i] = time[0];
1533 vertex_wire[i] = wire[0];
1540 chan_max[i] = std::max( chan_max[i],wire[0]);
1541 chan_min[i] = std::min( chan_min[i],wire[0]);
1543 g_vertex[i] =
new TGraph(1,&wire[0],&time[0]);
1544 g_vertex[i]->SetMarkerStyle(29);
1545 g_vertex[i]->SetMarkerSize(4);
1546 g_vertex[i]->SetMarkerColor(kMagenta-3);
1547 g_vertex[i]->GetYaxis()->SetRangeUser(tick_min*0.9,tick_max*1.1);
1548 g_vertex[i]->GetXaxis()->SetLimits(chan_min[i]*0.9,chan_max[i]*1.1);
1550 g_vertex[i]->GetYaxis()->SetTitle(
"Peak Hit Time Tick");
1551 g_vertex[i]->GetXaxis()->SetTitle( (
"Wire Number Plane " +
std::to_string(i)).c_str());
1552 g_vertex[i]->Draw(
"ap");
1555 g_vertex[i]->GetYaxis()->SetLabelOffset(999);
1556 g_vertex[i]->GetYaxis()->SetLabelSize(0);
1583 for(
size_t t=0; t< pts_trk.size(); t++){
1584 int tcol = tcols[used_col];
1587 for(
int i=0; i<3; i++){
1589 if(pts_trk[t][i]->GetN()>0){
1590 pts_trk[t][i]->Draw(
"p same");
1591 pts_trk[t][i]->SetMarkerColor(tcol);
1592 pts_trk[t][i]->SetFillColor(tcol);
1593 pts_trk[t][i]->SetMarkerStyle(20);
1594 pts_trk[t][i]->SetMarkerSize(plot_point_size);
1600 for(
size_t t=0; t< pts_shr.size(); t++){
1601 int tcol = tcols[used_col];
1604 for(
int i=0; i<3; i++){
1606 if(pts_shr[t][i]->GetN()>0){
1607 pts_shr[t][i]->Draw(
"p same");
1608 pts_shr[t][i]->SetMarkerColor(tcol);
1609 pts_shr[t][i]->SetFillColor(tcol);
1610 pts_shr[t][i]->SetMarkerStyle(20);
1611 pts_shr[t][i]->SetMarkerSize(plot_point_size);
1618 for(
int i=0; i<3; i++){
1620 if (g_unass[i]->GetN() > 0){
1621 g_unass[i]->SetMarkerColor(kBlack);
1622 g_unass[i]->SetMarkerStyle(20);
1623 g_unass[i]->SetMarkerSize(plot_point_size);
1625 g_vertex[i]->Draw(
"p same");
1633 TPad *p_top_info = (TPad*)can->cd(4);
1637 pottex.SetTextSize(0.045);
1638 pottex.SetTextAlign(13);
1641 pottex.DrawLatex(.1,.94, pot_draw.c_str());
1643 TLegend * l_top =
new TLegend(0.5,0.5,0.85,0.85);
1646 for(
size_t t=0; t< pts_shr.size(); t++){
1648 if(pts_shr[t][0]->GetN()>0){
1649 l_top->AddEntry(pts_shr[t][0],sname.c_str(),
"f");
1650 }
else if(pts_shr[t][1]->GetN()>0){
1651 l_top->AddEntry(pts_shr[t][1],sname.c_str(),
"f");
1652 }
else if(pts_shr[t][2]->GetN()>0){
1653 l_top->AddEntry(pts_shr[t][2],sname.c_str(),
"f");
1658 for(
size_t t=0; t< pts_trk.size(); t++){
1660 if(pts_trk[t][0]->GetN()>0){
1661 l_top->AddEntry(pts_trk[t][0],sname.c_str(),
"f");
1662 }
else if(pts_trk[t][1]->GetN()>0){
1663 l_top->AddEntry(pts_trk[t][1],sname.c_str(),
"f");
1664 }
else if(pts_trk[t][2]->GetN()>0){
1665 l_top->AddEntry(pts_trk[t][2],sname.c_str(),
"f");
1668 l_top->SetLineWidth(0);
1669 l_top->SetLineColor(kWhite);
1670 l_top->Draw(
"same");
std::vector< double > m_sss_candidate_PCA
std::vector< double > m_sss3d_shower_start_z
std::vector< double > m_sss3d_shower_invariant_mass
std::vector< double > SecondShowerMatching(std::vector< art::Ptr< recob::Hit >> &hitz, art::FindManyP< simb::MCParticle, anab::BackTrackerHitMatchingData > &mcparticles_per_hit, std::vector< art::Ptr< simb::MCParticle >> &mcParticleVector, std::map< int, art::Ptr< simb::MCParticle >> &MCParticleToTrackIdMap, var_all &vars)
const bool get_IsNuSlice() const
double m_vertex_pos_wire_p2
std::vector< double > m_isolation_num_shr_hits_win_10cm_trk
double m_vertex_pos_wire_p0
std::vector< double > m_isolation_min_dist_trk_shr
std::vector< double > m_isolation_nearest_shr_hit_to_trk_wire
std::vector< double > m_sss3d_shower_dir_x
ClusterModuleLabel join with tracks
double m_sss2d_conv_ranked_angle_to_shower
std::vector< int > m_sss_candidate_plane
std::vector< double > m_sss3d_shower_implied_invariant_mass
std::vector< double > m_sss_candidate_impact_parameter
double m_sss3d_ioc_ranked_invar
std::vector< double > m_sss3d_shower_start_x
double m_sss3d_invar_ranked_en
std::vector< double > m_sss3d_shower_energy_max
std::vector< double > m_sss_candidate_angle_to_shower
std::vector< double > m_isolation_num_unassoc_hits_win_10cm_trk
double m_sss2d_conv_ranked_conv
BEGIN_PROLOG or score(default)}sbnd_crttrackmatchingalg_crID
int m_sss3d_ioc_ranked_id
double m_sss2d_ioc_ranked_invar
double m_sss2d_invar_ranked_en
std::vector< double > m_isolation_nearest_unassoc_hit_to_trk_time
std::vector< double > m_isolation_num_unassoc_hits_win_1cm_trk
std::pair< int, std::pair< std::vector< std::vector< double > >, std::vector< double > > > GroupClusterCandidate(int num_clusters, const std::vector< int > &cluster_planes, const std::vector< double > &cluster_max_ticks, const std::vector< double > &cluster_min_ticks)
std::size_t size(FixedBins< T, C > const &) noexcept
std::vector< size_t > sort_indexes(const std::vector< T > &v)
std::vector< double > m_isolation_nearest_unassoc_hit_to_trk_wire
process_name use argoneut_mc_hitfinder track
int m_sss3d_invar_ranked_id
double m_sss3d_invar_ranked_implied_opang
double calcWire(double Y, double Z, int plane, int fTPC, int fCryostat, geo::GeometryCore const &geo)
std::vector< double > m_isolation_num_unassoc_hits_win_2cm_trk
std::vector< double > m_isolation_num_unassoc_hits_win_5cm_trk
std::vector< double > m_sss3d_shower_score
double invar_mass(art::Ptr< recob::Shower > &s1, double E1, art::Ptr< recob::Shower > &s2, double E2)
double m_sss3d_ioc_ranked_en
std::vector< art::Ptr< recob::Hit > > pPFPHits
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
std::vector< double > m_isolation_min_dist_trk_unassoc
bool map_min_fn(const std::pair< art::Ptr< recob::Hit >, double > p1, const std::pair< art::Ptr< recob::Hit >, double > p2)
double implied_invar_mass(double vx, double vy, double vz, art::Ptr< recob::Shower > &s1, double E1, art::Ptr< recob::Shower > &s2, double E2)
double m_sss3d_ioc_ranked_opang
TGraph * GetNearestNpts(int p, int cl, std::vector< art::Ptr< recob::Hit >> &hitz, double vertex_wire, double vertex_tick, int Npts)
std::vector< double > m_sss3d_shower_conversion_dist
std::vector< double > m_sss3d_shower_length
bool map_max_fn(const std::pair< art::Ptr< recob::Hit >, double > p1, const std::pair< art::Ptr< recob::Hit >, double > p2)
double m_sss3d_ioc_ranked_ioc
std::vector< double > m_reco_shower_energy_max
void IsolationStudy(std::vector< PandoraPFParticle > all_PPFPs, const std::vector< art::Ptr< recob::Track >> &tracks, const std::vector< art::Ptr< recob::Shower >> &showers, detinfo::DetectorPropertiesData const &theDetector, var_all &vars, para_all ¶s)
double m_sss2d_ioc_ranked_ioc
std::vector< double > m_isolation_nearest_shr_hit_to_trk_time
std::vector< double > m_sss3d_shower_ioc_ratio
std::vector< art::Ptr< recob::Hit > > pSliceHits
double m_sss3d_ioc_ranked_implied_invar
std::vector< double > m_sss_candidate_energy
std::vector< double > m_sss3d_shower_dir_y
auto end(FixedBins< T, C > const &) noexcept
geo::GeometryCore const * s_geom
double ConvertXToTicks(double X, int p, int t, int c) const
double m_sss3d_ioc_ranked_conv
double m_sss2d_invar_ranked_invar
std::vector< double > m_sss_candidate_mean_tick
std::vector< double > m_sss_candidate_min_dist
double m_sss2d_invar_ranked_conv
int m_sss2d_conv_ranked_num_planes
double m_sss2d_invar_ranked_ioc
double m_sss3d_invar_ranked_ioc
std::vector< int > m_sss3d_slice_nu
PandoraPFParticle * PPFP_GetPPFPFromTrack(std::vector< PandoraPFParticle > &PPFPs, art::Ptr< recob::Track > pTrack)
double m_sss3d_invar_ranked_opang
int spacecharge_correction(const art::Ptr< simb::MCParticle > &mcparticle, std::vector< double > &corrected, std::vector< double > &input)
int m_sss2d_ioc_ranked_num_planes
double m_sss2d_conv_ranked_invar
double m_sss2d_ioc_ranked_en
sss_score ScoreCluster(int p, int cl, std::vector< art::Ptr< recob::Hit >> &hits, double vertex_wire, double vertex_tick, const art::Ptr< recob::Shower > &shower)
const int get_SliceID() const
std::vector< double > m_sss3d_shower_impact_parameter
auto begin(FixedBins< T, C > const &) noexcept
double m_sss2d_conv_ranked_en
double CalcEShowerPlane(const std::vector< art::Ptr< recob::Hit >> &hits, int this_plane, para_all ¶s)
std::vector< double > m_sss3d_shower_start_y
double m_sss3d_invar_ranked_implied_invar
double m_sss2d_ioc_ranked_angle_to_shower
double m_sss3d_invar_ranked_invar
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
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
double m_sss3d_ioc_ranked_implied_opang
PandoraPFParticle * PPFP_GetPPFPFromShower(std::vector< PandoraPFParticle > &PPFPs, art::Ptr< recob::Shower > pShower)
double m_sss2d_ioc_ranked_pca
double m_sss2d_conv_ranked_ioc
int m_sss_num_associated_hits
double impact_paramater_shr(double x, double y, double z, art::Ptr< recob::Shower > &shr)
double m_sss2d_ioc_ranked_conv
std::vector< double > m_isolation_num_shr_hits_win_2cm_trk
then echo ***************************************echo Variable FHICL_FILE_PATH not found echo You porbably haven t set up larsoft echo Try setup uboonecode vXX_XX_XX q e10
void SimpleSecondShowerCluster(var_all &vars, para_all ¶s)
int CompareToShowers(int p, int cl, std::vector< art::Ptr< recob::Hit >> &hitz, double vertex_wire, double vertex_tick, const std::vector< art::Ptr< recob::Shower >> &showers, std::map< art::Ptr< recob::Shower >, art::Ptr< recob::PFParticle >> &showerToPFParticleMap, const std::map< art::Ptr< recob::PFParticle >, std::vector< art::Ptr< recob::Hit >> > &pfParticleToHitsMap, double eps)
double m_sss3d_invar_ranked_conv
const bool get_IsNeutrino() const
std::pair< bool, std::vector< double > > clusterCandidateOverlap(const std::vector< int > &candidate_indices, const std::vector< int > &cluster_planes, const std::vector< double > &cluster_max_ticks, const std::vector< double > &cluster_min_ticks)
std::vector< double > m_sss3d_shower_dir_z
std::vector< double > m_isolation_num_shr_hits_win_1cm_trk
double m_sss2d_invar_ranked_angle_to_shower
std::vector< double > m_isolation_num_shr_hits_win_5cm_trk
int m_sss2d_invar_ranked_num_planes
double m_sss2d_conv_ranked_pca
void SecondShowerSearch3D(std::vector< art::Ptr< recob::Shower >> &showers, std::map< art::Ptr< recob::Shower >, art::Ptr< recob::PFParticle >> &NormalShowerToPFParticleMap, std::vector< art::Ptr< recob::Track >> &tracks, std::map< art::Ptr< recob::Track >, art::Ptr< recob::PFParticle >> &NormalTrackToPFParticleMap, art::Event const &evt, var_all &vars, para_all ¶s)
std::vector< double > m_sss_candidate_max_tick
double m_sss2d_invar_ranked_pca
double m_vertex_pos_wire_p1
BEGIN_PROLOG could also be cout
int m_sss_num_unassociated_hits
std::vector< int > m_sss3d_slice_clear_cosmic
std::vector< double > m_sss_candidate_min_tick