74 : object_(object), tags_(tags), label_(label) {
95 std::vector<Handle<std::vector<T> > >
handles;
97 for (
size_t itag = 0; itag < tags_.size(); ++itag) {
98 LogInfo(
"HiEmbedding") <<
"itag " << itag;
99 LogInfo(
"HiEmbedding") <<
"label " << tags_[itag].label();
100 LogInfo(
"HiEmbedding") <<
"instance " << tags_[itag].instance();
102 handles.push_back(hand);
103 get =
get && e.
getByLabel(tags_[itag], handles[itag]);
106 <<
"One of the sub-events is missing the product with type " << object_ <<
", instance "
107 << tags_[itag].instance() <<
" whereas the other one is fine.";
112 crFrame->addSignals(handles[0].product(), e.
id());
113 for (
size_t itag = 1; itag < tags_.size(); ++itag) {
114 std::vector<T>* product =
const_cast<std::vector<T>*
>(handles[itag].product());
116 for (
auto&
item : *product) {
119 crFrame->addPileups(*product);
128 std::vector<Handle<HepMCProduct> >
handles;
130 for (
size_t itag = 0; itag < tags_.size(); ++itag) {
132 handles.push_back(hand);
133 get =
get && e.
getByLabel(tags_[itag], handles[itag]);
136 <<
"One of the sub-events is missing the product with type " << object_ <<
", instance "
137 << tags_[itag].instance() <<
" whereas the other one is fine.";
142 crFrame->addSignals(handles[0].product(), e.
id());
143 for (
size_t itag = 1; itag < tags_.size(); ++itag) {
145 crFrame->addPileups(*product);
180 std::vector<std::string> simtags = pset.
getParameter<std::vector<std::string> >(
"srcSIM");
181 std::vector<std::string> gentags = pset.
getParameter<std::vector<std::string> >(
"srcGEN");
183 if (simtags.size() != gentags.size())
184 LogError(
"MixingInput") <<
"Generator and Simulation input lists are not matching each other" << endl;
186 for (std::vector<string>::iterator it = names.begin(); it != names.end(); ++it) {
188 if (!pstag.
exists(
"type"))
191 std::vector<InputTag>
tags = pstag.
getParameter<std::vector<InputTag> >(
"input");
194 for (
size_t itag = 0; itag < tags.size(); ++itag) {
196 std::vector<InputTag>
inputs;
199 if (
object ==
"HepMCProduct")
200 signal = gentags[
input];
202 signal = simtags[
input];
208 if (
object ==
"HepMCProduct") {
210 produces<CrossingFrame<HepMCProduct> >(
label);
211 consumes<HepMCProduct>(
tag);
212 }
else if (
object ==
"SimTrack") {
214 produces<CrossingFrame<SimTrack> >(
label);
215 consumes<std::vector<SimTrack> >(
tag);
216 }
else if (
object ==
"SimVertex") {
218 produces<CrossingFrame<SimVertex> >(
label);
219 consumes<std::vector<SimVertex> >(
tag);
220 }
else if (
object ==
"PSimHit") {
222 produces<CrossingFrame<PSimHit> >(
label);
223 consumes<std::vector<PSimHit> >(
tag);
224 }
else if (
object ==
"PCaloHit") {
226 produces<CrossingFrame<PCaloHit> >(
label);
227 consumes<std::vector<PCaloHit> >(
tag);
229 LogInfo(
"Error") <<
"What the hell is this object?!";
231 LogInfo(
"HiMixingModule") <<
"Will mix " <<
object <<
"s with InputTag= " << tag.
encode() <<
", label will be "
236 produces<PileupMixingContent>();
239 HiMixingModule::~HiMixingModule() {
252 for (
size_t i = 0;
i < workers_.size(); ++
i) {
253 (workers_[
i])->addSignals(iEvent);
256 std::unique_ptr<PileupMixingContent> PileupMixing_ = std::make_unique<PileupMixingContent>();
267 if (
object ==
"HepMCProduct")
268 lookfor =
"edm::" + object;
269 else if (
object ==
"edm::HepMCProduct")
272 lookfor =
"std::vector<" +
object +
">";
274 for (edm::ProductRegistry::ProductList::const_iterator it = reg->
productList().begin();
293 LogWarning(
"MixingModule") <<
"!!!!!!!!!Could not find in registry requested object: " <<
object <<
" with "
294 << tag <<
".\nWill NOT be considered for mixing!!!!!!!!!";
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
uint16_t *__restrict__ id
HiMixingWorkerBase(std::string &object, std::vector< InputTag > &tags, std::string &label)
#define DEFINE_FWK_MODULE(type)
virtual ~HiMixingWorkerBase()
bool exists(std::string const ¶meterName) const
checks if a parameter exists
Log< level::Error, false > LogError
const std::string names[nVars_]
~HiMixingWorker() override
static std::string const input
std::string const & className() const
std::string const & moduleLabel() const
std::vector< BaseVolumeHandle * > handles
void addSignals(edm::Event &e) override
std::string const & productInstanceName() const
HiMixingWorker(std::string &object, std::vector< InputTag > &tags, std::string &label)
std::vector< InputTag > tags_
std::vector< std::string > getParameterNames() const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Log< level::Info, false > LogInfo
std::vector< HiMixingWorkerBase * > workers_
T getParameter(std::string const &) const
Log< level::Warning, false > LogWarning
ProductList const & productList() const