#include <SimCalorimetry/EcalZeroSuppressionProducers/interface/EcalZeroSuppressionProducer.h>
Public Member Functions | |
EcalZeroSuppressionProducer (const edm::ParameterSet ¶ms) | |
void | initCalibrations (const edm::EventSetup &eventSetup) |
virtual void | produce (edm::Event &event, const edm::EventSetup &eventSetup) |
Produces the EDM products,. | |
virtual | ~EcalZeroSuppressionProducer () |
Private Attributes | |
std::string | digiProducer_ |
std::string | EBdigiCollection_ |
std::string | EBZSdigiCollection_ |
std::string | EEdigiCollection_ |
std::string | EEZSdigiCollection_ |
double | glbBarrelThreshold_ |
double | glbEndcapThreshold_ |
EcalZeroSuppressor< EBDataFrame > | theBarrelZeroSuppressor_ |
EcalZeroSuppressor< EEDataFrame > | theEndcapZeroSuppressor_ |
Definition at line 24 of file EcalZeroSuppressionProducer.h.
EcalZeroSuppressionProducer::EcalZeroSuppressionProducer | ( | const edm::ParameterSet & | params | ) | [explicit] |
Definition at line 4 of file EcalZeroSuppressionProducer.cc.
References digiProducer_, EBdigiCollection_, EBZSdigiCollection_, EEdigiCollection_, EEZSdigiCollection_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), glbBarrelThreshold_, and glbEndcapThreshold_.
00005 { 00006 digiProducer_ = params.getParameter<std::string>("digiProducer"); 00007 EBdigiCollection_ = params.getParameter<std::string>("EBdigiCollection"); 00008 EEdigiCollection_ = params.getParameter<std::string>("EEdigiCollection"); 00009 EBZSdigiCollection_ = params.getParameter<std::string>("EBZSdigiCollection"); 00010 EEZSdigiCollection_ = params.getParameter<std::string>("EEZSdigiCollection"); 00011 00012 // initialize the default values for the thresholds in number of noise sigmas 00013 00014 glbBarrelThreshold_ = params.getUntrackedParameter<double>("glbBarrelThreshold",0.2); 00015 glbEndcapThreshold_ = params.getUntrackedParameter<double>("glbEndcapThreshold",0.4); 00016 00017 produces<EBDigiCollection>(EBZSdigiCollection_); 00018 produces<EEDigiCollection>(EEZSdigiCollection_); 00019 00020 }
EcalZeroSuppressionProducer::~EcalZeroSuppressionProducer | ( | ) | [virtual] |
void EcalZeroSuppressionProducer::initCalibrations | ( | const edm::EventSetup & | eventSetup | ) |
Definition at line 119 of file EcalZeroSuppressionProducer.cc.
References edm::EventSetup::get(), edm::ESHandle< T >::product(), EcalZeroSuppressor< C >::setPedestals(), theBarrelZeroSuppressor_, and theEndcapZeroSuppressor_.
Referenced by produce().
00119 { 00120 00121 // Pedestals from event setup 00122 00123 edm::ESHandle<EcalPedestals> dbPed; 00124 eventSetup.get<EcalPedestalsRcd>().get( dbPed ); 00125 const EcalPedestals * thePedestals=dbPed.product(); 00126 00127 theBarrelZeroSuppressor_.setPedestals( thePedestals ); 00128 theEndcapZeroSuppressor_.setPedestals( thePedestals ); 00129 00130 }
void EcalZeroSuppressionProducer::produce | ( | edm::Event & | event, | |
const edm::EventSetup & | eventSetup | |||
) | [virtual] |
Produces the EDM products,.
Implements edm::EDProducer.
Definition at line 27 of file EcalZeroSuppressionProducer.cc.
References EcalZeroSuppressor< C >::accept(), digiProducer_, EBdigiCollection_, EBZSdigiCollection_, EEdigiCollection_, EEZSdigiCollection_, glbBarrelThreshold_, glbEndcapThreshold_, initCalibrations(), edm::Handle< T >::isValid(), edm::Handle< T >::product(), edm::DataFrameContainer::size(), theBarrelZeroSuppressor_, and theEndcapZeroSuppressor_.
00028 { 00029 00030 // Get Inputs 00031 00032 initCalibrations(eventSetup); 00033 00034 edm::Handle< EBDigiCollection > pEBDigis; 00035 edm::Handle< EEDigiCollection > pEEDigis; 00036 00037 const EBDigiCollection* fullBarrelDigis =0; 00038 const EEDigiCollection* fullEndcapDigis =0; 00039 00040 event.getByLabel( digiProducer_, pEBDigis); 00041 if (pEBDigis.isValid()){ 00042 fullBarrelDigis = pEBDigis.product(); // get a ptr to the produc 00043 edm::LogInfo("ZeroSuppressionInfo") << "total # fullBarrelDigis: " << fullBarrelDigis->size() ; 00044 } else { 00045 edm::LogError("ZeroSuppressionError") << "Error! can't get the product " << EBdigiCollection_.c_str() ; 00046 } 00047 00048 event.getByLabel( digiProducer_, pEEDigis); 00049 if (pEEDigis.isValid()){ 00050 fullEndcapDigis = pEEDigis.product(); // get a ptr to the product 00051 edm::LogInfo("ZeroSuppressionInfo") << "total # fullEndcapDigis: " << fullEndcapDigis->size() ; 00052 } else { 00053 edm::LogError("ZeroSuppressionError") << "Error! can't get the product " << EEdigiCollection_.c_str() ; 00054 } 00055 00056 // collection of zero suppressed digis to put in the event 00057 00058 std::auto_ptr< EBDigiCollection > gzsBarrelDigis(new EBDigiCollection()); 00059 std::auto_ptr< EEDigiCollection > gzsEndcapDigis(new EEDigiCollection()); 00060 00061 CaloDigiCollectionSorter sorter(5); 00062 00063 // Barrel zero suppression 00064 00065 if (fullBarrelDigis) { 00066 00067 for(EBDigiCollection::const_iterator digiItr = (*fullBarrelDigis).begin(); 00068 digiItr != (*fullBarrelDigis).end(); ++digiItr) 00069 { 00070 00071 bool isAccepted = theBarrelZeroSuppressor_.accept(*digiItr, glbBarrelThreshold_); 00072 if (isAccepted) { 00073 (*gzsBarrelDigis).push_back(digiItr->id(), digiItr->begin()); 00074 } 00075 00076 } 00077 edm::LogInfo("ZeroSuppressionInfo") << "EB Digis: " << gzsBarrelDigis->size(); 00078 00079 00080 //std::vector<EBDataFrame> sortedDigisEB = sorter.sortedVector(*gzsBarrelDigis); 00081 //LogDebug("ZeroSuppressionDump") << "Top 10 EB digis"; 00082 //for(int i = 0; i < std::min(10,(int) sortedDigisEB.size()); ++i) 00083 // { 00084 // LogDebug("ZeroSuppressionDump") << sortedDigisEB[i]; 00085 // } 00086 } 00087 00088 // Endcap zero suppression 00089 00090 if (fullEndcapDigis) { 00091 00092 for(EEDigiCollection::const_iterator digiItr = (*fullEndcapDigis).begin(); 00093 digiItr != (*fullEndcapDigis).end(); ++digiItr) 00094 { 00095 00096 bool isAccepted = theEndcapZeroSuppressor_.accept(*digiItr, glbEndcapThreshold_); 00097 if (isAccepted) { 00098 (*gzsEndcapDigis).push_back(digiItr->id(), digiItr->begin()); 00099 } 00100 00101 } 00102 edm::LogInfo("ZeroSuppressionInfo") << "EB Digis: " << gzsBarrelDigis->size(); 00103 00104 // std::vector<EEDataFrame> sortedDigisEE = sorter.sortedVector(*gzsEndcapDigis); 00105 //LogDebug("ZeroSuppressionDump") << "Top 10 EE digis"; 00106 //for(int i = 0; i < std::min(10,(int) sortedDigisEE.size()); ++i) 00107 // { 00108 // LogDebug("ZeroSuppressionDump") << sortedDigisEE[i]; 00109 // } 00110 00111 } 00112 // Step D: Put outputs into event 00113 event.put(gzsBarrelDigis, EBZSdigiCollection_); 00114 event.put(gzsEndcapDigis, EEZSdigiCollection_); 00115 00116 }
std::string EcalZeroSuppressionProducer::digiProducer_ [private] |
Definition at line 44 of file EcalZeroSuppressionProducer.h.
Referenced by EcalZeroSuppressionProducer(), and produce().
std::string EcalZeroSuppressionProducer::EBdigiCollection_ [private] |
Definition at line 45 of file EcalZeroSuppressionProducer.h.
Referenced by EcalZeroSuppressionProducer(), and produce().
std::string EcalZeroSuppressionProducer::EBZSdigiCollection_ [private] |
Definition at line 47 of file EcalZeroSuppressionProducer.h.
Referenced by EcalZeroSuppressionProducer(), and produce().
std::string EcalZeroSuppressionProducer::EEdigiCollection_ [private] |
Definition at line 46 of file EcalZeroSuppressionProducer.h.
Referenced by EcalZeroSuppressionProducer(), and produce().
std::string EcalZeroSuppressionProducer::EEZSdigiCollection_ [private] |
Definition at line 48 of file EcalZeroSuppressionProducer.h.
Referenced by EcalZeroSuppressionProducer(), and produce().
double EcalZeroSuppressionProducer::glbBarrelThreshold_ [private] |
Definition at line 41 of file EcalZeroSuppressionProducer.h.
Referenced by EcalZeroSuppressionProducer(), and produce().
double EcalZeroSuppressionProducer::glbEndcapThreshold_ [private] |
Definition at line 42 of file EcalZeroSuppressionProducer.h.
Referenced by EcalZeroSuppressionProducer(), and produce().
Definition at line 50 of file EcalZeroSuppressionProducer.h.
Referenced by initCalibrations(), and produce().
Definition at line 51 of file EcalZeroSuppressionProducer.h.
Referenced by initCalibrations(), and produce().