Skip to content

Commit 36335bd

Browse files
authored
Merge branch 'develop' into feature/hhausner_newBNBQualityDevices
2 parents ac8790e + 9eb9dc4 commit 36335bd

43 files changed

Lines changed: 876 additions & 127 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
1515

1616
find_package(cetmodules 3.20.00 REQUIRED)
17-
project(sbnobj VERSION 09.19.00.01 LANGUAGES CXX)
17+
project(sbnobj VERSION 10.01.00 LANGUAGES CXX)
1818

1919
message(STATUS
2020
"\n-- ============================================================================="
@@ -34,9 +34,13 @@ cet_set_compiler_flags(DIAGS CAUTIOUS
3434
cet_report_compiler_flags(REPORT_THRESHOLD VERBOSE)
3535

3636
# these are minimum required versions, not the actual product versions
37+
find_package(art REQUIRED EXPORT)
38+
find_package(canvas REQUIRED EXPORT)
3739
find_package( messagefacility REQUIRED )
3840
find_package( canvas REQUIRED )
41+
find_package( larcore REQUIRED )
3942
find_package( larcoreobj REQUIRED )
43+
find_package( lardata REQUIRED )
4044
find_package( lardataobj REQUIRED )
4145
find_package( larcorealg REQUIRED )
4246
find_package( lardataalg REQUIRED )
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* \class TPCChannelInfo
3+
*
4+
* \ingroup anab
5+
*
6+
* \brief TPCChannel Analysis Info
7+
*
8+
*/
9+
10+
#ifndef TPCChannelInfo_hh_
11+
#define TPCChannelInfo_hh_
12+
13+
14+
namespace anab {
15+
16+
struct TPCChannelInfo{
17+
unsigned channel; //!< Channel number
18+
float baseline; //!< Channel baseline
19+
float rms; //!< Channel RMS
20+
float even_fraction; //!< Fraction of even samples in waveform
21+
float xbad_fraction; //!< Fraction of samples equal to 0xBAD in the waveform
22+
};
23+
24+
}
25+
26+
27+
#endif

sbnobj/Common/Analysis/classes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "canvas/Persistency/Common/Wrapper.h"
22
#include "canvas/Persistency/Common/Assns.h"
33
#include "sbnobj/Common/Analysis/TPCPurityInfo.hh"
4+
#include "sbnobj/Common/Analysis/TPCChannelInfo.hh"
45
#include <vector>

sbnobj/Common/Analysis/classes_def.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
<lcgdict>
22

3+
<class name="anab::TPCChannelInfo" ClassVersion="10">
4+
<version ClassVersion="10" checksum="3801257877"/>
5+
</class>
6+
<class name="std::vector<anab::TPCChannelInfo>"/>
7+
<class name="art::Wrapper< anab::TPCChannelInfo>"/>
8+
<class name="art::Wrapper< std::vector<anab::TPCChannelInfo>>"/>
9+
310
<class name="anab::TPCPurityInfo" ClassVersion="12">
411
<version ClassVersion="12" checksum="2429165902"/>
512
<version ClassVersion="11" checksum="3124295666"/>

sbnobj/Common/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ add_subdirectory(SBNEventWeight)
77
add_subdirectory(POTAccounting)
88
add_subdirectory(EventGen)
99
add_subdirectory(Trigger)
10+
add_subdirectory(Utilities)

sbnobj/Common/CRT/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
cet_make_library(
22
SOURCE
33
CRTHit.cc
4+
CRTPMTMatching.cxx
45
CRTTrack.cc
56
CRTTzero.cc
6-
CRTPMTMatching.cxx
7-
LIBRARIES
7+
CRTHitT0TaggingInfo.cc
8+
CRTHitT0TaggingTruthInfo.cc
9+
LIBRARIES
810
cetlib_except::cetlib_except
911
lardataobj::Simulation
12+
larcorealg::Geometry
1013
)
1114

1215
art_dictionary(DICTIONARY_LIBRARIES sbnobj::Common_CRT)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "sbnobj/Common/CRT/CRTHitT0TaggingInfo.hh"
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/**
2+
* @file sbnobj/Common/CRT/CRTHitT0TaggingInfo.hh
3+
* @author Francesco Poppi (poppi@bo.infn.it)
4+
* @date January 2025
5+
*/
6+
7+
#ifndef SBNOBJ_COMMON_CRTHitT0TaggingInfo_hh_
8+
#define SBNOBJ_COMMON_CRTHitT0TaggingInfo_hh_
9+
10+
// C/C++ standard libraries
11+
#include <limits>
12+
#include "larcorealg/Geometry/GeometryCore.h"
13+
#include "larcoreobj/SimpleTypesAndConstants/geo_types.h"
14+
#include "larcoreobj/SimpleTypesAndConstants/geo_vectors.h"
15+
// -----------------------------------------------------------------------------
16+
namespace sbn::crt {
17+
/// @brief How was the track fitted when matched with a CRT hit.
18+
19+
enum class CRTTaggingMethod {
20+
crtHits = 0, ///< matching performed using single CRT Hits
21+
crtTracks = 1 ///< matching performed using CRTTracks
22+
};
23+
24+
enum class CRTTaggingTrackFit {
25+
pca = 0, ///< Track fitted with PCA method
26+
startEnd = 1, ///< Track fitted from Start-End vector
27+
kalman = 2, ///< Track fitted using Kalman Filter
28+
others = 9 ///< Track direction evaluated in other mehods
29+
};
30+
31+
struct CRTHitT0TaggingInfo;
32+
}
33+
/**
34+
* @brief Additional information on the matching between CRT and TPC tracks.
35+
*
36+
*/
37+
struct sbn::crt::CRTHitT0TaggingInfo {
38+
39+
/// Magic value denoting the absence of DCA information.
40+
static constexpr double NoDistance = std::numeric_limits<double>::lowest();
41+
static constexpr double NoTime = std::numeric_limits<double>::lowest();
42+
43+
/// Magic value denoting the absence of CRTs.
44+
static constexpr int NoCRT = std::numeric_limits<int>::lowest();
45+
46+
/// Magic value denoting the absence of CRT Plane.
47+
static constexpr int NoPlane = std::numeric_limits<int>::lowest();
48+
49+
// --- BEGIN -- Data members -------------------------------------------------
50+
51+
// Francesco: following a discussion with Henry Lay, we decided that is good
52+
// to have a common object to store additional information, but at the moment
53+
// the matching approach is different, ICARUS uses single CRT Hits to track
54+
// matching, while SBND uses CRTTracks. Due to this difference, we decided
55+
// to add a notation "Hit" in the member which matches tracks with single hits.
56+
// We might at some point do more discussion and see if this can work for both.
57+
58+
/// Distance of closest approach between track extension and CRT hit [cm]
59+
double Distance = NoDistance;
60+
61+
/// Matched CRT Hit sub detector
62+
// e.g. ICARUS case: 0 Top, 1 Side, 2 Bottom
63+
int Sys = NoCRT;
64+
65+
/// Matched CRT Hit region
66+
// e.g. ICARUS case: 30-34 Top CRT, 40-48 Side CRT, 50 Bottom CRT
67+
int Region = NoCRT;
68+
69+
/// Matched CRT Hit time w.r.t. trigger [ns]
70+
double Time = NoTime;
71+
72+
/// Distance distinguished into its components DX, DY, DZ [cm]
73+
double DeltaX = NoDistance;
74+
double DeltaY = NoDistance;
75+
double DeltaZ = NoDistance;
76+
77+
/// Extrapolated Track Projection Crossing Point onto the CRT Plane
78+
double CrossX = NoDistance;
79+
double CrossY = NoDistance;
80+
double CrossZ = NoDistance;
81+
82+
/// Fix Coordinate for the CRT Plane
83+
// e.g. ICARUS case:
84+
// For Top CRT region 30 Y coordinate is constant: plane=0
85+
// For Top CRT region 31/32 and Side CRT 40/41/42/43/44/45 X coordinate is constant: plane=1
86+
// For Top CRT region 33/34 and Side CRT 46/47 Z coordinate is constant: plane=2
87+
int Plane = NoPlane;
88+
89+
// PCA Fit Fir Eigenvector
90+
geo::Vector_t PCAEigenVector = {-1., -1., -1.};
91+
92+
CRTTaggingTrackFit fitType;
93+
CRTTaggingMethod taggingMethod;
94+
95+
// --- END ---- Data members -------------------------------------------------
96+
97+
}; // sbn::crt::CRTHitT0TaggingInfo
98+
99+
100+
// -----------------------------------------------------------------------------
101+
102+
103+
#endif // SBNOBJ_COMMON_CRTHitT0TaggingInfo_hh_
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "sbnobj/Common/CRT/CRTHitT0TaggingTruthInfo.hh"
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/**
2+
* @file sbnobj/Common/CRT/CRTHitT0TaggingTruthInfo.hh
3+
* @author Francesco Poppi (poppi@bo.infn.it)
4+
* @date January 2025
5+
*/
6+
7+
#ifndef SBNOBJ_COMMON_CRTHitT0TaggingTruthInfo_hh_
8+
#define SBNOBJ_COMMON_CRTHitT0TaggingTruthInfo_hh_
9+
10+
// C/C++ standard libraries
11+
#include <limits>
12+
13+
// -----------------------------------------------------------------------------
14+
namespace sbn::crt {
15+
struct CRTHitT0TaggingTruthInfo;
16+
}
17+
/**
18+
* @brief Truth information on the matching between CRT and TPC tracks.
19+
*
20+
*/
21+
struct sbn::crt::CRTHitT0TaggingTruthInfo {
22+
static constexpr double NoCoordinate = std::numeric_limits<double>::lowest();
23+
static constexpr int NoId = std::numeric_limits<int>::lowest();
24+
static constexpr int NoPdg = std::numeric_limits<int>::lowest();
25+
26+
/// Verify that the truth level information of the track were correctly retrieved.
27+
/// Default is false.
28+
bool truthFound = false;
29+
30+
/// Turth level information of the match.
31+
/// Default is false. For MC this information is filled if MC truth is available.
32+
bool truthMatch = false;
33+
34+
/// Truth information of the particle Geant4Id.
35+
int truthG4TrackId = NoId;
36+
37+
/// Truth information of the particle Pdg code.
38+
int truthTrackPdgCode = NoPdg;
39+
40+
/// Truth information if the particle is associated with the neutrino interaction
41+
/// or not (information from generator). Default is false.
42+
bool truthIsNu = false;
43+
44+
// --- END ---- Data members -------------------------------------------------
45+
46+
}; // sbn::crt::CRTHitT0TaggingTruthInfo
47+
48+
// -----------------------------------------------------------------------------
49+
50+
51+
#endif // SBNOBJ_COMMON_CRTHitT0TaggingTruthInfo_hh_

0 commit comments

Comments
 (0)