AliPhysics  db95e02 (db95e02)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Post.C
Go to the documentation of this file.
1 
24 void Usage(std::ostream& o)
25 {
26  o << "Usage: Post(SIM,REAL,OUT,PROC,VIZ,N)\n"
27  << "\n"
28  << " SIM Simulation data file \n"
29  << " REAL Real data file \n"
30  << " OUTPUT (optional) Output name \n"
31  << " PROC (optional) processing options \n"
32  << " VIZ (optional) visualisation options \n"
33  << " N (optional) max number of centrality bins \n"
34  << std::endl;
35  o << "Processing options:\n"
36  << "\n"
37  << " 0x0001 Do scaling by unity\n"
38  << " 0x0002 Do scaling by full average\n"
39  << " 0x0004 Do scaling by eta differential\n"
40  << " 0x0008 Do scaling by fully differential\n"
41  << " 0x0010 Correct for decay of strange to secondary \n"
42  << " 0x1000 MC closure test\n"
43  << std::endl;
44  o << "Visualization options:\n"
45  << "\n"
46  << " 0x0001 Draw general information\n"
47  << " 0x0002 Draw parameters\n"
48  << " 0x0004 Draw weights\n"
49  << " 0x0008 Draw dNch/deta\n"
50  << " 0x0010 Draw alphas\n"
51  << " 0x0020 Draw delta information\n"
52  << " 0x0040 Draw backgrounds\n"
53  << " 0x0100 Whether to make a PDF\n"
54  << " 0x0200 Whether to pause after each plot\n"
55  << " 0x0400 Draw in landscape\n"
56  << " 0x0800 Alternative markers\n"
57  << std::endl;
58 }
59 
70 const TString& FormatInput(const char* inp, TString& shrt)
71 {
72  static TString tmp;
73  tmp = "";
74  Long_t flags;
75  if (gSystem->GetFileStat(inp, 0, 0, flags, 0) != 0) {
76  Warning("FormatInput", "Cannot stat %s", inp);
77  return tmp;
78  }
79  if (flags & 0x1) {
80  shrt = inp;
81  tmp.Form("%s/tracklet_dndeta.root", inp);
82  }
83  else {
84  shrt = gSystem->DirName(inp);
85  tmp = inp;
86  }
87  return tmp;
88 }
124 void Post(const char* sim,
125  const char* real,
126  const char* output=0,
127  UInt_t proc=0x2,
128  UInt_t viz=0x32f,
129  UInt_t n=10)
130 {
131  if (TString(sim) .Contains("help",TString::kIgnoreCase) ||
132  TString(real).Contains("help",TString::kIgnoreCase)) {
133  Usage(std::cout);
134  return;
135  }
136  // Set the path to the code
137  TString fwd = "$ALICE_PHYSICS/PWGLF/FORWARD/analysis2/dndeta/tracklets3";
138  if (gSystem->Getenv("ANA_SRC")) fwd = "$ANA_SRC/dndeta/tracklets3";
139 
140  // Compile the needed code
141  gSystem->AddIncludePath(Form("-I%s",fwd.Data()));
142  gROOT->LoadMacro(Form("%s/AliTrackletAODUtils.C++g",fwd.Data()));
143  gROOT->LoadMacro(Form("%s/AliTrackletdNdeta2.C++g",fwd.Data()));
144 
145  // Set inputs and output
146  TString realShrt, simShrt;
147  TString realFile = FormatInput(real);
148  TString simFile = FormatInput(sim);
149  TString outFile(output && output[0] != '\0' ? output :
150  Form("%s_%s",realShrt.Data(),simShrt.Data()));
151  if (proc & 0x1) outFile.Append("_unit");
152  if (proc & 0x2) outFile.Append("_const");
153  if (proc & 0x4) outFile.Append("_eta");
154  if (proc & 0x8) outFile.Append("_etaipz");
155  gSystem->mkdir(outFile,true);
156  Printf("===========================================\n"
157  " Real data file: %s\n"
158  " Simulation data file: %s\n"
159  " Output directory: %s\n"
160  "===========================================",
161  realFile.Data(), simFile.Data(), outFile.Data());
162 
163  // Create the object to do the post processing, and run it
165  p->Run(proc,viz,n,realFile,simFile,outFile);
166 
167  // Extract a GSE
168  Printf("Extracting GraphSysErr object(s)");
169  gROOT->LoadMacro(Form("%s/ExtractGSE2.C",fwd.Data()));
170  ExtractGSE2(outFile);
171 
172  Printf("All output stored in %s", outFile.Data());
173 }
174 /* @} */
175 // EOF
void ExtractGSE2(const char *input, UShort_t sNN=5023)
Definition: ExtractGSE2.C:340
void Run(UInt_t proc=kDefaultProc, UInt_t viz=kDefaultViz, UShort_t maxBins=9, const char *dataName="data.root", const char *simName="sim.root", const char *output=0, Double_t fudge=1)
const TString & FormatInput(const char *inp, TString &shrt)
Definition: Post.C:70
void Usage(std::ostream &o)
Definition: Post.C:24
TSystem * gSystem
unsigned int UInt_t
Definition: External.C:33
void Post(const char *sim, const char *real, const char *output=0, UInt_t proc=0x2, UInt_t viz=0x32f, UInt_t n=10)
Definition: Post.C:124
const char * fwd