20 useUserData_(iConfig.exists(
"userData"))
54 "PATPhotonProducer: you can't specify both 'photonIDSource' and 'photonIDSources'\n";
58 for (std::vector<std::string>::const_iterator it = names.begin(), ed = names.end(); it != ed; ++it) {
64 "PATPhotonProducer: id addPhotonID is true, you must specify either:\n" <<
65 "\tInputTag photonIDSource = <someTag>\n" <<
"or\n" <<
66 "\tPSet photonIDSources = { \n" <<
67 "\t\tInputTag <someName> = <someTag> // as many as you want \n " <<
86 produces<std::vector<Photon> >();
88 if (iConfig.
exists(
"isoDeposits")) {
93 if (depconf.
exists(
"user")) {
94 std::vector<edm::InputTag> userdeps = depconf.
getParameter<std::vector<edm::InputTag> >(
"user");
95 std::vector<edm::InputTag>::const_iterator it = userdeps.begin(), ed = userdeps.end();
97 for ( ; it != ed; ++it, ++
key) {
119 std::vector<edm::Handle<edm::Association<reco::GenParticleCollection> > > genMatches(
genMatchSrc_.size());
132 for (
size_t j = 0, nd =
deposits.size();
j < nd; ++
j) {
137 std::vector<edm::Handle<edm::ValueMap<Bool_t> > > idhandles;
138 std::vector<pat::Photon::IdPair> ids;
149 std::vector<Photon> * PATPhotons =
new std::vector<Photon>();
152 unsigned int idx = itPhoton - photons->begin();
155 Photon aPhoton(photonRef);
160 for(
size_t i = 0,
n = genMatches.size();
i <
n; ++
i) {
185 for (
size_t j = 0, nd =
deposits.size();
j < nd; ++
j) {
193 ids[
i].second = (*idhandles[
i])[photonRef];
204 PATPhotons->push_back(aPhoton);
211 std::auto_ptr<std::vector<Photon> > myPhotons(PATPhotons);
212 iEvent.
put(myPhotons);
221 iDesc.
setComment(
"PAT photon producer module");
226 iDesc.
add<
bool>(
"embedSuperCluster",
true)->setComment(
"embed external super cluster");
229 iDesc.
add<
bool>(
"addGenMatch",
true)->setComment(
"add MC matching");
230 iDesc.
add<
bool>(
"embedGenMatch",
false)->setComment(
"embed MC matched MC information");
231 std::vector<edm::InputTag> emptySourceVector;
234 )->
setComment(
"input with MC match information");
239 iDesc.
add<
bool>(
"addPhotonID",
true)->setComment(
"add photon ID variables");
244 )->
setComment(
"input with photon ID variables");
251 isoDepositsPSet.
addOptional<std::vector<edm::InputTag> >(
"user");
257 iDesc.
add(
"efficiencies", efficienciesPSet);
258 iDesc.
add<
bool>(
"addEfficiencies",
false);
267 iDesc.
add(
"userIsolation", isolationPSet);
269 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.