1 |
#ifndef L1UpgradeNtuple_h
|
2 |
#define L1UpgradeNtuple_h
|
3 |
|
4 |
/** @file Copy of UserCode/L1TriggerUpgrade/macros/L1UpgradeNtuple.C with minor changes to fix memory leakes.
|
5 |
*
|
6 |
* I need to use L1UpgradeNtuple, but it's in the macros directory of UserCode/L1TriggerUpgrade so I
|
7 |
* can't include it using the standard "use" directive in a buildfile. I was previously incorporating
|
8 |
* it with an #include directive so save having to potentially out of synch copies. I found some
|
9 |
* memory leaks however so needed to change it, hence made another copy here.
|
10 |
*
|
11 |
* I'll just have to make a special effort to keep it up to date with the version in UserCode/L1TriggerUpgrade.
|
12 |
*
|
13 |
* @author Copied over into this file by Mark Grimes, but original code probably by Brian Winer.
|
14 |
* @date Copied here 06/Jun/2013
|
15 |
*/
|
16 |
|
17 |
#include <string>
|
18 |
#include <vector>
|
19 |
#include "Rtypes.h"
|
20 |
|
21 |
//
|
22 |
// Forward declarations
|
23 |
//
|
24 |
class TChain;
|
25 |
class TFile;
|
26 |
namespace L1Analysis
|
27 |
{
|
28 |
class L1AnalysisEventDataFormat;
|
29 |
class L1AnalysisGCTDataFormat;
|
30 |
class L1AnalysisGMTDataFormat;
|
31 |
class L1AnalysisGTDataFormat;
|
32 |
class L1AnalysisRCTDataFormat;
|
33 |
class L1AnalysisDTTFDataFormat;
|
34 |
class L1AnalysisCSCTFDataFormat;
|
35 |
class L1AnalysisCaloTPDataFormat;
|
36 |
class L1AnalysisEventDataFormat;
|
37 |
class L1AnalysisGCTDataFormat;
|
38 |
class L1AnalysisGMTDataFormat;
|
39 |
class L1AnalysisGTDataFormat;
|
40 |
class L1AnalysisRCTDataFormat;
|
41 |
class L1AnalysisDTTFDataFormat;
|
42 |
class L1AnalysisCSCTFDataFormat;
|
43 |
class L1AnalysisCaloTPDataFormat;
|
44 |
class L1AnalysisRecoMetDataFormat;
|
45 |
class L1AnalysisRecoMuonDataFormat;
|
46 |
class L1AnalysisRecoJetDataFormat;
|
47 |
class L1AnalysisRecoClusterDataFormat;
|
48 |
class L1AnalysisRecoClusterDataFormat;
|
49 |
class L1AnalysisRecoVertexDataFormat;
|
50 |
class L1AnalysisRecoTrackDataFormat;
|
51 |
class L1AnalysisL1ExtraDataFormat;
|
52 |
class L1AnalysisL1ExtraDataFormat;
|
53 |
class L1AnalysisL1MenuDataFormat;
|
54 |
class L1AnalysisL1ExtraUpgradeDataFormat;
|
55 |
class L1AnalysisSimulationDataFormat;
|
56 |
class L1AnalysisGeneratorDataFormat;
|
57 |
}
|
58 |
|
59 |
|
60 |
class L1UpgradeNtuple
|
61 |
{
|
62 |
public:
|
63 |
TChain *fChain; //!pointer to the analyzed TTree or TChain
|
64 |
TChain *ftreeEmu;
|
65 |
TChain *ftreemuon;
|
66 |
TChain *ftreereco;
|
67 |
TChain *ftreeExtra;
|
68 |
TChain *ftreeMenu;
|
69 |
TChain *ftreeEmuExtra;
|
70 |
TChain *ftreeUpgrade;
|
71 |
Int_t fCurrent; //!current Tree number in a TChain
|
72 |
|
73 |
bool dol1emu;
|
74 |
bool doreco;
|
75 |
bool domuonreco;
|
76 |
bool dol1extra;
|
77 |
bool dol1emuextra;
|
78 |
bool dol1menu;
|
79 |
bool dol1upgrade;
|
80 |
|
81 |
// L1Tree (Standard)
|
82 |
L1Analysis::L1AnalysisEventDataFormat *event_;
|
83 |
L1Analysis::L1AnalysisGCTDataFormat *gct_;
|
84 |
L1Analysis::L1AnalysisGMTDataFormat *gmt_;
|
85 |
L1Analysis::L1AnalysisGTDataFormat *gt_;
|
86 |
L1Analysis::L1AnalysisRCTDataFormat *rct_;
|
87 |
L1Analysis::L1AnalysisDTTFDataFormat *dttf_;
|
88 |
L1Analysis::L1AnalysisCSCTFDataFormat *csctf_;
|
89 |
L1Analysis::L1AnalysisCaloTPDataFormat *calo_;
|
90 |
|
91 |
// L1Tree (ReEmulated)
|
92 |
L1Analysis::L1AnalysisEventDataFormat *eventEmu_;
|
93 |
L1Analysis::L1AnalysisGCTDataFormat *gctEmu_;
|
94 |
L1Analysis::L1AnalysisGMTDataFormat *gmtEmu_;
|
95 |
L1Analysis::L1AnalysisGTDataFormat *gtEmu_;
|
96 |
L1Analysis::L1AnalysisRCTDataFormat *rctEmu_;
|
97 |
L1Analysis::L1AnalysisDTTFDataFormat *dttfEmu_;
|
98 |
L1Analysis::L1AnalysisCSCTFDataFormat *csctfEmu_;
|
99 |
L1Analysis::L1AnalysisCaloTPDataFormat *caloEmu_;
|
100 |
|
101 |
// Reco Trees
|
102 |
L1Analysis::L1AnalysisRecoMetDataFormat *recoMet_;
|
103 |
L1Analysis::L1AnalysisRecoMuonDataFormat *recoMuon_;
|
104 |
L1Analysis::L1AnalysisRecoJetDataFormat *recoJet_;
|
105 |
L1Analysis::L1AnalysisRecoClusterDataFormat *recoBasicCluster_;
|
106 |
L1Analysis::L1AnalysisRecoClusterDataFormat *recoSuperCluster_;
|
107 |
L1Analysis::L1AnalysisRecoVertexDataFormat *recoVertex_;
|
108 |
L1Analysis::L1AnalysisRecoTrackDataFormat *recoTrack_;
|
109 |
|
110 |
// L1 Extra Trees (Standard and ReEmulated)
|
111 |
L1Analysis::L1AnalysisL1ExtraDataFormat *l1extra_;
|
112 |
L1Analysis::L1AnalysisL1ExtraDataFormat *l1emuextra_;
|
113 |
|
114 |
// L1 Menu
|
115 |
L1Analysis::L1AnalysisL1MenuDataFormat *l1menu_;
|
116 |
|
117 |
// L1ExtraUpgrade Tree
|
118 |
L1Analysis::L1AnalysisL1ExtraUpgradeDataFormat *l1upgrade_;
|
119 |
|
120 |
// Monte Carlo Information
|
121 |
L1Analysis::L1AnalysisSimulationDataFormat *sim_;
|
122 |
L1Analysis::L1AnalysisGeneratorDataFormat *gen_;
|
123 |
|
124 |
L1UpgradeNtuple();
|
125 |
L1UpgradeNtuple( const std::string & fname );
|
126 |
|
127 |
virtual ~L1UpgradeNtuple();
|
128 |
|
129 |
bool Open( const std::string & fname );
|
130 |
bool OpenWithList( const std::string & fname );
|
131 |
virtual Int_t GetEntry( Long64_t entry );
|
132 |
virtual Long64_t LoadTree( Long64_t entry );
|
133 |
virtual void Init();
|
134 |
//virtual void Loop();
|
135 |
// Don't need these for now
|
136 |
//void Test();
|
137 |
//void Test2();
|
138 |
Long64_t GetEntries();
|
139 |
|
140 |
private:
|
141 |
bool CheckFirstFile();
|
142 |
bool OpenWithoutInit();
|
143 |
bool OpenNtupleList( const std::string & fname );
|
144 |
|
145 |
std::vector<std::string> listNtuples;
|
146 |
Long64_t nentries_;
|
147 |
TFile* rf;
|
148 |
};
|
149 |
|
150 |
#endif
|