CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
PFECALSuperClusterProducer Class Reference

#include <PFECALSuperClusterProducer.h>

Inheritance diagram for PFECALSuperClusterProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) override
 
 PFECALSuperClusterProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
 ~PFECALSuperClusterProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

PFECALSuperClusterAlgo::clustering_type _theclusteringtype
 
PFECALSuperClusterAlgo::energy_weight _theenergyweight
 
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
< PFEnergyCalibration
thePFEnergyCalibration_
 
bool verbose_
 verbose ? More...
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Author
Nicolas Chanon Additional authors for Mustache: Y. Gershtein, R. Patel, L. Gray
Date
July 2012

Definition at line 43 of file PFECALSuperClusterProducer.h.

Constructor & Destructor Documentation

PFECALSuperClusterProducer::PFECALSuperClusterProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 46 of file PFECALSuperClusterProducer.cc.

References HLT_FULL_cff::doSatelliteClusterMerge, Exception, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), PFECALSuperClusterAlgo::kBOX, PFECALSuperClusterAlgo::kCalibratedNoPS, PFECALSuperClusterAlgo::kCalibratedTotal, PFECALSuperClusterAlgo::kMustache, PFECALSuperClusterAlgo::kRaw, HLT_FULL_cff::satelliteClusterSeedThreshold, HLT_FULL_cff::satelliteMajorityFraction, HLT_FULL_cff::seedThresholdIsET, and AlCaHLTBitMon_QueryRunRegistry::string.

