ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/wangdy/TimingCSC/interface/CSCTimingAnalyzer.h
Revision: 1.6
Committed: Wed Nov 7 17:44:58 2007 UTC (17 years, 5 months ago) by wangdy
Content type: text/plain
Branch: MAIN
Changes since 1.5: +2 -1 lines
Log Message:
custom the analysis to cover all the possible sectors, which can be chosen at runtime

File Contents

# Content
1 /**
2 * @file CSCTimingAnalyzer.h
3 * @author Dayong Wang
4 * @date Fri Dec 1 18:24:39 2006
5 *
6 * @brief Analyzer for extracting CSC timing const.
7 * based on B. Jackson's analyzer by Dayong Wang
8 *
9 */
10 // $Id: CSCTimingAnalyzer.h,v 1.5 2007/11/07 10:03:27 wangdy Exp $
11
12 #ifndef TimingCSC_CSCTimingAnalyzer_h
13 #define TimingCSC_CSCTimingAnalyzer_h
14
15
16 #include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigiCollection.h"
17 #include "DataFormats/L1CSCTrackFinder/interface/L1CSCTrackCollection.h"
18
19 #include <TROOT.h>
20 #include <TFile.h>
21 #include <TCanvas.h>
22 #include <TH1I.h>
23 #include <TH1F.h>
24 #include <TString.h>
25
26 enum
27 {
28 /// MAX_STATIONS is set to 5 because the subsectors in ME 1 are handled
29 /// as a separate station
30 MAX_STATIONS = 5,
31 MAX_SECTORS = 6,
32 MAX_CHAMBERS = 9
33 };
34
35 const TString stationLabel[MAX_STATIONS] = {"1a","1b","2","3","4"};
36 const TString sectorLabel[MAX_SECTORS] = {"1","2","3","4","5","6"};
37 const TString chamberLabel[MAX_CHAMBERS] = {"1","2","3","4","5","6","7","8","9"};
38 const int MINSEC=0;
39 const int MAXSEC=6;
40 const int TIMINGSEC=3; // this only works for naive estimation now
41
42 class CSCTriggerMappingFromFile;
43
44 class CSCTimingAnalyzer : public edm::EDAnalyzer
45 {
46 public:
47
48 explicit CSCTimingAnalyzer(edm::ParameterSet const& conf);
49 ~CSCTimingAnalyzer();
50
51 virtual void beginJob(const edm::EventSetup&);
52 virtual void endJob();
53 virtual void analyze(edm::Event const& e, edm::EventSetup const& iSetup);
54
55 private:
56
57 void initializeHistograms();
58 void fillHistograms(edm::Handle<CSCCorrelatedLCTDigiCollection> corrlcts,
59 edm::Handle<L1CSCTrackCollection> tracks);
60
61 void timingExtract();
62 void initializeCanvases();
63 void fillCanvases();
64 void printCanvases();
65
66 void deleteRootObjects();
67 void deleteHistograms();
68 void deleteCanvases();
69
70 bool testBeam;
71 int TBFEDid, TBendcap, TBsector;
72 std::string mapPath;
73 CSCTriggerMappingFromFile* TFMapping;
74 int eventNumber;
75
76 /* std::string day; */
77 edm::InputTag lctProducer, trackProducer;
78
79 std::string run;
80 std::string outFile;
81 std::string timeFile;
82
83 /// Root Objects
84
85 /// File to store the generated hisograms
86 TFile* fAnalysis;
87
88 /// for output of const and error
89 TFile* fTimingConst;
90
91 TH1I* hBX[MAX_SECTORS][MAX_STATIONS][MAX_CHAMBERS];
92 TH1I* hNumTracksPerEvent;
93 TH1F* hTimingConstDirect;
94 TH1F* hTimingConstA;
95 TH1F* hTimingConstB;
96 TH1F* hTimingComp;
97 /// Arrays of histograms that contains the strip difference between
98 /// LCTs in adjacent CSCs within the same event
99 ///
100 /// MAX_CHAMBERS-2 because there are that many boundaries between CSCs to
101 /// account for in ME 234. In ME 1 there will be unused plots
102 TH1I* hBXDifference[MAX_SECTORS][MAX_STATIONS][MAX_CHAMBERS-2];
103
104 /// BX difference between station 2 and 3
105 /// overlapping cscs in ME 2 and 3
106 TH1I* hBXDifference23Overlap[MAX_SECTORS][MAX_CHAMBERS];
107 /// crossing cscs in ME 2 and 3
108 TH1I* hBXDifference23Cross[MAX_SECTORS][2*MAX_CHAMBERS-4];
109 /// non overlapping cscs in ME 2 and 3
110 TH1I* hBXDifference23NonOverlap[MAX_SECTORS][MAX_CHAMBERS-3];
111 /// require "forward" muons
112
113 /// BX difference between stations 1A and 2
114 /// ME 1A ring 1
115 TH1I* hBXDifference1AR12[MAX_SECTORS][MAX_CHAMBERS-3];
116 /// ME 1A ring 2/3
117 TH1I* hBXDifference1AR232[MAX_SECTORS][MAX_CHAMBERS-3];
118
119 /// BX difference between stations 1B and 2
120 /// ME 1B ring 1
121 TH1I* hBXDifference1BR12[MAX_SECTORS][MAX_CHAMBERS-3];
122 /// ME 1B ring 2/3
123 TH1I* hBXDifference1BR232[MAX_SECTORS][MAX_CHAMBERS-3];
124
125 /// BX difference within different rings in stations 1A
126 /// R1-R2
127 TH1I* hBXDifference1AInR1R2[MAX_SECTORS][7];
128 /// R1-R3
129 TH1I* hBXDifference1AInR1R3[MAX_SECTORS][7];
130
131 /// BX difference within different rings in stations 1B
132 /// R1-R2
133 TH1I* hBXDifference1BInR1R2[MAX_SECTORS][7];
134 /// R1-R3
135 TH1I* hBXDifference1BInR1R3[MAX_SECTORS][7];
136
137 /// BX difference within stations 1A abd 1B
138 TH1I* hBXDifference1AWith1B[MAX_SECTORS][7];
139
140
141
142 /// Canvases to display the histograms once they are filled
143
144 TCanvas* cBX[MAX_SECTORS][MAX_STATIONS];
145 TCanvas* cNumTracksPerEvent;
146 TCanvas* cTimingConstA;
147 TCanvas* cTimingConstB;
148 TCanvas* cTimingConstDirect;
149 TCanvas* cTimingComp;
150
151 TCanvas* cBXDifference[MAX_SECTORS][MAX_STATIONS];
152
153 /// Canvases for printing BX Difference between station 2 and 3
154 /// Overlapping cscs in stations 2 and 3
155 TCanvas* cBXDifference23Overlap[MAX_SECTORS];
156 /// Crossing cscs in stations 2 and 3
157 TCanvas* cBXDifference23Cross[MAX_SECTORS];
158 /// Non-overlapping cscs in stations 2 and 3
159 TCanvas* cBXDifference23NonOverlap[MAX_SECTORS];
160 /// Canvases for printing BX differences between station 1A and 2
161 /// ME 1A ring 1
162 TCanvas* cBXDifference1AR12[MAX_SECTORS];
163 /// ME 1A ring 2/3
164 TCanvas* cBXDifference1AR232[MAX_SECTORS];
165
166 /// Canvases for printing BX differences between station 1B and 2
167 /// ME 1B ring 1
168 TCanvas* cBXDifference1BR12[MAX_SECTORS];
169 /// ME 1B ring 2/3
170 TCanvas* cBXDifference1BR232[MAX_SECTORS];
171
172 /// Canvases for printing BX differences within station 1A
173 /// R1R2
174 TCanvas* cBXDifference1AInR1R2[MAX_SECTORS];
175 /// R1R3
176 TCanvas* cBXDifference1AInR1R3[MAX_SECTORS];
177
178 /// Canvases for printing BX differences within station 1B
179 /// R1R2
180 TCanvas* cBXDifference1BInR1R2[MAX_SECTORS];
181 /// R1R3
182 TCanvas* cBXDifference1BInR1R3[MAX_SECTORS];
183
184 /// Canvases for printing BX differences of station 1A and 1B
185 TCanvas* cBXDifference1AWith1B[MAX_SECTORS];
186
187
188 };
189
190 #endif