Classes | Namespaces | Enumerations | Functions
CosmicTrackAna_module.cc File Reference
#include <string>
#include <vector>
#include <limits>
#include <algorithm>
#include <initializer_list>
#include "TH1D.h"
#include "TH2D.h"
#include "TTree.h"
#include "TVector3.h"
#include "TSpline.h"
#include "TStopwatch.h"
#include "Calibrator/Calibrator.h"
#include "CalibrationUtils/CalibUtil.h"
#include "GeometryObjects/Geo.h"
#include "GeometryObjects/CellGeo.h"
#include "Geometry/Geometry.h"
#include "Geometry/LiveGeometry.h"
#include "MCCheater/BackTracker.h"
#include "NovaDAQConventions/DAQConventions.h"
#include "RecoBase/CellHit.h"
#include "RecoBase/RecoHit.h"
#include "RecoBase/Track.h"
#include "Simulation/Particle.h"
#include "Simulation/FLSHit.h"
#include "Simulation/ParticleNavigator.h"
#include "SummaryData/CosmicExposure.h"
#include "Utilities/func/MathUtil.h"
#include "TrackFit/CosmicTrackStruct.h"
#include "TrackFit/CosmicTrackSelection.h"
#include "TrackFit/CosmicTrackUtilities.h"
#include "BreakPointFitter/func/Path.h"
#include "art/Framework/Core/EDAnalyzer.h"
#include "art/Framework/Core/ModuleMacros.h"
#include "art/Framework/Principal/Event.h"
#include "art/Framework/Principal/SubRun.h"
#include "art/Framework/Principal/Handle.h"
#include "art/Framework/Services/Registry/ServiceHandle.h"
#include "art/Framework/Services/Optional/TFileService.h"
#include "art/Framework/Services/Optional/TFileDirectory.h"
#include "canvas/Persistency/Common/Ptr.h"
#include "canvas/Persistency/Common/PtrVector.h"
#include "fhiclcpp/ParameterSet.h"
#include "messagefacility/MessageLogger/MessageLogger.h"
#include "canvas/Persistency/Common/FindOne.h"

Go to the source code of this file.

Classes

class  trk::CosmicTrackAna
 

Namespaces

 trk
 Track finder for cosmic rays.
 

Enumerations

enum  _oneDRecoHists {
  kDCosX = 0, kDCosY, kDCosZ, kEndX,
  kEndY, kEndZ, kStartX, kStartY,
  kStartZ, kDiffX, kDiffY, kDiffZ,
  kFractionHitsUsed, kFractionSigUsed, kTrkCells, kTracksFound,
  kResidualsX, kResidualsY, kCellHitSig, kTrkSig,
  kVtxDistToEdge, kEndDistToEdge, kHitXPosition, kHitYPosition,
  kHitZPosition, kTrackLength, kCellHitX, kCellHitY,
  kPlaneHitX, kPlaneHitY, kCosCosmic, kAzimuth,
  kTNSX, kTNSY, kTrackRangeMomentum, kCellsPerPlaneX,
  kCellsPerPlaneY, kStepRelativeToMedian, kMax1DRecoHist
}
 Cosmic track analysis module CosmicTrackAna. Makes some validation plots. More...
 
enum  _oneDTruthHists {
  kDCosXDiff = 0, kDCosYDiff, kDCosZDiff, kRecoEff,
  kPrimaryTrueEnergy, kDeltaTrackLength, kDeltaRangeMomentum, kDeltaRangeMomentumUncor,
  kDeltaZEnd, kDeltaEnd, kDeltaBeg, kTrackEfficiency,
  kTrackPurity, kEndTrueX, kEndTrueY, kEndTrueZ,
  kStartTrueX, kStartTrueY, kStartTrueZ, kCosCosmicTrue,
  kAzimuthTrue, kMax1DTruthHist
}
 