47 {
48 
49  verbose_ =
50  iConfig.getUntrackedParameter<bool>("verbose",false);
51 
52  superClusterAlgo_.setUseRegression(iConfig.getParameter<bool>("useRegression"));
53 
55 
56  std::string _typename = iConfig.getParameter<std::string>("ClusteringType");
57  if( _typename == ClusterType__BOX ) {
59  } else if ( _typename == ClusterType__Mustache ) {
61  } else {
62  throw cms::Exception("InvalidClusteringType")
63  << "You have not chosen a valid clustering type,"
64  << " please choose from \"Box\" or \"Mustache\"!";
65  }
66 
67  std::string _weightname = iConfig.getParameter<std::string>("EnergyWeight");
68  if( _weightname == EnergyWeight__Raw ) {
70  } else if ( _weightname == EnergyWeight__CalibratedNoPS ) {
72  } else if ( _weightname == EnergyWeight__CalibratedTotal) {
74  } else {
75  throw cms::Exception("InvalidClusteringType")
76  << "You have not chosen a valid energy weighting scheme,"
77  << " please choose from \"Raw\", \"CalibratedNoPS\", or"
78  << " \"CalibratedTotal\"!";
79  }
80 
81 
82  // parameters for clustering
83  bool seedThresholdIsET = iConfig.getParameter<bool>("seedThresholdIsET");
84 
85  bool useDynamicDPhi = iConfig.getParameter<bool>("useDynamicDPhiWindow");
86 
87  double threshPFClusterSeedBarrel = iConfig.getParameter<double>("thresh_PFClusterSeedBarrel");
88  double threshPFClusterBarrel = iConfig.getParameter<double>("thresh_PFClusterBarrel");
89 
90  double threshPFClusterSeedEndcap = iConfig.getParameter<double>("thresh_PFClusterSeedEndcap");
91  double threshPFClusterEndcap = iConfig.getParameter<double>("thresh_PFClusterEndcap");
92 
93  double phiwidthSuperClusterBarrel = iConfig.getParameter<double>("phiwidth_SuperClusterBarrel");
94  double etawidthSuperClusterBarrel = iConfig.getParameter<double>("etawidth_SuperClusterBarrel");
95 
96  double phiwidthSuperClusterEndcap = iConfig.getParameter<double>("phiwidth_SuperClusterEndcap");
97  double etawidthSuperClusterEndcap = iConfig.getParameter<double>("etawidth_SuperClusterEndcap");
98 
99  double threshPFClusterES = iConfig.getParameter<double>("thresh_PFClusterES");
100 
101  //double threshPFClusterMustacheOutBarrel = iConfig.getParameter<double>("thresh_PFClusterMustacheOutBarrel");
102  //double threshPFClusterMustacheOutEndcap = iConfig.getParameter<double>("thresh_PFClusterMustacheOutEndcap");
103 
104  double doSatelliteClusterMerge =
105  iConfig.getParameter<bool>("doSatelliteClusterMerge");
107  iConfig.getParameter<double>("satelliteClusterSeedThreshold");
108  double satelliteMajorityFraction =
109  iConfig.getParameter<double>("satelliteMajorityFraction");
110 
114  superClusterAlgo_.setUseETForSeeding(seedThresholdIsET);
115  superClusterAlgo_.setUseDynamicDPhi(useDynamicDPhi);
116 
117  superClusterAlgo_.setThreshSuperClusterEt( iConfig.getParameter<double>("thresh_SCEt") );
118 
119  superClusterAlgo_.setThreshPFClusterSeedBarrel( threshPFClusterSeedBarrel );
120  superClusterAlgo_.setThreshPFClusterBarrel( threshPFClusterBarrel );
121 
122  superClusterAlgo_.setThreshPFClusterSeedEndcap( threshPFClusterSeedEndcap );
123  superClusterAlgo_.setThreshPFClusterEndcap( threshPFClusterEndcap );
124 
125  superClusterAlgo_.setPhiwidthSuperClusterBarrel( phiwidthSuperClusterBarrel );
126  superClusterAlgo_.setEtawidthSuperClusterBarrel( etawidthSuperClusterBarrel );
127 
128  superClusterAlgo_.setPhiwidthSuperClusterEndcap( phiwidthSuperClusterEndcap );
129  superClusterAlgo_.setEtawidthSuperClusterEndcap( etawidthSuperClusterEndcap );
130 
131  superClusterAlgo_.setThreshPFClusterES( threshPFClusterES );
132 
133  superClusterAlgo_.setSatelliteMerging( doSatelliteClusterMerge );
134  superClusterAlgo_.setSatelliteThreshold( satelliteClusterSeedThreshold );
135  superClusterAlgo_.setMajorityFraction( satelliteMajorityFraction );
136  //superClusterAlgo_.setThreshPFClusterMustacheOutBarrel( threshPFClusterMustacheOutBarrel );
137  //superClusterAlgo_.setThreshPFClusterMustacheOutEndcap( threshPFClusterMustacheOutEndcap );
138 
139  //Load the ECAL energy calibration
141  std::shared_ptr<PFEnergyCalibration>(new PFEnergyCalibration());
143  superClusterAlgo_.setUsePS(iConfig.getParameter<bool>("use_preshower"));
144 
145  bool applyCrackCorrections_ = iConfig.getParameter<bool>("applyCrackCorrections");
146  superClusterAlgo_.setCrackCorrections(applyCrackCorrections_);
147 
148  PFBasicClusterCollectionBarrel_ = iConfig.getParameter<string>("PFBasicClusterCollectionBarrel");
149  PFSuperClusterCollectionBarrel_ = iConfig.getParameter<string>("PFSuperClusterCollectionBarrel");
150 
151  PFBasicClusterCollectionEndcap_ = iConfig.getParameter<string>("PFBasicClusterCollectionEndcap");
152  PFSuperClusterCollectionEndcap_ = iConfig.getParameter<string>("PFSuperClusterCollectionEndcap");
153 
154  PFBasicClusterCollectionPreshower_ = iConfig.getParameter<string>("PFBasicClusterCollectionPreshower");
155  PFSuperClusterCollectionEndcapWithPreshower_ = iConfig.getParameter<string>("PFSuperClusterCollectionEndcapWithPreshower");
156 
157  PFClusterAssociationEBEE_ = "PFClusterAssociationEBEE";
158  PFClusterAssociationES_ = "PFClusterAssociationES";
159 
160  produces<reco::SuperClusterCollection>(PFSuperClusterCollectionBarrel_);
161  produces<reco::SuperClusterCollection>(PFSuperClusterCollectionEndcapWithPreshower_);
162  produces<reco::CaloClusterCollection>(PFBasicClusterCollectionBarrel_);
163  produces<reco::CaloClusterCollection>(PFBasicClusterCollectionEndcap_);
164  produces<reco::CaloClusterCollection>(PFBasicClusterCollectionPreshower_);
165  produces<edm::ValueMap<reco::CaloClusterPtr> >(PFClusterAssociationEBEE_);
166  produces<edm::ValueMap<reco::CaloClusterPtr> >(PFClusterAssociationES_);
167 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
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_
tuple satelliteMajorityFraction
void setEtawidthSuperClusterBarrel(double etawidth)
tuple doSatelliteClusterMerge
void setClusteringType(clustering_type thetype)
void setEtawidthSuperClusterEndcap(double etawidth)
void setPhiwidthSuperClusterBarrel(double phiwidth)
void setVerbosityLevel(bool verbose)
void setThreshPFClusterEndcap(double thresh)
void setTokens(const edm::ParameterSet &, edm::ConsumesCollector &&)
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
void setUseETForSeeding(bool useET)
PFECALSuperClusterAlgo superClusterAlgo_
clustering algorithm
void setEnergyWeighting(energy_weight thetype)
tuple seedThresholdIsET
void setThreshPFClusterSeedBarrel(double thresh)
PFECALSuperClusterAlgo::energy_weight _theenergyweight
void setUseDynamicDPhi(bool useit)
tuple satelliteClusterSeedThreshold
void setPhiwidthSuperClusterEndcap(double phiwidth)
void setThreshPFClusterES(double thresh)
void setUseRegression(bool useRegression)
void setSatelliteThreshold(const double t)
void setPFClusterCalibration(const std::shared_ptr< PFEnergyCalibration > &)
PFECALSuperClusterProducer::~PFECALSuperClusterProducer ( )

Definition at line 171 of file PFECALSuperClusterProducer.cc.

171 {}

Member Function Documentation

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

Reimplemented from edm::stream::EDProducerBase.

Definition at line 174 of file PFECALSuperClusterProducer.cc.

174  {
176 }
void update(const edm::EventSetup &)
PFECALSuperClusterAlgo superClusterAlgo_
clustering algorithm
void PFECALSuperClusterProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 307 of file PFECALSuperClusterProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), HLT_FULL_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

