37 : flagSimTrack_(
false),
38 flagSimVertex_(
false),
39 flagHepMCProduct_(
false),
47 for (std::vector<std::string>::iterator it=names.begin();it!= names.end();++it)
50 if (!pset.
exists(
"type"))
continue;
53 std::vector<InputTag> tags=pset.
getParameter<std::vector<InputTag> >(
"input");
56 if (
object==
"SimTrack") {
60 if (!tags.empty()) tag=tags[0];
63 produces<PCrossingFrame<SimTrack> >(
label);
64 consumes<std::vector<SimTrack>>(
tag);
65 LogInfo(
"MixingModule") <<
"Add PCrossingFrame<SimTrack> "<<
object<<
"s with InputTag= "<<tag.
encode()<<
", label will be "<<
label;
69 else if (
object==
"SimVertex") {
73 if (!tags.empty()) tag=tags[0];
76 produces<PCrossingFrame<SimVertex> >(
label);
77 consumes<std::vector<SimVertex>>(
tag);
78 LogInfo(
"MixingModule") <<
"Add SimVertexContainer "<<
object<<
"s with InputTag= "<<tag.
encode()<<
", label will be "<<
label;
82 else if (
object==
"PCaloHit"){
86 for (
unsigned int ii=0;
ii<subdets.size();
ii++) {
88 if (tags.size()==1) tag=tags[0];
89 else if(tags.size()>1) tag=tags[
ii];
93 produces<PCrossingFrame<PCaloHit> >(
label);
94 consumes<std::vector<PCaloHit>>(
tag);
95 LogInfo(
"MixingModule") <<
"Add PCrossingFrame<PCaloHit> "<<
object<<
"s with InputTag= "<<tag.
encode()<<
", label will be "<<
label;
103 else if (
object==
"PSimHit"){
107 for (
unsigned int ii=0;
ii<subdets.size();
ii++) {
109 if (tags.size()==1) tag=tags[0];
111 else if(tags.size()>1) tag=tags[
ii];
115 produces<PCrossingFrame<PSimHit> >(
label);
116 consumes<std::vector<PSimHit>>(
tag);
117 LogInfo(
"MixingModule") <<
"Add PSimHitContainer "<<
object<<
"s with InputTag= "<<tag.
encode()<<
", label will be "<<
label;
125 else if (
object==
"HepMCProduct"){
129 if (!tags.empty()) tag=tags[0];
133 produces<PCrossingFrame<edm::HepMCProduct> >(
label);
134 consumes<HepMCProduct>(
tag);
135 LogInfo(
"MixingModule") <<
"Add HepMCProduct "<<
object<<
"s with InputTag= "<<tag.
encode()<<
", label will be "<<
label;
137 else LogWarning(
"MixingModule") <<
"You did not mix a type of object("<<
object<<
").";
157 gotTracks = iEvent.
getByLabel(
"mix",
"g4SimHits",cf_simtrack);
161 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);
181 LogInfo(
"MixingModule") <<
" Please, check if the object <SimVertex> has been mixed by the MixingModule!";
195 std::unique_ptr<PCrossingFrame<PCaloHit> > pOutHCalo(PCFPhCaloHit);
199 LogInfo(
"MixingModule") <<
" Please, check if the object <PCaloHit> " <<
labCaloHit[
ii] <<
" has been mixed by the MixingModule!";
214 std::unique_ptr<PCrossingFrame<PSimHit> > pOutSimHit(PCFSimHit);
218 LogInfo(
"MixingModule") <<
" Please, check if the object <PSimHit> " <<
labSimHit[
ii] <<
" has been mixed by the MixingModule!";
227 bool gotHepMCProduct;
229 gotHepMCProduct=iEvent.
getByLabel(
"mix",
"generatorSmeared",cf_hepmc);
230 if (gotHepMCProduct){
232 std::unique_ptr<PCrossingFrame<edm::HepMCProduct> > pOuthepmcpr(PCFHepMC);
236 LogInfo(
"MixingModule") <<
" Please, check if the object <HepMCProduct> has been mixed by the MixingModule!";
T getParameter(std::string const &) const
bool useCurrentProcessOnly_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
static const HistoName names[]
std::vector< std::string > labCaloHit
bool exists(std::string const ¶meterName) const
checks if a parameter exists
def setup(process, global_tag, zero_tesla=False)
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_
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
def getProcessName(pdgGen, requiredNumberOfGeneratedObjects)
T const * product() const
static const std::string subdets[7]
CFWriter(const edm::ParameterSet &conf)