CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Attributes
pat::PATPhotonProducer Class Reference

Produces the pat::Photon. More...

#include "PhysicsTools/PatAlgos/interface/PATPhotonProducer.h"

Inheritance diagram for pat::PATPhotonProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 PATPhotonProducer (const edm::ParameterSet &iConfig)
 
virtual void produce (edm::Event &iEvent, const edm::EventSetup &iSetup)
 
 ~PATPhotonProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 

Private Types

typedef std::pair< std::string,
edm::InputTag
NameTag
 

Private Attributes

bool addEfficiencies_
 
bool addGenMatch_
 
bool addPhotonID_
 
bool addResolutions_
 
pat::helper::EfficiencyLoader efficiencyLoader_
 
bool embedGenMatch_
 
bool embedSuperCluster_
 
GreaterByEt< PhotoneTComparator_
 
std::vector< edm::InputTaggenMatchSrc_
 
std::vector< std::pair
< pat::IsolationKeys,
edm::InputTag > > 
isoDepositLabels_
 
pat::helper::MultiIsolator isolator_
 
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
 
std::vector< NameTagphotIDSrcs_
 
edm::InputTag photonSrc_
 
pat::helper::KinResolutionsLoader resolutionLoader_
 
pat::PATUserDataHelper
< pat::Photon
userDataHelper_
 
bool useUserData_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Produces the pat::Photon.

The PATPhotonProducer produces the analysis-level pat::Photon starting from a collection of objects of PhotonType.

Author
Steven Lowette
Version
Id:
PATPhotonProducer.h,v 1.18 2009/06/08 13:51:35 hegner Exp

Definition at line 38 of file PATPhotonProducer.h.

Member Typedef Documentation

typedef std::pair<std::string, edm::InputTag> pat::PATPhotonProducer::NameTag
private

Definition at line 73 of file PATPhotonProducer.h.

Constructor & Destructor Documentation

PATPhotonProducer::PATPhotonProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 18 of file PATPhotonProducer.cc.

References addEfficiencies_, addGenMatch_, addPhotonID_, addResolutions_, pat::EcalIso, efficiencyLoader_, embedGenMatch_, embedSuperCluster_, edm::ParameterSet::exists(), edm::ParameterSet::existsAs(), genMatchSrc_, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNamesForType(), pat::HcalIso, isoDepositLabels_, combine::key, h::names, photIDSrcs_, photonSrc_, resolutionLoader_, pat::TrackIso, pat::UserBaseIso, userDataHelper_, and useUserData_.

