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
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

Private Attributes

std::string tagname_
 

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)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- 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 ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 94 of file WriteL1TriggerObjetsXml.cc.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 139 of file WriteL1TriggerObjetsXml.cc.

140 {
141 }
void WriteL1TriggerObjetsXml::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 145 of file WriteL1TriggerObjetsXml.cc.

145  {
146 }

Member Data Documentation

std::string WriteL1TriggerObjetsXml::tagname_
private

Definition at line 58 of file WriteL1TriggerObjetsXml.cc.

Referenced by analyze().