enum  _twoDRecoHists {
  kFracHitsUsedVsNum = 0, kEndXY, kEndZX, kEndZY,
  kStartXY, kStartZX, kStartZY, kDirXY,
  kResidVsCosX, kResidVsCosY, kResidVsAzX, kResidVsAzY,
  kHitXYPosition, kHitXZPosition, kHitYZPosition, kCellPlaneX,
  kCellPlaneY, kCellsPerPlaneXY, kPEPerCMVsWX, kPEPerCMVsWY,
  kStepRelativeToMedianVsAz, kMax2DRecoHist
}
 
enum  _twoDTruthHists {
  kDCosXRecoVsTrue = 0, kDCosYRecoVsTrue, kDCosZRecoVsTrue, kDCosXDiffVsZLen,
  kDCosYDiffVsZLen, kDCosZDiffVsZLen, kTrackFindEff, kTracksFoundVsLeft,
  kDeltaZEndVsDCosZ, kDeltaZBegVsDCosZ, kDeltaZEndVsDistToEdge, kDiffEndVsDCosZ,
  kDiffBegVsDCosZ, kDiffEndVsAzimuth, kDiffBegVsAzimuth, kDiffEndVsCosTheta,
  kDiffBegVsCosTheta, kDeltaRangeMomVsLength, kDeltaRangeMomUncorVsLength, kDeltaRangeMomUncorVsCosTheta,
  kDeltaRangeMomUncorVsAzimuth, kDeltaLengthVsLength, kdEdxVsRange, kDeltaLengthVsPlaneAsymmetry,
  kDeltaLengthVsDeltaStartPlane, kDeltaLengthVsDeltaEndPlane, kDeltaLengthVsCellsPerPlane, kMax2DTruthHist
}
 

Functions

bool trk::sortTVector3ByZ (TVector3 const &a, TVector3 const &b)
 
bool trk::sortTVector3ByY (TVector3 const &a, TVector3 const &b)
 
bool trk::sortFLSHits (sim::FLSHit const &a, sim::FLSHit const &b)
 

Enumeration Type Documentation

Cosmic track analysis module CosmicTrackAna. Makes some validation plots.

Author
Gavin S. Davies - gsdav.nosp@m.ies@.nosp@m.iasta.nosp@m.te.e.nosp@m.du
Date
Enumerator
kDCosX 

direction cosine in x

kDCosY 

direction cosine in y

kDCosZ 

direction cosine in z

kEndX 

track end position in x

kEndY 

track end position in y

kEndZ 

track end position in z

kStartX 

track start position in x

kStartY 

track start position in y

kStartZ 

track start position in z

kDiffX 

difference in track start and end position in x

kDiffY 

difference in track start and end position in y

kDiffZ 

difference in track start and end position in z

kFractionHitsUsed 

Fraction of hits in event used in track.

kFractionSigUsed 

Fraction of hits in event used in track.

kTrkCells 

number of cells in a track

kTracksFound 

number of tracks found

kResidualsX 

residuals for the tracks

kResidualsY 

residuals for the tracks

kCellHitSig 

signal size of calibrated cell hits

kTrkSig 

track signal (Q)

kVtxDistToEdge 

distance in cm to closest edge of detector at track vertex

kEndDistToEdge 

distance in cm to closest edge of detector at track end

kHitXPosition 

position of reco hits in x

kHitYPosition 

position of reco hits in y

kHitZPosition 

position of reco hits in z

kTrackLength 

length of track

kCellHitX 
kCellHitY 
kPlaneHitX 
kPlaneHitY 
kCosCosmic 

cosine theta of cosmic track with respect to zenith

kAzimuth 

azimuthal angle of the cosmic ray

kTNSX 

distribution of x/y cellhit times in nano seconds

kTNSY 

distribution of x/y cellhit times in nano seconds

kTrackRangeMomentum 

momentum of track from range

kCellsPerPlaneX 

average number of cells hit per plane in x

kCellsPerPlaneY 

average number of cells hit per plane in y

kStepRelativeToMedian 

size of steps along trajectory normalized by the median step

kMax1DRecoHist 

