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::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 WriteL1TriggerObjetsXml (const edm::ParameterSet &)
 
 ~WriteL1TriggerObjetsXml ()
 
- 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
std::vector< ConsumesInfoconsumesInfo () const
 
 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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
virtual void beginJob () override
 
virtual void endJob () override
 

Private Attributes

std::string tagname_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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

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

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

Definition at line 45 of file WriteL1TriggerObjetsXml.cc.

Constructor & Destructor Documentation

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

Definition at line 71 of file WriteL1TriggerObjetsXml.cc.

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

Definition at line 78 of file WriteL1TriggerObjetsXml.cc.

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

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 93 of file WriteL1TriggerObjetsXml.cc.

References HcalL1TriggerObjectsXml::add_hcal_channel_dataset(), HLT_25ns10e33_v2_cff::depth, edm::EventSetup::get(), HcalChannelStatus::getValue(), HcalBarrel, HcalEndcap, HcalForward, i, HcalCalibrations::LUTrespcorrgain(), HcalCalibrations::pedestal(), mps_update::status, AlCaHLTBitMon_QueryRunRegistry::string, tagname_, and XMLDOMBlock::write().

94 {
95  using namespace edm;
97  iSetup.get<HcalDbRecord>().get(conditions);
98  const HcalTopology* topo=conditions->getTopologyUsed();
99 
101  std::string subDetName[3] = {"HB", "HE", "HF"};
102 
104  for (int isub = 0; isub < 3; ++isub){
105  for (int ieta = -41; ieta <= 41; ++ieta){
106  for (int iphi = 1; iphi <=72; ++iphi){
107  for (int depth = 1; depth <= 3; ++depth){
108  HcalDetId id(subDet[isub], ieta, iphi, depth);
109 
110  if (!topo->valid(id)) continue;
111  HcalCalibrations calibrations = conditions->getHcalCalibrations(id);
112  const HcalChannelStatus* channelStatus = conditions->getHcalChannelStatus(id);
113  uint32_t status = channelStatus->getValue();
114 
115  double gain = 0.0;
116  double ped = 0.0;
117 
118  for (int i=0; i<4; ++i) {
119  gain += calibrations.LUTrespcorrgain(i);
120  ped += calibrations.pedestal(i);
121  }
122  gain /= 4.;
123  ped /= 4.;
124 
125  xml.add_hcal_channel_dataset(ieta, iphi, depth, subDetName[isub], ped, gain, status);
126  }// for depth
127  }// for iphi
128  }// for ieta
129  }// for subdet
130 
131  std::string xmlOutputFileName(tagname_);
132  xmlOutputFileName += ".xml";
133  xml.write(xmlOutputFileName);
134 }
int i
Definition: DBlmapReader.cc:9
double pedestal(int fCapId) const
get pedestal for capid=0..3
HcalSubdetector
Definition: HcalAssistant.h:31
double LUTrespcorrgain(int fCapId) const
get LUT corrected and response corrected gain for capid=0..3
const T & get() const
Definition: EventSetup.h:56
uint32_t getValue() const
tuple status
Definition: mps_update.py:57
void WriteL1TriggerObjetsXml::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 138 of file WriteL1TriggerObjetsXml.cc.

139 {
140 }
void WriteL1TriggerObjetsXml::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 144 of file WriteL1TriggerObjetsXml.cc.

144  {
145 }

Member Data Documentation

std::string WriteL1TriggerObjetsXml::tagname_
private

Definition at line 57 of file WriteL1TriggerObjetsXml.cc.

Referenced by analyze().