CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CTPPSPixelRawToDigi Class Reference

#include <CTPPSPixelRawToDigi.h>

Inheritance diagram for CTPPSPixelRawToDigi:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CTPPSPixelRawToDigi (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 get data, convert to digis attach againe to Event More...
 
virtual ~CTPPSPixelRawToDigi ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

edm::ParameterSet config_
 
std::set< unsigned int > fedIds_
 
edm::EDGetTokenT< FEDRawDataCollectionFEDRawDataCollection_
 
edm::InputTag label_
 
std::string mappingLabel_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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

Definition at line 24 of file CTPPSPixelRawToDigi.h.

Constructor & Destructor Documentation

CTPPSPixelRawToDigi::CTPPSPixelRawToDigi ( const edm::ParameterSet conf)
explicit

Definition at line 27 of file CTPPSPixelRawToDigi.cc.

References config_, FEDRawDataCollection_, edm::ParameterSet::getParameter(), mappingLabel_, and AlCaHLTBitMon_QueryRunRegistry::string.

28  : config_(conf)
29 
30 {
31 
32  FEDRawDataCollection_ = consumes <FEDRawDataCollection> (config_.getParameter<edm::InputTag>("InputLabel"));
33 
34 // Products
35  produces< edm::DetSetVector<CTPPSPixelDigi> >();
36 
37 //CablingMap could have a label //Tav
38  mappingLabel_ = config_.getParameter<std::string> ("mappingLabel"); //RPix
39 
40 }
T getParameter(std::string const &) const
edm::ParameterSet config_
edm::EDGetTokenT< FEDRawDataCollection > FEDRawDataCollection_
CTPPSPixelRawToDigi::~CTPPSPixelRawToDigi ( )
virtual

Definition at line 43 of file CTPPSPixelRawToDigi.cc.

43  {
44  edm::LogInfo("CTPPSPixelRawToDigi") << " CTPPSPixelRawToDigi destructor!";
45 
46 }

Member Function Documentation

void CTPPSPixelRawToDigi::produce ( edm::Event ev,
const edm::EventSetup es 
)
overridevirtual

get data, convert to digis attach againe to Event

create product (digis & errors)

get event data for this fed

send digis and errors back to framework

Definition at line 48 of file CTPPSPixelRawToDigi.cc.

References mps_alisetup::collection, TauDecayModes::dec, DEFINE_FWK_MODULE, FEDRawDataCollection::FEDData(), l1t::stage2::layer2::fedId, CTPPSPixelDAQMapping::fedIds(), fedIds_, FEDRawDataCollection_, edm::EventSetup::get(), edm::Event::getByToken(), CTPPSPixelDataFormatter::interpretRawData(), HPSPFTaus_cff::mapping, FEDNumbering::MAXCTPPSPixelsFEDID, FEDNumbering::MINCTPPSPixelsFEDID, eostools::move(), edm::Event::put(), CTPPSPixelDAQMapping::ROCMapping, and FEDRawData::size().

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

50 {
51 
52 
54  ev.getByToken(FEDRawDataCollection_, buffers);
55 
57 
58  bool data_exist=false;
60  const FEDRawData& tempRawData = buffers->FEDData( fed );
61  if(tempRawData.size()!=0){
62  data_exist=true;
63  break;
64  }
65  }
67  auto collection = std::make_unique<edm::DetSetVector<CTPPSPixelDigi>>();
68 
69 
70  if(data_exist){
71  es.get<CTPPSPixelDAQMappingRcd>().get( mapping);
72 
73 
74  fedIds_ = mapping->fedIds();
75 
76  CTPPSPixelDataFormatter formatter(mapping->ROCMapping);
77 
78  bool errorsInEvent = false;
79  for (auto aFed = fedIds_.begin(); aFed != fedIds_.end(); ++aFed) {
80  int fedId = *aFed;
81 
82  edm::LogInfo("CTPPSPixelRawToDigi")<< " PRODUCE DIGI FOR FED: " << dec <<fedId << endl;
83 
85  const FEDRawData& fedRawData = buffers->FEDData( fedId );
86 
87  formatter.interpretRawData( errorsInEvent, fedId, fedRawData, *collection);
88  }
89  }
92 
93 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
std::set< unsigned int > fedIds() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
std::set< unsigned int > fedIds_
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
std::map< CTPPSPixelFramePosition, CTPPSPixelROCInfo > ROCMapping
const T & get() const
Definition: EventSetup.h:55
edm::EDGetTokenT< FEDRawDataCollection > FEDRawDataCollection_
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

edm::ParameterSet CTPPSPixelRawToDigi::config_
private

Definition at line 36 of file CTPPSPixelRawToDigi.h.

Referenced by CTPPSPixelRawToDigi().

std::set<unsigned int> CTPPSPixelRawToDigi::fedIds_
private

Definition at line 40 of file CTPPSPixelRawToDigi.h.

Referenced by produce().

edm::EDGetTokenT<FEDRawDataCollection> CTPPSPixelRawToDigi::FEDRawDataCollection_
private

Definition at line 38 of file CTPPSPixelRawToDigi.h.

Referenced by CTPPSPixelRawToDigi(), and produce().

edm::InputTag CTPPSPixelRawToDigi::label_
private
std::string CTPPSPixelRawToDigi::mappingLabel_
private

Definition at line 44 of file CTPPSPixelRawToDigi.h.

Referenced by CTPPSPixelRawToDigi().