00001 #ifndef ECALZEROSUPPRESSIONPRODUCER_H 00002 #define ECALZEROSUPPRESSIONPRODUCER_H 00003 00004 #include "FWCore/Framework/interface/EDProducer.h" 00005 //#include "FWCore/Framework/interface/Event.h" 00006 //#include "DataFormats/Common/interface/Handle.h" 00007 //#include "FWCore/ParameterSet/interface/ParameterSet.h" 00008 //#include "FWCore/Framework/interface/EventSetup.h" 00009 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h" 00010 #include "SimCalorimetry/EcalSelectiveReadoutAlgos/interface/EcalSelectiveReadoutSuppressor.h" 00011 #include "DataFormats/Provenance/interface/ProductID.h" 00012 #include <memory> 00013 #include <vector> 00014 00015 class EcalSelectiveReadoutProducer : public edm::EDProducer 00016 { 00017 public: 00018 00022 explicit 00023 EcalSelectiveReadoutProducer(const edm::ParameterSet& params); 00024 00027 virtual 00028 ~EcalSelectiveReadoutProducer(); 00029 00034 virtual void 00035 produce(edm::Event& event, const edm::EventSetup& eventSetup); 00036 00043 static void 00044 printSrFlags(std::ostream& os, 00045 const EBSrFlagCollection& ebSrFlags, 00046 const EESrFlagCollection& eeSrFlags, 00047 int iEvent = -1, 00048 bool withHeader = true); 00049 00050 private: 00051 00057 void 00058 checkWeights(const edm::Event& evt, const edm::ProductID& noZSDigiId) const; 00059 00065 bool 00066 getBinOfMax(const edm::Event& evt, const edm::ProductID& noZsDigiId, 00067 int& binOfMax) const; 00068 00069 const EBDigiCollection* 00070 getEBDigis(edm::Event& event) const; 00071 00072 const EEDigiCollection* 00073 getEEDigis(edm::Event& event) const; 00074 00075 const EcalTrigPrimDigiCollection* 00076 getTrigPrims(edm::Event& event) const; 00077 00080 void 00081 checkGeometry(const edm::EventSetup & eventSetup); 00082 void 00083 checkTriggerMap(const edm::EventSetup & eventSetup); 00084 00085 void 00086 printTTFlags(const EcalTrigPrimDigiCollection& tp, std::ostream& os) const; 00087 00088 private: 00089 std::auto_ptr<EcalSelectiveReadoutSuppressor> suppressor_; 00090 std::string digiProducer_; // name of module/plugin/producer making digis 00091 std::string ebdigiCollection_; // secondary name given to collection of input digis 00092 std::string eedigiCollection_; // secondary name given to collection of input digis 00093 std::string ebSRPdigiCollection_; // secondary name given to collection of suppressed digis 00094 std::string eeSRPdigiCollection_; // secondary name given to collection of suppressed digis 00095 std::string ebSrFlagCollection_; // secondary name given to collection of SR flag digis 00096 std::string eeSrFlagCollection_; // secondary name given to collection of SR flag digis 00097 std::string trigPrimProducer_; // name of module/plugin/producer making triggere primitives 00098 std::string trigPrimCollection_; // name of module/plugin/producer making triggere primitives 00099 00100 // store the pointer, so we don't have to update it every event 00101 const CaloGeometry * theGeometry; 00102 const EcalTrigTowerConstituentsMap * theTriggerTowerMap; 00103 edm::ParameterSet params_; 00104 00105 bool trigPrimBypass_; 00106 00109 int dumpFlags_; 00110 00111 // switch to write out the SrFlags collections in the event 00112 bool writeSrFlags_; 00113 00114 }; 00115 00116 #endif