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]);
104 if(!
get)
LogWarning(
"Product inconsistency")<<
"One of the sub-events is missing the product with type "
107 <<tags_[itag].instance()
108 <<
" whereas the other one is fine.";
113 crFrame->addSignals(handles[0].product(),e.
id());
114 for(
size_t itag = 1; itag < tags_.size(); ++itag){
115 crFrame->addPileups(0,
const_cast< std::vector<T> *
>(handles[itag].product()),itag);
117 e.
put(crFrame,label_);
125 std::vector<Handle<HepMCProduct> > handles;
127 for(
size_t itag = 0; itag< tags_.size(); ++itag){
129 handles.push_back(hand);
130 get =
get && e.
getByLabel(tags_[itag],handles[itag]);
131 if(!
get)
LogWarning(
"Product inconsistency")<<
"One of the sub-events is missing the product with type "
134 <<tags_[itag].instance()
135 <<
" whereas the other one is fine.";
140 crFrame->addSignals(handles[0].product(),e.
id());
141 for(
size_t itag = 1; itag < tags_.size(); ++itag){
142 crFrame->addPileups(0, const_cast<HepMCProduct *>(handles[itag].product()),itag);
144 e.
put(crFrame,label_);
156 virtual void endJob() ;
181 std::vector<std::string> simtags = pset.
getParameter<std::vector<std::string> >(
"srcSIM");
182 std::vector<std::string> gentags = pset.
getParameter<std::vector<std::string> >(
"srcGEN");
184 if(simtags.size() != gentags.size())
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){
189 if (!pstag.
exists(
"type"))
continue;
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") signal = gentags[
input];
200 else signal = simtags[
input];
206 if (
object==
"HepMCProduct"){
208 produces<CrossingFrame<HepMCProduct> >(
label);
209 }
else if (
object==
"SimTrack"){
211 produces<CrossingFrame<SimTrack> >(
label);
212 }
else if (
object==
"SimVertex"){
214 produces<CrossingFrame<SimVertex> >(
label);
215 }
else if (
object==
"PSimHit"){
217 produces<CrossingFrame<PSimHit> >(
label);
218 }
else if (
object==
"PCaloHit"){
220 produces<CrossingFrame<PCaloHit> >(
label);
221 }
else LogInfo(
"Error")<<
"What the hell is this object?!";
223 LogInfo(
"HiMixingModule") <<
"Will mix "<<
object<<
"s with InputTag= "<<tag.
encode()<<
", label will be "<<
label;
227 produces<PileupMixingContent>();
231 HiMixingModule::~HiMixingModule()
250 for(
size_t i = 0;
i < workers_.size(); ++
i){
251 (workers_[
i])->addSignals(iEvent);
254 std::auto_ptr< PileupMixingContent > PileupMixing_ = std::auto_ptr< PileupMixingContent >(
new PileupMixingContent());
255 iEvent.
put(PileupMixing_);
267 HiMixingModule::endJob() {
277 if (
object==
"HepMCProduct") lookfor=
"edm::"+
object;
278 else if (
object==
"edm::HepMCProduct") lookfor=
object;
279 else lookfor=
"std::vector<"+
object+
">";
281 for (edm::ProductRegistry::ProductList::const_iterator it = reg->
productList().begin();
298 LogWarning(
"MixingModule")<<
"!!!!!!!!!Could not find in registry requested object: "<<
object<<
" with "<<tag<<
".\nWill NOT be considered for mixing!!!!!!!!!";
T getParameter(std::string const &) const
static const HistoName names[]
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_
ProductList const & productList() const
void addSignals(edm::Event &e)