00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083 #ifndef __StEmbeddingQADraw_h__
00084 #define __StEmbeddingQADraw_h__
00085
00086 #include <vector>
00087
00088 class TCanvas ;
00089 class TH1 ;
00090 class TFile ;
00091 class TObject ;
00092 class TPad ;
00093 class TPaveText ;
00094 class TPDF ;
00095 #include "TString.h"
00096
00097 class StEmbeddingQADraw {
00098 public:
00103 StEmbeddingQADraw(const TString embeddingFile, const TString realDataFile, const Int_t geantid,
00104 const Bool_t isEmbeddingOnly = kFALSE);
00105
00107 StEmbeddingQADraw(const TString embeddingFile, const TString realDataFile,
00108 const Int_t year, const TString production, const Int_t geantid, const Bool_t isEmbeddingOnly = kFALSE);
00109 virtual ~StEmbeddingQADraw();
00110
00112 void init() ;
00113
00115 void setParentGeantId(const Int_t parentgeantid) ;
00116
00118 void setOutputDirectory(const TString name = "./") ;
00119
00120 Bool_t draw() const ;
00121
00122
00123 Bool_t drawEvent() const;
00124
00125
00126 Bool_t drawMcTrack() const;
00127 Bool_t drawTrack() const ;
00128
00129 Bool_t drawGeantId() const;
00130 Bool_t drawPhi() const ;
00131 Bool_t drawRapidity() const;
00132 Bool_t drawPt() const;
00133 Bool_t drawMomentum() const;
00134 Bool_t drawdEdx() const;
00135 Bool_t drawDca() const;
00136 Bool_t drawNHit() const;
00137
00138 Bool_t finish() ;
00139
00140 void setPNGOn() ;
00141 void setGIFOn() ;
00142 void setJPGOn() ;
00143 void setEPSOn() ;
00144 void setPSOn() ;
00145
00146 Int_t getYear() const ;
00147 const Char_t* getProduction() const ;
00148 Int_t getGeantId() const ;
00149
00151
00152 const Char_t* getParticleName(const Int_t geantid = -1) const ;
00153
00154 void setPtMax(const Double_t ptmax) ;
00155
00156 private:
00158
00159 Bool_t open(const TString embeddingFile, const TString realDataFile) ;
00160
00162 void print(const TCanvas& canvas, const TString name) const;
00163
00165
00166 void checkInputGeantId() ;
00167
00169 Bool_t isOpen() const ;
00170
00172 Bool_t isMatchedPairOk() const ;
00173
00175 void setDaughterGeantId() ;
00176
00178 Int_t getEntries() const ;
00179
00181 Bool_t isDecay() const ;
00182
00184
00185 Int_t getGeantIdReal(const Int_t daughter) const ;
00186
00188
00189
00190
00191
00192 Int_t getCategoryId(const Bool_t isEmbedding = kTRUE) const ;
00193
00195 TObject* getHistogram(const TString name, const Bool_t isEmbedding = kTRUE) const ;
00196
00199 TObject* getHistogram(const TString name, const UInt_t daughter, const Bool_t isEmbedding,
00200 const UInt_t parentparentid = 0) const ;
00201
00203 const Char_t* getHistogramName(const TString name, const UInt_t daughter, const Bool_t isEmbedding,
00204 const UInt_t parentparentid = 0) const ;
00205
00206
00208 Double_t getNormalization(const TH1& h) const ;
00209
00211 const Char_t* getBaseName() const ;
00212
00214 Bool_t drawStatistics(const Double_t x1=0.1, const Double_t y1=0.2, const Double_t x2=0.9, const Double_t y2=0.8,
00215 const Double_t textSize = 0.05) const;
00216
00218 TPaveText* drawHeader(const TString description,
00219 const Double_t x1=0.0, const Double_t y1=0.9, const Double_t x2=1.0, const Double_t y2=0.95,
00220 const Double_t textSize = 0.032) const;
00221
00223 void drawLegend(const UInt_t id, TH1* hembed, TH1* hreal, const Option_t* option="L",
00224 const Bool_t doSplit=kFALSE) const ;
00225
00227 void drawErrorMessages(const TString histogramName) const ;
00228
00230 Bool_t drawVertices() const;
00231 Bool_t drawRunEventId() const;
00232 Bool_t drawNumberOfParticles() const;
00233
00235 Bool_t drawdEdxVsMomentum(const Bool_t isMcMomentum=kTRUE) const ;
00236
00237
00238
00239
00240 Bool_t drawProjection2D(const TString name, const Bool_t isMC = kFALSE) const;
00241 Bool_t drawProjection3D(const TString name) const;
00242
00244
00245 TPaveText* initCanvas(const TString header, const Int_t nx=0, const Int_t ny=0) const;
00246
00248 Double_t getVzAcceptedMinimum() const ;
00249 Double_t getVzAcceptedMaximum() const ;
00250
00252 const Char_t* getMcParticleName() const ;
00253
00255 const Char_t* getEmbeddingParticleName(const UInt_t id, const Bool_t doSplit=kFALSE) const ;
00256
00258 const Char_t* getRealParticleName(const UInt_t id, const Bool_t doSplit=kFALSE) const ;
00259
00260
00261 static UInt_t mCanvasId ;
00262
00263 TCanvas* mCanvas ;
00264 TPad* mMainPad ;
00265 TPDF* mPDF ;
00266
00267 const Bool_t mIsEmbeddingOnly ;
00268
00269 Bool_t mIsOpen ;
00270
00271 Bool_t mIsPNGOn ;
00272 Bool_t mIsGIFOn ;
00273 Bool_t mIsJPGOn ;
00274 Bool_t mIsEPSOn ;
00275 Bool_t mIsPSOn ;
00276
00277 Int_t mYear ;
00278 TString mProduction ;
00279 Int_t mGeantId ;
00280 Double_t mPtMax ;
00281
00282 TFile* mInputEmbedding ;
00283 TFile* mInputRealData ;
00284
00285 TString mOutputFigureDirectory ;
00286
00287 std::vector<Int_t> mDaughterGeantId ;
00288 std::vector<Int_t> mParentGeantId ;
00289 std::vector<Int_t> mParentParentGeantId ;
00290 std::vector<Int_t> mMcGeantId ;
00291 Int_t mInputParentGeantId ;
00292
00293 ClassDef(StEmbeddingQADraw, 1)
00294 };
00295
00296 inline Int_t StEmbeddingQADraw::getYear() const { return mYear ; }
00297 inline const Char_t* StEmbeddingQADraw::getProduction() const { return mProduction.Data() ; }
00298 inline Int_t StEmbeddingQADraw::getGeantId() const { return mGeantId ; }
00299
00300 #endif
00301