00001 TString MuDSTFile(TString production, TString trgsetupname)
00002 {
00003 if( production.Contains("P08ic") && trgsetupname.Contains("upsilon"))
00004 return "/star/data06/embed/andrewar/MuDstReduced/P08ic_MuDst_st_upsilon.root";
00005
00006 }
00007 int Quit(char* prompt="Hit q or n to quit...")
00008 {
00009 char character;
00010 fflush(stdin);
00011 cout << prompt << flush;
00012 character = getc(stdin);
00013 cout << endl;
00014 return ((character=='q')||
00015 (character=='Q')||
00016 (character=='n')||
00017 (character=='N'));
00018 }
00019
00020
00022
00023 void StringCuts(char *o, const char *s, const char *s1)
00024 {
00025
00026 strcpy(o,s);
00027 strcat(o, " {"); strcat(o,s1); strcat(o,"}");
00028 }
00029
00030 void StringCuts(char *o, const char *s, const char *s1, const char *s2)
00031 {
00032 strcpy(o,s);
00033 strcat(o, " {");
00034 strcat(o, " ("); strcat(o,s1); strcat(o,")");
00035 strcat(o,"&&("); strcat(o,s2); strcat(o,")");
00036 strcat(o, "}");
00037 }
00038
00039 void StringCuts(char *o, const char *s, const char *s1,
00040 const char *s2, const char *s3)
00041 {
00042 strcpy(o,s);
00043 strcat(o, " {");
00044 strcat(o, "("); strcat(o,s1); strcat(o,")");
00045 strcat(o,"&&("); strcat(o,s2); strcat(o,")");
00046 strcat(o,"&&("); strcat(o,s3); strcat(o,")");
00047 strcat(o, "}");
00048 }
00049
00050 void StringCuts(char *o, const char *s, const char *s1, const char *s2,
00051 const char *s3, const char *s4)
00052 {
00053 strcpy(o,s);
00054 strcat(o, " {");
00055 strcat(o, "("); strcat(o,s1); strcat(o,")");
00056 strcat(o,"&&("); strcat(o,s2); strcat(o,")");
00057 strcat(o,"&&("); strcat(o,s3); strcat(o,")");
00058 strcat(o,"&&("); strcat(o,s4); strcat(o,")");
00059 strcat(o, "}");
00060 }
00061
00062
00064
00065 void Style(int i)
00066 {
00067 switch (i) {
00068 case 1:
00069
00070 gStyle->SetCanvasColor(10);
00071 gStyle->SetPadColor(10);
00072 gStyle->SetPadTickX(1);
00073 gStyle->SetPadTickY(1);
00074 gStyle->SetFillColor(0);
00075 gStyle->SetTitleColor(0);
00076 gStyle->SetStatColor(0);
00077 gStyle->SetHistFillColor(0);
00078 gStyle->SetFrameFillColor(10);
00079 gStyle->SetCanvasBorderMode(0);
00080 gStyle->SetFrameBorderMode(0);
00081 gStyle->SetPadBorderMode(0);
00082
00083 gStyle->SetOptFit();
00084 break;
00085 default:
00086 break;
00087 }
00088 }
00089
00091
00092 void keyLine(Float_t x, Float_t y, const Char_t* tt,
00093 Int_t color=1, Int_t style=1, Float_t tSize=0.04)
00094 {
00095 gPad->Update();
00096 Float_t x1 = gPad->GetFrame()->GetX1();
00097 Float_t x2 = gPad->GetFrame()->GetX2();
00098 Float_t dx = x2-x1;
00099 x = x1 + dx*x;
00100 Float_t y1 = gPad->GetFrame()->GetY1();
00101 Float_t y2 = gPad->GetFrame()->GetY2();
00102 Float_t dy = y2-y1;
00103 y = y1 + dy*y;
00104 TLine *l = new TLine(x,y,x+0.05*dx,y);
00105 l->SetLineColor(color);
00106 l->SetLineStyle(style);
00107 l->Draw();
00108 TText *t = new TText(x+0.06*dx,y,tt);
00109 t->SetTextAlign(12);
00110 t->SetTextSize(tSize);
00111 t->SetTextColor(color);
00112 t->Draw();
00113 }
00114
00115 void keySymbol(Float_t x, Float_t y, const Char_t* tt,
00116 Int_t color=1, Int_t marker=1, Float_t tSize=0.04)
00117 {
00118 gPad->Update();
00119 Float_t x1 = gPad->GetFrame()->GetX1();
00120 Float_t x2 = gPad->GetFrame()->GetX2();
00121 Float_t dx = x2-x1;
00122 x = x1 + dx*x;
00123 Float_t y1 = gPad->GetFrame()->GetY1();
00124 Float_t y2 = gPad->GetFrame()->GetY2();
00125 Float_t dy = y2-y1;
00126 y = y1 + dy*y;
00127 TMarker *l = new TMarker(x+0.025*dx,y,marker);
00128 l->SetMarkerColor(color);
00129 l->Draw();
00130 TText *t = new TText(x+0.06*dx,y,tt);
00131 t->SetTextAlign(12);
00132 t->SetTextSize(tSize);
00133 t->SetTextColor(color);
00134 t->Draw();
00135 }