All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Classes | Enumerations | Functions | Variables
sbn Namespace Reference

This module creates Common Analysis Files. More...

Namespaces

 bits
 Simple utilities to deal with bit enumerators.
 
 crt
 
 details
 
 evwgh
 
 util
 

Classes

struct  selTrackInfo
 
struct  selBeamInfo
 
struct  selTriggerInfo
 
struct  selSimTriggerInfo
 
struct  selLightInfo
 
struct  selHitInfo
 
class  TimedTrackSelector
 Selects tracks with time information. More...
 
class  TimeTrackTreeStorage
 Fills a ROOT tree with track-based triggering information. More...
 
class  DumpArtDAQfragments
 Dumps on console the content of artdaq::Fragment collections. More...
 
class  DumpPMTconfiguration
 Dumps on console the content of sbn::PMTconfiguration data product. More...
 
class  DumpTrigger
 Dumps on console the content of trigger data products. More...
 
class  DumpTriggerConfiguration
 Dumps on console the content of icarus::TriggerConfiguration data product. More...
 
struct  OpDetWaveformMeta
 Derivative information from raw::OpDetWaveform data. More...
 
class  OpDetWaveformMetaMaker
 Converter from raw::OpDetWaveform into sbn::OpDetWaveformMeta. More...
 
class  TriggerEmulationTree
 Fills a ROOT tree with trigger emulation results. More...
 
class  DuplicateEventTracker
 Keeps track of duplicate events in the job. More...
 
class  EventRegistry
 Keeps a record of all registered events and their source. More...
 
class  BNBRetriever
 
class  MWRData
 
class  EXTRetriever
 
class  NuMIRetriever
 
class  ITCSSelectionTool
 
class  TrackCaloSkimmer
 
class  TrackCaloSkimmerSelectAllTrack
 
class  TrackCaloSkimmerSelectAnode2CathodeTrack
 
class  TrackCaloSkimmerSelectStoppingTrack
 
class  CRUMBS
 
struct  CRTSipmGeo
 
struct  CRTStripGeo
 
struct  CRTModuleGeo
 
struct  CRTTaggerGeo
 
class  CRTGeoAlg
 
class  TPCGeoAlg
 
class  CRTHitConverter
 
class  MCSFitAllPID
 
class  PMTFlashTriggerFilter
 
class  PMTFlashTriggerMaker
 
class  RangePAllPID
 
class  ShowerCosmicDistance
 
class  ShowerSelectionVars
 
class  TrackScatterClosestApproach
 
class  TrackStoppingChi2Alg
 
class  TrackStoppingChi2Fitter
 
class  TransferPFParticleFlashMatch
 
class  TransferPFParticleT0
 
class  TransferTrackT0
 
class  Dazzle
 
class  Razzle
 
class  PCAngleKinkFinder
 
class  PCAngleKinkTree
 
struct  PCAngleInfo
 
class  PCAnglePlaneMaker
 
class  NuVertexChargeTree
 Analyzer module for use with sbn::Stub and sbn::VertexHit objects. More...
 
class  TrackAreaHit
 
class  TrackHitDumper
 
class  TrackHitFilter
 
class  MergedTrackIdentifier
 
class  TrackSplitter
 
class  IStubMerge
 Abstract interface intended for art tools which take a list of stubs and return a new list with some of them merged. More...
 
class  PlaneStubMerge
 Art tool for merging stubs on the same plane. More...
 
class  StubBuilder
 
struct  StubInfo
 Internal struct: contains information on stub and other associated data products. More...
 
class  TwoPlaneStubMerge
 Art tool for merging stubs across planes. More...
 
class  VertexChargeVacuum
 
class  VertexStubTracker
 
struct  Vector3D
 
struct  WireInfo
 
struct  HitTruth
 
struct  HitInfo
 
struct  TrackHitInfo
 
struct  MetaInfo
 
struct  TrueHit
 
struct  TrueParticle
 
struct  TrackTruth
 
struct  TrackInfo
 
struct  PMTconfiguration
 Class containing configuration for PMT readout. More...
 
struct  V1730channelConfiguration
 Class containing configuration for a V1730 channel. More...
 
struct  V1730Configuration
 Class containing configuration for a V1730 board. More...
 
class  BNBSpillInfo
 
class  EXTCountInfo
 
class  NuMISpillInfo
 
class  CRUMBSResult
 
struct  FlashTriggerPrimitive
 
class  MergedTrackInfo
 
class  MVAPID
 
class  RangeP
 
class  ScatterClosestApproach
 
class  ShowerDensityFit
 
class  ShowerTrackFit
 
class  SimpleFlashMatch
 
class  StoppingChi2Fit
 
class  StubHit
 
class  Stub
 
class  VertexHit
 
