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.8 2007/12/06 22:25:00 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[12] = {"1","2","3","4","5","6", "7","8","9","10","11","12"};
|
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 |
const int BX_START=3; // starting of hBX: 3 for MC and 0 for data
|
42 |
|
43 |
class CSCTriggerMappingFromFile;
|
44 |
|
45 |
class CSCTimingAnalyzer : public edm::EDAnalyzer
|
46 |
{
|
47 |
public:
|
48 |
|
49 |
explicit CSCTimingAnalyzer(edm::ParameterSet const& conf);
|
50 |
~CSCTimingAnalyzer();
|
51 |
|
52 |
virtual void beginJob(const edm::EventSetup&);
|
53 |
virtual void endJob();
|
54 |
virtual void analyze(edm::Event const& e, edm::EventSetup const& iSetup);
|
55 |
|
56 |
private:
|
57 |
|
58 |
void initializeHistograms();
|
59 |
void fillHistograms(edm::Handle<CSCCorrelatedLCTDigiCollection> corrlcts,
|
60 |
edm::Handle<L1CSCTrackCollection> tracks);
|
61 |
|
62 |
void timingExtract();
|
63 |
void initializeCanvases();
|
64 |
void fillCanvases();
|
65 |
void printCanvases();
|
66 |
|
67 |
void deleteRootObjects();
|
68 |
void deleteHistograms();
|
69 |
void deleteCanvases();
|
70 |
|
71 |
bool testBeam;
|
72 |
int TBFEDid, TBendcap, TBsector;
|
73 |
std::string mapPath;
|
74 |
CSCTriggerMappingFromFile* TFMapping;
|
75 |
int eventNumber;
|
76 |
|
77 |
/* std::string day; */
|
78 |
edm::InputTag lctProducer, trackProducer;
|
79 |
|
80 |
std::string run;
|
81 |
std::string outFile;
|
82 |
std::string timeFile;
|
83 |
|
84 |
/// Root Objects
|
85 |
|
86 |
/// File to store the generated hisograms
|
87 |
TFile* fAnalysis;
|
88 |
|
89 |
/// for output of const and error
|
90 |
TFile* fTimingConst;
|
91 |
|
92 |
TH1I* hBX[12][MAX_STATIONS][MAX_CHAMBERS];
|
93 |
TH1I* hNumTracksPerEvent;
|
94 |
TH1F* hTimingConstDirect;
|
95 |
TH1F* hTimingConstA;
|
96 |
TH1F* hTimingConstB;
|
97 |
TH1F* hTimingComp;
|
98 |
/// Arrays of histograms that contains the strip difference between
|
99 |
/// LCTs in adjacent CSCs within the same event
|
100 |
///
|
101 |
/// MAX_CHAMBERS-2 because there are that many boundaries between CSCs to
|
102 |
/// account for in ME 234. In ME 1 there will be unused plots
|
103 |
TH1I* hBXDifference[12][MAX_STATIONS][MAX_CHAMBERS-2];
|
104 |
|
105 |
/// BX difference between station 2 and 3
|
106 |
/// overlapping cscs in ME 2 and 3
|
107 |
TH1I* hBXDifference23Overlap[12][MAX_CHAMBERS];
|
108 |
/// crossing cscs in ME 2 and 3
|
109 |
TH1I* hBXDifference23Cross[12][2*MAX_CHAMBERS-4];
|
110 |
/// non overlapping cscs in ME 2 and 3
|
111 |
TH1I* hBXDifference23NonOverlap[12][MAX_CHAMBERS-3];
|
112 |
/// require "forward" muons
|
113 |
|
114 |
/// BX difference between stations 1A and 2
|
115 |
/// ME 1A ring 1
|
116 |
TH1I* hBXDifference1AR12[12][MAX_CHAMBERS-3];
|
117 |
/// ME 1A ring 2/3
|
118 |
TH1I* hBXDifference1AR232[12][MAX_CHAMBERS-3];
|
119 |
|
120 |
/// BX difference between stations 1B and 2
|
121 |
/// ME 1B ring 1
|
122 |
TH1I* hBXDifference1BR12[12][MAX_CHAMBERS-3];
|
123 |
/// ME 1B ring 2/3
|
124 |
TH1I* hBXDifference1BR232[12][MAX_CHAMBERS-3];
|
125 |
|
126 |
/// BX difference within different rings in stations 1A
|
127 |
/// R1-R2
|
128 |
TH1I* hBXDifference1AInR1R2[12][7];
|
129 |
/// R1-R3
|
130 |
TH1I* hBXDifference1AInR1R3[12][7];
|
131 |
|
132 |
/// BX difference within different rings in stations 1B
|
133 |
/// R1-R2
|
134 |
TH1I* hBXDifference1BInR1R2[12][7];
|
135 |
/// R1-R3
|
136 |
TH1I* hBXDifference1BInR1R3[12][7];
|
137 |
|
138 |
/// BX difference within stations 1A abd 1B
|
139 |
TH1I* hBXDifference1AWith1B[12][7];
|
140 |
|
141 |
|
142 |
/// BX difference between station 3 and 4
|
143 |
/// overlapping cscs in ME 3 and 4
|
144 |
TH1I* hBXDifference34Overlap[12][MAX_CHAMBERS];
|
145 |
/// crossing cscs in ME 3 and 4
|
146 |
TH1I* hBXDifference34Cross[12][4];
|
147 |
|
148 |
|
149 |
/// Canvases to display the histograms once they are filled
|
150 |
|
151 |
TCanvas* cBX[12][MAX_STATIONS];
|
152 |
TCanvas* cNumTracksPerEvent;
|
153 |
TCanvas* cTimingConstA;
|
154 |
TCanvas* cTimingConstB;
|
155 |
TCanvas* cTimingConstDirect;
|
156 |
TCanvas* cTimingComp;
|
157 |
|
158 |
TCanvas* cBXDifference[12][MAX_STATIONS];
|
159 |
|
160 |
/// Canvases for printing BX Difference between station 2 and 3
|
161 |
/// Overlapping cscs in stations 2 and 3
|
162 |
TCanvas* cBXDifference23Overlap[12];
|
163 |
/// Crossing cscs in stations 2 and 3
|
164 |
TCanvas* cBXDifference23Cross[12];
|
165 |
/// Non-overlapping cscs in stations 2 and 3
|
166 |
TCanvas* cBXDifference23NonOverlap[12];
|
167 |
/// Canvases for printing BX differences between station 1A and 2
|
168 |
/// ME 1A ring 1
|
169 |
TCanvas* cBXDifference1AR12[12];
|
170 |
/// ME 1A ring 2/3
|
171 |
TCanvas* cBXDifference1AR232[12];
|
172 |
|
173 |
/// Canvases for printing BX differences between station 1B and 2
|
174 |
/// ME 1B ring 1
|
175 |
TCanvas* cBXDifference1BR12[12];
|
176 |
/// ME 1B ring 2/3
|
177 |
TCanvas* cBXDifference1BR232[12];
|
178 |
|
179 |
/// Canvases for printing BX differences within station 1A
|
180 |
/// R1R2
|
181 |
TCanvas* cBXDifference1AInR1R2[12];
|
182 |
/// R1R3
|
183 |
TCanvas* cBXDifference1AInR1R3[12];
|
184 |
|
185 |
/// Canvases for printing BX differences within station 1B
|
186 |
/// R1R2
|
187 |
TCanvas* cBXDifference1BInR1R2[12];
|
188 |
/// R1R3
|
189 |
TCanvas* cBXDifference1BInR1R3[12];
|
190 |
|
191 |
/// Canvases for printing BX differences of station 1A and 1B
|
192 |
TCanvas* cBXDifference1AWith1B[12];
|
193 |
|
194 |
|
195 |
};
|
196 |
|
197 |
#endif
|