1042 if( !
evt.isRealData() )
MC = 1;
1048 auto pfpVec =
evt.getValidHandle< std::vector< recob::PFParticle > >(
fPFParticleTag );
1103 double startX = tempTrack->
Start().X();
1104 double startY = tempTrack->
Start().Y();
1105 double startZ = tempTrack->
Start().Z();
1107 double endX = tempTrack->
End().X();
1108 double endY = tempTrack->
End().Y();
1109 double endZ = tempTrack->
End().Z();
1111 double start[3] = {startX, startY, startZ};
1112 double end[3] = {endX, endY, endZ};
1116 if (!((end_tpc == 1 || end_tpc == 5) &&
1117 (start_tpc == 1 || start_tpc == 5)))
1120 std::pair<double, int> vertex_michel_score =
1139 const sim::ParticleList & plist = pi_serv->
ParticleList();
1149 double pitch = geom->
WirePitch( 2, 1, 0);
1150 size_t nWires = geom->
Nwires( 2, 1, 0 );
1154 std::cout <<
"Pitch: " << pitch <<
std::endl;
1155 std::cout <<
"nWires: " << nWires <<
std::endl;
1158 std::cout <<
"APA 2 Z0: " << z0_APA2 <<
std::endl;
1163 if( !
evt.isRealData() ){
1164 auto mcTruths =
evt.getValidHandle<std::vector<simb::MCTruth>>(
fGeneratorTag);
1165 true_beam_particle = truthUtil.GetGeantGoodParticle((*mcTruths)[0],
evt);
1166 if( !true_beam_particle ){
1171 std::cout <<
"Got " << (*mcTruths)[0].NParticles() <<
1173 for (
int i = 0; i < (*mcTruths)[0].NParticles(); ++i) {
1185 if(
evt.isRealData() ){
1186 auto beamHandle =
evt.getValidHandle<std::vector<beam::ProtoDUNEBeamEvent>>(
fBeamModuleLabel);
1188 std::vector<art::Ptr<beam::ProtoDUNEBeamEvent>> beamVec;
1189 if( beamHandle.isValid()){
1202 int nMomenta = momenta.size();
1207 const std::vector<double> the_tofs = beamEvent.
GetTOFs();
1208 const std::vector<int> the_chans = beamEvent.
GetTOFChans();
1209 for (
size_t iTOF = 0; iTOF < the_tofs.size(); ++iTOF) {
1236 auto beamHandle =
evt.getValidHandle<std::vector<beam::ProtoDUNEBeamEvent>>(
"generator");
1238 std::vector<art::Ptr<beam::ProtoDUNEBeamEvent>> beamVec;
1239 if( beamHandle.isValid()){
1248 int nMomenta = momenta.size();
1251 std::cout <<
"Got beam event" <<
std::endl;
1252 std::cout <<
"Got " << nTracks <<
" Tracks" <<
std::endl;
1253 std::cout <<
"Got " << nMomenta <<
" Momenta" <<
std::endl;
1261 const std::vector<double> the_tofs = beamEvent.
GetTOFs();
1262 const std::vector<int> the_chans = beamEvent.
GetTOFChans();
1263 for (
size_t iTOF = 0; iTOF < the_tofs.size(); ++iTOF) {
1305 auto allHits =
evt.getValidHandle<std::vector<recob::Hit> >(
fHitTag);
1307 auto recoTracks =
evt.getValidHandle<std::vector<recob::Track> >(
fTrackerTag);
1310 auto recoShowers =
evt.getValidHandle< std::vector< recob::Shower > >(
fShowerTag);
1311 art::FindManyP<recob::Hit> findHitsFromShowers(recoShowers,
evt,
fShowerTag);
1313 std::map< int, std::vector< int > > trueToPFPs;
1322 if(beamParticles.size() == 0){
1323 std::cout <<
"We found no beam particles for this event... moving on" <<
std::endl;
1327 std::cout <<
"Found " << beamParticles.size() <<
" particles" <<
std::endl;
1337 if( !
evt.isRealData() ){
1372 double matched_hits = 0.;
1373 for(
size_t j = 0; j < list.size(); ++j ){
1379 if( list[j].particle == beam_match.
particle ){
1380 matched_hits = list[j].nSharedHits + list[j].nSharedDeltaRayHits;
1383 total += list[j].nSharedHits + list[j].nSharedDeltaRayHits;
1390 trueParticle = truthUtil.GetMCParticleFromPFParticle(clockData, *particle,
evt,
fPFParticleTag);
1394 if( trueParticle->
TrackId() == true_beam_particle->TrackId() ){
1443 size_t true_np = true_beam_particle->NumberTrajectoryPoints();
1460 for(
size_t i = 0; i < trueToPFPs[
true_beam_ID ].size(); ++i ){
1477 if( pandora2Track ){
1492 for(
auto itProc = true_beam_proc_map.begin(); itProc != true_beam_proc_map.end(); ++itProc ){
1493 int index = itProc->first;
1499 if( process ==
"hadElastic" ){
1503 double process_X = true_beam_trajectory.
X( index );
1504 double process_Y = true_beam_trajectory.
Y( index );
1505 double process_Z = true_beam_trajectory.
Z( index );
1507 double PX = true_beam_trajectory.
Px( index );
1508 double next_PX = true_beam_trajectory.
Px( index + 1 );
1509 double PY = true_beam_trajectory.
Py( index );
1510 double next_PY = true_beam_trajectory.
Py( index + 1 );
1511 double PZ = true_beam_trajectory.
Pz( index );
1512 double next_PZ = true_beam_trajectory.
Pz( index + 1 );
1514 double total_P = sqrt( PX*PX + PY*PY + PZ*PZ );
1515 double total_next_P = sqrt( next_PX*next_PX + next_PY*next_PY + next_PZ*next_PZ );
1519 ( ( PX * next_PX ) + ( PY * next_PY ) + ( PZ * next_PZ ) ) / ( total_P * total_next_P )
1522 double mass = 139.57;
1529 double total_E = sqrt(total_P*total_P*1.e6 + mass*mass);
1530 double total_next_E = sqrt(total_next_P*total_next_P*1.e6 + mass*mass);
1538 std::vector<const sim::IDE *> ides_between_points =
1539 truthUtil.GetSimIDEsBetweenPoints(
1540 *true_beam_particle, true_beam_trajectory.
Position(index),
1541 true_beam_trajectory.
Position(index +1));
1543 double total_edep = 0.;
1544 for (
size_t i = 0; i < ides_between_points.size(); ++i) {
1545 total_edep += ides_between_points[i]->energy;
1562 std::sort( view2_IDEs.begin(), view2_IDEs.end(),
sort_IDEs );
1567 size_t remove_index = 0;
1568 bool do_remove =
false;
1569 if( view2_IDEs.size() ){
1570 for(
size_t i = 1; i < view2_IDEs.size()-1; ++i ){
1571 const sim::IDE * prev_IDE = view2_IDEs[i-1];
1572 const sim::IDE * this_IDE = view2_IDEs[i];
1579 if( this_IDE->
trackID < 0 && ( this_IDE->
z - prev_IDE->
z ) > 5 ){
1588 view2_IDEs.erase( view2_IDEs.begin() + remove_index, view2_IDEs.end() );
1592 double mass = 139.57;
1630 if (sliced_ides.size()) {
1631 auto first_slice = sliced_ides.begin();
1635 auto theIDEs = first_slice->second;
1637 if (theIDEs.size()) {
1639 double ide_z = theIDEs[0]->z;
1644 for (
size_t i = 1; i < true_beam_trajectory.
size(); ++i) {
1645 double z0 = true_beam_trajectory.
Z(i-1);
1646 double z1 = true_beam_trajectory.
Z(i);
1648 if (z0 < ide_z && z1 > ide_z) {
1649 init_KE = 1.e3 * true_beam_trajectory.
E(i-1) - mass;
1651 std::cout <<
"Found matching position" << z0 <<
" " << ide_z <<
1653 std::cout <<
"init KE: " << init_KE <<
std::endl;
1663 for(
auto it = sliced_ides.begin(); it != sliced_ides.end(); ++it ){
1665 auto theIDEs = it->second;
1671 for(
size_t i = 0; i < theIDEs.size(); ++i ){
1672 deltaE += theIDEs[i]->energy;
1682 for (
size_t i = 0; i < true_beam_trajectory.
size(); ++i) {
1691 for(
int i = 0; i < true_beam_particle->NumberDaughters(); ++i ){
1692 int daughterID = true_beam_particle->Daughter(i);
1694 if (
fVerbose) std::cout <<
"Daughter " << i <<
" ID: " << daughterID <<
std::endl;
1695 auto part = plist[ daughterID ];
1700 if (process ==
"muIoni" || process ==
"hIoni")
1726 std::cout <<
"PID: " << pid <<
std::endl;
1732 if( part->
Process().find(
"Inelastic" ) != std::string::npos ){
1745 int pi0_decay_daughter_ID = part->
Daughter(j);
1746 auto pi0_decay_part = plist[ pi0_decay_daughter_ID ];
1780 for(
size_t k = 0;
k < trueToPFPs[ pi0_decay_part->TrackId() ].size(); ++
k ){
1783 const recob::PFParticle * thePFP = &(pfpVec->at( trueToPFPs[ pi0_decay_part->TrackId() ][
k] ));
1799 if( pandora2Track ){
1829 if( pandora2Shower ){
1851 int grand_daughter_ID = part->
Daughter(j);
1852 auto grand_daughter_part = plist[ grand_daughter_ID ];
1882 for(
size_t j = 0; j < trueToPFPs[ part->
TrackId() ].size(); ++j ){
1901 if( pandora2Track ){
1931 if( pandora2Shower ){
1961 if( cnn.nHits > 0 ){
1973 if( cnn_collection.nHits > 0 ){
2000 std::pair<double, int> vertex_michel_score =
2007 if (
fVerbose) std::cout <<
"Beam particle is track-like " << thisTrack->
ID() <<
std::endl;
2056 thisTrack->
Length(), 2212);
2058 thisTrack->
Length(), 13);
2070 if( ( pt.X() - -999. ) < 1.e-6 )
continue;
2072 TVector3
p( pt.X(), pt.Y(), pt.Z() );
2077 if( i < thisTrack->NumberTrajectoryPoints() - 1 ){
2079 if( ( next_pt.X() - -999. ) > 1.e-6 ){
2081 TVector3 next_p( next_pt.X(), next_pt.Y(), next_pt.Z() );
2082 double segment = ( next_p -
p ).Mag();
2088 std::map< const recob::Hit *, int > hitsToSlices;
2089 std::map< int, std::vector< const recob::Hit * > > slicesToHits;
2097 std::vector<int> view_0_TPC;
2098 std::vector<int> view_1_TPC;
2099 std::vector<int> view_2_TPC;
2101 for(
auto it = trajPtsToHits.begin(); it != trajPtsToHits.end(); ++it ){
2104 size_t i = it->first;
2118 int slice = std::floor(
2120 hitsToSlices[theHit] = slice;
2121 slicesToHits[slice].push_back(theHit);
2130 switch( theHit->
View() ){
2136 view_0_TPC.push_back( theHit->
WireID().
TPC );
2143 view_1_TPC.push_back( theHit->
WireID().
TPC );
2151 view_2_TPC.push_back( theHit->
WireID().
TPC );
2193 bool found_calo =
false;
2195 for ( index = 0; index <
calo.size(); ++
index) {
2201 std::cout <<
"Cali index " << index <<
std::endl;
2212 auto calo_range =
calo[
index].ResidualRange();
2213 auto TpIndices =
calo[
index].TpIndices();
2217 size_t this_index = 0;
2218 for ( this_index = 0; this_index < pandoracalo.size(); ++this_index) {
2219 if (pandoracalo[this_index].
PlaneID().Plane == 2) {
2224 TpIndices = pandoracalo[this_index].TpIndices();
2225 std::cout <<
"pandoracalo hits " << pandoracalo[this_index].dQdx().size() <<
std::endl;
2227 std::cout << calo_dQdX.size() <<
std::endl;
2231 std::vector< size_t > calo_hit_indices;
2232 for(
size_t i = 0; i < calo_dQdX.size(); ++i ){
2239 const recob::Hit & theHit = (*allHits)[ TpIndices[i] ];
2251 calo_hit_indices.push_back( TpIndices[i] );
2254 geom->
Wire(theHit.
WireID()).GetCenter().Z());
2257 std::cout << theXYZPoints[i].X() <<
" " << theXYZPoints[i].Y() <<
" " <<
2258 theXYZPoints[i].Z() <<
" " << theHit.
WireID().
Wire <<
" " <<
2259 geom->
Wire(theHit.
WireID()).GetCenter().Z() <<
" " <<
2264 std::sort(theXYZPoints.begin(), theXYZPoints.end(), [](
auto a,
auto b)
2265 {
return (
a.Z() <
b.Z());});
2268 if (theXYZPoints.size()) {
2276 TVector3
dir((theXYZPoints.back().X() - theXYZPoints[0].X()),
2277 (theXYZPoints.back().Y() - theXYZPoints[0].Y()),
2278 (theXYZPoints.back().Z() - theXYZPoints[0].Z()));
2295 if (theXYZPoints.size() > 1) {
2296 TVector3 start_p1(theXYZPoints[0].
X(),
2297 theXYZPoints[0].
Y(), theXYZPoints[0].
Z());
2298 TVector3 start_p2(theXYZPoints[1].
X(),
2299 theXYZPoints[1].
Y(), theXYZPoints[1].
Z());
2300 TVector3 start_diff = start_p2 - start_p1;
2306 size_t nPoints = theXYZPoints.size();
2307 TVector3 end_p1(theXYZPoints[nPoints - 2].
X(),
2308 theXYZPoints[nPoints - 2].
Y(), theXYZPoints[nPoints - 2].
Z());
2309 TVector3 end_p2(theXYZPoints[nPoints - 1].
X(),
2310 theXYZPoints[nPoints - 1].
Y(), theXYZPoints[nPoints - 1].
Z());
2311 TVector3 end_diff = end_p2 - end_p1;
2326 if (theXYZPoints.size() > 2) {
2327 std::vector<TVector3>
input;
2328 for (
size_t iP = 0; iP < 3; ++iP) {
2329 input.push_back(TVector3(theXYZPoints[iP].
X(),
2330 theXYZPoints[iP].
Y(),
2331 theXYZPoints[iP].
Z()));
2334 TVector3 startDiff =
FitLine(input);
2339 std::vector<TVector3> end_input;
2340 size_t nPoints = theXYZPoints.size();
2341 for (
size_t iP = nPoints - 3; iP < nPoints; ++iP) {
2342 end_input.push_back(TVector3(theXYZPoints[iP].
X(),
2343 theXYZPoints[iP].
Y(),
2344 theXYZPoints[iP].
Z()));
2347 TVector3 endDiff =
FitLine(end_input);
2361 if (theXYZPoints.size() > 3) {
2362 std::vector<TVector3>
input;
2363 for (
size_t iP = 0; iP < 4; ++iP) {
2364 input.push_back(TVector3(theXYZPoints[iP].
X(),
2365 theXYZPoints[iP].
Y(),
2366 theXYZPoints[iP].
Z()));
2369 TVector3 startDiff =
FitLine(input);
2374 std::vector<TVector3> end_input;
2375 size_t nPoints = theXYZPoints.size();
2376 for (
size_t iP = nPoints - 4; iP < nPoints; ++iP) {
2377 end_input.push_back(TVector3(theXYZPoints[iP].
X(),
2378 theXYZPoints[iP].
Y(),
2379 theXYZPoints[iP].
Z()));
2382 TVector3 endDiff =
FitLine(end_input);
2399 std::cout <<
"Getting reco beam calo" <<
std::endl;
2403 std::cout <<
"got calibrated dedx" <<
std::endl;
2414 std::vector< calo_point > reco_beam_calo_points;
2421 reco_beam_calo_points.push_back(
2430 std::sort( reco_beam_calo_points.begin(), reco_beam_calo_points.end(), [](calo_point
a, calo_point
b) {
return ( a.z <
b.z );} );
2433 for(
size_t i = 0; i < reco_beam_calo_points.size(); ++i ){
2434 calo_point thePoint = reco_beam_calo_points[i];
2438 calo_hit_indices[i] = thePoint.hit_index;
2446 double init_KE = 0.;
2466 for(
size_t i = 0; i < reco_beam_calo_points.size() - 1; ++i ){
2474 if( !
evt.isRealData() ){
2479 std::vector< const sim::IDE * > true_ides_from_reco;
2480 for(
auto it = trajPtsToHits.begin(); it != trajPtsToHits.end(); ++it ){
2482 if( theHit->
View() != 2 )
continue;
2484 std::vector< const sim::IDE * > ides = bt_serv->
HitToSimIDEs_Ps( clockData, *theHit );
2485 for(
size_t i = 0; i < ides.size(); ++i ){
2488 true_ides_from_reco.push_back( ides[i] );
2493 if( true_ides_from_reco.size() ){
2494 std::sort( true_ides_from_reco.begin(), true_ides_from_reco.end(),
sort_IDEs );
2495 if (
fVerbose) std::cout <<
"Max IDE z: " << true_ides_from_reco.back()->z <<
std::endl;
2503 std::sort( view2_IDEs.begin(), view2_IDEs.end(),
sort_IDEs );
2505 size_t remove_index = 0;
2506 bool do_remove =
false;
2507 if( view2_IDEs.size() ){
2508 for(
size_t i = 1; i < view2_IDEs.size()-1; ++i ){
2509 const sim::IDE * prev_IDE = view2_IDEs[i-1];
2510 const sim::IDE * this_IDE = view2_IDEs[i];
2513 if( this_IDE->
trackID < 0 && ( this_IDE->
z - prev_IDE->
z ) > 5 ){
2522 view2_IDEs.erase( view2_IDEs.begin() + remove_index, view2_IDEs.end() );
2526 std::vector< int > found_slices;
2528 for(
auto it = sliced_ides.begin(); it != sliced_ides.end(); ++it ){
2530 auto theIDEs = it->second;
2533 bool slice_found =
false;
2534 for(
size_t i = 0; i < theIDEs.size(); ++i ){
2535 if( std::find( true_ides_from_reco.begin(), true_ides_from_reco.end(), theIDEs[i] ) != true_ides_from_reco.end() ){
2542 found_slices.push_back( it->first );
2549 std::cout <<
"Found " << found_slices.size() <<
"/" << sliced_ides.size() <<
" slices" <<
std::endl;
2550 std::cout <<
"Maximum true slice: " << (found_slices.size() ? sliced_ides.rbegin()->first : -999 ) << std::endl;
2551 std::cout <<
"Max found: " << (found_slices.size() ? found_slices.back() : -999 ) << std::endl;
2552 std::cout <<
"Testing hit to true slice matching" <<
std::endl;
2556 std::map< int, std::vector< std::pair<int, double> > > true_slice_to_reco_electrons;
2557 std::map< int, int > reco_beam_hit_to_true_ID;
2558 std::vector< int > reco_beam_hit_index;
2559 for(
size_t i = 0; i < reco_beam_calo_points.size(); ++i ){
2560 calo_point thePoint = reco_beam_calo_points[i];
2562 auto theHit = (*allHits)[thePoint.hit_index];
2564 reco_beam_hit_index.push_back( thePoint.hit_index );
2567 reco_beam_hit_to_true_ID[thePoint.hit_index] =
getTrueIDFromHit( clockData, theHit, bt_serv );
2571 if( theMap[0].first != -999 ){
2572 for(
size_t j = 0; j < theMap.size(); ++j ){
2573 true_slice_to_reco_electrons[theMap[j].first].push_back({thePoint.hit_index, theMap[j].second});
2578 bool all_good =
false;
2579 size_t maxTries = 5;
2584 while( !all_good && nTries < maxTries ){
2587 bool found_duplicate =
false;
2590 for(
auto it = true_slice_to_reco_electrons.begin(); it != true_slice_to_reco_electrons.end(); ++it ){
2593 if( it->first == -999 )
continue;
2597 std::vector< std::pair< int, double > > & reco_electrons = it->second;
2599 if(reco_electrons.size()){
2601 int maxHit = reco_electrons[0].first;
2602 double maxElectrons = reco_electrons[0].second;
2607 for(
auto it2 = true_slice_to_reco_electrons.begin(); it2 != true_slice_to_reco_electrons.end(); ++it2 ){
2610 if( it2->first == -999 )
continue;
2611 if( it->first == it2->first )
continue;
2615 if( it2->second.size() ){
2617 int maxHit2 = it2->second[0].first;
2618 double maxElectrons2 = it2->second[0].second;
2623 if( maxHit == maxHit2 ){
2627 found_duplicate =
true;
2629 if( maxElectrons < maxElectrons2 ){
2631 reco_electrons.erase( reco_electrons.begin(), reco_electrons.begin()+1 );
2643 all_good = !found_duplicate;
2648 std::map< int, int > reco_beam_hit_to_true_slice;
2656 if( true_slice_to_reco_electrons.find( slice ) != true_slice_to_reco_electrons.end() ){
2660 reco_beam_hit_to_true_slice[true_slice_to_reco_electrons[slice][0].first] = slice;
2664 int max_slice_found = -999;
2665 for(
size_t i = 0; i < reco_beam_calo_points.size(); ++i ){
2666 calo_point thePoint = reco_beam_calo_points[i];
2669 bool found_in_true_slices = ( reco_beam_hit_to_true_slice.find( thePoint.hit_index ) != reco_beam_hit_to_true_slice.end() );
2672 int true_id = reco_beam_hit_to_true_ID[thePoint.hit_index];
2675 reco_beam_hit_true_slice.push_back((found_in_true_slices ? reco_beam_hit_to_true_slice[thePoint.hit_index] : -999));
2678 if (reco_beam_hit_to_true_slice[thePoint.hit_index] > max_slice_found)
2679 max_slice_found = reco_beam_hit_to_true_slice[thePoint.hit_index];
2689 for(
auto itProc = true_beam_proc_map.begin(); itProc != true_beam_proc_map.end(); ++itProc ){
2690 int index = itProc->first;
2693 double process_X = true_beam_trajectory.
X( index );
2694 double process_Y = true_beam_trajectory.
Y( index );
2695 double process_Z = true_beam_trajectory.
Z( index );
2697 int slice_num = std::floor( ( process_Z - z0 ) / pitch );
2700 std::cout <<
"Process " << index <<
", " << process <<
"(" << process_X <<
","<< process_Y <<
","<< process_Z <<
")" <<
" at slice " << slice_num <<
std::endl;
2701 std::cout <<
"d(Slice) to max slice found: " << slice_num - max_slice_found <<
std::endl;
2711 int slice_num = std::floor( ( process_Z - z0 ) / pitch );
2714 std::cout <<
"Process " << -1 <<
", " <<
true_beam_endProcess <<
"(" << process_X <<
","<< process_Y <<
","<< process_Z <<
")" <<
" at slice " << slice_num <<
std::endl;
2715 std::cout <<
"d(Slice) to max slice found: " << slice_num - max_slice_found <<
std::endl;
2756 for(
size_t daughterID : particle->
Daughters() ){
2761 if (
fVerbose) std::cout <<
"Got " << daughterPFP_hits.size() <<
" hits from daughter " << daughterID <<
std::endl;
2764 size_t nHits_coll = 0;
2765 for (
size_t i = 0; i < daughterPFP_hits.size(); ++i) {
2766 if (daughterPFP_hits[i]->
View() == 2) {
2772 double track_total = 0.;
2773 double em_total = 0.;
2774 double michel_total = 0.;
2775 double none_total = 0.;
2776 for(
size_t h = 0;
h < daughterPFP_hits.size(); ++
h ){
2777 std::array<float,4> cnn_out = hitResults.getOutput( daughterPFP_hits[
h] );
2778 track_total += cnn_out[ hitResults.getIndex(
"track") ];
2779 em_total += cnn_out[ hitResults.getIndex(
"em") ];
2780 michel_total += cnn_out[ hitResults.getIndex(
"michel") ];
2781 none_total += cnn_out[ hitResults.getIndex(
"none") ];
2787 std::cout <<
"Testing new CNN: " <<
std::endl;
2788 std::cout << track_total <<
" " << theCNNResults.track <<
std::endl;
2789 std::cout << em_total <<
" " << theCNNResults.em <<
std::endl;
2790 std::cout << michel_total <<
" " << theCNNResults.michel <<
std::endl;
2791 std::cout << none_total <<
" " << theCNNResults.none <<
std::endl;
2797 if( daughterPFP_hits.size() > 0 ){
2809 if( cnn_collection.nHits > 0 ){
2822 if( !
evt.isRealData() ){
2864 double matched_hits = 0.;
2865 for(
size_t j = 0; j < list.size(); ++j ){
2869 if( list[j].particle == match.
particle ){
2870 matched_hits = list[j].nSharedHits + list[j].nSharedDeltaRayHits;
2873 total += list[j].nSharedHits + list[j].nSharedDeltaRayHits;
2878 double totalTruth = truthUtil.GetMCParticleHits( clockData, *match.
particle,
evt,
fHitTag).size();
2911 if( true_daughter_byE ){
2914 double purity = truthUtil.GetPurity( clockData, *daughterPFP,
evt,
fPFParticleTag);
2931 if( pandora2Track ){
2934 std::cout <<
"Getting calo for " << pandora2Track->
ID() <<
std::endl;
2936 auto dummy_caloSCE =
2939 std::cout << dummy_caloSCE.size() <<
std::endl;
2940 bool found_calo =
false;
2942 for ( index = 0; index < dummy_caloSCE.size(); ++
index) {
2943 if (dummy_caloSCE[index].
PlaneID().Plane == 2) {
2948 std::cout << index <<
" " << found_calo <<
std::endl;
2956 auto dummy_dEdx_SCE = dummy_caloSCE[
index].dEdx();
2957 auto dummy_dQdx_SCE = dummy_caloSCE[
index].dQdx();
2958 auto dummy_Range_SCE = dummy_caloSCE[
index].ResidualRange();
2966 for(
size_t j = 0; j < dummy_dEdx_SCE.size(); ++j ){
2972 for(
size_t j = 0; j < cali_dEdX_SCE.size(); ++j ){
2976 std::pair<double, int> this_chi2_ndof = trackUtil.
Chi2PID(
2992 size_t plane0_index = 0;
2993 bool found_plane0 =
false;
2994 for ( plane0_index = 0; plane0_index < dummy_caloSCE.size(); ++plane0_index) {
2995 std::cout << dummy_caloSCE[plane0_index].PlaneID().Plane <<
std::endl;
2996 if (dummy_caloSCE[plane0_index].
PlaneID().
Plane == 0) {
2997 found_plane0 =
true;
3001 size_t plane1_index = 0;
3002 bool found_plane1 =
false;
3003 for ( plane1_index = 0; plane1_index < dummy_caloSCE.size(); ++plane1_index) {
3004 std::cout << dummy_caloSCE[plane1_index].PlaneID().Plane <<
std::endl;
3005 if (dummy_caloSCE[plane1_index].
PlaneID().
Plane == 1) {
3006 found_plane1 =
true;
3011 std::cout <<
"Plane 0, 1 " << plane0_index <<
" " <<
3016 std::vector<double>());
3018 std::vector<double>());
3021 auto resRange_plane0 = dummy_caloSCE[plane0_index].ResidualRange();
3022 for (
size_t j = 0; j < resRange_plane0.size(); ++j) {
3024 resRange_plane0[j]);
3029 for (
size_t j = 0; j < dEdX_plane0.size(); ++j) {
3033 std::pair<double, int> plane0_chi2_ndof = trackUtil.
Chi2PID(
3037 plane0_chi2_ndof.first);
3039 plane0_chi2_ndof.second);
3050 std::vector<double>());
3053 std::vector<double>());
3056 auto resRange_plane1 = dummy_caloSCE[plane1_index].ResidualRange();
3060 for (
size_t j = 0; j < resRange_plane1.size(); ++j) {
3062 resRange_plane1[j]);
3065 for (
size_t j = 0; j < dEdX_plane1.size(); ++j) {
3070 std::pair<double, int> plane1_chi2_ndof = trackUtil.
Chi2PID(
3074 plane1_chi2_ndof.first);
3076 plane1_chi2_ndof.second);
3097 std::cout <<
"Getting michel" <<
std::endl;
3099 std::pair<double, int> vertex_results =
3101 *pandora2Track,
evt,
"pandora2Track",
fHitTag,
3102 0., -500., 500., 0., 500., 0.,
false,
3106 vertex_results.first);
3108 vertex_results.second);
3124 double to_start_of_daughter = sqrt(
3125 ( d_startX - max_X ) * ( d_startX - max_X ) +
3126 ( d_startY - max_Y ) * ( d_startY - max_Y ) +
3127 ( d_startZ - max_Z ) * ( d_startZ - max_Z )
3129 double to_end_of_daughter = sqrt(
3130 ( d_endX - max_X ) * ( d_endX - max_X ) +
3131 ( d_endY - max_Y ) * ( d_endY - max_Y ) +
3132 ( d_endZ - max_Z ) * ( d_endZ - max_Z )
3135 if ( to_end_of_daughter < to_start_of_daughter ){
3154 ( d_startX - X ) * ( d_startX - X ) +
3155 ( d_startY - Y ) * ( d_startY - Y ) +
3156 ( d_startZ - Z ) * ( d_startZ - Z )
3159 if( dr < dr_start ){
3165 ( d_endX - X ) * ( d_endX - X ) +
3166 ( d_endY - Y ) * ( d_endY - Y ) +
3167 ( d_endZ - Z ) * ( d_endZ - Z )
3178 if( dr_end < dr_start ){
3199 std::vector<double>());
3201 std::vector<double>());
3203 std::vector<double>());
3205 std::vector<double>());
3245 if( pandora2Shower ){
3257 const std::vector<art::Ptr<recob::Hit>> hits =
3259 *pandora2Shower,
evt,
"pandora2Shower");
3261 art::FindManyP<recob::SpacePoint> spFromHits(hits,
evt,
fHitTag);
3264 std::vector<double> x_vec, y_vec, z_vec;
3265 double total_y = 0.;
3267 std::vector<art::Ptr<recob::Hit>> good_hits;
3269 for (
size_t iHit = 0; iHit < hits.size(); ++iHit) {
3270 auto theHit = hits[iHit];
3271 if (theHit->
View() != 2)
continue;
3273 good_hits.push_back(theHit);
3275 double shower_hit_x = detProp.ConvertTicksToX(
3280 double shower_hit_z = geom->
Wire(theHit->
WireID()).GetCenter().Z();
3282 x_vec.push_back(shower_hit_x);
3283 z_vec.push_back(shower_hit_z);
3285 std::vector<art::Ptr<recob::SpacePoint>> sps = spFromHits.at(iHit);
3288 y_vec.push_back(sps[0]->XYZ()[1]);
3289 total_y += y_vec.back();
3294 y_vec.push_back(-999.);
3303 double total_shower_energy = 0.;
3304 for (
size_t iHit = 0; iHit < good_hits.size(); ++iHit) {
3305 auto theHit = good_hits[iHit];
3306 if (theHit->
View() != 2)
continue;
3308 if (y_vec[iHit] < -100.)
3309 y_vec[iHit] = total_y / n_good_y;
3312 good_hits[iHit], x_vec[iHit], y_vec[iHit], z_vec[iHit]);
3342 std::map< int, std::pair< double, double > > UpperCosmicROILimits, LowerCosmicROILimits;
3343 std::map< int, int > wire_to_n_ticks;
3344 std::map< int, double > wire_to_avg_ticks;
3345 bool inTPC1 =
false;
3347 if( view_2_TPC[i] != 1 )
continue;
3356 double max_tick = 0.;
3357 double min_tick = 99999.;
3358 for(
auto it = wire_to_n_ticks.begin(); it != wire_to_n_ticks.end(); ++it ){
3359 wire_to_avg_ticks[ it->first ] /= it->second;
3361 if( wire_to_avg_ticks[ it->first ] > max_tick ){
3362 max_tick = wire_to_avg_ticks[ it->first ];
3364 if( wire_to_avg_ticks[ it->first ] < min_tick ){
3365 min_tick = wire_to_avg_ticks[ it->first ];
3372 std::vector< double > these_wires, these_ticks;
3374 for(
auto it = wire_to_avg_ticks.begin(); it != wire_to_avg_ticks.end(); ++it ){
3375 these_wires.push_back( it->first );
3376 these_ticks.push_back( it->second );
3378 TGraph gr_wire_ticks( these_wires.size(), &these_wires[0], &these_ticks[0] );
3383 for(
size_t i = 0; i < pfpVec->size(); ++i ){
3386 if( &(*pfpVec)[i] == particle )
continue;
3388 int nUpperCosmicROI = 0;
3389 int nLowerCosmicROI = 0;
3394 bool found_new =
false;
3397 if( !
evt.isRealData() )
3401 for(
size_t j = 0; j < planeHits.size(); ++j ){
3402 auto theHit = planeHits[j];
3405 if(
int(theHit->
WireID().
Wire) > wire_to_avg_ticks.begin()->first &&
int(theHit->
WireID().
Wire) < wire_to_avg_ticks.rbegin()->first &&
3410 std::cout <<
"\tBeam: " << gr_wire_ticks.Eval( theHit->
WireID().
Wire ) << std::endl;
3422 if( !found_new && !
evt.isRealData() ){
3425 std::vector< const sim::IDE * > ides = bt_serv->
HitToSimIDEs_Ps( clockData, *theHit );
3426 for(
size_t j = 0; j < ides.size(); ++j ){
3443 std::cout <<
"NHits in Upper ROI: " << nUpperCosmicROI <<
std::endl;
3444 std::cout <<
"NHits in Lower ROI: " << nLowerCosmicROI <<
std::endl;
3447 if( nLowerCosmicROI || nUpperCosmicROI ){
3457 if( !
evt.isRealData() ){
3459 for(
size_t i = 0; i < planeHits.size(); ++i ){
3460 auto theHit = planeHits[i];
3463 std::vector< const sim::IDE * > ides = bt_serv->
HitToSimIDEs_Ps( clockData, *theHit );
3464 for(
size_t j = 0; j < ides.size(); ++j ){
3477 else if( thisShower ){
3482 std::cout <<
"Beam particle is shower-like" <<
std::endl;
3496 if( pandora2Track ){
3541 bool found_plane =
false;
3542 for (index = 0; index <
calo.size(); ++
index) {
3550 auto calo_range =
calo[
index].ResidualRange();
3551 for(
size_t i = 0; i < calo_range.size(); ++i ){
3600 bool created =
CreateRWTraj(*true_beam_particle, plist,
3601 fGeometryService,
event, &theTraj);
3602 if (created && theTraj.GetNSteps() > 0) {
3606 std::vector<double> weights_vec =
MultiRW->GetWeightFromAll1DThrows(
3608 std::cout << weights_vec.size() <<
std::endl;
3610 weights_vec.begin(), weights_vec.end());
3616 for (
size_t i = 0; i <
ParSet.size(); ++i) {
3617 std::pair<double, double> pm_weights =
3618 MultiRW->GetPlusMinusSigmaParWeight(theTraj, i);
3628 *true_beam_particle, plist,
3629 fGeometryService,
event);
3632 for (
size_t i = 0; i < trajs.size(); ++i) {
3633 if (trajs[i]->GetNSteps() > 0) {
3635 for (
size_t j = 0; j <
ParSet.size(); ++j) {
3636 std::pair<double, double> pm_weights =
3637 MultiRW->GetPlusMinusSigmaParWeight((*trajs[i]), j);
3658 *true_beam_particle, plist,
3659 fGeometryService,
event);
3662 for (
size_t i = 0; i < trajs.size(); ++i) {
3663 if (trajs[i]->GetNSteps() > 0) {
3665 for (
size_t j = 0; j <
ParSet.size(); ++j) {
3666 std::pair<double, double> pm_weights =
3667 ProtMultiRW->GetPlusMinusSigmaParWeight((*trajs[i]), j);
double E(const int i=0) const
std::vector< double > reco_daughter_allShower_dirX
TrackID_t trackID
Geant4 supplied track ID.
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
std::vector< std::vector< double > > reco_daughter_allTrack_resRange_plane0
std::vector< int > reco_daughter_allTrack_Chi2_ndof_plane0
double true_beam_interactingEnergy
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allShower_len
std::vector< int > reco_daughter_PFP_true_byHits_origin
double quality_reco_view_0_max_segment
int true_daughter_nPiMinus
double reco_beam_momByRange_alt_proton
double reco_beam_true_byE_endPx
std::vector< std::vector< int > > true_beam_daughter_reco_byHits_allTrack_ID
unsigned int NumberTrajectoryPoints() const
std::vector< int > true_beam_slices
std::vector< double > true_beam_Pi0_decay_startPx
const std::vector< size_t > & Daughters() const
Returns the collection of daughter particles.
int reco_beam_allTrack_Chi2_ndof
std::vector< int > reco_daughter_allTrack_ID
const TVector3 & ShowerStart() const
double reco_beam_allTrack_trackEndDirX
const TLorentzVector & Position(const int i=0) const
double Z(const size_type i) const
double X(const size_type i) const
std::vector< int > true_beam_Pi0_decay_ID
float z
z position of ionization [cm]
std::vector< double > reco_daughter_allTrack_endX
int true_daughter_nProton
double reco_beam_true_byE_startPy
double true_beam_startDirZ
std::vector< std::string > true_beam_grand_daughter_Process
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_PFP_trackScore
double reco_beam_PFP_michelScore
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_endX
protoana::ProtoDUNEBeamCuts beam_cuts
std::vector< int > reco_daughter_PFP_true_byHits_ID
bool quality_reco_view_1_hits_in_TPC5
double Py(const int i=0) const
std::vector< int > true_beam_Pi0_decay_parID
double reco_beam_trackDirZ
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_endX
double reco_beam_allTrack_trackDirY
std::vector< double > reco_daughter_allTrack_momByRange_alt_proton
int reco_beam_true_byE_PDG
std::vector< std::string > true_beam_grand_daughter_endProcess
double reco_beam_calo_startY
const std::vector< double > & GetTOFs() const
std::vector< std::vector< double > > reco_daughter_allTrack_dQdX_SCE
std::vector< std::string > reco_daughter_PFP_true_byHits_process
std::vector< double > reco_track_startY
std::vector< std::string > true_beam_daughter_Process
const TLorentzVector & EndPosition() const
std::vector< double > reco_daughter_PFP_true_byHits_endZ
double reco_beam_true_byHits_endE
bool quality_reco_view_0_hits_in_TPC5
std::vector< int > true_beam_process_dSlice
double reco_beam_true_byHits_endPy
size_t Self() const
Returns the index of this particle.
std::vector< double > reco_beam_dEdX
double reco_beam_true_byE_endP
std::vector< std::vector< int > > true_beam_Pi0_decay_reco_byHits_allTrack_ID
double reco_beam_calo_endY
double E(const size_type i) const
std::vector< double > reco_daughter_PFP_true_byHits_startPy
protoana::ProtoDUNEBeamlineUtils fBeamlineUtils
std::vector< double > reco_daughter_PFP_trackScore_collection
double true_beam_startDirY
double reco_beam_allTrack_endY
std::vector< std::string > reco_daughter_PFP_true_byHits_endProcess
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_startZ
std::vector< int > data_BI_PDG_candidates
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.
std::vector< double > reco_daughter_allTrack_endZ
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
std::string true_beam_endProcess
std::string reco_beam_true_byHits_process
const simb::MCTrajectory & Trajectory() const
std::vector< std::string > true_beam_daughter_endProcess
geo::WireID WireID() const
const recob::TrackTrajectory & Trajectory() const
Access to the stored recob::TrackTrajectory.
double reco_beam_true_byHits_endPx
double reco_beam_allTrack_trackDirX
std::vector< double > reco_daughter_allTrack_startZ
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.
double reco_beam_true_byE_endPz
std::vector< double > g4rw_primary_weights
double Pz(const size_type i) const
std::vector< double > reco_daughter_PFP_true_byHits_len
cnnOutput2D GetCNNOutputFromPFParticle(const recob::PFParticle &part, const art::Event &evt, const anab::MVAReader< recob::Hit, 4 > &CNN_results, protoana::ProtoDUNEPFParticleUtils &pfpUtil, std::string fPFParticleTag)
simb::Origin_t Origin() const
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)
std::vector< double > true_beam_incidentEnergies
std::vector< double > quality_reco_view_0_tick
std::vector< double > g4rw_alt_primary_minus_sigma_weight
std::string KeyToProcess(unsigned char const &key) const
std::map< int, TProfile * > templates
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)
double Px(const int i=0) const
double reco_beam_PFP_emScore
std::vector< int > true_beam_process_slice
protoana::ProtoDUNECalibration calibration
std::vector< double > reco_daughter_allTrack_len
std::vector< double > data_BI_TOF
double reco_beam_allTrack_trackEndDirZ
std::vector< double > true_beam_traj_Y
double quality_reco_view_2_max_segment
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
std::vector< double > reco_daughter_allTrack_Chi2_proton_plane0
std::vector< double > true_beam_Pi0_decay_startZ
std::vector< std::string > g4rw_primary_var
int true_daughter_nNucleus
std::string fGeneratorTag
std::vector< double > true_beam_daughter_endY
std::vector< const sim::IDE * > TrackIdToSimIDEs_Ps(int const &id) const
std::vector< std::vector< int > > true_beam_Pi0_decay_reco_byHits_PFP_nHits
std::string fPFParticleTag
std::vector< double > true_beam_elastic_IDE_edep
std::vector< double > reco_track_endY
std::vector< double > true_beam_daughter_startX
std::vector< double > reco_track_startX
double quality_reco_view_0_wire_backtrack
std::vector< double > true_beam_daughter_startPx
int reco_beam_vertex_slice
std::vector< std::vector< int > > true_beam_reco_byHits_allTrack_ID
geo::View_t View() const
View for the plane of the hit.
std::string reco_beam_true_byE_process
WireID_t Wire
Index of the wire within its plane.
double quality_reco_max_lateral
std::vector< std::vector< int > > true_beam_Pi0_decay_reco_byHits_PFP_ID
std::vector< std::pair< int, double > > getTrueSliceListFromRecoHit_electrons(detinfo::DetectorClocksData const &clockData, const recob::Hit &hit, art::ServiceHandle< cheat::BackTrackerService > bt, const std::map< int, std::vector< const sim::IDE * > > &true_slices, int beam_id)
std::vector< int > reco_daughter_allTrack_vertex_nHits
std::vector< G4ReweightTraj * > CreateNRWTrajs(const simb::MCParticle &part, const sim::ParticleList &plist, art::ServiceHandle< geo::Geometry > geo_serv, int event)
std::vector< double > reco_daughter_PFP_trackScore
std::vector< int > true_beam_daughter_PDG
TVector3 FitLine(const std::vector< TVector3 > &input)
double reco_beam_true_byE_endPy
double reco_beam_momByRange_alt_muon
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_endZ
std::vector< double > quality_reco_view_0_wire
BR-MS.
std::vector< double > true_beam_Pi0_decay_startP
std::string Process() const
std::vector< double > reco_beam_calo_startDirZ
std::vector< int > true_beam_daughter_nHits
std::vector< double > true_beam_Pi0_decay_startPy
std::vector< double > reco_daughter_PFP_michelScore
std::vector< int > reco_track_ID
int getTrueIDFromHit(detinfo::DetectorClocksData const &clockData, const recob::Hit &hit, art::ServiceHandle< cheat::BackTrackerService > bt)
int true_daughter_nNeutron
std::vector< double > reco_daughter_PFP_true_byHits_completeness
std::vector< int > cosmic_has_beam_IDE
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)
std::vector< double > reco_daughter_PFP_true_byE_completeness
std::vector< double > true_beam_daughter_len
double reco_beam_trackDirX
int NumberDaughters() const
unsigned int Nwires(unsigned int p, unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wires in the specified plane.
G4MultiReweighter * ProtMultiRW
std::vector< int > true_beam_process_matched
std::vector< double > reco_beam_incidentEnergies
std::vector< size_t > reco_daughter_PFP_true_byHits_sharedHits
EDIT: quality.
std::vector< double > reco_beam_calo_tick
int Daughter(const int i) const
std::vector< double > reco_track_endX
double quality_reco_max_segment
std::vector< size_t > reco_daughter_PFP_true_byHits_emHits
std::string reco_beam_true_byHits_endProcess
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< std::vector< double > > true_beam_Pi0_decay_reco_byHits_PFP_trackScore
std::vector< double > true_beam_daughter_startZ
std::vector< double > reco_beam_dQdX
std::vector< double > true_beam_Pi0_decay_startPz
double quality_reco_view_1_wire_backtrack
geo::TPCID FindTPCAtPosition(double const worldLoc[3]) const
Returns the ID of the TPC at specified location.
double reco_beam_trackEndDirX
std::vector< std::vector< double > > reco_daughter_allTrack_calibrated_dEdX_SCE_plane0
std::vector< double > reco_beam_spacePts_Y
std::vector< std::vector< double > > reco_daughter_allTrack_dEdX_SCE
std::vector< double > reco_daughter_allTrack_momByRange_alt_muon
double HitToEnergy(const art::Ptr< recob::Hit > hit, double X, double Y, double Z, double recomb_factor=.6417)
G4MultiReweighter * MultiRW
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allShower_len
std::vector< std::vector< double > > reco_daughter_allTrack_calibrated_dEdX_SCE_plane1
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_len
int reco_beam_true_byHits_origin
double reco_beam_true_byHits_startPy
double reco_beam_true_byE_endE
const std::vector< art::Ptr< recob::Hit > > GetRecoShowerArtHits(const recob::Shower &shower, art::Event const &evt, const std::string showerModule) const
std::vector< double > true_beam_elastic_costheta
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allShower_startY
Vector_t StartDirection() const
Access to track direction at different points.
bool reco_beam_allTrack_beam_cuts
std::vector< double > reco_daughter_allTrack_momByRange_proton
Reconstructed Daughter Info.
double Length(size_t p=0) const
Access to various track properties.
std::vector< double > reco_daughter_PFP_true_byHits_startP
double reco_beam_true_byE_startP
double Y(const size_type i) const
std::vector< double > reco_daughter_PFP_true_byHits_startX
std::vector< double > reco_daughter_PFP_emScore
std::vector< double > quality_reco_view_2_tick
std::vector< double > reco_daughter_allShower_dirY
std::vector< double > reco_daughter_PFP_true_byHits_purity
std::string EndProcess() const
double reco_beam_true_byE_startPz
std::vector< double > reco_daughter_PFP_true_byHits_endX
Point_t const & Start() const
Access to track position at different points.
const std::vector< short > & GetActiveFibers(std::string) const
std::vector< double > quality_reco_view_1_wire
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allShower_startZ
double reco_beam_vertex_michel_score
std::vector< double > g4rw_primary_plus_sigma_weight
Ionization at a point of the TPC sensitive volume.
const std::vector< double > & GetRecoBeamMomenta() const
double reco_beam_true_byE_startPx
T LocationAtPoint(unsigned int p) const
Position at point p. Use e.g. as:
const art::Ptr< simb::MCTruth > & TrackIdToMCTruth_P(int id) const
double reco_beam_allTrack_startZ
double Theta() const
Access to spherical or geographical angles at vertex or at any point.
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_startZ
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allShower_startX
double reco_beam_calo_startZ
std::vector< std::string > true_beam_processes
double reco_beam_PFP_emScore_collection
std::vector< double > true_beam_elastic_deltaE
std::vector< double > reco_daughter_allShower_dirZ
std::vector< double > true_beam_daughter_startP
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.
std::vector< int > reco_daughter_PFP_true_byHits_parID
float energy
energy deposited by ionization by this track ID and time [MeV]
bool CreateRWTraj(const simb::MCParticle &part, const sim::ParticleList &plist, art::ServiceHandle< geo::Geometry > geo_serv, int event, G4ReweightTraj *theTraj)
double reco_beam_allTrack_endZ
std::vector< double > reco_daughter_PFP_true_byHits_startPz
double reco_beam_true_byHits_endPz
std::vector< double > g4rw_alt_primary_plus_sigma_weight
std::vector< double > reco_beam_spacePts_Z
std::vector< int > true_beam_grand_daughter_PDG
std::vector< std::vector< int > > true_beam_reco_byHits_PFP_ID
double reco_beam_true_byE_startE
std::vector< double > reco_beam_TrkPitch
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allShower_startX
std::vector< double > reco_daughter_allTrack_momByRange_muon
std::vector< double > reco_beam_cosmic_candidate_lower_hits
int reco_beam_true_byHits_ID
std::vector< double > true_beam_elastic_X
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_startY
std::vector< double > true_beam_daughter_startY
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_endY
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_endY
std::vector< int > reco_daughter_PFP_true_byHits_parPDG
bool sort_IDEs(const sim::IDE *i1, const sim::IDE *i2)
std::vector< double > reco_daughter_PFP_true_byHits_endY
std::vector< int > reco_beam_calo_TPC
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< double > reco_beam_resRange
const TVector3 & Direction() const
bool IsGoodBeamlineTrigger(art::Event const &evt) const
std::vector< double > reco_daughter_PFP_michelScore_collection
bool reco_beam_true_byE_matched
std::vector< double > reco_beam_spacePts_X
Reconstructed Daughter Info.
const std::vector< const recob::SpacePoint * > GetPFParticleSpacePoints(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel) const
double reco_beam_true_byHits_startPz
std::string fCalorimetryTag
static int max(int a, int b)
int reco_beam_true_byE_origin
PlaneID_t Plane
Index of the plane within its TPC.
std::vector< double > true_beam_traj_KE
std::vector< double > reco_beam_calibrated_dEdX
std::vector< int > reco_beam_hit_true_origin
double reco_beam_trackEndDirZ
std::vector< std::vector< int > > true_beam_daughter_reco_byHits_allShower_ID
bool reco_beam_passes_beam_cuts
std::vector< int > true_beam_slices_found
std::vector< double > reco_beam_allTrack_calibrated_dEdX
std::vector< int > reco_daughter_PFP_true_byE_PDG
const TLorentzVector & Position(const size_type) const
The accessor methods described above.
ProcessMap const & TrajectoryProcesses() const
int true_daughter_nPiPlus
std::vector< double > reco_daughter_allShower_len
std::vector< double > reco_track_endZ
std::vector< double > reco_daughter_allShower_startZ
std::vector< int > reco_track_nHits
std::vector< int > reco_daughter_allShower_ID
std::vector< int > true_beam_grand_daughter_ID
size_t nSharedDeltaRayHits
std::vector< double > reco_daughter_allTrack_Chi2_proton
std::vector< double > quality_reco_view_2_z
std::vector< std::vector< double > > reco_daughter_allTrack_calibrated_dEdX_SCE
double reco_beam_allTrack_trackDirZ
const sim::ParticleList & ParticleList() const
std::vector< int > reco_daughter_PFP_ID
Add by hits?
std::pair< double, int > Chi2PID(const std::vector< double > &track_dedx, const std::vector< double > &range, TProfile *profile)
std::vector< std::vector< int > > true_beam_Pi0_decay_reco_byHits_allShower_ID
double reco_beam_true_byHits_startE
std::vector< double > reco_daughter_allTrack_Theta
std::vector< double > reco_track_michel_score
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
std::vector< std::vector< double > > reco_daughter_allTrack_resRange_SCE
double reco_beam_allTrack_Chi2_proton
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allShower_startZ
const std::vector< const recob::Hit * > GetRecoTrackHitsFromPlane(const recob::Track &track, art::Event const &evt, const std::string trackModule, unsigned int planeID) const
Get the hits from a given reco track from a specific plane.
std::vector< int > reco_daughter_PFP_true_byHits_PDG
double reco_beam_PFP_trackScore_collection
Defines an enumeration for cellhit classification.
std::vector< double > true_beam_Pi0_decay_len
WireGeo const & Wire(geo::WireID const &wireid) const
Returns the specified wire.
std::vector< double > reco_track_startZ
float PeakTime() const
Time of the signal peak, in tick units.
int reco_beam_allTrack_ID
std::vector< int > reco_daughter_allTrack_Chi2_ndof_plane1
std::vector< int > GetPID(beam::ProtoDUNEBeamEvent const &beamevt, double nominal_momentum)
double reco_beam_true_byHits_endP
std::vector< double > reco_daughter_allTrack_startY
const simb::MCParticle * particle
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allShower_startY
int reco_beam_vertex_nHits
Hierarchical representation of particle flow.
double reco_beam_true_byHits_startPx
std::vector< double > reco_daughter_PFP_true_byHits_startY
const std::vector< int > & GetTOFChans() const
double reco_beam_momByRange_proton
std::vector< double > reco_beam_calo_wire_z
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
std::vector< int > true_beam_daughter_ID
std::vector< std::vector< int > > true_beam_reco_byHits_PFP_nHits
double reco_beam_calo_startX
double TotalLength() const
std::vector< double > reco_daughter_allShower_energy
std::vector< int > reco_daughter_PFP_nHits_collection
std::vector< double > true_beam_daughter_endZ
std::vector< fhicl::ParameterSet > ParSet
std::vector< int > reco_daughter_allTrack_Chi2_ndof
double reco_beam_trackDirY
double reco_beam_PFP_trackScore
std::vector< int > reco_beam_hit_true_slice
Vector_t EndDirection() const
std::vector< double > reco_beam_calo_endDirX
std::vector< double > true_beam_daughter_endX
std::vector< double > quality_reco_view_1_tick
std::vector< double > reco_daughter_PFP_true_byHits_startE
Point_t const & End() const
Returns the position of the last valid point of the trajectory [cm].
int true_beam_nElasticScatters
std::vector< double > reco_daughter_PFP_true_byE_purity
std::vector< double > reco_daughter_allShower_startX
double Pz(const int i=0) const
std::vector< double > reco_beam_cosmic_candidate_upper_hits
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_traj_Z
double reco_beam_PFP_michelScore_collection
std::vector< double > reco_daughter_allTrack_Chi2_proton_plane1
double reco_beam_calo_endX
std::vector< int > reco_beam_hit_true_ID
std::vector< double > true_beam_Pi0_decay_startX
bool quality_reco_view_2_hits_in_TPC5
std::vector< double > true_beam_daughter_startPy
const TVector3 GetPFParticleSecondaryVertex(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel, const std::string trackLabel) const
Function to find the secondary interaction vertex of a primary PFParticle.
Point_t const & End() const
const std::vector< recob::Track > & GetBeamTracks() const
double Px(const size_type i) const
detail::Node< FrameID, bool > PlaneID
std::vector< int > true_beam_Pi0_decay_nHits
std::vector< std::vector< double > > reco_daughter_allTrack_resRange_plane1
std::vector< double > reco_daughter_allTrack_vertex_michel_score
std::vector< double > true_beam_elastic_Z
std::vector< int > reco_beam_cosmic_candidate_ID
std::vector< int > true_beam_grand_daughter_nHits
double reco_beam_momByRange_muon
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_len
bool reco_beam_allTrack_flipped
std::vector< double > true_beam_slices_deltaE
const std::vector< const recob::Hit * > GetPFParticleHitsFromPlane(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel, unsigned int planeID) const
std::vector< const sim::IDE * > HitToSimIDEs_Ps(detinfo::DetectorClocksData const &clockData, recob::Hit const &hit) const
double reco_beam_true_byHits_startP
2D representation of charge deposited in the TDC/wire plane
double true_beam_startDirX
std::vector< int > true_beam_Pi0_decay_PDG
void GetCenter(double *xyz, double localz=0.0) const
Fills the world coordinate of a point on the wire.
std::vector< double > reco_daughter_PFP_true_byHits_startZ
std::vector< double > reco_beam_calo_endDirZ
std::vector< double > reco_daughter_allTrack_to_vertex
std::vector< double > true_beam_elastic_Y
int n_cosmics_with_beam_IDE
std::string fPandora2CaloSCE
#define MF_LOG_WARNING(category)
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_startDirX
std::string reco_beam_true_byE_endProcess
std::vector< std::vector< int > > true_beam_daughter_reco_byHits_PFP_nHits
std::vector< double > reco_beam_calo_endDirY
std::vector< double > reco_daughter_allTrack_dR
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_startX
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.)
recob::tracking::Plane Plane
std::map< size_t, const recob::Hit * > GetRecoHitsFromTrajPoints(const recob::Track &track, art::Event const &evt, std::string trackModule)
std::vector< double > reco_daughter_allTrack_endY
Point_t const & Start() const
Returns the position of the first valid point of the trajectory [cm].
std::vector< double > reco_daughter_allTrack_Phi
double reco_beam_allTrack_len
double reco_beam_allTrack_endX
double Py(const size_type i) const
std::vector< double > reco_beam_calo_startDirY
std::vector< double > reco_daughter_allShower_startY
std::vector< double > true_beam_daughter_startPz
bool reco_beam_true_byHits_matched
double reco_beam_Chi2_proton
std::vector< double > reco_daughter_allTrack_alt_len
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_endZ
std::vector< double > quality_reco_view_2_wire
double quality_reco_view_1_max_segment
std::vector< double > true_beam_Pi0_decay_startY
double reco_beam_allTrack_startX
std::vector< double > reco_daughter_PFP_true_byHits_startPx
std::vector< double > true_beam_traj_X
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_startX
std::vector< std::vector< int > > true_beam_daughter_reco_byHits_PFP_ID
double reco_beam_allTrack_trackEndDirY
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_byHits_purity
double GetTrackMomentum(double trkrange, int pdg) const
std::vector< double > g4rw_primary_minus_sigma_weight
std::vector< int > true_beam_grand_daughter_parID
cet::coded_exception< error, detail::translate > exception
std::vector< double > reco_beam_calo_wire
double lateralDist(TVector3 &n, TVector3 &x0, TVector3 &p)
double quality_reco_view_2_wire_backtrack
QTextStream & endl(QTextStream &s)
double reco_beam_trackEndDirY
std::vector< double > reco_beam_allTrack_resRange
Event finding and building.
int reco_beam_true_byHits_PDG
h
training ###############################
std::string fBeamModuleLabel
double reco_beam_allTrack_startY
int reco_beam_true_byE_ID
std::vector< double > reco_daughter_allTrack_startX
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_startY
double reco_beam_calo_endZ
std::vector< int > data_BI_TOF_Chan
std::vector< int > reco_daughter_PFP_nHits
std::vector< int > true_beam_slices_nIDEs
double reco_beam_interactingEnergy
std::vector< double > reco_daughter_PFP_true_byE_len