test
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>(iConfig.getParameter<edm::InputTag>("electronSource"));
38 hConversionsToken_ = consumes<reco::ConversionCollection>(iConfig.getParameter<edm::InputTag>("conversionSource"));
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  // PFCluster Isolation maps
66  addPFClusterIso_ = iConfig.getParameter<bool>("addPFClusterIso");
67  ecalPFClusterIsoT_ = consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("ecalPFClusterIsoMap"));
68  hcalPFClusterIsoT_ = consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("hcalPFClusterIsoMap"));
69  // photon ID configurables
70  addPhotonID_ = iConfig.getParameter<bool>( "addPhotonID" );
71  if (addPhotonID_) {
72  // it might be a single photon ID
73  if (iConfig.existsAs<edm::InputTag>("photonIDSource")) {
74  photIDSrcs_.push_back(NameTag("", iConfig.getParameter<edm::InputTag>("photonIDSource")));
75  }
76  // or there might be many of them
77  if (iConfig.existsAs<edm::ParameterSet>("photonIDSources")) {
78  // please don't configure me twice
79  if (!photIDSrcs_.empty()){
80  throw cms::Exception("Configuration") << "PATPhotonProducer: you can't specify both 'photonIDSource' and 'photonIDSources'\n";
81  }
82  // read the different photon ID names
83  edm::ParameterSet idps = iConfig.getParameter<edm::ParameterSet>("photonIDSources");
84  std::vector<std::string> names = idps.getParameterNamesForType<edm::InputTag>();
85  for (std::vector<std::string>::const_iterator it = names.begin(), ed = names.end(); it != ed; ++it) {
86  photIDSrcs_.push_back(NameTag(*it, idps.getParameter<edm::InputTag>(*it)));
87  }
88  }
89  // but in any case at least once
90  if (photIDSrcs_.empty()) throw cms::Exception("Configuration") <<
91  "PATPhotonProducer: id addPhotonID is true, you must specify either:\n" <<
92  "\tInputTag photonIDSource = <someTag>\n" << "or\n" <<
93  "\tPSet photonIDSources = { \n" <<
94  "\t\tInputTag <someName> = <someTag> // as many as you want \n " <<
95  "\t}\n";
96  }
97  photIDTokens_ = edm::vector_transform(photIDSrcs_, [this](NameTag const & tag){return mayConsume<edm::ValueMap<Bool_t> >(tag.second);});
98  // Resolution configurables
99  addResolutions_ = iConfig.getParameter<bool>("addResolutions");
100  if (addResolutions_) {
101  resolutionLoader_ = pat::helper::KinResolutionsLoader(iConfig.getParameter<edm::ParameterSet>("resolutions"));
102  }
103  // Check to see if the user wants to add user data
104  if ( useUserData_ ) {
105  userDataHelper_ = PATUserDataHelper<Photon>(iConfig.getParameter<edm::ParameterSet>("userData"), consumesCollector());
106  }
107  // produces vector of photons
108  produces<std::vector<Photon> >();
109 
110  // read isoDeposit labels, for direct embedding
111  readIsolationLabels(iConfig, "isoDeposits", isoDepositLabels_, isoDepositTokens_);
112  // read isolation value labels, for direct embedding
113  readIsolationLabels(iConfig, "isolationValues", isolationValueLabels_, isolationValueTokens_);
114 
115 }
116 
117 PATPhotonProducer::~PATPhotonProducer() {
118 }
119 
121 {
122  // switch off embedding (in unschedules mode)
123  if (iEvent.isRealData()){
124  addGenMatch_ = false;
125  embedGenMatch_ = false;
126  }
127 
128  edm::ESHandle<CaloTopology> theCaloTopology;
129  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
130  ecalTopology_ = & (*theCaloTopology);
131 
132  edm::ESHandle<CaloGeometry> theCaloGeometry;
133  iSetup.get<CaloGeometryRecord>().get(theCaloGeometry);
134  ecalGeometry_ = & (*theCaloGeometry);
135 
136  // Get the vector of Photon's from the event
138  iEvent.getByToken(photonToken_, photons);
139 
140  // for conversion veto selection
142  iEvent.getByToken(hConversionsToken_, hConversions);
143 
144  // Get the collection of electrons from the event
146  iEvent.getByToken(electronToken_, hElectrons);
147 
148  // Get the beamspot
149  edm::Handle<reco::BeamSpot> beamSpotHandle;
150  iEvent.getByToken(beamLineToken_, beamSpotHandle);
151 
153 
154  // prepare the MC matching
155  std::vector<edm::Handle<edm::Association<reco::GenParticleCollection> > >genMatches(genMatchTokens_.size());
156  if (addGenMatch_) {
157  for (size_t j = 0, nd = genMatchTokens_.size(); j < nd; ++j) {
158  iEvent.getByToken(genMatchTokens_[j], genMatches[j]);
159  }
160  }
161 
162  if (isolator_.enabled()) isolator_.beginEvent(iEvent,iSetup);
163 
165  if (resolutionLoader_.enabled()) resolutionLoader_.newEvent(iEvent, iSetup);
166 
167  IsoDepositMaps deposits(isoDepositTokens_.size());
168  for (size_t j = 0, nd = isoDepositTokens_.size(); j < nd; ++j) {
169  iEvent.getByToken(isoDepositTokens_[j], deposits[j]);
170  }
171 
172  IsolationValueMaps isolationValues(isolationValueTokens_.size());
173  for (size_t j = 0; j<isolationValueTokens_.size(); ++j) {
174  iEvent.getByToken(isolationValueTokens_[j], isolationValues[j]);
175  }
176 
177 
178  // prepare ID extraction
179  std::vector<edm::Handle<edm::ValueMap<Bool_t> > > idhandles;
180  std::vector<pat::Photon::IdPair> ids;
181  if (addPhotonID_) {
182  idhandles.resize(photIDSrcs_.size());
183  ids.resize(photIDSrcs_.size());
184  for (size_t i = 0; i < photIDSrcs_.size(); ++i) {
185  iEvent.getByToken(photIDTokens_[i], idhandles[i]);
186  ids[i].first = photIDSrcs_[i].first;
187  }
188  }
189 
190  // loop over photons
191  std::vector<Photon> * PATPhotons = new std::vector<Photon>();
192  for (edm::View<reco::Photon>::const_iterator itPhoton = photons->begin(); itPhoton != photons->end(); itPhoton++) {
193  // construct the Photon from the ref -> save ref to original object
194  unsigned int idx = itPhoton - photons->begin();
195  edm::RefToBase<reco::Photon> photonRef = photons->refAt(idx);
196  edm::Ptr<reco::Photon> photonPtr = photons->ptrAt(idx);
197  Photon aPhoton(photonRef);
198  if (embedSuperCluster_) aPhoton.embedSuperCluster();
199  if (embedSeedCluster_) aPhoton.embedSeedCluster();
202 
203  std::vector<DetId> selectedCells;
204  bool barrel = itPhoton->isEB();
205  //loop over sub clusters
206  if (embedBasicClusters_) {
207  for (reco::CaloCluster_iterator clusIt = itPhoton->superCluster()->clustersBegin(); clusIt!=itPhoton->superCluster()->clustersEnd(); ++clusIt) {
208  //get seed (max energy xtal)
209  DetId seed = lazyTools.getMaximum(**clusIt).first;
210  //get all xtals in 5x5 window around the seed
211  std::vector<DetId> dets5x5 = (barrel) ? ecalTopology_->getSubdetectorTopology(DetId::Ecal,EcalBarrel)->getWindow(seed,5,5):
213  selectedCells.insert(selectedCells.end(), dets5x5.begin(), dets5x5.end());
214 
215  //get all xtals belonging to cluster
216  for (const std::pair<DetId, float> &hit : (*clusIt)->hitsAndFractions()) {
217  selectedCells.push_back(hit.first);
218  }
219  }
220  }
221 
222  //remove duplicates
223  std::sort(selectedCells.begin(),selectedCells.end());
224  std::unique(selectedCells.begin(),selectedCells.end());
225 
226  // Retrieve the corresponding RecHits
227 
228 
229  edm::Handle< EcalRecHitCollection > recHitsEBHandle;
230  iEvent.getByToken(reducedBarrelRecHitCollectionToken_,recHitsEBHandle);
231  edm::Handle< EcalRecHitCollection > recHitsEEHandle;
232  iEvent.getByToken(reducedEndcapRecHitCollectionToken_,recHitsEEHandle);
233 
234 
235  //orginal code would throw an exception via the handle not being valid but now it'll just have a null pointer error
236  //should have little effect, if its not barrel or endcap, something very bad has happened elsewhere anyways
237  const EcalRecHitCollection *recHits = nullptr;
238  if(photonRef->superCluster()->seed()->hitsAndFractions().at(0).first.subdetId()==EcalBarrel ) recHits = recHitsEBHandle.product();
239  else if( photonRef->superCluster()->seed()->hitsAndFractions().at(0).first.subdetId()==EcalEndcap ) recHits = recHitsEEHandle.product();
240 
241 
242  EcalRecHitCollection selectedRecHits;
243 
244 
245  unsigned nSelectedCells = selectedCells.size();
246  for (unsigned icell = 0 ; icell < nSelectedCells ; ++icell) {
247  EcalRecHitCollection::const_iterator it = recHits->find( selectedCells[icell] );
248  if ( it != recHits->end() ) {
249  selectedRecHits.push_back(*it);
250  }
251  }
252  selectedRecHits.sort();
253  if (embedRecHits_) aPhoton.embedRecHits(& selectedRecHits);
254 
255  // store the match to the generated final state muons
256  if (addGenMatch_) {
257  for(size_t i = 0, n = genMatches.size(); i < n; ++i) {
258  reco::GenParticleRef genPhoton = (*genMatches[i])[photonRef];
259  aPhoton.addGenParticleRef(genPhoton);
260  }
261  if (embedGenMatch_) aPhoton.embedGenParticle();
262  }
263 
264  if (efficiencyLoader_.enabled()) {
265  efficiencyLoader_.setEfficiencies( aPhoton, photonRef );
266  }
267 
268  if (resolutionLoader_.enabled()) {
270  }
271 
272  // here comes the extra functionality
273  if (isolator_.enabled()) {
274  isolator_.fill(*photons, idx, isolatorTmpStorage_);
275  typedef pat::helper::MultiIsolator::IsolationValuePairs IsolationValuePairs;
276  // better to loop backwards, so the vector is resized less times
277  for (IsolationValuePairs::const_reverse_iterator it = isolatorTmpStorage_.rbegin(), ed = isolatorTmpStorage_.rend(); it != ed; ++it) {
278  aPhoton.setIsolation(it->first, it->second);
279  }
280  }
281 
282  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
283  aPhoton.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[photonRef]);
284  }
285 
286  for (size_t j = 0; j<isolationValues.size(); ++j) {
287  aPhoton.setIsolation(isolationValueLabels_[j].first,(*isolationValues[j])[photonRef]);
288  }
289 
290  // add photon ID info
291  if (addPhotonID_) {
292  for (size_t i = 0; i < photIDSrcs_.size(); ++i) {
293  ids[i].second = (*idhandles[i])[photonRef];
294  }
295  aPhoton.setPhotonIDs(ids);
296  }
297 
298  if ( useUserData_ ) {
299  userDataHelper_.add( aPhoton, iEvent, iSetup );
300  }
301 
302 
303  // set conversion veto selection
304  bool passelectronveto = false;
305  if( hConversions.isValid()){
306  // this is recommended method
307  passelectronveto = !ConversionTools::hasMatchedPromptElectron(photonRef->superCluster(), hElectrons, hConversions, beamSpotHandle->position());
308  }
309  aPhoton.setPassElectronVeto( passelectronveto );
310 
311 
312  // set electron veto using pixel seed (not recommended but many analysis groups are still using since it is powerful method to remove electrons)
313  aPhoton.setHasPixelSeed( photonRef->hasPixelSeed() );
314 
315  // set seed energy
316  aPhoton.setSeedEnergy( photonRef->superCluster()->seed()->energy() );
317 
318  EcalRegressionData ecalRegData;
319  ecalRegData.fill(*(photonRef->superCluster()),
320  recHitsEBHandle.product(),recHitsEEHandle.product(),
322 
323 
324  // set input variables for regression energy correction
325  aPhoton.setEMax( ecalRegData.eMax() );
326  aPhoton.setE2nd( ecalRegData.e2nd() );
327  aPhoton.setE3x3( ecalRegData.e3x3() );
328  aPhoton.setETop( ecalRegData.eTop() );
329  aPhoton.setEBottom( ecalRegData.eBottom() );
330  aPhoton.setELeft( ecalRegData.eLeft() );
331  aPhoton.setERight( ecalRegData.eRight() );
332  aPhoton.setSee( ecalRegData.sigmaIEtaIEta() );
333  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
334  aPhoton.setSpp( ecalRegData.sigmaIPhiIPhi() );
335 
336  aPhoton.setMaxDR( ecalRegData.maxSubClusDR() );
337  aPhoton.setMaxDRDPhi( ecalRegData.maxSubClusDRDPhi() );
338  aPhoton.setMaxDRDEta( ecalRegData.maxSubClusDRDEta() );
339  aPhoton.setMaxDRRawEnergy( ecalRegData.maxSubClusDRRawEnergy() );
349 
350  aPhoton.setCryPhi( ecalRegData.seedCrysPhiOrY() );
351  aPhoton.setCryEta( ecalRegData.seedCrysEtaOrX() );
352  aPhoton.setIEta( ecalRegData.seedCrysIEtaOrIX() );
353  aPhoton.setIPhi( ecalRegData.seedCrysIPhiOrIY() );
354 
355  // Get PFCluster Isolation
356  if (addPFClusterIso_) {
357  edm::Handle<edm::ValueMap<float> > ecalPFClusterIsoMapH;
358  iEvent.getByToken(ecalPFClusterIsoT_, ecalPFClusterIsoMapH);
359  edm::Handle<edm::ValueMap<float> > hcalPFClusterIsoMapH;
360  iEvent.getByToken(hcalPFClusterIsoT_, hcalPFClusterIsoMapH);
361  aPhoton.setEcalPFClusterIso((*ecalPFClusterIsoMapH)[photonRef]);
362  aPhoton.setHcalPFClusterIso((*hcalPFClusterIsoMapH)[photonRef]);
363  } else {
364  aPhoton.setEcalPFClusterIso(-999.);
365  aPhoton.setHcalPFClusterIso(-999.);
366  }
367 
368  // add the Photon to the vector of Photons
369  PATPhotons->push_back(aPhoton);
370  }
371 
372  // sort Photons in ET
373  std::sort(PATPhotons->begin(), PATPhotons->end(), eTComparator_);
374 
375  // put genEvt object in Event
376  std::auto_ptr<std::vector<Photon> > myPhotons(PATPhotons);
377  iEvent.put(myPhotons);
379 
380 }
381 
382 // ParameterSet description for module
384 {
386  iDesc.setComment("PAT photon producer module");
387 
388  // input source
389  iDesc.add<edm::InputTag>("photonSource", edm::InputTag("no default"))->setComment("input collection");
390  iDesc.add<edm::InputTag>("electronSource", edm::InputTag("no default"))->setComment("input collection");
391  iDesc.add<edm::InputTag>("conversionSource", edm::InputTag("allConversions"))->setComment("input collection");
392 
393  iDesc.add<edm::InputTag>("reducedBarrelRecHitCollection", edm::InputTag("reducedEcalRecHitsEB"));
394  iDesc.add<edm::InputTag>("reducedEndcapRecHitCollection", edm::InputTag("reducedEcalRecHitsEE"));
395 
396  iDesc.ifValue(edm::ParameterDescription<bool>("addPFClusterIso", false, true),
397  true >> (edm::ParameterDescription<edm::InputTag>("ecalPFClusterIsoMap", edm::InputTag("photonEcalPFClusterIsolationProducer"), true) and
398  edm::ParameterDescription<edm::InputTag>("hcalPFClusterIsoMap", edm::InputTag("photonHcalPFClusterIsolationProducer"),true)) or
399  false >> (edm::ParameterDescription<edm::InputTag>("ecalPFClusterIsoMap", edm::InputTag(""), true) and
400  edm::ParameterDescription<edm::InputTag>("hcalPFClusterIsoMap", edm::InputTag(""),true)));
401 
402  iDesc.add<bool>("embedSuperCluster", true)->setComment("embed external super cluster");
403  iDesc.add<bool>("embedSeedCluster", true)->setComment("embed external seed cluster");
404  iDesc.add<bool>("embedBasicClusters", true)->setComment("embed external basic clusters");
405  iDesc.add<bool>("embedPreshowerClusters", true)->setComment("embed external preshower clusters");
406  iDesc.add<bool>("embedRecHits", true)->setComment("embed external RecHits");
407 
408  // MC matching configurables
409  iDesc.add<bool>("addGenMatch", true)->setComment("add MC matching");
410  iDesc.add<bool>("embedGenMatch", false)->setComment("embed MC matched MC information");
411  std::vector<edm::InputTag> emptySourceVector;
412  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("genParticleMatch", edm::InputTag(), true) xor
413  edm::ParameterDescription<std::vector<edm::InputTag> >("genParticleMatch", emptySourceVector, true)
414  )->setComment("input with MC match information");
415 
417 
418  // photon ID configurables
419  iDesc.add<bool>("addPhotonID",true)->setComment("add photon ID variables");
420  edm::ParameterSetDescription photonIDSourcesPSet;
421  photonIDSourcesPSet.setAllowAnything();
422  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("photonIDSource", edm::InputTag(), true) xor
423  edm::ParameterDescription<edm::ParameterSetDescription>("photonIDSources", photonIDSourcesPSet, true)
424  )->setComment("input with photon ID variables");
425 
426  // IsoDeposit configurables
427  edm::ParameterSetDescription isoDepositsPSet;
428  isoDepositsPSet.addOptional<edm::InputTag>("tracker");
429  isoDepositsPSet.addOptional<edm::InputTag>("ecal");
430  isoDepositsPSet.addOptional<edm::InputTag>("hcal");
431  isoDepositsPSet.addOptional<edm::InputTag>("pfAllParticles");
432  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedHadrons");
433  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedAll");
434  isoDepositsPSet.addOptional<edm::InputTag>("pfPUChargedHadrons");
435  isoDepositsPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
436  isoDepositsPSet.addOptional<edm::InputTag>("pfPhotons");
437  isoDepositsPSet.addOptional<std::vector<edm::InputTag> >("user");
438  iDesc.addOptional("isoDeposits", isoDepositsPSet);
439 
440  // isolation values configurables
441  edm::ParameterSetDescription isolationValuesPSet;
442  isolationValuesPSet.addOptional<edm::InputTag>("tracker");
443  isolationValuesPSet.addOptional<edm::InputTag>("ecal");
444  isolationValuesPSet.addOptional<edm::InputTag>("hcal");
445  isolationValuesPSet.addOptional<edm::InputTag>("pfAllParticles");
446  isolationValuesPSet.addOptional<edm::InputTag>("pfChargedHadrons");
447  isolationValuesPSet.addOptional<edm::InputTag>("pfChargedAll");
448  isolationValuesPSet.addOptional<edm::InputTag>("pfPUChargedHadrons");
449  isolationValuesPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
450  isolationValuesPSet.addOptional<edm::InputTag>("pfPhotons");
451  isolationValuesPSet.addOptional<std::vector<edm::InputTag> >("user");
452  iDesc.addOptional("isolationValues", isolationValuesPSet);
453 
454  // Efficiency configurables
455  edm::ParameterSetDescription efficienciesPSet;
456  efficienciesPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
457  iDesc.add("efficiencies", efficienciesPSet);
458  iDesc.add<bool>("addEfficiencies", false);
459 
460  // Check to see if the user wants to add user data
461  edm::ParameterSetDescription userDataPSet;
463  iDesc.addOptional("userData", userDataPSet);
464 
465  edm::ParameterSetDescription isolationPSet;
466  isolationPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
467  iDesc.add("userIsolation", isolationPSet);
468 
469  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("beamLineSrc", edm::InputTag(), true)
470  )->setComment("input with high level selection");
471 
472  descriptions.add("PATPhotonProducer", iDesc);
473 
474 }
475 
477 
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:258
void setComment(std::string const &value)
Assists in assimilating all pat::UserData into pat objects.
int i
Definition: DBlmapReader.cc:9
void newEvent(const edm::Event &event)
To be called for each new event, reads in the ValueMaps for efficiencies.
const std::vector< float > & subClusRawEnergy() const
Analysis-level Photon class.
Definition: Photon.h:47
void setIEta(float i)
Definition: Photon.h:300
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:186
void setSubClusDPhi3(float s)
Definition: Photon.h:283
static const HistoName names[]
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
void setE2nd(float e)
Definition: Photon.h:243
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
void setAllowAnything()
allow any parameter label/value pairs
void setSee(float s)
Definition: Photon.h:256
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:269
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, bool allowCkfMatch=true, 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:281
float eLeft() const
edm::EDGetTokenT< edm::ValueMap< float > > ecalPFClusterIsoT_
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
edm::EDGetTokenT< edm::ValueMap< float > > hcalPFClusterIsoT_
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:298
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:63
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:194
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:174
void setComment(std::string const &value)
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
void setELeft(float e)
Definition: Photon.h:251
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:214
int iEvent
Definition: GenABIO.cc:230
void setEMax(float e)
Definition: Photon.h:241
void beginEvent(const edm::Event &event, const edm::EventSetup &eventSetup)
const CaloTopology * ecalTopology_
void setERight(float e)
Definition: Photon.h:253
float seedCrysIPhiOrIY() const
IsolationLabels isolationValueLabels_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
void setMaxDRDEta(float m)
Definition: Photon.h:267
std::vector< edm::EDGetTokenT< edm::ValueMap< IsoDeposit > > > isoDepositTokens_
void embedGenParticle()
Definition: PATObject.h:694
pat::helper::EfficiencyLoader efficiencyLoader_
void newEvent(const edm::Event &event, const edm::EventSetup &setup)
To be called for each new event, reads in the EventSetup object.
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:231
void setETop(float e)
Definition: Photon.h:247
int j
Definition: DBlmapReader.cc:9
float maxSubClusDRDPhi() const
void setSeedEnergy(float e)
Definition: Photon.h:238
void setSubClusDPhi1(float s)
Definition: Photon.h:279
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::vector< NameTag > photIDSrcs_
bool isValid() const
Definition: HandleBase.h:75
void setSubClusDEta1(float s)
Definition: Photon.h:286
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:295
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:678
ParameterDescriptionNode * ifValue(ParameterDescription< T > const &switchParameter, std::auto_ptr< ParameterDescriptionCases< T > > cases)
void setCryPhi(float c)
Definition: Photon.h:293
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
void setHasPixelSeed(bool flag)
Definition: Photon.h:234
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:288
void setMaxDR(float m)
Definition: Photon.h:263
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:56
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:274
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:249
std::vector< std::pair< pat::IsolationKeys, float > > IsolationValuePairs
Definition: MultiIsolator.h:16
void setMaxDRDPhi(float m)
Definition: Photon.h:265
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:290
size_type size() const
float eRight() const
void setSubClusRawE1(float s)
Definition: Photon.h:272
PATPhotonProducer(const edm::ParameterSet &iConfig)
void setSubClusRawE3(float s)
Definition: Photon.h:276
volatile std::atomic< bool > shutdown_flag false
edm::EDGetTokenT< EcalRecHitCollection > reducedBarrelRecHitCollectionToken_
std::vector< edm::EDGetTokenT< edm::ValueMap< double > > > isolationValueTokens_
edm::InputTag reducedBarrelRecHitCollection_
void setHcalPFClusterIso(float hcalPFClus)
Definition: Photon.h:131
void setE3x3(float e)
Definition: Photon.h:245
float eBottom() const
edm::EDGetTokenT< reco::ConversionCollection > hConversionsToken_
void setSep(float s)
Definition: Photon.h:260
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_
void setEcalPFClusterIso(float ecalPFClus)
Definition: Photon.h:130