CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PATPhotonProducer.cc
Go to the documentation of this file.
1 //
2 //
3 
9 
15 
18 
22 
23 #include "TVector2.h"
25 
26 
27 #include <memory>
28 
29 using namespace pat;
30 
32  isolator_(iConfig.exists("userIsolation") ? iConfig.getParameter<edm::ParameterSet>("userIsolation") : edm::ParameterSet(), consumesCollector(), false) ,
33  useUserData_(iConfig.exists("userData"))
34 {
35  // initialize the configurables
36  photonToken_ = consumes<edm::View<reco::Photon> >(iConfig.getParameter<edm::InputTag>("photonSource"));
37  electronToken_ = consumes<reco::GsfElectronCollection>(edm::InputTag("gedGsfElectrons"));
38  hConversionsToken_ = consumes<reco::ConversionCollection>(edm::InputTag("allConversions"));
39  beamLineToken_ = consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("beamLineSrc"));
40  embedSuperCluster_ = iConfig.getParameter<bool>("embedSuperCluster");
41  embedSeedCluster_ = iConfig.getParameter<bool>( "embedSeedCluster" );
42  embedBasicClusters_ = iConfig.getParameter<bool>( "embedBasicClusters" );
43  embedPreshowerClusters_ = iConfig.getParameter<bool>( "embedPreshowerClusters" );
44  embedRecHits_ = iConfig.getParameter<bool>( "embedRecHits" );
45  reducedBarrelRecHitCollection_ = iConfig.getParameter<edm::InputTag>("reducedBarrelRecHitCollection");
46  reducedBarrelRecHitCollectionToken_ = mayConsume<EcalRecHitCollection>(reducedBarrelRecHitCollection_);
47  reducedEndcapRecHitCollection_ = iConfig.getParameter<edm::InputTag>("reducedEndcapRecHitCollection");
48  reducedEndcapRecHitCollectionToken_ = mayConsume<EcalRecHitCollection>(reducedEndcapRecHitCollection_);
49  // MC matching configurables
50  addGenMatch_ = iConfig.getParameter<bool>( "addGenMatch" );
51  if (addGenMatch_) {
52  embedGenMatch_ = iConfig.getParameter<bool>( "embedGenMatch" );
53  if (iConfig.existsAs<edm::InputTag>("genParticleMatch")) {
55  }
56  else {
57  genMatchTokens_ = edm::vector_transform(iConfig.getParameter<std::vector<edm::InputTag> >( "genParticleMatch" ), [this](edm::InputTag const & tag){return consumes<edm::Association<reco::GenParticleCollection> >(tag);});
58  }
59  }
60  // Efficiency configurables
61  addEfficiencies_ = iConfig.getParameter<bool>("addEfficiencies");
62  if (addEfficiencies_) {
63  efficiencyLoader_ = pat::helper::EfficiencyLoader(iConfig.getParameter<edm::ParameterSet>("efficiencies"), consumesCollector());
64  }
65  // photon ID configurables
66  addPhotonID_ = iConfig.getParameter<bool>( "addPhotonID" );
67  if (addPhotonID_) {
68  // it might be a single photon ID
69  if (iConfig.existsAs<edm::InputTag>("photonIDSource")) {
70  photIDSrcs_.push_back(NameTag("", iConfig.getParameter<edm::InputTag>("photonIDSource")));
71  }
72  // or there might be many of them
73  if (iConfig.existsAs<edm::ParameterSet>("photonIDSources")) {
74  // please don't configure me twice
75  if (!photIDSrcs_.empty()){
76  throw cms::Exception("Configuration") << "PATPhotonProducer: you can't specify both 'photonIDSource' and 'photonIDSources'\n";
77  }
78  // read the different photon ID names
79  edm::ParameterSet idps = iConfig.getParameter<edm::ParameterSet>("photonIDSources");
80  std::vector<std::string> names = idps.getParameterNamesForType<edm::InputTag>();
81  for (std::vector<std::string>::const_iterator it = names.begin(), ed = names.end(); it != ed; ++it) {
82  photIDSrcs_.push_back(NameTag(*it, idps.getParameter<edm::InputTag>(*it)));
83  }
84  }
85  // but in any case at least once
86  if (photIDSrcs_.empty()) throw cms::Exception("Configuration") <<
87  "PATPhotonProducer: id addPhotonID is true, you must specify either:\n" <<
88  "\tInputTag photonIDSource = <someTag>\n" << "or\n" <<
89  "\tPSet photonIDSources = { \n" <<
90  "\t\tInputTag <someName> = <someTag> // as many as you want \n " <<
91  "\t}\n";
92  }
93  photIDTokens_ = edm::vector_transform(photIDSrcs_, [this](NameTag const & tag){return mayConsume<edm::ValueMap<Bool_t> >(tag.second);});
94  // Resolution configurables
95  addResolutions_ = iConfig.getParameter<bool>("addResolutions");
96  if (addResolutions_) {
97  resolutionLoader_ = pat::helper::KinResolutionsLoader(iConfig.getParameter<edm::ParameterSet>("resolutions"));
98  }
99  // Check to see if the user wants to add user data
100  if ( useUserData_ ) {
101  userDataHelper_ = PATUserDataHelper<Photon>(iConfig.getParameter<edm::ParameterSet>("userData"), consumesCollector());
102  }
103  // produces vector of photons
104  produces<std::vector<Photon> >();
105 
106  // read isoDeposit labels, for direct embedding
107  readIsolationLabels(iConfig, "isoDeposits", isoDepositLabels_, isoDepositTokens_);
108  // read isolation value labels, for direct embedding
109  readIsolationLabels(iConfig, "isolationValues", isolationValueLabels_, isolationValueTokens_);
110 
111 }
112 
113 PATPhotonProducer::~PATPhotonProducer() {
114 }
115 
117 {
118  // switch off embedding (in unschedules mode)
119  if (iEvent.isRealData()){
120  addGenMatch_ = false;
121  embedGenMatch_ = false;
122  }
123 
124  edm::ESHandle<CaloTopology> theCaloTopology;
125  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
126  ecalTopology_ = & (*theCaloTopology);
127 
128  edm::ESHandle<CaloGeometry> theCaloGeometry;
129  iSetup.get<CaloGeometryRecord>().get(theCaloGeometry);
130  ecalGeometry_ = & (*theCaloGeometry);
131 
132  // Get the vector of Photon's from the event
134  iEvent.getByToken(photonToken_, photons);
135 
136  // for conversion veto selection
138  iEvent.getByToken(hConversionsToken_, hConversions);
139 
140  // Get the collection of electrons from the event
142  iEvent.getByToken(electronToken_, hElectrons);
143 
144  // Get the beamspot
145  edm::Handle<reco::BeamSpot> beamSpotHandle;
146  iEvent.getByToken(beamLineToken_, beamSpotHandle);
147 
149 
150  // prepare the MC matching
151  std::vector<edm::Handle<edm::Association<reco::GenParticleCollection> > >genMatches(genMatchTokens_.size());
152  if (addGenMatch_) {
153  for (size_t j = 0, nd = genMatchTokens_.size(); j < nd; ++j) {
154  iEvent.getByToken(genMatchTokens_[j], genMatches[j]);
155  }
156  }
157 
158  if (isolator_.enabled()) isolator_.beginEvent(iEvent,iSetup);
159 
161  if (resolutionLoader_.enabled()) resolutionLoader_.newEvent(iEvent, iSetup);
162 
163  IsoDepositMaps deposits(isoDepositTokens_.size());
164  for (size_t j = 0, nd = isoDepositTokens_.size(); j < nd; ++j) {
165  iEvent.getByToken(isoDepositTokens_[j], deposits[j]);
166  }
167 
168  IsolationValueMaps isolationValues(isolationValueTokens_.size());
169  for (size_t j = 0; j<isolationValueTokens_.size(); ++j) {
170  iEvent.getByToken(isolationValueTokens_[j], isolationValues[j]);
171  }
172 
173 
174  // prepare ID extraction
175  std::vector<edm::Handle<edm::ValueMap<Bool_t> > > idhandles;
176  std::vector<pat::Photon::IdPair> ids;
177  if (addPhotonID_) {
178  idhandles.resize(photIDSrcs_.size());
179  ids.resize(photIDSrcs_.size());
180  for (size_t i = 0; i < photIDSrcs_.size(); ++i) {
181  iEvent.getByToken(photIDTokens_[i], idhandles[i]);
182  ids[i].first = photIDSrcs_[i].first;
183  }
184  }
185 
186  // loop over photons
187  std::vector<Photon> * PATPhotons = new std::vector<Photon>();
188  for (edm::View<reco::Photon>::const_iterator itPhoton = photons->begin(); itPhoton != photons->end(); itPhoton++) {
189  // construct the Photon from the ref -> save ref to original object
190  unsigned int idx = itPhoton - photons->begin();
191  edm::RefToBase<reco::Photon> photonRef = photons->refAt(idx);
192  edm::Ptr<reco::Photon> photonPtr = photons->ptrAt(idx);
193  Photon aPhoton(photonRef);
194  if (embedSuperCluster_) aPhoton.embedSuperCluster();
195  if (embedSeedCluster_) aPhoton.embedSeedCluster();
198 
199  std::vector<DetId> selectedCells;
200  bool barrel = itPhoton->isEB();
201  //loop over sub clusters
202  if (embedBasicClusters_) {
203  for (reco::CaloCluster_iterator clusIt = itPhoton->superCluster()->clustersBegin(); clusIt!=itPhoton->superCluster()->clustersEnd(); ++clusIt) {
204  //get seed (max energy xtal)
205  DetId seed = lazyTools.getMaximum(**clusIt).first;
206  //get all xtals in 5x5 window around the seed
207  std::vector<DetId> dets5x5 = (barrel) ? ecalTopology_->getSubdetectorTopology(DetId::Ecal,EcalBarrel)->getWindow(seed,5,5):
209  selectedCells.insert(selectedCells.end(), dets5x5.begin(), dets5x5.end());
210 
211  //get all xtals belonging to cluster
212  for (const std::pair<DetId, float> &hit : (*clusIt)->hitsAndFractions()) {
213  selectedCells.push_back(hit.first);
214  }
215  }
216  }
217 
218  //remove duplicates
219  std::sort(selectedCells.begin(),selectedCells.end());
220  std::unique(selectedCells.begin(),selectedCells.end());
221 
222  // Retrieve the corresponding RecHits
223 
224 
225  edm::Handle< EcalRecHitCollection > recHitsEBHandle;
226  iEvent.getByToken(reducedBarrelRecHitCollectionToken_,recHitsEBHandle);
227  edm::Handle< EcalRecHitCollection > recHitsEEHandle;
228  iEvent.getByToken(reducedEndcapRecHitCollectionToken_,recHitsEEHandle);
229 
230 
231  //orginal code would throw an exception via the handle not being valid but now it'll just have a null pointer error
232  //should have little effect, if its not barrel or endcap, something very bad has happened elsewhere anyways
233  const EcalRecHitCollection *recHits = nullptr;
234  if(photonRef->superCluster()->seed()->hitsAndFractions().at(0).first.subdetId()==EcalBarrel ) recHits = recHitsEBHandle.product();
235  else if( photonRef->superCluster()->seed()->hitsAndFractions().at(0).first.subdetId()==EcalEndcap ) recHits = recHitsEEHandle.product();
236 
237 
238  EcalRecHitCollection selectedRecHits;
239 
240 
241  unsigned nSelectedCells = selectedCells.size();
242  for (unsigned icell = 0 ; icell < nSelectedCells ; ++icell) {
243  EcalRecHitCollection::const_iterator it = recHits->find( selectedCells[icell] );
244  if ( it != recHits->end() ) {
245  selectedRecHits.push_back(*it);
246  }
247  }
248  selectedRecHits.sort();
249  if (embedRecHits_) aPhoton.embedRecHits(& selectedRecHits);
250 
251  // store the match to the generated final state muons
252  if (addGenMatch_) {
253  for(size_t i = 0, n = genMatches.size(); i < n; ++i) {
254  reco::GenParticleRef genPhoton = (*genMatches[i])[photonRef];
255  aPhoton.addGenParticleRef(genPhoton);
256  }
257  if (embedGenMatch_) aPhoton.embedGenParticle();
258  }
259 
260  if (efficiencyLoader_.enabled()) {
261  efficiencyLoader_.setEfficiencies( aPhoton, photonRef );
262  }
263 
264  if (resolutionLoader_.enabled()) {
266  }
267 
268  // here comes the extra functionality
269  if (isolator_.enabled()) {
270  isolator_.fill(*photons, idx, isolatorTmpStorage_);
271  typedef pat::helper::MultiIsolator::IsolationValuePairs IsolationValuePairs;
272  // better to loop backwards, so the vector is resized less times
273  for (IsolationValuePairs::const_reverse_iterator it = isolatorTmpStorage_.rbegin(), ed = isolatorTmpStorage_.rend(); it != ed; ++it) {
274  aPhoton.setIsolation(it->first, it->second);
275  }
276  }
277 
278  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
279  aPhoton.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[photonRef]);
280  }
281 
282  for (size_t j = 0; j<isolationValues.size(); ++j) {
283  aPhoton.setIsolation(isolationValueLabels_[j].first,(*isolationValues[j])[photonRef]);
284  }
285 
286  // add photon ID info
287  if (addPhotonID_) {
288  for (size_t i = 0; i < photIDSrcs_.size(); ++i) {
289  ids[i].second = (*idhandles[i])[photonRef];
290  }
291  aPhoton.setPhotonIDs(ids);
292  }
293 
294  if ( useUserData_ ) {
295  userDataHelper_.add( aPhoton, iEvent, iSetup );
296  }
297 
298 
299  // set conversion veto selection
300  bool passelectronveto = false;
301  if( hConversions.isValid()){
302  // this is recommended method
303  passelectronveto = !ConversionTools::hasMatchedPromptElectron(photonRef->superCluster(), hElectrons, hConversions, beamSpotHandle->position());
304  }
305  aPhoton.setPassElectronVeto( passelectronveto );
306 
307 
308  // set electron veto using pixel seed (not recommended but many analysis groups are still using since it is powerful method to remove electrons)
309  aPhoton.setHasPixelSeed( photonRef->hasPixelSeed() );
310 
311  // set seed energy
312  aPhoton.setSeedEnergy( photonRef->superCluster()->seed()->energy() );
313 
314  EcalRegressionData ecalRegData;
315  ecalRegData.fill(*(photonRef->superCluster()),
316  recHitsEBHandle.product(),recHitsEEHandle.product(),
318 
319 
320  // set input variables for regression energy correction
321  aPhoton.setEMax( ecalRegData.eMax() );
322  aPhoton.setE2nd( ecalRegData.e2nd() );
323  aPhoton.setE3x3( ecalRegData.e3x3() );
324  aPhoton.setETop( ecalRegData.eTop() );
325  aPhoton.setEBottom( ecalRegData.eBottom() );
326  aPhoton.setELeft( ecalRegData.eLeft() );
327  aPhoton.setERight( ecalRegData.eRight() );
328  aPhoton.setSee( ecalRegData.sigmaIEtaIEta() );
329  aPhoton.setSep( ecalRegData.sigmaIEtaIPhi()*ecalRegData.sigmaIEtaIEta()*ecalRegData.sigmaIPhiIPhi() ); //there is a conflict on what sigmaIEtaIPhi actually is, regression and ID have it differently, this may change in later releases
330  aPhoton.setSpp( ecalRegData.sigmaIPhiIPhi() );
331 
332  aPhoton.setMaxDR( ecalRegData.maxSubClusDR() );
333  aPhoton.setMaxDRDPhi( ecalRegData.maxSubClusDRDPhi() );
334  aPhoton.setMaxDRDEta( ecalRegData.maxSubClusDRDEta() );
335  aPhoton.setMaxDRRawEnergy( ecalRegData.maxSubClusDRRawEnergy() );
345 
346  aPhoton.setCryPhi( ecalRegData.seedCrysPhiOrY() );
347  aPhoton.setCryEta( ecalRegData.seedCrysEtaOrX() );
348  aPhoton.setIEta( ecalRegData.seedCrysIEtaOrIX() );
349  aPhoton.setIPhi( ecalRegData.seedCrysIPhiOrIY() );
350 
351 
352  // add the Photon to the vector of Photons
353  PATPhotons->push_back(aPhoton);
354  }
355 
356  // sort Photons in ET
357  std::sort(PATPhotons->begin(), PATPhotons->end(), eTComparator_);
358 
359  // put genEvt object in Event
360  std::auto_ptr<std::vector<Photon> > myPhotons(PATPhotons);
361  iEvent.put(myPhotons);
363 
364 }
365 
366 // ParameterSet description for module
368 {
370  iDesc.setComment("PAT photon producer module");
371 
372  // input source
373  iDesc.add<edm::InputTag>("photonSource", edm::InputTag("no default"))->setComment("input collection");
374  iDesc.add<edm::InputTag>("electronSource", edm::InputTag("no default"))->setComment("input collection");
375 
376  iDesc.add<edm::InputTag>("reducedBarrelRecHitCollection", edm::InputTag("reducedEcalRecHitsEB"));
377  iDesc.add<edm::InputTag>("reducedEndcapRecHitCollection", edm::InputTag("reducedEcalRecHitsEE"));
378 
379  iDesc.add<bool>("embedSuperCluster", true)->setComment("embed external super cluster");
380  iDesc.add<bool>("embedSeedCluster", true)->setComment("embed external seed cluster");
381  iDesc.add<bool>("embedBasicClusters", true)->setComment("embed external basic clusters");
382  iDesc.add<bool>("embedPreshowerClusters", true)->setComment("embed external preshower clusters");
383  iDesc.add<bool>("embedRecHits", true)->setComment("embed external RecHits");
384 
385  // MC matching configurables
386  iDesc.add<bool>("addGenMatch", true)->setComment("add MC matching");
387  iDesc.add<bool>("embedGenMatch", false)->setComment("embed MC matched MC information");
388  std::vector<edm::InputTag> emptySourceVector;
389  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("genParticleMatch", edm::InputTag(), true) xor
390  edm::ParameterDescription<std::vector<edm::InputTag> >("genParticleMatch", emptySourceVector, true)
391  )->setComment("input with MC match information");
392 
394 
395  // photon ID configurables
396  iDesc.add<bool>("addPhotonID",true)->setComment("add photon ID variables");
397  edm::ParameterSetDescription photonIDSourcesPSet;
398  photonIDSourcesPSet.setAllowAnything();
399  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("photonIDSource", edm::InputTag(), true) xor
400  edm::ParameterDescription<edm::ParameterSetDescription>("photonIDSources", photonIDSourcesPSet, true)
401  )->setComment("input with photon ID variables");
402 
403  // IsoDeposit configurables
404  edm::ParameterSetDescription isoDepositsPSet;
405  isoDepositsPSet.addOptional<edm::InputTag>("tracker");
406  isoDepositsPSet.addOptional<edm::InputTag>("ecal");
407  isoDepositsPSet.addOptional<edm::InputTag>("hcal");
408  isoDepositsPSet.addOptional<edm::InputTag>("pfAllParticles");
409  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedHadrons");
410  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedAll");
411  isoDepositsPSet.addOptional<edm::InputTag>("pfPUChargedHadrons");
412  isoDepositsPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
413  isoDepositsPSet.addOptional<edm::InputTag>("pfPhotons");
414  isoDepositsPSet.addOptional<std::vector<edm::InputTag> >("user");
415  iDesc.addOptional("isoDeposits", isoDepositsPSet);
416 
417  // isolation values configurables
418  edm::ParameterSetDescription isolationValuesPSet;
419  isolationValuesPSet.addOptional<edm::InputTag>("tracker");
420  isolationValuesPSet.addOptional<edm::InputTag>("ecal");
421  isolationValuesPSet.addOptional<edm::InputTag>("hcal");
422  isolationValuesPSet.addOptional<edm::InputTag>("pfAllParticles");
423  isolationValuesPSet.addOptional<edm::InputTag>("pfChargedHadrons");
424  isolationValuesPSet.addOptional<edm::InputTag>("pfChargedAll");
425  isolationValuesPSet.addOptional<edm::InputTag>("pfPUChargedHadrons");
426  isolationValuesPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
427  isolationValuesPSet.addOptional<edm::InputTag>("pfPhotons");
428  isolationValuesPSet.addOptional<std::vector<edm::InputTag> >("user");
429  iDesc.addOptional("isolationValues", isolationValuesPSet);
430 
431  // Efficiency configurables
432  edm::ParameterSetDescription efficienciesPSet;
433  efficienciesPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
434  iDesc.add("efficiencies", efficienciesPSet);
435  iDesc.add<bool>("addEfficiencies", false);
436 
437  // Check to see if the user wants to add user data
438  edm::ParameterSetDescription userDataPSet;
440  iDesc.addOptional("userData", userDataPSet);
441 
442  edm::ParameterSetDescription isolationPSet;
443  isolationPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
444  iDesc.add("userIsolation", isolationPSet);
445 
446  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("beamLineSrc", edm::InputTag(), true)
447  )->setComment("input with high level selection");
448 
449  descriptions.add("PATPhotonProducer", iDesc);
450 
451 }
452 
454 
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
float sigmaIPhiIPhi() const
T getParameter(std::string const &) const
void setSpp(float s)
Definition: Photon.h:252
void setComment(std::string const &value)
Assists in assimilating all pat::UserData into pat objects.
int i
Definition: DBlmapReader.cc:9
const std::vector< float > & subClusRawEnergy() const
Analysis-level Photon class.
Definition: Photon.h:47
void setIEta(float i)
Definition: Photon.h:294
pat::PATUserDataHelper< pat::Photon > userDataHelper_
float maxSubClusDRRawEnergy() const
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
float maxSubClusDRDEta() const
edm::EDGetTokenT< EcalRecHitCollection > reducedEndcapRecHitCollectionToken_
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:184
void setSubClusDPhi3(float s)
Definition: Photon.h:277
static const HistoName names[]
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
void setE2nd(float e)
Definition: Photon.h:237
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
void setAllowAnything()
allow any parameter label/value pairs
void setSee(float s)
Definition: Photon.h:250
std::vector< edm::Handle< edm::ValueMap< double > > > IsolationValueMaps
std::vector< edm::EDGetTokenT< edm::ValueMap< Bool_t > > > photIDTokens_
void fill(const reco::SuperCluster &superClus, const EcalRecHitCollection *ebRecHits, const EcalRecHitCollection *eeRecHits, const CaloGeometry *geom, const CaloTopology *topology, const reco::VertexCollection *vertices)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void setMaxDRRawEnergy(float m)
Definition: Photon.h:263
edm::EDGetTokenT< reco::BeamSpot > beamLineToken_
void embedSeedCluster()
method to store the electron&#39;s seedcluster internally
static bool hasMatchedPromptElectron(const reco::SuperClusterRef &sc, const edm::Handle< reco::GsfElectronCollection > &eleCol, const edm::Handle< reco::ConversionCollection > &convCol, const math::XYZPoint &beamspot, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=0)
edm::EDGetTokenT< edm::View< reco::Photon > > photonToken_
std::vector< EcalRecHit >::const_iterator const_iterator
void setSubClusDPhi2(float s)
Definition: Photon.h:275
float eLeft() const
void push_back(T const &t)
float seedCrysPhiOrY() const
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
std::vector< edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > > genMatchTokens_
void embedRecHits(const EcalRecHitCollection *rechits)
method to store the RecHits internally - can be called from the PATElectronProducer ...
pat::helper::KinResolutionsLoader resolutionLoader_
float sigmaIEtaIEta() const
GreaterByEt< Photon > eTComparator_
const CaloGeometry * ecalGeometry_
float sigmaIEtaIPhi() const
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
Definition: transform.h:11
void setIPhi(float i)
Definition: Photon.h:292
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
edm::InputTag reducedEndcapRecHitCollection_
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
static void fillDescription(edm::ParameterSetDescription &iDesc)
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:192
bool enabled() const
True if it has a non null configuration.
Definition: MultiIsolator.h:50
IsolationLabels isoDepositLabels_
void setIsolation(IsolationKeys key, float value)
Definition: Photon.h:168
void setComment(std::string const &value)
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
void setELeft(float e)
Definition: Photon.h:245
void setIsoDeposit(IsolationKeys key, const IsoDeposit &dep)
Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten.
Definition: Photon.h:208
int iEvent
Definition: GenABIO.cc:230
void setEMax(float e)
Definition: Photon.h:235
void beginEvent(const edm::Event &event, const edm::EventSetup &eventSetup)
const CaloTopology * ecalTopology_
void setERight(float e)
Definition: Photon.h:247
float seedCrysIPhiOrIY() const
IsolationLabels isolationValueLabels_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
void setMaxDRDEta(float m)
Definition: Photon.h:261
std::vector< edm::EDGetTokenT< edm::ValueMap< IsoDeposit > > > isoDepositTokens_
void embedGenParticle()
Definition: PATObject.h:677
pat::helper::EfficiencyLoader efficiencyLoader_
float maxSubClusDR() const
void setPhotonIDs(const std::vector< IdPair > &ids)
Definition: Photon.h:110
float seedCrysIEtaOrIX() const
void embedBasicClusters()
method to store the electron&#39;s basic clusters
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void setPassElectronVeto(bool flag)
Definition: Photon.h:225
void setETop(float e)
Definition: Photon.h:241
int j
Definition: DBlmapReader.cc:9
float maxSubClusDRDPhi() const
void setSeedEnergy(float e)
Definition: Photon.h:232
void setSubClusDPhi1(float s)
Definition: Photon.h:273
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::vector< NameTag > photIDSrcs_
bool first
Definition: L1TdeRCT.cc:75
bool isValid() const
Definition: HandleBase.h:76
void setSubClusDEta1(float s)
Definition: Photon.h:280
std::vector< edm::Handle< edm::ValueMap< IsoDeposit > > > IsoDepositMaps
pat::helper::MultiIsolator isolator_
float seedCrysEtaOrX() const
void embedPreshowerClusters()
method to store the electron&#39;s preshower clusters
void setCryEta(float c)
Definition: Photon.h:289
const_iterator end() const
void embedSuperCluster()
method to store the photon&#39;s supercluster internally
Definition: DetId.h:18
void addGenParticleRef(const reco::GenParticleRef &ref)
Definition: PATObject.h:661
void setCryPhi(float c)
Definition: Photon.h:287
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
void setHasPixelSeed(bool flag)
Definition: Photon.h:228
T const * product() const
Definition: Handle.h:81
static void fillDescription(edm::ParameterSetDescription &iDesc)
Method for documentation and validation of PSet.
void setSubClusDEta2(float s)
Definition: Photon.h:282
void setMaxDR(float m)
Definition: Photon.h:257
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
bool hasPixelSeed() const
Bool flagging photons having a non-zero size vector of Ref to electornPixel seeds.
Definition: Photon.h:75
const T & get() const
Definition: EventSetup.h:55
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
void setSubClusRawE2(float s)
Definition: Photon.h:268
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:26
const std::vector< float > & subClusDEta() const
void setEBottom(float e)
Definition: Photon.h:243
std::vector< std::pair< pat::IsolationKeys, float > > IsolationValuePairs
Definition: MultiIsolator.h:16
void setMaxDRDPhi(float m)
Definition: Photon.h:259
iterator find(key_type k)
const std::vector< float > & subClusDPhi() const
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
void setSubClusDEta3(float s)
Definition: Photon.h:284
size_type size() const
float eRight() const
void setSubClusRawE1(float s)
Definition: Photon.h:266
PATPhotonProducer(const edm::ParameterSet &iConfig)
void setSubClusRawE3(float s)
Definition: Photon.h:270
volatile std::atomic< bool > shutdown_flag false
edm::EDGetTokenT< EcalRecHitCollection > reducedBarrelRecHitCollectionToken_
std::vector< edm::EDGetTokenT< edm::ValueMap< double > > > isolationValueTokens_
void newEvent(const edm::Event &event, const edm::EventSetup &setup) const
To be called for each new event, reads in the EventSetup object.
edm::InputTag reducedBarrelRecHitCollection_
void newEvent(const edm::Event &event) const
To be called for each new event, reads in the ValueMaps for efficiencies.
void setE3x3(float e)
Definition: Photon.h:239
float eBottom() const
edm::EDGetTokenT< reco::ConversionCollection > hConversionsToken_
void setSep(float s)
Definition: Photon.h:254
void fill(const edm::View< T > &coll, int idx, IsolationValuePairs &isolations) const
Definition: MultiIsolator.h:82
Produces the pat::Photon.
edm::EDGetTokenT< reco::GsfElectronCollection > electronToken_