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
HcalTTPTriggerRecord Class Reference

#include <HcalTTPTriggerRecord.h>

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

Public Member Functions

 HcalTTPTriggerRecord (const edm::ParameterSet &ps)
 
virtual void produce (edm::Event &e, const edm::EventSetup &c)
 
virtual ~HcalTTPTriggerRecord ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

std::vector< std::string > names_
 
std::vector< unsigned int > ttpBits_
 
edm::InputTag ttpDigis_
 

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
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 9 of file HcalTTPTriggerRecord.h.

Constructor & Destructor Documentation

HcalTTPTriggerRecord::HcalTTPTriggerRecord ( const edm::ParameterSet ps)
explicit

Definition at line 10 of file HcalTTPTriggerRecord.cc.

References edm::ParameterSet::getParameter(), names_, ttpBits_, and ttpDigis_.

11 {
12  ttpDigis_ = ps.getParameter<edm::InputTag>("ttpDigiCollection") ;
13  ttpBits_ = ps.getParameter< std::vector<unsigned int> >("ttpBits");
14  names_ = ps.getParameter< std::vector<std::string> >("ttpBitNames");
15 
16  produces<L1GtTechnicalTriggerRecord>();
17 }
T getParameter(std::string const &) const
std::vector< unsigned int > ttpBits_
std::vector< std::string > names_
HcalTTPTriggerRecord::~HcalTTPTriggerRecord ( )
virtual

Definition at line 20 of file HcalTTPTriggerRecord.cc.

20  {
21 }

Member Function Documentation

void HcalTTPTriggerRecord::produce ( edm::Event e,
const edm::EventSetup c 
)
virtual

Implements edm::EDProducer.

Definition at line 23 of file HcalTTPTriggerRecord.cc.

References edm::SortedCollection< T, SORT >::begin(), funct::false, edm::Event::getByLabel(), i, names_, convertSQLitetoXML_cfg::output, edm::Event::put(), ttpBits_, and ttpDigis_.

23  {
24 
25  std::vector<L1GtTechnicalTrigger> vecTT(ttpBits_.size()) ;
26 
27  // Get Inputs
28  edm::Handle<HcalTTPDigiCollection> ttpDigiCollection ;
29  e.getByLabel(ttpDigis_,ttpDigiCollection) ;
30 
31  if ( !ttpDigiCollection.failedToGet() ) {
32  const HcalTTPDigiCollection* ttpDigis = ttpDigiCollection.product() ;
33  uint8_t ttpResults = ttpDigis->begin()->triggerOutput() ;
34  bool bit8 = ttpResults & 0x1 ;
35  bool bit9 = ttpResults & 0x2 ;
36  bool bit10 = ttpResults & 0x4 ;
37 
38  for (unsigned int i=0; i<ttpBits_.size(); i++) {
39  bool bitValue = false ;
40  if ( ttpBits_.at(i) == 8 ) bitValue = bit8 ;
41  if ( ttpBits_.at(i) == 9 ) bitValue = bit9 ;
42  if ( ttpBits_.at(i) == 10 ) bitValue = bit10 ;
43  vecTT.at(i) = L1GtTechnicalTrigger(names_.at(i), ttpBits_.at(i), 0, bitValue) ;
44  }
45  } else {
46  vecTT.clear() ;
47  }
48 
49  // Put output into event
50  std::auto_ptr<L1GtTechnicalTriggerRecord> output(new L1GtTechnicalTriggerRecord()) ;
51  output->setGtTechnicalTrigger(vecTT) ;
52  e.put(output) ;
53 }
int i
Definition: DBlmapReader.cc:9
std::vector< unsigned int > ttpBits_
std::vector< std::string > names_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
const_iterator begin() const

Member Data Documentation

std::vector<std::string> HcalTTPTriggerRecord::names_
private

Definition at line 22 of file HcalTTPTriggerRecord.h.

Referenced by HcalTTPTriggerRecord(), and produce().

std::vector<unsigned int> HcalTTPTriggerRecord::ttpBits_
private

Definition at line 21 of file HcalTTPTriggerRecord.h.

Referenced by HcalTTPTriggerRecord(), and produce().

edm::InputTag HcalTTPTriggerRecord::ttpDigis_
private

Definition at line 20 of file HcalTTPTriggerRecord.h.

Referenced by HcalTTPTriggerRecord(), and produce().