ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/wangdy/TimingCSC/interface/CSCTimingAnalyzer.h
Revision: 1.5
Committed: Wed Nov 7 10:03:27 2007 UTC (17 years, 5 months ago) by wangdy
Content type: text/plain
Branch: MAIN
Changes since 1.4: +5 -3 lines
Log Message:
update to CMSSW_167; handle simulation sample and real data together

File Contents

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