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;
54 std::string
object = pset.
getParameter<std::string>(
"type");
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 LogInfo(
"MixingModule") <<
"Add PCrossingFrame<SimTrack> "<<
object<<
"s with InputTag= "<<tag.
encode()<<
", label will be "<<
label;
70 else if (
object==
"SimVertex") {
74 if (tags.size()>0) tag=tags[0];
77 produces<PCrossingFrame<SimVertex> >(
label);
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 LogInfo(
"MixingModule") <<
"Add PCrossingFrame<PCaloHit> "<<
object<<
"s with InputTag= "<<tag.
encode()<<
", label will be "<<
label;
102 else if (
object==
"PSimHit"){
106 for (
unsigned int ii=0;ii<subdets.size();ii++) {
108 if (tags.size()==1) tag=tags[0];
110 else if(tags.size()>1) tag=tags[ii];
114 produces<PCrossingFrame<PSimHit> >(
label);
115 LogInfo(
"MixingModule") <<
"Add PSimHitContainer "<<
object<<
"s with InputTag= "<<tag.
encode()<<
", label will be "<<
label;
123 else if (
object==
"HepMCProduct"){
127 if (tags.size()>0) tag=tags[0];
131 produces<PCrossingFrame<edm::HepMCProduct> >(
label);
132 LogInfo(
"MixingModule") <<
"Add HepMCProduct "<<
object<<
"s with InputTag= "<<tag.
encode()<<
", label will be "<<
label;
134 else LogWarning(
"MixingModule") <<
"You did not mix a type of object("<<
object<<
").";
154 gotTracks = iEvent.
getByLabel(
"mix",
"g4SimHits",cf_simtrack);
158 std::auto_ptr<PCrossingFrame<SimTrack> > pOutTrack(PCFbis);
159 iEvent.
put(pOutTrack,
"g4SimHits");
162 LogInfo(
"MixingModule") <<
" Please, check if the object <SimTrack> has been mixed by the MixingModule!";
170 gotSimVertex=iEvent.
getByLabel(
"mix",
"g4SimHits",cf_simvtx);
174 std::auto_ptr<PCrossingFrame<SimVertex> > pOutVertex(PCFvtx);
175 iEvent.
put(pOutVertex,
"g4SimHits");
178 LogInfo(
"MixingModule") <<
" Please, check if the object <SimVertex> has been mixed by the MixingModule!";
185 for (
unsigned int ii=0;ii<
labCaloHit.size();ii++){
192 std::auto_ptr<PCrossingFrame<PCaloHit> > pOutHCalo(PCFPhCaloHit);
196 LogInfo(
"MixingModule") <<
" Please, check if the object <PCaloHit> " <<
labCaloHit[ii] <<
" has been mixed by the MixingModule!";
204 for (
unsigned int ii=0;ii<
labSimHit.size();ii++) {
211 std::auto_ptr<PCrossingFrame<PSimHit> > pOutSimHit(PCFSimHit);
215 LogInfo(
"MixingModule") <<
" Please, check if the object <PSimHit> " <<
labSimHit[ii] <<
" has been mixed by the MixingModule!";
224 bool gotHepMCProduct;
226 gotHepMCProduct=iEvent.
getByLabel(
"mix",
"generator",cf_hepmc);
227 if (gotHepMCProduct){
229 std::auto_ptr<PCrossingFrame<edm::HepMCProduct> > pOuthepmcpr(PCFHepMC);
230 iEvent.
put(pOuthepmcpr,
"generator");
233 LogInfo(
"MixingModule") <<
" Please, check if the object <HepMCProduct> has been mixed by the MixingModule!";
T getParameter(std::string const &) const
bool useCurrentProcessOnly_
std::vector< std::string > labCaloHit
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::vector< std::string > labSimHit
std::string friendlyName(std::string const &iFullName)
static std::string subdets[11]
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::vector< std::string > wantedBranches_
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
virtual void produce(edm::Event &e, const edm::EventSetup &c)
void beginRun(const edm::Run &run, const edm::EventSetup &es)
static const HistoName names[]
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
CFWriter(const edm::ParameterSet &conf)