#include <MTCCHLTrigger.h>
Public Member Functions | |
virtual bool | filter (edm::Event &e, edm::EventSetup const &c) |
MTCCHLTrigger (const edm::ParameterSet &ps) | |
virtual | ~MTCCHLTrigger () |
Private Attributes | |
unsigned int | ChargeThreshold |
std::string | clusterProducer |
bool | selOnDigiCharge |
Definition at line 13 of file MTCCHLTrigger.h.
cms::MTCCHLTrigger::MTCCHLTrigger | ( | const edm::ParameterSet & | ps | ) |
Definition at line 9 of file MTCCHLTrigger.cc.
References ChargeThreshold, clusterProducer, edm::ParameterSet::getParameter(), selOnDigiCharge, and AlCaHLTBitMon_QueryRunRegistry::string.
{ selOnDigiCharge=ps.getParameter<bool>("SelOnDigiCharge"); ChargeThreshold=ps.getParameter<int>("ChargeThreshold"); clusterProducer = ps.getParameter<std::string>("ClusterProducer"); produces <int>(); produces <unsigned int>(); }
virtual cms::MTCCHLTrigger::~MTCCHLTrigger | ( | ) | [inline, virtual] |
Definition at line 16 of file MTCCHLTrigger.h.
{}
bool cms::MTCCHLTrigger::filter | ( | edm::Event & | e, |
edm::EventSetup const & | c | ||
) | [virtual] |
Implements edm::EDFilter.
Definition at line 17 of file MTCCHLTrigger.cc.
References edm::DetSetVector< T >::begin(), ChargeThreshold, clusterProducer, end, edm::Event::getByLabel(), edm::Event::getManyByType(), h, convertSQLitetoXML_cfg::output, edm::Event::put(), and selOnDigiCharge.
{ //get data //StripCluster edm::Handle< edm::DetSetVector<SiStripCluster> > h; e.getByLabel(clusterProducer,h); //StripDigi from RawToDigi and ZeroSuppressor std::vector< edm::Handle< edm::DetSetVector<SiStripDigi> > > di; e.getManyByType(di); if (selOnDigiCharge) { unsigned int digiadc=0; for (std::vector< edm::Handle< edm::DetSetVector<SiStripDigi> > >::const_iterator mi = di.begin(); mi!=di.end(); mi++){ for (edm::DetSetVector<SiStripDigi>::const_iterator it = (*mi)->begin(); it!= (*mi)->end();it++) { for(std::vector<SiStripDigi>::const_iterator vit=(it->data).begin(); vit!=(it->data).end(); vit++) digiadc += vit->adc(); } } return (digiadc>ChargeThreshold) ? true : false; } else { unsigned int amplclus=0; for (edm::DetSetVector<SiStripCluster>::const_iterator it=h->begin();it!=h->end();it++) { for(std::vector<SiStripCluster>::const_iterator vit=(it->data).begin(); vit!=(it->data).end(); vit++){ for(std::vector<uint8_t>::const_iterator ia=vit->amplitudes().begin(); ia!=vit->amplitudes().end(); ia++) { if ((*ia)>0){ amplclus+=(*ia); } } } } bool decision= (amplclus>ChargeThreshold) ? true : false; std::auto_ptr< unsigned int > output( new unsigned int(amplclus) ); std::auto_ptr< int > output_dec( new int(decision) ); e.put(output); e.put(output_dec); return decision; } }
unsigned int cms::MTCCHLTrigger::ChargeThreshold [private] |
Definition at line 23 of file MTCCHLTrigger.h.
Referenced by filter(), and MTCCHLTrigger().
std::string cms::MTCCHLTrigger::clusterProducer [private] |
Definition at line 27 of file MTCCHLTrigger.h.
Referenced by filter(), and MTCCHLTrigger().
bool cms::MTCCHLTrigger::selOnDigiCharge [private] |
Definition at line 22 of file MTCCHLTrigger.h.
Referenced by filter(), and MTCCHLTrigger().