CMS 3D CMS Logo

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

#include <HiSuperClusterProducer.h>

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

Public Member Functions

virtual void endJob ()
 
 HiSuperClusterProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~HiSuperClusterProducer () 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

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 barrelBCEnergyThreshold_
 
float barrelEtaSearchRoad_
 
float barrelPhiSearchRoad_
 
std::string barrelSuperclusterCollection_
 
HiBremRecoveryClusterAlgobremAlgo_p
 
bool doBarrel_
 
bool doEndcaps_
 
edm::EDGetTokenT< reco::BasicClusterCollectionebClustersToken_
 
edm::EDGetTokenT< reco::BasicClusterCollectioneeClustersToken_
 
float endcapBCEnergyThreshold_
 
float endcapEtaSearchRoad_
 
float endcapPhiSearchRoad_
 
std::string endcapSuperclusterCollection_
 
int nEvt_
 
int nMaxPrintout_
 
int noSuperClusters
 
float seedTransverseEnergyThreshold_
 
double totalE
 
HiBremRecoveryClusterAlgo::VerbosityLevel verbosity
 

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 HiSuperClusterProducer.h.

Constructor & Destructor Documentation

◆ HiSuperClusterProducer()

HiSuperClusterProducer::HiSuperClusterProducer ( const edm::ParameterSet ps)

Definition at line 25 of file HiSuperClusterProducer.cc.

25  {
26  // The verbosity level
27  std::string verbosityString = ps.getParameter<std::string>("VerbosityLevel");
28  if (verbosityString == "DEBUG")
30  else if (verbosityString == "WARNING")
32  else if (verbosityString == "INFO")
34  else
36 
37  endcapSuperclusterCollection_ = ps.getParameter<std::string>("endcapSuperclusterCollection");
38  barrelSuperclusterCollection_ = ps.getParameter<std::string>("barrelSuperclusterCollection");
39 
40  doBarrel_ = ps.getParameter<bool>("doBarrel");
41  doEndcaps_ = ps.getParameter<bool>("doEndcaps");
42 
43  barrelEtaSearchRoad_ = ps.getParameter<double>("barrelEtaSearchRoad");
44  barrelPhiSearchRoad_ = ps.getParameter<double>("barrelPhiSearchRoad");
45  endcapEtaSearchRoad_ = ps.getParameter<double>("endcapEtaSearchRoad");
46  endcapPhiSearchRoad_ = ps.getParameter<double>("endcapPhiSearchRoad");
47  seedTransverseEnergyThreshold_ = ps.getParameter<double>("seedTransverseEnergyThreshold");
48  barrelBCEnergyThreshold_ = ps.getParameter<double>("barrelBCEnergyThreshold");
49  endcapBCEnergyThreshold_ = ps.getParameter<double>("endcapBCEnergyThreshold");
50 
51  if (verbosityString == "INFO") {
52  std::cout << "Barrel BC Energy threshold = " << barrelBCEnergyThreshold_ << std::endl;
53  std::cout << "Endcap BC Energy threshold = " << endcapBCEnergyThreshold_ << std::endl;
54  }
55 
63  verbosity);
64 
65  produces<reco::SuperClusterCollection>(endcapSuperclusterCollection_);
66  produces<reco::SuperClusterCollection>(barrelSuperclusterCollection_);
67 
68  eeClustersToken_ = consumes<reco::BasicClusterCollection>(edm::InputTag(
69  ps.getParameter<std::string>("endcapClusterProducer"), ps.getParameter<std::string>("endcapClusterCollection")));
70  ebClustersToken_ = consumes<reco::BasicClusterCollection>(edm::InputTag(
71  ps.getParameter<std::string>("barrelClusterProducer"), ps.getParameter<std::string>("barrelClusterCollection")));
72 
73  totalE = 0;
74  noSuperClusters = 0;
75  nEvt_ = 0;
76 }

