25 class FilterSimPhotonTime;
60 ,
fDebug(p.get<
bool>(
"Debug",
false))
73 async<art::InEvent>();
81 std::cout <<
"\tFilterSimPhotonTime: TimeWindows size is " <<
fTimeWindows.size() << std::endl;
85 std::cout <<
"\t\tTimeWindow " 86 <<
"[" << tw.first <<
"," << tw.second <<
"]" << std::endl;
88 if (tw.first > tw.second)
90 <<
"Bad time window initialization: tw.first>tw.second. Reverse the order!" << std::endl;
96 auto const& simPhotonsCollection =
99 std::vector<double> sumEnergyArray(
fN, 0.0);
101 const std::vector<sim::SimPhotons>& simPhotonsCollectionReflected =
104 std::vector<sim::SimPhotons>();
106 size_t n_sim_photons = simPhotonsCollection.size() + simPhotonsCollectionReflected.size();
108 for (
size_t i_pc = 0; i_pc < n_sim_photons; i_pc++) {
110 (i_pc < simPhotonsCollection.size()) ?
111 simPhotonsCollection[i_pc] :
112 simPhotonsCollectionReflected[i_pc - simPhotonsCollection.size()];
115 std::cout <<
"\tFilterSimPhotonTime: Processing simphotons channel " << simphotons.
OpChannel()
118 for (
auto const& photon : simphotons)
119 for (
size_t i_tw = 0; i_tw <
fN; i_tw++) {
121 if (photon.Time >= tw.first && photon.Time <= tw.second &&
125 std::string photon_string =
126 (i_pc < simPhotonsCollection.size()) ?
"Photon" :
"Reflected Photon";
127 std::cout <<
"\t\t" << photon_string <<
" with time " << photon.Time <<
" detected. " 128 <<
"Energy is " << photon.Energy <<
"." << std::endl;
131 sumEnergyArray[i_tw] += photon.Energy;
134 std::cout <<
"\t\tTotal energy in this window (" << i_tw <<
") is now " 135 << sumEnergyArray[i_tw] << std::endl;
143 std::cout <<
"\tFilterSimPhotonTime: Final total energies are below min of " <<
fMinTotalEnergy 145 for (
size_t i_tw = 0; i_tw <
fN; ++i_tw) {
146 std::cout <<
"\t\tTimeWindow " 148 <<
"]: " << sumEnergyArray[i_tw] << std::endl;
float const fMinTotalEnergy
FilterSimPhotonTime(fhicl::ParameterSet const &p, art::ProcessingFrame const &)
int OpChannel() const
Returns the optical channel number this object is associated to.
std::vector< std::pair< float, float > > const fTimeWindows
SharedFilter(fhicl::ParameterSet const &pset)
std::string const fReflectedLabel
std::string const fSimPhotonsCollectionLabel
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Simulation objects for optical detectors.
#define DEFINE_ART_MODULE(klass)
float const fMinPhotonEnergy
bool filter(art::Event &e, art::ProcessingFrame const &) override
Collection of photons which recorded on one channel.
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
void CheckTimeWindows() const
void serialize(T const &...)
bool const fUseReflectedPhotons
FilterSimPhotonTime & operator=(FilterSimPhotonTime const &)=delete
cet::coded_exception< error, detail::translate > exception