StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
drawEmbeddingQA.C
1 
2 //______________________________________________________________________
3 // Draw QA histograms
4 // - Output filename are automatically determined by
5 // StEmbeddingQAMaker
6 // - You don't need to put year, production and particlename. Those
7 // are obtained from the embedding output filename
8 // - 'outputDirectory' is the directory where the output figures
9 // are printed.
10 // - You can check the embedding output only by settting isEmbeddingOnly = kTRUE
11 void drawEmbeddingQA(
12  const TString outputDirectory = "./",
13  const TString embeddingFile = "qa_embedding_2005_P07ie.root",
14  const TString realDataFile = "qa_real_2005_P07ie.root",
15  const Int_t geantid = 8,
16  const Float_t ptMaxCut = 10.0,
17  const Bool_t isEmbeddingOnly = kFALSE,
18  const Int_t parentGeantId = 0,
19  const Float_t vzCut = 30.0,
20  const Int_t refMultMinCut = 0,
21  const Int_t refMultMaxCut = 1000,
22  const Float_t ptMinCut = 0.1,
23  const Float_t etaMaxCut = 1.5,
24  const Float_t yMaxCut = 10.0
25 ){
26  gROOT->Macro("${STAR}/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
27  gSystem->Load("StMiniMcEvent");
28  gSystem->Load("StEmbeddingUtilities");
29 
30  // Set relevant cut parameters here used in the base QA
31  // The default parameters can be found in the constructor of StRoot/StEmbeddingUtilities/StEmbeddingQAUtilities.cxx
32  // You should have consistent parameters in both doEmbeddingQAMaker.C and drawEmbeddingQA.C
33  // Below are the examples how to change the parameters
34  // All values used here are default ones
35  //
36  // NOTE: These are just used to print them out in the pdf, not really affect the real QA process
38  utility->setPtMinCut(ptMinCut);
39  utility->setPtMaxCut(ptMaxCut);
40  utility->setEtaCut(etaMaxCut);
41  // utility->setNHitCut(10);
42  // utility->setNHitToNPossCut(0.51);
43  // utility->setDcaCut(3.0);
44  // utility->setNSigmaCut(2.0);
45  utility->setRapidityCut(yMaxCut);
46  utility->setRefMultMinCut(refMultMinCut);
47  utility->setRefMultMaxCut(refMultMaxCut);
48  utility->setZVertexCut(vzCut);
49 
50  // FIXME: the trigger ID selections has to be hard-coded below!!!
51  // Default is no trigger cut, you can add multiple trigger id's like
52  // utility->addTriggerIdCut(290001);
53  // utility->addTriggerIdCut(290004);
54  // FIXME: using BTof PID in selecting real data primary tracks (turn this on ONLY for checking the dE/dx match between data and MC)
55  // utility->setBTofPid(kTRUE);
56 
57  StEmbeddingQADraw* maker = new StEmbeddingQADraw(embeddingFile, realDataFile, geantid, isEmbeddingOnly);
58  maker->setParentGeantId(parentGeantId) ;
59  maker->init();
60  maker->setOutputDirectory(outputDirectory);
61 
62 
63  // Flag for output figures (default is false)
64 // maker->setPNGOn() ; // Print png file
65 // maker->setGIFOn() ; // Print gif file
66 // maker->setJPGOn() ; // Print jpg file
67 // maker->setEPSOn() ; // Print eps file
68 // maker->setPSOn() ; // Print ps file
69 
70  // Set maximum pt to be drawn
71  maker->setPtMax(ptMaxCut+0.5) ;
72 
73  // Draw all QA plots
74  maker->draw();
75 
76  // or draw each QA
77  // Event-wise QA
78 // maker->drawEvent();
79 
80  // MC tracks
81 // maker->drawMcTrack();
82 
83  // Reconstructed track compared with real data
84  // Either
85 // maker->drawTrack();
86  // or
87 // maker->drawGeantId();
88 // maker->drawRapidity();
89 // maker->drawMomentum();
90 // maker->drawPt();
91 // maker->drawdEdx();
92 // maker->drawDca();
93 // maker->drawNHit();
94 
95  maker->finish() ;
96 }
97 
98 //______________________________________________________________________
99 // You need to put year, production and particlename
100 // if you determine the output filename by hand in StEmbeddingQAMaker.
101 // Please put the correct year, production and particleName since
102 // those are printed in the legend for each QA, and are used
103 // for the output figure name.
104 void drawEmbeddingQA(
105  const TString outputDirectory,
106  const TString embeddingFile,
107  const TString realDataFile,
108  const Int_t year,
109  const TString production,
110  const Int_t geantid,
111  const Double_t ptmax,
112  const Bool_t isEmbeddingOnly = kFALSE,
113  const Int_t parentgeantId = 0
114 ){
115  gROOT->Macro("${STAR}/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
116  gSystem->Load("StMiniMcEvent");
117  gSystem->Load("StEmbeddingUtilities");
118 
119  StEmbeddingQADraw* maker = new StEmbeddingQADraw(embeddingFile, realDataFile, year, production, geantid, isEmbeddingOnly);
120 // maker->setParentGeantId(parentGeantId) ;
121  maker->init();
122  maker->setOutputDirectory(outputDirectory);
123 
124  // Flag for output figures (default is false)
125 // maker->setPNGOn() ; // Print png file
126 // maker->setGIFOn() ; // Print gif file
127 // maker->setJPGOn() ; // Print jpg file
128 // maker->setEPSOn() ; // Print eps file
129 // maker->setPSOn() ; // Print ps file
130 
131  // Set maximum pt to be drawn
132  maker->setPtMax(ptmax) ;
133 
134  // Draw all QA plots
135  maker->draw();
136 
137  // or draw each QA
138  // Event-wise QA
139 // maker->drawEvent();
140 
141  // MC tracks
142 // maker->drawMcTrack();
143 
144  // Reconstructed track compared with real data
145  // Either
146 // maker->drawTrack();
147  // or
148 // maker->drawGeantId();
149 // maker->drawRapidity();
150 // maker->drawMomentum();
151 // maker->drawPt();
152 // maker->drawdEdx();
153 // maker->drawDca();
154 // maker->drawNHit();
155 
156  maker->finish() ;
157 }
158 
159 
Float_t setPtMinCut(const Float_t val)
Set track and event selections, return new value.
Bool_t finish()
NHit vs (pt, eta)
static StEmbeddingQAUtilities * instance()
Get instance.
void setParentGeantId(const Int_t parentgeantid)
Set parent geant id (default is 0)
void init()
Initialization.
void setOutputDirectory(const TString name="./")
Default is current directory.