Definition at line 58 of file CosmicTrackAna_module.cc.

58  {
59  kDCosX = 0, ///< direction cosine in x
60  kDCosY, ///< direction cosine in y
61  kDCosZ, ///< direction cosine in z
62  kEndX, ///< track end position in x
63  kEndY, ///< track end position in y
64  kEndZ, ///< track end position in z
65  kStartX, ///< track start position in x
66  kStartY, ///< track start position in y
67  kStartZ, ///< track start position in z
68  kDiffX, ///< difference in track start and end position in x
69  kDiffY, ///< difference in track start and end position in y
70  kDiffZ, ///< difference in track start and end position in z
71  kFractionHitsUsed, ///< Fraction of hits in event used in track
72  kFractionSigUsed, ///< Fraction of hits in event used in track
73  kTrkCells, ///< number of cells in a track
74  kTracksFound, ///< number of tracks found
75  kResidualsX, ///< residuals for the tracks
76  kResidualsY, ///< residuals for the tracks
77  kCellHitSig, ///< signal size of calibrated cell hits
78  kTrkSig, ///< track signal (Q)
79  kVtxDistToEdge, ///< distance in cm to closest edge of detector at track vertex
80  kEndDistToEdge, ///< distance in cm to closest edge of detector at track end
81  kHitXPosition, ///< position of reco hits in x
82  kHitYPosition, ///< position of reco hits in y
83  kHitZPosition, ///< position of reco hits in z
84  kTrackLength, ///< length of track
85  kCellHitX, ///<
86  kCellHitY, ///<
87  kPlaneHitX, ///<
88  kPlaneHitY, ///<
89  kCosCosmic, ///< cosine theta of cosmic track with respect to zenith
90  kAzimuth, ///< azimuthal angle of the cosmic ray
91  kTNSX, ///< distribution of x/y cellhit times in nano seconds
92  kTNSY, ///< distribution of x/y cellhit times in nano seconds
93  kTrackRangeMomentum, ///< momentum of track from range
94  kCellsPerPlaneX, ///< average number of cells hit per plane in x
95  kCellsPerPlaneY, ///< average number of cells hit per plane in y
96  kStepRelativeToMedian, ///< size of steps along trajectory normalized by the median step
98 };
direction cosine in x
track start position in x
distribution of x/y cellhit times in nano seconds
distribution of x/y cellhit times in nano seconds
signal size of calibrated cell hits
difference in track start and end position in y
Fraction of hits in event used in track.
distance in cm to closest edge of detector at track vertex
residuals for the tracks
difference in track start and end position in z
number of cells in a track
difference in track start and end position in x
residuals for the tracks
number of tracks found
position of reco hits in z
average number of cells hit per plane in y
cosine theta of cosmic track with respect to zenith
track end position in y
azimuthal angle of the cosmic ray
track signal (Q)
position of reco hits in y
track start position in z
average number of cells hit per plane in x
Fraction of hits in event used in track.
direction cosine in z
track end position in x
length of track
distance in cm to closest edge of detector at track end
momentum of track from range
direction cosine in y
track start position in y
track end position in z
position of reco hits in x
size of steps along trajectory normalized by the median step
Enumerator
kDCosXDiff 

Fraction difference in direction cosine in x.

kDCosYDiff 

Fraction difference in direction cosine in y.

kDCosZDiff 

Fraction difference in direction cosine in z.

kRecoEff 
kPrimaryTrueEnergy 

True energy of particle zero (GeV)

kDeltaTrackLength 

difference between true and reco length in cm

kDeltaRangeMomentum 

difference in reco momentum from range and true momentum

kDeltaRangeMomentumUncor 

difference in reco momentum from range uncorrected for track length

kDeltaZEnd 

difference in z end point of reconstructed track vs simulated

kDeltaEnd 

difference in end point of reconstructed track vs simulated

kDeltaBeg 

difference in start point of reconstructed track vs simulated

kTrackEfficiency 

efficiency in selecting hits for the track

