CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
PFECALSuperClusterProducer Class Reference
Inheritance diagram for PFECALSuperClusterProducer:
edm::stream::EDProducer< edm::GlobalCache< reco::SCProducerCache > >

Public Member Functions

void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) override
 
 PFECALSuperClusterProducer (const edm::ParameterSet &, const reco::SCProducerCache *gcache)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~PFECALSuperClusterProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< reco::SCProducerCache > >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
static void globalEndJob (const reco::SCProducerCache *)
 
static std::unique_ptr< reco::SCProducerCacheinitializeGlobalCache (const edm::ParameterSet &config)
 

Private Attributes

PFECALSuperClusterAlgo::clustering_type _theclusteringtype
 
PFECALSuperClusterAlgo::energy_weight _theenergyweight
 
bool isOOTCollection_
 
std::string PFBasicClusterCollectionBarrel_
 
std::string PFBasicClusterCollectionEndcap_
 
std::string PFBasicClusterCollectionPreshower_
 
std::string PFClusterAssociationEBEE_
 
std::string PFClusterAssociationES_
 
std::string PFSuperClusterCollectionBarrel_
 
std::string PFSuperClusterCollectionEndcap_
 
std::string PFSuperClusterCollectionEndcapWithPreshower_
 
PFECALSuperClusterAlgo superClusterAlgo_
 clustering algorithm More...
 
std::shared_ptr< PFEnergyCalibrationthePFEnergyCalibration_
 
bool verbose_
 verbose ? More...
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< reco::SCProducerCache > >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 48 of file PFECALSuperClusterProducer.cc.

Constructor & Destructor Documentation

◆ PFECALSuperClusterProducer()

PFECALSuperClusterProducer::PFECALSuperClusterProducer ( const edm::ParameterSet iConfig,
const reco::SCProducerCache gcache 
)
explicit

Definition at line 107 of file PFECALSuperClusterProducer.cc.

References _theclusteringtype, _theenergyweight, HLT_2022v14_cff::doSatelliteClusterMerge, HLT_2022v14_cff::dropUnseedable, Exception, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), isOOTCollection_, PFECALSuperClusterAlgo::kBOX, PFECALSuperClusterAlgo::kCalibratedNoPS, PFECALSuperClusterAlgo::kCalibratedTotal, PFECALSuperClusterAlgo::kDeepSC, PFECALSuperClusterAlgo::kMustache, PFECALSuperClusterAlgo::kRaw, PFBasicClusterCollectionBarrel_, PFBasicClusterCollectionEndcap_, PFBasicClusterCollectionPreshower_, PFClusterAssociationEBEE_, PFClusterAssociationES_, PFSuperClusterCollectionBarrel_, PFSuperClusterCollectionEndcap_, PFSuperClusterCollectionEndcapWithPreshower_, HLT_2022v14_cff::satelliteClusterSeedThreshold, HLT_2022v14_cff::satelliteMajorityFraction, HLT_2022v14_cff::seedThresholdIsET, PFECALSuperClusterAlgo::setClusteringType(), PFECALSuperClusterAlgo::setCrackCorrections(), PFECALSuperClusterAlgo::setDropUnseedable(), PFECALSuperClusterAlgo::setEnergyWeighting(), PFECALSuperClusterAlgo::setEtawidthSuperClusterBarrel(), PFECALSuperClusterAlgo::setEtawidthSuperClusterEndcap(), PFECALSuperClusterAlgo::setIsOOTCollection(), PFECALSuperClusterAlgo::setMajorityFraction(), PFECALSuperClusterAlgo::setPFClusterCalibration(), PFECALSuperClusterAlgo::setPhiwidthSuperClusterBarrel(), PFECALSuperClusterAlgo::setPhiwidthSuperClusterEndcap(), PFECALSuperClusterAlgo::setSatelliteMerging(), PFECALSuperClusterAlgo::setSatelliteThreshold(), PFECALSuperClusterAlgo::setThreshPFClusterBarrel(), PFECALSuperClusterAlgo::setThreshPFClusterEndcap(), PFECALSuperClusterAlgo::setThreshPFClusterSeedBarrel(), PFECALSuperClusterAlgo::setThreshPFClusterSeedEndcap(), PFECALSuperClusterAlgo::setThreshSuperClusterEt(), PFECALSuperClusterAlgo::setTokens(), PFECALSuperClusterAlgo::setUseDynamicDPhi(), PFECALSuperClusterAlgo::setUseETForSeeding(), PFECALSuperClusterAlgo::setUseRegression(), PFECALSuperClusterAlgo::setVerbosityLevel(), AlCaHLTBitMon_QueryRunRegistry::string, superClusterAlgo_, thePFEnergyCalibration_, and verbose_.

