CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

WriteL1TriggerObjetsXml Class Reference

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

Inheritance diagram for WriteL1TriggerObjetsXml:
edm::EDAnalyzer

List of all members.

Public Member Functions

 WriteL1TriggerObjetsXml (const edm::ParameterSet &)
 ~WriteL1TriggerObjetsXml ()

Private Member Functions

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

Private Attributes

std::string tagname_

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.

                                                                               : tagname_(iConfig.getParameter<std::string>("TagName"))
{
   //now do what ever initialization is needed

}
WriteL1TriggerObjetsXml::~WriteL1TriggerObjetsXml ( )

Definition at line 78 of file WriteL1TriggerObjetsXml.cc.

{
 
   // do anything here that needs to be done at desctruction time
   // (e.g. close files, deallocate resources etc.)

}

Member Function Documentation

void WriteL1TriggerObjetsXml::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

Implements edm::EDAnalyzer.

Definition at line 93 of file WriteL1TriggerObjetsXml.cc.

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

{
   using namespace edm;
   edm::ESHandle<HcalDbService> conditions;
   iSetup.get<HcalDbRecord>().get(conditions);

   HcalSubdetector subDet[3] = {HcalBarrel, HcalEndcap, HcalForward};
   std::string subDetName[3] = {"HB", "HE", "HF"};

   HcalL1TriggerObjectsXml xml(tagname_);
   for (int isub = 0; isub < 3; ++isub){
      for (int ieta = -41; ieta <= 41; ++ieta){
         for (int iphi = 1; iphi <=72; ++iphi){
            for (int depth = 1; depth <= 3; ++depth){
               if (!HcalDetId::validDetId(subDet[isub], ieta, iphi, depth)) continue;
               HcalDetId id(subDet[isub], ieta, iphi, depth);
               HcalCalibrations calibrations = conditions->getHcalCalibrations(id);
               const HcalChannelStatus* channelStatus = conditions->getHcalChannelStatus(id);
               uint32_t status = channelStatus->getValue();

               double gain = 0.0;
               double ped = 0.0;

               for (int i=0; i<4; ++i) {
                  gain += calibrations.LUTrespcorrgain(i);
                  ped += calibrations.pedestal(i);
               }
               gain /= 4.;
               ped /= 4.;

               xml.add_hcal_channel_dataset(ieta, iphi, depth, subDetName[isub], ped, gain, status);
            }// for depth
         }// for iphi
      }// for ieta
   }// for subdet

   std::string xmlOutputFileName(tagname_);
   xmlOutputFileName += ".xml";
   xml.write(xmlOutputFileName);
}
void WriteL1TriggerObjetsXml::beginJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 136 of file WriteL1TriggerObjetsXml.cc.

{
}
void WriteL1TriggerObjetsXml::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 142 of file WriteL1TriggerObjetsXml.cc.

                                {
}

Member Data Documentation

std::string WriteL1TriggerObjetsXml::tagname_ [private]

Definition at line 57 of file WriteL1TriggerObjetsXml.cc.

Referenced by analyze().