LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
opdet::FlashHypothesisAnaAlg Class Reference

#include "FlashHypothesisAnaAlg.h"

Public Types

using Providers_t = FlashHypothesisCreator::Providers_t
 

Public Member Functions

 FlashHypothesisAnaAlg (fhicl::ParameterSet const &p)
 
void SetOutputObjects (TTree *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, geo::Geometry const &)
 
void FillOpDetPositions (geo::Geometry const &)
 
void RunComparison (const unsigned int run, const unsigned int event, std::vector< sim::MCTrack > const &, std::vector< sim::SimPhotons > const &, Providers_t providers, opdet::OpDigiProperties const &opdigip, phot::PhotonVisibilityService const &pvs)
 

Private Attributes

unsigned int fCounterIndex
 
float fdEdx
 
float fXOffset
 
TTree * fTree
 
FlashHypothesisCreator fFHCreator
 
SimPhotonCounterAlg fSPCAlg
 
FlashHypothesisComparison fFHCompare
 
sim::MCTrackCollectionAnaAlg fMCTAlg
 
std::vector< float > fOpDetPositions_Y
 
std::vector< float > fOpDetPositions_Z
 

Detailed Description

Definition at line 43 of file FlashHypothesisAnaAlg.h.

Member Typedef Documentation

Constructor & Destructor Documentation

opdet::FlashHypothesisAnaAlg::FlashHypothesisAnaAlg ( fhicl::ParameterSet const &  p)
inline

Definition at line 48 of file FlashHypothesisAnaAlg.h.

49  : fCounterIndex(p.get<unsigned int>("SimPhotonCounterIndex", 0))
50  , fdEdx(p.get<float>("dEdx", 2.1))
51  , fXOffset(p.get<float>("HypothesisXOffset", 0.0))
52  , fSPCAlg(p.get<fhicl::ParameterSet>("SimPhotonCounterAlgParams"))
53  {}

Member Function Documentation

void opdet::FlashHypothesisAnaAlg::FillOpDetPositions ( geo::Geometry const &  geom)

Definition at line 45 of file FlashHypothesisAnaAlg.cxx.

References geo::GeometryCore::Cryostat(), fOpDetPositions_Y, fOpDetPositions_Z, geo::OpDetGeo::GetCenter(), geo::GeometryCore::NOpDets(), and geo::CryostatGeo::OpDet().

Referenced by opdet::FlashHypothesisAna::beginJob().

46 {
47 
48  fOpDetPositions_Y.resize(geom.NOpDets());
49  fOpDetPositions_Z.resize(geom.NOpDets());
50 
51  for (size_t i_opdet = 0; i_opdet < geom.NOpDets(); i_opdet++) {
52  auto const xyz = geom.Cryostat().OpDet(i_opdet).GetCenter();
53  fOpDetPositions_Y[i_opdet] = (float)xyz.Y();
54  fOpDetPositions_Z[i_opdet] = (float)xyz.Z();
55  }
56 }
std::vector< float > fOpDetPositions_Y
std::vector< float > fOpDetPositions_Z
void opdet::FlashHypothesisAnaAlg::RunComparison ( const unsigned int  run,
const unsigned int  event,
std::vector< sim::MCTrack > const &  mctrackVec,
std::vector< sim::SimPhotons > const &  simPhotonsVec,
Providers_t  providers,
opdet::OpDigiProperties const &  opdigip,
phot::PhotonVisibilityService const &  pvs 
)

Definition at line 58 of file FlashHypothesisAnaAlg.cxx.

References opdet::SimPhotonCounterAlg::AddSimPhotonsVector(), fCounterIndex, fdEdx, fFHCompare, fFHCreator, sim::MCTrackCollectionAnaAlg::FillTree(), fMCTAlg, fOpDetPositions_Y, fOpDetPositions_Z, fSPCAlg, fTree, fXOffset, lar::ProviderPack< Providers >::get(), opdet::FlashHypothesisCreator::GetFlashHypothesisCollection(), opdet::SimPhotonCounterAlg::GetSimPhotonCounter(), opdet::SimPhotonCounterAlg::InitializeCounters(), and opdet::FlashHypothesisComparison::RunComparison().

Referenced by opdet::FlashHypothesisAna::analyze().

