Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MergeDaqCollections::MergeDaqCollections Class Reference
Inheritance diagram for MergeDaqCollections::MergeDaqCollections:
art::EDProducer art::ProducerBase art::Consumer art::EngineCreator art::ProductRegistryHelper

Public Types

using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
template<typename UserConfig , typename KeysToIgnore = void>
using Table = ProducerBase::Table< UserConfig, KeysToIgnore >
 

Public Member Functions

 MergeDaqCollections (fhicl::ParameterSet const &pset)
 
virtual ~MergeDaqCollections ()
 
void produce (art::Event &evt)
 
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 ()
 

Protected Member Functions

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

Protected Attributes

std::string fFirstDaqCollection
 
std::string fSecondCollection
 Label on the main collection. More...
 
bool fFirstCollectionIsMC
 Label on the main collection. More...
 
bool fSecondCollectionIsMC
 First collection is MC. More...
 
bool fUseSecondaryTrigger
 Second collection is MC. More...
 
bool fRemoveFirstCollectionNoise
 Want trigger from 2nd collection rather than 1st. More...
 
bool fRemoveSecondCollectionNoise
 Don't mix in noise hits from first collection, if it is MC. More...
 
bool fOverlayWithTDCCut
 Don't mix in noise hits from second collection, if it is MC. More...
 
int fTDCExtendValue
 Only overlay secondary hits within a TDC range of the main event hits. Since we are using the secondary hits as background noise hits. We only need them in the time window close to the signal hits. We can still use the cosmic files before overlay for as a larger data set for background study. This way we can save a lot of disk space for the overlaid files and computing time in the following analysis chain. More...
 
std::string fInstanceLabel
 

Detailed Description

Definition at line 35 of file MergeDaqCollections_module.cc.

Member Typedef Documentation

using art::EDProducer::ModuleType = EDProducer
inherited

Definition at line 34 of file EDProducer.h.

template<typename UserConfig , typename KeysToIgnore = void>
using art::EDProducer::Table = ProducerBase::Table<UserConfig, KeysToIgnore>
inherited

Definition at line 43 of file EDProducer.h.

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

Definition at line 35 of file EDProducer.h.

Constructor & Destructor Documentation

MergeDaqCollections::MergeDaqCollections::MergeDaqCollections ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 63 of file MergeDaqCollections_module.cc.

63  :
64  fFirstDaqCollection (pset.get< std::string >("FirstDaqCollection")),
65  fSecondCollection (pset.get< std::string >("SecondCollection")),
66  fFirstCollectionIsMC (pset.get< bool >("FirstCollectionIsMC")),
67  fSecondCollectionIsMC (pset.get< bool >("SecondCollectionIsMC")),
68  fUseSecondaryTrigger (pset.get< bool >("UseSecondaryTrigger")),
69  fRemoveFirstCollectionNoise (pset.get< bool >("RemoveFirstCollectionNoise")),
70  fRemoveSecondCollectionNoise(pset.get< bool >("RemoveSecondCollectionNoise")),
71  fOverlayWithTDCCut(pset.get< bool >("OverlayWithTDCCut")),
72  fTDCExtendValue(pset.get< int >("TDCExtendValue")),
73  fInstanceLabel (pset.get< std::string >("InstanceLabel"))
74  {
75  produces< std::vector<rawdata::RawDigit> >(fInstanceLabel);
76  produces< std::vector<rawdata::RawTrigger> >(fInstanceLabel);
77  }
bool fOverlayWithTDCCut
Don&#39;t mix in noise hits from second collection, if it is MC.
bool fRemoveSecondCollectionNoise
Don&#39;t mix in noise hits from first collection, if it is MC.
bool fFirstCollectionIsMC
Label on the main collection.
std::string fSecondCollection
Label on the main collection.
bool fRemoveFirstCollectionNoise
Want trigger from 2nd collection rather than 1st.
int fTDCExtendValue
Only overlay secondary hits within a TDC range of the main event hits. Since we are using the seconda...
enum BeamMode string
MergeDaqCollections::MergeDaqCollections::~MergeDaqCollections ( )
virtual

