CMS 3D CMS Logo

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
20  e.getByLabel(clusterProducer, h);
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:19
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
MTCCHLTrigger(const edm::ParameterSet &ps)
Definition: MTCCHLTrigger.cc:8
std::string clusterProducer
Definition: MTCCHLTrigger.h:20
bool filter(edm::Event &e, edm::EventSetup const &c) override
Namespace of DDCMS conversion namespace.
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