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
h
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition: L1TUtmAlgorithmRcd.h:4
edm::DetSetVector::begin
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:314
edm::Handle
Definition: AssociativeIterator.h:50
end
#define end
Definition: vmac.h:39
SiStripDigi.h
h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
funct::true
true
Definition: Factorize.h:173
edm::ParameterSet
Definition: ParameterSet.h:36
SiStripCluster.h
edm::DetSetVector::const_iterator
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
edm::EventSetup
Definition: EventSetup.h:57
DetSetVector.h
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
cms::MTCCHLTrigger::clusterProducer
std::string clusterProducer
Definition: MTCCHLTrigger.h:26
cms::MTCCHLTrigger::selOnDigiCharge
bool selOnDigiCharge
Definition: MTCCHLTrigger.h:21
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
cms::MTCCHLTrigger::ChargeThreshold
unsigned int ChargeThreshold
Definition: MTCCHLTrigger.h:22
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
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