CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MTCCHLTrigger.cc
Go to the documentation of this file.
6 
7 namespace cms {
9  selOnDigiCharge = ps.getParameter<bool>("SelOnDigiCharge");
10  ChargeThreshold = ps.getParameter<int>("ChargeThreshold");
11  clusterProducer = ps.getParameter<std::string>("ClusterProducer");
12  produces<int>();
13  produces<unsigned int>();
14  }
15 
17  //get data
18  //StripCluster
21 
22  //StripDigi from RawToDigi and ZeroSuppressor
23  std::vector<edm::Handle<edm::DetSetVector<SiStripDigi> > > di;
24  e.getManyByType(di);
25 
26  if (selOnDigiCharge) {
27  unsigned int digiadc = 0;
28  for (std::vector<edm::Handle<edm::DetSetVector<SiStripDigi> > >::const_iterator mi = di.begin(); mi != di.end();
29  mi++) {
30  for (edm::DetSetVector<SiStripDigi>::const_iterator it = (*mi)->begin(); it != (*mi)->end(); it++) {
31  for (std::vector<SiStripDigi>::const_iterator vit = (it->data).begin(); vit != (it->data).end(); vit++)
32  digiadc += vit->adc();
33  }
34  }
35  return (digiadc > ChargeThreshold) ? true : false;
36  } else {
37  unsigned int amplclus = 0;
38  for (edm::DetSetVector<SiStripCluster>::const_iterator it = h->begin(); it != h->end(); it++) {
39  for (std::vector<SiStripCluster>::const_iterator vit = (it->data).begin(); vit != (it->data).end(); vit++) {
40  for (auto ia = vit->amplitudes().begin(); ia != vit->amplitudes().end(); ia++) {
41  if ((*ia) > 0) {
42  amplclus += (*ia);
43  }
44  }
45  }
46  }
47  bool decision = (amplclus > ChargeThreshold) ? true : false;
48  e.put(std::make_unique<unsigned int>(amplclus));
49  e.put(std::make_unique<int>(decision));
50  return decision;
51  }
52  }
53 } // namespace cms
unsigned int ChargeThreshold
Definition: MTCCHLTrigger.h:22
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
const edm::EventSetup & c
MTCCHLTrigger(const edm::ParameterSet &ps)
Definition: MTCCHLTrigger.cc:8
std::string clusterProducer
Definition: MTCCHLTrigger.h:26
void getManyByType(std::vector< Handle< PROD >> &results) const
Definition: Event.h:530
bool filter(edm::Event &e, edm::EventSetup const &c) override
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:500
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
string end
Definition: dataset.py:937
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:314
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4