All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FlashT0FirstHit_tool.cc
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////
2 /// File: FlashT0FirstHit_tool.cc
3 ///
4 /// Base class: FlashT0Base.hh
5 ///
6 /// Algorithm description: The OpFlash t0 is set to the OpHit
7 /// with the largest signal (#PE). Only OpHits above the
8 /// MinHitPE cut are considered
9 ///
10 /// Created by Fran Nicolas, June 2022
11 ////////////////////////////////////////////////////////////////////////
12 
13 #include "fhiclcpp/types/Atom.h"
14 #include "art/Utilities/ToolMacros.h"
15 #include "art/Utilities/make_tool.h"
16 #include "art/Utilities/ToolConfigTable.h"
17 
18 #include "FlashT0Base.hh"
19 
20 namespace lightana{
21 
23  {
24 
25  public:
26 
27  //Configuration parameters
28  struct Config {
29 
30  fhicl::Atom<double> MinHitPE {
31  fhicl::Name("MinHitPE"),
32  fhicl::Comment("Minimum number of reconstructed PE to consider the OpHit for the t0 calculation")
33  };
34 
35  };
36 
37  // Default constructor
38  explicit FlashT0FirstHit(art::ToolConfigTable<Config> const& config);
39 
40  // Method to calculate the OpFlash t0
41  double GetFlashT0(double flash_peaktime, LiteOpHitArray_t ophit_list) override;
42 
43  private:
44 
45  double fMinHitPE;
46 
47  };
48 
49  FlashT0FirstHit::FlashT0FirstHit(art::ToolConfigTable<Config> const& config)
50  : fMinHitPE{ config().MinHitPE() }
51  {
52  }
53 
54  double FlashT0FirstHit::GetFlashT0(double flash_time, LiteOpHitArray_t ophit_list){
55 
56  double start_time = flash_time;
57 
58  for(auto & ophit : ophit_list){
59  if(ophit.peak_time<start_time && ophit.pe>fMinHitPE) start_time = ophit.peak_time;
60  }
61 
62  return start_time;
63  }
64 
65 }
66 
67 DEFINE_ART_CLASS_TOOL(lightana::FlashT0FirstHit)
double GetFlashT0(double flash_peaktime, LiteOpHitArray_t ophit_list) override
std::vector< lightana::LiteOpHit_t > LiteOpHitArray_t
BEGIN_PROLOG vertical distance to the surface Name
BEGIN_PROLOG opflashCryoW opflashCryoW triggerfilterBNB triggerfilterNuMI triggerfilterOffbeamBNB triggerfilterOffbeamNuMI triggerfilterUnknown roifinder roifinder2d gaushitTPCEE gaushitTPCWE purityana1 ophit
then echo fcl sbnd_project sbnd_project sbnd_project sbnd_project production production start_time
FlashT0FirstHit(art::ToolConfigTable< Config > const &config)