20 #include "art_root_io/TFileService.h" 22 #include "canvas/Persistency/Common/FindManyP.h" 53 Name(
"EmTrkModuleLabel"),
Comment(
"tag of hits classifier")
57 Name(
"CalorimetryAlg"),
Comment(
"calo alg to calibrate hit adc to energy")
129 fEmChargePerTpcHist = tfs->make<TH2F>(
"EmChargePerTPC",
"EM charge reconstucted", 3, 0., 3., 2, 0., 2.);
130 fHadChargePerTpcHist = tfs->make<TH2F>(
"HadChargePerTPC",
"hadronic charge reconstucted", 3, 0., 3., 2, 0., 2.);
131 fChargePerTpcHist = tfs->make<TH2F>(
"ChargePerTPC",
"total charge reconstucted", 3, 0., 3., 2, 0., 2.);
133 fTree = tfs->make<TTree>(
"events",
"summary tree");
149 float trackLikeThr = 0.63;
153 if (!cluResults) {
return false; }
155 int trkLikeIdx = cluResults->getIndex(
"track");
156 int emLikeIdx = cluResults->getIndex(
"em");
157 if ((trkLikeIdx < 0) || (emLikeIdx < 0)) {
return false; }
159 const art::FindManyP< recob::Hit > hitsFromClusters(cluResults->dataHandle(),
evt, cluResults->dataTag());
160 const auto & cnnOuts = cluResults->outputs();
161 const auto & clusters = cluResults->items();
163 for (
size_t i = 0; i < clusters.size(); ++i)
165 if (clusters[i].
View() == view) {
continue; }
167 double trackLike, trkOrEm = cnnOuts[i][trkLikeIdx] + cnnOuts[i][emLikeIdx];
168 if (trkOrEm > 0) { trackLike = cnnOuts[i][trkLikeIdx] / trkOrEm; }
169 else { trackLike = 0; }
171 if (trackLike > trackLikeThr)
188 for (
const auto &
h : hits)
191 histo->Fill(xy.first, xy.second,
getHitMeV(clockData, detProp, *
h));
200 if (!std::isnormal(adc) || (adc < 0)) adc = 0.0;
208 if (!std::isnormal(dq) || (dq < 0)) dq = 0.0;
223 if (!fillChargeHistos<4>(evt, clockData, detProp) &&
224 !fillChargeHistos<3>(evt, clockData, detProp))
Store parameters for running LArG4.
RecoStats & operator=(RecoStats const &)=delete
double getHitMeV(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const recob::Hit &hit) const
AdcChannelData::View View
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
geo::WireID WireID() const
ChannelGroupService::Name Name
Planes which measure Z direction.
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
void analyze(art::Event const &e) override
EDAnalyzer(fhicl::ParameterSet const &pset)
double ElectronsFromADCArea(double area, unsigned short plane) const
#define DEFINE_ART_MODULE(klass)
bool fillChargeHistos(const art::Event &evt, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp)
TH2F * fEmChargePerTpcHist
PlaneID_t Plane
Index of the plane within its TPC.
Detector simulation of raw signals on wires.
fhicl::Table< calo::CalorimetryAlg::Config > CalorimetryAlg
fhicl::Atom< art::InputTag > EmTrkModuleLabel
void fillChargeHisto(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, TH2F *histo, const std::vector< art::Ptr< recob::Hit >> &hits)
float PeakTime() const
Time of the signal peak, in tick units.
Declaration of signal hit object.
Contains all timing reference information for the detector.
TH2F * fHadChargePerTpcHist
EventNumber_t event() const
2D representation of charge deposited in the TDC/wire plane
calo::CalorimetryAlg fCalorimetryAlg
double LifetimeCorrection(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, double time, double T0=0) const
RecoStats(Parameters const &config)
std::unordered_map< int, std::pair< int, int > > mapTPCtoXY
static std::unique_ptr< MVAReader > create(const art::Event &evt, const art::InputTag &tag)
double GeVToElectrons() const
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)
art::InputTag fEmTrkModuleLabel