Public Member Functions | Public Attributes | Private Member Functions | List of all members
ProductTablesFixture Class Reference

Public Member Functions

 ProductTablesFixture ()
 
 ProductTablesFixture ()
 

Public Attributes

ModuleDescription currentModuleDescription_ {}
 
std::map< std::string, std::map< std::string, ParameterSet > > moduleConfigurations_ {}
 
std::map< std::string, ModuleDescriptionmoduleDescriptions_ {}
 
ProductDescriptions descriptions_ {}
 
ProductTables producedProducts_ {ProductTables::invalid()}
 
ProductTable presentProducts_ {}
 
std::map< std::string, TypeLabelLookup_tearlyLookup_ {}
 
TypeLabelLookup_t currentLookup_ {}
 
std::map< std::string, art::ProductIDproductIDs_ {}
 
std::map< std::string, art::ProcessConfiguration * > processConfigurations_ {}
 

Private Member Functions

template<typename T , bool Present>
ModuleDescription const & registerProduct (std::string const &tag, std::string const &moduleLabel, std::string const &processName, std::string const &productInstanceName={})
 
art::BranchDescription fake_single_process_branch (std::string const &tag, std::string const &processName, std::string const &productInstanceName={})
 
ProcessConfigurationfake_single_module_process (std::string const &tag, std::string const &processName, fhicl::ParameterSet const &moduleParams, std::string const &release=art::getReleaseVersion())
 

Detailed Description

Definition at line 112 of file Event_t.cc.

Constructor & Destructor Documentation

ProductTablesFixture::ProductTablesFixture ( )

Definition at line 144 of file Event_t.cc.

145 {
146  constexpr bool presentFromSource{true};
147  constexpr bool produced{false};
148 
149  // Register products for "EARLY" process
150  registerProduct<product_t, presentFromSource>(
151  "nolabel_tag", "modOne", "EARLY");
152  registerProduct<product_t, presentFromSource>(
153  "int1_tag", "modMulti", "EARLY", "int1");
154  registerProduct<product_t, presentFromSource>(
155  "int2_tag", "modMulti", "EARLY", "int2");
156  registerProduct<product_t, presentFromSource>(
157  "int3_tag", "modMulti", "EARLY");
158 
159  // Register products for "LATE" process
160  registerProduct<product_t, presentFromSource>(
161  "int1_tag_late", "modMulti", "LATE", "int1");
162 
163  // Fill the lookups for "source-like" products
164  {
166  descriptions_.clear();
167  }
168 
169  // Register single IntProduct for the "CURRENT" process
170  currentModuleDescription_ = registerProduct<product_t, produced>(
171  "current_tag", "modMulti", "CURRENT", "int1");
172 
173  // Create the lookup that we will use for the current-process module
174  {
176  descriptions_.clear();
177  }
178 }
ProductDescriptions descriptions_
Definition: Event_t.cc:126
ProductTables producedProducts_
Definition: Event_t.cc:127
ProductTable presentProducts_
Definition: Event_t.cc:128
ModuleDescription currentModuleDescription_
Definition: Event_t.cc:116
ProductTablesFixture::ProductTablesFixture ( )

Member Function Documentation

ProcessConfiguration * ProductTablesFixture::fake_single_module_process ( std::string const &  tag,
std::string const &  processName,
fhicl::ParameterSet const &  moduleParams,
std::string const &  release = art::getReleaseVersion() 
)
private

Definition at line 85 of file EventPrincipal_t.cc.

90 {
91  fhicl::ParameterSet processParams;
92  processParams.put(processName, moduleParams);
93  processParams.put("process_name", processName);
94  auto result =
95  new ProcessConfiguration(processName, processParams.id(), release);
97  return result;
98 }
static QCString result
ParameterSetID id() const
string release
Definition: conf.py:24
void put(std::string const &key)
std::map< std::string, art::ProcessConfiguration * > processConfigurations_
art::BranchDescription ProductTablesFixture::fake_single_process_branch ( std::string const &  tag,
std::string const &  processName,
std::string const &  productInstanceName = {} 
)
private

Definition at line 101 of file EventPrincipal_t.cc.