struct  ExtraTriggerInfo
 Additional information on trigger. More...
 

Enumerations

enum  EDet { kNOTDEFINED, kSBND, kICARUS }
 

Functions

TimeTrackTreeStorage::TriggerInputSpec_t convert (TimeTrackTreeStorage::Config::TriggerSpecConfig const &config)
 
TriggerEmulationTree::TriggerInputSpec_t convert (TriggerEmulationTree::Config::TriggerSpecConfig const &config)
 
double GetPitch (const geo::GeometryCore *geo, const spacecharge::SpaceCharge *sce, geo::Point_t loc, geo::Vector_t dir, geo::View_t view, geo::TPCID tpc, bool correct_sce, bool track_is_sce_corrected, float xsign=1.)
 Computes the track-pitch on a plane given an input direction and location. More...
 
geo::Point_t GetLocation (const spacecharge::SpaceCharge *sce, geo::Point_t loc_w, geo::TPCID TPC, float xsign=1.)
 Get the location in the presence of space charge. More...
 
double GetEfield (const detinfo::DetectorPropertiesData &dprop, const spacecharge::SpaceCharge *sce, geo::Point_t loc, geo::TPCID TPC, bool correct_loc_sce, float xsign=1.)
 Get the E-Field in the presence of space charge. More...
 
geo::Point_t GetLocationAtWires (const spacecharge::SpaceCharge *sce, const geo::GeometryCore *geo, geo::Point_t loc, geo::TPCID TPC, float xsign=1.)
 Get the SCE-distorted location (i.e. the location "seen" by the wireplanes) More...
 
bool StubContains (const sbn::StubInfo &A, const sbn::StubInfo &B)
 Returns whether stub A contains stub B. More...
 
float StubDirectionDot (const sbn::StubInfo &A, const sbn::StubInfo &B, const geo::GeometryCore *geo, const detinfo::DetectorPropertiesData &dprop)
 Computes the dot product of two stubs. More...
 
float StubTimeOffset (const sbn::StubInfo &A, const sbn::StubInfo &B, const detinfo::DetectorClocksData &dclock, const detinfo::DetectorPropertiesData &dprop)
 
geo::Point_t TwoStubEndPosition (const sbn::StubInfo &A, const sbn::StubInfo &B, const geo::GeometryCore *geo, const spacecharge::SpaceCharge *sce, const detinfo::DetectorPropertiesData &dprop)
 Returns an updated end position of a stub after merging across two planes. More...
 
float StubChargeOffset (const sbn::StubInfo &A, const sbn::StubInfo &B)
 Difference of the total charge between two stubs. More...
 
float StubPeakChargeOffset (const sbn::StubInfo &A, const sbn::StubInfo &B)
 Difference of the endpoint charge between two stubs. More...
 
float StubPeakdQdxOffset (const sbn::StubInfo &A, const sbn::StubInfo &B, const geo::GeometryCore *geo, const spacecharge::SpaceCharge *sce, const detinfo::DetectorPropertiesData &dprop)
 Difference of the endpoint dQ/dx between two stubs. More...
 
std::ostream & operator<< (std::ostream &out, sbn::PMTconfiguration const &config)
 Prints the configuration into a stream with default verbosity. More...
 
std::ostream & operator<< (std::ostream &out, sbn::V1730channelConfiguration const &config)
 Prints the configuration into a stream with default verbosity. More...
 
std::ostream & operator<< (std::ostream &out, sbn::V1730Configuration const &config)
 Prints the configuration into a stream with default verbosity. More...
 
std::ostream & operator<< (std::ostream &out, ExtraTriggerInfo const &info)
 
Creation of `sbn::OpDetWaveformMeta` from `raw::OpDetWaveform`

The creation of summary objects sbn::OpDetWaveformMeta from optical detector waveforms is possible with two options:

For usage examples, see their respective documentation.

OpDetWaveformMeta makeOpDetWaveformMeta (raw::OpDetWaveform const &waveform, detinfo::DetectorTimings const &detTimings)
 Creates a sbn::OpDetWaveformMeta out of a raw::OpDetWaveform. More...
 
OpDetWaveformMeta makeOpDetWaveformMeta (raw::OpDetWaveform const &waveform, util::quantities::intervals::microseconds opDetTickPeriod)
 Creates a sbn::OpDetWaveformMeta out of a raw::OpDetWaveform. More...
 

Variables

constexpr int default_int = std::numeric_limits<int>::max()
 
constexpr float default_float = std::numeric_limits<float>::signaling_NaN()
 

Detailed Description

This module creates Common Analysis Files.

Set of values to identify a beam.

Multivariate Gaussian sampling utilities.

Original author: J. Zennamo.

Note: In larsim EventWeight, these functions are static members of the WeightCalc class.