109  : superClusterAlgo_(gcache) {
110  verbose_ = iConfig.getUntrackedParameter<bool>("verbose", false);
111 
112  superClusterAlgo_.setUseRegression(iConfig.getParameter<bool>("useRegression"));
113 
114  isOOTCollection_ = iConfig.getParameter<bool>("isOOTCollection");
116 
117  std::string _typename = iConfig.getParameter<std::string>("ClusteringType");
118  if (_typename == ClusterType__BOX) {
120  } else if (_typename == ClusterType__Mustache) {
122  } else if (_typename == ClusterType__DeepSC) {
124  } else {
125  throw cms::Exception("InvalidClusteringType") << "You have not chosen a valid clustering type,"
126  << " please choose from \"Box\" or \"Mustache\" or \"DeepSC\"!";
127  }
128 
129  std::string _weightname = iConfig.getParameter<std::string>("EnergyWeight");
130  if (_weightname == EnergyWeight__Raw) {
132  } else if (_weightname == EnergyWeight__CalibratedNoPS) {
134  } else if (_weightname == EnergyWeight__CalibratedTotal) {
136  } else {
137  throw cms::Exception("InvalidClusteringType") << "You have not chosen a valid energy weighting scheme,"
138  << " please choose from \"Raw\", \"CalibratedNoPS\", or"
139  << " \"CalibratedTotal\"!";
140  }
141 
142  // parameters for clustering
143  bool seedThresholdIsET = iConfig.getParameter<bool>("seedThresholdIsET");
144 
145  bool useDynamicDPhi = iConfig.getParameter<bool>("useDynamicDPhiWindow");
146 
147  double threshPFClusterSeedBarrel = iConfig.getParameter<double>("thresh_PFClusterSeedBarrel");
148  double threshPFClusterBarrel = iConfig.getParameter<double>("thresh_PFClusterBarrel");
149 
150  double threshPFClusterSeedEndcap = iConfig.getParameter<double>("thresh_PFClusterSeedEndcap");
151  double threshPFClusterEndcap = iConfig.getParameter<double>("thresh_PFClusterEndcap");
152 
153  double phiwidthSuperClusterBarrel = iConfig.getParameter<double>("phiwidth_SuperClusterBarrel");
154  double etawidthSuperClusterBarrel = iConfig.getParameter<double>("etawidth_SuperClusterBarrel");
155 
156  double phiwidthSuperClusterEndcap = iConfig.getParameter<double>("phiwidth_SuperClusterEndcap");
157  double etawidthSuperClusterEndcap = iConfig.getParameter<double>("etawidth_SuperClusterEndcap");
158 
159  double doSatelliteClusterMerge = iConfig.getParameter<bool>("doSatelliteClusterMerge");
160  double satelliteClusterSeedThreshold = iConfig.getParameter<double>("satelliteClusterSeedThreshold");
161  double satelliteMajorityFraction = iConfig.getParameter<double>("satelliteMajorityFraction");
162  bool dropUnseedable = iConfig.getParameter<bool>("dropUnseedable");
163 
165  superClusterAlgo_.setUseDynamicDPhi(useDynamicDPhi);
166  // clusteringType and useDynamicDPhi need to be defined before setting the tokens in order to esConsume only the necessary records
167  superClusterAlgo_.setTokens(iConfig, consumesCollector());
168 
172 
173  superClusterAlgo_.setThreshSuperClusterEt(iConfig.getParameter<double>("thresh_SCEt"));
174 
175  superClusterAlgo_.setThreshPFClusterSeedBarrel(threshPFClusterSeedBarrel);
176  superClusterAlgo_.setThreshPFClusterBarrel(threshPFClusterBarrel);
177 
178  superClusterAlgo_.setThreshPFClusterSeedEndcap(threshPFClusterSeedEndcap);
179  superClusterAlgo_.setThreshPFClusterEndcap(threshPFClusterEndcap);
180 
181  superClusterAlgo_.setPhiwidthSuperClusterBarrel(phiwidthSuperClusterBarrel);
182  superClusterAlgo_.setEtawidthSuperClusterBarrel(etawidthSuperClusterBarrel);
183 
184  superClusterAlgo_.setPhiwidthSuperClusterEndcap(phiwidthSuperClusterEndcap);
185  superClusterAlgo_.setEtawidthSuperClusterEndcap(etawidthSuperClusterEndcap);
186 
191 
192  //Load the ECAL energy calibration
193  thePFEnergyCalibration_ = std::make_shared<PFEnergyCalibration>();
195 
196  bool applyCrackCorrections_ = iConfig.getParameter<bool>("applyCrackCorrections");
197  superClusterAlgo_.setCrackCorrections(applyCrackCorrections_);
198 
199  PFBasicClusterCollectionBarrel_ = iConfig.getParameter<string>("PFBasicClusterCollectionBarrel");
200  PFSuperClusterCollectionBarrel_ = iConfig.getParameter<string>("PFSuperClusterCollectionBarrel");
201 
202  PFBasicClusterCollectionEndcap_ = iConfig.getParameter<string>("PFBasicClusterCollectionEndcap");
203  PFSuperClusterCollectionEndcap_ = iConfig.getParameter<string>("PFSuperClusterCollectionEndcap");
204 
205  PFBasicClusterCollectionPreshower_ = iConfig.getParameter<string>("PFBasicClusterCollectionPreshower");
207  iConfig.getParameter<string>("PFSuperClusterCollectionEndcapWithPreshower");
208 
209  PFClusterAssociationEBEE_ = "PFClusterAssociationEBEE";
210  PFClusterAssociationES_ = "PFClusterAssociationES";
211 
212  produces<reco::SuperClusterCollection>(PFSuperClusterCollectionBarrel_);
213  produces<reco::SuperClusterCollection>(PFSuperClusterCollectionEndcapWithPreshower_);
214  produces<reco::CaloClusterCollection>(PFBasicClusterCollectionBarrel_);
215  produces<reco::CaloClusterCollection>(PFBasicClusterCollectionEndcap_);
216  produces<reco::CaloClusterCollection>(PFBasicClusterCollectionPreshower_);
217  produces<edm::ValueMap<reco::CaloClusterPtr>>(PFClusterAssociationEBEE_);
218  produces<edm::ValueMap<reco::CaloClusterPtr>>(PFClusterAssociationES_);
219 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void setMajorityFraction(const double f)
void setSatelliteMerging(const bool doit)
void setThreshPFClusterSeedEndcap(double thresh)
PFECALSuperClusterAlgo::clustering_type _theclusteringtype
void setCrackCorrections(bool applyCrackCorrections)
void setThreshPFClusterBarrel(double thresh)
void setThreshSuperClusterEt(double thresh)
std::shared_ptr< PFEnergyCalibration > thePFEnergyCalibration_
void setEtawidthSuperClusterBarrel(double etawidth)
void setClusteringType(clustering_type thetype)
T getUntrackedParameter(std::string const &, T const &) const
void setEtawidthSuperClusterEndcap(double etawidth)
void setPhiwidthSuperClusterBarrel(double phiwidth)
void setVerbosityLevel(bool verbose)
void setThreshPFClusterEndcap(double thresh)
void setTokens(const edm::ParameterSet &, edm::ConsumesCollector &&)
void setUseETForSeeding(bool useET)
PFECALSuperClusterAlgo superClusterAlgo_
clustering algorithm
void setEnergyWeighting(energy_weight thetype)
void setThreshPFClusterSeedBarrel(double thresh)
PFECALSuperClusterAlgo::energy_weight _theenergyweight
void setUseDynamicDPhi(bool useit)
void setDropUnseedable(const bool d)
void setPhiwidthSuperClusterEndcap(double phiwidth)
void setUseRegression(bool useRegression)
void setSatelliteThreshold(const double t)
void setPFClusterCalibration(const std::shared_ptr< PFEnergyCalibration > &)
void setIsOOTCollection(bool isOOTCollection)

◆ ~PFECALSuperClusterProducer()

PFECALSuperClusterProducer::~PFECALSuperClusterProducer ( )
override

Definition at line 221 of file PFECALSuperClusterProducer.cc.

221 {}

Member Function Documentation

◆ beginLuminosityBlock()

void PFECALSuperClusterProducer::beginLuminosityBlock ( const edm::LuminosityBlock iL,
const edm::EventSetup iE 
)
override

Definition at line 223 of file PFECALSuperClusterProducer.cc.

References superClusterAlgo_, and PFECALSuperClusterAlgo::update().

223  {
225 }
void update(const edm::EventSetup &)
PFECALSuperClusterAlgo superClusterAlgo_
clustering algorithm

◆ fillDescriptions()

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

Definition at line 352 of file PFECALSuperClusterProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, HLT_2022v14_cff::InputTag, SCEnergyCorrectorSemiParm::makePSetDescription(), or, AlCaHLTBitMon_QueryRunRegistry::string, and parallelization::uint.

352  {
354  desc.add<std::string>("PFSuperClusterCollectionEndcap", "particleFlowSuperClusterECALEndcap");
355  desc.add<bool>("doSatelliteClusterMerge", false);
356  desc.add<double>("thresh_PFClusterBarrel", 0.0);
357  desc.add<std::string>("PFBasicClusterCollectionBarrel", "particleFlowBasicClusterECALBarrel");
358  desc.add<bool>("useRegression", true);
359  desc.add<double>("satelliteMajorityFraction", 0.5);
360  desc.add<double>("thresh_PFClusterEndcap", 0.0);
361  desc.add<edm::InputTag>("ESAssociation", edm::InputTag("particleFlowClusterECAL"));
362  desc.add<std::string>("PFBasicClusterCollectionPreshower", "particleFlowBasicClusterECALPreshower");
363  desc.addUntracked<bool>("verbose", false);
364  desc.add<double>("thresh_SCEt", 4.0);
365  desc.add<double>("etawidth_SuperClusterEndcap", 0.04);
366  desc.add<double>("phiwidth_SuperClusterEndcap", 0.6);
367  desc.add<bool>("useDynamicDPhiWindow", true);
368  desc.add<std::string>("PFSuperClusterCollectionBarrel", "particleFlowSuperClusterECALBarrel");
370  desc.add<bool>("applyCrackCorrections", false);
371  desc.add<double>("satelliteClusterSeedThreshold", 50.0);
372  desc.add<double>("etawidth_SuperClusterBarrel", 0.04);
373  desc.add<std::string>("PFBasicClusterCollectionEndcap", "particleFlowBasicClusterECALEndcap");
374  desc.add<edm::InputTag>("PFClusters", edm::InputTag("particleFlowClusterECAL"));
375  desc.add<double>("thresh_PFClusterSeedBarrel", 1.0);
376  desc.add<std::string>("EnergyWeight", "Raw");
377  desc.add<edm::InputTag>("BeamSpot", edm::InputTag("offlineBeamSpot"));
378  desc.add<double>("thresh_PFClusterSeedEndcap", 1.0);
379  desc.add<double>("phiwidth_SuperClusterBarrel", 0.6);
380  desc.add<double>("thresh_PFClusterES", 0.0);
381  desc.add<bool>("seedThresholdIsET", true);
382  desc.add<bool>("isOOTCollection", false);
383  desc.add<edm::InputTag>("barrelRecHits", edm::InputTag("ecalRecHit", "EcalRecHitsEB"));
384  desc.add<edm::InputTag>("endcapRecHits", edm::InputTag("ecalRecHit", "EcalRecHitsEE"));
385  desc.add<std::string>("PFSuperClusterCollectionEndcapWithPreshower",
386  "particleFlowSuperClusterECALEndcapWithPreshower");
387  desc.add<bool>("dropUnseedable", false);
388 
389  edm::ParameterSetDescription deepSCParams;
390  deepSCParams.add<std::string>("modelFile", "");
391  deepSCParams.add<std::string>("configFileClusterFeatures", "");
392  deepSCParams.add<std::string>("configFileWindowFeatures", "");
393  deepSCParams.add<std::string>("configFileHitsFeatures", "");
394  deepSCParams.add<uint>("nClusterFeatures", 12);
395  deepSCParams.add<uint>("nWindowFeatures", 18);
396  deepSCParams.add<uint>("nHitsFeatures", 4);
397  deepSCParams.add<uint>("maxNClusters", 40);
398  deepSCParams.add<uint>("maxNRechits", 40);
399  deepSCParams.add<uint>("batchSize", 64);
400  deepSCParams.add<std::string>("collectionStrategy", "Cascade");
401 
402  EmptyGroupDescription emptyGroup;
403 
404  // Add DeepSC parameters only to the specific ClusteringType
406  edm::ParameterDescription<std::string>("ClusteringType", ClusterType__Mustache, true),
407  ClusterType__Mustache >> emptyGroup or ClusterType__BOX >> emptyGroup or
408  ClusterType__DeepSC >>
409  edm::ParameterDescription<edm::ParameterSetDescription>("deepSuperClusterConfig", deepSCParams, true));
410  desc.addNode(switchNode);
411 
412  descriptions.add("particleFlowSuperClusterECALMustache", desc);
413 }
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::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static edm::ParameterSetDescription makePSetDescription()
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ globalEndJob()

