LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
FlashHypothesisAnaAlg.cxx
Go to the documentation of this file.
1 
11 #include "FlashHypothesisAnaAlg.h"
12 
14  TH1F* h_h_p, TH1F* h_s_p, TH1F* h_c_p,
15  TH1F* h_h_l, TH1F* h_s_l, TH1F* h_c_l,
16  TH1F* h_h_t, TH1F* h_s_t, TH1F* h_c_t,
17  geo::Geometry const& geom)
18 {
19  fTree = tree;
21  h_h_p,h_s_p,h_c_p,
22  h_h_l,h_s_l,h_c_l,
23  h_h_t,h_s_t,h_c_t,
24  geom.NOpDets(),
25  false);
26 
27  fMCTAlg.SetOutputTree(tree,false);
28 }
29 
31 {
32 
33  fOpDetPositions_Y.resize(geom.NOpDets());
34  fOpDetPositions_Z.resize(geom.NOpDets());
35 
36  double xyz[3];
37  for(size_t i_opdet=0; i_opdet<geom.NOpDets(); i_opdet++){
38  geom.Cryostat(0).OpDet(i_opdet).GetCenter(xyz);
39  fOpDetPositions_Y[i_opdet] = (float)xyz[1];
40  fOpDetPositions_Z[i_opdet] = (float)xyz[2];
41  }
42 
43 }
44 
45 void opdet::FlashHypothesisAnaAlg::RunComparison(const unsigned int run,
46  const unsigned int event,
47  std::vector<sim::MCTrack> const& mctrackVec,
48  std::vector<sim::SimPhotons> const& simPhotonsVec,
49  Providers_t providers,
50  opdet::OpDigiProperties const& opdigip,
52 {
53  auto const* geom = providers.get<geo::GeometryCore>();
54 
55  FlashHypothesisCollection fhc(geom->NOpDets());
56  for(auto const& mctrack : mctrackVec){
57  if(mctrack.size()==0) continue;
58  std::vector<float> dEdxVector(mctrack.size()-1,fdEdx);
59  fhc = fhc + fFHCreator.GetFlashHypothesisCollection(mctrack,
60  dEdxVector,
61  providers,
62  pvs,
63  opdigip,
64  fXOffset);
65  }
66 
67  fSPCAlg.InitializeCounters(*geom,opdigip);
68  fSPCAlg.AddSimPhotonsVector(simPhotonsVec);
69 
70  fFHCompare.RunComparison(run,event,
73 
74  fMCTAlg.FillTree(run,event,mctrackVec);
75 
76  fTree->Fill();
77 }
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:47
FlashHypothesisCreator fFHCreator
SimPhotonCounter const & GetSimPhotonCounter(size_t)
std::vector< float > fOpDetPositions_Z
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:110
Description of geometry of one entire detector.
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.
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 > &)
void FillOpDetPositions(geo::Geometry const &)
Event finding and building.