CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ESZeroSuppressionProducer.cc
Go to the documentation of this file.
4 
6 
7  digiProducer_ = ps.getParameter<std::string>("digiProducer");
8  ESdigiCollection_ = ps.getParameter<std::string>("ESdigiCollection");
9  ESZSdigiCollection_ = ps.getParameter<std::string>("ESZSdigiCollection");
10 
11  produces<ESDigiCollection>(ESZSdigiCollection_);
12 }
13 
15 
16 }
17 
19 
20  eventSetup.get<ESThresholdsRcd>().get(esthresholds_);
21  const ESThresholds *thresholds = esthresholds_.product();
22 
23  eventSetup.get<ESPedestalsRcd>().get(espeds_);
24  const ESPedestals *pedestals = espeds_.product();
25 
26  float ts2Threshold = thresholds->getTS2Threshold();
27 
29 
30  bool fullESDigis = true;
31  event.getByLabel(digiProducer_, ESDigis);
32  if (!ESDigis.isValid()) {
33  edm::LogError("ZeroSuppressionError") << "Error! can't get the product " << ESdigiCollection_.c_str() ;
34  fullESDigis = false;
35  }
36 
37  std::auto_ptr<ESDigiCollection> ESZSDigis(new ESDigiCollection());
38 
39  if (fullESDigis) {
41  for (i=ESDigis->begin(); i!=ESDigis->end(); ++i) {
42 
43  ESDataFrame dataframe = (*i);
44 
45  ESPedestals::const_iterator it_ped = pedestals->find(dataframe.id());
46 
47  if (dataframe.sample(1).adc() > (ts2Threshold+it_ped->getMean())) {
48  //std::cout<<dataframe.sample(1).adc()<<" "<<ts2Threshold+it_ped->getMean()<<std::endl;
49  (*ESZSDigis).push_back(*i);
50  }
51  }
52  }
53 
54  event.put(ESZSDigis, ESZSdigiCollection_);
55 }
56 
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
ESZeroSuppressionProducer(const edm::ParameterSet &ps)
edm::ESHandle< ESPedestals > espeds_
const ESDetId & id() const
Definition: ESDataFrame.h:18
std::vector< T >::const_iterator const_iterator
edm::ESHandle< ESThresholds > esthresholds_
const_iterator find(uint32_t rawId) const
const ESSample & sample(int i) const
Definition: ESDataFrame.h:23
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool isValid() const
Definition: HandleBase.h:76
float getTS2Threshold() const
Definition: ESThresholds.h:14
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
edm::SortedCollection< ESDataFrame > ESDigiCollection
std::vector< Item >::const_iterator const_iterator
virtual void produce(edm::Event &event, const edm::EventSetup &eventSetup)
int adc() const
get the ADC sample (singed 16 bits)
Definition: ESSample.h:18