39 : flagSimTrack_(
false),
40 flagSimVertex_(
false),
41 flagHepMCProduct_(
false),
49 for (std::vector<std::string>::iterator it=names.begin();it!= names.end();++it)
52 if (!pset.
exists(
"type"))
continue;
55 std::vector<InputTag>
tags=pset.
getParameter<std::vector<InputTag> >(
"input");
58 if (
object==
"SimTrack") {
62 if (tags.size()>0) tag=tags[0];
65 produces<PCrossingFrame<SimTrack> >(
label);
66 consumes<std::vector<SimTrack>>(
tag);
67 LogInfo(
"MixingModule") <<
"Add PCrossingFrame<SimTrack> "<<
object<<
"s with InputTag= "<<tag.
encode()<<
", label will be "<<
label;
71 else if (
object==
"SimVertex") {
75 if (tags.size()>0) tag=tags[0];
78 produces<PCrossingFrame<SimVertex> >(
label);
79 consumes<std::vector<SimVertex>>(
tag);
80 LogInfo(
"MixingModule") <<
"Add SimVertexContainer "<<
object<<
"s with InputTag= "<<tag.
encode()<<
", label will be "<<
label;
84 else if (
object==
"PCaloHit"){
88 for (
unsigned int ii=0;
ii<subdets.size();
ii++) {
90 if (tags.size()==1) tag=tags[0];
91 else if(tags.size()>1) tag=tags[
ii];
95 produces<PCrossingFrame<PCaloHit> >(
label);
96 consumes<std::vector<PCaloHit>>(
tag);
97 LogInfo(
"MixingModule") <<
"Add PCrossingFrame<PCaloHit> "<<
object<<
"s with InputTag= "<<tag.
encode()<<
", label will be "<<
label;
105 else if (
object==
"PSimHit"){
109 for (
unsigned int ii=0;
ii<subdets.size();
ii++) {
111 if (tags.size()==1) tag=tags[0];
113 else if(tags.size()>1) tag=tags[
ii];
117 produces<PCrossingFrame<PSimHit> >(
label);
118 consumes<std::vector<PSimHit>>(
tag);
119 LogInfo(
"MixingModule") <<
"Add PSimHitContainer "<<
object<<
"s with InputTag= "<<tag.
encode()<<
", label will be "<<
label;
127 else if (
object==
"HepMCProduct"){
131 if (tags.size()>0) tag=tags[0];
135 produces<PCrossingFrame<edm::HepMCProduct> >(
label);
136 consumes<HepMCProduct>(
tag);
137 LogInfo(
"MixingModule") <<
"Add HepMCProduct "<<
object<<
"s with InputTag= "<<tag.
encode()<<
", label will be "<<
label;
139 else LogWarning(
"MixingModule") <<
"You did not mix a type of object("<<
object<<
").";
159 gotTracks = iEvent.
getByLabel(
"mix",
"g4SimHits",cf_simtrack);
163 std::auto_ptr<PCrossingFrame<SimTrack> > pOutTrack(PCFbis);
164 iEvent.
put(pOutTrack,
"g4SimHits");
167 LogInfo(
"MixingModule") <<
" Please, check if the object <SimTrack> has been mixed by the MixingModule!";
175 gotSimVertex=iEvent.
getByLabel(
"mix",
"g4SimHits",cf_simvtx);
179 std::auto_ptr<PCrossingFrame<SimVertex> > pOutVertex(PCFvtx);
180 iEvent.
put(pOutVertex,
"g4SimHits");
183 LogInfo(
"MixingModule") <<
" Please, check if the object <SimVertex> has been mixed by the MixingModule!";
197 std::auto_ptr<PCrossingFrame<PCaloHit> > pOutHCalo(PCFPhCaloHit);
201 LogInfo(
"MixingModule") <<
" Please, check if the object <PCaloHit> " <<
labCaloHit[
ii] <<
" has been mixed by the MixingModule!";
216 std::auto_ptr<PCrossingFrame<PSimHit> > pOutSimHit(PCFSimHit);
220 LogInfo(
"MixingModule") <<
" Please, check if the object <PSimHit> " <<
labSimHit[
ii] <<
" has been mixed by the MixingModule!";
229 bool gotHepMCProduct;
231 gotHepMCProduct=iEvent.
getByLabel(
"mix",
"generator",cf_hepmc);
232 if (gotHepMCProduct){
234 std::auto_ptr<PCrossingFrame<edm::HepMCProduct> > pOuthepmcpr(PCFHepMC);
235 iEvent.
put(pOuthepmcpr,
"generator");
238 LogInfo(
"MixingModule") <<
" Please, check if the object <HepMCProduct> has been mixed by the MixingModule!";
T getParameter(std::string const &) const
bool useCurrentProcessOnly_
static const HistoName names[]
std::vector< std::string > labCaloHit
bool exists(std::string const ¶meterName) const
checks if a parameter exists
virtual void produce(edm::Event &e, const edm::EventSetup &c) override
std::vector< std::string > labSimHit
std::string friendlyName(std::string const &iFullName)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
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
T const * product() const
volatile std::atomic< bool > shutdown_flag false
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
CFWriter(const edm::ParameterSet &conf)