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  std::auto_ptr< unsigned int > output( new unsigned int(amplclus) );
47  std::auto_ptr< int > output_dec( new int(decision) );
48  e.put(output);
49  e.put(output_dec);
50  return decision;
51  }
52  }
53 }
void getManyByType(std::vector< Handle< PROD > > &results) const
Definition: Event.h:452
T getParameter(std::string const &) const
unsigned int ChargeThreshold
Definition: MTCCHLTrigger.h:23
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)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
#define end
Definition: vmac.h:37
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:418
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:346
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:104