kTrackPurity 

purity in selecting hits for the track

kEndTrueX 

truth end position in x

kEndTrueY 

truth end position in y

kEndTrueZ 

truth end position in z

kStartTrueX 

truth start position in x

kStartTrueY 

truth start position in y

kStartTrueZ 

truth start position in z

kCosCosmicTrue 

cosine theta of cosmic track with respect to zenith

kAzimuthTrue 

azimuthal angle of the cosmic ray

kMax1DTruthHist 

Definition at line 100 of file CosmicTrackAna_module.cc.

100  {
101  kDCosXDiff = 0, ///< Fraction difference in direction cosine in x
102  kDCosYDiff, ///< Fraction difference in direction cosine in y
103  kDCosZDiff, ///< Fraction difference in direction cosine in z
104  kRecoEff,
105  kPrimaryTrueEnergy, ///< True energy of particle zero (GeV)
106  kDeltaTrackLength, ///< difference between true and reco length in cm
107  kDeltaRangeMomentum, ///< difference in reco momentum from range and true momentum
108  kDeltaRangeMomentumUncor, ///< difference in reco momentum from range uncorrected for track length
109  kDeltaZEnd, ///< difference in z end point of reconstructed track vs simulated
110  kDeltaEnd, ///< difference in end point of reconstructed track vs simulated
111  kDeltaBeg, ///< difference in start point of reconstructed track vs simulated
112  kTrackEfficiency, ///< efficiency in selecting hits for the track
113  kTrackPurity, ///< purity in selecting hits for the track
114  kEndTrueX, ///< truth end position in x
115  kEndTrueY, ///< truth end position in y
116  kEndTrueZ, ///< truth end position in z
117  kStartTrueX, ///< truth start position in x
118  kStartTrueY, ///< truth start position in y
119  kStartTrueZ, ///< truth start position in z
120  kCosCosmicTrue, ///< cosine theta of cosmic track with respect to zenith
121  kAzimuthTrue, ///< azimuthal angle of the cosmic ray
123 };
difference between true and reco length in cm
truth start position in x
azimuthal angle of the cosmic ray
efficiency in selecting hits for the track
Fraction difference in direction cosine in y.
difference in reco momentum from range and true momentum
cosine theta of cosmic track with respect to zenith
Fraction difference in direction cosine in z.
True energy of particle zero (GeV)
Fraction difference in direction cosine in x.
truth start position in y
purity in selecting hits for the track
difference in end point of reconstructed track vs simulated
truth start position in z
difference in reco momentum from range uncorrected for track length
difference in start point of reconstructed track vs simulated
truth end position in x
truth end position in z
truth end position in y
difference in z end point of reconstructed track vs simulated
Enumerator
kFracHitsUsedVsNum 

Fraction hits used vs the number of hits that could be used.

kEndXY 

track end position in xy

kEndZX 

track end position in zx

kEndZY 

track end position in zy

kStartXY 

track start position in xy

kStartZX 

track start position in zx

kStartZY 

track start position in zy

kDirXY 

direction in x versus y

kResidVsCosX 

residual for each hit vs cos(theta)

kResidVsCosY 
kResidVsAzX 

residual for each hit vs azimuth

kResidVsAzY 
kHitXYPosition 

reco hit positions in xy

kHitXZPosition 

reco hit positions in xz

kHitYZPosition 

reco hit positions in yz

kCellPlaneX 
kCellPlaneY 
kCellsPerPlaneXY 

cells hit per plane in Y vs X

kPEPerCMVsWX 

PE/cm deposited as a function of W in X view.

kPEPerCMVsWY 

PE/cm deposited as a function of W in Y view.

kStepRelativeToMedianVsAz 

largest trajectory step relative to the median vs azimuth

kMax2DRecoHist 

Definition at line 125 of file CosmicTrackAna_module.cc.

