CMS 3D CMS Logo

DTNoiseComputation.h
Go to the documentation of this file.
1 #ifndef DTNoiseComputation_H
2 #define DTNoiseComputation_H
3 
4 /*
5  * \file DTNoiseComputation.h
6  *
7  * \author G. Mila - INFN Torino
8  *
9 */
10 
18 
19 #include <string>
20 #include <map>
21 #include <vector>
22 
23 namespace edm {
24  class ParameterSet;
25  class Event;
26  class EventSetup;
27 } // namespace edm
28 
29 class DTGeometry;
30 class TFile;
31 class TH2F;
32 class TH1F;
33 
34 class DTNoiseComputation : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
35 public:
38 
40  ~DTNoiseComputation() override;
41 
43  void beginJob() override {}
44 
45  void beginRun(const edm::Run&, const edm::EventSetup& setup) override;
46 
47  void analyze(const edm::Event& event, const edm::EventSetup& setup) override {}
48 
49  void endRun(const edm::Run&, const edm::EventSetup& setup) override {}
50 
52  void endJob() override;
53 
54 protected:
55 private:
56  bool debug;
57  int counter;
58  int MaxEvents;
60 
61  // Get the DT Geometry
64 
65  // The file which contain the occupancy plot and the digi event plot
66  TFile* theFile;
67 
68  // The file which will contain the occupancy plot and the digi event plot
69  TFile* theNewFile;
70 
71  // Map of label to compute the average noise per layer
72  std::map<DTLayerId, bool> toComputeNoiseAverage;
73 
74  // Map of the average noise per layer
75  std::map<DTWireId, double> theAverageNoise;
76 
77  // Map of the histograms with the number of events per evt per wire
78  std::map<DTLayerId, std::vector<TH2F*> > theEvtMap;
79 
80  // map of histos with the distance of event per wire
81  std::map<DTWireId, TH1F*> theHistoEvtDistancePerWire;
82 
83  // Map of label for analysis histos
84  std::map<DTWireId, bool> toDel;
85 
86  // Map of the Time Constants per wire
87  std::map<DTWireId, double> theTimeConstant;
88 
90  std::string getLayerName(const DTLayerId& lId) const;
91 
93  std::string getSuperLayerName(const DTSuperLayerId& slId) const;
94 
96  std::string getChamberName(const DTLayerId& lId) const;
97 
98  // map of histos with the average noise per chamber
99  std::map<DTChamberId, TH1F*> AvNoisePerChamber;
100 
101  // map of histos with the average integrated noise per chamber
102  std::map<DTChamberId, TH1F*> AvNoiseIntegratedPerChamber;
103 
104  // map of histos with the average noise per SuperLayer
105  std::map<DTSuperLayerId, TH1F*> AvNoisePerSuperLayer;
106 
107  // map of histos with the average integrated noise per SuperLayer
108  std::map<DTSuperLayerId, TH1F*> AvNoiseIntegratedPerSuperLayer;
109 
110  // get the maximum bin number
111  int getMaxNumBins(const DTChamberId& chId) const;
112 
113  // get the Y axis maximum
114  double getYMaximum(const DTSuperLayerId& slId) const;
115 
116  // map of noisy cell occupancy
117  std::map<std::pair<int, int>, TH1F*> noisyC;
118 
119  // map of somehow noisy cell occupancy
120  std::map<std::pair<int, int>, TH1F*> someHowNoisyC;
121 };
122 #endif
DTNoiseComputation(const edm::ParameterSet &ps)
Constructor.
void endRun(const edm::Run &, const edm::EventSetup &setup) override
edm::ESHandle< DTGeometry > dtGeom
std::map< DTLayerId, std::vector< TH2F * > > theEvtMap
int getMaxNumBins(const DTChamberId &chId) const
std::map< DTWireId, TH1F * > theHistoEvtDistancePerWire
std::map< DTWireId, bool > toDel
void endJob() override
Endjob.
std::string getLayerName(const DTLayerId &lId) const
Get the name of the layer.
std::map< std::pair< int, int >, TH1F * > noisyC
void analyze(const edm::Event &event, const edm::EventSetup &setup) override
std::map< DTWireId, double > theAverageNoise
~DTNoiseComputation() override
Destructor.
std::map< DTChamberId, TH1F * > AvNoisePerChamber
std::map< DTSuperLayerId, TH1F * > AvNoiseIntegratedPerSuperLayer
std::map< std::pair< int, int >, TH1F * > someHowNoisyC
void beginJob() override
BeginJob.
HLT enums.
std::map< DTSuperLayerId, TH1F * > AvNoisePerSuperLayer
std::map< DTLayerId, bool > toComputeNoiseAverage
std::map< DTWireId, double > theTimeConstant
std::string getChamberName(const DTLayerId &lId) const
Get the name of the chamber.
void beginRun(const edm::Run &, const edm::EventSetup &setup) override
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken_
Definition: event.py:1
Definition: Run.h:45
std::string getSuperLayerName(const DTSuperLayerId &slId) const
Get the name of the superLayer.
std::map< DTChamberId, TH1F * > AvNoiseIntegratedPerChamber
double getYMaximum(const DTSuperLayerId &slId) const