static void PFECALSuperClusterProducer::globalEndJob ( const reco::SCProducerCache )
inlinestatic

Definition at line 60 of file PFECALSuperClusterProducer.cc.

60 {};

◆ initializeGlobalCache()

static std::unique_ptr<reco::SCProducerCache> PFECALSuperClusterProducer::initializeGlobalCache ( const edm::ParameterSet config)
inlinestatic

Definition at line 56 of file PFECALSuperClusterProducer.cc.

References submitPVResolutionJobs::config.

56  {
57  return std::make_unique<reco::SCProducerCache>(config);
58  }
config
parse the configuration file

◆ produce()

void PFECALSuperClusterProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 227 of file PFECALSuperClusterProducer.cc.

References bsc_activity_cfg::clusters, TauDecayModes::dec, Exception, edm::helper::Filler< Map >::fill(), PFECALSuperClusterAlgo::getEBOutputSCCollection(), PFECALSuperClusterAlgo::getEEOutputSCCollection(), iEvent, edm::helper::Filler< Map >::insert(), PFECALSuperClusterAlgo::loadAndSortPFClusters(), eostools::move(), PFBasicClusterCollectionBarrel_, PFBasicClusterCollectionEndcap_, PFBasicClusterCollectionPreshower_, PFClusterAssociationEBEE_, PFClusterAssociationES_, PFSuperClusterCollectionBarrel_, PFSuperClusterCollectionEndcapWithPreshower_, edm::PtrVector< T >::push_back(), PFECALSuperClusterAlgo::run(), superClusterAlgo_, and PFECALSuperClusterAlgo::updateSCParams().