The constants are used to identify the gate during which a trigger is acquired, in the raw::Trigger::TriggerBits() bit mask.

Enumeration Type Documentation

enum sbn::EDet
Enumerator
kNOTDEFINED 
kSBND 
kICARUS 

Definition at line 70 of file TrackCaloSkimmer.h.

const int kSBND
Definition: ExpInfo.h:11
const int kICARUS
Definition: ExpInfo.h:13

Function Documentation

TriggerEmulationTree::TriggerInputSpec_t sbn::convert ( TriggerEmulationTree::Config::TriggerSpecConfig const &  config)

Definition at line 231 of file TriggerEmulationTree_module.cc.

232  {
233  return {
234  config.Name() // name
235  , config.TriggerTag() // inputTag
236  };
237  } // convert(sbn::TriggerSpecConfig)
TimeTrackTreeStorage::TriggerInputSpec_t sbn::convert ( TimeTrackTreeStorage::Config::TriggerSpecConfig const &  config)

Definition at line 388 of file TimeTrackTreeStorage_module.cc.

389  {
390  return {
391  config.Name() // name
392  , config.TriggerTag() // inputTag
393  };
394  } // convert(sbn::TriggerSpecConfig)
double sbn::GetEfield ( const detinfo::DetectorPropertiesData dprop,
const spacecharge::SpaceCharge sce,
geo::Point_t  loc,
geo::TPCID  TPC,
bool  correct_loc_sce,
float  xsign = 1. 
)

Get the E-Field in the presence of space charge.

Definition at line 14 of file StubMergeAlgorithms.cxx.

14  {
15 
16  double EField = dprop.Efield();
17  if (sce && sce->EnableSimEfieldSCE()) {
18  if (correct_loc_sce) loc = sbn::GetLocation(sce, loc, TPC, xsign);
19 
20  // Gets relative E field Distortions
21  geo::Vector_t EFieldOffsets = sce->GetEfieldOffsets(loc);
22  // Add 1 in X direction as this is the direction of the drift field
23  EFieldOffsets = EFieldOffsets + geo::Xaxis();
24  // Convert to Absolute E Field from relative
25  EFieldOffsets = EField * EFieldOffsets;
26  // We only care about the magnitude for recombination
27  EField = EFieldOffsets.r();
28  }
29 
30  return EField;
31 }
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:164
geo::Point_t GetLocation(const spacecharge::SpaceCharge *sce, geo::Point_t loc_w, geo::TPCID TPC, float xsign=1.)
Get the location in the presence of space charge.
double Efield(unsigned int planegap=0) const
kV/cm
virtual geo::Vector_t GetEfieldOffsets(geo::Point_t const &point) const =0
constexpr Vector Xaxis()
Returns a x axis vector of the specified type.
Definition: geo_vectors.h:215
virtual bool EnableSimEfieldSCE() const =0
geo::Point_t sbn::GetLocation ( const spacecharge::SpaceCharge sce,
geo::Point_t  loc_w,
geo::TPCID  TPC,
float  xsign = 1. 
)

Get the location in the presence of space charge.

Definition at line 3 of file StubMergeAlgorithms.cxx.

3  {
4  if (sce && sce->EnableCalSpatialSCE()) {
5  geo::Vector_t offset = sce->GetCalPosOffsets(loc_w, TPC.TPC);
6  loc_w.SetX(loc_w.X() + xsign * offset.X());
7  loc_w.SetY(loc_w.Y() + offset.Y());
8  loc_w.SetZ(loc_w.Z() + offset.Z());
9  }
10 
11  return loc_w;
12 }
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:164
virtual geo::Vector_t GetCalPosOffsets(geo::Point_t const &point, int const &TPCid) const =0
BEGIN_PROLOG TPC Trig offset(g4 rise time) ProjectToHeight
Definition: CORSIKAGen.fcl:7
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:406
virtual bool EnableCalSpatialSCE() const =0
geo::Point_t sbn::GetLocationAtWires ( const spacecharge::SpaceCharge sce,
const geo::GeometryCore geo,
geo::Point_t  loc,
geo::TPCID  TPC,
float  xsign = 1. 
)

Get the SCE-distorted location (i.e. the location "seen" by the wireplanes)

Definition at line 33 of file StubMergeAlgorithms.cxx.

