Skip to content

Commit 618ffe3

Browse files
committed
Merge branch 'develop' into geom-separate
2 parents 77c3a5e + bbf2ea0 commit 618ffe3

228 files changed

Lines changed: 189736 additions & 2336 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: SBND Issue
3+
about: Fillable form for sbndcode issues
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
## I'm submitting a ...
11+
12+
- [ ] bug report
13+
- [ ] feature request
14+
15+
## Checklist
16+
- [ ] I've added at least 1 label under `Labels`
17+
- [ ] Assigned a reviewer under `Assignees`
18+
19+
## Expected Behavior
20+
21+
22+
## Current Behavior
23+
24+
25+
## Possible Solution (optional)
26+
27+
28+
## How to reproduce

.github/pull_request_template.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## Description
2+
Please provide a detailed description of the changes this pull request introduces.
3+
4+
## Checklist
5+
- [ ] Added at least 1 label from [available labels](https://github.com/SBNSoftware/sbndcode/issues/labels?sort=name-asc).
6+
- [ ] Assigned at least 1 reviewer under `Reviewers`,
7+
- [ ] Assigned all contributers including yourself under `Assignees`
8+
- [ ] Linked any relevant issues under `Developement`
9+
- [ ] Does this PR affect CAF data format? If so, please assign a CAF maintainer ([PetrilloAtWork](https://github.com/PetrilloAtWork) or [JosiePaton](https://github.com/JosiePaton)) as additional reviewer.
10+
- [ ] Does this affect the standard workflow?
11+
12+
### Relevant PR links (optional)
13+
Does this PR require merging another PR in a different repository (such as sbnanobj/sbnobj etc.)?
14+
15+
### Link(s) to docdb describing changes (optional)
16+
Is there a docdb describing the issue this solves or the feature added?

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515

1616
cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
1717

18-
set(${PROJECT_NAME}_CMAKE_PROJECT_VERSION_STRING 09.90.00)
18+
set(${PROJECT_NAME}_CMAKE_PROJECT_VERSION_STRING 09.93.01.01)
1919
find_package(cetmodules REQUIRED)
2020
project(sbndcode LANGUAGES CXX)
2121

2222
# for CI:
23-
# project(sbndcode VERSION 09.90.00)
23+
# project(sbndcode VERSION 09.93.01.01)
2424

2525
message(STATUS "\n")
2626
message(STATUS "================================= ${PROJECT_NAME} =================================")

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Contributing
2+
For most recent contributing guidelines, see [docDB 38041](https://sbn-docdb.fnal.gov/cgi-bin/sso/ShowDocument?docid=38041).

sbndcode/CRT/CRTAna/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ art_make(
33
ROOT::Tree
44
larsim::Utils
55
sbnobj::SBND_CRT
6+
sbnobj::SBND_Timing
67
sbndcode_GeoWrappers
78
sbndcode_CRT_CRTBackTracker
89
)

sbndcode/CRT/CRTAna/CRTAnalysis_module.cc

Lines changed: 809 additions & 499 deletions
Large diffs are not rendered by default.

sbndcode/CRT/CRTAna/CRTCalibAna_module.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@ class sbnd::crt::CRTCalibAna : public art::EDAnalyzer {
277277

278278
sbnd::crt::CRTCalibAna::CRTCalibAna(fhicl::ParameterSet const& p)
279279
: EDAnalyzer{p}
280-
, fCRTGeoAlg(p.get<fhicl::ParameterSet>("CRTGeoAlg", fhicl::ParameterSet()))
281-
, fCRTBackTrackerAlg(p.get<fhicl::ParameterSet>("CRTBackTrackerAlg", fhicl::ParameterSet()))
280+
, fCRTGeoAlg(p.get<fhicl::ParameterSet>("CRTGeoAlg"))
281+
, fCRTBackTrackerAlg(p.get<fhicl::ParameterSet>("CRTBackTrackerAlg"))
282282
{
283283
fMCParticleModuleLabel = p.get<std::string>("MCParticleModuleLabel", "largeant");
284284
fSimDepositModuleLabel = p.get<std::string>("SimDepositModuleLabel", "genericcrt");
@@ -967,8 +967,8 @@ void sbnd::crt::CRTCalibAna::AnalyseCRTClusters(const art::Event &e, const std::
967967
_cl_sp_z[i] = spacepoint->Z();
968968
_cl_sp_ez[i] = spacepoint->ZErr();
969969
_cl_sp_pe[i] = spacepoint->PE();
970-
_cl_sp_time[i] = spacepoint->Time();
971-
_cl_sp_etime[i] = spacepoint->TimeErr();
970+
_cl_sp_time[i] = spacepoint->Ts0();
971+
_cl_sp_etime[i] = spacepoint->Ts0Err();
972972
_cl_sp_complete[i] = spacepoint->Complete();
973973
}
974974
else
@@ -1112,8 +1112,8 @@ void sbnd::crt::CRTCalibAna::AnalyseCRTTracks(const art::Event &e, const std::ve
11121112
_tr_dir_y[i] = dir.Y();
11131113
_tr_dir_z[i] = dir.Z();
11141114

1115-
_tr_time[i] = track->Time();
1116-
_tr_etime[i] = track->TimeErr();
1115+
_tr_time[i] = track->Ts0();
1116+
_tr_etime[i] = track->Ts0();
11171117
_tr_pe[i] = track->PE();
11181118
_tr_length[i] = track->Length();
11191119
_tr_tof[i] = track->ToF();
@@ -1267,7 +1267,7 @@ void sbnd::crt::CRTCalibAna::AnalyseTPCMatching(const art::Event &e, const art::
12671267

12681268
_tpc_sp_matched[nActualTracks] = true;
12691269
_tpc_sp_good_match[nActualTracks] = truthMatch.trackid == trackid;
1270-
_tpc_sp_time[nActualTracks] = spacepoint->Time();
1270+
_tpc_sp_time[nActualTracks] = spacepoint->Ts0();
12711271
_tpc_sp_score[nActualTracks] = spMatch.TriggerConfidence();
12721272
}
12731273
else
@@ -1287,7 +1287,7 @@ void sbnd::crt::CRTCalibAna::AnalyseTPCMatching(const art::Event &e, const art::
12871287

12881288
_tpc_tr_matched[nActualTracks] = true;
12891289
_tpc_tr_good_match[nActualTracks] = truthMatch.trackid == trackid;
1290-
_tpc_tr_time[nActualTracks] = crttrack->Time();
1290+
_tpc_tr_time[nActualTracks] = crttrack->Ts0();
12911291
_tpc_tr_score[nActualTracks] = trackMatch.TriggerConfidence();
12921292
}
12931293
else

sbndcode/CRT/CRTAna/run_crtana.fcl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#include "simulationservices_sbnd.fcl"
1+
#include "crtgeoalg_sbnd.fcl"
22
#include "crtbacktrackeralg_sbnd.fcl"
3+
#include "simulationservices_sbnd.fcl"
34

45
process_name: CRTAnalyzer
56

@@ -24,6 +25,7 @@ physics:
2425
crtana:
2526
{
2627
module_type: "CRTAnalysis"
28+
CRTGeoAlg: @local::crtgeoalg_sbnd
2729
CRTBackTrackerAlg: @local::crtbacktrackeralg_sbnd
2830
}
2931
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include "crt_channel_map_service.fcl"
2+
#include "crt_calib_service.fcl"
3+
#include "run_crtana.fcl"
4+
5+
services.ParticleInventoryService: @erase
6+
services.BackTrackerService: @erase
7+
8+
services.CRTChannelMapService: @local::crt_channel_map_standard
9+
services.CRTCalibService: @local::crt_calib_service
10+
11+
physics.analyzers.crtana.FEBDataModuleLabel: "crtdecoder"
12+
physics.analyzers.crtana.DataMode: true
13+
physics.analyzers.crtana.NoTPC: true
14+
physics.analyzers.crtana.HasPTB: true
15+
physics.analyzers.crtana.HasTDC: true

sbndcode/CRT/CRTBackTracker/CRTBackTrackerAlg.cc

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace sbnd::crt {
88
}
99

1010
CRTBackTrackerAlg::CRTBackTrackerAlg(){}
11-
11+
1212
CRTBackTrackerAlg::~CRTBackTrackerAlg(){}
1313

1414
void CRTBackTrackerAlg::reconfigure(const Config& config)
@@ -20,6 +20,7 @@ namespace sbnd::crt {
2020
fClusterModuleLabel = config.ClusterModuleLabel();
2121
fSpacePointModuleLabel = config.SpacePointModuleLabel();
2222
fTrackModuleLabel = config.TrackModuleLabel();
23+
fCRTGeoAlgConfig = config.GeoAlgConfig();
2324

2425
return;
2526
}
@@ -37,6 +38,8 @@ namespace sbnd::crt {
3738
fTrackIDMotherMap.clear();
3839
fStripHitMCPMap.clear();
3940

41+
CRTGeoAlg geoAlg = CRTGeoAlg(fCRTGeoAlgConfig);
42+
4043
art::Handle<std::vector<sim::ParticleAncestryMap>> droppedTrackIDMapVecHandle;
4144
event.getByLabel(fSimModuleLabel, droppedTrackIDMapVecHandle);
4245

@@ -91,7 +94,7 @@ namespace sbnd::crt {
9194
const double x = (ide->entryX + ide->exitX) / 2.;
9295
const double y = (ide->entryY + ide->exitY) / 2.;
9396
const double z = (ide->entryZ + ide->exitZ) / 2.;
94-
const CRTTagger tagger = fCRTGeoAlg.WhichTagger(x, y, z);
97+
const CRTTagger tagger = geoAlg.WhichTagger(x, y, z);
9598

9699
const int rollUpID = RollUpID(ide->trackID);
97100

@@ -244,7 +247,7 @@ namespace sbnd::crt {
244247
const double x = (ide->entryX + ide->exitX) / 2.;
245248
const double y = (ide->entryY + ide->exitY) / 2.;
246249
const double z = (ide->entryZ + ide->exitZ) / 2.;
247-
const CRTTagger tagger = fCRTGeoAlg.WhichTagger(x, y, z);
250+
const CRTTagger tagger = geoAlg.WhichTagger(x, y, z);
248251

249252
const int rollUpID = RollUpID(ide->trackID);
250253
Category category(rollUpID, tagger);
@@ -260,7 +263,7 @@ namespace sbnd::crt {
260263

261264
for(auto const stripHit : stripHitVec)
262265
{
263-
const CRTTagger tagger = fCRTGeoAlg.ChannelToTaggerEnum(stripHit->Channel());
266+
const CRTTagger tagger = geoAlg.ChannelToTaggerEnum(stripHit->Channel());
264267
TruthMatchMetrics truthMatch = TruthMatching(event, stripHit);
265268

266269
fStripHitMCPMap[stripHit.key()] = truthMatch.trackid;
@@ -337,6 +340,8 @@ namespace sbnd::crt {
337340

338341
CRTBackTrackerAlg::TruthMatchMetrics CRTBackTrackerAlg::TruthMatching(const art::Event &event, const art::Ptr<CRTStripHit> &stripHit)
339342
{
343+
CRTGeoAlg geoAlg = CRTGeoAlg(fCRTGeoAlgConfig);
344+
340345
art::Handle<std::vector<FEBData>> febDataHandle;
341346
event.getByLabel(fFEBDataModuleLabel, febDataHandle);
342347

@@ -345,7 +350,7 @@ namespace sbnd::crt {
345350

346351
art::FindManyP<sim::AuxDetIDE, FEBTruthInfo> febDataToIDEs(febDataHandle, event, fFEBDataModuleLabel);
347352
art::FindOneP<FEBData> stripHitToFEBData(stripHitHandle, event, fStripHitModuleLabel);
348-
const CRTTagger tagger = fCRTGeoAlg.ChannelToTaggerEnum(stripHit->Channel());
353+
const CRTTagger tagger = geoAlg.ChannelToTaggerEnum(stripHit->Channel());
349354

350355
auto const febData = stripHitToFEBData.at(stripHit.key());
351356
auto const assnIDEVec = febDataToIDEs.at(febData.key());
@@ -540,8 +545,10 @@ namespace sbnd::crt {
540545
const geo::Vector_t &dir,
541546
const CRTTagger &tagger)
542547
{
548+
CRTGeoAlg geoAlg = CRTGeoAlg(fCRTGeoAlgConfig);
549+
543550
const CoordSet constrainedPlane = CRTCommonUtils::GetTaggerDefinedCoordinate(tagger);
544-
const CRTTaggerGeo taggerGeo = fCRTGeoAlg.GetTagger(CRTCommonUtils::GetTaggerName(tagger));
551+
const CRTTaggerGeo taggerGeo = geoAlg.GetTagger(CRTCommonUtils::GetTaggerName(tagger));
545552
double k;
546553

547554
switch(constrainedPlane)
@@ -570,14 +577,15 @@ namespace sbnd::crt {
570577
break;
571578
}
572579

573-
if(!fCRTGeoAlg.IsPointInsideCRTLimits(start + k * dir))
580+
if(!geoAlg.IsPointInsideCRTLimits(start + k * dir))
574581
return {999999., {999999., 999999., 999999.}};
575582

576583
return {k, start + k * dir};
577584
}
578585

579586
void CRTBackTrackerAlg::TrueParticlePDGEnergyTime(const int trackID, int &pdg, double &energy, double &time)
580587
{
588+
art::ServiceHandle<cheat::ParticleInventoryService> particleInv;
581589
const simb::MCParticle* particle = particleInv->TrackIdToParticle_P(trackID);
582590

583591
pdg = particle == NULL ? -std::numeric_limits<int>::max() : particle->PdgCode();

0 commit comments

Comments
 (0)