CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
sistrip::SpyDigiConverterModule Class Reference
Inheritance diagram for sistrip::SpyDigiConverterModule:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void produce (edm::Event &, const edm::EventSetup &) override
 
 SpyDigiConverterModule (const edm::ParameterSet &)
 
 ~SpyDigiConverterModule ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

const bool discardDigisWithAPVAddressError_
 
const uint32_t expectedHeaderBit_
 
sistrip::SpyUtilities::FrameQuality frameQuality_
 
const edm::InputTag productLabel_
 
const bool storeAPVAddress_
 True = store APVE address for each channel. More...
 
const bool storeModuleDigis_
 
const bool storePayloadDigis_
 
const bool storeReorderedDigis_
 
SpyUtilities utility_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 36 of file SiStripSpyDigiConverterModule.cc.

Constructor & Destructor Documentation

sistrip::SpyDigiConverterModule::SpyDigiConverterModule ( const edm::ParameterSet pset)

Definition at line 61 of file SiStripSpyDigiConverterModule.cc.

References frameQuality_, edm::ParameterSet::getParameter(), edm::isDebugEnabled(), LogTrace, sistrip::SpyUtilities::FrameQuality::maxDigiRange, sistrip::SpyUtilities::FrameQuality::maxTickHeight, sistrip::SpyUtilities::FrameQuality::maxZeroLight, sistrip::SpyUtilities::FrameQuality::minDigiRange, sistrip::SpyUtilities::FrameQuality::minTickHeight, sistrip::SpyUtilities::FrameQuality::minZeroLight, storeAPVAddress_, storeModuleDigis_, storePayloadDigis_, and storeReorderedDigis_.

61  :
62  productLabel_(pset.getParameter<edm::InputTag>("InputProductLabel")),
63  storeAPVAddress_(pset.getParameter<bool>("StoreAPVAddress")),
64  storePayloadDigis_(pset.getParameter<bool>("StorePayloadDigis")),
65  storeReorderedDigis_(pset.getParameter<bool>("StoreReorderedDigis")),
66  storeModuleDigis_(pset.getParameter<bool>("StoreModuleDigis")),
67  discardDigisWithAPVAddressError_(pset.getParameter<bool>("DiscardDigisWithWrongAPVAddress")),
68  expectedHeaderBit_(pset.getParameter<uint32_t>("ExpectedPositionOfFirstHeaderBit"))
69  {
70  if ( edm::isDebugEnabled() ) {
71  LogTrace("SiStripSpyDigiConverter")
72  << "[sistrip::SpyDigiConverterModule::" << __func__ << "]"
73  << " Constructing object...";
74  }
75 
76  if (storePayloadDigis_) produces< edm::DetSetVector<SiStripRawDigi> >("Payload");
77  if (storeReorderedDigis_) produces< edm::DetSetVector<SiStripRawDigi> >("Reordered");
78  if (storeModuleDigis_) produces< edm::DetSetVector<SiStripRawDigi> >("VirginRaw");
79 
80  if (storeAPVAddress_) {
81  produces< std::vector<uint32_t> >("APVAddress");
82  //produces<uint8_t>("APVAddress");
83  }
84 
85 
86  frameQuality_.minDigiRange = static_cast<uint16_t>(pset.getParameter<uint32_t>("MinDigiRange"));
87  frameQuality_.maxDigiRange = static_cast<uint16_t>(pset.getParameter<uint32_t>("MaxDigiRange"));
88  frameQuality_.minZeroLight = static_cast<uint16_t>(pset.getParameter<uint32_t>("MinZeroLight"));
89  frameQuality_.maxZeroLight = static_cast<uint16_t>(pset.getParameter<uint32_t>("MaxZeroLight"));
90  frameQuality_.minTickHeight = static_cast<uint16_t>(pset.getParameter<uint32_t>("MinTickHeight"));
91  frameQuality_.maxTickHeight = static_cast<uint16_t>(pset.getParameter<uint32_t>("MaxTickHeight"));
92 
93 
94  } // end of constructor.
T getParameter(std::string const &) const
bool isDebugEnabled()
const bool storeAPVAddress_
True = store APVE address for each channel.
#define LogTrace(id)
sistrip::SpyUtilities::FrameQuality frameQuality_
sistrip::SpyDigiConverterModule::~SpyDigiConverterModule ( )

Definition at line 97 of file SiStripSpyDigiConverterModule.cc.

References edm::isDebugEnabled(), and LogTrace.

97  {
98  if ( edm::isDebugEnabled() ) {
99  LogTrace("SiStripSpyDigiConverter")
100  << "[sistrip::SpyDigiConverterModule::" << __func__ << "]"
101  << " Destructing object...";
102  }
103  } // end of destructor.
bool isDebugEnabled()
#define LogTrace(id)

Member Function Documentation

void sistrip::SpyDigiConverterModule::produce ( edm::Event event,
const edm::EventSetup setup 
)
overridevirtual

Retrieves cabling map from EventSetup and spy channel scope mode digis from Event, creates DetSetVectors of SiStripRawDigis, at verious levels of processing, using the SiStripSpyDigiConverter class and attaches the containers to the Event.

Implements edm::EDProducer.

Definition at line 111 of file SiStripSpyDigiConverterModule.cc.

References discardDigisWithAPVAddressError_, expectedHeaderBit_, sistrip::SpyDigiConverter::extractPayloadDigis(), frameQuality_, sistrip::SpyUtilities::getCabling(), sistrip::SpyUtilities::getMajorityHeader(), sistrip::SpyDigiConverter::mergeModuleChannels(), edm::Handle< T >::product(), productLabel_, sistrip::SpyDigiConverter::reorderDigis(), storeAPVAddress_, storeModuleDigis_, storePayloadDigis_, storeReorderedDigis_, and utility_.

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

