93 std::vector<Handle<std::vector<T> > > handles;
95 for(
size_t itag = 0; itag < tags_.size(); ++itag){
96 LogInfo(
"HiEmbedding")<<
"itag "<<itag;
97 LogInfo(
"HiEmbedding")<<
"label "<<tags_[itag].label();
98 LogInfo(
"HiEmbedding")<<
"instance "<<tags_[itag].instance();
100 handles.push_back(hand);
101 get =
get && e.
getByLabel(tags_[itag],handles[itag]);
102 if(!
get)
LogWarning(
"Product inconsistency")<<
"One of the sub-events is missing the product with type " 105 <<tags_[itag].instance()
106 <<
" whereas the other one is fine.";
111 crFrame->addSignals(handles[0].product(),e.
id());
112 for(
size_t itag = 1; itag < tags_.size(); ++itag){
113 std::vector<T>* product =
const_cast<std::vector<T>*
>(handles[itag].product());
115 for(
auto& item : *product) {
118 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]);
134 if(!
get)
LogWarning(
"Product inconsistency")<<
"One of the sub-events is missing the product with type " 137 <<tags_[itag].instance()
138 <<
" whereas the other one is fine.";
143 crFrame->addSignals(handles[0].product(),e.
id());
144 for(
size_t itag = 1; itag < tags_.size(); ++itag){
146 crFrame->addPileups(*product);
185 std::vector<std::string> simtags = pset.
getParameter<std::vector<std::string> >(
"srcSIM");
186 std::vector<std::string> gentags = pset.
getParameter<std::vector<std::string> >(
"srcGEN");
188 if(simtags.size() != gentags.size())
LogError(
"MixingInput")<<
"Generator and Simulation input lists are not matching each other"<<endl;
190 for (std::vector<string>::iterator it=names.begin();it!= names.end();++it){
193 if (!pstag.
exists(
"type"))
continue;
195 std::vector<InputTag> tags=pstag.
getParameter<std::vector<InputTag> >(
"input");
198 for(
size_t itag = 0; itag < tags.size(); ++itag){
200 std::vector<InputTag>
inputs;
203 if (
object==
"HepMCProduct") signal = gentags[
input];
204 else signal = simtags[
input];
210 if (
object==
"HepMCProduct"){
212 produces<CrossingFrame<HepMCProduct> >(
label);
213 consumes<HepMCProduct>(
tag);
214 }
else if (
object==
"SimTrack"){
216 produces<CrossingFrame<SimTrack> >(
label);
217 consumes<std::vector<SimTrack> >(
tag);
218 }
else if (
object==
"SimVertex"){
220 produces<CrossingFrame<SimVertex> >(
label);
221 consumes<std::vector<SimVertex> >(
tag);
222 }
else if (
object==
"PSimHit"){
224 produces<CrossingFrame<PSimHit> >(
label);
225 consumes<std::vector<PSimHit> >(
tag);
226 }
else if (
object==
"PCaloHit"){
228 produces<CrossingFrame<PCaloHit> >(
label);
229 consumes<std::vector<PCaloHit> >(
tag);
230 }
else LogInfo(
"Error")<<
"What the hell is this object?!";
232 LogInfo(
"HiMixingModule") <<
"Will mix "<<
object<<
"s with InputTag= "<<tag.
encode()<<
", label will be "<<
label;
236 produces<PileupMixingContent>();
240 HiMixingModule::~HiMixingModule()
259 for(
size_t i = 0;
i < workers_.size(); ++
i){
260 (workers_[
i])->addSignals(iEvent);
263 std::unique_ptr< PileupMixingContent > PileupMixing_ = std::unique_ptr< PileupMixingContent >(
new PileupMixingContent());
275 if (
object==
"HepMCProduct") lookfor=
"edm::"+
object;
276 else if (
object==
"edm::HepMCProduct") lookfor=
object;
277 else lookfor=
"std::vector<"+
object+
">";
279 for (edm::ProductRegistry::ProductList::const_iterator it = reg->
productList().begin();
296 LogWarning(
"MixingModule")<<
"!!!!!!!!!Could not find in registry requested object: "<<
object<<
" with "<<tag<<
".\nWill NOT be considered for mixing!!!!!!!!!";
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
HiMixingWorkerBase(std::string &object, std::vector< InputTag > &tags, std::string &label)
virtual ~HiMixingWorkerBase()
bool exists(std::string const ¶meterName) const
checks if a parameter exists
const std::string names[nVars_]
~HiMixingWorker() override
static std::string const input
#define DEFINE_FWK_MODULE(type)
std::string const & className() const
std::string const & moduleLabel() const
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
std::vector< HiMixingWorkerBase * > workers_
ProductList const & productList() const