CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
TICLLayerTileProducer Class Reference
Inheritance diagram for TICLLayerTileProducer:
edm::stream::EDProducer<>

Public Member Functions

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

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::EDGetTokenT< std::vector
< reco::CaloCluster > > 
clusters_HFNose_token_
 
edm::EDGetTokenT< std::vector
< reco::CaloCluster > > 
clusters_token_
 
std::string detector_
 
bool doNose_
 
edm::ESGetToken< CaloGeometry,
CaloGeometryRecord
geometry_token_
 
hgcal::RecHitTools rhtools_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 17 of file TICLLayerTileProducer.cc.

Constructor & Destructor Documentation

TICLLayerTileProducer::TICLLayerTileProducer ( const edm::ParameterSet ps)
explicit

Definition at line 34 of file TICLLayerTileProducer.cc.

References clusters_HFNose_token_, clusters_token_, detector_, doNose_, geometry_token_, and edm::ParameterSet::getParameter().

35  : detector_(ps.getParameter<std::string>("detector")) {
37  consumes<std::vector<reco::CaloCluster>>(ps.getParameter<edm::InputTag>("layer_HFNose_clusters"));
38  clusters_token_ = consumes<std::vector<reco::CaloCluster>>(ps.getParameter<edm::InputTag>("layer_clusters"));
39  geometry_token_ = esConsumes<CaloGeometry, CaloGeometryRecord, edm::Transition::BeginRun>();
40 
41  doNose_ = (detector_ == "HFNose");
42 
43  if (doNose_)
44  produces<TICLLayerTilesHFNose>();
45  else
46  produces<TICLLayerTiles>();
47 }
edm::EDGetTokenT< std::vector< reco::CaloCluster > > clusters_HFNose_token_
edm::EDGetTokenT< std::vector< reco::CaloCluster > > clusters_token_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geometry_token_
TICLLayerTileProducer::~TICLLayerTileProducer ( )
inlineoverride

Definition at line 20 of file TICLLayerTileProducer.cc.

20 {};

Member Function Documentation

void TICLLayerTileProducer::beginRun ( edm::Run const &  ,
edm::EventSetup const &  es 
)
override

Definition at line 49 of file TICLLayerTileProducer.cc.

References relativeConstraints::geom, geometry_token_, edm::EventSetup::getHandle(), rhtools_, and hgcal::RecHitTools::setGeometry().

49  {
51  rhtools_.setGeometry(*geom);
52 }
hgcal::RecHitTools rhtools_
void setGeometry(CaloGeometry const &)
Definition: RecHitTools.cc:68
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geometry_token_
void TICLLayerTileProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 88 of file TICLLayerTileProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

88  {
90  desc.add<std::string>("detector", "HGCAL");
91  desc.add<edm::InputTag>("layer_clusters", edm::InputTag("hgcalLayerClusters"));
92  desc.add<edm::InputTag>("layer_HFNose_clusters", edm::InputTag("hgcalLayerClustersHFNose"));
93  descriptions.add("ticlLayerTileProducer", desc);
94 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void TICLLayerTileProducer::produce ( edm::Event evt,
const edm::EventSetup  
)
override

Definition at line 54 of file TICLLayerTileProducer.cc.

References cms::cuda::assert(), clusters_HFNose_token_, clusters_token_, doNose_, edm::Event::getByToken(), hgcal::RecHitTools::getLayerWithOffset(), hgcal::RecHitTools::lastLayer(), phase1PixelTopology::layer, LogDebug, eostools::move(), edm::Event::put(), mps_fire::result, rhtools_, and hgcal::RecHitTools::zside().

54  {
55  auto result = std::make_unique<TICLLayerTiles>();
56  auto resultHFNose = std::make_unique<TICLLayerTilesHFNose>();
57 
59  if (doNose_)
60  evt.getByToken(clusters_HFNose_token_, cluster_h);
61  else
62  evt.getByToken(clusters_token_, cluster_h);
63 
64  const auto &layerClusters = *cluster_h;
65  int lcId = 0;
66  for (auto const &lc : layerClusters) {
67  const auto firstHitDetId = lc.hitsAndFractions()[0].first;
68  int layer = rhtools_.getLayerWithOffset(firstHitDetId) +
69  rhtools_.lastLayer(doNose_) * ((rhtools_.zside(firstHitDetId) + 1) >> 1) - 1;
70 
71  assert(layer >= 0);
72 
73  if (doNose_)
74  resultHFNose->fill(layer, lc.eta(), lc.phi(), lcId);
75  else
76  result->fill(layer, lc.eta(), lc.phi(), lcId);
77  LogDebug("TICLLayerTileProducer") << "Adding layerClusterId: " << lcId << " into bin [eta,phi]: [ "
78  << (*result)[layer].etaBin(lc.eta()) << ", " << (*result)[layer].phiBin(lc.phi())
79  << "] for layer: " << layer << std::endl;
80  lcId++;
81  }
82  if (doNose_)
83  evt.put(std::move(resultHFNose));
84  else
85  evt.put(std::move(result));
86 }
edm::EDGetTokenT< std::vector< reco::CaloCluster > > clusters_HFNose_token_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
int zside(const DetId &id) const
Definition: RecHitTools.cc:163
hgcal::RecHitTools rhtools_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
assert(be >=bs)
constexpr std::array< uint8_t, layerIndexSize > layer
tuple result
Definition: mps_fire.py:311
def move
Definition: eostools.py:511
unsigned int lastLayer(bool nose=false) const
Definition: RecHitTools.h:79
edm::EDGetTokenT< std::vector< reco::CaloCluster > > clusters_token_
unsigned int getLayerWithOffset(const DetId &) const
Definition: RecHitTools.cc:365
#define LogDebug(id)

Member Data Documentation

edm::EDGetTokenT<std::vector<reco::CaloCluster> > TICLLayerTileProducer::clusters_HFNose_token_
private

Definition at line 27 of file TICLLayerTileProducer.cc.

Referenced by produce(), and TICLLayerTileProducer().

edm::EDGetTokenT<std::vector<reco::CaloCluster> > TICLLayerTileProducer::clusters_token_
private

Definition at line 26 of file TICLLayerTileProducer.cc.

Referenced by produce(), and TICLLayerTileProducer().

std::string TICLLayerTileProducer::detector_
private

Definition at line 30 of file TICLLayerTileProducer.cc.

Referenced by TICLLayerTileProducer().

bool TICLLayerTileProducer::doNose_
private

Definition at line 31 of file TICLLayerTileProducer.cc.

Referenced by produce(), and TICLLayerTileProducer().

edm::ESGetToken<CaloGeometry, CaloGeometryRecord> TICLLayerTileProducer::geometry_token_
private

Definition at line 28 of file TICLLayerTileProducer.cc.

Referenced by beginRun(), and TICLLayerTileProducer().

hgcal::RecHitTools TICLLayerTileProducer::rhtools_
private

Definition at line 29 of file TICLLayerTileProducer.cc.

Referenced by beginRun(), and produce().