CMS 3D CMS Logo

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

#include <L1RCTInputProducer.h>

Inheritance diagram for L1RCTInputProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 L1RCTInputProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &e, const edm::EventSetup &c) override
 
 ~L1RCTInputProducer () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (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::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

edm::InputTag ecalDigisLabel
 
edm::InputTag hcalDigisLabel
 
L1RCTrct
 
L1RCTLookupTablesrctLookupTables
 
bool useEcal
 
bool useHcal
 

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 wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
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)
 
template<Transition B>
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 (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 19 of file L1RCTInputProducer.h.

Constructor & Destructor Documentation

◆ L1RCTInputProducer()

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

Definition at line 30 of file L1RCTInputProducer.cc.

33  useEcal(conf.getParameter<bool>("useEcal")),
34  useHcal(conf.getParameter<bool>("useHcal")),
35  ecalDigisLabel(conf.getParameter<edm::InputTag>("ecalDigisLabel")),
36  hcalDigisLabel(conf.getParameter<edm::InputTag>("hcalDigisLabel")) {
37  produces<std::vector<unsigned short>>("rctCrate");
38  produces<std::vector<unsigned short>>("rctCard");
39  produces<std::vector<unsigned short>>("rctTower");
40  produces<std::vector<unsigned int>>("rctEGammaET");
41  produces<std::vector<bool>>("rctHoEFGVetoBit");
42  produces<std::vector<unsigned int>>("rctJetMETET");
43  produces<std::vector<bool>>("rctTowerActivityBit");
44  produces<std::vector<bool>>("rctTowerMIPBit");
45  produces<std::vector<unsigned short>>("rctHFCrate");
46  produces<std::vector<unsigned short>>("rctHFRegion");
47  produces<std::vector<unsigned int>>("rctHFET");
48  produces<std::vector<bool>>("rctHFFG");
49 }

◆ ~L1RCTInputProducer()

L1RCTInputProducer::~L1RCTInputProducer ( )
override

Definition at line 51 of file L1RCTInputProducer.cc.

51  {
52  if (rct != nullptr)
53  delete rct;
54  if (rctLookupTables != nullptr)
55  delete rctLookupTables;
56 }

References rct, and rctLookupTables.

Member Function Documentation

◆ produce()

void L1RCTInputProducer::produce ( edm::Event e,
const edm::EventSetup c 
)
overridevirtual

Implements edm::EDProducer.

Definition at line 58 of file L1RCTInputProducer.cc.

58  {
59  // Refresh configuration information every event
60  // Hopefully, this does not take too much time
61  // There should be a call back function in future to
62  // handle changes in configuration
63 
64  edm::ESHandle<L1RCTParameters> rctParameters;
65  eventSetup.get<L1RCTParametersRcd>().get(rctParameters);
66  const L1RCTParameters *r = rctParameters.product();
68  eventSetup.get<L1RCTChannelMaskRcd>().get(channelMask);
69  const L1RCTChannelMask *c = channelMask.product();
71  eventSetup.get<L1CaloEcalScaleRcd>().get(ecalScale);
72  const L1CaloEcalScale *e = ecalScale.product();
74  eventSetup.get<L1CaloHcalScaleRcd>().get(hcalScale);
75  const L1CaloHcalScale *h = hcalScale.product();
77  eventSetup.get<L1EmEtScaleRcd>().get(emScale);
78  const L1CaloEtScale *s = emScale.product();
79 
85 
88 
89  if (useEcal) {
90  event.getByLabel(ecalDigisLabel, ecal);
91  }
92  if (useHcal) {
93  event.getByLabel(hcalDigisLabel, hcal);
94  }
95 
98  if (ecal.isValid()) {
99  ecalColl = *ecal;
100  }
101  if (hcal.isValid()) {
102  hcalColl = *hcal;
103  }
104 
105  rct->digiInput(ecalColl, hcalColl);
106 
107  // Stuff to create
108 
109  std::unique_ptr<std::vector<unsigned short>> rctCrate(new std::vector<unsigned short>);
110  std::unique_ptr<std::vector<unsigned short>> rctCard(new std::vector<unsigned short>);
111  std::unique_ptr<std::vector<unsigned short>> rctTower(new std::vector<unsigned short>);
112  std::unique_ptr<std::vector<unsigned int>> rctEGammaET(new std::vector<unsigned int>);
113  std::unique_ptr<std::vector<bool>> rctHoEFGVetoBit(new std::vector<bool>);
114  std::unique_ptr<std::vector<unsigned int>> rctJetMETET(new std::vector<unsigned int>);
115  std::unique_ptr<std::vector<bool>> rctTowerActivityBit(new std::vector<bool>);
116  std::unique_ptr<std::vector<bool>> rctTowerMIPBit(new std::vector<bool>);
117 
118  for (int crate = 0; crate < 18; crate++) {
119  for (int card = 0; card < 7; card++) {
120  for (int tower = 0; tower < 32; tower++) {
121  unsigned short ecalCompressedET = rct->ecalCompressedET(crate, card, tower);
122  unsigned short ecalFineGrainBit = rct->ecalFineGrainBit(crate, card, tower);
123  unsigned short hcalCompressedET = rct->hcalCompressedET(crate, card, tower);
124  unsigned int lutBits =
125  rctLookupTables->lookup(ecalCompressedET, hcalCompressedET, ecalFineGrainBit, crate, card, tower);
126  unsigned int eGammaETCode = lutBits & 0x0000007F;
127  bool hOeFGVetoBit = (lutBits >> 7) & 0x00000001;
128  unsigned int jetMETETCode = (lutBits >> 8) & 0x000001FF;
129  bool activityBit = (lutBits >> 17) & 0x00000001;
130  if (eGammaETCode > 0 || jetMETETCode > 0 || hOeFGVetoBit || activityBit) {
131  rctCrate->push_back(crate);
132  rctCard->push_back(card);
133  rctTower->push_back(tower);
134  rctEGammaET->push_back(eGammaETCode);
135  rctHoEFGVetoBit->push_back(hOeFGVetoBit);
136  rctJetMETET->push_back(jetMETETCode);
137  rctTowerActivityBit->push_back(activityBit);
138  rctTowerMIPBit->push_back(false); // FIXME: MIP bit is not yet defined
139  }
140  }
141  }
142  }
143 
144  std::unique_ptr<std::vector<unsigned short>> rctHFCrate(new std::vector<unsigned short>);
145  std::unique_ptr<std::vector<unsigned short>> rctHFRegion(new std::vector<unsigned short>);
146  std::unique_ptr<std::vector<unsigned int>> rctHFET(new std::vector<unsigned int>);
147  std::unique_ptr<std::vector<bool>> rctHFFG(new std::vector<bool>);
148  for (int crate = 0; crate < 18; crate++) {
149  for (int hfRegion = 0; hfRegion < 8; hfRegion++) {
150  unsigned short hfCompressedET = rct->hfCompressedET(crate, hfRegion);
151  unsigned int hfETCode = rctLookupTables->lookup(hfCompressedET, crate, 999, hfRegion);
152  if (hfETCode > 0) {
153  rctHFCrate->push_back(crate);
154  rctHFRegion->push_back(hfRegion);
155  rctHFET->push_back(hfETCode);
156  rctHFFG->push_back(false); // FIXME: HF FG is not yet defined
157  }
158  }
159  }
160 
161  // putting stuff back into event
162  event.put(std::move(rctCrate), "rctCrate");
163  event.put(std::move(rctCard), "rctCard");
164  event.put(std::move(rctTower), "rctTower");
165  event.put(std::move(rctEGammaET), "rctEGammaET");
166  event.put(std::move(rctHoEFGVetoBit), "rctHoEFGVetoBit");
167  event.put(std::move(rctJetMETET), "rctJetMETET");
168  event.put(std::move(rctTowerActivityBit), "rctTowerActivityBit");
169  event.put(std::move(rctTowerMIPBit), "rctTowerMIPBit");
170  event.put(std::move(rctHFCrate), "rctHFCrate");
171  event.put(std::move(rctHFRegion), "rctHFRegion");
172  event.put(std::move(rctHFET), "rctHFET");
173  event.put(std::move(rctHFFG), "rctHFFG");
174 }

References HltBtagPostValidation_cff::c, L1RCT::digiInput(), MillePedeFileConverter_cfg::e, bsc_activity_cfg::ecal, L1RCT::ecalCompressedET(), ecalDigisLabel, L1RCT::ecalFineGrainBit(), edm::EventSetup::get(), get, patCandidatesForDimuonsSequences_cff::hcal, L1RCT::hcalCompressedET(), hcalDigisLabel, L1RCT::hfCompressedET(), L1RCTLookupTables::lookup(), eostools::move(), edm::ESHandle< T >::product(), alignCSCRings::r, rct, rctLookupTables, alignCSCRings::s, L1RCTLookupTables::setChannelMask(), L1RCTLookupTables::setEcalScale(), L1RCTLookupTables::setHcalScale(), L1RCTLookupTables::setL1CaloEtScale(), L1RCTLookupTables::setRCTParameters(), hgcalTowerProducer_cfi::tower, useEcal, and useHcal.

Member Data Documentation

◆ ecalDigisLabel

edm::InputTag L1RCTInputProducer::ecalDigisLabel
private

Definition at line 30 of file L1RCTInputProducer.h.

Referenced by produce().

◆ hcalDigisLabel

edm::InputTag L1RCTInputProducer::hcalDigisLabel
private

Definition at line 31 of file L1RCTInputProducer.h.

Referenced by produce().

◆ rct

L1RCT* L1RCTInputProducer::rct
private

Definition at line 27 of file L1RCTInputProducer.h.

Referenced by produce(), and ~L1RCTInputProducer().

◆ rctLookupTables

L1RCTLookupTables* L1RCTInputProducer::rctLookupTables
private

Definition at line 26 of file L1RCTInputProducer.h.

Referenced by produce(), and ~L1RCTInputProducer().

◆ useEcal

bool L1RCTInputProducer::useEcal
private

Definition at line 28 of file L1RCTInputProducer.h.

Referenced by produce().

◆ useHcal

bool L1RCTInputProducer::useHcal
private

Definition at line 29 of file L1RCTInputProducer.h.

Referenced by produce().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
L1CaloHcalScale
Definition: L1CaloHcalScale.h:28
L1CaloEcalScale
Definition: L1CaloEcalScale.h:28
L1RCTLookupTables::lookup
unsigned int lookup(unsigned short ecalInput, unsigned short hcalInput, unsigned short fgbit, unsigned short crtNo, unsigned short crdNo, unsigned short twrNo) const
Definition: L1RCTLookupTables.cc:22
L1RCTInputProducer::rct
L1RCT * rct
Definition: L1RCTInputProducer.h:27
hcal
Definition: ConfigurationDatabase.cc:13
L1CaloEcalScaleRcd
Definition: L1CaloEcalScaleRcd.h:12
L1RCTInputProducer::useHcal
bool useHcal
Definition: L1RCTInputProducer.h:29
L1RCTParametersRcd
Definition: L1RCTParametersRcd.h:12
hgcalTowerProducer_cfi.tower
tower
Definition: hgcalTowerProducer_cfi.py:3
L1RCT::hfCompressedET
unsigned short hfCompressedET(int crate, int tower)
Definition: L1RCT.h:71
edm::SortedCollection
Definition: SortedCollection.h:49
L1RCTChannelMask
Definition: L1RCTChannelMask.h:7
edm::Handle
Definition: AssociativeIterator.h:50
L1RCT::ecalCompressedET
unsigned short ecalCompressedET(int crate, int card, int tower)
Definition: L1RCT.h:63
L1RCTInputProducer::useEcal
bool useEcal
Definition: L1RCTInputProducer.h:28
patCandidatesForDimuonsSequences_cff.hcal
hcal
Definition: patCandidatesForDimuonsSequences_cff.py:37
alignCSCRings.s
s
Definition: alignCSCRings.py:92
L1RCTLookupTables::setHcalScale
void setHcalScale(const L1CaloHcalScale *hcalScale)
Definition: L1RCTLookupTables.h:27
L1RCT
Definition: L1RCT.h:20
edm::ESHandle
Definition: DTSurvey.h:22
L1RCTInputProducer::ecalDigisLabel
edm::InputTag ecalDigisLabel
Definition: L1RCTInputProducer.h:30
h
L1RCT::ecalFineGrainBit
unsigned short ecalFineGrainBit(int crate, int card, int tower)
Definition: L1RCT.h:64
L1RCTLookupTables
Definition: L1RCTLookupTables.h:11
L1RCTChannelMaskRcd
Definition: L1RCTChannelMaskRcd.h:12
L1CaloEtScale
Definition: L1CaloEtScale.h:29
L1RCTLookupTables::setL1CaloEtScale
void setL1CaloEtScale(const L1CaloEtScale *etScale)
Definition: L1RCTLookupTables.h:29
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
get
#define get
L1RCTInputProducer::rctLookupTables
L1RCTLookupTables * rctLookupTables
Definition: L1RCTInputProducer.h:26
alignCSCRings.r
r
Definition: alignCSCRings.py:93
eostools.move
def move(src, dest)
Definition: eostools.py:511
L1RCTLookupTables::setEcalScale
void setEcalScale(const L1CaloEcalScale *ecalScale)
Definition: L1RCTLookupTables.h:31
L1EmEtScaleRcd
Definition: L1EmEtScaleRcd.h:30
L1RCTLookupTables::setRCTParameters
void setRCTParameters(const L1RCTParameters *rctParameters)
Definition: L1RCTLookupTables.h:21
L1RCTParameters
Definition: L1RCTParameters.h:27
bsc_activity_cfg.ecal
ecal
Definition: bsc_activity_cfg.py:25
L1RCTInputProducer::hcalDigisLabel
edm::InputTag hcalDigisLabel
Definition: L1RCTInputProducer.h:31
L1RCTLookupTables::setChannelMask
void setChannelMask(const L1RCTChannelMask *channelMask)
Definition: L1RCTLookupTables.h:23
edm::InputTag
Definition: InputTag.h:15
L1RCT::digiInput
void digiInput(const EcalTrigPrimDigiCollection &ecalCollection, const HcalTrigPrimDigiCollection &hcalCollection)
Definition: L1RCT.cc:109
L1RCT::hcalCompressedET
unsigned short hcalCompressedET(int crate, int card, int tower)
Definition: L1RCT.h:65
L1CaloHcalScaleRcd
Definition: L1CaloHcalScaleRcd.h:13
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37