53 #include "dune/DuneObj/ProtoDUNEBeamEvent.h" 58 #include "geant4reweight/src/ReweightBase/G4ReweighterFactory.hh" 59 #include "geant4reweight/src/ReweightBase/G4Reweighter.hh" 60 #include "geant4reweight/src/ReweightBase/G4ReweightTraj.hh" 61 #include "geant4reweight/src/ReweightBase/G4ReweightStep.hh" 62 #include "geant4reweight/src/PropBase/G4ReweightParameterMaker.hh" 63 #include "geant4reweight/src/ReweightBase/G4MultiReweighter.hh" 64 #include "geant4reweight/src/ReweightBase/G4ReweightManager.hh" 69 #include "art_root_io/TFileService.h" 77 #include "TVirtualFitter.h" 78 #include "TPolyLine3D.h" 79 #include "Math/Vector3D.h" 90 void line(
double t,
double * p,
double & x,
double & y,
double & z);
91 void SumDistance2(
int &,
double *,
double & sum,
double * par,
int);
97 return( i1->
z < i2->
z );
100 std::vector<const sim::IDE*> ides,
double the_z0,
double the_pitch,
103 std::map<int, std::vector<const sim::IDE*>> results;
105 for (
size_t i = 0; i < ides.size(); ++i) {
106 int slice_num = std::floor(
107 (ides[i]->z - (the_z0 - the_pitch/2.)) / the_pitch);
113 results[slice_num].push_back(ides[i]);
122 TFile * theFile = 0x0;
126 theFile =
new TFile(filename.c_str());
127 if (!theFile ||theFile->IsZombie() || !theFile->IsOpen()) {
134 mf::LogInfo(
"pduneana::OpenFile") <<
"File does not exist here. Searching FW_SEARCH_PATH";
137 auto found = sp.find_file(filename, found_filename);
142 mf::LogInfo(
"pduneana::OpenFile") <<
"Found file " << found_filename;
143 theFile =
new TFile(found_filename.c_str());
144 if (!theFile ||theFile->IsZombie() || !theFile->IsOpen()) {
147 throw cet::exception(
"PDSPAnalyzer_module.cc") <<
"Could not open " << found_filename;
172 calo_point(
size_t w,
double in_tick,
double p,
double dqdx,
double dedx,
double dq,
173 double cali_dqdx,
double cali_dedx,
double r,
size_t index,
double input_wire_z,
int t,
174 double efield,
double input_x,
double input_y,
double input_z)
175 : wire(w),
tick(in_tick), pitch(p), dQdX(dqdx),
dEdX(dedx), dQ(dq),
176 calibrated_dQdX(cali_dqdx), calibrated_dEdX(cali_dedx),
177 res_range(r), hit_index(index), wire_z(input_wire_z), tpc(t),
178 EField(efield), x(input_x), y(input_y), z(input_z) {};
204 const std::vector< art::Ptr< recob::Hit > > daughterPFP_hits
207 double tot_charge = 0.;
208 for (
size_t h = 0;
h < daughterPFP_hits.size(); ++
h) {
209 std::array<float,4> cnn_out = CNN_results.
getOutput( daughterPFP_hits[
h] );
210 double hitcharge = daughterPFP_hits[
h]->Integral();
211 double track_score = cnn_out[ CNN_results.
getIndex(
"track") ];
212 double em_score = cnn_out[ CNN_results.
getIndex(
"em") ];
213 double michel_score = cnn_out[ CNN_results.
getIndex(
"michel") ];
214 double none_score = cnn_out[ CNN_results.
getIndex(
"none") ];
215 output.
track += track_score;
216 output.
em += em_score;
217 output.
michel += michel_score;
218 output.
none += none_score;
223 tot_charge += hitcharge;
225 output.
nHits = daughterPFP_hits.size();
226 if (tot_charge != 0) {
249 double tot_charge = 0.;
250 for (
size_t h = 0;
h < daughterPFP_hits.size(); ++
h) {
251 std::array<float,4> cnn_out = CNN_results.
getOutput( daughterPFP_hits[
h] );
252 double hitcharge = daughterPFP_hits[
h]->Integral();
253 double track_score = cnn_out[ CNN_results.
getIndex(
"track") ];
254 double em_score = cnn_out[ CNN_results.
getIndex(
"em") ];
255 double michel_score = cnn_out[ CNN_results.
getIndex(
"michel") ];
256 double none_score = cnn_out[ CNN_results.
getIndex(
"none") ];
257 output.
track += track_score;
258 output.
em += em_score;
259 output.
michel += michel_score;
260 output.
none += none_score;
265 tot_charge += hitcharge;
267 output.
nHits = daughterPFP_hits.size();
268 if (tot_charge != 0) {
311 void endJob()
override;
315 double lateralDist( TVector3 &
n, TVector3 & x0, TVector3 & p );
326 void BeamForcedTrackInfo(
const art::Event & evt,
331 const sim::ParticleList & plist,
332 std::map<
int, std::vector<int>> & trueToPFPs,
339 void DaughterMatchInfo(
const art::Event & evt,
345 void BeamForcedTrackInfo();
346 void GetG4RWCoeffs(std::vector<double> & weights, std::vector<double> & coeffs);
347 void G4RWGridWeights(
348 std::vector<std::vector<G4ReweightTraj *>> & hierarchy,
349 std::vector<fhicl::ParameterSet> & pars,
351 G4MultiReweighter * multi_rw);
395 std::vector< double > true_beam_elastic_costheta, true_beam_elastic_X,
397 true_beam_elastic_deltaE, true_beam_elastic_IDE_edep;
404 true_beam_reco_byHits_allTrack_ID;
423 true_beam_daughter_reco_byHits_allTrack_ID, true_beam_daughter_reco_byHits_allShower_ID;
439 true_beam_Pi0_decay_reco_byHits_allTrack_ID, true_beam_Pi0_decay_reco_byHits_allShower_ID;
491 std::vector<double> reco_beam_dEdX_SCE, reco_beam_dQdX_SCE, reco_beam_EField_SCE, reco_beam_resRange_SCE,
reco_beam_TrkPitch_SCE;
493 std::vector<double> reco_beam_calibrated_dEdX_SCE, reco_beam_calibrated_dQdX_SCE,
reco_beam_dQ;
520 reco_track_endX, reco_track_endY, reco_track_endZ,
521 reco_track_michel_score, reco_track_michel_score_weight_by_charge;
538 g4rw_full_grid_coeffs;
543 g4rw_full_grid_piplus_coeffs;
547 g4rw_full_grid_proton_coeffs;
549 g4rw_full_grid_neutron_coeffs;
551 g4rw_full_grid_kplus_coeffs;
643 std::vector<int> reco_daughter_PFP_nHits,
695 std::vector< std::vector< double > > reco_daughter_allTrack_calibrated_dEdX_SCE, reco_daughter_allTrack_calibrated_dQdX_SCE,
reco_daughter_allTrack_EField_SCE, reco_daughter_allTrack_calo_X, reco_daughter_allTrack_calo_Y, reco_daughter_allTrack_calo_Z;
700 std::vector<std::vector<double>>
701 reco_daughter_allTrack_calibrated_dEdX_SCE_plane0,
704 std::vector<std::vector<double>>
705 reco_daughter_allTrack_resRange_plane0,
708 std::vector<double> reco_daughter_allTrack_Chi2_proton_plane0,
711 std::vector<int> reco_daughter_allTrack_Chi2_ndof_plane0,
725 std::vector<double> reco_daughter_allShower_len,
726 reco_daughter_allShower_startX,
727 reco_daughter_allShower_startY,
729 reco_daughter_allShower_dirX,
730 reco_daughter_allShower_dirY,
731 reco_daughter_allShower_dirZ,
732 reco_daughter_allShower_energy;
800 std::vector<fhicl::ParameterSet> ParSet, FakeDataParSet,
ProtParSet;
803 G4ReweightParameterMaker ParMaker, FakeDataParameterMaker,
ProtParMaker;
805 * KPlusMultiRW, * NeutronMultiRW, * FakeDataMultiRW;
840 fSCE(
p.get<
bool>(
"SCE",
true)){
857 ParSet =
p.get<std::vector<fhicl::ParameterSet>>(
"ParameterSet");
862 FakeDataParSet =
p.get<std::vector<fhicl::ParameterSet>>(
"FakeDataParameterSet");
868 ProtParSet =
p.get<std::vector<fhicl::ParameterSet>>(
"ProtParameterSet");
893 double start =
p.get<
double>(
"ParameterGridStart");
894 double delta =
p.get<
double>(
"ParameterGridDelta");
895 int n =
p.get<
int>(
"ParameterGridN");
896 for (
int i = 0; i <
n; ++i) {
900 fGridPair =
p.get<std::pair<double, double>>(
"GridPair");
917 std::cout<<
"########## EvtNo."<<
event<<
std::endl;
935 double startX = tempTrack->
Start().X();
936 double startY = tempTrack->
Start().Y();
937 double startZ = tempTrack->
Start().Z();
939 double endX = tempTrack->
End().X();
940 double endY = tempTrack->
End().Y();
941 double endZ = tempTrack->
End().Z();
943 double start[3] = {startX, startY, startZ};
944 double end[3] = {endX, endY, endZ};
948 if (!((end_tpc == 1 || end_tpc == 5) &&
949 (start_tpc == 1 || start_tpc == 5)))
952 std::pair<double, int> vertex_michel_score =
955 std::pair<double, double> vertex_michel_score_weight_by_charge =
961 reco_track_michel_score_weight_by_charge.push_back( vertex_michel_score_weight_by_charge.second != 0 ? vertex_michel_score_weight_by_charge.first/vertex_michel_score_weight_by_charge.second : -999. );
990 std::cout <<
"APA 2 Z0: " << z0_APA2 <<
std::endl;
998 if( !true_beam_particle ){
1003 std::cout <<
"Got " << (*mcTruths)[0].NParticles() <<
1005 for (
int i = 0; i < (*mcTruths)[0].NParticles(); ++i) {
1035 std::map< int, std::vector< int > > trueToPFPs;
1043 const std::map<unsigned int, std::vector<const recob::PFParticle*>> sliceMap
1045 std::vector<std::vector<const recob::PFParticle*>> beam_slices;
1046 for (
auto slice : sliceMap) {
1047 for (
auto particle : slice.second) {
1051 beam_slices.push_back(slice.second);
1057 for (
const auto *
p : slice.second) {
1072 if (!added) {
continue;}
1082 if(beam_slices.size() == 0){
1083 std::cout <<
"We found no beam particles for this event... moving on" <<
std::endl;
1089 std::cout <<
"Found " << beamParticles.size() <<
" particles" <<
std::endl;
1094 double cut_v = 9999.;
1095 for (std::vector<const recob::PFParticle*> beam_slice : beam_slices) {
1100 std::cout <<
"#Start position of beam particle NO." << iiloop <<
1101 ": (" << vtx.X() <<
", " << vtx.Y() <<
", " << vtx.Z() <<
1105 double fom =
abs(vtx.Z() - 30);
1115 beam_slices.at(ii).at(0) :
1116 beamParticles.at(0));
1122 BeamMatchInfo(evt, particle, true_beam_particle, clockData);
1133 else if( thisShower ){
1150 TrueBeamInfo(evt, true_beam_particle, clockData, plist, trueToPFPs, hitResults);
1162 *true_beam_particle, plist,
1163 fGeometryService,
event);
1166 for (
size_t i = 0; i < trajs.size(); ++i) {
1167 if (trajs[i]->GetNSteps() > 0) {
1168 for (
size_t j = 0; j <
ParSet.size(); ++j) {
1169 std::pair<double, double> pm_weights =
1170 MultiRW->GetPlusMinusSigmaParWeight((*trajs[i]), j);
1186 std::vector<std::vector<G4ReweightTraj *>> new_full_created
1188 event,
"LAr",
false);
1190 std::cout <<
"Created " << new_full_created.size() <<
" reweightable pi+" 1194 bool new_added =
false;
1195 for (
size_t i = 0; i < new_full_created.size(); ++i) {
1196 std::vector<G4ReweightTraj *> temp_trajs = new_full_created[i];
1198 for (
size_t j = 0; j < temp_trajs.size(); ++j) {
1199 G4ReweightTraj * this_traj = temp_trajs[j];
1200 if (this_traj->GetNSteps() > 0) {
1201 for (
size_t k = 0;
k <
ParSet.size(); ++
k) {
1202 std::pair<double, double> pm_weights =
1203 MultiRW->GetPlusMinusSigmaParWeight((*this_traj),
k);
1231 std::vector<std::vector<G4ReweightTraj *>> piplus_hierarchy
1233 event,
"LAr",
false);
1247 bool set_values =
FakeDataMultiRW->SetAllParameterValues(fake_data_input);
1251 if (piplus_hierarchy.size()) {
1252 std::vector<G4ReweightTraj *> & init_trajs = piplus_hierarchy[0];
1255 for (
size_t k = 1;
k < piplus_hierarchy.size(); ++
k) {
1256 std::vector<G4ReweightTraj *> & temp_trajs = piplus_hierarchy[
k];
1264 throw std::runtime_error(message);
1269 fake_data_input[i] = 1.;
1272 std::vector<std::vector<G4ReweightTraj *>> proton_hierarchy
1274 event,
"LAr",
false);
1282 std::vector<std::vector<G4ReweightTraj *>> neutron_hierarchy
1284 event,
"LAr",
false);
1292 std::vector<std::vector<G4ReweightTraj *>> kplus_hierarchy
1294 event,
"LAr",
false);
1311 fTree = tfs->make<TTree>(
"beamana",
"beam analysis tree");
1500 fTree->Branch(
"reco_daughter_allTrack_Chi2_proton_plane0",
1502 fTree->Branch(
"reco_daughter_allTrack_Chi2_proton_plane1",
1505 fTree->Branch(
"reco_daughter_allTrack_Chi2_ndof_plane0",
1507 fTree->Branch(
"reco_daughter_allTrack_Chi2_ndof_plane1",
1510 fTree->Branch(
"reco_daughter_allTrack_calibrated_dEdX_SCE_plane0",
1512 fTree->Branch(
"reco_daughter_allTrack_calibrated_dEdX_SCE_plane1",
1514 fTree->Branch(
"reco_daughter_allTrack_resRange_plane0",
1516 fTree->Branch(
"reco_daughter_allTrack_resRange_plane1",
1535 fTree->Branch(
"reco_daughter_allTrack_vertex_michel_score",
1537 fTree->Branch(
"reco_daughter_allTrack_vertex_nHits",
1555 fTree->Branch(
"reco_daughter_PFP_nHits_collection",
1801 fTree->Branch(
"g4rw_alt_primary_plus_sigma_weight",
1803 fTree->Branch(
"g4rw_alt_primary_minus_sigma_weight",
1806 fTree->Branch(
"g4rw_full_primary_plus_sigma_weight",
1808 fTree->Branch(
"g4rw_full_primary_minus_sigma_weight",
1847 TVector3
x = ( (p - x0)*n )*
n;
1848 return (x - (p - x0)).Mag();
2376 (cnn.
em / cnn.
nHits) : -999.);
2385 cnn_collection.
track / cnn_collection.
nHits : -999.);
2387 cnn_collection.
em / cnn_collection.
nHits : -999.);
2389 cnn_collection.
michel / cnn_collection.
nHits : -999.);
2402 auto sce = lar::providerFrom<spacecharge::SpaceChargeService>();
2410 std::pair<double, int> vertex_michel_score =
2416 std::pair<double, double> vertex_michel_score_weight_by_charge =
2421 if (
fVerbose) std::cout <<
"Beam particle is track-like " << thisTrack->
ID() <<
std::endl;
2476 thisTrack->
Length(), 2212);
2478 thisTrack->
Length(), 13);
2483 std::map< const recob::Hit *, int > hitsToSlices;
2484 std::map< int, std::vector< const recob::Hit * > > slicesToHits;
2492 for(
auto it = trajPtsToHits.begin(); it != trajPtsToHits.end(); ++it ){
2495 size_t i = it->first;
2510 int slice = std::floor((z -
fZ0) /
fPitch);
2511 hitsToSlices[theHit] = slice;
2512 slicesToHits[slice].push_back(theHit);
2524 bool found_calo =
false;
2526 for ( index = 0; index <
calo.size(); ++
index) {
2543 auto calo_range =
calo[
index].ResidualRange();
2544 auto TpIndices =
calo[
index].TpIndices();
2549 size_t this_index = 0;
2550 for ( this_index = 0; this_index < pandoracalo.size(); ++this_index) {
2551 if (pandoracalo[this_index].
PlaneID().Plane == 2) {
2555 TpIndices = pandoracalo[this_index].TpIndices();
2557 std::cout << calo_dQdX.size() <<
std::endl;
2561 std::vector< size_t > calo_hit_indices;
2562 for(
size_t i = 0; i < calo_dQdX.size(); ++i ){
2569 const recob::Hit & theHit = (*allHits)[ TpIndices[i] ];
2583 calo_hit_indices.push_back( TpIndices[i] );
2591 std::cout << theXYZPoints[i].X() <<
" " << theXYZPoints[i].Y() <<
" " <<
2592 theXYZPoints[i].Z() <<
" " << theHit.
WireID().
Wire <<
" " <<
2598 std::sort(theXYZPoints.begin(), theXYZPoints.end(), [](
auto a,
auto b)
2599 {
return (
a.Z() <
b.Z());});
2607 if (theXYZPoints.size()) {
2615 TVector3
dir((theXYZPoints.back().X() - theXYZPoints[0].X()),
2616 (theXYZPoints.back().Y() - theXYZPoints[0].Y()),
2617 (theXYZPoints.back().Z() - theXYZPoints[0].Z()));
2634 if (theXYZPoints.size() > 1) {
2635 TVector3 start_p1(theXYZPoints[0].
X(),
2636 theXYZPoints[0].
Y(), theXYZPoints[0].
Z());
2637 TVector3 start_p2(theXYZPoints[1].
X(),
2638 theXYZPoints[1].
Y(), theXYZPoints[1].
Z());
2639 TVector3 start_diff = start_p2 - start_p1;
2645 size_t nPoints = theXYZPoints.size();
2646 TVector3 end_p1(theXYZPoints[nPoints - 2].
X(),
2647 theXYZPoints[nPoints - 2].
Y(), theXYZPoints[nPoints - 2].
Z());
2648 TVector3 end_p2(theXYZPoints[nPoints - 1].
X(),
2649 theXYZPoints[nPoints - 1].
Y(), theXYZPoints[nPoints - 1].
Z());
2650 TVector3 end_diff = end_p2 - end_p1;
2665 if (theXYZPoints.size() > 2) {
2666 std::vector<TVector3>
input;
2667 for (
size_t iP = 0; iP < 3; ++iP) {
2668 input.push_back(TVector3(theXYZPoints[iP].
X(),
2669 theXYZPoints[iP].
Y(),
2670 theXYZPoints[iP].
Z()));
2673 TVector3 startDiff =
FitLine(input);
2678 std::vector<TVector3> end_input;
2679 size_t nPoints = theXYZPoints.size();
2680 for (
size_t iP = nPoints - 3; iP < nPoints; ++iP) {
2681 end_input.push_back(TVector3(theXYZPoints[iP].
X(),
2682 theXYZPoints[iP].
Y(),
2683 theXYZPoints[iP].
Z()));
2686 TVector3 endDiff =
FitLine(end_input);
2700 if (theXYZPoints.size() > 3) {
2701 std::vector<TVector3>
input;
2702 for (
size_t iP = 0; iP < 4; ++iP) {
2703 input.push_back(TVector3(theXYZPoints[iP].
X(),
2704 theXYZPoints[iP].
Y(),
2705 theXYZPoints[iP].
Z()));
2708 TVector3 startDiff =
FitLine(input);
2713 std::vector<TVector3> end_input;
2714 size_t nPoints = theXYZPoints.size();
2715 for (
size_t iP = nPoints - 4; iP < nPoints; ++iP) {
2716 end_input.push_back(TVector3(theXYZPoints[iP].
X(),
2717 theXYZPoints[iP].
Y(),
2718 theXYZPoints[iP].
Z()));
2721 TVector3 endDiff =
FitLine(end_input);
2738 std::cout <<
"Getting reco beam calo" <<
std::endl;
2743 std::cout <<
"got calibrated dedx" <<
std::endl;
2748 for (
auto dqdx : new_dQdX) {
2754 for (
auto ef : efield) {
2759 for (
size_t i = 0; i < calo_dQdX.size(); ++i){
2764 double E_field_nominal = detProp.Efield();
2767 = (
sce->EnableCalEfieldSCE() &&
fSCE ?
2768 sce->GetCalEfieldOffsets(
2770 theXYZPoints[i].Y(),
2771 theXYZPoints[i].Z()},
2774 TVector3 E_field_vector = {
2775 E_field_nominal*(1 + E_field_offsets.X()),
2776 E_field_nominal*E_field_offsets.Y(),
2777 E_field_nominal*E_field_offsets.Z()};
2779 double E_field = E_field_vector.Mag();
2793 std::vector< calo_point > reco_beam_calo_points;
2800 reco_beam_calo_points.push_back(
2815 std::sort( reco_beam_calo_points.begin(), reco_beam_calo_points.end(), [](
calo_point a,
calo_point b) {
return ( a.
z <
b.z );} );
2818 for(
size_t i = 0; i < reco_beam_calo_points.size(); ++i ){
2819 calo_point thePoint = reco_beam_calo_points[i];
2825 calo_hit_indices[i] = thePoint.
hit_index;
2842 double init_KE = 0.;
2845 double mass = 139.57;
2856 for(
size_t i = 0; i < reco_beam_calo_points.size() - 1; ++i ){
2858 if (reco_beam_calo_points[i].calibrated_dEdX < 0.)
continue;
2859 double this_energy =
reco_beam_incidentEnergies.back() - ( reco_beam_calo_points[i].calibrated_dEdX * reco_beam_calo_points[i].pitch );
2872 for (index = 0; index < calo_NoSCE.size(); ++
index) {
2873 if (calo_NoSCE[index].
PlaneID().Plane == 2) {
2880 auto calo_dQdX = calo_NoSCE[
index].dQdx();
2881 auto calo_dEdX = calo_NoSCE[
index].dEdx();
2882 auto calo_range = calo_NoSCE[
index].ResidualRange();
2883 auto TpIndices = calo_NoSCE[
index].TpIndices();
2885 std::vector< size_t > calo_hit_indices;
2886 for(
size_t i = 0; i < calo_dQdX.size(); ++i ){
2892 calo_hit_indices.push_back( TpIndices[i] );
2893 const recob::Hit & theHit = (*allHits)[ TpIndices[i] ];
2922 std::vector< calo_point > reco_beam_calo_points;
2928 reco_beam_calo_points.push_back(
2941 std::sort( reco_beam_calo_points.begin(), reco_beam_calo_points.end(), [](
calo_point a,
calo_point b) {
return ( a.
z <
b.z );} );
2944 for(
size_t i = 0; i < reco_beam_calo_points.size(); ++i ){
2945 calo_point thePoint = reco_beam_calo_points[i];
2949 calo_hit_indices[i] = thePoint.
hit_index;
2973 bool found_calo =
false;
2975 for ( index = 0; index < calo.size(); ++
index) {
2976 if (calo[index].
PlaneID().Plane == 2) {
2982 auto TpIndices = calo[
index].TpIndices();
2983 for(
size_t i = 0; i < TpIndices.size(); ++i ){
2984 const recob::Hit & theHit = (*allHits)[ TpIndices[i] ];
3002 std::cout <<
"Beam particle is shower-like" <<
std::endl;
3013 const sim::ParticleList & plist,
3014 std::map<
int, std::vector<int>> & trueToPFPs,
3029 auto sce = lar::providerFrom<spacecharge::SpaceChargeService>();
3030 auto offset =
sce->GetPosOffsets(
3052 true_beam_particle->
Position(true_np-1).X()), 2) +
3054 true_beam_particle->
Position(true_np-1).Y()), 2) +
3056 true_beam_particle->
Position(true_np-1).Z()), 2));
3070 for(
size_t i = 0; i < trueToPFPs[
true_beam_ID ].size(); ++i ){
3087 if( pandora2Track ){
3102 for(
auto itProc = true_beam_proc_map.begin(); itProc != true_beam_proc_map.end(); ++itProc ){
3103 int index = itProc->first;
3109 if( process ==
"hadElastic" ){
3113 double process_X = true_beam_trajectory.
X( index );
3114 double process_Y = true_beam_trajectory.
Y( index );
3115 double process_Z = true_beam_trajectory.
Z( index );
3117 double PX = true_beam_trajectory.
Px( index );
3118 double next_PX = true_beam_trajectory.
Px( index + 1 );
3119 double PY = true_beam_trajectory.
Py( index );
3120 double next_PY = true_beam_trajectory.
Py( index + 1 );
3121 double PZ = true_beam_trajectory.
Pz( index );
3122 double next_PZ = true_beam_trajectory.
Pz( index + 1 );
3124 double total_P = sqrt( PX*PX + PY*PY + PZ*PZ );
3125 double total_next_P = sqrt( next_PX*next_PX + next_PY*next_PY + next_PZ*next_PZ );
3129 ( ( PX * next_PX ) + ( PY * next_PY ) + ( PZ * next_PZ ) ) / ( total_P * total_next_P )
3132 double total_E = sqrt(total_P*total_P*1.e6 +
3134 double total_next_E = sqrt(total_next_P*total_next_P*1.e6 +
3135 true_beam_mass*true_beam_mass);
3143 std::vector<const sim::IDE *> ides_between_points =
3145 *true_beam_particle, true_beam_trajectory.
Position(index),
3146 true_beam_trajectory.
Position(index +1));
3148 double total_edep = 0.;
3149 for (
size_t i = 0; i < ides_between_points.size(); ++i) {
3150 total_edep += ides_between_points[i]->energy;
3156 if( true_beam_endProcess.find(
"Inelastic" ) == std::string::npos ){
3170 for (
size_t i = 0; i < view2_IDEs.size(); ++i) {
3171 const sim::IDE * ide = view2_IDEs[i];
3176 std::sort( view2_IDEs.begin(), view2_IDEs.end(),
sort_IDEs );
3180 size_t remove_index = 0;
3181 bool do_remove =
false;
3182 if( view2_IDEs.size() ){
3183 for(
size_t i = 1; i < view2_IDEs.size()-1; ++i ){
3184 const sim::IDE * prev_IDE = view2_IDEs[i-1];
3185 const sim::IDE * this_IDE = view2_IDEs[i];
3192 if( this_IDE->
trackID < 0 && ( this_IDE->
z - prev_IDE->
z ) > 5 ){
3201 view2_IDEs.erase( view2_IDEs.begin() + remove_index, view2_IDEs.end() );
3212 if (sliced_ides.size()) {
3213 auto first_slice = sliced_ides.begin();
3217 auto theIDEs = first_slice->second;
3219 if (theIDEs.size()) {
3221 double ide_z = theIDEs[0]->z;
3226 for (
size_t i = 1; i < true_beam_trajectory.
size(); ++i) {
3227 double z0 = true_beam_trajectory.
Z(i-1);
3228 double z1 = true_beam_trajectory.
Z(i);
3230 double x0 = true_beam_trajectory.
X(i-1);
3231 double y0 = true_beam_trajectory.
Y(i-1);
3232 double x1 = true_beam_trajectory.
X(i);
3233 double y1 = true_beam_trajectory.
Y(i);
3237 if (z0 < ide_z && z1 > ide_z) {
3241 std::cout <<
"Found matching position" << z0 <<
" " << ide_z <<
3243 std::cout <<
"init KE: " << init_KE <<
" " <<
3254 for(
auto it = sliced_ides.begin(); it != sliced_ides.end(); ++it ){
3256 auto theIDEs = it->second;
3261 for(
size_t i = 0; i < theIDEs.size(); ++i ){
3262 deltaE += theIDEs[i]->energy;
3272 for (
size_t i = 0; i < true_beam_trajectory.
size(); ++i) {
3282 auto offset =
sce->GetPosOffsets(
3283 {true_beam_trajectory.
X(i), true_beam_trajectory.
Y(i),
3284 true_beam_trajectory.
Z(i)});
3290 for (
size_t i = 1; i < true_beam_trajectory.
size(); ++i) {
3298 int daughterID = true_beam_particle->
Daughter(i);
3300 if (
fVerbose) std::cout <<
"Daughter " << i <<
" ID: " << daughterID <<
std::endl;
3301 auto part = plist[ daughterID ];
3302 int pid = part->PdgCode();
3306 if (process ==
"muIoni" || process ==
"hIoni")
3331 std::cout <<
"Process: " << part->Process() <<
std::endl;
3332 std::cout <<
"PID: " << pid <<
std::endl;
3333 std::cout <<
"Start: " << part->Position(0).X() <<
" " << part->Position(0).Y() <<
" " << part->Position(0).Z() <<
std::endl;
3334 std::cout <<
"End: " << part->EndPosition().X() <<
" " << part->EndPosition().Y() <<
" " << part->EndPosition().Z() <<
std::endl;
3335 std::cout <<
"Len: " << part->Trajectory().TotalLength() <<
std::endl;
3338 if( part->Process().find(
"Inelastic" ) != std::string::npos ){
3350 for(
int j = 0; j < part->NumberDaughters(); ++j ){
3351 int pi0_decay_daughter_ID = part->Daughter(j);
3352 auto pi0_decay_part = plist[ pi0_decay_daughter_ID ];
3385 for(
size_t k = 0;
k < trueToPFPs[ pi0_decay_part->TrackId() ].size(); ++
k ){
3388 const recob::PFParticle * thePFP = &(pfpVec->at( trueToPFPs[ pi0_decay_part->TrackId() ][
k] ));
3395 double track_score = ((theCNNResults.
nHits > 0) ?
3396 (theCNNResults.
track / theCNNResults.
nHits) :
3412 if( pandora2Track ){
3442 if( pandora2Shower ){
3463 for(
int j = 0; j < part->NumberDaughters(); ++j ){
3464 int grand_daughter_ID = part->Daughter(j);
3465 auto grand_daughter_part = plist[ grand_daughter_ID ];
3496 for(
size_t j = 0; j < trueToPFPs[ part->TrackId() ].size(); ++j ){
3499 const recob::PFParticle * thePFP = &(pfpVec->at( trueToPFPs[ part->TrackId() ][j] ));
3506 double track_score = ((theCNNResults.
nHits > 0) ?
3507 (theCNNResults.
track / theCNNResults.
nHits) :
3526 if( pandora2Track ){
3556 if( pandora2Shower ){
3580 std::vector<art::Ptr<beam::ProtoDUNEBeamEvent>> beamVec;
3589 if (beamHandle.isValid()) {
3599 if( beamHandle.isValid()){
3605 MF_LOG_WARNING(
"PDSPAnalyzer") <<
"BeamEvent generator object not " <<
3618 std::cout << momenta.size() <<
std::endl;
3629 int nMomenta = momenta.size();
3632 std::cout <<
"Got beam event" <<
std::endl;
3633 std::cout <<
"Got " << nTracks <<
" Tracks" <<
std::endl;
3634 std::cout <<
"Got " << nMomenta <<
" Momenta" <<
std::endl;
3643 const std::vector<double> the_tofs = beamEvent.
GetTOFs();
3644 const std::vector<int> the_chans = beamEvent.
GetTOFChans();
3645 for (
size_t iTOF = 0; iTOF < the_tofs.size(); ++iTOF) {
3692 auto sce = lar::providerFrom<spacecharge::SpaceChargeService>();
3701 for (
size_t daughterID : particle->
Daughters()) {
3707 if (
fVerbose) std::cout <<
"Got " << daughterPFP_hits.size() <<
" hits from daughter " << daughterID <<
std::endl;
3710 size_t nHits_coll = 0;
3711 for (
size_t i = 0; i < daughterPFP_hits.size(); ++i) {
3712 if (daughterPFP_hits[i]->
View() == 2) {
3722 double track_score = (theCNNResults.
nHits > 0 ?
3723 (theCNNResults.
track / theCNNResults.
nHits) :
3725 double em_score = (theCNNResults.
nHits > 0 ?
3726 (theCNNResults.
em / theCNNResults.
nHits) :
3728 double michel_score = (theCNNResults.
nHits > 0 ?
3737 double track_score_collection = (cnn_collection.
nHits > 0 ?
3738 (cnn_collection.
track / cnn_collection.
nHits) :
3740 double em_score_collection = (cnn_collection.
nHits > 0 ?
3741 (cnn_collection.
em / cnn_collection.
nHits) :
3743 double michel_score_collection = (cnn_collection.
nHits > 0 ?
3770 if (pandoraTrack != 0x0) {
3773 else if (pandoraShower != 0x0) {
3786 if( pandora2Track ){
3790 auto dummy_caloSCE =
3793 bool found_calo =
false;
3795 for ( index = 0; index < dummy_caloSCE.size(); ++
index) {
3796 if (dummy_caloSCE[index].
PlaneID().Plane == 2) {
3813 auto dummy_dEdx_SCE = dummy_caloSCE[
index].dEdx();
3814 auto dummy_dQdx_SCE = dummy_caloSCE[
index].dQdx();
3815 auto dummy_Range_SCE = dummy_caloSCE[
index].ResidualRange();
3816 auto theXYZPoints = dummy_caloSCE[
index].XYZ();
3827 for(
size_t j = 0; j < dummy_dEdx_SCE.size(); ++j ){
3854 std::vector<float> cali_dEdX_SCE
3858 for(
size_t j = 0; j < cali_dEdX_SCE.size(); ++j ){
3864 *pandora2Track, evt,
"pandora2Track",
3866 for (
auto dqdx : new_dQdX) {
3871 for (
auto ef : efield) {
3877 for (
size_t j = 0; j < dummy_dQdx_SCE.size(); ++j) {
3882 double E_field_nominal = detProp.Efield();
3884 = (sce->EnableCalEfieldSCE() &&
fSCE ?
3885 sce->GetCalEfieldOffsets(
3887 theXYZPoints[j].Z()},
3888 dummy_caloSCE[
index].PlaneID().TPC) :
3890 TVector3 E_field_vector
3891 = {E_field_nominal*(1 + E_field_offsets.X()),
3892 E_field_nominal*E_field_offsets.Y(),
3893 E_field_nominal*E_field_offsets.Z()};
3895 double E_field = E_field_vector.Mag();
3937 size_t plane0_index = 0;
3938 bool found_plane0 =
false;
3939 for ( plane0_index = 0; plane0_index < dummy_caloSCE.size(); ++plane0_index) {
3940 if (dummy_caloSCE[plane0_index].
PlaneID().Plane == 0) {
3941 found_plane0 =
true;
3945 size_t plane1_index = 0;
3946 bool found_plane1 =
false;
3947 for ( plane1_index = 0; plane1_index < dummy_caloSCE.size(); ++plane1_index) {
3948 if (dummy_caloSCE[plane1_index].
PlaneID().Plane == 1) {
3949 found_plane1 =
true;
3954 std::cout <<
"Plane 0, 1 " << plane0_index <<
" " <<
3959 std::vector<double>());
3961 std::vector<double>());
3964 auto resRange_plane0 = dummy_caloSCE[plane0_index].ResidualRange();
3967 for (
size_t j = 0; j < resRange_plane0.size(); ++j) {
3969 resRange_plane0[j]);
3973 std::vector<float> dEdX_plane0
3977 dummy_caloSCE[plane0_index].dEdx());
3996 plane0_chi2_ndof.first);
3998 plane0_chi2_ndof.second);
4009 std::vector<double>());
4012 std::vector<double>());
4015 auto resRange_plane1 = dummy_caloSCE[plane1_index].ResidualRange();
4016 for (
size_t j = 0; j < resRange_plane1.size(); ++j) {
4018 resRange_plane1[j]);
4022 std::vector<float> dEdX_plane1
4026 dummy_caloSCE[plane1_index].dEdx());
4027 for (
auto & dedx : dEdX_plane1) {
4052 plane1_chi2_ndof.first);
4054 plane1_chi2_ndof.second);
4078 std::pair<double, int> vertex_results =
4080 *pandora2Track, evt,
"pandora2Track",
fHitTag,
4081 0., -500., 500., 0., 500., 0.,
false,
4085 vertex_results.first);
4087 vertex_results.second);
4125 std::vector<double>());
4127 std::vector<double>());
4129 std::vector<double>());
4131 std::vector<double>());
4170 if( pandora2Shower ){
4182 const std::vector<art::Ptr<recob::Hit>> hits =
4184 *pandora2Shower, evt,
"pandora2Shower");
4186 art::FindManyP<recob::SpacePoint> spFromHits(hits, evt,
fHitTag);
4189 std::vector<double> x_vec, y_vec, z_vec;
4190 double total_y = 0.;
4192 std::vector<art::Ptr<recob::Hit>> good_hits;
4194 for (
size_t iHit = 0; iHit < hits.size(); ++iHit) {
4195 auto theHit = hits[iHit];
4196 if (theHit->View() != 2)
continue;
4198 good_hits.push_back(theHit);
4200 double shower_hit_x = detProp.ConvertTicksToX(
4202 theHit->WireID().Plane,
4203 theHit->WireID().TPC, 0);
4205 double shower_hit_z =
geom->
Wire(theHit->WireID()).GetCenter().Z();
4207 x_vec.push_back(shower_hit_x);
4208 z_vec.push_back(shower_hit_z);
4210 std::vector<art::Ptr<recob::SpacePoint>> sps = spFromHits.at(iHit);
4213 y_vec.push_back(sps[0]->XYZ()[1]);
4214 total_y += y_vec.back();
4219 y_vec.push_back(-999.);
4228 double total_shower_energy = 0.;
4229 for (
size_t iHit = 0; iHit < good_hits.size(); ++iHit) {
4230 auto theHit = good_hits[iHit];
4231 if (theHit->View() != 2)
continue;
4233 if (y_vec[iHit] < -100.)
4234 y_vec[iHit] = total_y / n_good_y;
4237 good_hits[iHit], x_vec[iHit], y_vec[iHit], z_vec[iHit]);
4296 double matched_hits = 0.;
4297 for(
size_t j = 0; j < list.size(); ++j ){
4303 if( list[j].particle == beam_match.
particle ){
4304 matched_hits = list[j].nSharedHits + list[j].nSharedDeltaRayHits;
4307 total += list[j].nSharedHits + list[j].nSharedDeltaRayHits;
4397 double matched_hits = 0.;
4398 for(
size_t j = 0; j < list.size(); ++j ){
4399 if( list[j].particle == match.
particle ){
4400 matched_hits = list[j].nSharedHits + list[j].nSharedDeltaRayHits;
4402 total += list[j].nSharedHits + list[j].nSharedDeltaRayHits;
4440 if( true_daughter_byE ){
4464 if( pandora2Track ){
4471 std::pair<double, double> vertex_michel_score_weight_by_charge =
4473 if (vertex_michel_score_weight_by_charge.second != 0)
4523 bool found_plane =
false;
4524 for (index = 0; index < calo.size(); ++
index) {
4525 if (calo[index].
PlaneID().Plane == 2) {
4533 auto calo_range = calo[
index].ResidualRange();
4534 auto calo_dEdX = calo[
index].dEdx();
4535 auto calo_dQdX = calo[
index].dQdx();
4536 auto TpIndices = calo[
index].TpIndices();
4538 for(
size_t i = 0; i < calo_range.size(); ++i ){
4545 auto theXYZPoints = calo[
index].XYZ();
4546 for(
size_t i = 0; i < calo_dQdX.size(); ++i ){
4547 const recob::Hit & theHit = (*allHits)[ TpIndices[i] ];
4570 std::sort(theXYZPoints.begin(), theXYZPoints.end(), [](
auto a,
auto b)
4571 {
return (
a.Z() <
b.Z());});
4572 if (theXYZPoints.size()) {
4584 for(
size_t i = 0; i < new_dEdX.size(); ++i ) {
4594 for (
size_t i = 0; i < calo_dEdX.size(); ++i){
4606 double efield_placeholder = 1.;
4613 std::vector< calo_point > reco_beam_calo_points;
4620 reco_beam_calo_points.push_back(
4635 std::sort( reco_beam_calo_points.begin(), reco_beam_calo_points.end(), [](
calo_point a,
calo_point b) {
return ( a.
z <
b.z );} );
4638 for(
size_t i = 0; i < reco_beam_calo_points.size(); ++i ){
4639 calo_point thePoint = reco_beam_calo_points[i];
4651 double init_KE = 0.;
4654 double mass = 139.57;
4664 for(
size_t i = 0; i < reco_beam_calo_points.size() - 1; ++i ){
4666 if (reco_beam_calo_points[i].calibrated_dEdX < 0.)
continue;
4705 std::vector<std::vector<G4ReweightTraj *>> & hierarchy,
4706 std::vector<fhicl::ParameterSet> & pars,
4708 G4MultiReweighter * multi_rw) {
4709 std::vector<double>
input(pars.size(), 1.);
4710 for (
size_t i = 0; i < pars.size(); ++i) {
4711 weights.push_back(std::vector<double>());
4714 bool set_values = multi_rw->SetAllParameterValues(input);
4717 if (hierarchy.size()) {
4718 std::vector<G4ReweightTraj *> & init_trajs = hierarchy[0];
4719 weights.back().push_back(
4721 for (
size_t k = 1;
k < hierarchy.size(); ++
k) {
4722 std::vector<G4ReweightTraj *> & temp_trajs = hierarchy[
k];
4723 weights.back().back()
4730 throw std::runtime_error(message);
4742 double &
x,
double &
y,
double &
z) {
4755 ROOT::Math::XYZVector xp(x,y,z);
4756 ROOT::Math::XYZVector x0(p[0], p[2], 0.);
4757 ROOT::Math::XYZVector
x1(p[0] + p[1], p[2] + p[3], 1.);
4758 ROOT::Math::XYZVector u = (x1-x0).Unit();
4759 double d2 = ((xp-x0).Cross(u)) .Mag2();
4765 double * par,
int) {
4767 TGraph2D * gr =
dynamic_cast<TGraph2D*
>( (TVirtualFitter::GetFitter())->GetObjectFit() );
4769 double *
x = gr->GetX();
4770 double *
y = gr->GetY();
4771 double *
z = gr->GetZ();
4772 int npoints = gr->GetN();
4774 for (
int i = 0; i < npoints; ++i) {
4781 TGraph2D * gr =
new TGraph2D();
4782 for (
size_t i = 0; i < input.size(); ++i) {
4783 gr->SetPoint(i, input[i].
X(), input[i].
Y(), input[i].
Z());
4786 TVirtualFitter *
min = TVirtualFitter::Fitter(0,4);
4787 min->SetObjectFit(gr);
4793 min->ExecuteCommand(
"SET PRINT",arglist,1);
4796 double pStart[4] = {1,1,1,1};
4797 min->SetParameter(0,
"x0",pStart[0],0.01,0,0);
4798 min->SetParameter(1,
"Ax",pStart[1],0.01,0,0);
4799 min->SetParameter(2,
"y0",pStart[2],0.01,0,0);
4800 min->SetParameter(3,
"Ay",pStart[3],0.01,0,0);
4804 min->ExecuteCommand(
"MIGRAD", arglist, 2);
4808 for (
int i = 0; i < 4; ++i) {
4809 parFit[i] = min->GetParameter(i);
4811 double startX1, startY1, startZ1;
4812 double startX2, startY2, startZ2;
4813 line(0, parFit, startX1, startY1, startZ1);
4814 line(1, parFit, startX2, startY2, startZ2);
4816 TVector3 diff(startX2 - startX1,
4826 if (weights.empty())
return;
4829 gr.Fit(
"pol9",
"Q");
4830 TF1 * fit_func = (TF1*)gr.GetFunction(
"pol9");
4831 for (
int j = 0; j < fit_func->GetNpar(); ++j) {
4832 coeffs.push_back(fit_func->GetParameter(j));
int reco_beam_true_byHits_PDG
G4MultiReweighter * KPlusMultiRW
def analyze(root, level, gtrees, gbranches, doprint)
double E(const int i=0) const
std::vector< double > true_beam_traj_X_SCE
double michel_weight_by_charge
std::vector< int > beam_inst_TOF_Chan
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_PFP_trackScore
TrackID_t trackID
Geant4 supplied track ID.
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_startX
std::vector< int > reco_daughter_PFP_true_byE_PDG
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
double reco_beam_PFP_trackScore_collection_weight_by_charge
std::vector< double > reco_beam_calo_startDirX
std::vector< double > reco_beam_calo_X
std::vector< double > true_beam_incidentEnergies
std::vector< std::vector< double > > reco_daughter_allTrack_calo_X
std::vector< int > reco_daughter_PFP_true_byHits_ID
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allShower_startX
std::pair< double, double > GetVertexMichelScore_weight_by_charge(const recob::Track &track, const art::Event &evt, const std::string trackModule, const std::string hitModule, double min_length=5., double min_x=-200., double max_x=0., double min_y=200., double max_y=500., double min_z=25., bool check_wire=true, double check_x=0, double check_y=0., double check_z=0.)
std::vector< double > reco_daughter_allShower_startY
double reco_beam_allTrack_trackDirY
std::vector< double > reco_beam_spacePts_Y
std::vector< double > reco_daughter_PFP_true_byHits_startZ
double reco_beam_allTrack_startY
std::vector< std::vector< double > > g4rw_primary_grid_weights
std::vector< double > reco_beam_dQ_NoSCE
unsigned int NumberTrajectoryPoints() const
std::vector< int > reco_daughter_allTrack_Chi2_ndof_plane1
std::vector< double > g4rw_full_primary_plus_sigma_weight
double reco_beam_calo_endZ
const std::vector< size_t > & Daughters() const
Returns the collection of daughter particles.
double true_beam_startDirZ
std::vector< double > GetEFieldVector(const recob::Track &track, art::Event const &evt, const std::string trackModule, const std::string caloModule, size_t planeID, double negativeZFix=0.)
const TVector3 & ShowerStart() const
double reco_beam_allTrack_startZ
const TLorentzVector & Position(const int i=0) const
double Z(const size_type i) const
bool reco_beam_passes_beam_cuts
double X(const size_type i) const
std::vector< std::vector< double > > reco_daughter_allTrack_dQdX_SCE
std::vector< double > true_beam_daughter_startPz
float z
z position of ionization [cm]
std::string reco_beam_true_byE_process
double reco_beam_true_byE_endE
std::vector< std::vector< double > > reco_daughter_allTrack_calo_Z
std::string reco_beam_true_byE_endProcess
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_PFP_trackScore
protoana::ProtoDUNEBeamCuts beam_cuts
std::vector< double > reco_beam_calo_Z_allTrack
bool IsBeamParticle(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel) const
Use the pandora metadata to tell us if this is a beam particle or not.
int reco_beam_true_byHits_origin
std::vector< std::vector< double > > reco_daughter_shower_spacePts_Z
std::vector< double > reco_daughter_PFP_true_byHits_startX
std::vector< double > reco_daughter_allTrack_Chi2_muon
double reco_beam_true_byHits_startPy
int true_daughter_nPiMinus
std::vector< int > true_beam_Pi0_decay_ID
double reco_beam_calo_endY
TFile * OpenFile(const std::string filename)
double Py(const int i=0) const
std::vector< double > true_beam_elastic_IDE_edep
std::vector< int > reco_daughter_PFP_true_byHits_parID
int reco_beam_vertex_slice
const int & GetTimingTrigger() const
std::vector< double > beam_particle_scores
std::vector< double > reco_beam_dEdX_NoSCE
const std::vector< double > & GetTOFs() const
const simb::MCParticle * GetGeantGoodParticle(const simb::MCTruth &genTruth, const art::Event &evt) const
std::vector< double > true_beam_Pi0_decay_len
std::vector< double > reco_track_michel_score_weight_by_charge
std::vector< int > true_beam_slices
std::vector< double > true_beam_slices_deltaE
std::vector< double > reco_beam_TrkPitch_NoSCE
std::vector< fhicl::ParameterSet > FakeDataParSet
std::vector< double > reco_daughter_allTrack_alt_len
const TLorentzVector & EndPosition() const
std::pair< double, double > fGridPair
std::string fCalorimetryTagNoSCE
std::vector< double > reco_beam_EField_SCE
bool reco_beam_allTrack_flipped
size_t Self() const
Returns the index of this particle.
std::vector< double > reco_daughter_allTrack_endZ
double E(const size_type i) const
std::vector< double > reco_beam_calo_Y_allTrack
std::vector< int > reco_daughter_PFP_nHits_collection
std::vector< double > true_beam_Pi0_decay_startZ
std::vector< double > true_beam_Pi0_decay_startPx
double reco_beam_true_byHits_startPx
std::vector< double > reco_beam_calo_wire_NoSCE
std::vector< std::vector< double > > reco_daughter_allTrack_calibrated_dQdX_SCE
std::vector< double > reco_beam_resRange_SCE
std::vector< double > g4rw_full_primary_minus_sigma_weight
AdcChannelData::View View
const recob::Shower * GetPFParticleShower(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel, const std::string showerLabel) const
Get the shower associated to this particle. Returns a null pointer if not found.
double reco_beam_trackDirX
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
std::vector< int > beam_inst_PDG_candidates
double reco_beam_calo_endY_allTrack
double reco_beam_true_byHits_endPy
std::vector< double > reco_daughter_allTrack_startZ
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
const simb::MCTrajectory & Trajectory() const
std::vector< std::string > true_beam_grand_daughter_Process
std::vector< double > reco_daughter_allTrack_Chi2_pion
geo::WireID WireID() const
std::vector< double > reco_track_startX
std::vector< double > reco_track_startZ
const double & GetCKov0Pressure() const
const recob::TrackTrajectory & Trajectory() const
Access to the stored recob::TrackTrajectory.
std::vector< std::string > true_beam_daughter_endProcess
std::vector< fhicl::ParameterSet > ParSet
art::ServiceHandle< geo::Geometry > geom
std::vector< anab::Calorimetry > GetRecoTrackCalorimetry(const recob::Track &track, art::Event const &evt, const std::string trackModule, const std::string caloModule) const
Get the Calorimetry(s) from a given reco track.
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_startZ
std::vector< std::vector< double > > g4rw_full_grid_piplus_weights
double Pz(const size_type i) const
std::vector< anab::Calorimetry > GetRecoShowerCalorimetry(const recob::Shower &shower, art::Event const &evt, const std::string showerModule, const std::string caloModule) const
Get shower calo info.
bool reco_beam_true_byE_matched
double GetCompleteness(detinfo::DetectorClocksData const &clockData, const T &recobj, const art::Event &evt, std::string recoModule, std::string hitModule) const
std::vector< int > reco_daughter_PFP_true_byHits_PDG
double reco_beam_PFP_michelScore_weight_by_charge
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_endX
protoana::ProtoDUNEEmptyEventFinder fEmptyEventFinder
double reco_beam_PFP_emScore_collection_weight_by_charge
std::vector< double > reco_daughter_allTrack_momByRange_proton
std::vector< double > reco_beam_calo_wire_z
std::string KeyToProcess(unsigned char const &key) const
std::vector< double > reco_beam_spacePts_Z
std::vector< double > reco_daughter_allTrack_Chi2_proton_plane1
std::vector< double > reco_beam_allTrack_calibrated_dEdX
std::vector< double > true_beam_daughter_startP
std::vector< double > g4rw_primary_minus_sigma_weight
double Px(const int i=0) const
double reco_beam_PFP_emScore
std::vector< double > reco_daughter_allTrack_momByRange_alt_muon
const short & GetCKov1Status() const
const TVector3 GetPFParticleVertex(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel, const std::string trackLabel) const
Function to find the interaction vertex of a primary PFParticle.
std::vector< int > reco_daughter_allShower_ID
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allShower_startZ
std::vector< double > reco_track_endX
void SumDistance2(int &, double *, double &sum, double *par, int)
double reco_beam_allTrack_trackDirX
bool reco_beam_allTrack_beam_cuts
double reco_beam_PFP_michelScore_collection
double reco_beam_true_byE_startPz
double reco_beam_true_byHits_endE
std::vector< double > reco_beam_calo_startDirY
double reco_beam_momByRange_alt_muon
art::ServiceHandle< cheat::BackTrackerService > bt_serv
void BeamForcedTrackInfo()
std::vector< std::string > true_beam_daughter_Process
int getIndex(const std::string &name) const
Index of column with given name, or -1 if name not found.
std::vector< const sim::IDE * > TrackIdToSimIDEs_Ps(int const &id) const
std::vector< int > reco_daughter_allTrack_Chi2_ndof
std::vector< double > reco_daughter_PFP_michelScore
double GetNTrajWeightFromSetPars(const std::vector< G4ReweightTraj * > &trajs, G4MultiReweighter &rw)
int true_daughter_nPiPlus
double reco_beam_true_byHits_endP
double true_beam_last_len
std::vector< double > reco_daughter_PFP_true_byHits_startPy
double reco_beam_trackEndDirY
Information about charge reconstructed in the active volume.
PDSPAnalyzer(fhicl::ParameterSet const &p)
const MCParticleSharedHits GetMCParticleByHits(detinfo::DetectorClocksData const &clockData, const T &recobj, const art::Event &evt, std::string recoModule, std::string hitModule) const
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
void TrueBeamInfo(const art::Event &evt, const simb::MCParticle *true_beam_particle, detinfo::DetectorClocksData const &clockData, const sim::ParticleList &plist, std::map< int, std::vector< int >> &trueToPFPs, anab::MVAReader< recob::Hit, 4 > *hitResults)
std::vector< std::vector< int > > true_beam_reco_byHits_PFP_nHits
WireID_t Wire
Index of the wire within its plane.
std::vector< double > reco_track_endZ
std::vector< double > reco_beam_calo_X_allTrack
std::vector< double > reco_beam_incidentEnergies_allTrack
std::vector< double > true_beam_traj_Z_SCE
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
std::vector< std::vector< double > > g4rw_full_grid_coeffs
std::vector< int > reco_daughter_PFP_nHits
std::string true_beam_endProcess
int true_daughter_nNeutron
std::vector< double > reco_daughter_PFP_true_byHits_startE
std::string Process() const
std::vector< double > reco_beam_calo_Y
std::vector< double > g4rw_alt_primary_minus_sigma_weight
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_startX
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_endX
std::string fGeneratorTag
double reco_beam_vertex_michel_score_weight_by_charge_allTrack
bool IsEmptyEvent(const art::Event &evt) const
G4ReweightManager * RWManager
std::vector< double > reco_daughter_PFP_true_byE_purity
double true_beam_endX_SCE
std::vector< std::vector< double > > g4rw_full_grid_proton_weights
std::vector< int > reco_beam_calo_TPC_NoSCE
std::vector< double > true_beam_daughter_startY
std::string reco_beam_true_byHits_endProcess
std::vector< double > reco_beam_calo_wire
std::vector< std::string > true_beam_processes
geo::Length_t WirePitch(geo::PlaneID const &planeid) const
Returns the distance between two consecutive wires.
bool IsBeamlike(const recob::Track &, const art::Event &, std::string)
int NumberDaughters() const
std::vector< double > true_beam_traj_Y
std::vector< std::vector< double > > reco_daughter_allTrack_dEdX_SCE
std::vector< double > true_beam_Pi0_decay_startPy
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_endY
double reco_beam_true_byHits_purity
double dEdX(double KE, const simb::MCParticle *part)
std::vector< size_t > reco_daughter_PFP_true_byHits_sharedHits
EDIT: quality.
std::vector< std::vector< int > > true_beam_Pi0_decay_reco_byHits_PFP_ID
art framework interface to geometry description
int reco_beam_true_byHits_ID
std::map< int, std::vector< const sim::IDE * > > slice_IDEs(std::vector< const sim::IDE * > ides, double the_z0, double the_pitch, double true_endZ)
std::vector< double > reco_beam_TrkPitch_SCE_allTrack
std::vector< std::vector< double > > reco_daughter_allTrack_calo_Y
int Daughter(const int i) const
std::vector< double > reco_daughter_allTrack_Phi
double reco_beam_true_byHits_endPz
double beam_inst_C1_pressure
std::vector< size_t > reco_daughter_PFP_true_byHits_emHits
bool reco_reconstructable_beam_event
const std::vector< art::Ptr< recob::Hit > > GetPFParticleHitsFromPlane_Ptrs(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel, size_t planeID) const
G4MultiReweighter * ProtMultiRW
double true_beam_endZ_SCE
std::vector< std::vector< double > > reco_daughter_allTrack_calibrated_dEdX_SCE_plane0
std::pair< double, int > GetVertexMichelScore(const recob::Track &track, const art::Event &evt, const std::string trackModule, const std::string hitModule, double min_length=5., double min_x=-200., double max_x=0., double min_y=200., double max_y=500., double min_z=25., bool check_wire=true, double check_x=0, double check_y=0., double check_z=0.)
std::vector< double > reco_beam_calibrated_dQdX_SCE
int reco_beam_true_byE_origin
std::vector< std::vector< int > > true_beam_reco_byHits_PFP_ID
std::vector< double > true_beam_daughter_startPx
double reco_beam_calo_endX
std::vector< std::string > g4rw_primary_var
double reco_beam_interactingEnergy
fhicl::ParameterSet BeamCuts
double reco_beam_calo_startZ_allTrack
std::vector< const recob::Hit * > GetMCParticleHits(detinfo::DetectorClocksData const &clockData, const simb::MCParticle &mcpart, const art::Event &evt, std::string hitModule, bool use_eve=true) const
geo::TPCID FindTPCAtPosition(double const worldLoc[3]) const
Returns the ID of the TPC at specified location.
std::vector< double > true_beam_traj_Y_SCE
double reco_beam_PFP_emScore_weight_by_charge
std::vector< int > reco_daughter_PFP_true_byHits_parPDG
double beam_inst_C0_pressure
std::vector< double > reco_daughter_PFP_true_byHits_startPx
double reco_beam_PFP_michelScore
std::vector< double > reco_beam_TrkPitch_SCE
std::vector< fhicl::ParameterSet > ProtParSet
protoana::ProtoDUNECalibration calibration_NoSCE
std::string fPandora2CaloSCE
double true_beam_endY_SCE
double HitToEnergy(const art::Ptr< recob::Hit > hit, double X, double Y, double Z, double recomb_factor=.6417)
std::vector< std::vector< double > > reco_daughter_allTrack_EField_SCE
double reco_beam_vertex_michel_score_weight_by_charge
double reco_beam_momByRange_muon
std::vector< std::vector< int > > true_beam_Pi0_decay_reco_byHits_allTrack_ID
const art::InputTag fTrackModuleLabel
void GetG4RWCoeffs(std::vector< double > &weights, std::vector< double > &coeffs)
std::vector< double > reco_beam_spacePts_X
QTextStream & reset(QTextStream &s)
G4MultiReweighter * MultiRW
const std::vector< art::Ptr< recob::Hit > > GetRecoShowerArtHits(const recob::Shower &shower, art::Event const &evt, const std::string showerModule) const
std::vector< MCParticleSharedHits > GetMCParticleListByHits(detinfo::DetectorClocksData const &clockData, const T &recobj, const art::Event &evt, std::string recoModule, std::string hitModule) const
Vector_t StartDirection() const
Access to track direction at different points.
std::vector< double > true_beam_daughter_startPy
double Length(size_t p=0) const
Access to various track properties.
double reco_beam_vertex_michel_score
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allShower_len
double Y(const size_type i) const
TVector3 FitLine(const std::vector< TVector3 > &input)
#define DEFINE_ART_MODULE(klass)
std::vector< std::vector< double > > g4rw_full_grid_proton_coeffs
std::vector< double > reco_daughter_PFP_true_byHits_len
std::string EndProcess() const
double reco_beam_trackDirZ
std::vector< std::vector< double > > g4rw_full_grid_neutron_coeffs
std::map< int, std::vector< int > > GetMapMCToPFPs_ByHits(detinfo::DetectorClocksData const &clockData, const art::Event &evt, std::string pfpTag, std::string hitTag)
double true_beam_IDE_totalDep
std::vector< double > reco_daughter_allTrack_endY
std::vector< double > reco_track_michel_score
Point_t const & Start() const
Access to track position at different points.
double GetPurity(detinfo::DetectorClocksData const &clockData, const recob::PFParticle &pfpart, const art::Event &evt, std::string pfparticleModule) const
const std::vector< short > & GetActiveFibers(std::string) const
std::vector< double > g4rw_alt_primary_plus_sigma_weight
std::vector< std::vector< int > > true_beam_reco_byHits_allTrack_ID
std::vector< std::vector< double > > reco_daughter_allTrack_calibrated_dEdX_SCE_plane1
double reco_beam_allTrack_len
Ionization at a point of the TPC sensitive volume.
std::vector< double > true_beam_traj_Px
std::vector< int > reco_beam_calo_TPC
const std::vector< double > & GetRecoBeamMomenta() const
T LocationAtPoint(unsigned int p) const
Position at point p. Use e.g. as:
std::vector< std::vector< int > > true_beam_daughter_reco_byHits_PFP_ID
std::vector< double > CalibratedQdX(const recob::Track &track, art::Event const &evt, const std::string trackModule, const std::string caloModule, size_t planeID, double negativeZFix)
std::vector< double > true_beam_elastic_deltaE
const art::Ptr< simb::MCTruth > & TrackIdToMCTruth_P(int id) const
std::vector< int > beam_track_IDs
std::vector< double > reco_daughter_allShower_startX
double track_weight_by_charge
std::vector< double > g4rw_primary_grid_pair_weights
std::vector< std::vector< double > > g4rw_full_grid_piminus_weights
double Theta() const
Access to spherical or geographical angles at vertex or at any point.
std::vector< double > reco_beam_allTrack_resRange
std::vector< double > reco_daughter_allTrack_endX
const simb::MCParticle * GetMCParticleFromPFParticle(detinfo::DetectorClocksData const &clockData, const recob::PFParticle &pfpart, art::Event const &evt, std::string pfparticleModule) const
double P(const int i=0) const
const recob::Track * GetPFParticleTrack(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel, const std::string trackLabel) const
Get the track associated to this particle. Returns a null pointer if not found.
int reco_beam_vertex_nHits
float energy
energy deposited by ionization by this track ID and time [MeV]
std::vector< int > reco_daughter_allTrack_ID
std::vector< double > true_beam_traj_Pz
double reco_beam_calo_startX_allTrack
double reco_beam_allTrack_endX
double reco_beam_calo_startX
double reco_beam_true_byE_startPy
double true_beam_interactingEnergy
std::vector< double > true_beam_elastic_costheta
double reco_beam_calo_startZ
double reco_beam_Chi2_proton
std::vector< std::string > true_beam_grand_daughter_endProcess
std::vector< std::vector< double > > g4rw_full_grid_weights
std::vector< std::vector< double > > g4rw_full_grid_kplus_weights
std::vector< std::vector< double > > reco_daughter_allTrack_resRange_SCE
int true_daughter_nNucleus
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_startZ
std::vector< double > g4rw_primary_plus_sigma_weight
std::vector< double > reco_beam_calibrated_dEdX_SCE
std::vector< double > reco_track_endY
std::vector< double > reco_daughter_PFP_true_byHits_completeness
std::string fBeamModuleLabel
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
std::vector< double > reco_daughter_PFP_true_byE_completeness
void BeamTrackInfo(const art::Event &evt, const recob::Track *thisTrack, detinfo::DetectorClocksData const &clockData)
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
std::vector< double > reco_daughter_allTrack_vertex_michel_score
void analyze(art::Event const &evt) override
std::vector< int > reco_daughter_PFP_ID
double reco_beam_vertex_michel_score_allTrack
std::vector< double > reco_daughter_allShower_dirY
std::vector< double > true_beam_daughter_endZ
const std::map< unsigned int, std::vector< const recob::PFParticle * > > GetPFParticleSliceMap(art::Event const &evt, const std::string particleLabel) const
Get a map of slice index to the primary PFParticles within it.
std::vector< int > reco_track_ID
double reco_beam_interactingEnergy_allTrack
std::vector< int > reco_daughter_allTrack_vertex_nHits
SubRunNumber_t subRun() const
double reco_beam_trackEndDirX
std::vector< double > reco_daughter_PFP_true_byHits_startY
const std::vector< const recob::PFParticle * > GetPFParticlesFromBeamSlice(art::Event const &evt, const std::string particleLabel) const
Return the pointers for the PFParticles in the beam slice. Returns an empty vector is no beam slice w...
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allShower_len
const TVector3 & Direction() const
std::vector< double > reco_beam_dQdX_SCE
bool IsGoodBeamlineTrigger(art::Event const &evt) const
double reco_beam_true_byHits_startPz
std::vector< double > reco_beam_calo_wire_z_NoSCE
std::vector< double > reco_daughter_PFP_true_byHits_startP
bool CreateRWTraj(const simb::MCParticle &part, const sim::ParticleList &plist, art::ServiceHandle< geo::Geometry > geo_serv, int event, G4ReweightTraj *theTraj)
double reco_beam_PFP_emScore_collection
std::vector< int > true_beam_Pi0_decay_nHits
std::vector< std::string > reco_daughter_PFP_true_byHits_endProcess
double reco_beam_alt_len_allTrack
std::map< int, TProfile * > templates
static int max(int a, int b)
std::vector< double > true_beam_Pi0_decay_startY
int true_beam_nElasticScatters
std::vector< double > true_beam_elastic_Y
bool sort_IDEs(const sim::IDE *i1, const sim::IDE *i2)
std::vector< int > true_beam_Pi0_decay_parID
std::vector< std::vector< double > > reco_daughter_allTrack_calibrated_dEdX_SCE
double reco_beam_calo_endZ_allTrack
double reco_beam_true_byE_endPy
double reco_beam_calo_startY_allTrack
double reco_beam_true_byE_endPz
const TLorentzVector & Position(const size_type) const
The accessor methods described above.
std::vector< double > reco_daughter_allTrack_Theta
ProcessMap const & TrajectoryProcesses() const
std::vector< std::vector< double > > reco_daughter_spacePts_Y
std::vector< double > reco_track_startY
protoana::ProtoDUNECalibration calibration_SCE
cnnOutput2D GetCNNOutputFromPFParticle(const recob::PFParticle &part, const art::Event &evt, const anab::MVAReader< recob::Hit, 4 > &CNN_results, protoana::ProtoDUNEPFParticleUtils &pfpUtil, std::string fPFParticleTag)
std::vector< int > reco_daughter_pandora_type
size_t nSharedDeltaRayHits
double reco_beam_true_byHits_startP
std::vector< std::vector< double > > g4rw_full_grid_piplus_weights_fake_data
std::vector< std::vector< double > > reco_daughter_allTrack_resRange_plane1
std::vector< std::vector< int > > true_beam_daughter_reco_byHits_allTrack_ID
std::vector< double > reco_daughter_PFP_michelScore_collection
double reco_beam_allTrack_trackEndDirY
std::vector< double > reco_daughter_PFP_true_byHits_endX
std::vector< double > true_beam_daughter_endY
std::vector< double > reco_beam_calo_wire_allTrack
const sim::ParticleList & ParticleList() const
std::pair< double, int > Chi2PID(const std::vector< double > &track_dedx, const std::vector< double > &range, TProfile *profile)
std::vector< double > true_beam_daughter_len
double reco_beam_allTrack_Chi2_proton
protoana::ProtoDUNEBeamlineUtils fBeamlineUtils
std::vector< std::vector< double > > reco_daughter_spacePts_Z
std::vector< double > true_beam_traj_KE
std::vector< int > true_beam_daughter_PDG
std::vector< double > reco_beam_calibrated_dEdX_NoSCE
std::vector< int > true_beam_grand_daughter_nHits
std::vector< double > reco_beam_calo_Z
std::vector< const sim::IDE * > GetSimIDEsBetweenPoints(const simb::MCParticle &mcpart, const TLorentzVector &p1, const TLorentzVector &p2)
std::vector< std::vector< int > > true_beam_daughter_reco_byHits_PFP_nHits
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_startY
art::ServiceHandle< cheat::ParticleInventoryService > pi_serv
std::vector< double > reco_daughter_allTrack_Chi2_proton
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
std::vector< double > reco_beam_calo_endDirX
bool reco_beam_true_byHits_matched
Defines an enumeration for cellhit classification.
std::vector< double > true_beam_daughter_endX
std::vector< double > g4rw_primary_weights
WireGeo const & Wire(geo::WireID const &wireid) const
Returns the specified wire.
std::vector< int > true_beam_daughter_nHits
std::vector< int > true_beam_Pi0_decay_PDG
std::string dEdX_template_name
protoana::ProtoDUNETruthUtils truthUtil
std::vector< int > true_beam_daughter_ID
protoana::ProtoDUNETrackUtils trackUtil
float PeakTime() const
Time of the signal peak, in tick units.
std::vector< double > reco_daughter_allShower_dirX
std::vector< double > true_beam_daughter_startZ
Declaration of signal hit object.
std::vector< double > reco_daughter_allTrack_Chi2_proton_plane0
std::vector< int > GetPID(beam::ProtoDUNEBeamEvent const &beamevt, double nominal_momentum)
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_endZ
std::vector< double > true_beam_daughter_startX
std::vector< double > true_beam_traj_Py
const simb::MCParticle * particle
void DaughterMatchInfo(const art::Event &evt, const recob::PFParticle *daughterPFP, detinfo::DetectorClocksData const &clockData)
std::vector< int > reco_track_nHits
std::vector< std::string > reco_daughter_PFP_true_byHits_process
Hierarchical representation of particle flow.
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allShower_startZ
std::vector< double > reco_daughter_PFP_emScore
std::vector< double > true_beam_traj_Z
double reco_beam_calo_startY
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
void BeamMatchInfo(const art::Event &evt, const recob::PFParticle *particle, const simb::MCParticle *true_beam_particle, detinfo::DetectorClocksData const &clockData)
const std::vector< int > & GetTOFChans() const
std::vector< double > true_beam_Pi0_decay_startPz
double reco_beam_allTrack_endZ
std::vector< int > true_beam_grand_daughter_PDG
double reco_beam_trackDirY
Contains all timing reference information for the detector.
G4ReweightParameterMaker ParMaker
std::vector< std::vector< double > > reco_daughter_spacePts_X
void BeamInstInfo(const art::Event &evt)
std::vector< double > reco_daughter_PFP_true_byHits_endY
double TotalLength() const
std::vector< double > fGridPoints
std::vector< std::vector< int > > true_beam_Pi0_decay_reco_byHits_PFP_nHits
std::vector< double > reco_beam_calo_endDirY
int reco_beam_true_byE_PDG
std::vector< double > reco_beam_incidentEnergies
double reco_beam_true_byE_startPx
Vector_t EndDirection() const
double reco_beam_momByRange_alt_proton
double true_beam_startDirY
protoana::ProtoDUNEPFParticleUtils pfpUtil
void line(double t, double *p, double &x, double &y, double &z)
std::vector< std::vector< double > > reco_daughter_shower_spacePts_Y
Point_t const & End() const
Returns the position of the last valid point of the trajectory [cm].
std::vector< std::vector< double > > reco_daughter_allTrack_resRange_plane0
int reco_beam_true_byE_ID
double Pz(const int i=0) const
double reco_beam_PFP_michelScore_collection_weight_by_charge
double reco_beam_true_byHits_startE
Provides recob::Track data product.
double reco_beam_PFP_trackScore
std::vector< int > true_beam_grand_daughter_ID
std::vector< int > true_beam_slices_found
std::vector< double > reco_beam_resRange_NoSCE
std::vector< double > reco_beam_dQ
std::vector< double > reco_beam_dEdX_SCE
fhicl::ParameterSet BeamPars
const std::vector< art::Ptr< recob::Hit > > GetPFParticleHits_Ptrs(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel) const
std::vector< double > true_beam_Pi0_decay_startX
double reco_beam_calo_endX_allTrack
std::vector< double > reco_daughter_PFP_trackScore
std::vector< double > true_beam_Pi0_decay_startP
double reco_beam_momByRange_proton
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_len
protoana::ProtoDUNEShowerUtils showerUtil
std::vector< std::vector< int > > true_beam_Pi0_decay_reco_byHits_allShower_ID
calo_point(size_t w, double in_tick, double p, double dqdx, double dedx, double dq, double cali_dqdx, double cali_dedx, double r, size_t index, double input_wire_z, int t, double efield, double input_x, double input_y, double input_z)
EventNumber_t event() const
Point_t const & End() const
const std::vector< recob::Track > & GetBeamTracks() const
const short & GetCKov0Status() const
double Px(const size_type i) const
std::vector< std::vector< double > > g4rw_full_grid_neutron_weights
detail::Node< FrameID, bool > PlaneID
std::vector< double > reco_daughter_allShower_energy
double reco_beam_allTrack_trackEndDirZ
double reco_beam_PFP_trackScore_weight_by_charge
std::vector< double > reco_daughter_allTrack_startX
bool file_exists(std::string const &qualified_filename)
int reco_beam_vertex_nHits_allTrack
double reco_beam_allTrack_trackDirZ
std::vector< double > reco_daughter_PFP_true_byE_len
void BeamPFPInfo(const art::Event &evt, const recob::PFParticle *particle, anab::MVAReader< recob::Hit, 4 > *hitResults)
std::vector< double > beam_inst_TOF
2D representation of charge deposited in the TDC/wire plane
cnnOutput2D GetCNNOutputFromPFParticleFromPlane(const recob::PFParticle &part, const art::Event &evt, const anab::MVAReader< recob::Hit, 4 > &CNN_results, protoana::ProtoDUNEPFParticleUtils &pfpUtil, std::string fPFParticleTag, size_t planeID)
double distance2(double x, double y, double z, double *p)
void GetCenter(double *xyz, double localz=0.0) const
Fills the world coordinate of a point on the wire.
std::vector< double > true_beam_elastic_Z
std::vector< double > true_beam_traj_X
double em_weight_by_charge
double true_beam_startDirX
int reco_beam_allTrack_Chi2_ndof
double lateralDist(TVector3 &n, TVector3 &x0, TVector3 &p)
std::vector< int > reco_daughter_allTrack_Chi2_ndof_plane0
G4MultiReweighter * FakeDataMultiRW
TFile * dEdX_template_file
double reco_beam_true_byE_startP
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allShower_startY
double reco_beam_true_byE_startE
#define MF_LOG_WARNING(category)
double reco_beam_trackEndDirZ
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
TPCID_t TPC
Index of the TPC within its cryostat.
std::vector< double > reco_beam_calo_startDirZ
std::vector< std::vector< double > > reco_daughter_shower_spacePts_X
double reco_beam_allTrack_trackEndDirX
double none_weight_by_charge
void BeamShowerInfo(const art::Event &evt, const recob::Shower *thisShower)
std::vector< double > reco_daughter_allTrack_momByRange_muon
std::vector< double > reco_daughter_PFP_trackScore_collection
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_endZ
std::vector< float > GetCalibratedCalorimetry(const recob::Track &track, art::Event const &evt, const std::string trackModule, const std::string caloModule, size_t planeID, double negativeZFix=0.)
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_endY
std::vector< G4ReweightTraj * > CreateNRWTrajs(const simb::MCParticle &part, const sim::ParticleList &plist, art::ServiceHandle< geo::Geometry > geo_serv, int event, std::string material_name="LAr", bool fVerbose=false)
std::vector< double > reco_daughter_allShower_dirZ
std::vector< int > reco_daughter_PFP_true_byHits_origin
std::map< size_t, const recob::Hit * > GetRecoHitsFromTrajPoints(const recob::Track &track, art::Event const &evt, std::string trackModule)
Point_t const & Start() const
Returns the position of the first valid point of the trajectory [cm].
std::vector< double > reco_daughter_allShower_len
void G4RWGridWeights(std::vector< std::vector< G4ReweightTraj * >> &hierarchy, std::vector< fhicl::ParameterSet > &pars, std::vector< std::vector< double >> &weights, G4MultiReweighter *multi_rw)
std::vector< std::vector< int > > true_beam_daughter_reco_byHits_allShower_ID
const bool & CheckIsMatched() const
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allShower_startX
double Py(const size_type i) const
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_len
std::string reco_beam_true_byHits_process
std::string fPFParticleTag
std::vector< std::vector< double > > g4rw_full_grid_kplus_coeffs
double reco_beam_PFP_trackScore_collection
std::array< float, N > getOutput(size_t key) const
Get copy of the MVA output vector at index "key".
std::vector< int > reco_daughter_allTrack_Chi2_ndof_pion
double reco_beam_true_byHits_endPx
std::vector< double > reco_daughter_PFP_true_byHits_endZ
double reco_beam_true_byE_endPx
std::vector< int > true_beam_grand_daughter_parID
double reco_beam_allTrack_startX
G4ReweightParameterMaker ProtParMaker
std::string fCalorimetryTagSCE
std::vector< double > reco_beam_dQdX_NoSCE
std::vector< const recob::Hit * > GetSharedHits(detinfo::DetectorClocksData const &clockData, const simb::MCParticle &mcpart, const recob::PFParticle &pfpart, const art::Event &evt, std::string pfparticleModule, bool delta_ray=false) const
float GetBeamCosmicScore(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel) const
Access the BDT output used to decide if a slice is beam-like or cosmic-like.
int true_daughter_nProton
std::vector< double > reco_daughter_allTrack_len
std::vector< double > reco_daughter_PFP_true_byHits_startPz
std::vector< std::vector< double > > g4rw_full_grid_piplus_coeffs
std::vector< double > reco_daughter_PFP_emScore_collection
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
double reco_beam_true_byE_endP
double GetTrackMomentum(double trkrange, int pdg) const
std::vector< std::vector< G4ReweightTraj * > > BuildHierarchy(int ID, int PDG, const sim::ParticleList &plist, art::ServiceHandle< geo::Geometry > geo_serv, int event, std::string material_name="LAr", bool fVerbose=false)
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)
Event finding and building.
std::vector< double > reco_beam_calo_endDirZ
std::vector< int > reco_daughter_allTrack_Chi2_ndof_muon
std::vector< double > reco_daughter_allShower_startZ
std::vector< double > reco_daughter_allTrack_momByRange_alt_proton
const double & GetCKov1Pressure() const
std::vector< double > reco_beam_calo_tick
double reco_beam_allTrack_endY
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allShower_startY
std::vector< double > reco_daughter_PFP_true_byHits_purity
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_startY
std::vector< double > true_beam_elastic_X
int reco_beam_allTrack_ID
std::vector< double > reco_daughter_allTrack_startY
void DaughterPFPInfo(const art::Event &evt, const recob::PFParticle *particle, detinfo::DetectorClocksData const &clockData, anab::MVAReader< recob::Hit, 4 > *hitResults)