105 {
106  string const moduleLabel{processName + "dummyMod"};
107  string const moduleClass{"DummyModule"};
108  TypeID const dummyType{typeid(arttest::DummyProduct)};
109  fhicl::ParameterSet modParams;
110  modParams.put("module_type", moduleClass);
111  modParams.put("module_label", moduleLabel);
112 
114  art::InEvent,
115  art::TypeLabel{dummyType,
116  productInstanceName,
118  false},
119  moduleLabel,
120  modParams.id(),
121  *fake_single_module_process(tag, processName, modParams)};
122  productIDs_.emplace(tag, result.productID());
123  return result;
124 }
static QCString result
ProcessConfiguration * fake_single_module_process(std::string const &tag, std::string const &processName, fhicl::ParameterSet const &moduleParams, std::string const &release=art::getReleaseVersion())
std::map< std::string, art::ProductID > productIDs_
ParameterSetID id() const
void put(std::string const &key)
template<class T , bool Present>
ModuleDescription const & ProductTablesFixture::registerProduct ( std::string const &  tag,
std::string const &  moduleLabel,
std::string const &  processName,
std::string const &  productInstanceName = {} 
)
private

Definition at line 182 of file Event_t.cc.

186 {
187  ParameterSet moduleParams;
188  moduleParams.put("module_type", module_class_name());
189  moduleParams.put("module_label", moduleLabel);
190 
191  moduleConfigurations_[processName][moduleLabel] = moduleParams;
192 
193  ParameterSet processParams;
194  processParams.put("process_name", processName);
195  processParams.put(moduleLabel, moduleParams);
196 
198  processName, processParams.id(), getReleaseVersion()};
199 
200  ModuleDescription const localModuleDescription{moduleParams.id(),
201  module_class_name(),
202  moduleLabel,
203  ModuleThreadingType::legacy,
204  process,
205  Present};
206 
207  TypeID const product_type{typeid(T)};
208 
209  moduleDescriptions_[tag] = localModuleDescription;
210  TypeLabel typeLabel{
211  product_type, productInstanceName, SupportsView<T>::value, false};
212  if (Present) {
213  typeLabel = TypeLabel{
214  product_type, productInstanceName, SupportsView<T>::value, moduleLabel};
215  }
217  InEvent, typeLabel, moduleLabel, moduleParams.id(), process};
218  if (Present) {
219  earlyLookup_[tag].emplace(typeLabel, pd);
220  } else {
221  currentLookup_.emplace(typeLabel, pd);
222  }
223  descriptions_.push_back(pd);
224  return moduleDescriptions_[tag];
225 }
ProductDescriptions descriptions_
Definition: Event_t.cc:126
TypeLabelLookup_t currentLookup_
Definition: Event_t.cc:130
def process(f, kind)
Definition: search.py:254
std::map< std::string, ModuleDescription > moduleDescriptions_
Definition: Event_t.cc:122
std::string const & getReleaseVersion()
ParameterSetID id() const
std::map< std::string, TypeLabelLookup_t > earlyLookup_
Definition: Event_t.cc:129
void put(std::string const &key)
std::map< std::string, std::map< std::string, ParameterSet > > moduleConfigurations_
Definition: Event_t.cc:121

Member Data Documentation

TypeLabelLookup_t ProductTablesFixture::currentLookup_ {}

Definition at line 130 of file Event_t.cc.

ModuleDescription ProductTablesFixture::currentModuleDescription_ {}

Definition at line 116 of file Event_t.cc.

ProductDescriptions ProductTablesFixture::descriptions_ {}

Definition at line 126 of file Event_t.cc.

std::map<std::string, TypeLabelLookup_t> ProductTablesFixture::earlyLookup_ {}

Definition at line 129 of file Event_t.cc.

std::map<std::string, std::map<std::string, ParameterSet> > ProductTablesFixture::moduleConfigurations_ {}

Definition at line 121 of file Event_t.cc.

std::map<std::string, ModuleDescription> ProductTablesFixture::moduleDescriptions_ {}

Definition at line 122 of file Event_t.cc.

ProductTable ProductTablesFixture::presentProducts_ {}

Definition at line 128 of file Event_t.cc.

std::map<std::string, art::ProcessConfiguration*> ProductTablesFixture::processConfigurations_ {}

Definition at line 55 of file EventPrincipal_t.cc.

ProductTables ProductTablesFixture::producedProducts_ {ProductTables::invalid()}

Definition at line 127 of file Event_t.cc.

std::map<std::string, art::ProductID> ProductTablesFixture::productIDs_ {}

Definition at line 54 of file EventPrincipal_t.cc.


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