20 useUserData_(iConfig.exists(
"userData"))
52 throw cms::Exception(
"Configuration") <<
"PATPhotonProducer: you can't specify both 'photonIDSource' and 'photonIDSources'\n";
57 for (std::vector<std::string>::const_iterator it = names.begin(), ed = names.end(); it != ed; ++it) {
63 "PATPhotonProducer: id addPhotonID is true, you must specify either:\n" <<
64 "\tInputTag photonIDSource = <someTag>\n" <<
"or\n" <<
65 "\tPSet photonIDSources = { \n" <<
66 "\t\tInputTag <someName> = <someTag> // as many as you want \n " <<
79 produces<std::vector<Photon> >();
81 if (iConfig.
exists(
"isoDeposits")) {
86 if (depconf.
exists(
"user")) {
87 std::vector<edm::InputTag> userdeps = depconf.
getParameter<std::vector<edm::InputTag> >(
"user");
88 std::vector<edm::InputTag>::const_iterator it = userdeps.begin(), ed = userdeps.end();
90 for ( ; it != ed; ++it, ++
key) {
113 std::vector<edm::Handle<edm::Association<reco::GenParticleCollection> > > genMatches(
genMatchSrc_.size());
125 std::vector<edm::Handle<edm::ValueMap<IsoDeposit> > > deposits(
isoDepositLabels_.size());
126 for (
size_t j = 0, nd = deposits.size();
j < nd; ++
j) {
131 std::vector<edm::Handle<edm::ValueMap<Bool_t> > > idhandles;
132 std::vector<pat::Photon::IdPair> ids;
143 std::vector<Photon> * PATPhotons =
new std::vector<Photon>();
146 unsigned int idx = itPhoton - photons->begin();
149 Photon aPhoton(photonRef);
154 for(
size_t i = 0,
n = genMatches.size();
i <
n; ++
i) {
179 for (
size_t j = 0, nd = deposits.size();
j < nd; ++
j) {
187 ids[
i].second = (*idhandles[
i])[photonRef];
198 PATPhotons->push_back(aPhoton);
205 std::auto_ptr<std::vector<Photon> > myPhotons(PATPhotons);
206 iEvent.
put(myPhotons);
215 iDesc.
setComment(
"PAT photon producer module");
220 iDesc.
add<
bool>(
"embedSuperCluster",
true)->setComment(
"embed external super cluster");
223 iDesc.
add<
bool>(
"addGenMatch",
true)->setComment(
"add MC matching");
224 iDesc.
add<
bool>(
"embedGenMatch",
false)->setComment(
"embed MC matched MC information");
225 std::vector<edm::InputTag> emptySourceVector;
228 )->
setComment(
"input with MC match information");
233 iDesc.
add<
bool>(
"addPhotonID",
true)->setComment(
"add photon ID variables");
238 )->
setComment(
"input with photon ID variables");
245 isoDepositsPSet.
addOptional<std::vector<edm::InputTag> >(
"user");
251 iDesc.
add(
"efficiencies", efficienciesPSet);
252 iDesc.
add<
bool>(
"addEfficiencies",
false);
261 iDesc.
add(
"userIsolation", isolationPSet);
263 descriptions.
add(
"PATPhotonProducer", iDesc);
bool enabled() const
'true' if this there is at least one efficiency configured
T getParameter(std::string const &) const
void setComment(std::string const &value)
Assists in assimilating all pat::UserData into pat objects.
Analysis-level Photon class.
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
pat::PATUserDataHelper< pat::Photon > userDataHelper_
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
std::vector< edm::InputTag > genMatchSrc_
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
std::pair< std::string, edm::InputTag > NameTag
void setAllowAnything()
allow any parameter label/value pairs
#define DEFINE_FWK_MODULE(type)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
void embedSuperCluster()
method to store the photon's supercluster internally
pat::helper::KinResolutionsLoader resolutionLoader_
GreaterByEt< Photon > eTComparator_
IsolationKeys
Enum defining isolation keys.
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
bool enabled() const
'true' if this there is at least one efficiency configured
std::vector< std::pair< pat::IsolationKeys, edm::InputTag > > isoDepositLabels_
static void fillDescription(edm::ParameterSetDescription &iDesc)
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
U second(std::pair< T, U > const &p)
bool enabled() const
True if it has a non null configuration.
void setIsolation(IsolationKeys key, float value)
void setComment(std::string const &value)
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
void setIsoDeposit(IsolationKeys key, const IsoDeposit &dep)
Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten.
void beginEvent(const edm::Event &event, const edm::EventSetup &eventSetup)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
pat::helper::EfficiencyLoader efficiencyLoader_
void setPhotonIDs(const std::vector< IdPair > &ids)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::vector< NameTag > photIDSrcs_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
pat::helper::MultiIsolator isolator_
void addGenParticleRef(const reco::GenParticleRef &ref)
static void fillDescription(edm::ParameterSetDescription &iDesc)
Method for documentation and validation of PSet.
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< std::pair< pat::IsolationKeys, float > > IsolationValuePairs
PATPhotonProducer(const edm::ParameterSet &iConfig)
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup)
void newEvent(const edm::Event &event, const edm::EventSetup &setup) const
To be called for each new event, reads in the EventSetup object.
static const HistoName names[]
void newEvent(const edm::Event &event) const
To be called for each new event, reads in the ValueMaps for efficiencies.
void fill(const edm::View< T > &coll, int idx, IsolationValuePairs &isolations) const
Produces the pat::Photon.