test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
 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 (const std::string &iProcessName, std::vector< const char * > &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 ()
 

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::BasicClusterCollection
ebClustersToken_
 
edm::EDGetTokenT
< reco::BasicClusterCollection
eeClustersToken_
 
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, 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
 
- 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, doBarrel_, doEndcaps_, 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 
50  dynamicPhiRoad, seedTransverseEnergyThreshold_);
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, 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 122 of file Multi5x5SuperClusterProducer.cc.

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

Referenced by produceSuperclustersForECALPart().

125 {
127  evt.getByToken(clustersToken, bccHandle);
128 
129  const reco::BasicClusterCollection *clusterCollection_p = bccHandle.product();
130  for (unsigned int i = 0; i < clusterCollection_p->size(); i++)
131  {
132  clusterPtrVector_p->push_back(reco::CaloClusterPtr(bccHandle, i));
133  }
134 }
int i
Definition: DBlmapReader.cc:9
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:141
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

Implements edm::stream::EDProducerBase.

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(), 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  std::auto_ptr<reco::SuperClusterCollection>
105  superclusters_ap(new reco::SuperClusterCollection(bremAlgo_p->makeSuperClusters(*clusterPtrVector_p)));
106 
107  // count the total energy and the number of superclusters
108  reco::SuperClusterCollection::iterator it;
109  for (it = superclusters_ap->begin(); it != superclusters_ap->end(); it++)
110  {
111  totalE += it->energy();
112  noSuperClusters++;
113  }
114 
115  // put the SC collection in the event
116  evt.put(superclusters_ap, superclusterCollection);
117 
118  delete clusterPtrVector_p;
119 }
reco::SuperClusterCollection makeSuperClusters(reco::CaloClusterPtrVector &clusters)
Multi5x5BremRecoveryClusterAlgo * bremAlgo_p
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
edm::PtrVector< CaloCluster > CaloClusterPtrVector
void getClusterPtrVector(edm::Event &evt, const edm::EDGetTokenT< reco::BasicClusterCollection > &clustersToken, reco::CaloClusterPtrVector *)

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
int Multi5x5SuperClusterProducer::nMaxPrintout_
private

Definition at line 33 of file Multi5x5SuperClusterProducer.h.

Referenced by counterExceeded().

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

Definition at line 46 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer().

double Multi5x5SuperClusterProducer::totalE
private