111  {
112 
113  static bool lFirstEvent = true;
114 
115  const SiStripFedCabling* lCabling = utility_.getCabling( setup );
116 
118 
119  //retrieve the scope mode digis
121  event.getByLabel(productLabel_, scopeDigisHandle);
122 
123  //32-bit to accomodate known CMSSW container
124  std::auto_ptr< std::vector<uint32_t> > pAPVAddresses(new std::vector<uint32_t>);
125 
126  std::auto_ptr<sistrip::SpyDigiConverter::DSVRawDigis> payloadDigis, reorderedDigis, moduleDigis;
127 
128  //get the majority value for expected position of first header bit
129  //from first event, compare to expected one, else output warning.
130  if (lFirstEvent){
131  uint16_t lFirstHeaderBit;
132  sistrip::SpyUtilities::getMajorityHeader(scopeDigisHandle.product(),lFirstHeaderBit);
133 
134  if (lFirstHeaderBit != static_cast<uint16_t>(expectedHeaderBit_)) {
135  edm::LogWarning("") << " -- Majority position for firstHeaderBit in first event ("
136  << lFirstHeaderBit
137  << ") is not where expected: "
138  << static_cast<uint16_t>(expectedHeaderBit_)
139  << std::endl;
140  }
141 
142  }
143 
144 
145 
146  //extract frame digis and APV addresses
147  payloadDigis = sistrip::SpyDigiConverter::extractPayloadDigis(scopeDigisHandle.product(),
148  pAPVAddresses.get(),
150  frameQuality_,
151  static_cast<uint16_t>(expectedHeaderBit_));
152 
153  // Reorder
155  reorderedDigis = sistrip::SpyDigiConverter::reorderDigis(payloadDigis.get());
156  }
157 
158  // Merge into modules
159  if (storeModuleDigis_) {
160  moduleDigis = sistrip::SpyDigiConverter::mergeModuleChannels(reorderedDigis.get(), *lCabling);
161  }
162 
163  //add to event
164  if (storePayloadDigis_) event.put(payloadDigis,"Payload");
165  if (storeReorderedDigis_) event.put(reorderedDigis,"Reordered");
166  if (storeModuleDigis_) event.put(moduleDigis,"VirginRaw");
167  if (storeAPVAddress_) {
168  event.put(pAPVAddresses, "APVAddress");
169  }
170 
171 
172  lFirstEvent = false;
173 
174  } // end of SpyDigiConverter::produce method.
static std::auto_ptr< DSVRawDigis > mergeModuleChannels(const DSVRawDigis *inputPhysicalOrderChannelDigis, const SiStripFedCabling &cabling)
static std::auto_ptr< DSVRawDigis > extractPayloadDigis(const DSVRawDigis *inputScopeDigis, std::vector< uint32_t > *pAPVAddresses, const bool discardDigisWithAPVAddrErr, const sistrip::SpyUtilities::FrameQuality &aQuality, const uint16_t expectedPos)
Extract frames from the scope digis.
static std::auto_ptr< DSVRawDigis > reorderDigis(const DSVRawDigis *inputPayloadDigis)
const bool storeAPVAddress_
True = store APVE address for each channel.
const SiStripFedCabling * getCabling(const edm::EventSetup &)
Updates the cabling object from the DB.
T const * product() const
Definition: Handle.h:74
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
sistrip::SpyUtilities::FrameQuality frameQuality_
static void getMajorityHeader(const edm::DetSetVector< SiStripRawDigi > *aInputDigis, uint16_t &firstHeaderBit, bool printResult=true)

Member Data Documentation

const bool sistrip::SpyDigiConverterModule::discardDigisWithAPVAddressError_
private

Definition at line 48 of file SiStripSpyDigiConverterModule.cc.

Referenced by produce().

const uint32_t sistrip::SpyDigiConverterModule::expectedHeaderBit_
private

Definition at line 49 of file SiStripSpyDigiConverterModule.cc.

Referenced by produce().

sistrip::SpyUtilities::FrameQuality sistrip::SpyDigiConverterModule::frameQuality_
private

Definition at line 47 of file SiStripSpyDigiConverterModule.cc.

Referenced by produce(), and SpyDigiConverterModule().

const edm::InputTag sistrip::SpyDigiConverterModule::productLabel_
private

Definition at line 44 of file SiStripSpyDigiConverterModule.cc.

Referenced by produce().

const bool sistrip::SpyDigiConverterModule::storeAPVAddress_
private

True = store APVE address for each channel.

Definition at line 45 of file SiStripSpyDigiConverterModule.cc.

Referenced by produce(), and SpyDigiConverterModule().

const bool sistrip::SpyDigiConverterModule::storeModuleDigis_
private

Definition at line 46 of file SiStripSpyDigiConverterModule.cc.

Referenced by produce(), and SpyDigiConverterModule().

const bool sistrip::SpyDigiConverterModule::storePayloadDigis_
private

Definition at line 46 of file SiStripSpyDigiConverterModule.cc.

Referenced by produce(), and SpyDigiConverterModule().

const bool sistrip::SpyDigiConverterModule::storeReorderedDigis_
private

Definition at line 46 of file SiStripSpyDigiConverterModule.cc.

Referenced by produce(), and SpyDigiConverterModule().

SpyUtilities sistrip::SpyDigiConverterModule::utility_
private

Definition at line 52 of file SiStripSpyDigiConverterModule.cc.

Referenced by produce().