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
HcalLutGenerator Class Reference

#include <HcalLutGenerator.h>

Inheritance diagram for HcalLutGenerator:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
void endJob ()
 
 HcalLutGenerator (const edm::ParameterSet &)
 
 ~HcalLutGenerator ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- 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

std::string _lin_file
 
uint32_t _status_word_to_mask
 
std::string _tag
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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 9 of file HcalLutGenerator.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file HcalLutGenerator.cc.

References _lin_file, _status_word_to_mask, _tag, gather_cfg::cout, edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

20 {
21  std::cout << " --> HcalLutGenerator::HcalLutGenerator()" << std::endl;
22  _tag = iConfig.getParameter<std::string>("tag");
23  _lin_file = iConfig.getParameter<std::string>("HO_master_file");
24  _status_word_to_mask = iConfig.getParameter<uint32_t>("status_word_to_mask");
25 }
T getParameter(std::string const &) const
uint32_t _status_word_to_mask
std::string _lin_file
tuple cout
Definition: gather_cfg.py:121
HcalLutGenerator::~HcalLutGenerator ( )

Definition at line 27 of file HcalLutGenerator.cc.

28 {
29 }

Member Function Documentation

void HcalLutGenerator::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 31 of file HcalLutGenerator.cc.

References _lin_file, _status_word_to_mask, _tag, gather_cfg::cout, edm::EventSetup::get(), and edm::ESHandleBase::swap().

32 {
33 
34  std::cout << " --> HcalLutGenerator::analyze()" << std::endl;
35 
36  //
37  //_____ get the coders from Event Setup _______________________________
38  //
39  edm::ESHandle<HcalTPGCoder> inputCoder;
40  iSetup.get<HcalTPGRecord>().get(inputCoder);
41 
42  //
44  iSetup.get<CaloTPGRecord>().get(outTranscoder);
45 
47  transcoder.swap(outTranscoder);
48 
49  //
50  //_____ get EMAP from Event Setup _____________________________________
51  //
53  iSetup.get<HcalElectronicsMapRcd>().get(hEmap);
54  std::vector<HcalGenericDetId> vEmap = hEmap->allPrecisionId();
55  std::cout << "EMAP from Event Setup has " << vEmap.size() << " entries" << std::endl;
56 
57  //
58  //_____ get Channel Quality conditions from Event Setup (example)______
59  //
61  iSetup.get<HcalChannelQualityRcd>().get("withTopo",hCQ);
62  const HcalChannelQuality * _cq = &(*hCQ);
63  //
64  /*
65  // Here's how one gets channel status from the Channel Quality condition.
66  // One can use their own loop over channels or get a vector of all
67  // channels from the conditions object
68  //
69  //_____ get list of all channels
70  //
71  std::vector<DetId> _channels = _cq->getAllChannels();
72  std::cout << "Channel Quality available for " << _channels.size() << " channels" << std::endl;
73  //
74  //_____ loop over channels
75  //
76  for (std::vector<DetId>::const_iterator _ch = _channels.begin();
77  _ch != _channels.end();
78  _ch++){
79  //
80  //_____ select only HBEF logical channels
81  //
82  HcalGenericDetId _gid( *_ch );
83  if ( !(_gid.null()) &&
84  (_gid.genericSubdet()==HcalGenericDetId::HcalGenBarrel ||
85  _gid.genericSubdet()==HcalGenericDetId::HcalGenEndcap ||
86  _gid.genericSubdet()==HcalGenericDetId::HcalGenForward ||
87  _gid.genericSubdet()==HcalGenericDetId::HcalGenOuter
88  )
89  ){
90  const HcalChannelStatus * _cs = _cq->getValues( *_ch );
91 
92  // get the full 32-bit channel status word
93  uint32_t status_word = _cs->getValue();
94 
95  // get the 15th bit (which is supposed to mean hot channel)
96  bool is_hot = _cs->isBitSet(15);
97  //edm::LogInfo("LUT") << "HCAL channel ID: " << _ch->rawId()
98  //std::cout << "HCAL channel ID: " << _ch->rawId()
99  // << ", status word: " << status_word
100  // << ", hot flag: " << is_hot << std::endl;
101  }
102  }
103  */
104  //_____end of Channel Quality example_____________________
105 
106  //
107  //_____ generate LUTs _________________________________________________
108  //
109  //HcalLutManager * manager = new HcalLutManager(); // old ways
110  //HcalLutManager * manager = new HcalLutManager(&(*hEmap));
111  HcalLutManager * manager = new HcalLutManager(&(*hEmap), _cq, _status_word_to_mask);
112  bool split_by_crate = true;
113  std::cout << " tag name: " << _tag << std::endl;
114  std::cout << " HO master file: " << _lin_file << std::endl;
115 
116  // default
117  //manager -> createLutXmlFiles_HBEFFromCoder_HOFromAscii( _tag, *inputCoder, *transcoder, _lin_file, split_by_crate );
118 
119  // with ZDC (experimental)
120  manager -> createLutXmlFiles_HBEFFromCoder_HOFromAscii_ZDC( _tag, *inputCoder, *transcoder, _lin_file, split_by_crate );
121  delete manager;
122 
123 
124 }
Various manipulations with trigger Lookup Tables.
uint32_t _status_word_to_mask
const T & get() const
Definition: EventSetup.h:55
std::string _lin_file
tuple cout
Definition: gather_cfg.py:121
void swap(ESHandleBase &iOther)
Definition: ESHandle.h:51
void HcalLutGenerator::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 127 of file HcalLutGenerator.cc.

127  {
128 
129 }

Member Data Documentation

std::string HcalLutGenerator::_lin_file
private

Definition at line 18 of file HcalLutGenerator.h.

Referenced by analyze(), and HcalLutGenerator().

uint32_t HcalLutGenerator::_status_word_to_mask
private

Definition at line 19 of file HcalLutGenerator.h.

Referenced by analyze(), and HcalLutGenerator().

std::string HcalLutGenerator::_tag
private

Definition at line 17 of file HcalLutGenerator.h.

Referenced by analyze(), and HcalLutGenerator().