41 art::Handle< std::vector<sbnd::crt::CRTData>> crtDataHandle;
42 std::vector<art::Ptr<sbnd::crt::CRTData> > crtDataList;
44 art::fill_ptr_vector(crtDataList, crtDataHandle);
46 art::FindManyP<sim::AuxDetIDE> findManyIdes(crtDataHandle, event,
fCRTDataLabel);
48 std::map<art::Ptr<sbnd::crt::CRTData>,
int> dataPtrMap;
50 for(
size_t data_i = 0; data_i < crtDataList.size(); data_i++){
52 dataPtrMap[crtDataList[data_i]] = data_i;
55 std::vector<art::Ptr<sim::AuxDetIDE>> ides = findManyIdes.at(data_i);
56 for(
size_t i = 0; i < ides.size(); i++){
57 int id = ides[i]->trackID;
64 art::Handle< std::vector<sbn::crt::CRTHit>> crtHitHandle;
65 std::vector<art::Ptr<sbn::crt::CRTHit> > crtHitList;
67 art::fill_ptr_vector(crtHitList, crtHitHandle);
69 art::FindManyP<sbnd::crt::CRTData> findManyData(crtHitHandle, event,
fCRTHitLabel);
71 std::map<art::Ptr<sbn::crt::CRTHit>,
int> hitPtrMap;
73 for(
size_t hit_i = 0; hit_i < crtHitList.size(); hit_i++){
75 hitPtrMap[crtHitList[hit_i]] = hit_i;
77 std::vector<art::Ptr<sbnd::crt::CRTData>> data = findManyData.at(hit_i);
78 for(
size_t data_i = 0; data_i < data.size(); data_i++){
80 int dataID = dataPtrMap[data[data_i]];
89 art::Handle< std::vector<sbn::crt::CRTTrack>> crtTrackHandle;
90 std::vector<art::Ptr<sbn::crt::CRTTrack> > crtTrackList;
92 art::fill_ptr_vector(crtTrackList, crtTrackHandle);
94 art::FindManyP<sbn::crt::CRTHit> findManyHits(crtTrackHandle, event,
fCRTTrackLabel);
96 for(
size_t track_i = 0; track_i < crtTrackList.size(); track_i++){
98 std::vector<art::Ptr<sbn::crt::CRTHit>> hits = findManyHits.at(track_i);
99 for(
size_t hit_i = 0; hit_i < hits.size(); hit_i++){
101 int hitID = hitPtrMap[hits[hit_i]];
115 if(data1.
T0() != data2.
T0())
return false;
116 if(data1.
T1() != data2.
T1())
return false;
117 if(data1.
ADC() != data2.
ADC())
return false;
168 std::vector<int> ids;
171 auto crtDataHandle =
event.getValidHandle<std::vector<sbnd::crt::CRTData>>(
fCRTDataLabel);
173 art::FindManyP<sim::AuxDetIDE> findManyIdes(crtDataHandle, event,
fCRTDataLabel);
176 int data_i = 0, index = 0;
177 for(
auto const& crtData : (*crtDataHandle)){
183 std::vector<art::Ptr<sim::AuxDetIDE>> ides = findManyIdes.at(data_i);
184 for(
size_t i = 0; i < ides.size(); i++){
185 int id = ides[i]->trackID;
191 std::sort(ids.begin(), ids.end());
192 ids.erase(std::unique(ids.begin(), ids.end()), ids.end());
201 std::vector<int> ids;
204 auto crtHitHandle =
event.getValidHandle<std::vector<sbn::crt::CRTHit>>(
fCRTHitLabel);
206 art::FindManyP<sbnd::crt::CRTData> findManyData(crtHitHandle, event,
fCRTHitLabel);
209 int hit_i = 0, index = 0;
210 for(
auto const& crtHit : (*crtHitHandle)){
216 std::vector<art::Ptr<sbnd::crt::CRTData>> data = findManyData.at(hit_i);
217 art::FindManyP<sim::AuxDetIDE> findManyIdes(data, event,
fCRTDataLabel);
220 for(
size_t i = 0; i < data.size(); i++){
221 std::vector<art::Ptr<sim::AuxDetIDE>> ides = findManyIdes.at(i);
222 for(
size_t j = 0; j < ides.size(); j++){
223 int id = ides[j]->trackID;
230 std::sort(ids.begin(), ids.end());
231 ids.erase(std::unique(ids.begin(), ids.end()), ids.end());
240 std::vector<int> ids;
243 auto crtTrackHandle =
event.getValidHandle<std::vector<sbn::crt::CRTTrack>>(
fCRTTrackLabel);
245 art::FindManyP<sbn::crt::CRTHit> findManyHits(crtTrackHandle, event,
fCRTTrackLabel);
248 int track_i = 0, index = 0;
249 for(
auto const& crtTrack : (*crtTrackHandle)){
255 std::vector<art::Ptr<sbn::crt::CRTHit>> hits = findManyHits.at(track_i);
256 art::FindManyP<sbnd::crt::CRTData> findManyData(hits, event,
fCRTHitLabel);
259 for(
size_t i = 0; i < hits.size(); i++){
260 std::vector<art::Ptr<sbnd::crt::CRTData>> data = findManyData.at(i);
261 art::FindManyP<sim::AuxDetIDE> findManyIdes(data, event,
fCRTDataLabel);
262 for(
size_t j = 0; j < data.size(); j++){
263 std::vector<art::Ptr<sim::AuxDetIDE>> ides = findManyIdes.at(j);
264 for(
size_t k = 0;
k < ides.size();
k++){
265 int id = ides[
k]->trackID;
273 std::sort(ids.begin(), ids.end());
274 ids.erase(std::unique(ids.begin(), ids.end()), ids.end());
283 std::map<int, double> ids;
286 auto crtDataHandle =
event.getValidHandle<std::vector<sbnd::crt::CRTData>>(
fCRTDataLabel);
288 art::FindManyP<sim::AuxDetIDE> findManyIdes(crtDataHandle, event,
fCRTDataLabel);
291 int data_i = 0, index = 0;
292 for(
auto const& crtData : (*crtDataHandle)){
298 std::vector<art::Ptr<sim::AuxDetIDE>> ides = findManyIdes.at(data_i);
299 for(
size_t i = 0; i < ides.size(); i++){
300 int id = ides[i]->trackID;
302 ids[id] += ides[i]->energyDeposited;
306 double maxEnergy = -1;
309 if(
id.
second > maxEnergy){
310 maxEnergy =
id.second;
322 double maxEnergy = -1;
325 if(
id.
second > maxEnergy){
326 maxEnergy =
id.second;
340 std::map<int, double> ids;
343 auto crtHitHandle =
event.getValidHandle<std::vector<sbn::crt::CRTHit>>(
fCRTHitLabel);
345 art::FindManyP<sbnd::crt::CRTData> findManyData(crtHitHandle, event,
fCRTHitLabel);
348 int hit_i = 0, index = 0;
349 for(
auto const& crtHit : (*crtHitHandle)){
355 std::vector<art::Ptr<sbnd::crt::CRTData>> data = findManyData.at(hit_i);
356 art::FindManyP<sim::AuxDetIDE> findManyIdes(data, event,
fCRTDataLabel);
359 for(
size_t i = 0; i < data.size(); i++){
360 std::vector<art::Ptr<sim::AuxDetIDE>> ides = findManyIdes.at(i);
361 for(
size_t j = 0; j < ides.size(); j++){
362 int id = ides[j]->trackID;
364 ids[id] += ides[j]->energyDeposited;
369 double maxEnergy = -1;
372 if(
id.
second > maxEnergy){
373 maxEnergy =
id.second;
385 double maxEnergy = -1;
388 if(
id.
second > maxEnergy){
389 maxEnergy =
id.second;
402 std::map<int, double> ids;
405 auto crtTrackHandle =
event.getValidHandle<std::vector<sbn::crt::CRTTrack>>(
fCRTTrackLabel);
407 art::FindManyP<sbn::crt::CRTHit> findManyHits(crtTrackHandle, event,
fCRTTrackLabel);
410 int track_i = 0, index = 0;
411 for(
auto const& crtTrack : (*crtTrackHandle)){
417 std::vector<art::Ptr<sbn::crt::CRTHit>> hits = findManyHits.at(track_i);
418 art::FindManyP<sbnd::crt::CRTData> findManyData(hits, event,
fCRTHitLabel);
421 for(
size_t i = 0; i < hits.size(); i++){
422 std::vector<art::Ptr<sbnd::crt::CRTData>> data = findManyData.at(i);
423 art::FindManyP<sim::AuxDetIDE> findManyIdes(data, event,
fCRTDataLabel);
424 for(
size_t j = 0; j < data.size(); j++){
425 std::vector<art::Ptr<sim::AuxDetIDE>> ides = findManyIdes.at(j);
426 for(
size_t k = 0;
k < ides.size();
k++){
427 int id = ides[
k]->trackID;
429 ids[id] += ides[
k]->energyDeposited;
435 double maxEnergy = -1;
438 if(
id.
second > maxEnergy){
439 maxEnergy =
id.second;
451 double maxEnergy = -1;
454 if(
id.
second > maxEnergy){
455 maxEnergy =
id.second;
float z_err
position uncertainty in z-direction (cm).
int TrueIdFromTrackId(const art::Event &event, int track_i)
float x_err
position uncertainty in x-direction (cm).
std::vector< int > AllTrueIds(const art::Event &event, const sbnd::crt::CRTData &data)
fhicl::Atom< art::InputTag > CRTTrackLabel
double ts1_ns
Timestamp T1 ([signal time w.r.t. Trigger time]), in UTC absolute time scale in nanoseconds from the ...
int plane
Name of the CRT wall (in the form of numbers).
float y_err
position uncertainty in y-direction (cm).
float x1_pos
X position of first CRTHit.
art::InputTag fCRTDataLabel
process_name use argoneut_mc_hitfinder track
float y1_err
Y position error of first CRTHit.
bool TrackCompare(const sbn::crt::CRTTrack &track1, const sbn::crt::CRTTrack &track2)
int TrueIdFromTotalEnergy(const art::Event &event, const sbnd::crt::CRTData &data)
int TrueIdFromHitId(const art::Event &event, int hit_i)
float z_pos
position in z-direction (cm).
void Initialize(const art::Event &event)
float z1_err
Z position error of first CRTHit.
void reconfigure(const Config &config)
float y2_err
Y position error of second CRTHit.
double ts1_ns
Average T1 (nanosecond) of the two hits making the track.
fhicl::Atom< bool > RollupUnsavedIds
art::InputTag fCRTTrackLabel
float z1_pos
Z position of first CRTHit.
float y_pos
position in y-direction (cm).
bool HitCompare(const sbn::crt::CRTHit &hit1, const sbn::crt::CRTHit &hit2)
std::map< int, std::map< int, double > > fTrackTrueIds
int plane1
Plane ID of first CRTHit.
fhicl::Atom< art::InputTag > CRTDataLabel
float z2_pos
Z position of second CRTHit.
float x_pos
position in x-direction (cm).
float y2_pos
Y position of second CRTHit.
float y1_pos
Y position of first CRTHit.
std::map< int, std::map< int, double > > fDataTrueIds
std::map< int, std::map< int, double > > fHitTrueIds
float x2_pos
X position of second CRTHit.
stream1 can override from command line with o or output services user sbnd
art::InputTag fCRTHitLabel
float x1_err
X position error of first CRTHit.
fhicl::Atom< art::InputTag > CRTHitLabel
CRTBackTracker(const Config &config)
std::string tagger
Name of the CRT wall (in the form of strings).
int plane2
Plane ID of second CRTHit.
float z2_err
Z position error of second CRTHit.
float x2_err
X position error of second CRTHit.
bool DataCompare(const sbnd::crt::CRTData &data1, const sbnd::crt::CRTData &data2)
int TrueIdFromDataId(const art::Event &event, int data_i)