227  {
228  // update SC parameters
230  // do clustering
233 
234  //build collections of output CaloClusters from the used PFClusters
235  auto caloClustersEB = std::make_unique<reco::CaloClusterCollection>();
236  auto caloClustersEE = std::make_unique<reco::CaloClusterCollection>();
237  auto caloClustersES = std::make_unique<reco::CaloClusterCollection>();
238 
239  std::map<reco::CaloClusterPtr, unsigned int> pfClusterMapEB; //maps of pfclusters to caloclusters
240  std::map<reco::CaloClusterPtr, unsigned int> pfClusterMapEE;
241  std::map<reco::CaloClusterPtr, unsigned int> pfClusterMapES;
242 
243  //fill calocluster collections and maps
244  for (const auto& ebsc : *(superClusterAlgo_.getEBOutputSCCollection())) {
245  for (reco::CaloCluster_iterator pfclus = ebsc.clustersBegin(); pfclus != ebsc.clustersEnd(); ++pfclus) {
246  if (!pfClusterMapEB.count(*pfclus)) {
247  reco::CaloCluster caloclus(**pfclus);
248  caloClustersEB->push_back(caloclus);
249  pfClusterMapEB[*pfclus] = caloClustersEB->size() - 1;
250  } else {
251  throw cms::Exception("PFECALSuperClusterProducer::produce")
252  << "Found an EB pfcluster matched to more than one EB supercluster!" << std::dec << std::endl;
253  }
254  }
255  }
256  for (const auto& eesc : *(superClusterAlgo_.getEEOutputSCCollection())) {
257  for (reco::CaloCluster_iterator pfclus = eesc.clustersBegin(); pfclus != eesc.clustersEnd(); ++pfclus) {
258  if (!pfClusterMapEE.count(*pfclus)) {
259  reco::CaloCluster caloclus(**pfclus);
260  caloClustersEE->push_back(caloclus);
261  pfClusterMapEE[*pfclus] = caloClustersEE->size() - 1;
262  } else {
263  throw cms::Exception("PFECALSuperClusterProducer::produce")
264  << "Found an EE pfcluster matched to more than one EE supercluster!" << std::dec << std::endl;
265  }
266  }
267  for (reco::CaloCluster_iterator pfclus = eesc.preshowerClustersBegin(); pfclus != eesc.preshowerClustersEnd();
268  ++pfclus) {
269  if (!pfClusterMapES.count(*pfclus)) {
270  reco::CaloCluster caloclus(**pfclus);
271  caloClustersES->push_back(caloclus);
272  pfClusterMapES[*pfclus] = caloClustersES->size() - 1;
273  } else {
274  throw cms::Exception("PFECALSuperClusterProducer::produce")
275  << "Found an ES pfcluster matched to more than one EE supercluster!" << std::dec << std::endl;
276  }
277  }
278  }
279 
280  //create ValueMaps from output CaloClusters back to original PFClusters
281  auto pfClusterAssociationEBEE = std::make_unique<edm::ValueMap<reco::CaloClusterPtr>>();
282  auto pfClusterAssociationES = std::make_unique<edm::ValueMap<reco::CaloClusterPtr>>();
283 
284  //vectors to fill ValueMaps
285  std::vector<reco::CaloClusterPtr> clusptrsEB(caloClustersEB->size());
286  std::vector<reco::CaloClusterPtr> clusptrsEE(caloClustersEE->size());
287  std::vector<reco::CaloClusterPtr> clusptrsES(caloClustersES->size());
288 
289  //put calocluster output collections in event and get orphan handles to create ptrs
290  const edm::OrphanHandle<reco::CaloClusterCollection>& caloClusHandleEB =
291  iEvent.put(std::move(caloClustersEB), PFBasicClusterCollectionBarrel_);
292  const edm::OrphanHandle<reco::CaloClusterCollection>& caloClusHandleEE =
293  iEvent.put(std::move(caloClustersEE), PFBasicClusterCollectionEndcap_);
294  const edm::OrphanHandle<reco::CaloClusterCollection>& caloClusHandleES =
296 
297  //relink superclusters to output caloclusters and fill vectors for ValueMaps
298  for (auto& ebsc : *(superClusterAlgo_.getEBOutputSCCollection())) {
299  reco::CaloClusterPtr seedptr(caloClusHandleEB, pfClusterMapEB[ebsc.seed()]);
300  ebsc.setSeed(seedptr);
301 
303  for (reco::CaloCluster_iterator pfclus = ebsc.clustersBegin(); pfclus != ebsc.clustersEnd(); ++pfclus) {
304  int caloclusidx = pfClusterMapEB[*pfclus];
305  reco::CaloClusterPtr clusptr(caloClusHandleEB, caloclusidx);
306  clusters.push_back(clusptr);
307  clusptrsEB[caloclusidx] = *pfclus;
308  }
309  ebsc.setClusters(clusters);
310  }
311  for (auto& eesc : *(superClusterAlgo_.getEEOutputSCCollection())) {
312  reco::CaloClusterPtr seedptr(caloClusHandleEE, pfClusterMapEE[eesc.seed()]);
313  eesc.setSeed(seedptr);
314 
316  for (reco::CaloCluster_iterator pfclus = eesc.clustersBegin(); pfclus != eesc.clustersEnd(); ++pfclus) {
317  int caloclusidx = pfClusterMapEE[*pfclus];
318  reco::CaloClusterPtr clusptr(caloClusHandleEE, caloclusidx);
319  clusters.push_back(clusptr);
320  clusptrsEE[caloclusidx] = *pfclus;
321  }
322  eesc.setClusters(clusters);
323 
324  reco::CaloClusterPtrVector psclusters;
325  for (reco::CaloCluster_iterator pfclus = eesc.preshowerClustersBegin(); pfclus != eesc.preshowerClustersEnd();
326  ++pfclus) {
327  int caloclusidx = pfClusterMapES[*pfclus];
328  reco::CaloClusterPtr clusptr(caloClusHandleES, caloclusidx);
329  psclusters.push_back(clusptr);
330  clusptrsES[caloclusidx] = *pfclus;
331  }
332  eesc.setPreshowerClusters(psclusters);
333  }
334 
335  //fill association maps from output CaloClusters back to original PFClusters
336  edm::ValueMap<reco::CaloClusterPtr>::Filler fillerEBEE(*pfClusterAssociationEBEE);
337  fillerEBEE.insert(caloClusHandleEB, clusptrsEB.begin(), clusptrsEB.end());
338  fillerEBEE.insert(caloClusHandleEE, clusptrsEE.begin(), clusptrsEE.end());
339  fillerEBEE.fill();
340 
341  edm::ValueMap<reco::CaloClusterPtr>::Filler fillerES(*pfClusterAssociationES);
342  fillerES.insert(caloClusHandleES, clusptrsES.begin(), clusptrsES.end());
343  fillerES.fill();
344 
345  //store in the event
346  iEvent.put(std::move(pfClusterAssociationEBEE), PFClusterAssociationEBEE_);
347  iEvent.put(std::move(pfClusterAssociationES), PFClusterAssociationES_);
350 }
std::unique_ptr< reco::SuperClusterCollection > & getEEOutputSCCollection()
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:149
void loadAndSortPFClusters(const edm::Event &evt)
int iEvent
Definition: GenABIO.cc:224
PFECALSuperClusterAlgo superClusterAlgo_
clustering algorithm
std::unique_ptr< reco::SuperClusterCollection > & getEBOutputSCCollection()
void updateSCParams(const edm::EventSetup &)
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ _theclusteringtype

