35 : flagSimTrack_(
false),
36 flagSimVertex_(
false),
37 flagHepMCProduct_(
false),
43 for (std::vector<std::string>::iterator it = names.begin(); it != names.end(); ++it) {
49 std::vector<InputTag>
tags = pset.
getParameter<std::vector<InputTag>>(
"input");
52 if (
object ==
"SimTrack") {
60 produces<PCrossingFrame<SimTrack>>(
label);
61 consumes<std::vector<SimTrack>>(
tag);
62 LogInfo(
"MixingModule") <<
"Add PCrossingFrame<SimTrack> " <<
object <<
"s with InputTag= " << tag.
encode()
63 <<
", label will be " <<
label;
67 else if (
object ==
"SimVertex") {
75 produces<PCrossingFrame<SimVertex>>(
label);
76 consumes<std::vector<SimVertex>>(
tag);
77 LogInfo(
"MixingModule") <<
"Add SimVertexContainer " <<
object <<
"s with InputTag= " << tag.
encode()
78 <<
", label will be " <<
label;
82 else if (
object ==
"PCaloHit") {
86 for (
unsigned int ii = 0;
ii < subdets.size();
ii++) {
90 else if (tags.size() > 1)
95 produces<PCrossingFrame<PCaloHit>>(
label);
96 consumes<std::vector<PCaloHit>>(
tag);
97 LogInfo(
"MixingModule") <<
"Add PCrossingFrame<PCaloHit> " <<
object <<
"s with InputTag= " << tag.
encode()
98 <<
", label will be " <<
label;
106 else if (
object ==
"PSimHit") {
110 for (
unsigned int ii = 0;
ii < subdets.size();
ii++) {
112 if (tags.size() == 1)
115 else if (tags.size() > 1)
120 produces<PCrossingFrame<PSimHit>>(
label);
121 consumes<std::vector<PSimHit>>(
tag);
122 LogInfo(
"MixingModule") <<
"Add PSimHitContainer " <<
object <<
"s with InputTag= " << tag.
encode()
123 <<
", label will be " <<
label;
131 else if (
object ==
"HepMCProduct") {
140 produces<PCrossingFrame<edm::HepMCProduct>>(
label);
141 consumes<HepMCProduct>(
tag);
142 LogInfo(
"MixingModule") <<
"Add HepMCProduct " <<
object <<
"s with InputTag= " << tag.
encode()
143 <<
", label will be " <<
label;
145 LogWarning(
"MixingModule") <<
"You did not mix a type of object(" <<
object <<
").";
158 gotTracks = iEvent.
getByLabel(
"mix",
"g4SimHits", cf_simtrack);
162 std::unique_ptr<PCrossingFrame<SimTrack>> pOutTrack(PCFbis);
165 LogInfo(
"MixingModule") <<
" Please, check if the object <SimTrack> has been mixed by the MixingModule!";
173 gotSimVertex = iEvent.
getByLabel(
"mix",
"g4SimHits", cf_simvtx);
177 std::unique_ptr<PCrossingFrame<SimVertex>> pOutVertex(PCFvtx);
180 LogInfo(
"MixingModule") <<
" Please, check if the object <SimVertex> has been mixed by the MixingModule!";
193 std::unique_ptr<PCrossingFrame<PCaloHit>> pOutHCalo(PCFPhCaloHit);
197 <<
" has been mixed by the MixingModule!";
210 std::unique_ptr<PCrossingFrame<PSimHit>> pOutSimHit(PCFSimHit);
214 <<
" has been mixed by the MixingModule!";
221 bool gotHepMCProduct;
223 gotHepMCProduct = iEvent.
getByLabel(
"mix",
"generatorSmeared", cf_hepmc);
224 if (gotHepMCProduct) {
226 std::unique_ptr<PCrossingFrame<edm::HepMCProduct>> pOuthepmcpr(PCFHepMC);
229 LogInfo(
"MixingModule") <<
" Please, check if the object <HepMCProduct> has been mixed by the MixingModule!";
bool useCurrentProcessOnly_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
std::vector< std::string > labCaloHit
bool exists(std::string const ¶meterName) const
checks if a parameter exists
void produce(edm::Event &e, const edm::EventSetup &c) override
std::vector< std::string > labSimHit
std::string friendlyName(std::string const &iFullName)
std::vector< std::string > wantedBranches_
std::vector< std::string > names
void beginRun(const edm::Run &run, const edm::EventSetup &es) override
std::vector< std::string > getParameterNames() const
virtual void branchesActivate(const std::string &friendlyName, std::string subdet, InputTag &tag, std::string &label)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Log< level::Info, false > LogInfo
T const * product() const
T getParameter(std::string const &) const
Log< level::Warning, false > LogWarning
static const std::string subdets[7]
CFWriter(const edm::ParameterSet &conf)