1 #ifndef MuonTools_MuDigiBaseProducer_h 2 #define MuonTools_MuDigiBaseProducer_h 21 template <
class DETECTOR_T,
class DIGI_T>
30 std::vector<std::unique_ptr<Variable<DETECTOR_T>>>
detIdVars_;
41 std::unique_ptr<Variable<DETECTOR_T>> detVarPtr;
44 detVarPtr =
std::move(std::make_unique<IntDetVar>(
name, varCfg));
45 }
else if (
type ==
"uint") {
46 detVarPtr =
std::move(std::make_unique<UIntDetVar>(
name, varCfg));
47 }
else if (
type ==
"int16") {
48 detVarPtr =
std::move(std::make_unique<Int16DetVar>(
name, varCfg));
49 }
else if (
type ==
"uint8") {
50 detVarPtr =
std::move(std::make_unique<UInt8DetVar>(
name, varCfg));
65 edm::Comment comType{
"the c++ type of the branch in the flat table"};
66 edm::Comment comPrecision{
"the precision with which to store the value in the flat table"};
68 variable.add<
std::string>(
"expr")->setComment(
"a function to define the content of the branch in the flat table");
69 variable.add<
std::string>(
"doc")->setComment(
"few words description of the branch content");
72 edm::allowedValues<std::string>(
"int",
"uint",
"int16",
"uint8"));
76 variables.setComment(
"a parameters set to define all variable taken form detId to fill the flat table");
88 std::vector<const DIGI_T *> digis;
89 std::vector<const DETECTOR_T *> detIds;
90 std::list<DETECTOR_T> detIdObjs;
93 auto detIdIt =
prod->begin();
94 auto detIdEnd =
prod->end();
96 for (; detIdIt != detIdEnd; ++detIdIt) {
98 detIdObjs.push_back(
detId);
99 std::fill_n(std::back_inserter(detIds),
range.second -
range.first, &detIdObjs.back());
104 auto table = std::make_unique<nanoaod::FlatTable>(digis.size(), this->
name_,
false, this->
extension_);
106 for (
const auto &
var : this->
vars_) {
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
T getParameter(std::string const &) const
std::unique_ptr< nanoaod::FlatTable > fillTable(const edm::Event &iEvent, const edm::Handle< COLLECTION > &prod) const override
constexpr char const * varNames[]
MuDigiBaseProducer(edm::ParameterSet const ¶ms)
~MuDigiBaseProducer() override
std::vector< std::unique_ptr< Variable< DIGI_T > > > vars_
std::vector< std::unique_ptr< Variable< DETECTOR_T > > > detIdVars_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static edm::ParameterSetDescription baseDescriptions()
A container for a generic type of digis indexed by some index, implemented with a map<IndexType...