00001 #ifndef RecoLocalMuon_CSCValHists_H
00002 #define RecoLocalMuon_CSCValHists_H
00003
00004
00014
00015 #include <memory>
00016 #include <iostream>
00017 #include <vector>
00018 #include <map>
00019 #include <string>
00020 #include <sstream>
00021 #include <iomanip>
00022 #include <fstream>
00023 #include <cmath>
00024
00025 #include "TH1F.h"
00026 #include "TH2F.h"
00027 #include "TH3F.h"
00028 #include "TProfile.h"
00029 #include "TProfile2D.h"
00030 #include "TFile.h"
00031 #include "TTree.h"
00032 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
00033
00034 using namespace std;
00035
00036 class CSCValHists{
00037
00038 public:
00039
00040
00041 CSCValHists();
00042
00043
00044 ~CSCValHists();
00045
00046
00047 void writeHists(TFile* theFile);
00048
00049
00050 void writeTrees(TFile* theFile);
00051
00052
00053 void setupTrees();
00054
00055
00056 void fillRechitTree(float x, float y, float gx, float gy,
00057 int en, int st, int ri, int ch, int la);
00058
00059
00060 void fillSegmentTree(float x, float y, float gx, float gy,
00061 int en, int st, int ri, int ch);
00062
00063
00064 void insertPlot(TH1* thePlot, string name, string folder);
00065
00066
00067 void fillCalibHist(float x, string name, string title, int bins, float xmin, float xmax,
00068 int bin, string folder);
00069
00070
00071 void fill1DHist(float x, string name, string title,
00072 int bins, float xmin, float xmax, string folder);
00073
00074
00075 void fill2DHist(float x, float y, string name, string title,
00076 int binsx, float xmin, float xmax,
00077 int binsy, float ymin, float ymax, string folder);
00078
00079
00080
00081 void fill1DHistByType(float x, string name, string title, CSCDetId id,
00082 int bins, float xmin, float xmax, string folder);
00083
00084
00085
00086 void fill2DHistByType(float x, float y, string name, string title, CSCDetId id,
00087 int binsx, float xmin, float xmax,
00088 int binsy, float ymin, float ymax, string folder);
00089
00090
00091
00092 void fill2DHistByStation(float x, float y, string name, string title, CSCDetId id,
00093 int binsx, float xmin, float xmax,
00094 int binsy, float ymin, float ymax, string folder);
00095
00096
00097
00098 void fill1DHistByChamber(float x, string name, string title, CSCDetId id,
00099 int bins, float xmin, float xmax, string folder);
00100
00101
00102
00103 void fill2DHistByChamber(float x, float y, string name, string title, CSCDetId id,
00104 int binsx, float xmin, float xmax,
00105 int binsy, float ymin, float ymax, string folder);
00106
00107
00108
00109 void fill1DHistByLayer(float x, string name, string title, CSCDetId id,
00110 int bins, float xmin, float xmax, string folder);
00111
00112
00113
00114 void fill2DHistByLayer(float x, float y, string name, string title, CSCDetId id,
00115 int binsx, float xmin, float xmax,
00116 int binsy, float ymin, float ymax, string folder);
00117
00118
00119
00120 void fillProfile(float x, float y, string name, string title,
00121 int binsx, float xmin, float xmax,
00122 float ymin, float ymax, string folder);
00123
00124
00125
00126 void fillProfileByType(float x, float y, string name, string title, CSCDetId id,
00127 int binsx, float xmin, float xmax,
00128 float ymin, float ymax, string folder);
00129
00130
00131
00132 void fillProfileByChamber(float x, float y, string name, string title, CSCDetId id,
00133 int binsx, float xmin, float xmax,
00134 float ymin, float ymax, string folder);
00135
00136
00137 void fill2DProfile(float x, float y, float z, string name, string title,
00138 int binsx, float xmin, float xmax,
00139 int binsy, float ymin, float ymax,
00140 float zmin, float zmax, string folder);
00141
00142 protected:
00143
00144 private:
00145
00146
00147 map<string,pair<TH1*,string> > theMap;
00148
00149
00150 struct posRecord {
00151 int endcap;
00152 int station;
00153 int ring;
00154 int chamber;
00155 int layer;
00156 float localx;
00157 float localy;
00158 float globalx;
00159 float globaly;
00160 } rHpos, segpos;
00161
00162
00163 TTree *rHTree;
00164 TTree *segTree;
00165
00166 };
00167
00168 #endif