001 #ifndef EWANALYSISTOOLS_EWTOOLBASE_H
002 #define EWANALYSISTOOLS_EWTOOLBASE_H
003
004 #ifndef EWPA_STANDALONE
005
006 #include "GaudiKernel/ISvcLocator.h"
007 #include "StoreGate/StoreGateSvc.h"
008 #endif
009
010
011 #include "EWCore/EventLibrary.h"
012
013
014 #include "TFile.h"
015 #include "TH1F.h"
016 #include "TH2F.h"
017 #include "TH3F.h"
018 #include "TProfile.h"
019 #include "TTree.h"
020 #include "TCanvas.h"
021 #include "TMath.h"
022 #include "TMarker.h"
023 #include "TLine.h"
024 #include "TPave.h"
025 #include "TLatex.h"
026 #include "TLegend.h"
027 #include "TPaveText.h"
028 #include "TText.h"
029 #include "TF1.h"
030
031
032
033
034
035
036 class EWToolBase {
037
038 public:
039
040
041
042
043
044
045 EWToolBase(std::string name="EWToolBase");
046 virtual ~EWToolBase();
047
048 void declareProperty(std::string name, std::string& val)
049 {m_stringProperty.insert(std::pair<std::string, std::string*>(name,&val));}
050 void declareProperty(std::string name, int& val)
051 {m_intProperty.insert(std::pair<std::string, int*>(name,&val));}
052 void declareProperty(std::string name, float& val)
053 {m_floatProperty.insert(std::pair<std::string, float*>(name,&val));}
054 void declareProperty(std::string name, double& val)
055 {m_doubleProperty.insert(std::pair<std::string, double*>(name,&val));}
056 void declareProperty(std::string name, bool& val)
057 {m_boolProperty.insert(std::pair<std::string, bool*>(name,&val));}
058 void declareProperty(std::string name, std::vector<int>& val)
059 {m_intVecProperty.insert(std::pair<std::string, std::vector<int>*>(name,&val));}
060 void declareProperty(std::string name, std::vector<float>& val)
061 {m_floatVecProperty.insert(std::pair<std::string, std::vector<float>*>(name,&val));}
062 void declareProperty(std::string name, std::vector<double>& val)
063 {m_doubleVecProperty.insert(std::pair<std::string, std::vector<double>*>(name,&val));}
064 void declareProperty(std::string name, std::vector<bool>& val)
065 {m_boolVecProperty.insert(std::pair<std::string, std::vector<bool>*>(name,&val));}
066 void declareProperty(std::string name, std::vector<std::string>& val)
067 {m_stringVecProperty.insert(std::pair<std::string, std::vector<std::string>*>(name,&val));}
068
069 void getProperty(std::map<std::string, std::string*>& prop) {prop = m_stringProperty;}
070 void getProperty(std::map<std::string, int*>& prop) {prop = m_intProperty;}
071 void getProperty(std::map<std::string, float*>& prop) {prop = m_floatProperty;}
072 void getProperty(std::map<std::string, double*>& prop) {prop = m_doubleProperty;}
073 void getProperty(std::map<std::string, bool*>& prop) {prop = m_boolProperty;}
074 void getProperty(std::map<std::string, std::vector<int>*>& prop) {prop = m_intVecProperty;}
075 void getProperty(std::map<std::string, std::vector<float>*>& prop) {prop = m_floatVecProperty;}
076 void getProperty(std::map<std::string, std::vector<double>*>& prop) {prop = m_doubleVecProperty;}
077 void getProperty(std::map<std::string, std::vector<bool>*>& prop) {prop = m_boolVecProperty;}
078 void getProperty(std::map<std::string, std::vector<std::string>*>& prop) {prop = m_stringVecProperty;}
079
080 virtual StatusCode initialize();
081 virtual StatusCode execute(EventLibrary* evtLib);
082 virtual StatusCode finalize() {return StatusCode::SUCCESS;}
083
084
085
086
087
088 std::string name() {return m_name;}
089
090
091
092
093
094 void setName(std::string name);
095
096
097
098
099
100 void setAraGate(TTree* araGate) {m_araGate = araGate;}
101
102
103
104
105
106
107
108 void ATLAS_LABEL(double x, double y, double tsize, int color);
109
110
111
112
113
114
115
116
117 void myText(double x, double y, int color, double tsize, const char *text, double angle=0);
118
119
120
121
122
123
124
125
126
127
128 void myBoxText(double x, double y, double boxsize, int mcolor, double tsize, const char *text);
129
130
131
132
133
134
135
136
137
138 void myMarkerText(double x, double y, int color, int mstyle, double tsize, const char *text);
139
140
141 void setDataType(std::string dataType);
142 bool dataType(std::string type);
143
144
145 bool isAthenaAware() {return m_athenaAware;}
146 void setAthenaAware(bool aware) {m_athenaAware = aware;}
147
148
149 virtual bool skimmingTest(EventLibrary* evtLib) {
150 m_Log << WARNING << "SkimmingTest always TRUE : not defined for " << m_name << endmsg;
151 m_Log << WARNING << "EventLibrary version : " << evtLib->version() << endmsg;
152 return true;
153 }
154
155
156
157
158
159
160
161
162
163
164 int getProdVertex(EventObject *part, double& vx, double& vy, double& vz, int& vbarcode);
165
166 int getEndVertex(EventObject *part, double& vx, double& vy, double& vz, int& vbarcode);
167
168
169
170
171
172
173
174
175
176
177 #ifndef EWPA_STANDALONE
178 int getProdVertex(const TruthParticle *par, double& vx, double& vy, double& vz, int& vbarcode);
179
180
181
182
183
184
185
186
187
188
189 int getEndVertex(const TruthParticle *par, double& vx, double& vy, double& vz, int& vbarcode);
190
191
192
193
194
195
196
197
198
199 #endif
200
201 void splitString(const std::string& str,
202 std::vector<std::string>& tokens,
203 const std::string& delimiters);
204
205 protected:
206
207 #ifndef EWPA_STANDALONE
208 StoreGateSvc* m_storeGate;
209 #endif
210
211 bool m_athenaAware;
212 std::string m_name;
213 std::string m_dataType;
214
215 std::map<std::string, std::string*> m_stringProperty;
216 std::map<std::string, int*> m_intProperty;
217 std::map<std::string, float*> m_floatProperty;
218 std::map<std::string, double*> m_doubleProperty;
219 std::map<std::string, bool*> m_boolProperty;
220 std::map<std::string, std::vector<std::string>*> m_stringVecProperty;
221 std::map<std::string, std::vector<int>*> m_intVecProperty;
222 std::map<std::string, std::vector<float>*> m_floatVecProperty;
223 std::map<std::string, std::vector<double>*> m_doubleVecProperty;
224 std::map<std::string, std::vector<bool>*> m_boolVecProperty;
225
226
227 TTree *m_araGate;
228 EWMessage m_Log;
229 };
230
231 #ifndef EWPA_STANDALONE
232 CLASS_DEF(EWToolBase, 259593343, 1)
233 #endif
234
235 #endif
236
Due to the LXR bug, the updates fail sometimes to remove references to deleted files. The Saturday's full rebuilds fix these problems |
This page was automatically generated by the
LXR engine.
|
|