CMS 3D CMS Logo

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

#include <Multi5x5ClusterProducer.h>

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

Public Member Functions

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

Private Member Functions

void clusterizeECALPart (edm::Event &evt, const edm::EventSetup &es, const edm::EDGetTokenT< EcalRecHitCollection > &token, const std::string &clusterCollection, const reco::CaloID::Detectors detector)
 
bool counterExceeded () const
 
const EcalRecHitCollectiongetCollection (edm::Event &evt, const edm::EDGetTokenT< EcalRecHitCollection > &token)
 
void outputValidationInfo (reco::CaloClusterPtrVector &clusterPtrVector)
 

Private Attributes

std::string barrelClusterCollection_
 
edm::EDGetTokenT< EcalRecHitCollectionbarrelHitToken_
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordcaloGeometryToken_
 
bool doBarrel_
 
bool doEndcap_
 
std::string endcapClusterCollection_
 
edm::EDGetTokenT< EcalRecHitCollectionendcapHitToken_
 
Multi5x5ClusterAlgoisland_p
 
int nEvt_
 
int nMaxPrintout_
 
PositionCalc posCalculator_
 

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 27 of file Multi5x5ClusterProducer.h.

Constructor & Destructor Documentation

◆ Multi5x5ClusterProducer()

Multi5x5ClusterProducer::Multi5x5ClusterProducer ( const edm::ParameterSet ps)

Definition at line 35 of file Multi5x5ClusterProducer.cc.

35  {
36  // Parameters to identify the hit collections
37  barrelHitToken_ = consumes<EcalRecHitCollection>(ps.getParameter<edm::InputTag>("barrelHitTag"));
38 
39  endcapHitToken_ = consumes<EcalRecHitCollection>(ps.getParameter<edm::InputTag>("endcapHitTag"));
40 
41  //EventSetup Token for CaloGeometry
42  caloGeometryToken_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
43 
44  // should cluster algo be run in barrel and endcap?
45  doEndcap_ = ps.getParameter<bool>("doEndcap");
46  doBarrel_ = ps.getParameter<bool>("doBarrel");
47 
48  // The names of the produced cluster collections
49  barrelClusterCollection_ = ps.getParameter<std::string>("barrelClusterCollection");
50  endcapClusterCollection_ = ps.getParameter<std::string>("endcapClusterCollection");
51 
52  // Island algorithm parameters
53  double barrelSeedThreshold = ps.getParameter<double>("IslandBarrelSeedThr");
54  double endcapSeedThreshold = ps.getParameter<double>("IslandEndcapSeedThr");
55 
56  const std::vector<std::string> flagnames = ps.getParameter<std::vector<std::string> >("RecHitFlagToBeExcluded");
57 
58  const std::vector<int> v_chstatus = StringToEnumValue<EcalRecHit::Flags>(flagnames);
59 
60  // Parameters for the position calculation:
63 
64  // Produces a collection of barrel and a collection of endcap clusters
65  produces<reco::BasicClusterCollection>(endcapClusterCollection_);
66  produces<reco::BasicClusterCollection>(barrelClusterCollection_);
67 
69  if (ps.exists("reassignSeedCrysToClusterItSeeds"))
70  reassignSeedCrysToClusterItSeeds = ps.getParameter<bool>("reassignSeedCrysToClusterItSeeds");
71 
73  barrelSeedThreshold, endcapSeedThreshold, v_chstatus, posCalculator_, reassignSeedCrysToClusterItSeeds);
74 
75  nEvt_ = 0;
76 }

References barrelClusterCollection_, barrelHitToken_, caloGeometryToken_, doBarrel_, doEndcap_, endcapClusterCollection_, endcapHitToken_, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), island_p, nEvt_, MonitorAlCaEcalPi0_cfi::posCalcParameters, posCalculator_, multi5x5BasicClusters_cfi::reassignSeedCrysToClusterItSeeds, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~Multi5x5ClusterProducer()

Multi5x5ClusterProducer::~Multi5x5ClusterProducer ( )
override

Definition at line 78 of file Multi5x5ClusterProducer.cc.

78 { delete island_p; }

References island_p.

Member Function Documentation

◆ clusterizeECALPart()

void Multi5x5ClusterProducer::clusterizeECALPart ( edm::Event evt,
const edm::EventSetup es,
const edm::EDGetTokenT< EcalRecHitCollection > &  token,
const std::string &  clusterCollection,
const reco::CaloID::Detectors  detector 
)
private

Definition at line 98 of file Multi5x5ClusterProducer.cc.