References barrelBCEnergyThreshold_, barrelEtaSearchRoad_, barrelPhiSearchRoad_, barrelSuperclusterCollection_, bremAlgo_p, gather_cfg::cout, doBarrel_, doEndcaps_, ebClustersToken_, eeClustersToken_, endcapBCEnergyThreshold_, endcapEtaSearchRoad_, endcapPhiSearchRoad_, endcapSuperclusterCollection_, edm::ParameterSet::getParameter(), nEvt_, noSuperClusters, HiBremRecoveryClusterAlgo::pDEBUG, HiBremRecoveryClusterAlgo::pERROR, HiBremRecoveryClusterAlgo::pINFO, HiBremRecoveryClusterAlgo::pWARNING, seedTransverseEnergyThreshold_, AlCaHLTBitMon_QueryRunRegistry::string, totalE, and verbosity.

◆ ~HiSuperClusterProducer()

HiSuperClusterProducer::~HiSuperClusterProducer ( )
override

Definition at line 78 of file HiSuperClusterProducer.cc.

78 { delete bremAlgo_p; }

References bremAlgo_p.

Member Function Documentation

◆ counterExceeded()

bool HiSuperClusterProducer::counterExceeded ( ) const
inlineprivate

Definition at line 66 of file HiSuperClusterProducer.h.

66 { return ((nEvt_ > nMaxPrintout_) || (nMaxPrintout_ < 0)); }

References nEvt_, and nMaxPrintout_.

◆ endJob()

void HiSuperClusterProducer::endJob ( void  )
virtual

Definition at line 80 of file HiSuperClusterProducer.cc.

80  {
81  double averEnergy = 0.;
82  std::ostringstream str;
83  str << "HiSuperClusterProducer::endJob()\n"
84  << " total # reconstructed super clusters: " << noSuperClusters << "\n"
85  << " total energy of all clusters: " << totalE << "\n";
86  if (noSuperClusters > 0) {
87  averEnergy = totalE / noSuperClusters;
88  str << " average SuperCluster energy = " << averEnergy << "\n";
89  }
90  edm::LogInfo("HiSuperClusterProducerInfo") << str.str() << "\n";
91 }

References noSuperClusters, str, and totalE.

◆ getClusterPtrVector()

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

Definition at line 128 of file HiSuperClusterProducer.cc.

130  {
132 
133  evt.getByToken(clustersToken, bccHandle);
134 
135  if (!(bccHandle.isValid())) {
136  edm::LogError("HiSuperClusterProducerError") << "could not get a handle on the BasicCluster Collection!";
137  clusterPtrVector_p = nullptr;
138  }
139 
140  const reco::BasicClusterCollection* clusterCollection_p = bccHandle.product();
141  for (unsigned int i = 0; i < clusterCollection_p->size(); i++) {
142  clusterPtrVector_p->push_back(reco::CaloClusterPtr(bccHandle, i));
143  }
144 }

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

Referenced by produceSuperclustersForECALPart().

◆ outputValidationInfo()

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

◆ produce()

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

◆ produceSuperclustersForECALPart()

void HiSuperClusterProducer::produceSuperclustersForECALPart ( edm::Event evt,
const edm::EDGetTokenT< reco::BasicClusterCollection > &  clustersToken,
std::string  superclusterColection 
)
private

Definition at line 103 of file HiSuperClusterProducer.cc.

106  {
107  // get the cluster collection out and turn it to a BasicClusterRefVector:
108  reco::CaloClusterPtrVector* clusterPtrVector_p = new reco::CaloClusterPtrVector;
109  getClusterPtrVector(evt, clustersToken, clusterPtrVector_p);
110 
111  // run the brem recovery and get the SC collection
112  auto superclusters_ap =
113  std::make_unique<reco::SuperClusterCollection>(bremAlgo_p->makeSuperClusters(*clusterPtrVector_p));
114 
115  // count the total energy and the number of superclusters
116  reco::SuperClusterCollection::iterator it;
117  for (it = superclusters_ap->begin(); it != superclusters_ap->end(); it++) {
118  totalE += it->energy();
119  noSuperClusters++;
120  }
121 
122  // put the SC collection in the event
123  evt.put(std::move(superclusters_ap), superclusterCollection);
124 
125  delete clusterPtrVector_p;
126 }

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

Referenced by produce().

Member Data Documentation

◆ barrelBCEnergyThreshold_

float HiSuperClusterProducer::barrelBCEnergyThreshold_
private

Definition at line 45 of file HiSuperClusterProducer.h.

Referenced by HiSuperClusterProducer().

◆ barrelEtaSearchRoad_

