Closed twongjirad closed 8 years ago
Why doesn't this happen every time?
Example of correct label:
[INFO] <test::_batch_process_::L248> Processing entry: 1783
[INFO] <testIOManager::get_data::L494> Setting event id (5498,22,1118)
[INFO] <SimpleFiller::fill_entry_data::L307> BNB PdgCode=14
Vertex (x, y, z, t) = (137.517,16.5527,204.815,3403.09)
Momentum (px, py, pz) = (-0.467529,1.17446,1243.1)
Inittial Energy = 1243.1
Deposit Energy = 1098.56
# Bounding Box = 3
Plane 0 (rows,cols) = (2160,672) ... Left Top (618,7806) ... Right Bottom (1290,5646)
Plane 1 (rows,cols) = (2160,832) ... Left Top (709,7806) ... Right Bottom (1541,5646)
Plane 2 (rows,cols) = (2160,1472) ... Left Top (670,7806) ... Right Bottom (2142,5646)
[INFO] <SimpleFiller::fill_entry_data::L320> Label to Datum: 1
What's in the ROOT file:
root [2] partroi_tpc_tree->Show(1783)
======> EVENT:1783
partroi_tpc_branch = (larcv::EventROI*)0x4e8f630
_producer = tpc
_run = 5637
_subrun = 72
_event = 3610
_part_v = (vector<larcv::ROI>*)0x4e8f680
_part_v._index = 0, 1, 2
_part_v._shape = 2, 1, 1
_part_v._type = 2, 6, 9
_part_v._mcst_index = 65535, 0, 1
_part_v._mct_index = 0, 0, 0
_part_v._energy_deposit = 271.893, 181.092, 90.801
_part_v._energy_init = 414.253, 286.751, 1029.07
_part_v._pdg = 14, 13, 2212
_part_v._parent_pdg = 0, 13, 2212
_part_v._trackid = 4294967295, 1, 2
_part_v._parent_trackid = 4294967295, 1, 2
_part_v._vtx._x = 121.65, 121.65, 121.65
Oh shit! The Run,subrun,event numbers are different...
Something is not right ... I checked I am filling from same file I am checking with ROOT...
some notes:
use_thread = false, non-random: seems ok. it says it is processing entry X, and the ROI dumped out matches.
use_thread = true, non-random: seems ok
use_thread = true; random: weirdness
use_thread = false; random: weirdness
i'm relying on cout with threads -- dangerous? but it is single thread filling sequentially?
there a double-shuffle?
In initializer of https://github.com/LArbys/LArCV/blob/master/core/Processor/ProcessDriver.cxx the entries are shuffled. if(_random_access) std::random_shuffle(_access_entry_v.begin(),_access_entry_v.end());
In https://github.com/LArbys/LArCV/blob/master/app/APICaffe/ThreadDatumFiller.cxx _batch_process
the entry to be drawn is randomized between (0,numentries in tree) This random draw, X, is stored.
But when it goes to process driver, this X is used to get entry Y = _access_entry_v[X].
X is stored in vector passed back to analysis.
So when training, correct label for an image is sent to net. but the wrong entry number for image-ROI pair is passed back to analysis script.
From the Filler:
Looking into the ROOT file:
Labeled as cosmic, but definitely a neutrino image.
—— the code ——
Diagnosis
In the loop, the first entry it sees is a cosmic ROI.
It then breaks, missing the MC ROIs behind it. This get's labeled as cosmic, but it's a neutrino.