CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
Multi5x5SuperClusterProducer Class Reference

#include <Multi5x5SuperClusterProducer.h>

Inheritance diagram for Multi5x5SuperClusterProducer:
edm::stream::EDProducer<>

Public Member Functions

void endStream () override
 
 Multi5x5SuperClusterProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Member Functions

reco::CaloClusterPtrVector getClusterPtrVector (edm::Event &evt, const edm::EDGetTokenT< reco::BasicClusterCollection > &clustersToken) const
 
void outputValidationInfo (reco::SuperClusterCollection &superclusterCollection)
 
void produceSuperclustersForECALPart (edm::Event &evt, const edm::EDGetTokenT< reco::BasicClusterCollection > &clustersToken, const edm::EDPutTokenT< reco::SuperClusterCollection > &putToken)
 

Private Attributes

const float barrelEtaSearchRoad_
 
const float barrelPhiSearchRoad_
 
edm::EDPutTokenT< reco::SuperClusterCollectionbarrelPutToken_
 
std::unique_ptr< Multi5x5BremRecoveryClusterAlgobremAlgo_p
 
const bool doBarrel_
 
const bool doEndcaps_
 
edm::EDGetTokenT< reco::BasicClusterCollectionebClustersToken_
 
edm::EDGetTokenT< reco::BasicClusterCollectioneeClustersToken_
 
const float endcapEtaSearchRoad_
 
const float endcapPhiSearchRoad_
 
edm::EDPutTokenT< reco::SuperClusterCollectionendcapPutToken_
 
int noSuperClusters
 
const float seedTransverseEnergyThreshold_
 
double totalE
 

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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 18 of file Multi5x5SuperClusterProducer.h.

Constructor & Destructor Documentation

◆ Multi5x5SuperClusterProducer()

Multi5x5SuperClusterProducer::Multi5x5SuperClusterProducer ( const edm::ParameterSet ps)

Definition at line 23 of file Multi5x5SuperClusterProducer.cc.

24  : barrelEtaSearchRoad_{static_cast<float>(ps.getParameter<double>("barrelEtaSearchRoad"))},
25  barrelPhiSearchRoad_{static_cast<float>(ps.getParameter<double>("barrelPhiSearchRoad"))},
26  endcapEtaSearchRoad_{static_cast<float>(ps.getParameter<double>("endcapEtaSearchRoad"))},
27  endcapPhiSearchRoad_{static_cast<float>(ps.getParameter<double>("endcapPhiSearchRoad"))},
28  seedTransverseEnergyThreshold_{static_cast<float>(ps.getParameter<double>("seedTransverseEnergyThreshold"))},
29  doBarrel_{ps.getParameter<bool>("doBarrel")},
30  doEndcaps_{ps.getParameter<bool>("doEndcaps")},
31  totalE{0.},
32  noSuperClusters{0} {
33  if (doEndcaps_) {
34  eeClustersToken_ = consumes<reco::BasicClusterCollection>(ps.getParameter<edm::InputTag>("endcapClusterTag"));
35  }
36  if (doBarrel_) {
37  ebClustersToken_ = consumes<reco::BasicClusterCollection>(ps.getParameter<edm::InputTag>("barrelClusterTag"));
38  }
39 
40  const edm::ParameterSet bremRecoveryPset = ps.getParameter<edm::ParameterSet>("bremRecoveryPset");
41  bool dynamicPhiRoad = ps.getParameter<bool>("dynamicPhiRoad");
42 
43  bremAlgo_p = std::make_unique<Multi5x5BremRecoveryClusterAlgo>(bremRecoveryPset,
50 
51  if (doEndcaps_) {
53  produces<reco::SuperClusterCollection>(ps.getParameter<std::string>("endcapSuperclusterCollection"));
54  }
55  if (doBarrel_) {
57  produces<reco::SuperClusterCollection>(ps.getParameter<std::string>("barrelSuperclusterCollection"));
58  }
59 }

References edm::ParameterSet::getParameter().

Member Function Documentation

◆ endStream()

void Multi5x5SuperClusterProducer::endStream ( )
override

Definition at line 61 of file Multi5x5SuperClusterProducer.cc.

61  {
62  double averEnergy = 0.;
63  std::ostringstream str;
64  str << "Multi5x5SuperClusterProducer::endJob()\n"
65  << " total # reconstructed super clusters: " << noSuperClusters << "\n"
66  << " total energy of all clusters: " << totalE << "\n";
67  if (noSuperClusters > 0) {
68  averEnergy = totalE / noSuperClusters;
69  str << " average SuperCluster energy = " << averEnergy << "\n";
70  }
71  edm::LogInfo("Multi5x5SuperClusterProducerInfo") << str.str() << "\n";
72 }

References noSuperClusters, str, and totalE.

◆ getClusterPtrVector()

reco::CaloClusterPtrVector Multi5x5SuperClusterProducer::getClusterPtrVector ( edm::Event evt,
const edm::EDGetTokenT< reco::BasicClusterCollection > &  clustersToken 
) const
private

Definition at line 102 of file Multi5x5SuperClusterProducer.cc.

103  {
104  reco::CaloClusterPtrVector clusterPtrVector_p;
106  evt.getByToken(clustersToken, bccHandle);
107 
108  const reco::BasicClusterCollection* clusterCollection_p = bccHandle.product();
109  clusterPtrVector_p.reserve(clusterCollection_p->size());
110  for (unsigned int i = 0; i < clusterCollection_p->size(); i++) {
111  clusterPtrVector_p.push_back(reco::CaloClusterPtr(bccHandle, i));
112  }
113  return clusterPtrVector_p;
114 }

References edm::Event::getByToken(), mps_fire::i, edm::Handle< T >::product(), edm::PtrVector< T >::push_back(), and edm::PtrVectorBase::reserve().

Referenced by produceSuperclustersForECALPart().

◆ outputValidationInfo()

void Multi5x5SuperClusterProducer::outputValidationInfo ( reco::SuperClusterCollection superclusterCollection)
private

◆ produce()

void Multi5x5SuperClusterProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
override

◆ produceSuperclustersForECALPart()

void Multi5x5SuperClusterProducer::produceSuperclustersForECALPart ( edm::Event evt,
const edm::EDGetTokenT< reco::BasicClusterCollection > &  clustersToken,
const edm::EDPutTokenT< reco::SuperClusterCollection > &  putToken 
)
private

Definition at line 82 of file Multi5x5SuperClusterProducer.cc.

85  {
86  // get the cluster collection out and turn it to a BasicClusterRefVector:
87  reco::CaloClusterPtrVector clusterPtrVector_p = getClusterPtrVector(evt, clustersToken);
88 
89  // run the brem recovery and get the SC collection
90  reco::SuperClusterCollection superclusters_ap(bremAlgo_p->makeSuperClusters(clusterPtrVector_p));
91 
92  // count the total energy and the number of superclusters
93  for (auto const& sc : superclusters_ap) {
94  totalE += sc.energy();
96  }
97 
98  // put the SC collection in the event
99  evt.emplace(putToken, std::move(superclusters_ap));
100 }

References bremAlgo_p, edm::Event::emplace(), getClusterPtrVector(), eostools::move(), noSuperClusters, and totalE.

Referenced by produce().

Member Data Documentation

◆ barrelEtaSearchRoad_

const float Multi5x5SuperClusterProducer::barrelEtaSearchRoad_
private

Definition at line 31 of file Multi5x5SuperClusterProducer.h.

◆ barrelPhiSearchRoad_

const float Multi5x5SuperClusterProducer::barrelPhiSearchRoad_
private

Definition at line 32 of file Multi5x5SuperClusterProducer.h.

◆ barrelPutToken_

edm::EDPutTokenT<reco::SuperClusterCollection> Multi5x5SuperClusterProducer::barrelPutToken_
private

Definition at line 29 of file Multi5x5SuperClusterProducer.h.

Referenced by produce().

◆ bremAlgo_p

std::unique_ptr<Multi5x5BremRecoveryClusterAlgo> Multi5x5SuperClusterProducer::bremAlgo_p
private

Definition at line 40 of file Multi5x5SuperClusterProducer.h.

Referenced by produceSuperclustersForECALPart().

◆ doBarrel_

const bool Multi5x5SuperClusterProducer::doBarrel_
private

Definition at line 37 of file Multi5x5SuperClusterProducer.h.

Referenced by produce().

◆ doEndcaps_

const bool Multi5x5SuperClusterProducer::doEndcaps_
private

Definition at line 38 of file Multi5x5SuperClusterProducer.h.

Referenced by produce().

◆ ebClustersToken_

edm::EDGetTokenT<reco::BasicClusterCollection> Multi5x5SuperClusterProducer::ebClustersToken_
private

Definition at line 27 of file Multi5x5SuperClusterProducer.h.

Referenced by produce().

◆ eeClustersToken_

edm::EDGetTokenT<reco::BasicClusterCollection> Multi5x5SuperClusterProducer::eeClustersToken_
private

Definition at line 26 of file Multi5x5SuperClusterProducer.h.

Referenced by produce().

◆ endcapEtaSearchRoad_

const float Multi5x5SuperClusterProducer::endcapEtaSearchRoad_
private

Definition at line 33 of file Multi5x5SuperClusterProducer.h.

◆ endcapPhiSearchRoad_

const float Multi5x5SuperClusterProducer::endcapPhiSearchRoad_
private

Definition at line 34 of file Multi5x5SuperClusterProducer.h.

◆ endcapPutToken_

edm::EDPutTokenT<reco::SuperClusterCollection> Multi5x5SuperClusterProducer::endcapPutToken_
private

Definition at line 28 of file Multi5x5SuperClusterProducer.h.

Referenced by produce().

◆ noSuperClusters

int Multi5x5SuperClusterProducer::noSuperClusters
private

Definition at line 43 of file Multi5x5SuperClusterProducer.h.

Referenced by endStream(), and produceSuperclustersForECALPart().

◆ seedTransverseEnergyThreshold_

const float Multi5x5SuperClusterProducer::seedTransverseEnergyThreshold_
private

Definition at line 35 of file Multi5x5SuperClusterProducer.h.

◆ totalE

double Multi5x5SuperClusterProducer::totalE
private

Definition at line 42 of file Multi5x5SuperClusterProducer.h.

Referenced by endStream(), and produceSuperclustersForECALPart().

Multi5x5SuperClusterProducer::ebClustersToken_
edm::EDGetTokenT< reco::BasicClusterCollection > ebClustersToken_
Definition: Multi5x5SuperClusterProducer.h:27
mps_fire.i
i
Definition: mps_fire.py:355
Multi5x5SuperClusterProducer::endcapPutToken_
edm::EDPutTokenT< reco::SuperClusterCollection > endcapPutToken_
Definition: Multi5x5SuperClusterProducer.h:28
edm::Handle::product
T const * product() const
Definition: Handle.h:70
Multi5x5SuperClusterProducer::endcapEtaSearchRoad_
const float endcapEtaSearchRoad_
Definition: Multi5x5SuperClusterProducer.h:33
Multi5x5SuperClusterProducer::totalE
double totalE
Definition: Multi5x5SuperClusterProducer.h:42
Multi5x5SuperClusterProducer::barrelEtaSearchRoad_
const float barrelEtaSearchRoad_
Definition: Multi5x5SuperClusterProducer.h:31
Multi5x5SuperClusterProducer::barrelPutToken_
edm::EDPutTokenT< reco::SuperClusterCollection > barrelPutToken_
Definition: Multi5x5SuperClusterProducer.h:29
Multi5x5SuperClusterProducer::getClusterPtrVector
reco::CaloClusterPtrVector getClusterPtrVector(edm::Event &evt, const edm::EDGetTokenT< reco::BasicClusterCollection > &clustersToken) const
Definition: Multi5x5SuperClusterProducer.cc:102
edm::LogInfo
Definition: MessageLogger.h:254
edm::Handle
Definition: AssociativeIterator.h:50
Multi5x5SuperClusterProducer::seedTransverseEnergyThreshold_
const float seedTransverseEnergyThreshold_
Definition: Multi5x5SuperClusterProducer.h:35
reco::SuperClusterCollection
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
Definition: SuperClusterFwd.h:9
edm::PtrVector< CaloCluster >
str
#define str(s)
Definition: TestProcessor.cc:48
Multi5x5SuperClusterProducer::doEndcaps_
const bool doEndcaps_
Definition: Multi5x5SuperClusterProducer.h:38
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
edm::Event::emplace
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&... args)
puts a new product
Definition: Event.h:424
reco::BasicClusterCollection
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects
Definition: BasicClusterFwd.h:16
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::PtrVector::push_back
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:149
edm::ParameterSet
Definition: ParameterSet.h:36
Multi5x5SuperClusterProducer::eeClustersToken_
edm::EDGetTokenT< reco::BasicClusterCollection > eeClustersToken_
Definition: Multi5x5SuperClusterProducer.h:26
Multi5x5SuperClusterProducer::doBarrel_
const bool doBarrel_
Definition: Multi5x5SuperClusterProducer.h:37
Multi5x5SuperClusterProducer::endcapPhiSearchRoad_
const float endcapPhiSearchRoad_
Definition: Multi5x5SuperClusterProducer.h:34
cosmicSuperClusters_cfi.dynamicPhiRoad
dynamicPhiRoad
Definition: cosmicSuperClusters_cfi.py:25
cosmicSuperClusters_cfi.bremRecoveryPset
bremRecoveryPset
Definition: cosmicSuperClusters_cfi.py:26
edm::Ptr< CaloCluster >
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Multi5x5SuperClusterProducer::noSuperClusters
int noSuperClusters
Definition: Multi5x5SuperClusterProducer.h:43
eostools.move
def move(src, dest)
Definition: eostools.py:511
Multi5x5SuperClusterProducer::bremAlgo_p
std::unique_ptr< Multi5x5BremRecoveryClusterAlgo > bremAlgo_p
Definition: Multi5x5SuperClusterProducer.h:40
Multi5x5SuperClusterProducer::barrelPhiSearchRoad_
const float barrelPhiSearchRoad_
Definition: Multi5x5SuperClusterProducer.h:32
Multi5x5SuperClusterProducer::produceSuperclustersForECALPart
void produceSuperclustersForECALPart(edm::Event &evt, const edm::EDGetTokenT< reco::BasicClusterCollection > &clustersToken, const edm::EDPutTokenT< reco::SuperClusterCollection > &putToken)
Definition: Multi5x5SuperClusterProducer.cc:82
edm::InputTag
Definition: InputTag.h:15
edm::PtrVectorBase::reserve
void reserve(size_type n)
Reserve space for RefVector.
Definition: PtrVectorBase.h:93