CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MTCCHLTrigger.cc
Go to the documentation of this file.
6 
7 namespace cms
8 {
10  selOnDigiCharge=ps.getParameter<bool>("SelOnDigiCharge");
11  ChargeThreshold=ps.getParameter<int>("ChargeThreshold");
12  clusterProducer = ps.getParameter<std::string>("ClusterProducer");
13  produces <int>();
14  produces <unsigned int>();
15 }
16 
18  //get data
19  //StripCluster
22 
23  //StripDigi from RawToDigi and ZeroSuppressor
24  std::vector< edm::Handle< edm::DetSetVector<SiStripDigi> > > di;
25  e.getManyByType(di);
26 
27  if (selOnDigiCharge) {
28  unsigned int digiadc=0;
29  for (std::vector< edm::Handle< edm::DetSetVector<SiStripDigi> > >::const_iterator mi = di.begin(); mi!=di.end(); 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++) digiadc += vit->adc();
32  }
33  }
34  return (digiadc>ChargeThreshold) ? true : false;
35  } else {
36  unsigned int amplclus=0;
37  for (edm::DetSetVector<SiStripCluster>::const_iterator it=h->begin();it!=h->end();it++) {
38  for(std::vector<SiStripCluster>::const_iterator vit=(it->data).begin(); vit!=(it->data).end(); vit++){
39  for(auto ia=vit->amplitudes().begin(); ia!=vit->amplitudes().end(); ia++)
40  {
41  if ((*ia)>0){ amplclus+=(*ia); }
42  }
43  }
44  }
45  bool decision= (amplclus>ChargeThreshold) ? true : false;
46  e.put(std::make_unique<unsigned int>(amplclus));
47  e.put(std::make_unique<int>(decision));
48  return decision;
49  }
50  }
51 }
void getManyByType(std::vector< Handle< PROD > > &results) const
Definition: Event.h:447
T getParameter(std::string const &) const
unsigned int ChargeThreshold
Definition: MTCCHLTrigger.h:23
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
MTCCHLTrigger(const edm::ParameterSet &ps)
Definition: MTCCHLTrigger.cc:9
std::string clusterProducer
Definition: MTCCHLTrigger.h:27
virtual bool filter(edm::Event &e, edm::EventSetup const &c)
#define end
Definition: vmac.h:37
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:413
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:346
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:104