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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void endStream () override
 
 Multi5x5SuperClusterProducer (const edm::ParameterSet &ps)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
 ~Multi5x5SuperClusterProducer ()
 
- 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)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

bool counterExceeded () const
 
void getClusterPtrVector (edm::Event &evt, const edm::EDGetTokenT< reco::BasicClusterCollection > &clustersToken, reco::CaloClusterPtrVector *)
 
void outputValidationInfo (reco::SuperClusterCollection &superclusterCollection)
 
void produceSuperclustersForECALPart (edm::Event &evt, const edm::EDGetTokenT< reco::BasicClusterCollection > &clustersToken, std::string superclusterColection)
 

Private Attributes

float barrelEtaSearchRoad_
 
float barrelPhiSearchRoad_
 
std::string barrelSuperclusterCollection_
 
Multi5x5BremRecoveryClusterAlgobremAlgo_p
 
bool doBarrel_
 
bool doEndcaps_
 
edm::EDGetTokenT< reco::BasicClusterCollectionebClustersToken_
 
edm::EDGetTokenT< reco::BasicClusterCollectioneeClustersToken_
 
float endcapEtaSearchRoad_
 
float endcapPhiSearchRoad_
 
std::string endcapSuperclusterCollection_
 
int nEvt_
 
int nMaxPrintout_
 
int noSuperClusters
 
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
 
- 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
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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

Definition at line 19 of file Multi5x5SuperClusterProducer.h.

Constructor & Destructor Documentation

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

Definition at line 24 of file Multi5x5SuperClusterProducer.cc.

References barrelEtaSearchRoad_, barrelPhiSearchRoad_, barrelSuperclusterCollection_, bremAlgo_p, cosmicSuperClusters_cfi::bremRecoveryPset, doBarrel_, doEndcaps_, cosmicSuperClusters_cfi::dynamicPhiRoad, ebClustersToken_, eeClustersToken_, endcapEtaSearchRoad_, endcapPhiSearchRoad_, endcapSuperclusterCollection_, edm::ParameterSet::getParameter(), nEvt_, noSuperClusters, seedTransverseEnergyThreshold_, AlCaHLTBitMon_QueryRunRegistry::string, and totalE.