65 {
66  auto const* geom = providers.get<geo::GeometryCore>();
67 
68  FlashHypothesisCollection fhc(geom->NOpDets());
69  for (auto const& mctrack : mctrackVec) {
70  if (mctrack.size() == 0) continue;
71  std::vector<float> dEdxVector(mctrack.size() - 1, fdEdx);
73  mctrack, dEdxVector, providers, pvs, opdigip, fXOffset);
74  }
75 
76  fSPCAlg.InitializeCounters(*geom, opdigip);
77  fSPCAlg.AddSimPhotonsVector(simPhotonsVec);
78 
80  event,
81  fhc,
85 
86  fMCTAlg.FillTree(run, event, mctrackVec);
87 
88  fTree->Fill();
89 }
void InitializeCounters(geo::GeometryCore const &, opdet::OpDigiProperties const &)
FlashHypothesisCollection GetFlashHypothesisCollection(recob::Track const &track, std::vector< float > const &dEdxVector, Providers_t providers, phot::PhotonVisibilityService const &pvs, opdet::OpDigiProperties const &opdigip, float XOffset=0)
std::vector< float > fOpDetPositions_Y
void FillTree(unsigned int, unsigned int, const std::vector< sim::MCTrack > &)
FlashHypothesisCreator fFHCreator
SimPhotonCounter const & GetSimPhotonCounter(size_t)
std::vector< float > fOpDetPositions_Z
void AddSimPhotonsVector(std::vector< sim::SimPhotons > const &)
Description of geometry of one entire detector.
Definition: GeometryCore.h:119
FlashHypothesisComparison fFHCompare
sim::MCTrackCollectionAnaAlg fMCTAlg
void RunComparison(const unsigned int, const unsigned int, const FlashHypothesisCollection &, const SimPhotonCounter &, const std::vector< float > &, const std::vector< float > &)
Event finding and building.
void opdet::FlashHypothesisAnaAlg::SetOutputObjects ( TTree *  tree,
TH1F *  h_h_p,
TH1F *  h_s_p,
TH1F *  h_c_p,
TH1F *  h_h_l,
TH1F *  h_s_l,
TH1F *  h_c_l,
TH1F *  h_h_t,
TH1F *  h_s_t,
TH1F *  h_c_t,
geo::Geometry const &  geom 
)

Title: FlashHypothesisAnaAlg Class Author: Wes Ketchum (wketc.nosp@m.hum@.nosp@m.lanl..nosp@m.gov)

Description: Alg that compares the flash hypotheses with truth photons and stores the results in a TTree.

Definition at line 26 of file FlashHypothesisAnaAlg.cxx.

References fFHCompare, fMCTAlg, fTree, geo::GeometryCore::NOpDets(), opdet::FlashHypothesisComparison::SetOutputObjects(), and sim::MCTrackCollectionAnaAlg::SetOutputTree().

Referenced by opdet::FlashHypothesisAna::beginJob().

37 {
38  fTree = tree;
40  tree, h_h_p, h_s_p, h_c_p, h_h_l, h_s_l, h_c_l, h_h_t, h_s_t, h_c_t, geom.NOpDets(), false);
41 
42  fMCTAlg.SetOutputTree(tree, false);
43 }
void SetOutputTree(TTree *, bool fill=true)
FlashHypothesisComparison fFHCompare
void SetOutputObjects(TTree *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, const unsigned int, bool fill=true)
sim::MCTrackCollectionAnaAlg fMCTAlg

Member Data Documentation

unsigned int opdet::FlashHypothesisAnaAlg::fCounterIndex
private

Definition at line 78 of file FlashHypothesisAnaAlg.h.

Referenced by RunComparison().

float opdet::FlashHypothesisAnaAlg::fdEdx
private

Definition at line 79 of file FlashHypothesisAnaAlg.h.

Referenced by RunComparison().

FlashHypothesisComparison opdet::FlashHypothesisAnaAlg::fFHCompare
private

Definition at line 86 of file FlashHypothesisAnaAlg.h.

Referenced by RunComparison(), and SetOutputObjects().

FlashHypothesisCreator opdet::FlashHypothesisAnaAlg::fFHCreator
private

Definition at line 84 of file FlashHypothesisAnaAlg.h.

Referenced by RunComparison().

sim::MCTrackCollectionAnaAlg opdet::FlashHypothesisAnaAlg::fMCTAlg
private

Definition at line 87 of file FlashHypothesisAnaAlg.h.

Referenced by RunComparison(), and SetOutputObjects().

std::vector<float> opdet::FlashHypothesisAnaAlg::fOpDetPositions_Y
private

Definition at line 89 of file FlashHypothesisAnaAlg.h.

Referenced by FillOpDetPositions(), and RunComparison().

std::vector<float> opdet::FlashHypothesisAnaAlg::fOpDetPositions_Z
private

Definition at line 90 of file FlashHypothesisAnaAlg.h.

Referenced by FillOpDetPositions(), and RunComparison().

SimPhotonCounterAlg opdet::FlashHypothesisAnaAlg::fSPCAlg
private

Definition at line 85 of file FlashHypothesisAnaAlg.h.

Referenced by RunComparison().

TTree* opdet::FlashHypothesisAnaAlg::fTree
private

Definition at line 82 of file FlashHypothesisAnaAlg.h.

Referenced by RunComparison(), and SetOutputObjects().

float opdet::FlashHypothesisAnaAlg::fXOffset
private

Definition at line 80 of file FlashHypothesisAnaAlg.h.

Referenced by RunComparison().


The documentation for this class was generated from the following files: