CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/EventFilter/SiStripRawToDigi/interface/SiStripDigiToRaw.h

Go to the documentation of this file.
00001 // Last commit: $Id: SiStripDigiToRaw.h,v 1.23 2009/09/14 14:01:03 nc302 Exp $
00002 
00003 #ifndef EventFilter_SiStripRawToDigi_SiStripDigiToRaw_H
00004 #define EventFilter_SiStripRawToDigi_SiStripDigiToRaw_H
00005 
00006 #include "DataFormats/Common/interface/Handle.h"
00007 #include "DataFormats/Common/interface/DetSetVector.h"
00008 #include "FWCore/Framework/interface/ESHandle.h"
00009 #include "FWCore/Framework/interface/Event.h"
00010 #include "boost/cstdint.hpp"
00011 #include <string>
00012 
00013 #include "EventFilter/SiStripRawToDigi/interface/SiStripFEDBufferGenerator.h"
00014 
00015 class SiStripFedCabling;
00016 class FEDRawDataCollection;
00017 class SiStripDigi;
00018 class SiStripRawDigi;
00019 
00020 namespace sistrip {
00021 
00029   class DigiToRaw {
00030     
00031   public: // ----- public interface -----
00032     
00033     DigiToRaw( FEDReadoutMode, bool use_fed_key );
00034     ~DigiToRaw();
00035     
00036     void createFedBuffers( edm::Event&, 
00037                            edm::ESHandle<SiStripFedCabling>& cabling,
00038                            edm::Handle< edm::DetSetVector<SiStripDigi> >& digis,
00039                            std::auto_ptr<FEDRawDataCollection>& buffers );
00040     void createFedBuffers( edm::Event&, 
00041                            edm::ESHandle<SiStripFedCabling>& cabling,
00042                            edm::Handle< edm::DetSetVector<SiStripRawDigi> >& digis,
00043                            std::auto_ptr<FEDRawDataCollection>& buffers);
00044     
00045     inline void fedReadoutMode( FEDReadoutMode mode ) { mode_ = mode; }
00046 
00047   private: // ----- private data members -----
00048     
00049     template<class Digi_t>
00050     void createFedBuffers_( edm::Event&, 
00051                             edm::ESHandle<SiStripFedCabling>& cabling,
00052                             edm::Handle< edm::DetSetVector<Digi_t> >& digis,
00053                             std::auto_ptr<FEDRawDataCollection>& buffers,
00054                             bool zeroSuppressed);
00055     uint16_t STRIP(const edm::DetSet<SiStripDigi>::const_iterator& it, const edm::DetSet<SiStripDigi>::const_iterator& begin) const;
00056     uint16_t STRIP(const edm::DetSet<SiStripRawDigi>::const_iterator& it, const edm::DetSet<SiStripRawDigi>::const_iterator& begin) const;
00057     
00058     FEDReadoutMode mode_;
00059     bool useFedKey_;
00060     FEDBufferGenerator bufferGenerator_;
00061     
00062   };
00063   
00064 }
00065 
00066 
00067 #endif // EventFilter_SiStripRawToDigi_SiStripDigiToRaw_H
00068