102  {
103  // get the hit collection from the event:
104  const EcalRecHitCollection* hitCollection_p = getCollection(evt, token);
105 
106  // get the geometry and topology from the event setup:
108 
109  const CaloSubdetectorGeometry* geometry_p;
110  std::unique_ptr<CaloSubdetectorTopology> topology_p;
111 
113  geometry_p = geoHandle->getSubdetectorGeometry(DetId::Ecal, EcalBarrel);
114  topology_p = std::make_unique<EcalBarrelTopology>(*geoHandle);
115  } else {
116  geometry_p = geoHandle->getSubdetectorGeometry(DetId::Ecal, EcalEndcap);
117  topology_p = std::make_unique<EcalEndcapTopology>(*geoHandle);
118  }
119 
120  const CaloSubdetectorGeometry* geometryES_p;
121  geometryES_p = geoHandle->getSubdetectorGeometry(DetId::Ecal, EcalPreshower);
122 
123  // Run the clusterization algorithm:
125  clusters = island_p->makeClusters(hitCollection_p, geometry_p, topology_p.get(), geometryES_p, detector);
126 
127  // create a unique_ptr to a BasicClusterCollection, copy the barrel clusters into it and put in the Event:
128  auto clusters_p = std::make_unique<reco::BasicClusterCollection>();
129  clusters_p->assign(clusters.begin(), clusters.end());
132  bccHandle = evt.put(std::move(clusters_p), barrelClusterCollection_);
133  else
134  bccHandle = evt.put(std::move(clusters_p), endcapClusterCollection_);
135 }

References barrelClusterCollection_, caloGeometryToken_, bsc_activity_cfg::clusters, reco::CaloID::DET_ECAL_BARREL, hgcalTestNeighbor_cfi::detector, DetId::Ecal, EcalBarrel, EcalEndcap, EcalPreshower, endcapClusterCollection_, getCollection(), edm::EventSetup::getHandle(), CaloGeometry::getSubdetectorGeometry(), island_p, Multi5x5ClusterAlgo::makeClusters(), eostools::move(), edm::Event::put(), and unpackBuffers-CaloStage2::token.

Referenced by produce().

◆ counterExceeded()

bool Multi5x5ClusterProducer::counterExceeded ( ) const
inlineprivate

Definition at line 53 of file Multi5x5ClusterProducer.h.

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

References nEvt_, and nMaxPrintout_.

◆ getCollection()

const EcalRecHitCollection * Multi5x5ClusterProducer::getCollection ( edm::Event evt,
const edm::EDGetTokenT< EcalRecHitCollection > &  token 
)
private

Definition at line 91 of file Multi5x5ClusterProducer.cc.

92  {
94  evt.getByToken(token, rhcHandle);
95  return rhcHandle.product();
96 }

References edm::Event::getByToken(), edm::Handle< T >::product(), and unpackBuffers-CaloStage2::token.

Referenced by clusterizeECALPart().

◆ outputValidationInfo()

void Multi5x5ClusterProducer::outputValidationInfo ( reco::CaloClusterPtrVector clusterPtrVector)
private

◆ produce()

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

Member Data Documentation

◆ barrelClusterCollection_

std::string Multi5x5ClusterProducer::barrelClusterCollection_
private

Definition at line 47 of file Multi5x5ClusterProducer.h.

Referenced by clusterizeECALPart(), Multi5x5ClusterProducer(), and produce().

◆ barrelHitToken_

edm::EDGetTokenT<EcalRecHitCollection> Multi5x5ClusterProducer::barrelHitToken_
private

Definition at line 43 of file Multi5x5ClusterProducer.h.

Referenced by Multi5x5ClusterProducer(), and produce().

◆ caloGeometryToken_

edm::ESGetToken<CaloGeometry, CaloGeometryRecord> Multi5x5ClusterProducer::caloGeometryToken_
private

Definition at line 45 of file Multi5x5ClusterProducer.h.

Referenced by clusterizeECALPart(), and Multi5x5ClusterProducer().

◆ doBarrel_

bool Multi5x5ClusterProducer::doBarrel_
private

Definition at line 40 of file Multi5x5ClusterProducer.h.

Referenced by Multi5x5ClusterProducer(), and produce().

◆ doEndcap_

bool Multi5x5ClusterProducer::doEndcap_
private

Definition at line 41 of file Multi5x5ClusterProducer.h.

Referenced by Multi5x5ClusterProducer(), and produce().

◆ endcapClusterCollection_

std::string Multi5x5ClusterProducer::endcapClusterCollection_
private

Definition at line 48 of file Multi5x5ClusterProducer.h.

Referenced by clusterizeECALPart(), Multi5x5ClusterProducer(), and produce().

◆ endcapHitToken_

edm::EDGetTokenT<EcalRecHitCollection> Multi5x5ClusterProducer::endcapHitToken_
private

Definition at line 44 of file Multi5x5ClusterProducer.h.

Referenced by Multi5x5ClusterProducer(), and produce().

◆ island_p

Multi5x5ClusterAlgo* Multi5x5ClusterProducer::island_p
private

◆ nEvt_

int Multi5x5ClusterProducer::nEvt_
private