float HiSuperClusterProducer::barrelEtaSearchRoad_
private

Definition at line 40 of file HiSuperClusterProducer.h.

Referenced by HiSuperClusterProducer().

◆ barrelPhiSearchRoad_

float HiSuperClusterProducer::barrelPhiSearchRoad_
private

Definition at line 41 of file HiSuperClusterProducer.h.

Referenced by HiSuperClusterProducer().

◆ barrelSuperclusterCollection_

std::string HiSuperClusterProducer::barrelSuperclusterCollection_
private

Definition at line 35 of file HiSuperClusterProducer.h.

Referenced by HiSuperClusterProducer(), and produce().

◆ bremAlgo_p

HiBremRecoveryClusterAlgo* HiSuperClusterProducer::bremAlgo_p
private

◆ doBarrel_

bool HiSuperClusterProducer::doBarrel_
private

Definition at line 48 of file HiSuperClusterProducer.h.

Referenced by HiSuperClusterProducer(), and produce().

◆ doEndcaps_

bool HiSuperClusterProducer::doEndcaps_
private

Definition at line 49 of file HiSuperClusterProducer.h.

Referenced by HiSuperClusterProducer(), and produce().

◆ ebClustersToken_

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

Definition at line 38 of file HiSuperClusterProducer.h.

Referenced by HiSuperClusterProducer(), and produce().

◆ eeClustersToken_

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

Definition at line 37 of file HiSuperClusterProducer.h.

Referenced by HiSuperClusterProducer(), and produce().

◆ endcapBCEnergyThreshold_

float HiSuperClusterProducer::endcapBCEnergyThreshold_
private

Definition at line 46 of file HiSuperClusterProducer.h.

Referenced by HiSuperClusterProducer().

◆ endcapEtaSearchRoad_

float HiSuperClusterProducer::endcapEtaSearchRoad_
private

Definition at line 42 of file HiSuperClusterProducer.h.

Referenced by HiSuperClusterProducer().

◆ endcapPhiSearchRoad_

float HiSuperClusterProducer::endcapPhiSearchRoad_
private

Definition at line 43 of file HiSuperClusterProducer.h.

Referenced by HiSuperClusterProducer().

◆ endcapSuperclusterCollection_

std::string HiSuperClusterProducer::endcapSuperclusterCollection_
private

Definition at line 34 of file HiSuperClusterProducer.h.

Referenced by HiSuperClusterProducer(), and produce().

◆ nEvt_

int HiSuperClusterProducer::nEvt_
private

Definition at line 30 of file HiSuperClusterProducer.h.

Referenced by counterExceeded(), HiSuperClusterProducer(), and produce().

◆ nMaxPrintout_

int HiSuperClusterProducer::nMaxPrintout_
private

Definition at line 29 of file HiSuperClusterProducer.h.

Referenced by counterExceeded().

◆ noSuperClusters

int HiSuperClusterProducer::noSuperClusters
private

◆ seedTransverseEnergyThreshold_

float HiSuperClusterProducer::seedTransverseEnergyThreshold_
private

Definition at line 44 of file HiSuperClusterProducer.h.

Referenced by HiSuperClusterProducer().

◆ totalE

double HiSuperClusterProducer::totalE
private

◆ verbosity

HiBremRecoveryClusterAlgo::VerbosityLevel HiSuperClusterProducer::verbosity
private

Definition at line 32 of file HiSuperClusterProducer.h.

Referenced by HiSuperClusterProducer().