33  {
34  if (sce && sce->EnableCalSpatialSCE()) {
35  // Returned X is the drift -- multiply by the drift direction to undo this
36  int corr = geo->TPC(TPC).DriftDir()[0];
37 
39  loc.SetX(loc.X() + corr * xsign * offset.X());
40  loc.SetY(loc.Y() + offset.Y());
41  loc.SetZ(loc.Z() + offset.Z());
42  }
43 
44  return loc;
45 }
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:164
Vector DriftDir() const
Returns the direction of the drift (vector pointing toward the planes).
Definition: TPCGeo.h:773
BEGIN_PROLOG TPC Trig offset(g4 rise time) ProjectToHeight
Definition: CORSIKAGen.fcl:7
virtual geo::Vector_t GetPosOffsets(geo::Point_t const &point) const =0
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
virtual bool EnableCalSpatialSCE() const =0
double sbn::GetPitch ( const geo::GeometryCore geo,
const spacecharge::SpaceCharge sce,
geo::Point_t  loc,
geo::Vector_t  dir,
geo::View_t  view,
geo::TPCID  tpc,
bool  correct_sce,
bool  track_is_sce_corrected,
float  xsign = 1. 
)

Computes the track-pitch on a plane given an input direction and location.

Parameters
loclocation in world coordinate system [cm]
dirdirection in world coordinate system (assumed to be unit vector)
viewthe view to project the direction onto
tpcID of the TPC the selected view belongs to
correct_scewhether to apply space charge correction
track_is_sce_correctedwhether location loc is already corrected for spacecharge effects
xsignfactor for the x (drift) coordinate (-1 flips it)
Returns
the pitch along direction dir [cm]

Is able to handle the presence of space charge (through the SpaceCharge service) and whether or not the input location/direction are already corrected for SCE.

Definition at line 47 of file StubMergeAlgorithms.cxx.

51  {
52 
53  double angleToVert = geo->WireAngleToVertical(view, tpc) - 0.5*::util::pi<>();
54 
55  geo::Vector_t dir_w;
56 
57  // "dir_w" should be the direction that the wires see. If the track already has the field
58  // distortion corrections applied, then we need to de-apply them to get the direction as
59  // seen by the wire planes
60  if (correct_sce && track_is_sce_corrected) {
61  // compute the dir of the track trajectory
62  geo::Point_t loc_mdx = loc - dir * (geo->WirePitch(view) / 2.);
63  geo::Point_t loc_pdx = loc + dir * (geo->WirePitch(view) / 2.);
64 
65  // map to the wires
66  loc_mdx = GetLocationAtWires(sce, geo, loc_mdx, tpc, xsign);
67  loc_pdx = GetLocationAtWires(sce, geo, loc_pdx, tpc, xsign);
68 
69  dir_w = (loc_pdx - loc_mdx).Unit();
70  }
71  // If there is no space charge or the track is not yet corrected, then the dir
72  // is what we want
73  else {
74  dir_w = dir;
75  }
76 
77  double cosgamma = std::abs(std::sin(angleToVert)*dir_w.Y() + std::cos(angleToVert)*dir_w.Z());
78  double pitch;
79  if (cosgamma) {
80  pitch = geo->WirePitch(view)/cosgamma;
81  }
82  else {
83  pitch = 0.;
84  }
85 
86  // now take the pitch computed on the wires and correct it back to the particle trajectory
87  geo::Point_t loc_w = loc;
88  if (correct_sce && track_is_sce_corrected) {
89  loc_w = sbn::GetLocationAtWires(sce, geo, loc, tpc, xsign);
90  }
91 
92  geo::Point_t locw_traj = (correct_sce) ? sbn::GetLocation(sce, loc_w, tpc, xsign) : loc_w;
93  geo::Point_t locw_pdx_traj = (correct_sce) ? sbn::GetLocation(sce, loc_w + pitch * dir_w, tpc, xsign) : (loc_w + pitch * dir_w);
94 
95  pitch = (locw_traj - locw_pdx_traj).R();
96 
97  return pitch;
98 }
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:164
geo::Point_t GetLocation(const spacecharge::SpaceCharge *sce, geo::Point_t loc_w, geo::TPCID TPC, float xsign=1.)
Get the location in the presence of space charge.
geo::Length_t WirePitch(geo::PlaneID const &planeid) const
Returns the distance between two consecutive wires.
geo::Point_t GetLocationAtWires(const spacecharge::SpaceCharge *sce, const geo::GeometryCore *geo, geo::Point_t loc, geo::TPCID TPC, float xsign=1.)
Get the SCE-distorted location (i.e. the location &quot;seen&quot; by the wireplanes)
T abs(T value)
tuple dir
Definition: dropbox.py:28
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
double WireAngleToVertical(geo::View_t view, geo::TPCID const &tpcid) const
Returns the angle of the wires in the specified view from vertical.
sbn::OpDetWaveformMeta sbn::makeOpDetWaveformMeta ( raw::OpDetWaveform const &  waveform,
detinfo::DetectorTimings const &  detTimings 
)

Creates a sbn::OpDetWaveformMeta out of a raw::OpDetWaveform.

Parameters
waveformthe input waveform
detTimingstiming service provider
Returns
a sbn::OpDetWaveformMeta object with the summary information