Definition at line 80 of file MergeDaqCollections_module.cc.

81  {
82  }

Member Function Documentation

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::EDProducer::currentContext ( ) const
protectedinherited
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::EDProducer::getProductID ( std::string const &  instanceName = {}) const
inlineinherited

Definition at line 123 of file EDProducer.h.

References art::EDProducer::moduleDescription_.

Referenced by skim::NueSkimmer::CopyMichelSlice(), and skim::NueSkimmer::CopyMichelTrack().

124  {
125  return ProducerBase::getProductID<PROD, B>(moduleDescription_,
126  instanceName);
127  }
ModuleDescription moduleDescription_
Definition: EDProducer.h:115
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 MergeDaqCollections::MergeDaqCollections::produce ( art::Event evt)
virtual

Implements art::EDProducer.

Definition at line 85 of file MergeDaqCollections_module.cc.

References DEFINE_ART_MODULE(), art::DataViewImpl::getByLabel(), MECModelEnuComparisons::i, cheat::BackTracker::IsNoise(), calib::Calibrator::MakeCellHit(), cet::sqlite::max(), std::max(), min(), std::min(), art::Event::put(), cheat::BackTracker::Rebuild(), rawdata::RawDigit::SetMC(), and rawdata::RawDigit::TDC().

86  {
89 
90  // BackTracker has not yet seen MC mixed from secondary file
91  if(fSecondCollectionIsMC) bt->Rebuild(evt);
92 
93  std::unique_ptr< std::vector<rawdata::RawDigit> > digitcol (new std::vector<rawdata::RawDigit>);
94  std::unique_ptr< std::vector<rawdata::RawTrigger> > triggercol (new std::vector<rawdata::RawTrigger>);
95 
97  evt.getByLabel(fFirstDaqCollection, digit1list);
98 
100  evt.getByLabel(fSecondCollection, digit2list);
101 
102 
103  // First Collection Digits
104  auto min_TDC = std::numeric_limits<int32_t>::max();
105  auto max_TDC = std::numeric_limits<int32_t>::min();
106  for(unsigned int i = 0; i < digit1list->size(); ++i){
107  rawdata::RawDigit digit ((*digit1list)[i]);
108  digit.SetMC(fFirstCollectionIsMC);
110  // Make cell hit so backtracker can
111  // attempt to match to particle
112  if(!bt->IsNoise(cal->MakeCellHit(&digit)))
113  digitcol->push_back(digit);
114  }
115  else
116  digitcol->push_back(digit);
117  }
118  //find max and min TDC of the digitcol
119  if (fOverlayWithTDCCut){
120  for(auto digit: *digitcol){
121  min_TDC = std::min(min_TDC, digit.TDC());
122  max_TDC = std::max(max_TDC, digit.TDC());
123  }
124  }
125 
126  //extend time window on each end with fTDCExtendValue
127  min_TDC = std::max(min_TDC-fTDCExtendValue, -3200); // data always has TDC > -3200 TDC which is 50 us, so we only overlay data beyond this time point.
128  max_TDC = max_TDC+fTDCExtendValue;
129 
130  // Second Collection Digits
131  for(unsigned int i = 0; i < digit2list->size(); ++i){
132  rawdata::RawDigit digit ((*digit2list)[i]);
133  if (fOverlayWithTDCCut){
134  if (digit.TDC()>max_TDC || digit.TDC()<min_TDC)
135  continue;
136  }
137  digit.SetMC(fSecondCollectionIsMC);
139  // Make cell hit so backtracker can
140  // attempt to match to particle
141  if(!bt->IsNoise(cal->MakeCellHit(&digit)))
142  digitcol->push_back(digit);
143  }
144  else
145  digitcol->push_back(digit);
146  }
147 
148 
149  // It can't be assumed which trigger is appropriate
151 
153  evt.getByLabel(fSecondCollection, triggerlist);
154 
155  for (unsigned int i = 0; i < triggerlist->size(); ++i) {
156  rawdata::RawTrigger trigger ((*triggerlist)[i]);
157  triggercol->push_back(trigger);
158  }
159  } else {
160  evt.getByLabel(fFirstDaqCollection, triggerlist);
161 
162  for (unsigned int i = 0; i < triggerlist->size(); ++i) {
163  rawdata::RawTrigger trigger ((*triggerlist)[i]);
164  triggercol->push_back(trigger);
165  }
166  }
167 
168  // put the collections in the event
169  evt.put(std::move(digitcol), fInstanceLabel);
170  evt.put(std::move(triggercol), fInstanceLabel);
171 
172  }
T max(const caf::Proxy< T > &a, T b)
bool fOverlayWithTDCCut
Don&#39;t mix in noise hits from second collection, if it is MC.
rb::CellHit MakeCellHit(const rawdata::RawDigit *rawdigit)
bool IsNoise(const art::Ptr< rb::CellHit > &hit) const
Is this hit not associated with any particles?
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
bool fRemoveSecondCollectionNoise
Don&#39;t mix in noise hits from first collection, if it is MC.
bool fFirstCollectionIsMC
Label on the main collection.
std::string fSecondCollection
Label on the main collection.
bool fRemoveFirstCollectionNoise
Want trigger from 2nd collection rather than 1st.
void Rebuild(const art::Event &evt)
static float min(const float a, const float b, const float c)
Definition: absgeo.cxx:45
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
int fTDCExtendValue
Only overlay secondary hits within a TDC range of the main event hits. Since we are using the seconda...
T min(const caf::Proxy< T > &a, T b)
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:68
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

