ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/wangdy/TimingCSC/interface/CSCTimingAnalyzer.h
Revision: 1.1
Committed: Thu Jun 14 14:22:59 2007 UTC (17 years, 10 months ago) by wangdy
Content type: text/plain
Branch: MAIN
Log Message:
first check in of CSCTF timing study related packages

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$
11
12 #ifndef TimingCSC_CSCTimingAnalyzer_h
13 #define TimingCSC_CSCTimingAnalyzer_h
14
15
16 //#include <iostream>
17
18 #include "FWCore/Framework/interface/EDAnalyzer.h"
19 #include "FWCore/Framework/interface/Event.h"
20 #include "FWCore/Framework/interface/Handle.h"
21 #include "FWCore/ParameterSet/interface/ParameterSet.h"
22 #include "FWCore/Framework/interface/EventSetup.h"
23 #include "FWCore/Framework/interface/ESHandle.h"
24 #include "FWCore/MessageLogger/interface/MessageLogger.h"
25
26 #include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigiCollection.h"
27 #include "DataFormats/L1CSCTrackFinder/interface/L1CSCTrackCollection.h"
28
29 #include <TROOT.h>
30 #include <TFile.h>
31 #include <TCanvas.h>
32 #include <TH1I.h>
33 #include <TH1F.h>
34 #include <TString.h>
35
36 enum
37 {
38 /// MAX_STATIONS is set to 5 because the subsectors in ME 1 are handled
39 /// as a separate station
40 MAX_STATIONS = 5,
41 MAX_SECTORS = 6,
42 MAX_CHAMBERS = 9
43 };
44
45 const TString stationLabel[MAX_STATIONS] = {"1a","1b","2","3","4"};
46 const TString sectorLabel[MAX_SECTORS] = {"1","2","3","4","5","6"};
47 const TString chamberLabel[MAX_CHAMBERS] = {"1","2","3","4","5","6","7","8","9"};
48
49 class CSCTriggerMappingFromFile;
50
51 class CSCTimingAnalyzer : public edm::EDAnalyzer
52 {
53 public:
54
55 explicit CSCTimingAnalyzer(edm::ParameterSet const& conf);
56 ~CSCTimingAnalyzer();
57
58 virtual void beginJob(const edm::EventSetup&);
59 virtual void endJob();
60 virtual void analyze(edm::Event const& e, edm::EventSetup const& iSetup);
61
62 private:
63
64 void initializeHistograms();
65 void fillHistograms(edm::Handle<CSCCorrelatedLCTDigiCollection> corrlcts,
66 edm::Handle<L1CSCTrackCollection> tracks);
67
68 void timingExtract();
69 void initializeCanvases();
70 void fillCanvases();
71 void printCanvases();
72
73 void deleteRootObjects();
74 void deleteHistograms();
75 void deleteCanvases();
76
77 bool testBeam;
78 int TBFEDid, TBendcap, TBsector;
79 std::string mapPath;
80 CSCTriggerMappingFromFile* TFMapping;
81 int eventNumber;
82
83 /* std::string day; */
84 std::string run;
85 std::string outFile;
86 std::string timeFile;
87
88 /// Root Objects
89
90 /// File to store the generated hisograms
91 TFile* fAnalysis;
92
93 /// for output of const and error
94 TFile* fTimingConst;
95
96 TH1I* hBX[MAX_SECTORS][MAX_STATIONS][MAX_CHAMBERS];
97 TH1I* hNumTracksPerEvent;
98 TH1F* hTimingConstDirect;
99 TH1F* hTimingConstA;
100 TH1F* hTimingConstB;
101 TH1F* hTimingComp;
102 /// Arrays of histograms that contains the strip difference between
103 /// LCTs in adjacent CSCs within the same event
104 ///
105 /// MAX_CHAMBERS-2 because there are that many boundaries between CSCs to
106 /// account for in ME 234. In ME 1 there will be unused plots
107 TH1I* hBXDifference[MAX_SECTORS][MAX_STATIONS][MAX_CHAMBERS-2];
108
109 /// BX difference between station 2 and 3
110 /// overlapping cscs in ME 2 and 3
111 TH1I* hBXDifference23Overlap[MAX_SECTORS][MAX_CHAMBERS];
112 /// crossing cscs in ME 2 and 3
113 TH1I* hBXDifference23Cross[MAX_SECTORS][2*MAX_CHAMBERS-4];
114 /// non overlapping cscs in ME 2 and 3
115 TH1I* hBXDifference23NonOverlap[MAX_SECTORS][MAX_CHAMBERS-3];
116 /// require "forward" muons
117
118 /// BX difference between stations 1A and 2
119 /// ME 1A ring 1
120 TH1I* hBXDifference1AR12[MAX_SECTORS][MAX_CHAMBERS-3];
121 /// ME 1A ring 2/3
122 TH1I* hBXDifference1AR232[MAX_SECTORS][MAX_CHAMBERS-3];
123
124 /// BX difference between stations 1B and 2
125 /// ME 1B ring 1
126 TH1I* hBXDifference1BR12[MAX_SECTORS][MAX_CHAMBERS-3];
127 /// ME 1B ring 2/3
128 TH1I* hBXDifference1BR232[MAX_SECTORS][MAX_CHAMBERS-3];
129
130
131 /// Canvases to display the histograms once they are filled
132
133 TCanvas* cBX[MAX_SECTORS][MAX_STATIONS];
134 TCanvas* cNumTracksPerEvent;
135 TCanvas* cTimingConstA;
136 TCanvas* cTimingConstB;
137 TCanvas* cTimingConstDirect;
138 TCanvas* cTimingComp;
139
140 TCanvas* cBXDifference[MAX_SECTORS][MAX_STATIONS];
141
142 /// Canvases for printing BX Difference between station 2 and 3
143 /// Overlapping cscs in stations 2 and 3
144 TCanvas* cBXDifference23Overlap[MAX_SECTORS];
145 /// Crossing cscs in stations 2 and 3
146 TCanvas* cBXDifference23Cross[MAX_SECTORS];
147 /// Non-overlapping cscs in stations 2 and 3
148 TCanvas* cBXDifference23NonOverlap[MAX_SECTORS];
149 /// Canvases for printing BX differences between station 1A and 2
150 /// ME 1A ring 1
151 TCanvas* cBXDifference1AR12[MAX_SECTORS];
152 /// ME 1A ring 2/3
153 TCanvas* cBXDifference1AR232[MAX_SECTORS];
154
155 /// Canvases for printing BX differences between station 1B and 2
156 /// ME 1B ring 1
157 TCanvas* cBXDifference1BR12[MAX_SECTORS];
158 /// ME 1B ring 2/3
159 TCanvas* cBXDifference1BR232[MAX_SECTORS];
160
161 };
162
163 #endif