Returns a new summary object extracted from the waveform.

The timing information is used to determine whether the global trigger and beam times are included.

Example:

(art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(event));

Definition at line 83 of file OpDetWaveformMetaUtils.cxx.

86  {
87  return sbn::OpDetWaveformMetaMaker{ detTimings }.make(waveform);
88 }
Converter from raw::OpDetWaveform into sbn::OpDetWaveformMeta.
fDetProps &fDetProps fDetProps &fDetProps detTimings
sbn::OpDetWaveformMeta sbn::makeOpDetWaveformMeta ( raw::OpDetWaveform const &  waveform,
util::quantities::intervals::microseconds  opDetTickPeriod 
)

Creates a sbn::OpDetWaveformMeta out of a raw::OpDetWaveform.

Parameters
waveformthe input waveform
opDetTickPeriodperiod of the optical detector digitizer
Returns
a sbn::OpDetWaveformMeta object with the summary information

Returns a new summary object extracted from the waveform.

Information requiring timing is not saved.

Example:

Definition at line 91 of file OpDetWaveformMetaUtils.cxx.

94  {
95  return sbn::OpDetWaveformMetaMaker{ opDetTickPeriod }.make(waveform);
96 }
Converter from raw::OpDetWaveform into sbn::OpDetWaveformMeta.
std::ostream & sbn::operator<< ( std::ostream &  out,
sbn::PMTconfiguration const &  config 
)
inline

Prints the configuration into a stream with default verbosity.

Definition at line 150 of file PMTconfiguration.h.

151  { config.dump(out); return out; }
std::ostream & sbn::operator<< ( std::ostream &  out,
sbn::V1730Configuration const &  config 
)
inline

Prints the configuration into a stream with default verbosity.

Definition at line 233 of file V1730Configuration.h.

234  { config.dump(out); return out; }
std::ostream & sbn::operator<< ( std::ostream &  out,
sbn::V1730channelConfiguration const &  config 
)
inline

Prints the configuration into a stream with default verbosity.

Definition at line 191 of file V1730channelConfiguration.h.

192  { config.dump(out); return out; }
std::ostream & sbn::operator<< ( std::ostream &  out,
ExtraTriggerInfo const &  info 
)

Definition at line 114 of file ExtraTriggerInfo.cxx.

115 {
116  if (!info.isValid()) {
117  out << "<invalid>";
118  return out;
119  }
120 
121  // quite a load:
122  out
123  << "trigger ID=" << dumpTriggerID(info.triggerID)
124  << " (type " << name(info.triggerType) << ")"
125  << " from source " << name(info.sourceType)
126  << " at " << dumpTimestamp(info.triggerTimestamp)
127  << " on beam gate ID=" << dumpTriggerID(info.gateID)
128  << " at " << dumpTimestamp(info.beamGateTimestamp)
129  << " (diff: "
130  << timestampDiff(info.beamGateTimestamp, info.triggerTimestamp) << " ns)"
131  << "\n"
132  << "enable gate opened at " << dumpTimestamp(info.enableGateTimestamp)
133  << " (" << timestampDiff(info.beamGateTimestamp, info.enableGateTimestamp)
134  << " ns before the gate)"
135  << "\n"
136  << "counts from this source: trigger="
137  << dumpTriggerCount(info.triggerCount)
138  << " beam=" << dumpTriggerCount(info.gateCount)
139  << "\n"
140  << "previous trigger from this source at "
141  << dumpTimestamp(info.previousTriggerTimestamp)
142  << ", triggers since: "
143  << dumpTriggerCount(info.anyTriggerCountFromPreviousTrigger)
144  << ", gates since: "
145  << dumpTriggerCount(info.anyGateCountFromPreviousTrigger)
146  << " ("
147  << dumpTriggerCount(info.gateCountFromPreviousTrigger)
148  << " from this same source)"
149  << "\n"
150  << "most recent trigger was from source "
151  << name(info.anyPreviousTriggerSourceType) << " at "
152  << dumpTimestamp(info.anyPreviousTriggerTimestamp)
153  ;
154  if (sbn::ExtraTriggerInfo::isValidTimestamp(info.anyPreviousTriggerTimestamp)
155  && sbn::ExtraTriggerInfo::isValidTimestamp(info.triggerTimestamp))
156  {
157  out
158  << " ("
159  << dumpTimestamp(info.triggerTimestamp - info.anyPreviousTriggerTimestamp)
160  << " earlier)";
161  }
162  out
163  << ", and "
164  << dumpTriggerCount(info.anyGateCountFromAnyPreviousTrigger)
165  << " gates from any source have opened since"
166  ;
167  if (info.WRtimeToTriggerTime != ExtraTriggerInfo::UnknownCorrection) {
168  out << "\nCorrection applied to the timestamps: "
169  << dumpTimestamp(info.WRtimeToTriggerTime);
170  }
171  if (info.triggerLocationBits != 0) {
172  out << "\nLocation(s) of trigger:";
173  for (std::string const& bitName: names(info.triggerLocation()))
174  out << " " << bitName;
175  }
176  out << "\nWest cryostat: "
177  << info.cryostats[ExtraTriggerInfo::WestCryostat].triggerCount
178  << " triggers";
179  if (auto const& cryo = info.cryostats[ExtraTriggerInfo::WestCryostat];
180  cryo.hasLVDS()
181  ) {
182  out
183  << "\n west wall: "
184  << dumpLVDSmask(cryo.LVDSstatus[ExtraTriggerInfo::WestPMTwall])
185  << "\n east wall: "
186  << dumpLVDSmask(cryo.LVDSstatus[ExtraTriggerInfo::EastPMTwall])
187  ;
188  }
189 
190  out << "\nEast cryostat: "
191  << info.cryostats[ExtraTriggerInfo::EastCryostat].triggerCount
192  << " triggers";
193  if (auto const& cryo = info.cryostats[ExtraTriggerInfo::EastCryostat];
194  cryo.hasLVDS()
195  ) {
196  out
197  << "\n west wall: "
198  << dumpLVDSmask(cryo.LVDSstatus[ExtraTriggerInfo::WestPMTwall])
199  << "\n east wall: "
200  << dumpLVDSmask(cryo.LVDSstatus[ExtraTriggerInfo::EastPMTwall])
201  ;
202  }
203 
204 
205  return out;
206 } // sbn::operator<< (ExtraTriggerInfo)
std::string bitName(triggerSource bit)
Returns a mnemonic short name of the beam type.
Definition: BeamBits.h:267
static const std::vector< std::string > names
static constexpr bool isValidTimestamp(std::uint64_t ts) noexcept
Returns whether the timestamp ts is valid (i.e. is not NoTimestamp).
then echo fcl name
float sbn::StubChargeOffset ( const sbn::StubInfo A,
const sbn::StubInfo B 
)

