96 std::vector<Handle<std::vector<T> > > handles;
98 for(
size_t itag = 0; itag < tags_.size(); ++itag){
99 LogInfo(
"HiEmbedding")<<
"itag "<<itag;
100 LogInfo(
"HiEmbedding")<<
"label "<<tags_[itag].label();
101 LogInfo(
"HiEmbedding")<<
"instance "<<tags_[itag].instance();
103 handles.push_back(hand);
104 get =
get && e.
getByLabel(tags_[itag],handles[itag]);
105 if(!
get)
LogWarning(
"Product inconsistency")<<
"One of the sub-events is missing the product with type "
108 <<tags_[itag].instance()
109 <<
" whereas the other one is fine.";
114 crFrame->addSignals(handles[0].product(),e.
id());
115 for(
size_t itag = 1; itag < tags_.size(); ++itag){
116 crFrame->addPileups(0,
const_cast< std::vector<T> *
>(handles[itag].product()),itag);
118 e.
put(crFrame,label_);
126 std::vector<Handle<HepMCProduct> > handles;
128 for(
size_t itag = 0; itag< tags_.size(); ++itag){
130 handles.push_back(hand);
131 get =
get && e.
getByLabel(tags_[itag],handles[itag]);
132 if(!
get)
LogWarning(
"Product inconsistency")<<
"One of the sub-events is missing the product with type "
135 <<tags_[itag].instance()
136 <<
" whereas the other one is fine.";
141 crFrame->addSignals(handles[0].product(),e.
id());
142 for(
size_t itag = 1; itag < tags_.size(); ++itag){
143 crFrame->addPileups(0, const_cast<HepMCProduct *>(handles[itag].product()),itag);
145 e.
put(crFrame,label_);
157 virtual void endJob() ;
158 bool verifyRegistry(std::string
object, std::string subdet,
InputTag &
tag,std::string &
label);
182 std::vector<std::string> simtags = pset.
getParameter<std::vector<std::string> >(
"srcSIM");
183 std::vector<std::string> gentags = pset.
getParameter<std::vector<std::string> >(
"srcGEN");
185 if(simtags.size() != gentags.size())
LogError(
"MixingInput")<<
"Generator and Simulation input lists are not matching each other"<<endl;
187 for (std::vector<string>::iterator it=names.begin();it!= names.end();++it){
190 if (!pstag.
exists(
"type"))
continue;
191 std::string
object = pstag.
getParameter<std::string>(
"type");
192 std::vector<InputTag>
tags=pstag.
getParameter<std::vector<InputTag> >(
"input");
195 for(
size_t itag = 0; itag < tags.size(); ++itag){
197 std::vector<InputTag>
inputs;
200 if (
object==
"HepMCProduct") signal = gentags[
input];
201 else signal = simtags[
input];
207 if (
object==
"HepMCProduct"){
209 produces<CrossingFrame<HepMCProduct> >(
label);
210 }
else if (
object==
"SimTrack"){
212 produces<CrossingFrame<SimTrack> >(
label);
213 }
else if (
object==
"SimVertex"){
215 produces<CrossingFrame<SimVertex> >(
label);
216 }
else if (
object==
"PSimHit"){
218 produces<CrossingFrame<PSimHit> >(
label);
219 }
else if (
object==
"PCaloHit"){
221 produces<CrossingFrame<PCaloHit> >(
label);
222 }
else LogInfo(
"Error")<<
"What the hell is this object?!";
224 LogInfo(
"HiMixingModule") <<
"Will mix "<<
object<<
"s with InputTag= "<<tag.
encode()<<
", label will be "<<
label;
228 produces<PileupMixingContent>();
232 HiMixingModule::~HiMixingModule()
251 for(
size_t i = 0;
i < workers_.size(); ++
i){
252 (workers_[
i])->addSignals(iEvent);
255 std::auto_ptr< PileupMixingContent > PileupMixing_ = std::auto_ptr< PileupMixingContent >(
new PileupMixingContent());
256 iEvent.
put(PileupMixing_);
268 HiMixingModule::endJob() {
271 bool HiMixingModule::verifyRegistry(std::string
object, std::string subdet,
InputTag &
tag,std::string &
label) {
278 if (
object==
"HepMCProduct") lookfor=
"edm::"+
object;
279 else if (
object==
"edm::HepMCProduct") lookfor=
object;
280 else lookfor=
"std::vector<"+
object+
">";
282 for (edm::ProductRegistry::ProductList::const_iterator it = reg->
productList().begin();
299 LogWarning(
"MixingModule")<<
"!!!!!!!!!Could not find in registry requested object: "<<
object<<
" with "<<tag<<
".\nWill NOT be considered for mixing!!!!!!!!!";
T getParameter(std::string const &) const
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
std::string const & className() const
std::string const & moduleLabel() const
std::string const & productInstanceName() const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
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_
static const HistoName names[]
ProductList const & productList() const
void addSignals(edm::Event &e)