File indexing completed on 2024-04-06 12:26:05
0001 #ifndef RecoLocalMuon_CSCValHists_H
0002 #define RecoLocalMuon_CSCValHists_H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #include <memory>
0018 #include <iostream>
0019 #include <vector>
0020 #include <map>
0021 #include <string>
0022 #include <sstream>
0023 #include <iomanip>
0024 #include <fstream>
0025 #include <cmath>
0026
0027 #include "TH1F.h"
0028 #include "TH2F.h"
0029 #include "TH3F.h"
0030 #include "TProfile.h"
0031 #include "TProfile2D.h"
0032 #include "TFile.h"
0033 #include "TTree.h"
0034 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
0035
0036 class CSCValHists {
0037 public:
0038
0039 CSCValHists();
0040
0041
0042 ~CSCValHists();
0043
0044
0045 void writeHists(TFile* theFile);
0046
0047
0048 void writeTrees(TFile* theFile);
0049
0050
0051 void setupTrees();
0052
0053
0054 void fillRechitTree(float x, float y, float gx, float gy, int en, int st, int ri, int ch, int la);
0055
0056
0057 void fillSegmentTree(float x, float y, float gx, float gy, int en, int st, int ri, int ch);
0058
0059
0060 void insertPlot(TH1* thePlot, std::string name, std::string folder);
0061
0062
0063 void fillCalibHist(
0064 float x, std::string name, std::string title, int bins, float xmin, float xmax, int bin, std::string folder);
0065
0066
0067 void fill1DHist(float x, std::string name, std::string title, int bins, float xmin, float xmax, std::string folder);
0068
0069
0070 void fill2DHist(float x,
0071 float y,
0072 std::string name,
0073 std::string title,
0074 int binsx,
0075 float xmin,
0076 float xmax,
0077 int binsy,
0078 float ymin,
0079 float ymax,
0080 std::string folder);
0081
0082
0083
0084 void fill1DHistByType(
0085 float x, std::string name, std::string title, CSCDetId id, int bins, float xmin, float xmax, std::string folder);
0086
0087
0088
0089 void fill2DHistByType(float x,
0090 float y,
0091 std::string name,
0092 std::string title,
0093 CSCDetId id,
0094 int binsx,
0095 float xmin,
0096 float xmax,
0097 int binsy,
0098 float ymin,
0099 float ymax,
0100 std::string folder);
0101
0102
0103
0104 void fill1DHistByCrate(
0105 float x, std::string name, std::string title, CSCDetId id, int bins, float xmin, float xmax, std::string folder);
0106
0107
0108
0109 void fill2DHistByCrate(float x,
0110 float y,
0111 std::string name,
0112 std::string title,
0113 CSCDetId id,
0114 int binsx,
0115 float xmin,
0116 float xmax,
0117 int binsy,
0118 float ymin,
0119 float ymax,
0120 std::string folder);
0121
0122
0123
0124 void fill1DHistByStation(
0125 float x, std::string name, std::string title, CSCDetId id, int bins, float xmin, float xmax, std::string folder);
0126
0127
0128
0129 void fill2DHistByStation(float x,
0130 float y,
0131 std::string name,
0132 std::string title,
0133 CSCDetId id,
0134 int binsx,
0135 float xmin,
0136 float xmax,
0137 int binsy,
0138 float ymin,
0139 float ymax,
0140 std::string folder);
0141
0142
0143
0144 void fill1DHistByChamber(
0145 float x, std::string name, std::string title, CSCDetId id, int bins, float xmin, float xmax, std::string folder);
0146
0147
0148
0149 void fill2DHistByChamber(float x,
0150 float y,
0151 std::string name,
0152 std::string title,
0153 CSCDetId id,
0154 int binsx,
0155 float xmin,
0156 float xmax,
0157 int binsy,
0158 float ymin,
0159 float ymax,
0160 std::string folder);
0161
0162
0163
0164 void fill2DHistByEvent(
0165 int run, int event, float x, std::string name, std::string title, CSCDetId id, std::string folder);
0166
0167
0168
0169 void fill2DHist(float z, std::string name, std::string title, CSCDetId id, std::string folder);
0170
0171
0172
0173 void fill1DHistByLayer(
0174 float x, std::string name, std::string title, CSCDetId id, int bins, float xmin, float xmax, std::string folder);
0175
0176
0177
0178 void fill2DHistByLayer(float x,
0179 float y,
0180 std::string name,
0181 std::string title,
0182 CSCDetId id,
0183 int binsx,
0184 float xmin,
0185 float xmax,
0186 int binsy,
0187 float ymin,
0188 float ymax,
0189 std::string folder);
0190
0191
0192 void fillProfile(float x,
0193 float y,
0194 std::string name,
0195 std::string title,
0196 int binsx,
0197 float xmin,
0198 float xmax,
0199 float ymin,
0200 float ymax,
0201 std::string folder);
0202
0203
0204
0205 void fillProfileByType(float x,
0206 float y,
0207 std::string name,
0208 std::string title,
0209 CSCDetId id,
0210 int binsx,
0211 float xmin,
0212 float xmax,
0213 float ymin,
0214 float ymax,
0215 std::string folder);
0216
0217
0218
0219 void fillProfileByChamber(float x,
0220 float y,
0221 std::string name,
0222 std::string title,
0223 CSCDetId id,
0224 int binsx,
0225 float xmin,
0226 float xmax,
0227 float ymin,
0228 float ymax,
0229 std::string folder);
0230
0231
0232 void fill2DProfile(float x,
0233 float y,
0234 float z,
0235 std::string name,
0236 std::string title,
0237 int binsx,
0238 float xmin,
0239 float xmax,
0240 int binsy,
0241 float ymin,
0242 float ymax,
0243 float zmin,
0244 float zmax,
0245 std::string folder);
0246
0247
0248 int crate_lookup(CSCDetId id);
0249
0250 protected:
0251 private:
0252
0253 std::map<std::string, std::pair<TH1*, std::string> > theMap;
0254
0255
0256 struct posRecord {
0257 int endcap;
0258 int station;
0259 int ring;
0260 int chamber;
0261 int layer;
0262 float localx;
0263 float localy;
0264 float globalx;
0265 float globaly;
0266 } rHpos, segpos;
0267
0268
0269 TTree* rHTree;
0270 TTree* segTree;
0271 };
0272
0273 #endif