18  :
19  isolator_(iConfig.exists("userIsolation") ? iConfig.getParameter<edm::ParameterSet>("userIsolation") : edm::ParameterSet(), false) ,
20  useUserData_(iConfig.exists("userData"))
21 {
22  // initialize the configurables
23  photonSrc_ = iConfig.getParameter<edm::InputTag>("photonSource");
24  embedSuperCluster_ = iConfig.getParameter<bool> ("embedSuperCluster");
25 
26  // MC matching configurables
27  addGenMatch_ = iConfig.getParameter<bool> ( "addGenMatch" );
28  if (addGenMatch_) {
29  embedGenMatch_ = iConfig.getParameter<bool> ( "embedGenMatch" );
30  if (iConfig.existsAs<edm::InputTag>("genParticleMatch")) {
31  genMatchSrc_.push_back(iConfig.getParameter<edm::InputTag>( "genParticleMatch" ));
32  } else {
33  genMatchSrc_ = iConfig.getParameter<std::vector<edm::InputTag> >( "genParticleMatch" );
34  }
35  }
36 
37  // Efficiency configurables
38  addEfficiencies_ = iConfig.getParameter<bool>("addEfficiencies");
39  if (addEfficiencies_) {
41  }
42 
43  // photon ID configurables
44  addPhotonID_ = iConfig.getParameter<bool> ( "addPhotonID" );
45  if (addPhotonID_) {
46  // it might be a single photon ID
47  if (iConfig.existsAs<edm::InputTag>("photonIDSource")) {
48  photIDSrcs_.push_back(NameTag("", iConfig.getParameter<edm::InputTag>("photonIDSource")));
49  }
50  // or there might be many of them
51  if (iConfig.existsAs<edm::ParameterSet>("photonIDSources")) {
52  // please don't configure me twice
53  if (!photIDSrcs_.empty()) throw cms::Exception("Configuration") <<
54  "PATPhotonProducer: you can't specify both 'photonIDSource' and 'photonIDSources'\n";
55  // read the different photon ID names
56  edm::ParameterSet idps = iConfig.getParameter<edm::ParameterSet>("photonIDSources");
57  std::vector<std::string> names = idps.getParameterNamesForType<edm::InputTag>();
58  for (std::vector<std::string>::const_iterator it = names.begin(), ed = names.end(); it != ed; ++it) {
59  photIDSrcs_.push_back(NameTag(*it, idps.getParameter<edm::InputTag>(*it)));
60  }
61  }
62  // but in any case at least once
63  if (photIDSrcs_.empty()) throw cms::Exception("Configuration") <<
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 " <<
68  "\t}\n";
69  }
70 
71 
72 
73  // Resolution configurables
74  addResolutions_ = iConfig.getParameter<bool>("addResolutions");
75  if (addResolutions_) {
77  }
78 
79  // Check to see if the user wants to add user data
80  if ( useUserData_ ) {
82  }
83 
84 
85  // produces vector of photons
86  produces<std::vector<Photon> >();
87 
88  if (iConfig.exists("isoDeposits")) {
89  edm::ParameterSet depconf = iConfig.getParameter<edm::ParameterSet>("isoDeposits");
90  if (depconf.exists("tracker")) isoDepositLabels_.push_back(std::make_pair(pat::TrackIso, depconf.getParameter<edm::InputTag>("tracker")));
91  if (depconf.exists("ecal")) isoDepositLabels_.push_back(std::make_pair(pat::EcalIso, depconf.getParameter<edm::InputTag>("ecal")));
92  if (depconf.exists("hcal")) isoDepositLabels_.push_back(std::make_pair(pat::HcalIso, depconf.getParameter<edm::InputTag>("hcal")));
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();
96  int key = UserBaseIso;
97  for ( ; it != ed; ++it, ++key) {
98  isoDepositLabels_.push_back(std::make_pair(IsolationKeys(key), *it));
99  }
100  }
101  }
102 }
T getParameter(std::string const &) const
Assists in assimilating all pat::UserData into pat objects.
pat::PATUserDataHelper< pat::Photon > userDataHelper_
std::vector< edm::InputTag > genMatchSrc_
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:181
std::pair< std::string, edm::InputTag > NameTag
bool exists(std::string const &parameterName) const
checks if a parameter exists
pat::helper::KinResolutionsLoader resolutionLoader_
IsolationKeys
Enum defining isolation keys.
Definition: Isolation.h:9
std::vector< std::pair< pat::IsolationKeys, edm::InputTag > > isoDepositLabels_
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:189
pat::helper::EfficiencyLoader efficiencyLoader_
std::vector< NameTag > photIDSrcs_
pat::helper::MultiIsolator isolator_
list key
Definition: combine.py:13
static const HistoName names[]
PATPhotonProducer::~PATPhotonProducer ( )

Definition at line 104 of file PATPhotonProducer.cc.

104  {
105 }

Member Function Documentation

void PATPhotonProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 218 of file PATPhotonProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addNode(), edm::ParameterSetDescription::addOptional(), pat::helper::KinResolutionsLoader::fillDescription(), pat::PATUserDataHelper< ObjectType >::fillDescription(), edm::ParameterSetDescription::setAllowAnything(), edm::ParameterSetDescription::setComment(), and edm::ParameterDescriptionNode::setComment().