mps_fire.i
i
Definition: mps_fire.py:355
HiSuperClusterProducer::endcapBCEnergyThreshold_
float endcapBCEnergyThreshold_
Definition: HiSuperClusterProducer.h:46
HiSuperClusterProducer::eeClustersToken_
edm::EDGetTokenT< reco::BasicClusterCollection > eeClustersToken_
Definition: HiSuperClusterProducer.h:37
edm::Handle::product
T const * product() const
Definition: Handle.h:70
HiBremRecoveryClusterAlgo::pDEBUG
Definition: HiBremRecoveryClusterAlgo.h:23
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::LogInfo
Definition: MessageLogger.h:254
edm::Handle
Definition: AssociativeIterator.h:50
HiSuperClusterProducer::barrelEtaSearchRoad_
float barrelEtaSearchRoad_
Definition: HiSuperClusterProducer.h:40
HiSuperClusterProducer::bremAlgo_p
HiBremRecoveryClusterAlgo * bremAlgo_p
Definition: HiSuperClusterProducer.h:51
HiSuperClusterProducer::verbosity
HiBremRecoveryClusterAlgo::VerbosityLevel verbosity
Definition: HiSuperClusterProducer.h:32
HiSuperClusterProducer::endcapSuperclusterCollection_
std::string endcapSuperclusterCollection_
Definition: HiSuperClusterProducer.h:34
edm::PtrVector< CaloCluster >
HiSuperClusterProducer::endcapEtaSearchRoad_
float endcapEtaSearchRoad_
Definition: HiSuperClusterProducer.h:42
str
#define str(s)
Definition: TestProcessor.cc:48
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
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
HiSuperClusterProducer::doBarrel_
bool doBarrel_
Definition: HiSuperClusterProducer.h:48
HiSuperClusterProducer::seedTransverseEnergyThreshold_
float seedTransverseEnergyThreshold_
Definition: HiSuperClusterProducer.h:44
edm::LogError
Definition: MessageLogger.h:183
HiSuperClusterProducer::barrelPhiSearchRoad_
float barrelPhiSearchRoad_
Definition: HiSuperClusterProducer.h:41
reco::CaloClusterPtrVector
edm::PtrVector< CaloCluster > CaloClusterPtrVector
Definition: CaloClusterFwd.h:22
HiSuperClusterProducer::totalE
double totalE
Definition: HiSuperClusterProducer.h:53
HiSuperClusterProducer::nEvt_
int nEvt_
Definition: HiSuperClusterProducer.h:30
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:132
HiSuperClusterProducer::doEndcaps_
bool doEndcaps_
Definition: HiSuperClusterProducer.h:49
HiSuperClusterProducer::barrelSuperclusterCollection_
std::string barrelSuperclusterCollection_
Definition: HiSuperClusterProducer.h:35
HiSuperClusterProducer::noSuperClusters
int noSuperClusters
Definition: HiSuperClusterProducer.h:54
HiSuperClusterProducer::getClusterPtrVector
void getClusterPtrVector(edm::Event &evt, const edm::EDGetTokenT< reco::BasicClusterCollection > &clustersToken, reco::CaloClusterPtrVector *)
Definition: HiSuperClusterProducer.cc:128
edm::Ptr< CaloCluster >
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
hybridSuperClusters_cfi.superclusterCollection
superclusterCollection
Definition: hybridSuperClusters_cfi.py:31
HiSuperClusterProducer::endcapPhiSearchRoad_
float endcapPhiSearchRoad_
Definition: HiSuperClusterProducer.h:43
HiBremRecoveryClusterAlgo::pERROR
Definition: HiBremRecoveryClusterAlgo.h:23
HiSuperClusterProducer::ebClustersToken_
edm::EDGetTokenT< reco::BasicClusterCollection > ebClustersToken_
Definition: HiSuperClusterProducer.h:38
HiSuperClusterProducer::nMaxPrintout_
int nMaxPrintout_
Definition: HiSuperClusterProducer.h:29
HiBremRecoveryClusterAlgo
Definition: HiBremRecoveryClusterAlgo.h:21
HiSuperClusterProducer::produceSuperclustersForECALPart
void produceSuperclustersForECALPart(edm::Event &evt, const edm::EDGetTokenT< reco::BasicClusterCollection > &clustersToken, std::string superclusterColection)
Definition: HiSuperClusterProducer.cc:103
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
HiSuperClusterProducer::barrelBCEnergyThreshold_
float barrelBCEnergyThreshold_
Definition: HiSuperClusterProducer.h:45
edm::InputTag
Definition: InputTag.h:15
HiBremRecoveryClusterAlgo::pINFO
Definition: HiBremRecoveryClusterAlgo.h:23
HiBremRecoveryClusterAlgo::makeSuperClusters
reco::SuperClusterCollection makeSuperClusters(reco::CaloClusterPtrVector &clusters)
Definition: HiBremRecoveryClusterAlgo.cc:5
HiBremRecoveryClusterAlgo::pWARNING
Definition: HiBremRecoveryClusterAlgo.h:23