25 {
26 
28  consumes<reco::BasicClusterCollection>(ps.getParameter<edm::InputTag>("endcapClusterTag"));
30  consumes<reco::BasicClusterCollection>(ps.getParameter<edm::InputTag>("barrelClusterTag"));
31 
32 
33  endcapSuperclusterCollection_ = ps.getParameter<std::string>("endcapSuperclusterCollection");
34  barrelSuperclusterCollection_ = ps.getParameter<std::string>("barrelSuperclusterCollection");
35 
36  doBarrel_ = ps.getParameter<bool>("doBarrel");
37  doEndcaps_ = ps.getParameter<bool>("doEndcaps");
38 
39  barrelEtaSearchRoad_ = ps.getParameter<double>("barrelEtaSearchRoad");
40  barrelPhiSearchRoad_ = ps.getParameter<double>("barrelPhiSearchRoad");
41  endcapEtaSearchRoad_ = ps.getParameter<double>("endcapEtaSearchRoad");
42  endcapPhiSearchRoad_ = ps.getParameter<double>("endcapPhiSearchRoad");
43  seedTransverseEnergyThreshold_ = ps.getParameter<double>("seedTransverseEnergyThreshold");
44 
45  const edm::ParameterSet bremRecoveryPset = ps.getParameter<edm::ParameterSet>("bremRecoveryPset");
46  bool dynamicPhiRoad = ps.getParameter<bool>("dynamicPhiRoad");
47 
51 
52  produces< reco::SuperClusterCollection >(endcapSuperclusterCollection_);
53  produces< reco::SuperClusterCollection >(barrelSuperclusterCollection_);
54 
55  totalE = 0;
56  noSuperClusters = 0;
57  nEvt_ = 0;
58 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::BasicClusterCollection > eeClustersToken_
Multi5x5BremRecoveryClusterAlgo * bremAlgo_p
edm::EDGetTokenT< reco::BasicClusterCollection > ebClustersToken_
Multi5x5SuperClusterProducer::~Multi5x5SuperClusterProducer ( )

Definition at line 61 of file Multi5x5SuperClusterProducer.cc.

References bremAlgo_p.

62 {
63  delete bremAlgo_p;
64 }
Multi5x5BremRecoveryClusterAlgo * bremAlgo_p

Member Function Documentation

bool Multi5x5SuperClusterProducer::counterExceeded ( ) const
inlineprivate
void Multi5x5SuperClusterProducer::endStream ( )
overridevirtual

Reimplemented from edm::stream::EDProducerBase.

Definition at line 67 of file Multi5x5SuperClusterProducer.cc.

References noSuperClusters, harvestTrackValidationPlots::str, and totalE.

67  {
68  double averEnergy = 0.;
69  std::ostringstream str;
70  str << "Multi5x5SuperClusterProducer::endJob()\n"
71  << " total # reconstructed super clusters: " << noSuperClusters << "\n"
72  << " total energy of all clusters: " << totalE << "\n";
73  if(noSuperClusters>0) {
74  averEnergy = totalE / noSuperClusters;
75  str << " average SuperCluster energy = " << averEnergy << "\n";
76  }
77  edm::LogInfo("Multi5x5SuperClusterProducerInfo") << str.str() << "\n";
78 
79 }
void Multi5x5SuperClusterProducer::getClusterPtrVector ( edm::Event evt,
const edm::EDGetTokenT< reco::BasicClusterCollection > &  clustersToken,
reco::CaloClusterPtrVector clusterPtrVector_p 
)
private

Definition at line 121 of file Multi5x5SuperClusterProducer.cc.

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

Referenced by produceSuperclustersForECALPart().

124 {
126  evt.getByToken(clustersToken, bccHandle);
127 
128  const reco::BasicClusterCollection *clusterCollection_p = bccHandle.product();
129  for (unsigned int i = 0; i < clusterCollection_p->size(); i++)
130  {
131  clusterPtrVector_p->push_back(reco::CaloClusterPtr(bccHandle, i));
132  }
133 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:140
T const * product() const
Definition: Handle.h:81
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects
void Multi5x5SuperClusterProducer::outputValidationInfo ( reco::SuperClusterCollection superclusterCollection)
private
void Multi5x5SuperClusterProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
overridevirtual

Definition at line 82 of file Multi5x5SuperClusterProducer.cc.

References barrelSuperclusterCollection_, doBarrel_, doEndcaps_, ebClustersToken_, eeClustersToken_, endcapSuperclusterCollection_, nEvt_, and produceSuperclustersForECALPart().

83 {
84  if(doEndcaps_)
86 
87  if(doBarrel_)
89 
90  nEvt_++;
91 }
edm::EDGetTokenT< reco::BasicClusterCollection > eeClustersToken_
edm::EDGetTokenT< reco::BasicClusterCollection > ebClustersToken_
void produceSuperclustersForECALPart(edm::Event &evt, const edm::EDGetTokenT< reco::BasicClusterCollection > &clustersToken, std::string superclusterColection)
void Multi5x5SuperClusterProducer::produceSuperclustersForECALPart ( edm::Event evt,
const edm::EDGetTokenT< reco::BasicClusterCollection > &  clustersToken,
std::string  superclusterColection 
)
private

Definition at line 95 of file Multi5x5SuperClusterProducer.cc.

References bremAlgo_p, getClusterPtrVector(), Multi5x5BremRecoveryClusterAlgo::makeSuperClusters(), eostools::move(), noSuperClusters, edm::Event::put(), and totalE.

Referenced by produce().

98 {
99  // get the cluster collection out and turn it to a BasicClusterRefVector:
100  reco::CaloClusterPtrVector *clusterPtrVector_p = new reco::CaloClusterPtrVector;
101  getClusterPtrVector(evt, clustersToken, clusterPtrVector_p);
102 
103  // run the brem recovery and get the SC collection
104  auto superclusters_ap = std::make_unique<reco::SuperClusterCollection>(bremAlgo_p->makeSuperClusters(*clusterPtrVector_p));
105 
106  // count the total energy and the number of superclusters
107  reco::SuperClusterCollection::iterator it;
108  for (it = superclusters_ap->begin(); it != superclusters_ap->end(); it++)
109  {
110  totalE += it->energy();
111  noSuperClusters++;
112  }
113 
114  // put the SC collection in the event
115  evt.put(std::move(superclusters_ap), superclusterCollection);
116 
117  delete clusterPtrVector_p;
118 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
Multi5x5BremRecoveryClusterAlgo * bremAlgo_p
edm::PtrVector< CaloCluster > CaloClusterPtrVector
void getClusterPtrVector(edm::Event &evt, const edm::EDGetTokenT< reco::BasicClusterCollection > &clustersToken, reco::CaloClusterPtrVector *)
def move(src, dest)
Definition: eostools.py:510
reco::SuperClusterCollection makeSuperClusters(const reco::CaloClusterPtrVector &clusters)

Member Data Documentation

float Multi5x5SuperClusterProducer::barrelEtaSearchRoad_
private

Definition at line 42 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer().

float Multi5x5SuperClusterProducer::barrelPhiSearchRoad_
private

Definition at line 43 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer().

std::string Multi5x5SuperClusterProducer::barrelSuperclusterCollection_
private

Definition at line 40 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer(), and produce().

Multi5x5BremRecoveryClusterAlgo* Multi5x5SuperClusterProducer::bremAlgo_p
private
bool Multi5x5SuperClusterProducer::doBarrel_
private

Definition at line 48 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer(), and produce().

bool Multi5x5SuperClusterProducer::doEndcaps_
private

Definition at line 49 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer(), and produce().

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

Definition at line 37 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer(), and produce().

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

Definition at line 36 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer(), and produce().

float Multi5x5SuperClusterProducer::endcapEtaSearchRoad_
private

Definition at line 44 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer().

float Multi5x5SuperClusterProducer::endcapPhiSearchRoad_
private

Definition at line 45 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer().

std::string Multi5x5SuperClusterProducer::endcapSuperclusterCollection_
private

Definition at line 39 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer(), and produce().

int Multi5x5SuperClusterProducer::nEvt_
private

Definition at line 34 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer(), and produce().

int Multi5x5SuperClusterProducer::nMaxPrintout_
private

Definition at line 33 of file Multi5x5SuperClusterProducer.h.

int Multi5x5SuperClusterProducer::noSuperClusters
private
float Multi5x5SuperClusterProducer::seedTransverseEnergyThreshold_
private

Definition at line 46 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer().

double Multi5x5SuperClusterProducer::totalE
private