307  {
309  desc.add<std::string>("PFSuperClusterCollectionEndcap","particleFlowSuperClusterECALEndcap");
310  desc.add<bool>("doSatelliteClusterMerge",false);
311  desc.add<double>("thresh_PFClusterBarrel",0.0);
312  desc.add<std::string>("PFBasicClusterCollectionBarrel","particleFlowBasicClusterECALBarrel");
313  desc.add<bool>("useRegression",true);
314  desc.add<double>("satelliteMajorityFraction",0.5);
315  desc.add<double>("thresh_PFClusterEndcap",0.0);
316  desc.add<edm::InputTag>("ESAssociation",edm::InputTag("particleFlowClusterECAL"));
317  desc.add<std::string>("PFBasicClusterCollectionPreshower","particleFlowBasicClusterECALPreshower");
318  desc.add<bool>("use_preshower",true);
319  desc.addUntracked<bool>("verbose",false);
320  desc.add<double>("thresh_SCEt",4.0);
321  desc.add<double>("etawidth_SuperClusterEndcap",0.04);
322  desc.add<double>("phiwidth_SuperClusterEndcap",0.6);
323  desc.add<bool>("useDynamicDPhiWindow",true);
324  desc.add<std::string>("PFSuperClusterCollectionBarrel","particleFlowSuperClusterECALBarrel");
325  {
327  psd0.add<bool>("isHLT", false);
328  psd0.add<edm::InputTag>("ecalRecHitsEE",edm::InputTag("ecalRecHit","EcalRecHitsEE"));
329  psd0.add<edm::InputTag>("ecalRecHitsEB",edm::InputTag("ecalRecHit","EcalRecHitsEB"));
330  psd0.add<std::string>("regressionKeyEB","pfscecal_EBCorrection_offline_v1");
331  psd0.add<std::string>("regressionKeyEE","pfscecal_EECorrection_offline_v1");
332  psd0.add<std::string>("uncertaintyKeyEB","pfscecal_EBUncertainty_offline_v1");
333  psd0.add<std::string>("uncertaintyKeyEE","pfscecal_EEUncertainty_offline_v1");
334  psd0.add<edm::InputTag>("vertexCollection",edm::InputTag("offlinePrimaryVertices"));
335  psd0.add<double>("etRecHitThreshold", 1.);
336  desc.add<edm::ParameterSetDescription>("regressionConfig",psd0);
337  }
338  desc.add<bool>("applyCrackCorrections",false);
339  desc.add<double>("satelliteClusterSeedThreshold",50.0);
340  desc.add<double>("etawidth_SuperClusterBarrel",0.04);
341  desc.add<std::string>("PFBasicClusterCollectionEndcap","particleFlowBasicClusterECALEndcap");
342  desc.add<edm::InputTag>("PFClusters",edm::InputTag("particleFlowClusterECAL"));
343  desc.add<double>("thresh_PFClusterSeedBarrel",1.0);
344  desc.add<std::string>("ClusteringType","Mustache");
345  desc.add<std::string>("EnergyWeight","Raw");
346  desc.add<edm::InputTag>("BeamSpot",edm::InputTag("offlineBeamSpot"));
347  desc.add<double>("thresh_PFClusterSeedEndcap",1.0);
348  desc.add<double>("phiwidth_SuperClusterBarrel",0.6);
349  desc.add<double>("thresh_PFClusterES",0.0);
350  desc.add<bool>("seedThresholdIsET",true);
351  desc.add<std::string>("PFSuperClusterCollectionEndcapWithPreshower","particleFlowSuperClusterECALEndcapWithPreshower");
352  descriptions.add("particleFlowSuperClusterECALMustache",desc);
353 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void PFECALSuperClusterProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::stream::EDProducerBase.

Definition at line 179 of file PFECALSuperClusterProducer.cc.

References HLT_FULL_cff::clusters, TauDecayModes::dec, Exception, edm::helper::Filler< Map >::fill(), edm::helper::Filler< Map >::insert(), edm::PtrVector< T >::push_back(), and edm::Event::put().

180  {
181 
182  // do clustering
185 
186  //build collections of output CaloClusters from the used PFClusters
187  std::auto_ptr<reco::CaloClusterCollection> caloClustersEB(new reco::CaloClusterCollection);
188  std::auto_ptr<reco::CaloClusterCollection> caloClustersEE(new reco::CaloClusterCollection);
189  std::auto_ptr<reco::CaloClusterCollection> caloClustersES(new reco::CaloClusterCollection);
190 
191  std::map<reco::CaloClusterPtr, unsigned int> pfClusterMapEB; //maps of pfclusters to caloclusters
192  std::map<reco::CaloClusterPtr, unsigned int> pfClusterMapEE;
193  std::map<reco::CaloClusterPtr, unsigned int> pfClusterMapES;
194 
195  //fill calocluster collections and maps
196  for( const auto& ebsc : *(superClusterAlgo_.getEBOutputSCCollection()) ) {
197  for (reco::CaloCluster_iterator pfclus = ebsc.clustersBegin(); pfclus!=ebsc.clustersEnd(); ++pfclus) {
198  if (!pfClusterMapEB.count(*pfclus)) {
199  reco::CaloCluster caloclus(**pfclus);
200  caloClustersEB->push_back(caloclus);
201  pfClusterMapEB[*pfclus] = caloClustersEB->size() - 1;
202  }
203  else {
204  throw cms::Exception("PFECALSuperClusterProducer::produce")
205  << "Found an EB pfcluster matched to more than one EB supercluster!"
206  << std::dec << std::endl;
207  }
208  }
209  }
210  for( const auto& eesc : *(superClusterAlgo_.getEEOutputSCCollection()) ) {
211  for (reco::CaloCluster_iterator pfclus = eesc.clustersBegin(); pfclus!=eesc.clustersEnd(); ++pfclus) {
212  if (!pfClusterMapEE.count(*pfclus)) {
213  reco::CaloCluster caloclus(**pfclus);
214  caloClustersEE->push_back(caloclus);
215  pfClusterMapEE[*pfclus] = caloClustersEE->size() - 1;
216  }
217  else {
218  throw cms::Exception("PFECALSuperClusterProducer::produce")
219  << "Found an EE pfcluster matched to more than one EE supercluster!"
220  << std::dec << std::endl;
221  }
222  }
223  for (reco::CaloCluster_iterator pfclus = eesc.preshowerClustersBegin(); pfclus!=eesc.preshowerClustersEnd(); ++pfclus) {
224  if (!pfClusterMapES.count(*pfclus)) {
225  reco::CaloCluster caloclus(**pfclus);
226  caloClustersES->push_back(caloclus);
227  pfClusterMapES[*pfclus] = caloClustersES->size() - 1;
228  }
229  else {
230  throw cms::Exception("PFECALSuperClusterProducer::produce")
231  << "Found an ES pfcluster matched to more than one EE supercluster!"
232  << std::dec << std::endl;
233  }
234  }
235  }
236 
237  //create ValueMaps from output CaloClusters back to original PFClusters
238  std::auto_ptr<edm::ValueMap<reco::CaloClusterPtr> > pfClusterAssociationEBEE(new edm::ValueMap<reco::CaloClusterPtr>);
239  std::auto_ptr<edm::ValueMap<reco::CaloClusterPtr> > pfClusterAssociationES(new edm::ValueMap<reco::CaloClusterPtr>);
240 
241  //vectors to fill ValueMaps
242  std::vector<reco::CaloClusterPtr> clusptrsEB(caloClustersEB->size());
243  std::vector<reco::CaloClusterPtr> clusptrsEE(caloClustersEE->size());
244  std::vector<reco::CaloClusterPtr> clusptrsES(caloClustersES->size());
245 
246  //put calocluster output collections in event and get orphan handles to create ptrs
247  const edm::OrphanHandle<reco::CaloClusterCollection> &caloClusHandleEB = iEvent.put(caloClustersEB,PFBasicClusterCollectionBarrel_);
248  const edm::OrphanHandle<reco::CaloClusterCollection> &caloClusHandleEE = iEvent.put(caloClustersEE,PFBasicClusterCollectionEndcap_);
249  const edm::OrphanHandle<reco::CaloClusterCollection> &caloClusHandleES = iEvent.put(caloClustersES,PFBasicClusterCollectionPreshower_);
250 
251  //relink superclusters to output caloclusters and fill vectors for ValueMaps
252  for( auto& ebsc : *(superClusterAlgo_.getEBOutputSCCollection()) ) {
253  reco::CaloClusterPtr seedptr(caloClusHandleEB,pfClusterMapEB[ebsc.seed()]);
254  ebsc.setSeed(seedptr);
255 
257  for (reco::CaloCluster_iterator pfclus = ebsc.clustersBegin(); pfclus!=ebsc.clustersEnd(); ++pfclus) {
258  int caloclusidx = pfClusterMapEB[*pfclus];
259  reco::CaloClusterPtr clusptr(caloClusHandleEB,caloclusidx);
260  clusters.push_back(clusptr);
261  clusptrsEB[caloclusidx] = *pfclus;
262  }
263  ebsc.setClusters(clusters);
264  }
265  for( auto& eesc : *(superClusterAlgo_.getEEOutputSCCollection()) ) {
266  reco::CaloClusterPtr seedptr(caloClusHandleEE,pfClusterMapEE[eesc.seed()]);
267  eesc.setSeed(seedptr);
268 
270  for (reco::CaloCluster_iterator pfclus = eesc.clustersBegin(); pfclus!=eesc.clustersEnd(); ++pfclus) {
271  int caloclusidx = pfClusterMapEE[*pfclus];
272  reco::CaloClusterPtr clusptr(caloClusHandleEE,caloclusidx);
273  clusters.push_back(clusptr);
274  clusptrsEE[caloclusidx] = *pfclus;
275  }
276  eesc.setClusters(clusters);
277 
278  reco::CaloClusterPtrVector psclusters;
279  for (reco::CaloCluster_iterator pfclus = eesc.preshowerClustersBegin(); pfclus!=eesc.preshowerClustersEnd(); ++pfclus) {
280  int caloclusidx = pfClusterMapES[*pfclus];
281  reco::CaloClusterPtr clusptr(caloClusHandleES,caloclusidx);
282  psclusters.push_back(clusptr);
283  clusptrsES[caloclusidx] = *pfclus;
284  }
285  eesc.setPreshowerClusters(psclusters);
286  }
287 
288  //fill association maps from output CaloClusters back to original PFClusters
289  edm::ValueMap<reco::CaloClusterPtr>::Filler fillerEBEE(*pfClusterAssociationEBEE);
290  fillerEBEE.insert(caloClusHandleEB, clusptrsEB.begin(), clusptrsEB.end());
291  fillerEBEE.insert(caloClusHandleEE, clusptrsEE.begin(), clusptrsEE.end());
292  fillerEBEE.fill();
293 
294  edm::ValueMap<reco::CaloClusterPtr>::Filler fillerES(*pfClusterAssociationES);
295  fillerES.insert(caloClusHandleES, clusptrsES.begin(), clusptrsES.end());
296  fillerES.fill();
297 
298  //store in the event
299  iEvent.put(pfClusterAssociationEBEE,PFClusterAssociationEBEE_);
300  iEvent.put(pfClusterAssociationES,PFClusterAssociationES_);
305 }
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:141
void loadAndSortPFClusters(const edm::Event &evt)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
PFECALSuperClusterAlgo superClusterAlgo_
clustering algorithm
std::auto_ptr< reco::SuperClusterCollection > & getEEOutputSCCollection()
std::vector< CaloCluster > CaloClusterCollection
collection of CaloCluster objects
std::auto_ptr< reco::SuperClusterCollection > & getEBOutputSCCollection()

Member Data Documentation

PFECALSuperClusterAlgo::clustering_type PFECALSuperClusterProducer::_theclusteringtype
private

Definition at line 58 of file PFECALSuperClusterProducer.h.

PFECALSuperClusterAlgo::energy_weight PFECALSuperClusterProducer::_theenergyweight
private

Definition at line 59 of file PFECALSuperClusterProducer.h.

std::string PFECALSuperClusterProducer::PFBasicClusterCollectionBarrel_
private

Definition at line 66 of file PFECALSuperClusterProducer.h.

std::string PFECALSuperClusterProducer::PFBasicClusterCollectionEndcap_
private

Definition at line 68 of file PFECALSuperClusterProducer.h.

std::string PFECALSuperClusterProducer::PFBasicClusterCollectionPreshower_
private

Definition at line 70 of file PFECALSuperClusterProducer.h.

std::string PFECALSuperClusterProducer::PFClusterAssociationEBEE_
private

Definition at line 72 of file PFECALSuperClusterProducer.h.

std::string PFECALSuperClusterProducer::PFClusterAssociationES_
private

Definition at line 73 of file PFECALSuperClusterProducer.h.

std::string PFECALSuperClusterProducer::PFSuperClusterCollectionBarrel_
private

Definition at line 67 of file PFECALSuperClusterProducer.h.

std::string PFECALSuperClusterProducer::PFSuperClusterCollectionEndcap_
private

Definition at line 69 of file PFECALSuperClusterProducer.h.

std::string PFECALSuperClusterProducer::PFSuperClusterCollectionEndcapWithPreshower_
private

Definition at line 71 of file PFECALSuperClusterProducer.h.

PFECALSuperClusterAlgo PFECALSuperClusterProducer::superClusterAlgo_
private

clustering algorithm

Definition at line 57 of file PFECALSuperClusterProducer.h.

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

Definition at line 61 of file PFECALSuperClusterProducer.h.

bool PFECALSuperClusterProducer::verbose_
private

verbose ?

Definition at line 64 of file PFECALSuperClusterProducer.h.