PFECALSuperClusterAlgo::clustering_type PFECALSuperClusterProducer::_theclusteringtype
private

Definition at line 69 of file PFECALSuperClusterProducer.cc.

Referenced by PFECALSuperClusterProducer().

◆ _theenergyweight

PFECALSuperClusterAlgo::energy_weight PFECALSuperClusterProducer::_theenergyweight
private

Definition at line 70 of file PFECALSuperClusterProducer.cc.

Referenced by PFECALSuperClusterProducer().

◆ isOOTCollection_

bool PFECALSuperClusterProducer::isOOTCollection_
private

Definition at line 87 of file PFECALSuperClusterProducer.cc.

Referenced by PFECALSuperClusterProducer().

◆ PFBasicClusterCollectionBarrel_

std::string PFECALSuperClusterProducer::PFBasicClusterCollectionBarrel_
private

Definition at line 77 of file PFECALSuperClusterProducer.cc.

Referenced by PFECALSuperClusterProducer(), and produce().

◆ PFBasicClusterCollectionEndcap_

std::string PFECALSuperClusterProducer::PFBasicClusterCollectionEndcap_
private

Definition at line 79 of file PFECALSuperClusterProducer.cc.

Referenced by PFECALSuperClusterProducer(), and produce().

◆ PFBasicClusterCollectionPreshower_