Definition at line 37 of file Multi5x5ClusterProducer.h.

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

◆ nMaxPrintout_

int Multi5x5ClusterProducer::nMaxPrintout_
private

Definition at line 36 of file Multi5x5ClusterProducer.h.

Referenced by counterExceeded().

◆ posCalculator_

PositionCalc Multi5x5ClusterProducer::posCalculator_
private

Definition at line 50 of file Multi5x5ClusterProducer.h.

Referenced by Multi5x5ClusterProducer().

edm::Handle::product
T const * product() const
Definition: Handle.h:70
Multi5x5ClusterProducer::barrelHitToken_
edm::EDGetTokenT< EcalRecHitCollection > barrelHitToken_
Definition: Multi5x5ClusterProducer.h:43
Multi5x5ClusterProducer::barrelClusterCollection_
std::string barrelClusterCollection_
Definition: Multi5x5ClusterProducer.h:47
reco::CaloID::DET_ECAL_ENDCAP
Definition: CaloID.h:21
CaloGeometry::getSubdetectorGeometry
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
edm::SortedCollection< EcalRecHit >
MonitorAlCaEcalPi0_cfi.posCalcParameters
posCalcParameters
Definition: MonitorAlCaEcalPi0_cfi.py:72
edm::Handle
Definition: AssociativeIterator.h:50
EcalBarrel
Definition: EcalSubdetector.h:10
Multi5x5ClusterProducer::endcapHitToken_
edm::EDGetTokenT< EcalRecHitCollection > endcapHitToken_
Definition: Multi5x5ClusterProducer.h:44
Multi5x5ClusterProducer::nEvt_
int nEvt_
Definition: Multi5x5ClusterProducer.h:37
edm::ESHandle< CaloGeometry >
Multi5x5ClusterProducer::island_p
Multi5x5ClusterAlgo * island_p
Definition: Multi5x5ClusterProducer.h:51
Multi5x5ClusterAlgo::makeClusters
std::vector< reco::BasicCluster > makeClusters(const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry, const CaloSubdetectorTopology *topology_p, const CaloSubdetectorGeometry *geometryES_p, reco::CaloID::Detectors detector, bool regional=false, const std::vector< RectangularEtaPhiRegion > &regions=std::vector< RectangularEtaPhiRegion >())
Definition: Multi5x5ClusterAlgo.cc:54
Multi5x5ClusterAlgo
Definition: Multi5x5ClusterAlgo.h:27
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:531
Multi5x5ClusterProducer::doEndcap_
bool doEndcap_
Definition: Multi5x5ClusterProducer.h:41
reco::BasicClusterCollection
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects
Definition: BasicClusterFwd.h:16
multi5x5BasicClusters_cfi.reassignSeedCrysToClusterItSeeds
reassignSeedCrysToClusterItSeeds
Definition: multi5x5BasicClusters_cfi.py:25
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalEndcap
Definition: EcalSubdetector.h:10
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:681
Multi5x5ClusterProducer::endcapClusterCollection_
std::string endcapClusterCollection_
Definition: Multi5x5ClusterProducer.h:48
Multi5x5ClusterProducer::getCollection
const EcalRecHitCollection * getCollection(edm::Event &evt, const edm::EDGetTokenT< EcalRecHitCollection > &token)
Definition: Multi5x5ClusterProducer.cc:91
edm::ParameterSet
Definition: ParameterSet.h:47
Multi5x5ClusterProducer::caloGeometryToken_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometryToken_
Definition: Multi5x5ClusterProducer.h:45
Multi5x5ClusterProducer::doBarrel_
bool doBarrel_
Definition: Multi5x5ClusterProducer.h:40
PositionCalc
Definition: PositionCalc.h:29
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:148
Multi5x5ClusterProducer::posCalculator_
PositionCalc posCalculator_
Definition: Multi5x5ClusterProducer.h:50
DetId::Ecal
Definition: DetId.h:27
EcalPreshower
Definition: EcalSubdetector.h:10
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::OrphanHandle
Definition: EDProductfwd.h:39
CaloSubdetectorGeometry
Definition: CaloSubdetectorGeometry.h:22
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
hgcalTestNeighbor_cfi.detector
detector
Definition: hgcalTestNeighbor_cfi.py:6
Multi5x5ClusterProducer::nMaxPrintout_
int nMaxPrintout_
Definition: Multi5x5ClusterProducer.h:36
Multi5x5ClusterProducer::clusterizeECALPart
void clusterizeECALPart(edm::Event &evt, const edm::EventSetup &es, const edm::EDGetTokenT< EcalRecHitCollection > &token, const std::string &clusterCollection, const reco::CaloID::Detectors detector)
Definition: Multi5x5ClusterProducer.cc:98
edm::InputTag
Definition: InputTag.h:15
reco::CaloID::DET_ECAL_BARREL
Definition: CaloID.h:20
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:318