All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Typedefs | Functions
FrameSaver.cxx File Reference
#include "FrameSaver.h"
#include "lardataobj/RawData/RawDigit.h"
#include "lardataobj/RecoBase/Wire.h"
#include "art/Framework/Core/EDProducer.h"
#include "art/Framework/Principal/Event.h"
#include "WireCellIface/IAnodePlane.h"
#include "WireCellIface/IFrame.h"
#include "WireCellIface/ITrace.h"
#include "WireCellUtil/NamedFactory.h"
#include "lardata/DetectorInfoServices/DetectorPropertiesService.h"
#include "larevt/CalibrationDBI/Interface/DetPedestalProvider.h"
#include "larevt/CalibrationDBI/Interface/DetPedestalService.h"
#include <algorithm>
#include <map>

Go to the source code of this file.

Classes

struct  PU
 

Typedefs

typedef std::unordered_map
< int, ITrace::vector > 
traces_bychan_t
 

Functions

static float summary_sum (const std::vector< float > &tsvals)
 
static float summary_set (const std::vector< float > &tsvals)
 
static void tagged_traces (IFrame::pointer frame, std::string tag, ITrace::vector &ret)
 
static void traces_bychan (ITrace::vector &traces, traces_bychan_t &ret)
 

Typedef Documentation

typedef std::unordered_map<int, ITrace::vector> traces_bychan_t

Definition at line 238 of file FrameSaver.cxx.

Function Documentation

static float summary_set ( const std::vector< float > &  tsvals)
static

Definition at line 103 of file FrameSaver.cxx.

104 {
105  if (tsvals.empty()) { return 0.0; }
106  return tsvals.back();
107 }
static float summary_sum ( const std::vector< float > &  tsvals)
static

Definition at line 98 of file FrameSaver.cxx.

99 {
100  return std::accumulate(tsvals.begin(), tsvals.end(), 0);
101 }
static void tagged_traces ( IFrame::pointer  frame,
std::string  tag,
ITrace::vector &  ret 
)
static

Definition at line 223 of file FrameSaver.cxx.

224 {
225  auto const& all_traces = frame->traces();
226  const auto& ttinds = frame->tagged_traces(tag);
227  if (ttinds.size()) {
228  for (size_t index : ttinds) {
229  ret.push_back(all_traces->at(index));
230  }
231  return;
232  }
233  auto ftags = frame->frame_tags();
234  if (std::find(ftags.begin(), ftags.end(), tag) == ftags.end()) { return; }
235  ret.insert(ret.begin(), all_traces->begin(), all_traces->end());
236 }
static void traces_bychan ( ITrace::vector &  traces,
traces_bychan_t ret 
)
static

Definition at line 240 of file FrameSaver.cxx.

241 {
242  for (auto trace : traces) {
243  int chid = trace->channel();
244  ret[chid].push_back(trace);
245  }
246 }
M::value_type trace(const M &m)