125  {
126  kFracHitsUsedVsNum = 0, ///< Fraction hits used vs the number of hits that could be used
127  kEndXY, ///< track end position in xy
128  kEndZX, ///< track end position in zx
129  kEndZY, ///< track end position in zy
130  kStartXY, ///< track start position in xy
131  kStartZX, ///< track start position in zx
132  kStartZY, ///< track start position in zy
133  kDirXY, ///< direction in x versus y
134  kResidVsCosX, ///< residual for each hit vs cos(theta)
135  kResidVsCosY,
136  kResidVsAzX, ///< residual for each hit vs azimuth
137  kResidVsAzY,
138  kHitXYPosition, ///< reco hit positions in xy
139  kHitXZPosition, ///< reco hit positions in xz
140  kHitYZPosition, ///< reco hit positions in yz
141  kCellPlaneX, ///<
142  kCellPlaneY, ///<
143  kCellsPerPlaneXY, ///< cells hit per plane in Y vs X
144  kPEPerCMVsWX, ///< PE/cm deposited as a function of W in X view
145  kPEPerCMVsWY, ///< PE/cm deposited as a function of W in Y view
146  kStepRelativeToMedianVsAz, ///< largest trajectory step relative to the median vs azimuth
148 };
PE/cm deposited as a function of W in Y view.
track start position in zx
reco hit positions in xz
cells hit per plane in Y vs X
residual for each hit vs azimuth
track end position in zx
PE/cm deposited as a function of W in X view.
track end position in xy
largest trajectory step relative to the median vs azimuth
track end position in zy
track start position in zy
reco hit positions in yz
direction in x versus y
Fraction hits used vs the number of hits that could be used.
reco hit positions in xy
track start position in xy
residual for each hit vs cos(theta)
Enumerator
kDCosXRecoVsTrue 

Direction cosine in x.

kDCosYRecoVsTrue 

Direction cosine in y.

kDCosZRecoVsTrue 

Direction cosine in z.

kDCosXDiffVsZLen 

Fraction difference in direction cosine in x vs z length.

kDCosYDiffVsZLen 

Fraction difference in direction cosine in y vs z length.

kDCosZDiffVsZLen 

Fraction difference in direction cosine in z vs z length.

kTrackFindEff 
kTracksFoundVsLeft 

number of tracks found in event vs particles leaving tracks

kDeltaZEndVsDCosZ 

difference in z endpoint of recoed track & simulated vs dcosZ

kDeltaZBegVsDCosZ 

difference in z start point of recoed track & simulated vs dcosZ

kDeltaZEndVsDistToEdge 

difference in z endpoint of recoed track & simulated vs dcosZ

kDiffEndVsDCosZ 

difference in end point of recoed track & simulated vs dcosZ

kDiffBegVsDCosZ 

difference in start point of recoed track & simulated vs dcosZ

kDiffEndVsAzimuth 

difference in end point of recoed track & simulated vs azimuth

kDiffBegVsAzimuth 

difference in start point of recoed track & simulated vs azimuth

kDiffEndVsCosTheta 

difference in end point of recoed track & simulated vs cosTheta

kDiffBegVsCosTheta 

difference in start point of recoed track & simulated vs cosTheta

kDeltaRangeMomVsLength 

difference in reco and true range momentum as a function of reco length

kDeltaRangeMomUncorVsLength 

difference in reco and true range momentum as a function of reco length

kDeltaRangeMomUncorVsCosTheta 

difference in reco and true range momentum as a function of cos theta

kDeltaRangeMomUncorVsAzimuth 

difference in reco and true range momentum as a function of azimuth

kDeltaLengthVsLength 

difference in recon and true length as a function of reco length

kdEdxVsRange 

dE/dx vs remaining length in a track

kDeltaLengthVsPlaneAsymmetry 

fractional length vs asymmetry in number of planes in each view

kDeltaLengthVsDeltaStartPlane 

fractional length vs difference in start plane in each view

kDeltaLengthVsDeltaEndPlane 

fractional length vs difference in end plane in each view

kDeltaLengthVsCellsPerPlane 

