Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | List of all members
calib::TimingCalFilter Class Reference
Inheritance diagram for calib::TimingCalFilter:
art::EDFilter art::ProducerBase art::Consumer art::EngineCreator art::ProductRegistryHelper

Public Types

using ModuleType = EDFilter
 
using WorkerType = WorkerT< EDFilter >
 
template<typename UserConfig >
using Table = ProducerBase::Table< UserConfig >
 

Public Member Functions

 TimingCalFilter (fhicl::ParameterSet const &p)
 
virtual ~TimingCalFilter ()
 
virtual bool endSubRun (art::SubRun &sr)
 
virtual bool filter (art::Event &e)
 
void reconfigure (const fhicl::ParameterSet &pset)
 
virtual void beginJob ()
 
template<typename PROD , BranchType B = InEvent>
ProductID getProductID (std::string const &instanceName={}) const
 
template<typename PROD , BranchType B>
ProductID getProductID (ModuleDescription const &moduleDescription, std::string const &instanceName) const
 
bool modifiesEvent () const
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TmayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Static Public Attributes

static constexpr bool Pass {true}
 
static constexpr bool Fail {false}
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Attributes

std::string fDCMLabel
 Where to find DCM stats. More...
 
std::map< int, std::vector< art::Ptr< caldp::PCHit > > > fDCMHitMap
 
uint32_t minTimeRun
 
uint32_t maxTimeRun
 
std::vector< std::vector< int > > fDCMOffsetCount
 
std::vector< std::vector< float > > fDCMOffsetSum
 vector running sum of relative dcm offsets More...
 
std::vector< std::vector< float > > fDCMOffsetSumSquare
 vector running sum squared of dcm offsets More...
 
std::vector< intfDCMUse
 vector of times a dcm is used More...
 

Detailed Description

Definition at line 44 of file TimingCalFilter_module.cc.

Member Typedef Documentation

using art::EDFilter::ModuleType = EDFilter
inherited

Definition at line 37 of file EDFilter.h.

template<typename UserConfig >
using art::EDFilter::Table = ProducerBase::Table<UserConfig>
inherited

Definition at line 46 of file EDFilter.h.

using art::EDFilter::WorkerType = WorkerT<EDFilter>
inherited

Definition at line 38 of file EDFilter.h.

Constructor & Destructor Documentation

calib::TimingCalFilter::TimingCalFilter ( fhicl::ParameterSet const &  p)
explicit

Definition at line 82 of file TimingCalFilter_module.cc.

References reconfigure().

83  :
87  fDCMOffsetSum(caldp::kDCMNumMax, std::vector<float>(caldp::kDCMNumMax, 0)),
90  {
91  this->reconfigure(pset);
92 
93  produces<caldp::DCMSummary, art::InSubRun>();
94  }
std::vector< std::vector< float > > fDCMOffsetSum
vector running sum of relative dcm offsets
std::vector< std::vector< int > > fDCMOffsetCount
static const int kDCMNumMax
maximum number of dcms possible on a detector
Definition: DCMSummary.h:16
std::vector< std::vector< float > > fDCMOffsetSumSquare
vector running sum squared of dcm offsets
std::vector< int > fDCMUse
vector of times a dcm is used
static float min(const float a, const float b, const float c)
Definition: absgeo.cxx:45
void reconfigure(const fhicl::ParameterSet &pset)
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:68
calib::TimingCalFilter::~TimingCalFilter ( )
virtual

Definition at line 103 of file TimingCalFilter_module.cc.

104  {
105  }

Member Function Documentation

void calib::TimingCalFilter::beginJob ( )
virtual

Reimplemented from art::EDFilter.

Definition at line 108 of file TimingCalFilter_module.cc.

109  {
110  }
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