219 {
221  iDesc.setComment("PAT photon producer module");
222 
223  // input source
224  iDesc.add<edm::InputTag>("photonSource", edm::InputTag("no default"))->setComment("input collection");
225 
226  iDesc.add<bool>("embedSuperCluster", true)->setComment("embed external super cluster");
227 
228  // MC matching configurables
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;
232  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("genParticleMatch", edm::InputTag(), true) xor
233  edm::ParameterDescription<std::vector<edm::InputTag> >("genParticleMatch", emptySourceVector, true)
234  )->setComment("input with MC match information");
235 
237 
238  // photon ID configurables
239  iDesc.add<bool>("addPhotonID",true)->setComment("add photon ID variables");
240  edm::ParameterSetDescription photonIDSourcesPSet;
241  photonIDSourcesPSet.setAllowAnything();
242  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("photonIDSource", edm::InputTag(), true) xor
243  edm::ParameterDescription<edm::ParameterSetDescription>("photonIDSources", photonIDSourcesPSet, true)
244  )->setComment("input with photon ID variables");
245 
246  // IsoDeposit configurables
247  edm::ParameterSetDescription isoDepositsPSet;
248  isoDepositsPSet.addOptional<edm::InputTag>("tracker");
249  isoDepositsPSet.addOptional<edm::InputTag>("ecal");
250  isoDepositsPSet.addOptional<edm::InputTag>("hcal");
251  isoDepositsPSet.addOptional<std::vector<edm::InputTag> >("user");
252  iDesc.addOptional("isoDeposits", isoDepositsPSet);
253 
254  // Efficiency configurables
255  edm::ParameterSetDescription efficienciesPSet;
256  efficienciesPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
257  iDesc.add("efficiencies", efficienciesPSet);
258  iDesc.add<bool>("addEfficiencies", false);
259 
260  // Check to see if the user wants to add user data
261  edm::ParameterSetDescription userDataPSet;
263  iDesc.addOptional("userData", userDataPSet);
264 
265  edm::ParameterSetDescription isolationPSet;
266  isolationPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
267  iDesc.add("userIsolation", isolationPSet);
268 
269  descriptions.add("PATPhotonProducer", iDesc);
270 
271 }
void setComment(std::string const &value)
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
void setAllowAnything()
allow any parameter label/value pairs
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
static void fillDescription(edm::ParameterSetDescription &iDesc)
void setComment(std::string const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescription(edm::ParameterSetDescription &iDesc)
Method for documentation and validation of PSet.
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void PATPhotonProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 107 of file PATPhotonProducer.cc.

References addGenMatch_, pat::PATObject< ObjectType >::addGenParticleRef(), addPhotonID_, pat::helper::MultiIsolator::beginEvent(), efficiencyLoader_, embedGenMatch_, pat::PATObject< ObjectType >::embedGenParticle(), pat::Photon::embedSuperCluster(), embedSuperCluster_, pat::helper::EfficiencyLoader::enabled(), pat::helper::KinResolutionsLoader::enabled(), pat::helper::MultiIsolator::enabled(), pat::helper::MultiIsolator::endEvent(), eTComparator_, pat::helper::MultiIsolator::fill(), first, genMatchSrc_, edm::Event::getByLabel(), i, isoDepositLabels_, isolator_, isolatorTmpStorage_, edm::EventBase::isRealData(), j, n, pat::helper::EfficiencyLoader::newEvent(), pat::helper::KinResolutionsLoader::newEvent(), photIDSrcs_, interactiveExample::photons, photonSrc_, edm::Event::put(), resolutionLoader_, edm::second(), pat::helper::EfficiencyLoader::setEfficiencies(), pat::Photon::setIsoDeposit(), pat::Photon::setIsolation(), pat::Photon::setPhotonIDs(), pat::helper::KinResolutionsLoader::setResolutions(), python.multivaluedict::sort(), userDataHelper_, and useUserData_.

107  {
108 
109  // Get the vector of Photon's from the event
111  iEvent.getByLabel(photonSrc_, photons);
112 
113  if (iEvent.isRealData()){
114  addGenMatch_ = false;
115  embedGenMatch_ = false;
116  }
117 
118  // prepare the MC matching
119  std::vector<edm::Handle<edm::Association<reco::GenParticleCollection> > > genMatches(genMatchSrc_.size());
120  if (addGenMatch_) {
121  for (size_t j = 0, nd = genMatchSrc_.size(); j < nd; ++j) {
122  iEvent.getByLabel(genMatchSrc_[j], genMatches[j]);
123  }
124  }
125 
126  if (isolator_.enabled()) isolator_.beginEvent(iEvent,iSetup);
127 
129  if (resolutionLoader_.enabled()) resolutionLoader_.newEvent(iEvent, iSetup);
130 
131  std::vector<edm::Handle<edm::ValueMap<IsoDeposit> > > deposits(isoDepositLabels_.size());
132  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
133  iEvent.getByLabel(isoDepositLabels_[j].second, deposits[j]);
134  }
135 
136  // prepare ID extraction
137  std::vector<edm::Handle<edm::ValueMap<Bool_t> > > idhandles;
138  std::vector<pat::Photon::IdPair> ids;
139  if (addPhotonID_) {
140  idhandles.resize(photIDSrcs_.size());
141  ids.resize(photIDSrcs_.size());
142  for (size_t i = 0; i < photIDSrcs_.size(); ++i) {
143  iEvent.getByLabel(photIDSrcs_[i].second, idhandles[i]);
144  ids[i].first = photIDSrcs_[i].first;
145  }
146  }
147 
148  // loop over photons
149  std::vector<Photon> * PATPhotons = new std::vector<Photon>();
150  for (edm::View<reco::Photon>::const_iterator itPhoton = photons->begin(); itPhoton != photons->end(); itPhoton++) {
151  // construct the Photon from the ref -> save ref to original object
152  unsigned int idx = itPhoton - photons->begin();
153  edm::RefToBase<reco::Photon> photonRef = photons->refAt(idx);
154  edm::Ptr<reco::Photon> photonPtr = photons->ptrAt(idx);
155  Photon aPhoton(photonRef);
156  if (embedSuperCluster_) aPhoton.embedSuperCluster();
157 
158  // store the match to the generated final state muons
159  if (addGenMatch_) {
160  for(size_t i = 0, n = genMatches.size(); i < n; ++i) {
161  reco::GenParticleRef genPhoton = (*genMatches[i])[photonRef];
162  aPhoton.addGenParticleRef(genPhoton);
163  }
164  if (embedGenMatch_) aPhoton.embedGenParticle();
165  }
166 
167  if (efficiencyLoader_.enabled()) {
168  efficiencyLoader_.setEfficiencies( aPhoton, photonRef );
169  }
170 
171  if (resolutionLoader_.enabled()) {
173  }
174 
175  // here comes the extra functionality
176  if (isolator_.enabled()) {
177  isolator_.fill(*photons, idx, isolatorTmpStorage_);
178  typedef pat::helper::MultiIsolator::IsolationValuePairs IsolationValuePairs;
179  // better to loop backwards, so the vector is resized less times
180  for (IsolationValuePairs::const_reverse_iterator it = isolatorTmpStorage_.rbegin(), ed = isolatorTmpStorage_.rend(); it != ed; ++it) {
181  aPhoton.setIsolation(it->first, it->second);
182  }
183  }
184 
185  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
186  aPhoton.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[photonRef]);
187  }
188 
189 
190  // add photon ID info
191  if (addPhotonID_) {
192  for (size_t i = 0; i < photIDSrcs_.size(); ++i) {
193  ids[i].second = (*idhandles[i])[photonRef];
194  }
195  aPhoton.setPhotonIDs(ids);
196  }
197 
198  if ( useUserData_ ) {
199  userDataHelper_.add( aPhoton, iEvent, iSetup );
200  }
201 
202 
203  // add the Photon to the vector of Photons
204  PATPhotons->push_back(aPhoton);
205  }
206 
207  // sort Photons in ET
208  std::sort(PATPhotons->begin(), PATPhotons->end(), eTComparator_);
209 
210  // put genEvt object in Event
211  std::auto_ptr<std::vector<Photon> > myPhotons(PATPhotons);
212  iEvent.put(myPhotons);
214 
215 }
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
int i
Definition: DBlmapReader.cc:9
Analysis-level Photon class.
Definition: Photon.h:46
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
pat::PATUserDataHelper< pat::Photon > userDataHelper_
std::vector< edm::InputTag > genMatchSrc_
pat::helper::KinResolutionsLoader resolutionLoader_
GreaterByEt< Photon > eTComparator_
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
bool isRealData() const
Definition: EventBase.h:60
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
std::vector< std::pair< pat::IsolationKeys, edm::InputTag > > isoDepositLabels_
U second(std::pair< T, U > const &p)
bool enabled() const
True if it has a non null configuration.
Definition: MultiIsolator.h:50
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
void beginEvent(const edm::Event &event, const edm::EventSetup &eventSetup)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
pat::helper::EfficiencyLoader efficiencyLoader_
int j
Definition: DBlmapReader.cc:9
std::vector< NameTag > photIDSrcs_
bool first
Definition: L1TdeRCT.cc:79
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
pat::helper::MultiIsolator isolator_
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
std::vector< std::pair< pat::IsolationKeys, float > > IsolationValuePairs
Definition: MultiIsolator.h:16
void newEvent(const edm::Event &event, const edm::EventSetup &setup) const
To be called for each new event, reads in the EventSetup object.
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
Definition: MultiIsolator.h:82

