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 Member Functions | Private Attributes
WriteL1TriggerObjetsXml Class Reference

#include <Test/WriteL1TriggerObjetsXml/src/WriteL1TriggerObjetsXml.cc>

Inheritance diagram for WriteL1TriggerObjetsXml:
edm::one::EDAnalyzer< edm::one::WatchRuns > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 WriteL1TriggerObjetsXml (const edm::ParameterSet &)
 
 ~WriteL1TriggerObjetsXml ()
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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 & 
itemsToGetFromEvent () 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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

virtual void analyze (edm::Event const &, edm::EventSetup const &) override
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &) override
 
virtual void endRun (edm::Run const &, edm::EventSetup const &) override
 

Private Attributes

std::string tagname_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 46 of file WriteL1TriggerObjetsXml.cc.

Constructor & Destructor Documentation

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

Definition at line 72 of file WriteL1TriggerObjetsXml.cc.

72  : tagname_(iConfig.getParameter<std::string>("TagName"))
73 {
74  //now do what ever initialization is needed
75 
76 }
T getParameter(std::string const &) const
WriteL1TriggerObjetsXml::~WriteL1TriggerObjetsXml ( )

Definition at line 79 of file WriteL1TriggerObjetsXml.cc.

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

Member Function Documentation

void WriteL1TriggerObjetsXml::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 94 of file WriteL1TriggerObjetsXml.cc.

References HcalL1TriggerObjectsXml::add_hcal_channel_dataset(), HcalTopology::dddConstants(), HLT_FULL_cff::depth, edm::EventSetup::get(), HcalDDDRecConstants::getEtaRange(), HcalDDDRecConstants::getMaxDepth(), HcalDDDRecConstants::getNPhi(), HcalChannelStatus::getValue(), HcalBarrel, HcalEndcap, HcalForward, i, HcalCalibrations::LUTrespcorrgain(), HLT_FULL_cff::maxDepth, maxEta, HcalCalibrations::pedestal(), edm::ESHandle< class >::product(), mps_update::status, AlCaHLTBitMon_QueryRunRegistry::string, tagname_, HcalTopology::valid(), and XMLDOMBlock::write().

95  {
97  iSetup.get<HcalRecNumberingRecord>().get(htopo);
98  const HcalTopology* topo = htopo.product();
100  iSetup.get<HcalDbRecord>().get(conditions);
101 
103  std::string subDetName[3] = {"HB", "HE", "HF"};
104  int maxEta(0), maxPhi(72), maxDepth(0);
105  const HcalDDDRecConstants* hcons = topo->dddConstants();
106  for (int isub=0; isub<3; ++isub) {
107  if (hcons->getMaxDepth(isub) > maxDepth) maxDepth = hcons->getMaxDepth(isub);
108  if (hcons->getEtaRange(isub).second > maxEta)
109  maxEta = hcons->getEtaRange(isub).second;
110  if (hcons->getNPhi(isub) > maxPhi) maxPhi = hcons->getNPhi(isub);
111  }
112 
114  for (int isub = 0; isub < 3; ++isub){
115  for (int ieta = -maxEta; ieta <= maxEta; ++ieta){
116  for (int iphi = 1; iphi <=maxPhi; ++iphi){
117  for (int depth = 1; depth <= maxDepth; ++depth){
118  HcalDetId id(subDet[isub], ieta, iphi, depth);
119 
120  if (!topo->valid(id)) continue;
121  HcalCalibrations calibrations = conditions->getHcalCalibrations(id);
122  const HcalChannelStatus* channelStatus = conditions->getHcalChannelStatus(id);
123  uint32_t status = channelStatus->getValue();
124 
125  double gain = 0.0;
126  double ped = 0.0;
127 
128  for (int i=0; i<4; ++i) {
129  gain += calibrations.LUTrespcorrgain(i);
130  ped += calibrations.pedestal(i);
131  }
132  gain /= 4.;
133  ped /= 4.;
134 
135  xml.add_hcal_channel_dataset(ieta, iphi, depth, subDetName[isub], ped, gain, status);
136  }// for depth
137  }// for iphi
138  }// for ieta
139  }// for subdet
140 
141  std::string xmlOutputFileName(tagname_);
142  xmlOutputFileName += ".xml";
143  xml.write(xmlOutputFileName);
144 }
int getNPhi(const int type) const
int i
Definition: DBlmapReader.cc:9
const HcalDDDRecConstants * dddConstants() const
Definition: HcalTopology.h:150
double maxEta
double pedestal(int fCapId) const
get pedestal for capid=0..3
int getMaxDepth(const int type) const
HcalSubdetector
Definition: HcalAssistant.h:31
double LUTrespcorrgain(int fCapId) const
get LUT corrected and response corrected gain for capid=0..3
T const * product() const
Definition: ESHandle.h:86
virtual bool valid(const DetId &id) const
std::pair< int, int > getEtaRange(const int i) const
uint32_t getValue() const
tuple status
Definition: mps_update.py:57
virtual void WriteL1TriggerObjetsXml::beginRun ( edm::Run const &  ,
edm::EventSetup const &   
)
inlineoverrideprivatevirtual

Definition at line 54 of file WriteL1TriggerObjetsXml.cc.

54 {}
virtual void WriteL1TriggerObjetsXml::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
inlineoverrideprivatevirtual

Definition at line 55 of file WriteL1TriggerObjetsXml.cc.

55 {}

Member Data Documentation

std::string WriteL1TriggerObjetsXml::tagname_
private

Definition at line 58 of file WriteL1TriggerObjetsXml.cc.

Referenced by analyze().