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 "CondFormats/EcalObjects/interface/EcalSRSettings.h" 00013 00014 #include <memory> 00015 #include <vector> 00016 00017 class EcalSelectiveReadoutProducer : public edm::EDProducer 00018 { 00019 public: 00020 00024 explicit 00025 EcalSelectiveReadoutProducer(const edm::ParameterSet& params); 00026 00029 virtual 00030 ~EcalSelectiveReadoutProducer(); 00031 00036 virtual void 00037 produce(edm::Event& event, const edm::EventSetup& eventSetup); 00038 00045 static void 00046 printSrFlags(std::ostream& os, 00047 const EBSrFlagCollection& ebSrFlags, 00048 const EESrFlagCollection& eeSrFlags, 00049 int iEvent = -1, 00050 bool withHeader = true); 00051 00052 00053 private: 00054 00060 void 00061 checkWeights(const edm::Event& evt, const edm::ProductID& noZSDigiId) const; 00062 00068 bool 00069 getBinOfMax(const edm::Event& evt, const edm::ProductID& noZsDigiId, 00070 int& binOfMax) const; 00071 00072 const EBDigiCollection* 00073 getEBDigis(edm::Event& event) const; 00074 00075 const EEDigiCollection* 00076 getEEDigis(edm::Event& event) const; 00077 00078 const EcalTrigPrimDigiCollection* 00079 getTrigPrims(edm::Event& event) const; 00080 00084 void 00085 checkGeometry(const edm::EventSetup & eventSetup); 00086 void 00087 checkTriggerMap(const edm::EventSetup & eventSetup); 00088 void 00089 checkElecMap(const edm::EventSetup & eventSetup); 00090 00092 00098 static void checkValidity(const EcalSRSettings& settings); 00099 00100 void 00101 printTTFlags(const EcalTrigPrimDigiCollection& tp, std::ostream& os) const; 00102 00103 private: 00104 std::auto_ptr<EcalSelectiveReadoutSuppressor> suppressor_; 00105 std::string digiProducer_; // name of module/plugin/producer making digis 00106 std::string ebdigiCollection_; // secondary name given to collection of input digis 00107 std::string eedigiCollection_; // secondary name given to collection of input digis 00108 std::string ebSRPdigiCollection_; // secondary name given to collection of suppressed digis 00109 std::string eeSRPdigiCollection_; // secondary name given to collection of suppressed digis 00110 std::string ebSrFlagCollection_; // secondary name given to collection of SR flag digis 00111 std::string eeSrFlagCollection_; // secondary name given to collection of SR flag digis 00112 std::string trigPrimProducer_; // name of module/plugin/producer making triggere primitives 00113 std::string trigPrimCollection_; // name of module/plugin/producer making triggere primitives 00114 00115 // store the pointer, so we don't have to update it every event 00116 const CaloGeometry * theGeometry; 00117 const EcalTrigTowerConstituentsMap * theTriggerTowerMap; 00118 const EcalElectronicsMapping * theElecMap; 00119 edm::ParameterSet params_; 00120 00121 bool trigPrimBypass_; 00122 00123 int trigPrimBypassMode_; 00124 00127 int dumpFlags_; 00128 00131 bool writeSrFlags_; 00132 00136 bool produceDigis_; 00137 00140 const EcalSRSettings* settings_; 00141 00145 bool useCondDb_; 00146 00150 std::auto_ptr<EcalSRSettings> settingsFromFile_; 00151 }; 00152 00153 #endif