CMS 3D CMS Logo

PATPhotonProducer.h
Go to the documentation of this file.
1 //
2 //
3 
4 #ifndef PhysicsTools_PatAlgos_PATPhotonProducer_h
5 #define PhysicsTools_PatAlgos_PATPhotonProducer_h
6 
21 
26 
28 
33 
37 
40 
43 
47 
49 
50 namespace pat {
51 
53  public:
54  explicit PATPhotonProducer(const edm::ParameterSet& iConfig);
55  ~PATPhotonProducer() override;
56 
57  void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) override;
58 
59  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
60 
61  private:
62  // configurables
67 
73 
78 
80 
85 
88  std::vector<edm::EDGetTokenT<edm::Association<reco::GenParticleCollection> > > genMatchTokens_;
89 
90  // tools
92 
93  typedef std::vector<edm::Handle<edm::ValueMap<IsoDeposit> > > IsoDepositMaps;
94  typedef std::vector<edm::Handle<edm::ValueMap<double> > > IsolationValueMaps;
95  typedef std::pair<pat::IsolationKeys, edm::InputTag> IsolationLabel;
96  typedef std::vector<IsolationLabel> IsolationLabels;
97 
99  pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_; // better here than recreate at each event
100  std::vector<edm::EDGetTokenT<edm::ValueMap<IsoDeposit> > > isoDepositTokens_;
101  std::vector<edm::EDGetTokenT<edm::ValueMap<double> > > isolationValueTokens_;
102 
105 
108  template <typename T>
109  void readIsolationLabels(const edm::ParameterSet& iConfig,
110  const char* psetName,
113 
116 
119 
121  typedef std::pair<std::string, edm::InputTag> NameTag;
122  std::vector<NameTag> photIDSrcs_;
123  std::vector<edm::EDGetTokenT<edm::ValueMap<Bool_t> > > photIDTokens_;
124 
126  //PUPPI isolation tokens
131 
134 
136  };
137 
138 } // namespace pat
139 
140 template <typename T>
142  const char* psetName,
145  labels.clear();
146 
147  if (iConfig.exists(psetName)) {
148  edm::ParameterSet depconf = iConfig.getParameter<edm::ParameterSet>(psetName);
149 
150  if (depconf.exists("tracker"))
151  labels.push_back(std::make_pair(pat::TrackIso, depconf.getParameter<edm::InputTag>("tracker")));
152  if (depconf.exists("ecal"))
153  labels.push_back(std::make_pair(pat::EcalIso, depconf.getParameter<edm::InputTag>("ecal")));
154  if (depconf.exists("hcal"))
155  labels.push_back(std::make_pair(pat::HcalIso, depconf.getParameter<edm::InputTag>("hcal")));
156  if (depconf.exists("pfAllParticles")) {
157  labels.push_back(std::make_pair(pat::PfAllParticleIso, depconf.getParameter<edm::InputTag>("pfAllParticles")));
158  }
159  if (depconf.exists("pfChargedHadrons")) {
160  labels.push_back(
161  std::make_pair(pat::PfChargedHadronIso, depconf.getParameter<edm::InputTag>("pfChargedHadrons")));
162  }
163  if (depconf.exists("pfChargedAll")) {
164  labels.push_back(std::make_pair(pat::PfChargedAllIso, depconf.getParameter<edm::InputTag>("pfChargedAll")));
165  }
166  if (depconf.exists("pfPUChargedHadrons")) {
167  labels.push_back(
168  std::make_pair(pat::PfPUChargedHadronIso, depconf.getParameter<edm::InputTag>("pfPUChargedHadrons")));
169  }
170  if (depconf.exists("pfNeutralHadrons")) {
171  labels.push_back(
172  std::make_pair(pat::PfNeutralHadronIso, depconf.getParameter<edm::InputTag>("pfNeutralHadrons")));
173  }
174  if (depconf.exists("pfPhotons")) {
175  labels.push_back(std::make_pair(pat::PfGammaIso, depconf.getParameter<edm::InputTag>("pfPhotons")));
176  }
177  if (depconf.exists("user")) {
178  std::vector<edm::InputTag> userdeps = depconf.getParameter<std::vector<edm::InputTag> >("user");
179  std::vector<edm::InputTag>::const_iterator it = userdeps.begin(), ed = userdeps.end();
181  for (; it != ed; ++it, ++key) {
182  labels.push_back(std::make_pair(pat::IsolationKeys(key), *it));
183  }
184  }
185 
186  tokens = edm::vector_transform(
187  labels, [this](IsolationLabel const& label) { return consumes<edm::ValueMap<T> >(label.second); });
188  }
189  tokens = edm::vector_transform(
190  labels, [this](IsolationLabel const& label) { return consumes<edm::ValueMap<T> >(label.second); });
191 }
192 
193 #endif
SummaryClient_cfi.labels
labels
Definition: SummaryClient_cfi.py:61
pat::PATPhotonProducer::electronToken_
edm::EDGetTokenT< reco::GsfElectronCollection > electronToken_
Definition: PATPhotonProducer.h:64
pat::PATPhotonProducer::isolator_
pat::helper::MultiIsolator isolator_
Definition: PATPhotonProducer.h:98
pat::PATPhotonProducer::saveRegressionData_
bool saveRegressionData_
Definition: PATPhotonProducer.h:135
pat::PATUserDataHelper< pat::Photon >
pat::EcalIso
Definition: Isolation.h:11
pat::PATPhotonProducer::useUserData_
bool useUserData_
Definition: PATPhotonProducer.h:125
pat::PATPhotonProducer::embedBasicClusters_
bool embedBasicClusters_
Definition: PATPhotonProducer.h:70
ESHandle.h
pat::PATPhotonProducer::reducedEndcapRecHitCollectionToken_
edm::EDGetTokenT< EcalRecHitCollection > reducedEndcapRecHitCollectionToken_
Definition: PATPhotonProducer.h:77
pat::helper::EfficiencyLoader
Definition: EfficiencyLoader.h:16
edm::EDGetTokenT
Definition: EDGetToken.h:33
pat::PATPhotonProducer::IsolationLabels
std::vector< IsolationLabel > IsolationLabels
Definition: PATPhotonProducer.h:96
Photon.h
pat::PATPhotonProducer::photonToken_
edm::EDGetTokenT< edm::View< reco::Photon > > photonToken_
Definition: PATPhotonProducer.h:63
EDProducer.h
pat::PfAllParticleIso
Definition: Isolation.h:13
pat::PATPhotonProducer::embedPreshowerClusters_
bool embedPreshowerClusters_
Definition: PATPhotonProducer.h:71
EcalClusterLazyTools.h
pat::PATPhotonProducer::ecalPFClusterIsoT_
edm::EDGetTokenT< edm::ValueMap< float > > ecalPFClusterIsoT_
Definition: PATPhotonProducer.h:83
pat::helper::MultiIsolator::IsolationValuePairs
std::vector< std::pair< pat::IsolationKeys, float > > IsolationValuePairs
Definition: MultiIsolator.h:17
CaloTopology
Definition: CaloTopology.h:19
MultiIsolator.h
EfficiencyLoader.h
pat::PATPhotonProducer::isolationValueLabels_
IsolationLabels isolationValueLabels_
Definition: PATPhotonProducer.h:104
EcalRecHitCollections.h
pat::PATPhotonProducer::IsoDepositMaps
std::vector< edm::Handle< edm::ValueMap< IsoDeposit > > > IsoDepositMaps
Definition: PATPhotonProducer.h:93
pat::PATPhotonProducer::userDataHelper_
pat::PATUserDataHelper< pat::Photon > userDataHelper_
Definition: PATPhotonProducer.h:130
pat::PATPhotonProducer::embedSeedCluster_
bool embedSeedCluster_
Definition: PATPhotonProducer.h:69
GreaterByEt
Definition: EtComparator.h:23
pat::PATPhotonProducer::efficiencyLoader_
pat::helper::EfficiencyLoader efficiencyLoader_
Definition: PATPhotonProducer.h:115
CaloGeometry
Definition: CaloGeometry.h:21
pat::PfChargedHadronIso
Definition: Isolation.h:14
pat::PATPhotonProducer::resolutionLoader_
pat::helper::KinResolutionsLoader resolutionLoader_
Definition: PATPhotonProducer.h:118
pat::PATPhotonProducer::isoDepositLabels_
IsolationLabels isoDepositLabels_
Definition: PATPhotonProducer.h:103
pat::PATPhotonProducer::addPFClusterIso_
bool addPFClusterIso_
Definition: PATPhotonProducer.h:81
pat::PATPhotonProducer::embedRecHits_
bool embedRecHits_
Definition: PATPhotonProducer.h:72
pat::helper::KinResolutionsLoader
Definition: KinResolutionsLoader.h:18
pat::PATPhotonProducer::~PATPhotonProducer
~PATPhotonProducer() override
Definition: PATPhotonProducer.cc:144
pat::PATPhotonProducer::isoDepositTokens_
std::vector< edm::EDGetTokenT< edm::ValueMap< IsoDeposit > > > isoDepositTokens_
Definition: PATPhotonProducer.h:100
KinResolutionsLoader.h
pat::PATPhotonProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: PATPhotonProducer.cc:480
EcalRecHit.h
EcalClusterLazyToolsBase::ESGetTokens
Definition: EcalClusterLazyTools.h:55
CaloGeometryRecord.h
pat::PATPhotonProducer::IsolationLabel
std::pair< pat::IsolationKeys, edm::InputTag > IsolationLabel
Definition: PATPhotonProducer.h:95
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
edm::vector_transform
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
pat::PATPhotonProducer::isolatorTmpStorage_
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
Definition: PATPhotonProducer.h:99
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:681
EtComparator.h
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
pat::PfGammaIso
Definition: Isolation.h:16
pat::PATPhotonProducer::produce
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
Definition: PATPhotonProducer.cc:146
UserData.h
pat::PATPhotonProducer::beamLineToken_
edm::EDGetTokenT< reco::BeamSpot > beamLineToken_
Definition: PATPhotonProducer.h:66
pat::UserBaseIso
Definition: Isolation.h:22
CaloTopologyRecord.h
pat::TrackIso
Definition: Isolation.h:10
iEvent
int iEvent
Definition: GenABIO.cc:224
pat::PATPhotonProducer::addGenMatch_
bool addGenMatch_
Definition: PATPhotonProducer.h:86
pat::PATPhotonProducer::isolationValueTokens_
std::vector< edm::EDGetTokenT< edm::ValueMap< double > > > isolationValueTokens_
Definition: PATPhotonProducer.h:101
pat::PATPhotonProducer::PATPhotonProducer
PATPhotonProducer(const edm::ParameterSet &iConfig)
Definition: PATPhotonProducer.cc:31
pat::HcalIso
Definition: Isolation.h:12
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
pat::PATPhotonProducer::ecalTopology_
const CaloTopology * ecalTopology_
Definition: PATPhotonProducer.h:132
pat::PfNeutralHadronIso
Definition: Isolation.h:15
edm::stream::EDProducer
Definition: EDProducer.h:38
pat::PATPhotonProducer::IsolationValueMaps
std::vector< edm::Handle< edm::ValueMap< double > > > IsolationValueMaps
Definition: PATPhotonProducer.h:94
pat::PfChargedAllIso
Definition: Isolation.h:25
edm::EventSetup
Definition: EventSetup.h:58
pat::PATPhotonProducer::eTComparator_
GreaterByEt< Photon > eTComparator_
Definition: PATPhotonProducer.h:91
pat::PATPhotonProducer::addEfficiencies_
bool addEfficiencies_
Definition: PATPhotonProducer.h:114
pat
Definition: HeavyIon.h:7
pat::PfPUChargedHadronIso
Definition: Isolation.h:24
pat::PATPhotonProducer
Produces the pat::Photon.
Definition: PATPhotonProducer.h:52
InputTag.h
CaloTopology.h
pat::PATPhotonProducer::photIDTokens_
std::vector< edm::EDGetTokenT< edm::ValueMap< Bool_t > > > photIDTokens_
Definition: PATPhotonProducer.h:123
pat::PATPhotonProducer::photIDSrcs_
std::vector< NameTag > photIDSrcs_
Definition: PATPhotonProducer.h:122
pat::PATPhotonProducer::genMatchTokens_
std::vector< edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > > genMatchTokens_
Definition: PATPhotonProducer.h:88
CaloSubdetectorTopology.h
pat::helper::MultiIsolator
Definition: MultiIsolator.h:15
pat::PATPhotonProducer::embedSuperCluster_
bool embedSuperCluster_
Definition: PATPhotonProducer.h:68
pat::IsolationKeys
IsolationKeys
Enum defining isolation keys.
Definition: Isolation.h:9
pat::PATPhotonProducer::ecalGeometry_
const CaloGeometry * ecalGeometry_
Definition: PATPhotonProducer.h:133
pat::PATPhotonProducer::hcalPFClusterIsoT_
edm::EDGetTokenT< edm::ValueMap< float > > hcalPFClusterIsoT_
Definition: PATPhotonProducer.h:84
pat::PATPhotonProducer::hConversionsToken_
edm::EDGetTokenT< reco::ConversionCollection > hConversionsToken_
Definition: PATPhotonProducer.h:65
pat::PATPhotonProducer::readIsolationLabels
void readIsolationLabels(const edm::ParameterSet &iConfig, const char *psetName, IsolationLabels &labels, std::vector< edm::EDGetTokenT< edm::ValueMap< T > > > &tokens)
Definition: PATPhotonProducer.h:141
edm::ValueMap
Definition: ValueMap.h:107
CaloGeometry.h
pat::PATPhotonProducer::PUPPIIsolation_photons_
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_photons_
Definition: PATPhotonProducer.h:129
pat::PATPhotonProducer::addPhotonID_
bool addPhotonID_
Definition: PATPhotonProducer.h:120
pat::PATPhotonProducer::addPuppiIsolation_
bool addPuppiIsolation_
Definition: PATPhotonProducer.h:82
pat::PATPhotonProducer::reducedBarrelRecHitCollectionToken_
edm::EDGetTokenT< EcalRecHitCollection > reducedBarrelRecHitCollectionToken_
Definition: PATPhotonProducer.h:75
PATUserDataHelper.h
EventSetup.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
Electron.h
pat::PATPhotonProducer::PUPPIIsolation_neutral_hadrons_
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_neutral_hadrons_
Definition: PATPhotonProducer.h:128
ConsumesCollector.h
ParameterSet.h
pat::PATPhotonProducer::PUPPIIsolation_charged_hadrons_
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_charged_hadrons_
Definition: PATPhotonProducer.h:127
pat::PATPhotonProducer::reducedBarrelRecHitCollection_
edm::InputTag reducedBarrelRecHitCollection_
Definition: PATPhotonProducer.h:74
pat::PATPhotonProducer::addResolutions_
bool addResolutions_
Definition: PATPhotonProducer.h:117
edm::Event
Definition: Event.h:73
pat::PATPhotonProducer::ecalClusterToolsESGetTokens_
const EcalClusterLazyTools::ESGetTokens ecalClusterToolsESGetTokens_
Definition: PATPhotonProducer.h:79
crabWrapper.key
key
Definition: crabWrapper.py:19
pat::PATPhotonProducer::embedGenMatch_
bool embedGenMatch_
Definition: PATPhotonProducer.h:87
edm::InputTag
Definition: InputTag.h:15
label
const char * label
Definition: PFTauDecayModeTools.cc:11
pat::PATPhotonProducer::NameTag
std::pair< std::string, edm::InputTag > NameTag
Definition: PATPhotonProducer.h:121
pat::PATPhotonProducer::reducedEndcapRecHitCollection_
edm::InputTag reducedEndcapRecHitCollection_
Definition: PATPhotonProducer.h:76