FlashHypothesisAnaAlg.cxx
Go to the documentation of this file.
1 /*!
2  * Title: FlashHypothesisAnaAlg Class
3  * Author: Wes Ketchum (wketchum@lanl.gov)
4  *
5  * Description:
6  * Alg that compares the flash hypotheses with truth photons and stores the
7  * results in a TTree.
8  *
9 */
10 
11 #include "FlashHypothesisAnaAlg.h"
12 
22 
23 #include "TTree.h"
24 
26  TH1F* h_h_p, TH1F* h_s_p, TH1F* h_c_p,
27  TH1F* h_h_l, TH1F* h_s_l, TH1F* h_c_l,
28  TH1F* h_h_t, TH1F* h_s_t, TH1F* h_c_t,
29  geo::Geometry const& geom)
30 {
31  fTree = tree;
33  h_h_p,h_s_p,h_c_p,
34  h_h_l,h_s_l,h_c_l,
35  h_h_t,h_s_t,h_c_t,
36  geom.NOpDets(),
37  false);
38 
39  fMCTAlg.SetOutputTree(tree,false);
40 }
41 
43 {
44 
45  fOpDetPositions_Y.resize(geom.NOpDets());
46  fOpDetPositions_Z.resize(geom.NOpDets());
47 
48  double xyz[3];
49  for(size_t i_opdet=0; i_opdet<geom.NOpDets(); i_opdet++){
50  geom.Cryostat(0).OpDet(i_opdet).GetCenter(xyz);
51  fOpDetPositions_Y[i_opdet] = (float)xyz[1];
52  fOpDetPositions_Z[i_opdet] = (float)xyz[2];
53  }
54 
55 }
56 
58  const unsigned int event,
59  std::vector<sim::MCTrack> const& mctrackVec,
60  std::vector<sim::SimPhotons> const& simPhotonsVec,
61  Providers_t providers,
62  opdet::OpDigiProperties const& opdigip,
64 {
65  auto const* geom = providers.get<geo::GeometryCore>();
66 
67  FlashHypothesisCollection fhc(geom->NOpDets());
68  for(auto const& mctrack : mctrackVec){
69  if(mctrack.size()==0) continue;
70  std::vector<float> dEdxVector(mctrack.size()-1,fdEdx);
71  fhc = fhc + fFHCreator.GetFlashHypothesisCollection(mctrack,
72  dEdxVector,
73  providers,
74  pvs,
75  opdigip,
76  fXOffset);
77  }
78 
79  fSPCAlg.InitializeCounters(*geom,opdigip);
80  fSPCAlg.AddSimPhotonsVector(simPhotonsVec);
81 
82  fFHCompare.RunComparison(run,event,
85 
86  fMCTAlg.FillTree(run,event,mctrackVec);
87 
88  fTree->Fill();
89 }
Encapsulate the construction of a single cyostat.
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)
void SetOutputTree(TTree *, bool fill=true)
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)
std::vector< float > fOpDetPositions_Y
void FillTree(unsigned int, unsigned int, const std::vector< sim::MCTrack > &)
Provider const * get() const
Returns the provider with the specified type.
Definition: ProviderPack.h:193
void GetCenter(double *xyz, double localz=0.0) const
Definition: OpDetGeo.cxx:40
FlashHypothesisCreator fFHCreator
SimPhotonCounter const & GetSimPhotonCounter(size_t)
std::vector< float > fOpDetPositions_Z
art framework interface to geometry description
void AddSimPhotonsVector(std::vector< sim::SimPhotons > const &)
void SetOutputObjects(TTree *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, geo::Geometry const &)
const OpDetGeo & OpDet(unsigned int iopdet) const
Return the iopdet&#39;th optical detector in the cryostat.
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
The geometry of one entire detector, as served by art.
Definition: Geometry.h:196
Description of geometry of one entire detector.
Class def header for mctrack data container.
FlashHypothesisComparison fFHCompare
void SetOutputObjects(TTree *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, const unsigned int, bool fill=true)
unsigned int NOpDets() const
Number of OpDets in the whole detector.
Encapsulate the geometry of an optical detector.
sim::MCTrackCollectionAnaAlg fMCTAlg
Container for a list of pointers to providers.
Definition: ProviderPack.h:114
void RunComparison(const unsigned int, const unsigned int, const FlashHypothesisCollection &, const SimPhotonCounter &, const std::vector< float > &, const std::vector< float > &)
Access the description of detector geometry.
void FillOpDetPositions(geo::Geometry const &)
Event finding and building.