CMS 3D CMS Logo

HcalDigiToRaw Class Reference

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

#include <EventFilter/HcalRawToDigi/plugins/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.

00016                                                         :
00017   hbheTag_(conf.getUntrackedParameter("HBHE",edm::InputTag())),
00018   hoTag_(conf.getUntrackedParameter("HO",edm::InputTag())),
00019   hfTag_(conf.getUntrackedParameter("HF",edm::InputTag())),
00020   zdcTag_(conf.getUntrackedParameter("ZDC",edm::InputTag())),
00021   calibTag_(conf.getUntrackedParameter("CALIB",edm::InputTag())),
00022   trigTag_(conf.getUntrackedParameter("TRIG",edm::InputTag()))
00023 {
00024   produces<FEDRawDataCollection>();
00025 }

HcalDigiToRaw::~HcalDigiToRaw (  )  [virtual]

Definition at line 28 of file HcalDigiToRaw.cc.

00028 { }  


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::EventSetup::get(), edm::Event::getByLabel(), FEDNumbering::getHcalFEDIds(), HcalPacker::Collections::hbhe, hbheTag_, HcalPacker::Collections::hfCont, hfTag_, HcalPacker::Collections::hoCont, hoTag_, edm::Event::id(), edm::InputTag::label(), HcalPacker::pack(), packer_, edm::Handle< T >::product(), edm::Event::put(), HcalPacker::Collections::tpCont, trigTag_, cms::Exception::what(), HcalPacker::Collections::zdcCont, and zdcTag_.

00032 {
00033   HcalPacker::Collections colls;
00034 
00035   
00036   // Step A: Get Inputs 
00037   edm::Handle<HBHEDigiCollection> hbhe;
00038   if (!hbheTag_.label().empty()) {
00039     e.getByLabel(hbheTag_,hbhe);
00040     colls.hbhe=hbhe.product();
00041   }
00042   edm::Handle<HODigiCollection> ho;
00043   if (!hoTag_.label().empty()) {
00044     e.getByLabel(hoTag_,ho);
00045     colls.hoCont=ho.product();
00046   }
00047   edm::Handle<HFDigiCollection> hf;
00048   if (!hfTag_.label().empty()) {
00049     e.getByLabel(hfTag_,hf);
00050     colls.hfCont=hf.product();
00051   }
00052   edm::Handle<HcalCalibDigiCollection> Calib;
00053   if (!calibTag_.label().empty()) {
00054     e.getByLabel(calibTag_,Calib);
00055     colls.calibCont=Calib.product();
00056   }
00057   edm::Handle<ZDCDigiCollection> zdc;
00058   if (!zdcTag_.label().empty()) {
00059     e.getByLabel(zdcTag_,zdc);
00060     colls.zdcCont=zdc.product();
00061   }
00062   edm::Handle<HcalTrigPrimDigiCollection> htp;
00063   if (!trigTag_.label().empty()) {
00064     e.getByLabel(trigTag_,htp);
00065     colls.tpCont=htp.product();
00066   }
00067   // get the mapping
00068   edm::ESHandle<HcalDbService> pSetup;
00069   es.get<HcalDbRecord>().get( pSetup );
00070   const HcalElectronicsMap* readoutMap=pSetup->getHcalMapping();
00071   // Step B: Create empty output
00072   std::auto_ptr<FEDRawDataCollection> raw=std::auto_ptr<FEDRawDataCollection>(new FEDRawDataCollection());
00073 
00074   const int ifed_first=FEDNumbering::getHcalFEDIds().first;
00075   const int ifed_last=FEDNumbering::getHcalFEDIds().second;
00076 
00077   int orbitN=e.id().event();
00078   int bcnN=2000;
00079 
00080   // Step C: pack all requested FEDs
00081   for (int ifed=ifed_first; ifed<=ifed_last; ++ifed) {
00082     FEDRawData& fed = raw->FEDData(ifed);
00083     try {
00084       packer_.pack(ifed,ifed-ifed_first, e.id().event(),
00085                    orbitN, bcnN, colls, *readoutMap, fed);
00086     } catch (cms::Exception& e) {
00087       edm::LogWarning("Unpacking error") << e.what();
00088     } catch (...) {
00089       edm::LogWarning("Unpacking exception");
00090     }
00091   }
00092 
00093 
00094   e.put(raw);
00095 }


Member Data Documentation

edm::InputTag HcalDigiToRaw::calibTag_ [private]

Definition at line 34 of file HcalDigiToRaw.h.

Referenced by produce().

edm::InputTag HcalDigiToRaw::hbheTag_ [private]

Definition at line 34 of file HcalDigiToRaw.h.

Referenced by produce().

edm::InputTag HcalDigiToRaw::hfTag_ [private]

Definition at line 34 of file HcalDigiToRaw.h.

Referenced by produce().

edm::InputTag HcalDigiToRaw::hoTag_ [private]

Definition at line 34 of file HcalDigiToRaw.h.

Referenced by produce().

HcalPacker HcalDigiToRaw::packer_ [private]

Definition at line 33 of file HcalDigiToRaw.h.

Referenced by produce().

edm::InputTag HcalDigiToRaw::trigTag_ [private]

Definition at line 34 of file HcalDigiToRaw.h.

Referenced by produce().

edm::InputTag HcalDigiToRaw::zdcTag_ [private]

Definition at line 34 of file HcalDigiToRaw.h.

Referenced by produce().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:23:37 2009 for CMSSW by  doxygen 1.5.4