std::string PFECALSuperClusterProducer::PFBasicClusterCollectionPreshower_
private

Definition at line 81 of file PFECALSuperClusterProducer.cc.

Referenced by PFECALSuperClusterProducer(), and produce().

◆ PFClusterAssociationEBEE_

std::string PFECALSuperClusterProducer::PFClusterAssociationEBEE_
private

Definition at line 83 of file PFECALSuperClusterProducer.cc.

Referenced by PFECALSuperClusterProducer(), and produce().

◆ PFClusterAssociationES_

std::string PFECALSuperClusterProducer::PFClusterAssociationES_
private

Definition at line 84 of file PFECALSuperClusterProducer.cc.

Referenced by PFECALSuperClusterProducer(), and produce().

◆ PFSuperClusterCollectionBarrel_

std::string PFECALSuperClusterProducer::PFSuperClusterCollectionBarrel_
private

Definition at line 78 of file PFECALSuperClusterProducer.cc.

Referenced by PFECALSuperClusterProducer(), and produce().

◆ PFSuperClusterCollectionEndcap_

std::string PFECALSuperClusterProducer::PFSuperClusterCollectionEndcap_
private

Definition at line 80 of file PFECALSuperClusterProducer.cc.

Referenced by PFECALSuperClusterProducer().

◆ PFSuperClusterCollectionEndcapWithPreshower_

std::string PFECALSuperClusterProducer::PFSuperClusterCollectionEndcapWithPreshower_
private

Definition at line 82 of file PFECALSuperClusterProducer.cc.

Referenced by PFECALSuperClusterProducer(), and produce().

◆ superClusterAlgo_

PFECALSuperClusterAlgo PFECALSuperClusterProducer::superClusterAlgo_
private

clustering algorithm

Definition at line 68 of file PFECALSuperClusterProducer.cc.

Referenced by beginLuminosityBlock(), PFECALSuperClusterProducer(), and produce().

◆ thePFEnergyCalibration_

std::shared_ptr<PFEnergyCalibration> PFECALSuperClusterProducer::thePFEnergyCalibration_
private

Definition at line 72 of file PFECALSuperClusterProducer.cc.

Referenced by PFECALSuperClusterProducer().

◆ verbose_

bool PFECALSuperClusterProducer::verbose_
private

verbose ?

Definition at line 75 of file PFECALSuperClusterProducer.cc.

Referenced by PFECALSuperClusterProducer().