CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
virtual void produce (edm::Event &e, const edm::EventSetup &c)
 
virtual ~L1RCTInputProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 

Detailed Description

Definition at line 19 of file L1RCTInputProducer.h.

Constructor & Destructor Documentation

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

Definition at line 30 of file L1RCTInputProducer.cc.

30  :
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 {
38  produces<std::vector<unsigned short> >("rctCrate");
39  produces<std::vector<unsigned short> >("rctCard");
40  produces<std::vector<unsigned short> >("rctTower");
41  produces<std::vector<unsigned int> >("rctEGammaET");
42  produces<std::vector<bool> >("rctHoEFGVetoBit");
43  produces<std::vector<unsigned int> >("rctJetMETET");
44  produces<std::vector<bool> >("rctTowerActivityBit");
45  produces<std::vector<bool> >("rctTowerMIPBit");
46  produces<std::vector<unsigned short> >("rctHFCrate");
47  produces<std::vector<unsigned short> >("rctHFRegion");
48  produces<std::vector<unsigned int> >("rctHFET");
49  produces<std::vector<bool> >("rctHFFG");
50 }
edm::InputTag ecalDigisLabel
tuple conf
Definition: dbtoconf.py:185
edm::InputTag hcalDigisLabel
L1RCTLookupTables * rctLookupTables
Definition: L1RCT.h:20
L1RCTInputProducer::~L1RCTInputProducer ( )
virtual

Definition at line 52 of file L1RCTInputProducer.cc.

References rct, and rctLookupTables.

53 {
54  if(rct != 0) delete rct;
55  if(rctLookupTables != 0) delete rctLookupTables;
56 }
L1RCTLookupTables * rctLookupTables

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 60 of file L1RCTInputProducer.cc.

References trackerHits::c, L1RCT::digiInput(), alignCSCRings::e, patCandidatesForDimuonsSequences_cff::ecal, L1RCT::ecalCompressedET(), ecalDigisLabel, L1RCT::ecalFineGrainBit(), edm::EventSetup::get(), h, patCandidatesForDimuonsSequences_cff::hcal, L1RCT::hcalCompressedET(), hcalDigisLabel, L1RCT::hfCompressedET(), edm::HandleBase::isValid(), L1RCTLookupTables::lookup(), edm::ESHandle< class >::product(), alignCSCRings::r, rct, rctLookupTables, alignCSCRings::s, L1RCTLookupTables::setChannelMask(), L1RCTLookupTables::setEcalScale(), L1RCTLookupTables::setHcalScale(), L1RCTLookupTables::setL1CaloEtScale(), L1RCTLookupTables::setRCTParameters(), useEcal, and useHcal.

