CMS 3D CMS Logo

EcalDisplaysByEvent.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: EcalDisplaysByEvent
4 // Class: EcalDisplaysByEvent
5 //
13 //
14 // Original Author: Seth COOPER
15 // Created: Th Aug 28 5:46:22 CEST 2007
16 //
17 //
18 
19 // system include files
20 #include <memory>
21 #include <vector>
22 #include <map>
23 #include <set>
24 #include <string>
25 
26 // user include files
36 
43 
47 
49 
50 #include "TFile.h"
51 #include "TH1F.h"
52 #include "TH2F.h"
53 #include "TH3F.h"
54 #include "TGraph.h"
55 #include "TTree.h"
56 #include "TCanvas.h"
57 
58 //
59 // class declaration
60 //
61 
62 class EcalDisplaysByEvent : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
63 public:
64  explicit EcalDisplaysByEvent(const edm::ParameterSet&);
65  ~EcalDisplaysByEvent() override;
66 
67 private:
68  void beginRun(edm::Run const&, edm::EventSetup const&) override;
69  void endRun(edm::Run const&, edm::EventSetup const&) override;
70  void analyze(edm::Event const&, edm::EventSetup const&) override;
71  void endJob() override;
74  void initHists(int);
75  void initEvtByEvtHists(int naiveEvtNum_, int ievt);
76  void deleteEvtByEvtHists();
77  void initAllEventHistos();
79  TH2F* init2DEcalHist(std::string histTypeName, int subDet);
80  TH3F* init3DEcalHist(std::string histTypeName, int dubDet);
81  TCanvas* init2DEcalCanvas(std::string canvasName);
83  TGraph* selectDigi(DetId det, int ievt);
84  int getEEIndex(EcalElectronicsId elecId);
88  void drawHistos();
89  void drawCanvas(TCanvas* canvas, TH1F* hist1, TH1F* hist2, TH1F* hist3);
90  void drawCanvas(TCanvas* canvas, TH2F* hist1, TH2F* hist2, TH2F* hist3);
91  void drawCanvas(TCanvas* canvas, TH3F* hist1, TH3F* hist2, TH3F* hist3);
92  void drawTimingErrors(TProfile2D* profile);
93  void drawEELines();
94 
95  // ----------member data ---------------------------
96 
102 
105 
111 
114 
115  int runNum_;
116  const int side_;
117  const double threshold_;
118  const double minTimingAmp_;
119  const bool makeDigiGraphs_;
120  const bool makeTimingHistos_;
121  const bool makeEnergyHistos_;
123  const double histRangeMin_;
124  const double histRangeMax_;
125  const double minTimingEnergyEB_;
126  const double minTimingEnergyEE_;
127 
128  std::set<EBDetId> listEBChannels;
129  std::set<EEDetId> listEEChannels;
130 
131  int abscissa[10];
132  int ordinate[10];
133 
134  static float gainRatio[3];
136 
137  std::vector<std::string>* names;
138  std::vector<std::string>* histoCanvasNamesVector;
139  std::vector<int> maskedChannels_;
140  std::vector<int> maskedFEDs_;
141  std::vector<int> seedCrys_;
142  std::vector<std::string> maskedEBs_;
143  std::map<int, TH1F*> FEDsAndTimingHists_;
144  std::map<int, float> crysAndAmplitudesMap_;
145  std::map<int, EcalDCCHeaderBlock> FEDsAndDCCHeaders_;
146  std::map<std::string, int> seedFrequencyMap_;
147 
149  // For event-by-evet histos
150  TH1F* timingEB_;
151  TH1F* timingEEM_;
152  TH1F* timingEEP_;
153  TH1F* energyEB_;
154  TH1F* energyEEM_;
155  TH1F* energyEEP_;
180  TCanvas* timingCanvas_;
181  TCanvas* energyCanvas_;
190 
191  // For all-event hitos
232 
233  TTree* canvasNames_;
238 
240 };
std::vector< std::string > maskedEBs_
std::set< EBDetId > listEBChannels
edm::Handle< EEDigiCollection > EEdigisHandle
const edm::InputTag headerProducer_
void endRun(edm::Run const &, edm::EventSetup const &) override
const edm::EDGetTokenT< EcalRawDataCollection > rawDataToken_
TH2F * init2DEcalHist(std::string histTypeName, int subDet)
std::vector< int > maskedChannels_
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
std::vector< std::string > * names
const EcalElectronicsMapping * ecalElectronicsMap_
int getEEIndex(EcalElectronicsId elecId)
const double minTimingEnergyEB_
void analyze(edm::Event const &, edm::EventSetup const &) override
std::map< int, EcalDCCHeaderBlock > FEDsAndDCCHeaders_
void drawTimingErrors(TProfile2D *profile)
TCanvas * digiOccupancyCoarseCanvasAll_
const edm::InputTag EBRecHitCollection_
std::set< EEDetId > listEEChannels
const edm::InputTag EEDigis_
void drawCanvas(TCanvas *canvas, TH1F *hist1, TH1F *hist2, TH1F *hist3)
std::vector< std::string > * histoCanvasNamesVector
const edm::InputTag EERecHitCollection_
const edm::EDGetTokenT< EcalRecHitCollection > ebRecHitToken_
std::vector< int > maskedFEDs_
const edm::EDGetTokenT< EEDigiCollection > eeDigiToken_
void selectHits(edm::Handle< EcalRecHitCollection > hits, int ievt)
TCanvas * recHitOccupancyCoarseCanvasAll_
const edm::InputTag EBDigis_
const edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcd > ecalMappingToken_
std::map< int, TH1F * > FEDsAndTimingHists_
const edm::EDGetTokenT< EcalRecHitCollection > eeRecHitToken_
static edm::Service< TFileService > fileService
const CaloTopology * caloTopo_
std::string intToString(int num)
Definition: DetId.h:17
static float gainRatio[3]
void makeHistos(edm::Handle< EBDigiCollection > ebDigis)
edm::Handle< EBDigiCollection > EBdigisHandle
const double minTimingEnergyEE_
std::map< std::string, int > seedFrequencyMap_
const edm::ESGetToken< CaloTopology, CaloTopologyRecord > topologyToken_
void initEvtByEvtHists(int naiveEvtNum_, int ievt)
TCanvas * digiOccupancyCoarseCanvas_
std::vector< int > seedCrys_
std::string floatToString(float num)
def canvas(sub, attr)
Definition: svgfig.py:482
TGraph * selectDigi(DetId det, int ievt)
TH3F * init3DEcalHist(std::string histTypeName, int dubDet)
TCanvas * init2DEcalCanvas(std::string canvasName)
void beginRun(edm::Run const &, edm::EventSetup const &) override
TCanvas * recHitOccupancyCoarseCanvas_
EcalDisplaysByEvent(const edm::ParameterSet &)
const edm::EDGetTokenT< EBDigiCollection > ebDigiToken_
Definition: Run.h:45
std::map< int, float > crysAndAmplitudesMap_