Member Data Documentation

bool pat::PATPhotonProducer::addEfficiencies_
private

Definition at line 66 of file PATPhotonProducer.h.

Referenced by PATPhotonProducer().

bool pat::PATPhotonProducer::addGenMatch_
private

Definition at line 55 of file PATPhotonProducer.h.

Referenced by PATPhotonProducer(), and produce().

bool pat::PATPhotonProducer::addPhotonID_
private

Definition at line 72 of file PATPhotonProducer.h.

Referenced by PATPhotonProducer(), and produce().

bool pat::PATPhotonProducer::addResolutions_
private

Definition at line 69 of file PATPhotonProducer.h.

Referenced by PATPhotonProducer().

pat::helper::EfficiencyLoader pat::PATPhotonProducer::efficiencyLoader_
private

Definition at line 67 of file PATPhotonProducer.h.

Referenced by PATPhotonProducer(), and produce().

bool pat::PATPhotonProducer::embedGenMatch_
private

Definition at line 56 of file PATPhotonProducer.h.

Referenced by PATPhotonProducer(), and produce().

bool pat::PATPhotonProducer::embedSuperCluster_
private

Definition at line 53 of file PATPhotonProducer.h.

Referenced by PATPhotonProducer(), and produce().

GreaterByEt<Photon> pat::PATPhotonProducer::eTComparator_
private

