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 
21 
22 #include "TVector2.h"
24 
25 
26 #include <memory>
27 
28 using namespace pat;
29 
31  isolator_(iConfig.exists("userIsolation") ? iConfig.getParameter<edm::ParameterSet>("userIsolation") : edm::ParameterSet(), consumesCollector(), false) ,
32  useUserData_(iConfig.exists("userData"))
33 {
34  // initialize the configurables
35  photonToken_ = consumes<edm::View<reco::Photon> >(iConfig.getParameter<edm::InputTag>("photonSource"));
36  electronToken_ = consumes<reco::GsfElectronCollection>(edm::InputTag("gedGsfElectrons"));
37  hConversionsToken_ = consumes<reco::ConversionCollection>(edm::InputTag("allConversions"));
38  beamLineToken_ = consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("beamLineSrc"));
39  embedSuperCluster_ = iConfig.getParameter<bool>("embedSuperCluster");
40  embedSeedCluster_ = iConfig.getParameter<bool>( "embedSeedCluster" );
41  embedBasicClusters_ = iConfig.getParameter<bool>( "embedBasicClusters" );
42  embedPreshowerClusters_ = iConfig.getParameter<bool>( "embedPreshowerClusters" );
43  embedRecHits_ = iConfig.getParameter<bool>( "embedRecHits" );
44  reducedBarrelRecHitCollection_ = iConfig.getParameter<edm::InputTag>("reducedBarrelRecHitCollection");
45  reducedBarrelRecHitCollectionToken_ = mayConsume<EcalRecHitCollection>(reducedBarrelRecHitCollection_);
46  reducedEndcapRecHitCollection_ = iConfig.getParameter<edm::InputTag>("reducedEndcapRecHitCollection");
47  reducedEndcapRecHitCollectionToken_ = mayConsume<EcalRecHitCollection>(reducedEndcapRecHitCollection_);
48  // MC matching configurables
49  addGenMatch_ = iConfig.getParameter<bool>( "addGenMatch" );
50  if (addGenMatch_) {
51  embedGenMatch_ = iConfig.getParameter<bool>( "embedGenMatch" );
52  if (iConfig.existsAs<edm::InputTag>("genParticleMatch")) {
54  }
55  else {
56  genMatchTokens_ = edm::vector_transform(iConfig.getParameter<std::vector<edm::InputTag> >( "genParticleMatch" ), [this](edm::InputTag const & tag){return consumes<edm::Association<reco::GenParticleCollection> >(tag);});
57  }
58  }
59  // Efficiency configurables
60  addEfficiencies_ = iConfig.getParameter<bool>("addEfficiencies");
61  if (addEfficiencies_) {
62  efficiencyLoader_ = pat::helper::EfficiencyLoader(iConfig.getParameter<edm::ParameterSet>("efficiencies"), consumesCollector());
63  }
64  // photon ID configurables
65  addPhotonID_ = iConfig.getParameter<bool>( "addPhotonID" );
66  if (addPhotonID_) {
67  // it might be a single photon ID
68  if (iConfig.existsAs<edm::InputTag>("photonIDSource")) {
69  photIDSrcs_.push_back(NameTag("", iConfig.getParameter<edm::InputTag>("photonIDSource")));
70  }
71  // or there might be many of them
72  if (iConfig.existsAs<edm::ParameterSet>("photonIDSources")) {
73  // please don't configure me twice
74  if (!photIDSrcs_.empty()){
75  throw cms::Exception("Configuration") << "PATPhotonProducer: you can't specify both 'photonIDSource' and 'photonIDSources'\n";
76  }
77  // read the different photon ID names
78  edm::ParameterSet idps = iConfig.getParameter<edm::ParameterSet>("photonIDSources");
79  std::vector<std::string> names = idps.getParameterNamesForType<edm::InputTag>();
80  for (std::vector<std::string>::const_iterator it = names.begin(), ed = names.end(); it != ed; ++it) {
81  photIDSrcs_.push_back(NameTag(*it, idps.getParameter<edm::InputTag>(*it)));
82  }
83  }
84  // but in any case at least once
85  if (photIDSrcs_.empty()) throw cms::Exception("Configuration") <<
86  "PATPhotonProducer: id addPhotonID is true, you must specify either:\n" <<
87  "\tInputTag photonIDSource = <someTag>\n" << "or\n" <<
88  "\tPSet photonIDSources = { \n" <<
89  "\t\tInputTag <someName> = <someTag> // as many as you want \n " <<
90  "\t}\n";
91  }
92  photIDTokens_ = edm::vector_transform(photIDSrcs_, [this](NameTag const & tag){return mayConsume<edm::ValueMap<Bool_t> >(tag.second);});
93  // Resolution configurables
94  addResolutions_ = iConfig.getParameter<bool>("addResolutions");
95  if (addResolutions_) {
96  resolutionLoader_ = pat::helper::KinResolutionsLoader(iConfig.getParameter<edm::ParameterSet>("resolutions"));
97  }
98  // Check to see if the user wants to add user data
99  if ( useUserData_ ) {
100  userDataHelper_ = PATUserDataHelper<Photon>(iConfig.getParameter<edm::ParameterSet>("userData"), consumesCollector());
101  }
102  // produces vector of photons
103  produces<std::vector<Photon> >();
104 
105  // read isoDeposit labels, for direct embedding
106  readIsolationLabels(iConfig, "isoDeposits", isoDepositLabels_, isoDepositTokens_);
107  // read isolation value labels, for direct embedding
108  readIsolationLabels(iConfig, "isolationValues", isolationValueLabels_, isolationValueTokens_);
109 
110 }
111 
112 PATPhotonProducer::~PATPhotonProducer() {
113 }
114 
116 {
117  // switch off embedding (in unschedules mode)
118  if (iEvent.isRealData()){
119  addGenMatch_ = false;
120  embedGenMatch_ = false;
121  }
122 
123  edm::ESHandle<CaloTopology> theCaloTopology;
124  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
125  ecalTopology_ = & (*theCaloTopology);
126 
127  edm::ESHandle<CaloGeometry> theCaloGeometry;
128  iSetup.get<CaloGeometryRecord>().get(theCaloGeometry);
129  ecalGeometry_ = & (*theCaloGeometry);
130 
131  // Get the vector of Photon's from the event
133  iEvent.getByToken(photonToken_, photons);
134 
135  // for conversion veto selection
137  iEvent.getByToken(hConversionsToken_, hConversions);
138 
139  // Get the collection of electrons from the event
141  iEvent.getByToken(electronToken_, hElectrons);
142 
143  // Get the beamspot
144  edm::Handle<reco::BeamSpot> beamSpotHandle;
145  iEvent.getByToken(beamLineToken_, beamSpotHandle);
146 
148 
149  // prepare the MC matching
150  std::vector<edm::Handle<edm::Association<reco::GenParticleCollection> > >genMatches(genMatchTokens_.size());
151  if (addGenMatch_) {
152  for (size_t j = 0, nd = genMatchTokens_.size(); j < nd; ++j) {
153  iEvent.getByToken(genMatchTokens_[j], genMatches[j]);
154  }
155  }
156 
157  if (isolator_.enabled()) isolator_.beginEvent(iEvent,iSetup);
158 
160  if (resolutionLoader_.enabled()) resolutionLoader_.newEvent(iEvent, iSetup);
161 
162  IsoDepositMaps deposits(isoDepositTokens_.size());
163  for (size_t j = 0, nd = isoDepositTokens_.size(); j < nd; ++j) {
164  iEvent.getByToken(isoDepositTokens_[j], deposits[j]);
165  }
166 
167  IsolationValueMaps isolationValues(isolationValueTokens_.size());
168  for (size_t j = 0; j<isolationValueTokens_.size(); ++j) {
169  iEvent.getByToken(isolationValueTokens_[j], isolationValues[j]);
170  }
171 
172 
173  // prepare ID extraction
174  std::vector<edm::Handle<edm::ValueMap<Bool_t> > > idhandles;
175  std::vector<pat::Photon::IdPair> ids;
176  if (addPhotonID_) {
177  idhandles.resize(photIDSrcs_.size());
178  ids.resize(photIDSrcs_.size());
179  for (size_t i = 0; i < photIDSrcs_.size(); ++i) {
180  iEvent.getByToken(photIDTokens_[i], idhandles[i]);
181  ids[i].first = photIDSrcs_[i].first;
182  }
183  }
184 
185  // loop over photons
186  std::vector<Photon> * PATPhotons = new std::vector<Photon>();
187  for (edm::View<reco::Photon>::const_iterator itPhoton = photons->begin(); itPhoton != photons->end(); itPhoton++) {
188  // construct the Photon from the ref -> save ref to original object
189  unsigned int idx = itPhoton - photons->begin();
190  edm::RefToBase<reco::Photon> photonRef = photons->refAt(idx);
191  edm::Ptr<reco::Photon> photonPtr = photons->ptrAt(idx);
192  Photon aPhoton(photonRef);
193  if (embedSuperCluster_) aPhoton.embedSuperCluster();
194  if (embedSeedCluster_) aPhoton.embedSeedCluster();
197 
198  std::vector<DetId> selectedCells;
199  bool barrel = itPhoton->isEB();
200  //loop over sub clusters
201  if (embedBasicClusters_) {
202  for (reco::CaloCluster_iterator clusIt = itPhoton->superCluster()->clustersBegin(); clusIt!=itPhoton->superCluster()->clustersEnd(); ++clusIt) {
203  //get seed (max energy xtal)
204  DetId seed = lazyTools.getMaximum(**clusIt).first;
205  //get all xtals in 5x5 window around the seed
206  std::vector<DetId> dets5x5 = (barrel) ? ecalTopology_->getSubdetectorTopology(DetId::Ecal,EcalBarrel)->getWindow(seed,5,5):
208  selectedCells.insert(selectedCells.end(), dets5x5.begin(), dets5x5.end());
209 
210  //get all xtals belonging to cluster
211  for (const std::pair<DetId, float> &hit : (*clusIt)->hitsAndFractions()) {
212  selectedCells.push_back(hit.first);
213  }
214  }
215  }
216 
217  //remove duplicates
218  std::sort(selectedCells.begin(),selectedCells.end());
219  std::unique(selectedCells.begin(),selectedCells.end());
220 
221  // Retrieve the corresponding RecHits
222 
224  float cryPhi, cryEta, thetatilt, phitilt;
225  int ieta, iphi;
226 
227  //what is the difference from itPhoton->isEB()? (TJ)
228  switch( photonRef->superCluster()->seed()->hitsAndFractions().at(0).first.subdetId() ) {
229  case EcalBarrel:
230  {
232  ecl_.localCoordsEB( *photonRef->superCluster()->seed(), *ecalGeometry_, cryEta, cryPhi, ieta, iphi, thetatilt, phitilt);
233  }
234  break;
235  case EcalEndcap:
236  {
238  }
239  break;
240  default:
241  edm::LogError("PFECALSuperClusterProducer::calculateRegressedEnergy") << "Supercluster seed is either EB nor EE!" << std::endl;
242  }
243 
244 
245  EcalRecHitCollection selectedRecHits;
246  const EcalRecHitCollection *recHits = rechitsH.product();
247 
248  unsigned nSelectedCells = selectedCells.size();
249  for (unsigned icell = 0 ; icell < nSelectedCells ; ++icell) {
250  EcalRecHitCollection::const_iterator it = recHits->find( selectedCells[icell] );
251  if ( it != recHits->end() ) {
252  selectedRecHits.push_back(*it);
253  }
254  }
255  selectedRecHits.sort();
256  if (embedRecHits_) aPhoton.embedRecHits(& selectedRecHits);
257 
258  // store the match to the generated final state muons
259  if (addGenMatch_) {
260  for(size_t i = 0, n = genMatches.size(); i < n; ++i) {
261  reco::GenParticleRef genPhoton = (*genMatches[i])[photonRef];
262  aPhoton.addGenParticleRef(genPhoton);
263  }
264  if (embedGenMatch_) aPhoton.embedGenParticle();
265  }
266 
267  if (efficiencyLoader_.enabled()) {
268  efficiencyLoader_.setEfficiencies( aPhoton, photonRef );
269  }
270 
271  if (resolutionLoader_.enabled()) {
273  }
274 
275  // here comes the extra functionality
276  if (isolator_.enabled()) {
277  isolator_.fill(*photons, idx, isolatorTmpStorage_);
278  typedef pat::helper::MultiIsolator::IsolationValuePairs IsolationValuePairs;
279  // better to loop backwards, so the vector is resized less times
280  for (IsolationValuePairs::const_reverse_iterator it = isolatorTmpStorage_.rbegin(), ed = isolatorTmpStorage_.rend(); it != ed; ++it) {
281  aPhoton.setIsolation(it->first, it->second);
282  }
283  }
284 
285  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
286  aPhoton.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[photonRef]);
287  }
288 
289  for (size_t j = 0; j<isolationValues.size(); ++j) {
290  aPhoton.setIsolation(isolationValueLabels_[j].first,(*isolationValues[j])[photonRef]);
291  }
292 
293  // add photon ID info
294  if (addPhotonID_) {
295  for (size_t i = 0; i < photIDSrcs_.size(); ++i) {
296  ids[i].second = (*idhandles[i])[photonRef];
297  }
298  aPhoton.setPhotonIDs(ids);
299  }
300 
301  if ( useUserData_ ) {
302  userDataHelper_.add( aPhoton, iEvent, iSetup );
303  }
304 
305 
306  // set conversion veto selection
307  bool passelectronveto = false;
308  if( hConversions.isValid()){
309  // this is recommended method
310  passelectronveto = !ConversionTools::hasMatchedPromptElectron(photonRef->superCluster(), hElectrons, hConversions, beamSpotHandle->position());
311  }
312  aPhoton.setPassElectronVeto( passelectronveto );
313 
314 
315  // set electron veto using pixel seed (not recommended but many analysis groups are still using since it is powerful method to remove electrons)
316  aPhoton.setHasPixelSeed( photonRef->hasPixelSeed() );
317 
318  // set seed energy
319  aPhoton.setSeedEnergy( photonRef->superCluster()->seed()->energy() );
320 
321  // prepare input variables for regression energy correction
322  float maxDR=999., maxDRDPhi=999., maxDRDEta=999., maxDRRawEnergy=0.;
323  float subClusRawE[3], subClusDPhi[3], subClusDEta[3];
324  memset(subClusRawE,0,3*sizeof(float));
325  memset(subClusDPhi,0,3*sizeof(float));
326  memset(subClusDEta,0,3*sizeof(float));
327  size_t iclus=0;
328  for( auto clus = photonRef->superCluster()->clustersBegin()+1; clus != photonRef->superCluster()->clustersEnd(); ++clus ) {
329  const float this_deta = (*clus)->eta() - photonRef->superCluster()->seed()->eta();
330  const float this_dphi = TVector2::Phi_mpi_pi((*clus)->phi() - photonRef->superCluster()->seed()->phi());
331  const float this_dr = std::hypot(this_deta,this_dphi);
332  if(this_dr > maxDR || maxDR == 999.0f) {
333  maxDR = this_dr;
334  maxDRDEta = this_deta;
335  maxDRDPhi = this_dphi;
336  maxDRRawEnergy = (*clus)->energy();
337  }
338  if( iclus++ < 3 ) {
339  subClusRawE[iclus] = (*clus)->energy();
340  subClusDEta[iclus] = this_deta;
341  subClusDPhi[iclus] = this_dphi;
342  }
343  }
344 
345 
346  const float eMax = EcalClusterTools::eMax( *photonRef->superCluster()->seed(), &*rechitsH );
347  const float e2nd = EcalClusterTools::e2nd( *photonRef->superCluster()->seed(), &*rechitsH );
348  const float e3x3 = EcalClusterTools::e3x3( *photonRef->superCluster()->seed(), &*rechitsH, ecalTopology_ );
349  const float eTop = EcalClusterTools::eTop( *photonRef->superCluster()->seed(), &*rechitsH, ecalTopology_ );
350  const float eBottom = EcalClusterTools::eBottom( *photonRef->superCluster()->seed(), &*rechitsH, ecalTopology_ );
351  const float eLeft = EcalClusterTools::eLeft( *photonRef->superCluster()->seed(), &*rechitsH, ecalTopology_ );
352  const float eRight = EcalClusterTools::eRight( *photonRef->superCluster()->seed(), &*rechitsH, ecalTopology_ );
353  std::vector<float> vCov = EcalClusterTools::localCovariances( *photonRef->superCluster()->seed(), &*rechitsH, ecalTopology_ );
354  const float see = (isnan(vCov[0]) ? 0. : sqrt(vCov[0]));
355  const float spp = (isnan(vCov[2]) ? 0. : sqrt(vCov[2]));
356  float sep = vCov[1];
357 
358  // set input variables for regression energy correction
359  aPhoton.setEMax( eMax );
360  aPhoton.setE2nd( e2nd );
361  aPhoton.setE3x3( e3x3 );
362  aPhoton.setETop( eTop );
363  aPhoton.setEBottom( eBottom );
364  aPhoton.setELeft( eLeft );
365  aPhoton.setERight( eRight );
366  aPhoton.setSee( see );
367  aPhoton.setSpp( spp );
368  aPhoton.setSep( sep );
369 
370  aPhoton.setMaxDR( maxDR );
371  aPhoton.setMaxDRDPhi( maxDRDPhi );
372  aPhoton.setMaxDRDEta( maxDRDEta );
373  aPhoton.setMaxDRRawEnergy( maxDRRawEnergy );
374  aPhoton.setSubClusRawE1( subClusRawE[0] );
375  aPhoton.setSubClusRawE2( subClusRawE[1] );
376  aPhoton.setSubClusRawE3( subClusRawE[2] );
377  aPhoton.setSubClusDPhi1( subClusDPhi[0] );
378  aPhoton.setSubClusDPhi2( subClusDPhi[1] );
379  aPhoton.setSubClusDPhi3( subClusDPhi[2] );
380  aPhoton.setSubClusDEta1( subClusDEta[0] );
381  aPhoton.setSubClusDEta2( subClusDEta[1] );
382  aPhoton.setSubClusDEta3( subClusDEta[2] );
383 
384  aPhoton.setCryPhi( cryPhi );
385  aPhoton.setCryEta( cryEta );
386  aPhoton.setIEta( ieta );
387  aPhoton.setIPhi( iphi );
388 
389 
390  // add the Photon to the vector of Photons
391  PATPhotons->push_back(aPhoton);
392  }
393 
394  // sort Photons in ET
395  std::sort(PATPhotons->begin(), PATPhotons->end(), eTComparator_);
396 
397  // put genEvt object in Event
398  std::auto_ptr<std::vector<Photon> > myPhotons(PATPhotons);
399  iEvent.put(myPhotons);
401 
402 }
403 
404 // ParameterSet description for module
406 {
408  iDesc.setComment("PAT photon producer module");
409 
410  // input source
411  iDesc.add<edm::InputTag>("photonSource", edm::InputTag("no default"))->setComment("input collection");
412  iDesc.add<edm::InputTag>("electronSource", edm::InputTag("no default"))->setComment("input collection");
413 
414  iDesc.add<edm::InputTag>("reducedBarrelRecHitCollection", edm::InputTag("reducedEcalRecHitsEB"));
415  iDesc.add<edm::InputTag>("reducedEndcapRecHitCollection", edm::InputTag("reducedEcalRecHitsEE"));
416 
417  iDesc.add<bool>("embedSuperCluster", true)->setComment("embed external super cluster");
418  iDesc.add<bool>("embedSeedCluster", true)->setComment("embed external seed cluster");
419  iDesc.add<bool>("embedBasicClusters", true)->setComment("embed external basic clusters");
420  iDesc.add<bool>("embedPreshowerClusters", true)->setComment("embed external preshower clusters");
421  iDesc.add<bool>("embedRecHits", true)->setComment("embed external RecHits");
422 
423  // MC matching configurables
424  iDesc.add<bool>("addGenMatch", true)->setComment("add MC matching");
425  iDesc.add<bool>("embedGenMatch", false)->setComment("embed MC matched MC information");
426  std::vector<edm::InputTag> emptySourceVector;
427  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("genParticleMatch", edm::InputTag(), true) xor
428  edm::ParameterDescription<std::vector<edm::InputTag> >("genParticleMatch", emptySourceVector, true)
429  )->setComment("input with MC match information");
430 
432 
433  // photon ID configurables
434  iDesc.add<bool>("addPhotonID",true)->setComment("add photon ID variables");
435  edm::ParameterSetDescription photonIDSourcesPSet;
436  photonIDSourcesPSet.setAllowAnything();
437  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("photonIDSource", edm::InputTag(), true) xor
438  edm::ParameterDescription<edm::ParameterSetDescription>("photonIDSources", photonIDSourcesPSet, true)
439  )->setComment("input with photon ID variables");
440 
441  // IsoDeposit configurables
442  edm::ParameterSetDescription isoDepositsPSet;
443  isoDepositsPSet.addOptional<edm::InputTag>("tracker");
444  isoDepositsPSet.addOptional<edm::InputTag>("ecal");
445  isoDepositsPSet.addOptional<edm::InputTag>("hcal");
446  isoDepositsPSet.addOptional<edm::InputTag>("pfAllParticles");
447  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedHadrons");
448  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedAll");
449  isoDepositsPSet.addOptional<edm::InputTag>("pfPUChargedHadrons");
450  isoDepositsPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
451  isoDepositsPSet.addOptional<edm::InputTag>("pfPhotons");
452  isoDepositsPSet.addOptional<std::vector<edm::InputTag> >("user");
453  iDesc.addOptional("isoDeposits", isoDepositsPSet);
454 
455  // isolation values configurables
456  edm::ParameterSetDescription isolationValuesPSet;
457  isolationValuesPSet.addOptional<edm::InputTag>("tracker");
458  isolationValuesPSet.addOptional<edm::InputTag>("ecal");
459  isolationValuesPSet.addOptional<edm::InputTag>("hcal");
460  isolationValuesPSet.addOptional<edm::InputTag>("pfAllParticles");
461  isolationValuesPSet.addOptional<edm::InputTag>("pfChargedHadrons");
462  isolationValuesPSet.addOptional<edm::InputTag>("pfChargedAll");
463  isolationValuesPSet.addOptional<edm::InputTag>("pfPUChargedHadrons");
464  isolationValuesPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
465  isolationValuesPSet.addOptional<edm::InputTag>("pfPhotons");
466  isolationValuesPSet.addOptional<std::vector<edm::InputTag> >("user");
467  iDesc.addOptional("isolationValues", isolationValuesPSet);
468 
469  // Efficiency configurables
470  edm::ParameterSetDescription efficienciesPSet;
471  efficienciesPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
472  iDesc.add("efficiencies", efficienciesPSet);
473  iDesc.add<bool>("addEfficiencies", false);
474 
475  // Check to see if the user wants to add user data
476  edm::ParameterSetDescription userDataPSet;
478  iDesc.addOptional("userData", userDataPSet);
479 
480  edm::ParameterSetDescription isolationPSet;
481  isolationPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
482  iDesc.add("userIsolation", isolationPSet);
483 
484  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("beamLineSrc", edm::InputTag(), true)
485  )->setComment("input with high level selection");
486 
487  descriptions.add("PATPhotonProducer", iDesc);
488 
489 }
490 
492 
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
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
Analysis-level Photon class.
Definition: Photon.h:47
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
void setIEta(float i)
Definition: Photon.h:294
pat::PATUserDataHelper< pat::Photon > userDataHelper_
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
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[]
void setE2nd(float e)
Definition: Photon.h:237
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
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_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void setMaxDRRawEnergy(float m)
Definition: Photon.h:263
edm::EDGetTokenT< reco::BeamSpot > beamLineToken_
void embedBasicClusters()
method to store the electron&#39;s basic clusters
Definition: Photon.cc:251
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
void push_back(T const &t)
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
Definition: Photon.cc:58
std::vector< edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > > genMatchTokens_
double Phi_mpi_pi(double x)
Definition: JetUtil.h:24
void embedSuperCluster()
method to store the photon&#39;s supercluster internally
Definition: Photon.cc:233
pat::helper::KinResolutionsLoader resolutionLoader_
GreaterByEt< Photon > eTComparator_
const CaloGeometry * ecalGeometry_
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
IsolationLabels isolationValueLabels_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
bool isnan(float x)
Definition: math.h:13
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_
T sqrt(T t)
Definition: SSEVec.h:48
void setPhotonIDs(const std::vector< IdPair > &ids)
Definition: Photon.h:110
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
void embedSeedCluster()
method to store the electron&#39;s seedcluster internally
Definition: Photon.cc:242
double f[11][100]
void embedPreshowerClusters()
method to store the electron&#39;s preshower clusters
Definition: Photon.cc:263
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_
void setCryEta(float c)
Definition: Photon.h:289
const_iterator end() const
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
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
void localCoordsEB(const reco::CaloCluster &bclus, const edm::EventSetup &es, float &etacry, float &phicry, int &ieta, int &iphi, float &thetatilt, float &phitilt) 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)
void setSubClusDEta3(float s)
Definition: Photon.h:284
size_type size() 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 embedRecHits(const EcalRecHitCollection *rechits)
method to store the RecHits internally - can be called from the PATElectronProducer ...
Definition: Photon.cc:275
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
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_