fractional length vs maximum cells per plane

kMax2DTruthHist 

Definition at line 150 of file CosmicTrackAna_module.cc.

150  {
151  kDCosXRecoVsTrue = 0, ///< Direction cosine in x
152  kDCosYRecoVsTrue, ///< Direction cosine in y
153  kDCosZRecoVsTrue, ///< Direction cosine in z
154  kDCosXDiffVsZLen, ///< Fraction difference in direction cosine in x vs z length
155  kDCosYDiffVsZLen, ///< Fraction difference in direction cosine in y vs z length
156  kDCosZDiffVsZLen, ///< Fraction difference in direction cosine in z vs z length
157  kTrackFindEff,
158  kTracksFoundVsLeft, ///< number of tracks found in event vs particles leaving tracks
159  kDeltaZEndVsDCosZ, ///< difference in z endpoint of recoed track & simulated vs dcosZ
160  kDeltaZBegVsDCosZ, ///< difference in z start point of recoed track & simulated vs dcosZ
161  kDeltaZEndVsDistToEdge, ///< difference in z endpoint of recoed track & simulated vs dcosZ
162  kDiffEndVsDCosZ, ///< difference in end point of recoed track & simulated vs dcosZ
163  kDiffBegVsDCosZ, ///< difference in start point of recoed track & simulated vs dcosZ
164  kDiffEndVsAzimuth, ///< difference in end point of recoed track & simulated vs azimuth
165  kDiffBegVsAzimuth, ///< difference in start point of recoed track & simulated vs azimuth
166  kDiffEndVsCosTheta, ///< difference in end point of recoed track & simulated vs cosTheta
167  kDiffBegVsCosTheta, ///< difference in start point of recoed track & simulated vs cosTheta
168  kDeltaRangeMomVsLength, ///< difference in reco and true range momentum as a function of reco length
169  kDeltaRangeMomUncorVsLength, ///< difference in reco and true range momentum as a function of reco length
170  kDeltaRangeMomUncorVsCosTheta,///< difference in reco and true range momentum as a function of cos theta
171  kDeltaRangeMomUncorVsAzimuth, ///< difference in reco and true range momentum as a function of azimuth
172  kDeltaLengthVsLength, ///< difference in recon and true length as a function of reco length
173  kdEdxVsRange, ///< dE/dx vs remaining length in a track
174  kDeltaLengthVsPlaneAsymmetry, ///< fractional length vs asymmetry in number of planes in each view
175  kDeltaLengthVsDeltaStartPlane,///< fractional length vs difference in start plane in each view
176  kDeltaLengthVsDeltaEndPlane, ///< fractional length vs difference in end plane in each view
177  kDeltaLengthVsCellsPerPlane, ///< fractional length vs maximum cells per plane
179 };
fractional length vs difference in end plane in each view
difference in end point of recoed track & simulated vs cosTheta
difference in reco and true range momentum as a function of reco length
difference in reco and true range momentum as a function of azimuth
difference in end point of recoed track & simulated vs dcosZ
Direction cosine in x.
difference in start point of recoed track & simulated vs cosTheta
difference in recon and true length as a function of reco length
difference in start point of recoed track & simulated vs dcosZ
Fraction difference in direction cosine in x vs z length.
number of tracks found in event vs particles leaving tracks
difference in start point of recoed track & simulated vs azimuth
fractional length vs difference in start plane in each view
fractional length vs asymmetry in number of planes in each view
difference in z endpoint of recoed track & simulated vs dcosZ
dE/dx vs remaining length in a track
Fraction difference in direction cosine in z vs z length.
Fraction difference in direction cosine in y vs z length.
difference in z start point of recoed track & simulated vs dcosZ
fractional length vs maximum cells per plane
difference in reco and true range momentum as a function of reco length
difference in reco and true range momentum as a function of cos theta
difference in end point of recoed track & simulated vs azimuth
Direction cosine in z.
difference in z endpoint of recoed track & simulated vs dcosZ
Direction cosine in y.