Definition at line 60 of file PATPhotonProducer.h.

Referenced by produce().

std::vector<edm::InputTag> pat::PATPhotonProducer::genMatchSrc_
private

Definition at line 57 of file PATPhotonProducer.h.

Referenced by PATPhotonProducer(), and produce().

std::vector<std::pair<pat::IsolationKeys,edm::InputTag> > pat::PATPhotonProducer::isoDepositLabels_
private

Definition at line 64 of file PATPhotonProducer.h.

Referenced by PATPhotonProducer(), and produce().

pat::helper::MultiIsolator pat::PATPhotonProducer::isolator_
private

Definition at line 62 of file PATPhotonProducer.h.

Referenced by produce().

pat::helper::MultiIsolator::IsolationValuePairs pat::PATPhotonProducer::isolatorTmpStorage_
private

Definition at line 63 of file PATPhotonProducer.h.

Referenced by produce().

std::vector<NameTag> pat::PATPhotonProducer::photIDSrcs_
private

Definition at line 74 of file PATPhotonProducer.h.

Referenced by PATPhotonProducer(), and produce().

edm::InputTag pat::PATPhotonProducer::photonSrc_
private

Definition at line 52 of file PATPhotonProducer.h.

Referenced by PATPhotonProducer(), and produce().

pat::helper::KinResolutionsLoader pat::PATPhotonProducer::resolutionLoader_
private

Definition at line 70 of file PATPhotonProducer.h.

Referenced by PATPhotonProducer(), and produce().

pat::PATUserDataHelper<pat::Photon> pat::PATPhotonProducer::userDataHelper_
private

Definition at line 77 of file PATPhotonProducer.h.

Referenced by PATPhotonProducer(), and produce().

bool pat::PATPhotonProducer::useUserData_
private

Definition at line 76 of file PATPhotonProducer.h.

Referenced by PATPhotonProducer(), and produce().