All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 #include "FlashHypothesis.h"
14 #include "FlashHypothesisCreator.h"
15 #include "SimPhotonCounterAlg.h"
16 
23 
24 #include "TTree.h"
25 
27  TH1F* h_h_p, TH1F* h_s_p, TH1F* h_c_p,
28  TH1F* h_h_l, TH1F* h_s_l, TH1F* h_c_l,
29  TH1F* h_h_t, TH1F* h_s_t, TH1F* h_c_t,
30  geo::Geometry const& geom)
31 {
32  fTree = tree;
34  h_h_p,h_s_p,h_c_p,
35  h_h_l,h_s_l,h_c_l,
36  h_h_t,h_s_t,h_c_t,
37  geom.NOpDets(),
38  false);
39 
40  fMCTAlg.SetOutputTree(tree,false);
41 }
42 
44 {
45 
46  fOpDetPositions_Y.resize(geom.NOpDets());
47  fOpDetPositions_Z.resize(geom.NOpDets());
48 
49  double xyz[3];
50  for(size_t i_opdet=0; i_opdet<geom.NOpDets(); i_opdet++){
51  geom.Cryostat(0).OpDet(i_opdet).GetCenter(xyz);
52  fOpDetPositions_Y[i_opdet] = (float)xyz[1];
53  fOpDetPositions_Z[i_opdet] = (float)xyz[2];
54  }
55 
56 }
57 
58 void opdet::FlashHypothesisAnaAlg::RunComparison(const unsigned int run,
59  const unsigned int event,
60  std::vector<sim::MCTrack> const& mctrackVec,
61  std::vector<sim::SimPhotons> const& simPhotonsVec,
62  Providers_t providers,
63  opdet::OpDigiProperties const& opdigip,
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);
72  fhc = fhc + fFHCreator.GetFlashHypothesisCollection(mctrack,
73  dEdxVector,
74  providers,
75  pvs,
76  opdigip,
77  fXOffset);
78  }
79 
80  fSPCAlg.InitializeCounters(*geom,opdigip);
81  fSPCAlg.AddSimPhotonsVector(simPhotonsVec);
82 
83  fFHCompare.RunComparison(run,event,
84  fhc,fSPCAlg.GetSimPhotonCounter(fCounterIndex),
85  fOpDetPositions_Y,fOpDetPositions_Z);
86 
87  fMCTAlg.FillTree(run,event,mctrackVec);
88 
89  fTree->Fill();
90 }
Class def header for a class FlashHypothesis.
Encapsulate the construction of a single cyostat.
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)
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
Access the description of detector geometry.
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:181
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 FillOpDetPositions(geo::Geometry const &)
art framework interface to geometry description