Difference of the total charge between two stubs.

Definition at line 195 of file StubMergeAlgorithms.cxx.

195  {
196  assert(A.stub.hits.size() == 1 && B.stub.hits.size() == 1);
197 
198  // Only count charge on the main stub
199  float ACharge = A.stub.CoreCharge();
200  float BCharge = B.stub.CoreCharge();
201 
202  return abs(ACharge - BCharge);
203 }
std::vector< std::vector< StubHit > > hits
Hits on each plane. Ordered vtx-&gt;end.
Definition: Stub.h:32
float CoreCharge(unsigned plane_index=0) const
Helper functions.
Definition: Stub.cxx:25
T abs(T value)
bool sbn::StubContains ( const sbn::StubInfo A,
const sbn::StubInfo B 
)

Returns whether stub A contains stub B.

Definition at line 102 of file StubMergeAlgorithms.cxx.

102  {
103  if (A.vhit_hit->WireID().Plane != B.vhit_hit->WireID().Plane) return false;
104 
105  for (const art::Ptr<recob::Hit> &h: A.hits) {
106  if (A.stub.OnCore(h->WireID())) {
107  if (h.key() == B.vhit_hit.key()) {
108  return true;
109  }
110  }
111  }
112  return false;
113 }
bool OnCore(const geo::WireID &w) const
Returns whether the input wire-ID is on the core of the stub.
Definition: Stub.cxx:57
std::vector< art::Ptr< recob::Hit > > hits
while getopts h
art::Ptr< recob::Hit > vhit_hit
float sbn::StubDirectionDot ( const sbn::StubInfo A,
const sbn::StubInfo B,
const geo::GeometryCore geo,
const detinfo::DetectorPropertiesData dprop 
)

Computes the dot product of two stubs.

Definition at line 115 of file StubMergeAlgorithms.cxx.

117  {
118 
119  // A and B should chare vertex locations
120  //
121  // We want this to be the vertex as seen by the wires
122  float vert_w = A.vhit->vtxw;
123  float vert_x = A.vhit->vtxx;;
124 
125  float Ahit_w = A.vhit_hit->WireID().Wire * geo->WirePitch() - vert_w;
126  float Ahit_x = dprop.ConvertTicksToX(A.vhit_hit->PeakTime(), A.vhit_hit->WireID()) - vert_x;
127 
128  float Bhit_w = B.vhit_hit->WireID().Wire * geo->WirePitch() - vert_w;
129  float Bhit_x = dprop.ConvertTicksToX(B.vhit_hit->PeakTime(), B.vhit_hit->WireID()) - vert_x;
130 
131  float Amag = sqrt(Ahit_w*Ahit_w + Ahit_x*Ahit_x);
132  float Bmag = sqrt(Bhit_w*Bhit_w + Bhit_x*Bhit_x);
133 
134  return(Ahit_w*Bhit_w + Ahit_x*Bhit_x) / (Amag*Bmag);
135 }
geo::Length_t WirePitch(geo::PlaneID const &planeid) const
Returns the distance between two consecutive wires.
art::Ptr< recob::Hit > vhit_hit
double ConvertTicksToX(double ticks, int p, int t, int c) const
art::Ptr< sbn::VertexHit > vhit
float sbn::StubPeakChargeOffset ( const sbn::StubInfo A,
const sbn::StubInfo B 
)

