00001 00011 #include "FWCore/Framework/interface/EDAnalyzer.h" 00012 #include "FWCore/Framework/interface/Event.h" 00013 #include "FWCore/Framework/interface/EventSetup.h" 00014 #include "FWCore/Framework/interface/MakerMacros.h" 00015 #include "FWCore/Framework/interface/ESHandle.h" 00016 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h" 00017 #include "DataFormats/EcalDetId/interface/EcalDetIdCollections.h" 00018 #include "DataFormats/EcalDigi/interface/EcalTriggerPrimitiveDigi.h" 00019 #include "DataFormats/EcalDigi/interface/EcalTriggerPrimitiveSample.h" 00020 #include "DataFormats/EcalRawData/interface/EcalRawDataCollections.h" 00021 #include "Geometry/EcalMapping/interface/EcalElectronicsMapping.h" 00022 #include "Geometry/EcalMapping/interface/EcalMappingRcd.h" 00023 #include "CaloOnlineTools/EcalTools/interface/EcalFedMap.h" 00024 00025 #include <iostream> 00026 #include <vector> 00027 #include <set> 00028 #include "TFile.h" 00029 #include "TH1.h" 00030 #include "TDirectory.h" 00031 00032 typedef std::map<std::string,TH1F*> stringHistMap; 00033 00034 class EcalPedHists: public edm::EDAnalyzer 00035 { 00036 public: 00037 EcalPedHists(const edm::ParameterSet& ps); 00038 ~EcalPedHists(); 00039 00040 protected: 00041 void analyze(const edm::Event & e, const edm::EventSetup& c); 00042 void beginRun(edm::Run const &, edm::EventSetup const & c); 00043 void endJob(void); 00044 00045 private: 00046 std::string intToString(int num); 00047 void readEBdigis(edm::Handle<EBDigiCollection> digis); 00048 void readEEdigis(edm::Handle<EEDigiCollection> digis); 00049 void initHists(int FED); 00050 00051 int runNum_; 00052 bool inputIsOk_; 00053 bool allFEDsSelected_; 00054 bool histsFilled_; 00055 std::string fileName_; 00056 edm::InputTag barrelDigiCollection_; 00057 edm::InputTag endcapDigiCollection_; 00058 edm::InputTag headerProducer_; 00059 std::vector<int> listChannels_; 00060 std::vector<int> listSamples_; 00061 std::vector<int> listFEDs_; 00062 std::vector<std::string> listEBs_; 00063 std::map<int,stringHistMap> FEDsAndHistMaps_; 00064 std::set<int> theRealFedSet_; 00065 EcalFedMap* fedMap_; 00066 TFile * root_file_; 00067 const EcalElectronicsMapping* ecalElectronicsMap_; 00068 };