diff --git a/sbnanaobj/StandardRecord/SRBlip.h b/sbnanaobj/StandardRecord/SRBlip.h new file mode 100644 index 0000000..c5c0407 --- /dev/null +++ b/sbnanaobj/StandardRecord/SRBlip.h @@ -0,0 +1,59 @@ +/** + * @file SRBlip.h + * @brief SRBlip object for localized energy deposits in bulk LAr + * @author Jacob McLaughlin - jmclaughlin2@illinoistech.edu + */ +#ifndef SRBLIP_H +#define SRBLIP_H +#include "sbnanaobj/StandardRecord/SRVector3D.h" +#include "sbnanaobj/StandardRecord/SRBlipHitClust.h" +#include "sbnanaobj/StandardRecord/SRTrueBlip.h" +#include "sbnanaobj/StandardRecord/SRConstants.h" + +namespace caf +{ + /** Blips are small, plane-matched, energy deposition in liquid argon with sizes similar to wire separation. + * Blips are composed of hit-clusters, which are (time and space) adjacent hits on a single wire plane. + * A single plane, usually the collection, is given a privledged position as the calorimetry plane. + * Every hit-cluster on the calorimetry plane is checked for matches on the other two planes, and when multiple possible pairs are found + * the highest scoring one is selected. + * Score components include cluster charge, cluster time duration, cluster peak time, and wire intersections. + */ + struct SRBlip{ + static constexpr int kNplanes = 3; + int ID=caf::kUninitializedInt; ///< Internal index for blip labelling + bool isValid=false; ///< Blip passes basic checks in reco. All blips saved to artRoot file should be valid. + int cryostat=caf::kUninitializedInt; ///< Which cryostat the blip was reconstructed to. For SBND this should always be 0. + int TPC=caf::kUninitializedInt; ///< Which tpc the blip was reconstructed to. For SBND this may be 0 or 1. + int nPlanes=caf::kUninitializedInt; ///< Number of planes matched to build the blip. Blips must be plane matched so this should be 2+ planes. + int maxWireSpan=caf::kUninitializedInt; ///< Maximum span of wires on any plane hit-cluster + float timeTick=-999; ///< Average time of hitclusters making up blips. [tpc tick] + /*! + Hit cluster time is the charge-weighted average of the hit-peak times for hits in the cluster + */ + float time=-999; ///< Average time of hitclusters making up blips. [us] + /*! + Hit cluster time is the charge-weighted average of the hit-peak times for hits in the cluster + */ + float charge=caf::kSignalingNaN; ///< Charge on calorimetry plane [e-] + float energy=caf::kSignalingNaN; ///< Reconstructed energy in the calorimetry plane (const dE/dx, fcl-configurable) [GeV] + float energyESTAR=caf::kSignalingNaN; ///< Reconstructed energy in the calorimetry plane (ESTAR method from ArgoNeuT) [GeV] + float energyPSTAR=caf::kSignalingNaN; ///< Reconstructed energy in the calorimetry plane (PSTAR method similar with ESTAR method from ArgoNeuT) [GeV] + float proxTrkDist=caf::kSignalingNaN; ///< 3-D distance to closest track, assuming the blip was coincident with event trigger [cm] + /*! + for properly flash matched out-of-time tracks this distance will be wrong! The blips have no such flash matching ability as of yet + */ + int proxTrkID=caf::kUninitializedInt; ///< index of the of closest track, assuming the blip was coincident with event trigger (recob::Track::ID()) + bool inCylinder=false; ///< Bool for whether this blip falls in a 45 degree cone relative to any track closer than fcl-set CylinderRadius (15 cm) + /*! + please note the blip X position is unreliable, so these distance and 3-d position derived variables may be incorrect + */ + SRVector3D position; ///< 3D position vector. Reconstructed assuming that the blip was coincident with the event trigger [cm] + float sigmaYZ=caf::kSignalingNaN; ///< Uncertainty in YZ intersect [cm] + float dX=caf::kSignalingNaN; ///< Equivalent length along drift direction [cm] + float dYZ=caf::kSignalingNaN; ///< Approximate length scale in YZ space [cm] + SRBlipHitClust clusters[kNplanes]; ///< Plane/cluster-specific information. Just contains hit clusters making up this blip! + SRTrueBlip truthBlip; ///< Truth-matched energy deposition. Just contains the relevant MC truth info to this blip! + }; +} +#endif diff --git a/sbnanaobj/StandardRecord/SRBlipHitClust.h b/sbnanaobj/StandardRecord/SRBlipHitClust.h new file mode 100644 index 0000000..77abb86 --- /dev/null +++ b/sbnanaobj/StandardRecord/SRBlipHitClust.h @@ -0,0 +1,62 @@ +/** + * @file SRBlipHitClust.h + * @brief SRBlipHitClust struct contains information on hit clusters on each plane used to form a SRBlip + * @author Jacob McLaughlin - jmclaughlin2@illinoistech.edu + */ +#ifndef SBNANAOBJ_STANDARDRECORD_SRBLIPHITCLUST_H +#define SBNANAOBJ_STANDARDRECORD_SRBLIPHITCLUST_H +#include +#include "sbnanaobj/StandardRecord/SRVector3D.h" +#include "sbnanaobj/StandardRecord/SRConstants.h" + +namespace caf +{ + /** Hit clusters are collections of adjacent hits on a single wire plane. + * They have a fcl-set maximum wire-span (fcl set. Default 10), as well as maximum tick-width (fcl set. Default 50 tick). + * Hit clusters have timestamp and associated wire IDs. + * Within a hit cluster certain statistical summaries of the collection are saved including: + * Total charge, total charge uncertianty, peak hit amplitude, and charge weighted RMS hit spread + */ + struct SRBlipHitClust { + int ID = caf::kUninitializedInt; ///< Per-plane index for the hit clusters. In SBND we save every collection plane hitcluster but not the induction + bool isValid = false; ///< Bool check that every hit is in the same cryostat, tpc, plane. Should always be true for saved items + bool isTruthMatched = false; ///< is there a trueBlip with the same leadG4ID as one of the G4IDs making up this cluster + bool isMatched = false; ///< Is this hit cluster plane-matched into a full 3d blip + int centerChan = caf::kUninitializedInt; ///< Channel ID of the wire in the geometric center of the hit cluster + int centerWire = caf::kUninitializedInt; ///< Wire ID of the wire in the geometric center of the hit cluster + int deadWireSep = caf::kUninitializedInt; ///< Separation between the extreme ends of the hitcluster and the nearest dead wire. + /*! + DeadWireSep can be between 0 and 5 and valid. Larger separations are filled in as 99. + */ + int cryostat = caf::kUninitializedInt; ///< cryostat for this hit cluster + int TPC = caf::kUninitializedInt; ///< TPC for this hit cluster + int plane = caf::kUninitializedInt; ///< Plane index for this hit cluster + int nHits = caf::kUninitializedInt; ///< Number of hits making up this hit cluster + int nWires = caf::kUninitializedInt; ///< Wire span of the hit cluster + float ADCs = caf::kUninitializedInt; ///< ADC integral sum of hits making up the cluster [ADC-tick] + float amplitude = caf::kUninitializedInt; ///< Max amplitude of hits making up the hit cluster [ADC] + float charge = caf::kUninitializedInt; ///< Total charge of hits making up the hit cluster [e-] + /*! + Charge is reconstructed from calo::CalorimetryAlg ( "sbnd_calorimetryalgmc" )-> ElectronsFromADCArea function + Configuration is in sbndcode/sbndcode/LArSoftConfigurations/calorimetry_sbnd.fcl + */ + float sigmaCharge = caf::kSignalingNaN; ///< charge-weighted charge uncertainties for this hit-cluster [e-] + float timeTick = caf::kSignalingNaN; ///< charge-weighted average hit-peak-times for this hit-cluster [tick] + float time = caf::kSignalingNaN; ///< charge-weighted average hit-peak-times for this hit-cluster [us] + float startTime = caf::kSignalingNaN; ///< Minimum -1 sigma time of a hit in this cluster [us] + float endTime = caf::kSignalingNaN; ///< Max +1 sigma time of a hit in this cluster [us] + float timespan = caf::kSignalingNaN; ///< Hit cluster EndTime - StartTime [us] + float RMS = caf::kSignalingNaN; ///< Quadrature estimate of charge waveform timespread accounting for varied hit-drift times and internal hit-RMS [us] + int startWire = caf::kUninitializedInt; ///< Lowest wireID involved with the hitcluster + int endWire = caf::kUninitializedInt; ///< Highest wireID involved with the hit cluster + int nPulseTrainHits = caf::kUninitializedInt; ///< Number of hits with a GoodnessOfFit<0 involved in this hit cluster + float goodnessOfFit = caf::kSignalingNaN; ///< Charge weighted hit-GoodnessofFit param + int blipID = caf::kUninitializedInt; ///< If this hit cluster ended up in a blip, what is its ID + int edepID = caf::kUninitializedInt; ///< If this hit cluster is MC-matched what is the trueBlip ID + std::vector hitIDs; ///< Index of the `recob::Hit` objects making up this cluster. Size should match nHits + std::vector wires; ///< Set of `geo::WireID` contributing hits to this cluster. Size should match nWires + std::vector chans; ///< Set of `raw::ChannelID` contributing hits to this cluster + std::vector G4IDs; ///< `simb::MCParticle` track ID contributing hits to this cluster + }; +} +#endif diff --git a/sbnanaobj/StandardRecord/SRTrueBlip.h b/sbnanaobj/StandardRecord/SRTrueBlip.h new file mode 100644 index 0000000..774e689 --- /dev/null +++ b/sbnanaobj/StandardRecord/SRTrueBlip.h @@ -0,0 +1,39 @@ +/** + * @file SRTrueBlip.h + * @brief SRTrueBlip struct for localized energy deposits in bulk LAr. MC Truth information + * @author Jacob McLaughlin - jmclaughlin2@illinoistech.edu + */ + +#ifndef SBNANAOBJ_STANDARDRECORD_SRBLIPTRUEBLIP_H +#define SBNANAOBJ_STANDARDRECORD_SRBLIPTRUEBLIP_H +#include "sbnanaobj/StandardRecord/SRVector3D.h" +#include "sbnanaobj/StandardRecord/SRConstants.h" + + +namespace caf +{ + /** True energy depositions + * std::vector > makes a particle list + * std::vector makes a IDE list + * Together those make a blip::ParticleInfo object used to fill in this TrueBlip information + * For a reconstructed MC blip we will record the true blip info associated with it + * That blip reconstruction applies cuts to overall blip size/spread + * A single TrueBlip will be constructed for energy depositions within TrueBlipMergeDist (fcl set 0.3 cm by default) + */ + struct SRTrueBlip { + int ID = caf::kUninitializedInt; ///< Index of this trueBlip object + int cryostat = caf::kUninitializedInt; ///< Cryostat ID the blip reconstructed to + int TPC = caf::kUninitializedInt; ///< TPC ID the blip reconstructed to + float time = caf::kSignalingNaN; ///< Charge weighted peak time of TrueBlip energy depositions [tick] + float driftTime = caf::kSignalingNaN; ///< Charge weighted drift time of TrueBlip energy depositions [tick] + float energy = caf::kSignalingNaN; ///< Total energy dep [GeV] + int depElectrons = caf::kUninitializedInt; ///< Total deposited electrons [e-] + int numElectrons = caf::kUninitializedInt; ///< electrons reaching wires [e-] + int leadG4ID = caf::kUninitializedInt; ///< G4 track ID depositing the most charge in this deposition + int leadG4Index = caf::kUninitializedInt; ///< G4 track Index depositing the most charge in this deposition + int leadG4PDG = caf::kUninitializedInt; ///< G4 PDG associated with the track depositing the most charge + float leadCharge = caf::kSignalingNaN; ///< Largest charge deposition associated with this True Blip + SRVector3D position; ///< Charge weighted true-XYZ position [cm] + }; +} +#endif diff --git a/sbnanaobj/StandardRecord/StandardRecord.h b/sbnanaobj/StandardRecord/StandardRecord.h index 7734946..58cabe4 100644 --- a/sbnanaobj/StandardRecord/StandardRecord.h +++ b/sbnanaobj/StandardRecord/StandardRecord.h @@ -25,6 +25,7 @@ #include "sbnanaobj/StandardRecord/SRSoftwareTrigger.h" #include "sbnanaobj/StandardRecord/SRInteractionDLP.h" #include "sbnanaobj/StandardRecord/SRInteractionTruthDLP.h" +#include "sbnanaobj/StandardRecord/SRBlip.h" /// Common Analysis Files namespace caf @@ -67,6 +68,7 @@ namespace caf bool pass_flashtrig = false; ///< Whether this Record passed the Flash Trigger requirement SRSBNDFrameShiftInfo sbnd_frames; ///< List of Frame Shift in event in unit [ns] (SBND) SRSBNDTimingInfo sbnd_timings; ///< List of Timing Info in event in UNIX timestamp format(SBND) + std::vector blips; ///< Blips are small O(mm) depositions in LAr, made from recob::Hit SRSoftwareTrigger soft_trig; ///< Software Trigger Info in event int ndlp = 0; ///< Number of reco DLP (ML) interactions. std::vector dlp; ///< Reco DLP (ML) interactions. diff --git a/sbnanaobj/StandardRecord/classes_def.xml b/sbnanaobj/StandardRecord/classes_def.xml index 007cbb3..e5ed627 100644 --- a/sbnanaobj/StandardRecord/classes_def.xml +++ b/sbnanaobj/StandardRecord/classes_def.xml @@ -5,7 +5,8 @@ - + + @@ -328,8 +329,21 @@ + + + + + + + + + + + + + @@ -358,6 +372,9 @@ + + +