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
MTCCHLTrigger.h
edm::DetSetVector< SiStripDigi >
Handle.h
edm::DetSetVector::begin
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:314
h
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
edm::Handle
Definition: AssociativeIterator.h:50
SiStripDigi.h
mps_fire.end
end
Definition: mps_fire.py:242
h
funct::true
true
Definition: Factorize.h:173
edm::ParameterSet
Definition: ParameterSet.h:47
SiStripCluster.h
edm::DetSetVector::const_iterator
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
edm::EventSetup
Definition: EventSetup.h:58
DetSetVector.h
cms::MTCCHLTrigger::clusterProducer
std::string clusterProducer
Definition: MTCCHLTrigger.h:26
cms::MTCCHLTrigger::selOnDigiCharge
bool selOnDigiCharge
Definition: MTCCHLTrigger.h:21
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cms::MTCCHLTrigger::ChargeThreshold
unsigned int ChargeThreshold
Definition: MTCCHLTrigger.h:22
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
cms::MTCCHLTrigger::filter
bool filter(edm::Event &e, edm::EventSetup const &c) override
Definition: MTCCHLTrigger.cc:16
cms::MTCCHLTrigger::MTCCHLTrigger
MTCCHLTrigger(const edm::ParameterSet &ps)
Definition: MTCCHLTrigger.cc:8
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
edm::Event
Definition: Event.h:73
cms
Namespace of DDCMS conversion namespace.
Definition: ProducerAnalyzer.cc:21
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37