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

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
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

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
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 9 of file HcalLutGenerator.h.

Constructor & Destructor Documentation

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

Definition at line 21 of file HcalLutGenerator.cc.

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

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

Definition at line 29 of file HcalLutGenerator.cc.

30 {
31 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 34 of file HcalLutGenerator.cc.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 132 of file HcalLutGenerator.cc.

132  {
133 
134 }

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().