Difference of the endpoint charge between two stubs.

Definition at line 205 of file StubMergeAlgorithms.cxx.

205  {
206  return abs(A.vhit->charge - B.vhit->charge);
207 }
T abs(T value)
art::Ptr< sbn::VertexHit > vhit
float sbn::StubPeakdQdxOffset ( const sbn::StubInfo A,
const sbn::StubInfo B,
const geo::GeometryCore geo,
const spacecharge::SpaceCharge sce,
const detinfo::DetectorPropertiesData dprop 
)

Difference of the endpoint dQ/dx between two stubs.

Definition at line 209 of file StubMergeAlgorithms.cxx.

212  {
213 
214  // stubs should share the vertex
215  geo::Point_t vtx = A.stub.vtx;
216  geo::Point_t end = sbn::TwoStubEndPosition(A, B, geo, sce, dprop);
217 
218  geo::Vector_t dir((end-vtx).Unit());
219 
220  // Input point, dir are always space charge corrected here
221  float Apitch = GetPitch(geo, sce, end, dir, A.vhit_hit->View(), A.vhit_hit->WireID(), true, true);
222  float Bpitch = GetPitch(geo, sce, end, dir, B.vhit_hit->View(), B.vhit_hit->WireID(), true, true);
223 
224  return abs(A.vhit->charge / Apitch - B.vhit->charge / Bpitch);
225 }
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:164
geo::Point_t vtx
Interaction Vertex / Start of Stub. Space charge corrected. [cm].
Definition: Stub.h:18
T abs(T value)
auto end(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:585
art::Ptr< recob::Hit > vhit_hit
double GetPitch(const geo::GeometryCore *geo, const spacecharge::SpaceCharge *sce, geo::Point_t loc, geo::Vector_t dir, geo::View_t view, geo::TPCID tpc, bool correct_sce, bool track_is_sce_corrected, float xsign=1.)
Computes the track-pitch on a plane given an input direction and location.
tuple dir
Definition: dropbox.py:28
art::Ptr< sbn::VertexHit > vhit
geo::Point_t TwoStubEndPosition(const sbn::StubInfo &A, const sbn::StubInfo &B, const geo::GeometryCore *geo, const spacecharge::SpaceCharge *sce, const detinfo::DetectorPropertiesData &dprop)
Returns an updated end position of a stub after merging across two planes.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
float sbn::StubTimeOffset ( const sbn::StubInfo A,
const sbn::StubInfo B,
const detinfo::DetectorClocksData dclock,
const detinfo::DetectorPropertiesData dprop 
)

Definition at line 137 of file StubMergeAlgorithms.cxx.

139  {
140 
141  // Convert the ticks to an X-point to undo tick-offsets between planes. And then convert to ticks.
142  return abs(dprop.ConvertTicksToX(A.vhit_hit->PeakTime(), A.vhit_hit->WireID()) - dprop.ConvertTicksToX(B.vhit_hit->PeakTime(), B.vhit_hit->WireID())) / dprop.DriftVelocity() / dclock.TPCClock().TickPeriod();
143 }
ElecClock const & TPCClock() const noexcept
Borrow a const TPC clock with time set to Trigger time [us].
constexpr double TickPeriod() const noexcept
A single tick period in microseconds.
Definition: ElecClock.h:352
T abs(T value)
art::Ptr< recob::Hit > vhit_hit
double DriftVelocity(double efield=0., double temperature=0.) const
cm/us
double ConvertTicksToX(double ticks, int p, int t, int c) const
geo::Point_t sbn::TwoStubEndPosition ( const sbn::StubInfo A,
const sbn::StubInfo B,
const geo::GeometryCore geo,
const spacecharge::SpaceCharge sce,
const detinfo::DetectorPropertiesData dprop 
)

Returns an updated end position of a stub after merging across two planes.

Definition at line 145 of file StubMergeAlgorithms.cxx.

148  {
149 
150  static constexpr bool VERBOSE = false;
151 
152  // intersect the wires with the geometry service
153  geo::Point_t yz;
154  bool intersects = geo->WireIDsIntersect(A.vhit_hit->WireID(), B.vhit_hit->WireID(), yz);
155  (void) intersects; // TODO: Do we care if the wires intersect? Means the end point will be outside the AV
156  double y = yz.Y();
157  double z = yz.Z();
158 
159  // just average the x-pos
160  double x = (dprop.ConvertTicksToX(A.vhit_hit->PeakTime(), A.vhit_hit->WireID()) + dprop.ConvertTicksToX(B.vhit_hit->PeakTime(), B.vhit_hit->WireID())) / 2.;
161 
162  geo::Point_t pos(x, y, z);
163 
164  // Correct for space charge
165  pos = GetLocation(sce, pos, A.vhit_hit->WireID());
166 
167  if (VERBOSE) {
168  std::cout << "A View: " << geo->View(A.vhit_hit->WireID()) << " Angle to Vertical: " << geo->WireAngleToVertical(geo->View(A.vhit_hit->WireID()), A.vhit_hit->WireID()) << std::endl;
169  std::cout << "B View: " << geo->View(B.vhit_hit->WireID()) << " Angle to Vertical: " << geo->WireAngleToVertical(geo->View(B.vhit_hit->WireID()), B.vhit_hit->WireID()) << std::endl;
170  std::cout << "A End: " << A.stub.end.X() << " " << A.stub.end.Y() << " " << A.stub.end.Z() << std::endl;
171  std::cout << "B End: " << B.stub.end.X() << " " << B.stub.end.Y() << " " << B.stub.end.Z() << std::endl;
172  std::cout << "A Wire Pos Y: " << geo->Wire(A.vhit_hit->WireID()).GetCenter().Y() << " Z: " << geo->Wire(A.vhit_hit->WireID()).GetCenter().Z() << std::endl;
173  std::cout << "B Wire Pos Y: " << geo->Wire(B.vhit_hit->WireID()).GetCenter().Y() << " Z: " << geo->Wire(B.vhit_hit->WireID()).GetCenter().Z() << std::endl;
174 
175  std::cout << "A Wire: " << A.vhit_hit->WireID().Wire << " Plane: " << A.vhit_hit->WireID().Plane << " TPC: " << A.vhit_hit->WireID().TPC << std::endl;
176  std::cout << "B Wire: " << B.vhit_hit->WireID().Wire << " Plane: " << B.vhit_hit->WireID().Plane << " TPC: " << B.vhit_hit->WireID().TPC << std::endl;
177 
178  std::cout << "Output Y: " << y << " Z: " << z << std::endl;
179 
180  std::cout << "A Wire coord: " << geo->WireCoordinate(pos, A.vhit_hit->WireID()) << std::endl;
181  std::cout << "B Wire coord: " << geo->WireCoordinate(pos, B.vhit_hit->WireID()) << std::endl;
182 
183  std::cout << "A X: " << dprop.ConvertTicksToX(A.vhit_hit->PeakTime(), A.vhit_hit->WireID()) << std::endl;
184  std::cout << "B X: " << dprop.ConvertTicksToX(B.vhit_hit->PeakTime(), B.vhit_hit->WireID()) << std::endl;
185 
186  std::cout << "Output X: " << x << std::endl;
187 
188 
189  std::cout << "Final x: " << pos.x() << " y: " << pos.y() << " z: " << pos.z() << std::endl;
190  }
191 
192  return pos;
193 }
geo::Length_t WireCoordinate(double YPos, double ZPos, geo::PlaneID const &planeid) const
Returns the index of the nearest wire to the specified position.
process_name opflash particleana ie ie ie z
process_name opflash particleana ie x
geo::Point_t end
End of Stub. Space charge corrected. [cm].
Definition: Stub.h:19
geo::Point_t GetLocation(const spacecharge::SpaceCharge *sce, geo::Point_t loc_w, geo::TPCID TPC, float xsign=1.)
Get the location in the presence of space charge.
process_name opflash particleana ie ie y
art::Ptr< recob::Hit > vhit_hit
j template void())
Definition: json.hpp:3108
View_t View(geo::PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
double ConvertTicksToX(double ticks, int p, int t, int c) const
bool WireIDsIntersect(WireID const &wid1, WireID const &wid2, geo::Point_t &intersection) const
Computes the intersection between two wires.
WireGeo const & Wire(geo::WireID const &wireid) const
Returns the specified wire.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
double WireAngleToVertical(geo::View_t view, geo::TPCID const &tpcid) const
Returns the angle of the wires in the specified view from vertical.
BEGIN_PROLOG could also be cout

Variable Documentation

constexpr float sbn::default_float = std::numeric_limits<float>::signaling_NaN()

Definition at line 10 of file CRUMBSResult.h.

constexpr int sbn::default_int = std::numeric_limits<int>::max()

Definition at line 9 of file CRUMBSResult.h.