bool MergeDaqCollections::MergeDaqCollections::fFirstCollectionIsMC
protected

Label on the main collection.

Definition at line 49 of file MergeDaqCollections_module.cc.

std::string MergeDaqCollections::MergeDaqCollections::fFirstDaqCollection
protected

Definition at line 46 of file MergeDaqCollections_module.cc.

std::string MergeDaqCollections::MergeDaqCollections::fInstanceLabel
protected

Definition at line 58 of file MergeDaqCollections_module.cc.

bool MergeDaqCollections::MergeDaqCollections::fOverlayWithTDCCut
protected

Don't mix in noise hits from second collection, if it is MC.

Definition at line 55 of file MergeDaqCollections_module.cc.

bool MergeDaqCollections::MergeDaqCollections::fRemoveFirstCollectionNoise
protected

Want trigger from 2nd collection rather than 1st.

Definition at line 53 of file MergeDaqCollections_module.cc.

bool MergeDaqCollections::MergeDaqCollections::fRemoveSecondCollectionNoise
protected

Don't mix in noise hits from first collection, if it is MC.

Definition at line 54 of file MergeDaqCollections_module.cc.

std::string MergeDaqCollections::MergeDaqCollections::fSecondCollection
protected

Label on the main collection.

Definition at line 47 of file MergeDaqCollections_module.cc.

bool MergeDaqCollections::MergeDaqCollections::fSecondCollectionIsMC
protected

First collection is MC.

Definition at line 50 of file MergeDaqCollections_module.cc.

int MergeDaqCollections::MergeDaqCollections::fTDCExtendValue
protected

Only overlay secondary hits within a TDC range of the main event hits. Since we are using the secondary hits as background noise hits. We only need them in the time window close to the signal hits. We can still use the cosmic files before overlay for as a larger data set for background study. This way we can save a lot of disk space for the overlaid files and computing time in the following analysis chain.

Definition at line 56 of file MergeDaqCollections_module.cc.

bool MergeDaqCollections::MergeDaqCollections::fUseSecondaryTrigger
protected

Second collection is MC.

Definition at line 51 of file MergeDaqCollections_module.cc.


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