147 {
148  if (!moduleContext_)
149  return ProductToken<T>::invalid();
150 
151  consumables_[BT].emplace_back(ConsumableType::Product,
152  TypeID{typeid(T)},
153  it.label(),
154  it.instance(),
155  it.process());
156  return ProductToken<T>{it};
157 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited
CurrentProcessingContext const* art::EDFilter::currentContext ( ) const
protectedinherited
bool calib::TimingCalFilter::endSubRun ( art::SubRun sr)
virtual

Reimplemented from art::EDFilter.

Definition at line 113 of file TimingCalFilter_module.cc.

References fDCMOffsetCount, fDCMOffsetSum, fDCMOffsetSumSquare, fDCMUse, MECModelEnuComparisons::i, calib::j, caldp::kDCMNumMax, cet::sqlite::max(), maxTimeRun, min(), minTimeRun, art::SubRun::put(), caldp::DCMSummary::SetDCMOffsetCount(), caldp::DCMSummary::SetDCMOffsetSum(), caldp::DCMSummary::SetDCMOffsetSumSquare(), caldp::DCMSummary::SetDCMUse(), caldp::DCMSummary::SetEndTime(), and caldp::DCMSummary::SetStartTime().

114  {
115  //object suming stats for absolute timing calibration
116  caldp::DCMSummary fDCMSummary;
117 
118  fDCMSummary.SetDCMUse(fDCMUse);
119  fDCMSummary.SetDCMOffsetCount(fDCMOffsetCount);
120  fDCMSummary.SetDCMOffsetSum(fDCMOffsetSum);
122  fDCMSummary.SetStartTime(minTimeRun);
123  fDCMSummary.SetEndTime(maxTimeRun);
124 
125  std::unique_ptr<caldp::DCMSummary> dsum(new caldp::DCMSummary(fDCMSummary));
126  sr.put(std::move(dsum));
127 
128  for (unsigned int i=0; i<caldp::kDCMNumMax; ++i){
129  fDCMUse[i] = 0;
130  for (unsigned int j=0; j<caldp::kDCMNumMax; ++j){
131  fDCMOffsetCount[i][j] = 0;
132  fDCMOffsetSum[i][j] = 0;
133  fDCMOffsetSumSquare[i][j] = 0;
134  }
135  }
138 
139  return true;
140  }
void SetStartTime(uint32_t aStart)
Definition: DCMSummary.h:40
void SetDCMOffsetCount(std::vector< std::vector< int > > in)
Definition: DCMSummary.h:44
std::vector< std::vector< float > > fDCMOffsetSum
vector running sum of relative dcm offsets
std::vector< std::vector< int > > fDCMOffsetCount
static const int kDCMNumMax
maximum number of dcms possible on a detector
Definition: DCMSummary.h:16
std::vector< std::vector< float > > fDCMOffsetSumSquare
vector running sum squared of dcm offsets
const double j
Definition: BetheBloch.cxx:29
void SetDCMUse(std::vector< int > in)
Definition: DCMSummary.h:43
void SetDCMOffsetSumSquare(std::vector< std::vector< float > > in)
Definition: DCMSummary.h:46
std::vector< int > fDCMUse
vector of times a dcm is used
static float min(const float a, const float b, const float c)
Definition: absgeo.cxx:45
ProductID put(std::unique_ptr< PROD > &&)
void SetEndTime(uint32_t aEnd)
Set end time offset is valid for.
Definition: DCMSummary.h:42
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:68
void SetDCMOffsetSum(std::vector< std::vector< float > > in)
Definition: DCMSummary.h:45
bool calib::TimingCalFilter::filter ( art::Event e)
virtual

Implements art::EDFilter.

Definition at line 143 of file TimingCalFilter_module.cc.

References febshutoff_auto::dcm, caldp::DCMStat::dcmList, DEFINE_ART_MODULE(), fDCMLabel, fDCMOffsetCount, fDCMOffsetSum, fDCMOffsetSumSquare, fDCMUse, art::fill_ptr_vector(), geom(), art::DataViewImpl::getByLabel(), MECModelEnuComparisons::i, maxTimeRun, minTimeRun, PandAna.reco_validation.add_data::offset, art::Event::run(), art::Event::subRun(), art::Event::time(), and art::Timestamp::timeHigh().

144  {
146 
147  //get the cosmic tracks associated with each event
149  evt.getByLabel(fDCMLabel,dcmcol);
150 
151  std::vector<art::Ptr<caldp::DCMStat> > dcms;
152  art::fill_ptr_vector(dcms, dcmcol);
153 
154  uint32_t evtTime = evt.time().timeHigh();
155  if (evtTime < minTimeRun) minTimeRun = evtTime;
156  if (evtTime > maxTimeRun) maxTimeRun = evtTime;
157 
158 
159  //now loop over the dcms
160  for (unsigned int i=0; i<dcms.size(); ++i){
161  const art::Ptr<caldp::DCMStat> dcm = dcms.at(i);
162  for (unsigned int dcm1=0; dcm1<dcm->dcmList.size(); ++dcm1){
163  //shift index to fill arrya starting at 0
164  int d1Indx = dcm->dcmList[dcm1].dcmNum-1;
165  fDCMUse[d1Indx]++;
166  for (unsigned int dcm2=dcm1+1; dcm2<dcm->dcmList.size(); ++dcm2){
167  //shift index for filling array
168  int d2Indx = dcm->dcmList[dcm2].dcmNum-1;
169  float offset = dcm->dcmList[dcm1].dcmTime - dcm->dcmList[dcm2].dcmTime;
170  fDCMOffsetCount[d1Indx][d2Indx]++;
171  fDCMOffsetSum[d1Indx][d2Indx] += offset;
172  fDCMOffsetSumSquare[d1Indx][d2Indx] += offset*offset;
173  }
174  }
175  } //end loop over dcm stat object
176 
177  // For automatic output file naming to work, need to allow at least one
178  // event per subrun for now. ART issue 5427
179  static unsigned int prevR = -1, prevSR = -1;
180  if(evt.run() != prevR || evt.subRun() != prevSR){
181  prevR = evt.run();
182  prevSR = evt.subRun();
183  return true;
184  }
185  return false;
186 
187  }
std::string fDCMLabel
Where to find DCM stats.
std::vector< std::vector< float > > fDCMOffsetSum
vector running sum of relative dcm offsets
std::vector< std::vector< int > > fDCMOffsetCount
std::vector< std::vector< float > > fDCMOffsetSumSquare
vector running sum squared of dcm offsets
int evt
std::vector< int > fDCMUse
vector of times a dcm is used
void geom(int which=0)
Definition: geom.C:163
std::vector< DCMTime > dcmList
Definition: DCMStat.h:31
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
Definition: fwd.h:28
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
template<typename PROD , BranchType B>
ProductID art::EDFilter::getProductID ( std::string const &  instanceName = {}) const
inlineinherited

Definition at line 131 of file EDFilter.h.

References art::EDFilter::moduleDescription_.

Referenced by novaddt::HoughTrackMaker::create_associations().

132  {
133  return ProducerBase::getProductID<PROD, B>(moduleDescription_,
134  instanceName);
135  }
ModuleDescription moduleDescription_
Definition: EDFilter.h:124
template<typename PROD , BranchType B>
ProductID art::ProducerBase::getProductID ( ModuleDescription const &  moduleDescription,
std::string const &  instanceName 
) const
inherited

Definition at line 56 of file ProducerBase.h.

References art::ModuleDescription::moduleLabel().

Referenced by art::ProducerBase::modifiesEvent().

58  {
59  auto const& pd =
60  get_ProductDescription<PROD>(B, md.moduleLabel(), instanceName);
61  return pd.productID();
62  }
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

190 {
191  if (!moduleContext_)
192  return ProductToken<T>::invalid();
193 
194  consumables_[BT].emplace_back(ConsumableType::Product,
195  TypeID{typeid(T)},
196  it.label(),
197  it.instance(),
198  it.process());
199  return ProductToken<T>{it};
200 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

215 {
216  if (!moduleContext_)
217  return ViewToken<T>::invalid();
218 
219  consumables_[BT].emplace_back(ConsumableType::ViewElement,
220  TypeID{typeid(T)},
221  it.label(),
222  it.instance(),
223  it.process());
224  return ViewToken<T>{it};
225 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
bool art::ProducerBase::modifiesEvent ( ) const
inlineinherited

Definition at line 40 of file ProducerBase.h.

References art::ProducerBase::getProductID(), and string.

41  {
42  return true;
43  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
void calib::TimingCalFilter::reconfigure ( const fhicl::ParameterSet pset)

Definition at line 97 of file TimingCalFilter_module.cc.

References fDCMLabel, fhicl::ParameterSet::get(), and string.

Referenced by TimingCalFilter().

98  {
99  fDCMLabel = pset.get< std::string >("DCMLabel");
100  }
std::string fDCMLabel
Where to find DCM stats.
T get(std::string const &key) const
Definition: ParameterSet.h:231
enum BeamMode string
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by art::RootOutput::endJob().

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited

Member Data Documentation

constexpr bool art::EDFilter::Fail {false}
staticinherited

Definition at line 33 of file EDFilter.h.

Referenced by evgen::GENIEFilter::filter().

std::map<int, std::vector<art::Ptr<caldp::PCHit> > > calib::TimingCalFilter::fDCMHitMap
private

Definition at line 61 of file TimingCalFilter_module.cc.

std::string calib::TimingCalFilter::fDCMLabel
private

Where to find DCM stats.

Definition at line 58 of file TimingCalFilter_module.cc.

Referenced by filter(), and reconfigure().

std::vector<std::vector<int> > calib::TimingCalFilter::fDCMOffsetCount
private

Definition at line 66 of file TimingCalFilter_module.cc.

Referenced by endSubRun(), and filter().

std::vector<std::vector<float> > calib::TimingCalFilter::fDCMOffsetSum
private

vector running sum of relative dcm offsets

Definition at line 68 of file TimingCalFilter_module.cc.

Referenced by endSubRun(), and filter().

std::vector<std::vector<float> > calib::TimingCalFilter::fDCMOffsetSumSquare
private

vector running sum squared of dcm offsets

Definition at line 70 of file TimingCalFilter_module.cc.

Referenced by endSubRun(), and filter().

std::vector<int > calib::TimingCalFilter::fDCMUse
private

vector of times a dcm is used

Definition at line 72 of file TimingCalFilter_module.cc.

Referenced by endSubRun(), and filter().

uint32_t calib::TimingCalFilter::maxTimeRun
private

Definition at line 64 of file TimingCalFilter_module.cc.

Referenced by endSubRun(), and filter().

uint32_t calib::TimingCalFilter::minTimeRun
private

Definition at line 63 of file TimingCalFilter_module.cc.

Referenced by endSubRun(), and filter().

constexpr bool art::EDFilter::Pass {true}
staticinherited

Definition at line 32 of file EDFilter.h.

Referenced by evgen::GENIEFilter::filter().


The documentation for this class was generated from the following file: