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
 
 ~Multi5x5SuperClusterProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

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
 

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 ( )
override

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 ( )
override

Definition at line 67 of file Multi5x5SuperClusterProducer.cc.

References noSuperClusters, 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 }
#define str(s)
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:579
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 
)
override

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:137
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