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();
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) {
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();
280 if (
desc.className() == lookfor &&
desc.moduleLabel() ==
tag.label() &&
281 desc.productInstanceName() ==
tag.instance()) {
293 LogWarning(
"MixingModule") <<
"!!!!!!!!!Could not find in registry requested object: " <<
object <<
" with "
294 <<
tag <<
".\nWill NOT be considered for mixing!!!!!!!!!";