CMS 3D CMS Logo

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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::EDGetTokenT< std::vector< reco::CaloCluster > > clusters_token_
 
hgcal::RecHitTools rhtools_
 

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 17 of file TICLLayerTileProducer.cc.

Constructor & Destructor Documentation

◆ TICLLayerTileProducer()

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

Definition at line 30 of file TICLLayerTileProducer.cc.

30  {
31  clusters_token_ = consumes<std::vector<reco::CaloCluster>>(ps.getParameter<edm::InputTag>("layer_clusters"));
32 
33  produces<TICLLayerTiles>();
34 }

References clusters_token_, and edm::ParameterSet::getParameter().

◆ ~TICLLayerTileProducer()

TICLLayerTileProducer::~TICLLayerTileProducer ( )
inlineoverride

Definition at line 20 of file TICLLayerTileProducer.cc.

20 {};

Member Function Documentation

◆ beginRun()

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

Definition at line 36 of file TICLLayerTileProducer.cc.

36 { rhtools_.getEventSetup(es); }

References hgcal::RecHitTools::getEventSetup(), and rhtools_.

◆ fillDescriptions()

void TICLLayerTileProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 59 of file TICLLayerTileProducer.cc.

59  {
61  desc.add<edm::InputTag>("layer_clusters", edm::InputTag("hgcalLayerClusters"));
62  descriptions.add("ticlLayerTileProducer", desc);
63 }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and HLT_2018_cff::InputTag.

◆ produce()

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

Definition at line 38 of file TICLLayerTileProducer.cc.

38  {
39  auto result = std::make_unique<TICLLayerTiles>();
40 
42  evt.getByToken(clusters_token_, cluster_h);
43  const auto &layerClusters = *cluster_h;
44  int lcId = 0;
45  for (auto const &lc : layerClusters) {
46  const auto firstHitDetId = lc.hitsAndFractions()[0].first;
47  int layer = rhtools_.getLayerWithOffset(firstHitDetId) +
48  rhtools_.lastLayerFH() * ((rhtools_.zside(firstHitDetId) + 1) >> 1) - 1;
49  assert(layer >= 0);
50  result->fill(layer, lc.eta(), lc.phi(), lcId);
51  LogDebug("TICLLayerTileProducer") << "Adding layerClusterId: " << lcId << " into bin [eta,phi]: [ "
52  << (*result)[layer].etaBin(lc.eta()) << ", " << (*result)[layer].phiBin(lc.phi())
53  << "] for layer: " << layer << std::endl;
54  lcId++;
55  }
56  evt.put(std::move(result));
57 }

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

Member Data Documentation

◆ clusters_token_

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

Definition at line 26 of file TICLLayerTileProducer.cc.

Referenced by produce(), and TICLLayerTileProducer().

◆ rhtools_

hgcal::RecHitTools TICLLayerTileProducer::rhtools_
private

Definition at line 27 of file TICLLayerTileProducer.cc.

Referenced by beginRun(), and produce().

edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
cms::cuda::assert
assert(be >=bs)
edm::Handle
Definition: AssociativeIterator.h:50
TICLLayerTileProducer::clusters_token_
edm::EDGetTokenT< std::vector< reco::CaloCluster > > clusters_token_
Definition: TICLLayerTileProducer.cc:26
hgcal::RecHitTools::lastLayerFH
unsigned int lastLayerFH() const
Definition: RecHitTools.h:64
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
hgcal::RecHitTools::getLayerWithOffset
unsigned int getLayerWithOffset(const DetId &) const
Definition: RecHitTools.cc:357
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:132
hgcal::RecHitTools::zside
int zside(const DetId &id) const
Definition: RecHitTools.cc:165
hgcal::RecHitTools::getEventSetup
void getEventSetup(const edm::EventSetup &)
Definition: RecHitTools.cc:70
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
TICLLayerTileProducer::rhtools_
hgcal::RecHitTools rhtools_
Definition: TICLLayerTileProducer.cc:27
mps_fire.result
result
Definition: mps_fire.py:303
edm::InputTag
Definition: InputTag.h:15