CMS 3D CMS Logo

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

#include <RecoLocalCalo/Castor/src/CastorCellProducer.cc>

Inheritance diagram for CastorCellProducer:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CastorCellProducer (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::global::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
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Types

typedef std::vector< reco::CastorCellCastorCellCollection
 
typedef ROOT::Math::RhoZPhiPoint CellPoint
 
typedef math::XYZPointD Point
 

Private Member Functions

void beginJob () override
 
void endJob () override
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 

Private Attributes

edm::EDGetTokenT< CastorRecHitCollectiontok_input_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Description: CastorCell Reconstruction Producer. Produce CastorCells from CastorRecHits. Implementation:

Definition at line 43 of file CastorCellProducer.cc.

Member Typedef Documentation

◆ CastorCellCollection

Definition at line 55 of file CastorCellProducer.cc.

◆ CellPoint

typedef ROOT::Math::RhoZPhiPoint CastorCellProducer::CellPoint
private

Definition at line 54 of file CastorCellProducer.cc.

◆ Point

Definition at line 53 of file CastorCellProducer.cc.

Constructor & Destructor Documentation

◆ CastorCellProducer()

CastorCellProducer::CastorCellProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 73 of file CastorCellProducer.cc.

References edm::ParameterSet::getUntrackedParameter(), ProducerED_cfi::InputTag, AlCaHLTBitMon_QueryRunRegistry::string, and tok_input_.

73  {
74  tok_input_ = consumes<CastorRecHitCollection>(
75  edm::InputTag(iConfig.getUntrackedParameter<std::string>("inputprocess", "castorreco")));
76  // register your products
77  produces<CastorCellCollection>();
78  // now do what ever other initialization is needed
79 }
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< CastorRecHitCollection > tok_input_

Member Function Documentation

◆ beginJob()

void CastorCellProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 168 of file CastorCellProducer.cc.

References LogDebug.

168 { LogDebug("CastorCellProducer") << "Starting CastorCellProducer"; }
#define LogDebug(id)

◆ endJob()

void CastorCellProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 171 of file CastorCellProducer.cc.

References LogDebug.

171 { LogDebug("CastorCellProducer") << "Ending CastorCellProducer"; }
#define LogDebug(id)

◆ produce()

void CastorCellProducer::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overrideprivatevirtual

Implements edm::global::EDProducerBase.

Definition at line 87 of file CastorCellProducer.cc.

References hcalRecHitTable_cff::energy, CaloRecHit::energy(), mps_fire::i, CastorRecHit::id(), iEvent, dqmiolumiharvest::j, LogDebug, HcalCastorDetId::module(), eostools::move(), nano_mu_digi_cff::sector, HcalCastorDetId::sector(), edm::SortedCollection< T, SORT >::size(), tok_input_, HcalCastorDetId::zside(), and ecaldqm::zside().

87  {
88  using namespace edm;
89  using namespace reco;
90  using namespace TMath;
91 
92  // Produce CastorCells from CastorRecHits
93 
95  iEvent.getByToken(tok_input_, InputRecHits);
96 
97  auto OutputCells = std::make_unique<CastorCellCollection>();
98 
99  // looping over all CastorRecHits
100 
101  LogDebug("CastorCellProducer") << "1. entering CastorCellProducer ";
102 
103  for (size_t i = 0; i < InputRecHits->size(); ++i) {
104  const CastorRecHit& rh = (*InputRecHits)[i];
105  int sector = rh.id().sector();
106  int module = rh.id().module();
107  double energy = rh.energy();
108  int zside = rh.id().zside();
109 
110  // define CastorCell properties
111  double zCell = 0.;
112  double phiCell;
113  double rhoCell;
114 
115  // set z position of the cell
116  if (module < 3) {
117  // starting in EM section
118  if (module == 1)
119  zCell = 14415;
120  if (module == 2)
121  zCell = 14464;
122  } else {
123  // starting in HAD section
124  zCell = 14534 + (module - 3) * 92;
125  }
126 
127  // set phi position of the cell
128  double castorphi[16];
129  for (int j = 0; j < 16; j++) {
130  castorphi[j] = -2.94524 + j * 0.3927;
131  }
132  if (sector > 8) {
133  phiCell = castorphi[sector - 9];
134  } else {
135  phiCell = castorphi[sector + 7];
136  }
137 
138  // add condition to select in eta sides
139  if (zside <= 0)
140  zCell = -1 * zCell;
141 
142  // set rho position of the cell (inner radius 3.7cm, outer radius 14cm)
143  rhoCell = 88.5;
144 
145  // store cell position
146  CellPoint tempcellposition(rhoCell, zCell, phiCell);
147  Point cellposition(tempcellposition);
148 
149  LogDebug("CastorCellProducer") << "cell number: " << i + 1 << std::endl
150  << "rho: " << cellposition.rho() << " phi: " << cellposition.phi() * MYR2D
151  << " eta: " << cellposition.eta() << std::endl
152  << "x: " << cellposition.x() << " y: " << cellposition.y()
153  << " z: " << cellposition.z();
154 
155  if (energy > 0.) {
156  CastorCell newCell(energy, cellposition);
157  OutputCells->push_back(newCell);
158  }
159 
160  } // end loop over CastorRecHits
161 
162  LogDebug("CastorCellProducer") << "total number of cells in the event: " << InputRecHits->size();
163 
164  iEvent.put(std::move(OutputCells));
165 }
size_type size() const
HcalCastorDetId id() const
get the id
Definition: CastorRecHit.h:14
int zside(DetId const &)
constexpr float energy() const
Definition: CaloRecHit.h:29
edm::EDGetTokenT< CastorRecHitCollection > tok_input_
int iEvent
Definition: GenABIO.cc:224
int module() const
get the module (1-2 for EM, 1-12 for HAD)
int zside() const
get the z-side of the cell (1/-1)
int sector() const
get the sector (1-16)
fixed size matrix
HLT enums.
Structure Point Contains parameters of Gaussian fits to DMRs.
ROOT::Math::RhoZPhiPoint CellPoint
def move(src, dest)
Definition: eostools.py:511
#define LogDebug(id)

Member Data Documentation

◆ tok_input_

edm::EDGetTokenT<CastorRecHitCollection> CastorCellProducer::tok_input_
private

Definition at line 56 of file CastorCellProducer.cc.

Referenced by CastorCellProducer(), and produce().