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::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CastorCellProducer (const edm::ParameterSet &)
 
 ~CastorCellProducer () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > 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
 
bool registeredToConsumeMany (TypeID const &, 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::ESRecordsToProxyIndices 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::Event &, const edm::EventSetup &) override
 

Private Attributes

edm::EDGetTokenT< CastorRecHitCollectiontok_input_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
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::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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 56 of file CastorCellProducer.cc.

◆ CellPoint

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

Definition at line 55 of file CastorCellProducer.cc.

◆ Point

Definition at line 54 of file CastorCellProducer.cc.

Constructor & Destructor Documentation

◆ CastorCellProducer()

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

Definition at line 74 of file CastorCellProducer.cc.

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

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

◆ ~CastorCellProducer()

CastorCellProducer::~CastorCellProducer ( )
override

Definition at line 82 of file CastorCellProducer.cc.

82  {
83  // do anything here that needs to be done at desctruction time
84  // (e.g. close files, deallocate resources etc.)
85 }

Member Function Documentation

◆ beginJob()

void CastorCellProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 174 of file CastorCellProducer.cc.

References LogDebug.

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

◆ endJob()

void CastorCellProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 177 of file CastorCellProducer.cc.

References LogDebug.

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

◆ produce()

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

Implements edm::EDProducer.

Definition at line 93 of file CastorCellProducer.cc.

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

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

Referenced by CastorCellProducer(), and produce().