CMS 3D CMS Logo

Public Member Functions | Private Attributes

HcalDigiToRaw Class Reference

#include <HcalDigiToRaw.h>

Inheritance diagram for HcalDigiToRaw:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 HcalDigiToRaw (const edm::ParameterSet &ps)
virtual void produce (edm::Event &e, const edm::EventSetup &c)
virtual ~HcalDigiToRaw ()

Private Attributes

edm::InputTag calibTag_
edm::InputTag hbheTag_
edm::InputTag hfTag_
edm::InputTag hoTag_
HcalPacker packer_
edm::InputTag trigTag_
edm::InputTag zdcTag_

Detailed Description

HcalDigiToRaw is the EDProducer subclass which runs the Hcal Unpack algorithm.

Author:
Jeremiah Mans
Version:
1st Version June 10, 2005

Definition at line 26 of file HcalDigiToRaw.h.


Constructor & Destructor Documentation

HcalDigiToRaw::HcalDigiToRaw ( const edm::ParameterSet ps) [explicit]

Definition at line 16 of file HcalDigiToRaw.cc.

                                                        :
  hbheTag_(conf.getUntrackedParameter("HBHE",edm::InputTag())),
  hoTag_(conf.getUntrackedParameter("HO",edm::InputTag())),
  hfTag_(conf.getUntrackedParameter("HF",edm::InputTag())),
  zdcTag_(conf.getUntrackedParameter("ZDC",edm::InputTag())),
  calibTag_(conf.getUntrackedParameter("CALIB",edm::InputTag())),
  trigTag_(conf.getUntrackedParameter("TRIG",edm::InputTag()))
{
  produces<FEDRawDataCollection>();
}
HcalDigiToRaw::~HcalDigiToRaw ( ) [virtual]

Definition at line 28 of file HcalDigiToRaw.cc.

{ }  

Member Function Documentation

void HcalDigiToRaw::produce ( edm::Event e,
const edm::EventSetup c 
) [virtual]

Implements edm::EDProducer.

Definition at line 31 of file HcalDigiToRaw.cc.

References HcalPacker::Collections::calibCont, calibTag_, edm::EventID::event(), edm::EventSetup::get(), edm::Event::getByLabel(), HcalPacker::Collections::hbhe, hbheTag_, HcalPacker::Collections::hfCont, hfTag_, HcalPacker::Collections::hoCont, hoTag_, edm::EventBase::id(), edm::InputTag::label(), FEDNumbering::MAXHCALFEDID, FEDNumbering::MINHCALFEDID, HcalPacker::pack(), packer_, edm::Handle< T >::product(), edm::Event::put(), HcalPacker::Collections::tpCont, trigTag_, cms::Exception::what(), HcalPacker::Collections::zdcCont, and zdcTag_.

{
  HcalPacker::Collections colls;

  
  // Step A: Get Inputs 
  edm::Handle<HBHEDigiCollection> hbhe;
  if (!hbheTag_.label().empty()) {
    e.getByLabel(hbheTag_,hbhe);
    colls.hbhe=hbhe.product();
  }
  edm::Handle<HODigiCollection> ho;
  if (!hoTag_.label().empty()) {
    e.getByLabel(hoTag_,ho);
    colls.hoCont=ho.product();
  }
  edm::Handle<HFDigiCollection> hf;
  if (!hfTag_.label().empty()) {
    e.getByLabel(hfTag_,hf);
    colls.hfCont=hf.product();
  }
  edm::Handle<HcalCalibDigiCollection> Calib;
  if (!calibTag_.label().empty()) {
    e.getByLabel(calibTag_,Calib);
    colls.calibCont=Calib.product();
  }
  edm::Handle<ZDCDigiCollection> zdc;
  if (!zdcTag_.label().empty()) {
    e.getByLabel(zdcTag_,zdc);
    colls.zdcCont=zdc.product();
  }
  edm::Handle<HcalTrigPrimDigiCollection> htp;
  if (!trigTag_.label().empty()) {
    e.getByLabel(trigTag_,htp);
    colls.tpCont=htp.product();
  }
  // get the mapping
  edm::ESHandle<HcalDbService> pSetup;
  es.get<HcalDbRecord>().get( pSetup );
  const HcalElectronicsMap* readoutMap=pSetup->getHcalMapping();
  // Step B: Create empty output
  std::auto_ptr<FEDRawDataCollection> raw=std::auto_ptr<FEDRawDataCollection>(new FEDRawDataCollection());

  const int ifed_first=FEDNumbering::MINHCALFEDID;
  const int ifed_last=FEDNumbering::MAXHCALFEDID;

  int orbitN=e.id().event();
  int bcnN=2000;

  // Step C: pack all requested FEDs
  for (int ifed=ifed_first; ifed<=ifed_last; ++ifed) {
    FEDRawData& fed = raw->FEDData(ifed);
    try {
      packer_.pack(ifed,ifed-ifed_first, e.id().event(),
                   orbitN, bcnN, colls, *readoutMap, fed);
    } catch (cms::Exception& e) {
      edm::LogWarning("Unpacking error") << e.what();
    } catch (...) {
      edm::LogWarning("Unpacking exception");
    }
  }


  e.put(raw);
}

Member Data Documentation

Definition at line 34 of file HcalDigiToRaw.h.

Referenced by produce().

Definition at line 34 of file HcalDigiToRaw.h.

Referenced by produce().

Definition at line 34 of file HcalDigiToRaw.h.

Referenced by produce().

Definition at line 34 of file HcalDigiToRaw.h.

Referenced by produce().

Definition at line 33 of file HcalDigiToRaw.h.

Referenced by produce().

Definition at line 34 of file HcalDigiToRaw.h.

Referenced by produce().

Definition at line 34 of file HcalDigiToRaw.h.

Referenced by produce().