61 {
62 
63  // Refresh configuration information every event
64  // Hopefully, this does not take too much time
65  // There should be a call back function in future to
66  // handle changes in configuration
67 
68  edm::ESHandle<L1RCTParameters> rctParameters;
69  eventSetup.get<L1RCTParametersRcd>().get(rctParameters);
70  const L1RCTParameters* r = rctParameters.product();
72  eventSetup.get<L1RCTChannelMaskRcd>().get(channelMask);
73  const L1RCTChannelMask* c = channelMask.product();
75  eventSetup.get<L1CaloEcalScaleRcd>().get(ecalScale);
76  const L1CaloEcalScale* e = ecalScale.product();
78  eventSetup.get<L1CaloHcalScaleRcd>().get(hcalScale);
79  const L1CaloHcalScale* h = hcalScale.product();
81  eventSetup.get<L1EmEtScaleRcd>().get(emScale);
82  const L1CaloEtScale* s = emScale.product();
83 
89 
92 
93  if (useEcal) { event.getByLabel(ecalDigisLabel, ecal); }
94  if (useHcal) { event.getByLabel(hcalDigisLabel, hcal); }
95 
98  if (ecal.isValid()) { ecalColl = *ecal; }
99  if (hcal.isValid()) { hcalColl = *hcal; }
100 
101  rct->digiInput(ecalColl, hcalColl);
102 
103  // Stuff to create
104 
105  std::auto_ptr<std::vector<unsigned short> >
106  rctCrate(new std::vector<unsigned short>);
107  std::auto_ptr<std::vector<unsigned short> >
108  rctCard(new std::vector<unsigned short>);
109  std::auto_ptr<std::vector<unsigned short> >
110  rctTower(new std::vector<unsigned short>);
111  std::auto_ptr<std::vector<unsigned int> >
112  rctEGammaET(new std::vector<unsigned int>);
113  std::auto_ptr<std::vector<bool> > rctHoEFGVetoBit(new std::vector<bool>);
114  std::auto_ptr<std::vector<unsigned int> >
115  rctJetMETET(new std::vector<unsigned int>);
116  std::auto_ptr<std::vector<bool> > rctTowerActivityBit(new std::vector<bool>);
117  std::auto_ptr<std::vector<bool> > rctTowerMIPBit(new std::vector<bool>);
118 
119  for(int crate = 0; crate < 18; crate++) {
120  for(int card = 0; card < 7; card++) {
121  for(int tower = 0; tower < 32; tower++) {
122  unsigned short ecalCompressedET =
123  rct->ecalCompressedET(crate, card, tower);
124  unsigned short ecalFineGrainBit =
125  rct->ecalFineGrainBit(crate, card, tower);
126  unsigned short hcalCompressedET =
127  rct->hcalCompressedET(crate, card, tower);
128  unsigned int lutBits =
129  rctLookupTables->lookup(ecalCompressedET, hcalCompressedET,
130  ecalFineGrainBit, crate, card, tower);
131  unsigned int eGammaETCode = lutBits & 0x0000007F;
132  bool hOeFGVetoBit = (lutBits >> 7) & 0x00000001;
133  unsigned int jetMETETCode = (lutBits >> 8) & 0x000001FF;
134  bool activityBit = (lutBits >> 17) & 0x00000001;
135  if(eGammaETCode > 0 || jetMETETCode > 0 ||
136  hOeFGVetoBit || activityBit) {
137  rctCrate->push_back(crate);
138  rctCard->push_back(card);
139  rctTower->push_back(tower);
140  rctEGammaET->push_back(eGammaETCode);
141  rctHoEFGVetoBit->push_back(hOeFGVetoBit);
142  rctJetMETET->push_back(jetMETETCode);
143  rctTowerActivityBit->push_back(activityBit);
144  rctTowerMIPBit->push_back(0); // FIXME: MIP bit is not yet defined
145  }
146  }
147  }
148  }
149 
150  std::auto_ptr<std::vector<unsigned short> >
151  rctHFCrate(new std::vector<unsigned short>);
152  std::auto_ptr<std::vector<unsigned short> >
153  rctHFRegion(new std::vector<unsigned short>);
154  std::auto_ptr<std::vector<unsigned int> > rctHFET(new std::vector<unsigned int>);
155  std::auto_ptr<std::vector<bool> > rctHFFG(new std::vector<bool>);
156  for(int crate = 0; crate < 18; crate++) {
157  for(int hfRegion = 0; hfRegion < 8; hfRegion++) {
158  unsigned short hfCompressedET = rct->hfCompressedET(crate, hfRegion);
159  unsigned int hfETCode =
160  rctLookupTables->lookup(hfCompressedET, crate, 999, hfRegion);
161  if(hfETCode > 0) {
162  rctHFCrate->push_back(crate);
163  rctHFRegion->push_back(hfRegion);
164  rctHFET->push_back(hfETCode);
165  rctHFFG->push_back(0); // FIXME: HF FG is not yet defined
166  }
167  }
168  }
169 
170  //putting stuff back into event
171  event.put(rctCrate, "rctCrate");
172  event.put(rctCard, "rctCard");
173  event.put(rctTower, "rctTower");
174  event.put(rctEGammaET, "rctEGammaET");
175  event.put(rctHoEFGVetoBit, "rctHoEFGVetoBit");
176  event.put(rctJetMETET, "rctJetMETET");
177  event.put(rctTowerActivityBit, "rctTowerActivityBit");
178  event.put(rctTowerMIPBit, "rctTowerMIPBit");
179  event.put(rctHFCrate, "rctHFCrate");
180  event.put(rctHFRegion, "rctHFRegion");
181  event.put(rctHFET, "rctHFET");
182  event.put(rctHFFG, "rctHFFG");
183 
184 }
unsigned short hcalCompressedET(int crate, int card, int tower)
Definition: L1RCT.h:82
unsigned short hfCompressedET(int crate, int tower)
Definition: L1RCT.h:86
edm::InputTag ecalDigisLabel
void setHcalScale(const L1CaloHcalScale *hcalScale)
unsigned short ecalFineGrainBit(int crate, int card, int tower)
Definition: L1RCT.h:80
unsigned short ecalCompressedET(int crate, int card, int tower)
Definition: L1RCT.h:78
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
bool isValid() const
Definition: HandleBase.h:76
void setL1CaloEtScale(const L1CaloEtScale *etScale)
edm::InputTag hcalDigisLabel
T const * product() const
Definition: ESHandle.h:62
void setEcalScale(const L1CaloEcalScale *ecalScale)
void setRCTParameters(const L1RCTParameters *rctParameters)
void digiInput(const EcalTrigPrimDigiCollection &ecalCollection, const HcalTrigPrimDigiCollection &hcalCollection)
Definition: L1RCT.cc:116
L1RCTLookupTables * rctLookupTables
void setChannelMask(const L1RCTChannelMask *channelMask)
unsigned int lookup(unsigned short ecalInput, unsigned short hcalInput, unsigned short fgbit, unsigned short crtNo, unsigned short crdNo, unsigned short twrNo) const

Member Data Documentation

edm::InputTag L1RCTInputProducer::ecalDigisLabel
private

Definition at line 30 of file L1RCTInputProducer.h.

Referenced by produce().

edm::InputTag L1RCTInputProducer::hcalDigisLabel
private

Definition at line 31 of file L1RCTInputProducer.h.

Referenced by produce().

L1RCT* L1RCTInputProducer::rct
private

Definition at line 27 of file L1RCTInputProducer.h.

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

L1RCTLookupTables* L1RCTInputProducer::rctLookupTables
private

Definition at line 26 of file L1RCTInputProducer.h.

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

bool L1RCTInputProducer::useEcal
private

Definition at line 28 of file L1RCTInputProducer.h.

Referenced by produce().

bool L1RCTInputProducer::useHcal
private

Definition at line 29 of file L1RCTInputProducer.h.

Referenced by produce().