Merge remote-tracking branch 'remotes/origin/master' into TPCdev
[u/mrichter/AliRoot.git] / PWGPP / QA / Tracking / ExpertQA / makeTrendingPlots.C
1 void SetGraphProperties( TGraphErrors *gr, const char *title, const char *yAxisTitle, Int_t color, Int_t mStyle, Float_t mSize);
2 void DrawAndSave( TGraphErrors *gr, const char *name );
3
4 makeTrendingPlots( const char *TrendingFile )
5 {
6   TFile *f = TFile::Open(TrendingFile);
7   if(!f){ std::cout << "ERROR! No Trendingfile given!" <<std::endl; return; }
8
9   TTree *tree = (TTree*) f->Get("trending");
10   if(!tree){ std::cout << "ERROR! No Tree available!" <<std::endl; return; }
11
12   //TGraph* MakeGraphSparse(TTree* tree, const char* expr = "Entry", const char* cut = "1", Int_t mstyle = 25, Int_t mcolor = 1, Float_t msize = -1, Float_t offset = 0.0)
13
14   // K0 Res
15   // shift
16   TGraphErrors *grK0shiftResPosHigh1pt = TStatToolkit::MakeGraphSparse( tree, "shiftK0sResPosHigh1pt:run:eShiftK0sResPosHigh1pt","shiftK0sResPosHigh1pt>-900" );
17   SetGraphProperties(grK0shiftResPosHigh1pt,"K0 shift resolution (positive tracks, 1pt = 1)","K0 shift resolution",1,20,.6);
18   TGraphErrors *grK0shiftResNegHigh1pt = TStatToolkit::MakeGraphSparse( tree, "shiftK0sResNegHigh1pt:run:eShiftK0sResNegHigh1pt","shiftK0sResNegHigh1pt>-900" );
19   SetGraphProperties(grK0shiftResNegHigh1pt,"K0 shift resolution (negative tracks, 1pt = 1)","K0 shift resolution",1,20,.6);
20   TGraphErrors *grK0shiftResPosLow1pt  = TStatToolkit::MakeGraphSparse( tree, "shiftK0sResPosLow1pt:run:eShiftK0sResPosLow1pt"  ,"shiftK0sResPosLow1pt>-900" );
21   SetGraphProperties(grK0shiftResPosLow1pt,"K0 shift resolution (positive tracks, 1pt = 0)","K0 shift resolution",1,20,.6);
22   TGraphErrors *grK0shiftResNegLow1pt  = TStatToolkit::MakeGraphSparse( tree, "shiftK0sResNegLow1pt:run:eShiftK0sResNegLow1pt"  ,"shiftK0sResNegLow1pt>-900" );
23   SetGraphProperties(grK0shiftResNegLow1pt,"K0 shift resolution (negative tracks, 1pt = 0)","K0 shift resolution",1,20,.6);
24   // sigma
25   TGraphErrors *grK0sigmaResPosHigh1pt = TStatToolkit::MakeGraphSparse( tree, "sigmaK0sResPosHigh1pt:run:eSigmaK0sResPosHigh1pt","sigmaK0sResPosHigh1pt>-900" );
26   SetGraphProperties(grK0sigmaResPosHigh1pt,"K0 sigma resolution (positive tracks, 1pt = 1)","K0 sigma resolution",1,20,.6);
27   TGraphErrors *grK0sigmaResNegHigh1pt = TStatToolkit::MakeGraphSparse( tree, "sigmaK0sResNegHigh1pt:run:eSigmaK0sResNegHigh1pt","sigmaK0sResNegHigh1pt>-900" );
28   SetGraphProperties(grK0sigmaResNegHigh1pt,"K0 sigma resolution (negative tracks, 1pt = 1)","K0 sigma resolution",1,20,.6);
29   TGraphErrors *grK0sigmaResPosLow1pt  = TStatToolkit::MakeGraphSparse( tree, "sigmaK0sResPosLow1pt:run:eSigmaK0sResPosLow1pt"  ,"sigmaK0sResPosLow1pt>-900" );
30   SetGraphProperties(grK0sigmaResPosLow1pt,"K0 sigma resolution (positive tracks, 1pt = 0)","K0 sigma resolution",1,20,.6);
31   TGraphErrors *grK0sigmaResNegLow1pt  = TStatToolkit::MakeGraphSparse( tree, "sigmaK0sResNegLow1pt:run:eSigmaK0sResNegLow1pt"  ,"sigmaK0sResNegLow1pt>-900" );
32   SetGraphProperties(grK0sigmaResNegLow1pt,"K0 sigma resolution (negative tracks, 1pt = 0)","K0 sigma resolution",1,20,.6);
33   // K0 Pull
34   // shift
35   TGraphErrors *grK0shiftPullPosHigh1pt = TStatToolkit::MakeGraphSparse( tree, "shiftK0sPullPosHigh1pt:run:eShiftK0sPullPosHigh1pt","shiftK0sPullPosHigh1pt>-900" );
36   SetGraphProperties(grK0shiftPullPosHigh1pt,"K0 shift pull (positive tracks, 1pt = 1)","K0 shift pull",1,20,.6);
37   TGraphErrors *grK0shiftPullNegHigh1pt = TStatToolkit::MakeGraphSparse( tree, "shiftK0sPullNegHigh1pt:run:eShiftK0sPullNegHigh1pt","shiftK0sPullNegHigh1pt>-900" );
38   SetGraphProperties(grK0shiftPullNegHigh1pt,"K0 shift pull (negative tracks, 1pt = 1)","K0 shift pull",1,20,.6);
39   TGraphErrors *grK0shiftPullPosLow1pt  = TStatToolkit::MakeGraphSparse( tree, "shiftK0sPullPosLow1pt:run:eShiftK0sPullPosLow1pt"  ,"shiftK0sPullPosLow1pt>-900" );
40   SetGraphProperties(grK0shiftPullPosLow1pt,"K0 shift pull (positive tracks, 1pt = 0)","K0 shift pull",1,20,.6);
41   TGraphErrors *grK0shiftPullNegLow1pt  = TStatToolkit::MakeGraphSparse( tree, "shiftK0sPullNegLow1pt:run:eShiftK0sPullNegLow1pt"  ,"shiftK0sPullNegLow1pt>-900" );
42   SetGraphProperties(grK0shiftPullNegLow1pt,"K0 shift pull (negative tracks, 1pt = 0)","K0 shift pull",1,20,.6);
43   // sigma
44   TGraphErrors *grK0sigmaPullPosHigh1pt = TStatToolkit::MakeGraphSparse( tree, "sigmaK0sPullPosHigh1pt:run:eSigmaK0sPullPosHigh1pt","sigmaK0sPullPosHigh1pt>-900" );
45   SetGraphProperties(grK0sigmaPullPosHigh1pt,"K0 sigma pull (positive tracks, 1pt = 1)","K0 sigma pull",1,20,.6);
46   TGraphErrors *grK0sigmaPullNegHigh1pt = TStatToolkit::MakeGraphSparse( tree, "sigmaK0sPullNegHigh1pt:run:eSigmaK0sPullNegHigh1pt","sigmaK0sPullNegHigh1pt>-900" );
47   SetGraphProperties(grK0sigmaPullNegHigh1pt,"K0 sigma pull (negative tracks, 1pt = 1)","K0 sigma pull",1,20,.6);
48   TGraphErrors *grK0sigmaPullPosLow1pt  = TStatToolkit::MakeGraphSparse( tree, "sigmaK0sPullPosLow1pt:run:eSigmaK0sPullPosLow1pt"  ,"sigmaK0sPullPosLow1pt>-900" );
49   SetGraphProperties(grK0sigmaPullPosLow1pt,"K0 sigma pull (positive tracks, 1pt = 0)","K0 sigma pull",1,20,.6);
50   TGraphErrors *grK0sigmaPullNegLow1pt  = TStatToolkit::MakeGraphSparse( tree, "sigmaK0sPullNegLow1pt:run:eSigmaK0sPullNegLow1pt"  ,"sigmaK0sPullNegLow1pt>-900" );
51   SetGraphProperties(grK0sigmaPullNegLow1pt,"K0 sigma pull (negative tracks, 1pt = 0)","K0 sigma pull",1,20,.6);
52
53   //DCAr Res
54   // TPC+ITS combined
55   TGraphErrors *grDCArResCombinedLow1pt   = TStatToolkit::MakeGraphSparse( tree, "dcaRresCombinedLow1pt:run:edcaRresCombinedLow1pt","dcaRresCombinedLow1pt>-900" );
56   SetGraphProperties(grDCArResCombinedLow1pt,"DCAr res (TPC+ITS combined tracking, 1pt = 0)","DCAr res",1,20,.6);
57   TGraphErrors *grDCArResCombinedHigh1pt  = TStatToolkit::MakeGraphSparse( tree, "dcaRresCombinedHigh1pt:run:edcaRresCombinedHigh1pt","dcaRresCombinedHigh1pt>-900" );
58   SetGraphProperties(grDCArResCombinedHigh1pt,"DCAr res (TPC+ITS combined tracking, 1pt = 1)","DCAr res",1,20,.6);
59   // TPC only
60   TGraphErrors *grDCArResTPCAsideLow1pt   = TStatToolkit::MakeGraphSparse( tree, "dcaRresTPCAsideLow1pt:run:edcaRresTPCAsideLow1pt","dcaRresTPCAsideLow1pt>-900" );
61   SetGraphProperties(grDCArResTPCAsideLow1pt,"DCAr res (TPC only tracking Aside, 1pt = 0)","DCAr res",1,20,.6);
62   TGraphErrors *grDCArResTPCAsideHigh1pt  = TStatToolkit::MakeGraphSparse( tree, "dcaRresTPCAsideHigh1pt:run:edcaRresTPCAsideHigh1pt","dcaRresTPCAsideHigh1pt>-900" );
63   SetGraphProperties(grDCArResTPCAsideHigh1pt,"DCAr res (TPC only tracking Aside, 1pt = 1)","DCAr res",1,20,.6);
64   TGraphErrors *grDCArResTPCCsideLow1pt   = TStatToolkit::MakeGraphSparse( tree, "dcaRresTPCCsideLow1pt:run:edcaRresTPCCsideLow1pt","dcaRresTPCCsideLow1pt>-900" );
65   SetGraphProperties(grDCArResTPCCsideLow1pt,"DCAr res (TPC only tracking Cside, 1pt = 0)","DCAr res",1,20,.6);
66   TGraphErrors *grDCArResTPCCsideHigh1pt  = TStatToolkit::MakeGraphSparse( tree, "dcaRresTPCCsideHigh1pt:run:edcaRresTPCCsideHigh1pt","dcaRresTPCCsideHigh1pt>-900" );
67   SetGraphProperties(grDCArResTPCCsideHigh1pt,"DCAr res (TPC only tracking Cside, 1pt = 1)","DCAr res",1,20,.6);
68   //DCAr Pull
69   // TPC+ITS combined
70   TGraphErrors *grDCArPullCombinedLow1pt  = TStatToolkit::MakeGraphSparse( tree, "dcaRpullCombinedLow1pt:run:edcaRpullCombinedLow1pt","dcaRpullCombinedLow1pt>-900" );
71   SetGraphProperties(grDCArPullCombinedLow1pt,"DCAr pull (TPC+ITS combined tracking, 1pt = 0)","DCAr pull",1,20,.6);
72   TGraphErrors *grDCArPullCombinedHigh1pt = TStatToolkit::MakeGraphSparse( tree, "dcaRpullCombinedHigh1pt:run:edcaRpullCombinedHigh1pt","dcaRpullCombinedHigh1pt>-900" );
73   SetGraphProperties(grDCArPullCombinedHigh1pt,"DCAr pull (TPC+ITS combined tracking, 1pt = 1)","DCAr pull",1,20,.6);
74   // TPC only
75   TGraphErrors *grDCArPullTPCAsideLow1pt  = TStatToolkit::MakeGraphSparse( tree, "dcaRpullTPCAsideLow1pt:run:edcaRpullTPCAsideLow1pt","dcaRpullTPCAsideLow1pt>-900" );
76   SetGraphProperties(grDCArPullTPCAsideLow1pt,"DCAr pull (TPC only tracking Aside, 1pt = 0)","DCAr pull",1,20,.6);
77   TGraphErrors *grDCArPullTPCAsideHigh1pt = TStatToolkit::MakeGraphSparse( tree, "dcaRpullTPCAsideHigh1pt:run:edcaRpullTPCAsideHigh1pt","dcaRpullTPCAsideHigh1pt>-900" );
78   SetGraphProperties(grDCArPullTPCAsideHigh1pt,"DCAr pull (TPC only tracking Aside, 1pt = 1)","DCAr pull",1,20,.6);
79   TGraphErrors *grDCArPullTPCCsideLow1pt  = TStatToolkit::MakeGraphSparse( tree, "dcaRpullTPCCsideLow1pt:run:edcaRpullTPCCsideLow1pt","dcaRpullTPCCsideLow1pt>-900" );
80   SetGraphProperties(grDCArPullTPCCsideLow1pt,"DCAr pull (TPC only tracking Cside, 1pt = 0)","DCAr pull",1,20,.6);
81   TGraphErrors *grDCArPullTPCCsideHigh1pt = TStatToolkit::MakeGraphSparse( tree, "dcaRpullTPCCsideHigh1pt:run:edcaRpullTPCCsideHigh1pt","dcaRpullTPCCsideHigh1pt>-900" );
82   SetGraphProperties(grDCArPullTPCCsideHigh1pt,"DCAr pull (TPC only tracking Cside, 1pt = 1)","DCAr pull",1,20,.6);
83
84   //qoverpt Shift
85   // Sin part
86   //Aside
87   TGraphErrors *grqptShiftCombinedSinAside  = TStatToolkit::MakeGraphSparse( tree, "qptShiftCombinedSinAside:run:eqptShiftCombinedSinAside","qptShiftCombinedSinAside>-900" );
88   SetGraphProperties(grqptShiftCombinedSinAside,"qpt shift sin part combined tracking Aside","sin part",1,20,.6);
89   TGraphErrors *grqptShiftTPCconstSinAside  = TStatToolkit::MakeGraphSparse( tree, "qptShiftTPCconstSinAside:run:eqptShiftTPCconstSinAside","qptShiftTPCconstSinAside>-900" );
90   SetGraphProperties(grqptShiftTPCconstSinAside,"qpt shift sin part TPCconstrained Aside","sin part",1,20,.6);
91   TGraphErrors *grqptShiftTPConlySinAside   = TStatToolkit::MakeGraphSparse( tree, "qptShiftTPConlySinAside:run:eqptShiftTPConlySinAside","qptShiftTPConlySinAside>-900" );
92   SetGraphProperties(grqptShiftTPConlySinAside,"qpt shift sin part TPConly Aside","sin part",1,20,.6);
93   //Cside
94   TGraphErrors *grqptShiftCombinedSinCside  = TStatToolkit::MakeGraphSparse( tree, "qptShiftCombinedSinCside:run:eqptShiftCombinedSinCside","qptShiftCombinedSinCside>-900" );
95   SetGraphProperties(grqptShiftCombinedSinCside,"qpt shift sin part combined tracking Cside","sin part",1,20,.6);
96   TGraphErrors *grqptShiftTPCconstSinCside  = TStatToolkit::MakeGraphSparse( tree, "qptShiftTPCconstSinCside:run:eqptShiftTPCconstSinCside","qptShiftTPCconstSinCside>-900" );
97   SetGraphProperties(grqptShiftTPCconstSinCside,"qpt shift sin part TPCconstrained Cside","sin part",1,20,.6);
98   TGraphErrors *grqptShiftTPConlySinCside   = TStatToolkit::MakeGraphSparse( tree, "qptShiftTPConlySinCside:run:eqptShiftTPConlySinCside","qptShiftTPConlySinCside>-900" );
99   SetGraphProperties(grqptShiftTPConlySinAside,"qpt shift sin part TPConly Aside","sin part",1,20,.6);
100   // Cos part
101   //Aside
102   TGraphErrors *grqptShiftCombinedCosAside  = TStatToolkit::MakeGraphSparse( tree, "qptShiftCombinedCosAside:run:eqptShiftCombinedCosAside","qptShiftCombinedCosAside>-900" );
103   SetGraphProperties(grqptShiftCombinedCosAside,"qpt shift cos part combined tracking Aside","cos part",1,20,.6);
104   TGraphErrors *grqptShiftTPCconstCosAside  = TStatToolkit::MakeGraphSparse( tree, "qptShiftTPCconstCosAside:run:eqptShiftTPCconstCosAside","qptShiftTPCconstCosAside>-900" );
105   SetGraphProperties(grqptShiftTPCconstCosAside,"qpt shift cos part TPCconstrained Aside","cos part",1,20,.6);
106   TGraphErrors *grqptShiftTPConlyCosAside   = TStatToolkit::MakeGraphSparse( tree, "qptShiftTPConlyCosAside:run:eqptShiftTPConlyCosAside","qptShiftTPConlyCosAside>-900" );
107   SetGraphProperties(grqptShiftTPConlyCosAside,"qpt shift cos part TPConly Aside","cos part",1,20,.6);
108   //Cside
109   TGraphErrors *grqptShiftCombinedCosCside  = TStatToolkit::MakeGraphSparse( tree, "qptShiftCombinedCosCside:run:eqptShiftCombinedCosCside","qptShiftCombinedCosCside>-900" );
110   SetGraphProperties(grqptShiftCombinedCosCside,"qpt shift cos part combined tracking Cside","cos part",1,20,.6);
111   TGraphErrors *grqptShiftTPCconstCosCside  = TStatToolkit::MakeGraphSparse( tree, "qptShiftTPCconstCosCside:run:eqptShiftTPCconstCosCside","qptShiftTPCconstCosCside>-900" );
112   SetGraphProperties(grqptShiftTPCconstCosCside,"qpt shift cos part TPCconstrained Cside","cos part",1,20,.6);
113   TGraphErrors *grqptShiftTPConlyCosCside   = TStatToolkit::MakeGraphSparse( tree, "qptShiftTPConlyCosCside:run:eqptShiftTPConlyCosCside","qptShiftTPConlyCosCside>-900" );
114   SetGraphProperties(grqptShiftTPConlyCosCside,"qpt shift cos part TPConly Cside","cos part",1,20,.6);
115
116   //delta Phi
117   // res
118   //Aside
119   TGraphErrors *grdPhiResTPCAsideLow1pt  = TStatToolkit::MakeGraphSparse( tree, "dPhiResTPCAsideLow1pt:run:edPhiResTPCAsideLow1pt","dPhiResTPCAsideLow1pt>-900" );
120   SetGraphProperties(grdPhiResTPCAsideLow1pt,"delta Phi resolution (Aside, 1pt = 0)","phi res",1,20,.6);
121   TGraphErrors *grdPhiResTPCAsideHigh1pt = TStatToolkit::MakeGraphSparse( tree, "dPhiResTPCAsideHigh1pt:run:edPhiResTPCAsideHigh1pt","dPhiResTPCAsideHigh1pt>-900" );
122   SetGraphProperties(grdPhiResTPCAsideHigh1pt,"delta Phi resolution (Aside, 1pt = 1)","phi res",1,20,.6);
123   //Cside
124   TGraphErrors *grdPhiResTPCCsideLow1pt  = TStatToolkit::MakeGraphSparse( tree, "dPhiResTPCCsideLow1pt:run:edPhiResTPCCsideLow1pt","dPhiResTPCCsideLow1pt>-900" );
125   SetGraphProperties(grdPhiResTPCCsideLow1pt,"delta Phi resolution (Cside, 1pt = 0)","phi res",1,20,.6);
126   TGraphErrors *grdPhiResTPCCsideHigh1pt = TStatToolkit::MakeGraphSparse( tree, "dPhiResTPCCsideHigh1pt:run:edPhiResTPCCsideHigh1pt","dPhiResTPCCsideHigh1pt>-900" );
127   SetGraphProperties(grdPhiResTPCCsideHigh1pt,"delta Phi resolution (Cside, 1pt = 1)","phi res",1,20,.6);
128   // pull
129   //Aside
130   TGraphErrors *grdPhiPullTPCAsideLow1pt  = TStatToolkit::MakeGraphSparse( tree, "dPhiPullTPCAsideLow1pt:run:edPhiPullTPCAsideLow1pt","dPhiPullTPCAsideLow1pt>-900" );
131   SetGraphProperties(grdPhiPullTPCAsideLow1pt,"delta Phi pull (Aside, 1pt = 0)","phi pull",1,20,.6);
132   TGraphErrors *grdPhiPullTPCAsideHigh1pt = TStatToolkit::MakeGraphSparse( tree, "dPhiPullTPCAsideHigh1pt:run:edPhiPullTPCAsideHigh1pt","dPhiPullTPCAsideHigh1pt>-900" );
133   SetGraphProperties(grdPhiPullTPCAsideHigh1pt,"delta Phi pull (Aside, 1pt = 1)","phi pull",1,20,.6);
134   //Cside
135   TGraphErrors *grdPhiPullTPCCsideLow1pt  = TStatToolkit::MakeGraphSparse( tree, "dPhiPullTPCCsideLow1pt:run:edPhiPullTPCCsideLow1pt","dPhiPullTPCCsideLow1pt>-900" );
136   SetGraphProperties(grdPhiPullTPCCsideLow1pt,"delta Phi pull (Cside, 1pt = 0)","phi pull",1,20,.6);
137   TGraphErrors *grdPhiPullTPCCsideHigh1pt = TStatToolkit::MakeGraphSparse( tree, "dPhiPullTPCCsideHigh1pt:run:edPhiPullTPCCsideHigh1pt","dPhiPullTPCCsideHigh1pt>-900" );
138   SetGraphProperties(grdPhiPullTPCCsideHigh1pt,"delta Phi pull (Cside, 1pt = 1)","phi pull",1,20,.6);
139
140   // TPCITS matching Efficiency
141   TGraphErrors *grEfficiencyLowPt   = TStatToolkit::MakeGraphSparse( tree, "EfficiencyLowPt:run:eEfficiencyLowPt","EfficiencyLowPt>-900" );
142   SetGraphProperties(grEfficiencyLowPt,"TPCITS matching Efficiency (p_{T} < 1 GeV)","Efficiency",1,20,.6);
143   grEfficiencyLowPt->GetYaxis()->SetRangeUser(0.,1.1);
144   TGraphErrors *grEfficiencyHighPt  = TStatToolkit::MakeGraphSparse( tree, "EfficiencyHighPt:run:eEfficiencyHighPt","EfficiencyHighPt>-900" );
145   SetGraphProperties(grEfficiencyHighPt,"TPCITS matching Efficiency (p_{T} > 4 GeV)","Efficiency",1,20,.6);
146   grEfficiencyHighPt->GetYaxis()->SetRangeUser(0.,1.1);
147
148
149
150   if(grK0shiftResPosHigh1pt     ) DrawAndSave( grK0shiftResPosHigh1pt,     "K0shiftResPosHigh1pt"    );
151   if(grK0shiftResNegHigh1pt     ) DrawAndSave( grK0shiftResNegHigh1pt,     "K0shiftResNegHigh1pt"    );
152   if(grK0shiftResPosLow1pt      ) DrawAndSave( grK0shiftResPosLow1pt,      "K0shiftResPosLow1pt"     );
153   if(grK0shiftResNegLow1pt      ) DrawAndSave( grK0shiftResNegLow1pt,      "K0shiftResNegLow1pt"     );
154   if(grK0sigmaResPosHigh1pt     ) DrawAndSave( grK0sigmaResPosHigh1pt,     "K0sigmaResPosHigh1pt"    );
155   if(grK0sigmaResNegHigh1pt     ) DrawAndSave( grK0sigmaResNegHigh1pt,     "K0sigmaResNegHigh1pt"    );
156   if(grK0sigmaResPosLow1pt      ) DrawAndSave( grK0sigmaResPosLow1pt,      "K0sigmaResPosLow1pt"     );
157   if(grK0sigmaResNegLow1pt      ) DrawAndSave( grK0sigmaResNegLow1pt,      "K0sigmaResNegLow1pt"     );
158   if(grK0shiftPullPosHigh1pt    ) DrawAndSave( grK0shiftPullPosHigh1pt,    "K0shiftPullPosHigh1pt"   );
159   if(grK0shiftPullNegHigh1pt    ) DrawAndSave( grK0shiftPullNegHigh1pt,    "K0shiftPullNegHigh1pt"   );
160   if(grK0shiftPullPosLow1pt     ) DrawAndSave( grK0shiftPullPosLow1pt,     "K0shiftPullPosLow1pt"    );
161   if(grK0shiftPullNegLow1pt     ) DrawAndSave( grK0shiftPullNegLow1pt,     "K0shiftPullNegLow1pt"    );
162   if(grK0sigmaPullPosHigh1pt    ) DrawAndSave( grK0sigmaPullPosHigh1pt,    "K0sigmaPullPosHigh1pt"   );
163   if(grK0sigmaPullNegHigh1pt    ) DrawAndSave( grK0sigmaPullNegHigh1pt,    "K0sigmaPullNegHigh1pt"   );
164   if(grK0sigmaPullPosLow1pt     ) DrawAndSave( grK0sigmaPullPosLow1pt,     "K0sigmaPullPosLow1pt"    );
165   if(grK0sigmaPullNegLow1pt     ) DrawAndSave( grK0sigmaPullNegLow1pt,     "K0sigmaPullNegLow1pt"    );
166   if(grDCArResCombinedLow1pt    ) DrawAndSave( grDCArResCombinedLow1pt,    "DCArResCombinedLow1pt"   );
167   if(grDCArResCombinedHigh1pt   ) DrawAndSave( grDCArResCombinedHigh1pt,   "DCArResCombinedHigh1pt"  );
168   if(grDCArResTPCAsideLow1pt    ) DrawAndSave( grDCArResTPCAsideLow1pt,    "DCArResTPCAsideLow1pt"   );
169   if(grDCArResTPCAsideHigh1pt   ) DrawAndSave( grDCArResTPCAsideHigh1pt,   "DCArResTPCAsideHigh1pt"  );
170   if(grDCArResTPCCsideLow1pt    ) DrawAndSave( grDCArResTPCCsideLow1pt,    "DCArResTPCCsideLow1pt"   );
171   if(grDCArResTPCCsideHigh1pt   ) DrawAndSave( grDCArResTPCCsideHigh1pt,   "DCArResTPCCsideHigh1pt"  );
172   if(grDCArPullCombinedLow1pt   ) DrawAndSave( grDCArPullCombinedLow1pt,   "DCArPullCombinedLow1pt"  );
173   if(grDCArPullCombinedHigh1pt  ) DrawAndSave( grDCArPullCombinedHigh1pt,  "DCArPullCombinedHigh1pt" );
174   if(grDCArPullTPCAsideLow1pt   ) DrawAndSave( grDCArPullTPCAsideLow1pt,   "DCArPullTPCAsideLow1pt"  );
175   if(grDCArPullTPCAsideHigh1pt  ) DrawAndSave( grDCArPullTPCAsideHigh1pt,  "DCArPullTPCAsideHigh1pt" );
176   if(grDCArPullTPCCsideLow1pt   ) DrawAndSave( grDCArPullTPCCsideLow1pt,   "DCArPullTPCCsideLow1pt"  );
177   if(grDCArPullTPCCsideHigh1pt  ) DrawAndSave( grDCArPullTPCCsideHigh1pt,  "DCArPullTPCCsideHigh1pt" );
178   if(grqptShiftCombinedSinAside ) DrawAndSave( grqptShiftCombinedSinAside, "qptShiftCombinedSinAside");
179   if(grqptShiftTPCconstSinAside ) DrawAndSave( grqptShiftTPCconstSinAside, "qptShiftTPCconstSinAside");
180   if(grqptShiftTPConlySinAside  ) DrawAndSave( grqptShiftTPConlySinAside,  "qptShiftTPConlySinAside" );
181   if(grqptShiftCombinedSinCside ) DrawAndSave( grqptShiftCombinedSinCside, "qptShiftCombinedSinCside");
182   if(grqptShiftTPCconstSinCside ) DrawAndSave( grqptShiftTPCconstSinCside, "qptShiftTPCconstSinCside");
183   if(grqptShiftTPConlySinCside  ) DrawAndSave( grqptShiftTPConlySinCside,  "qptShiftTPConlySinCside" );
184   if(grqptShiftCombinedCosAside ) DrawAndSave( grqptShiftCombinedCosAside, "qptShiftCombinedCosAside");
185   if(grqptShiftTPCconstCosAside ) DrawAndSave( grqptShiftTPCconstCosAside, "qptShiftTPCconstCosAside");
186   if(grqptShiftTPConlyCosAside  ) DrawAndSave( grqptShiftTPConlyCosAside,  "qptShiftTPConlyCosAside" );
187   if(grqptShiftCombinedCosCside ) DrawAndSave( grqptShiftCombinedCosCside, "qptShiftCombinedCosCside");
188   if(grqptShiftTPCconstCosCside ) DrawAndSave( grqptShiftTPCconstCosCside, "qptShiftTPCconstCosCside");
189   if(grqptShiftTPConlyCosCside  ) DrawAndSave( grqptShiftTPConlyCosCside,  "qptShiftTPConlyCosCside" );
190   if(grdPhiResTPCAsideLow1pt    ) DrawAndSave( grdPhiResTPCAsideLow1pt,    "dPhiResTPCAsideLow1pt"   );
191   if(grdPhiResTPCAsideHigh1pt   ) DrawAndSave( grdPhiResTPCAsideHigh1pt,   "dPhiResTPCAsideHigh1pt"  );
192   if(grdPhiResTPCCsideLow1pt    ) DrawAndSave( grdPhiResTPCCsideLow1pt,    "dPhiResTPCCsideLow1pt"   );
193   if(grdPhiResTPCCsideHigh1pt   ) DrawAndSave( grdPhiResTPCCsideHigh1pt,   "dPhiResTPCCsideHigh1pt"  );
194   if(grdPhiPullTPCAsideLow1pt   ) DrawAndSave( grdPhiPullTPCAsideLow1pt,   "dPhiPullTPCAsideLow1pt"  );
195   if(grdPhiPullTPCAsideHigh1pt  ) DrawAndSave( grdPhiPullTPCAsideHigh1pt,  "dPhiPullTPCAsideHigh1pt" );
196   if(grdPhiPullTPCCsideLow1pt   ) DrawAndSave( grdPhiPullTPCCsideLow1pt,   "dPhiPullTPCCsideLow1pt"  );
197   if(grdPhiPullTPCCsideHigh1pt  ) DrawAndSave( grdPhiPullTPCCsideHigh1pt,  "dPhiPullTPCCsideHigh1pt" );
198   if(grEfficiencyLowPt          ) DrawAndSave( grEfficiencyLowPt,          "EfficiencyLowPt"         );
199   if(grEfficiencyHighPt         ) DrawAndSave( grEfficiencyHighPt,         "EfficiencyHighPt"        );
200
201
202
203 }
204
205 void SetGraphProperties( TGraphErrors *gr, const char *title, const char *yAxisTitle, Int_t color, Int_t mStyle, Float_t mSize){
206   gr->SetTitle(title);
207   gr->GetXaxis()->SetTitle("run");
208   gr->GetYaxis()->SetTitle(yAxisTitle);
209   gr->SetMarkerStyle(mStyle);
210   gr->SetMarkerSize(mSize);
211   gr->SetLineColor(color);
212   gr->SetMarkerColor(color);
213 }
214
215 void DrawAndSave( TGraphErrors *gr, const char *name ){
216
217   TCanvas *can = new TCanvas("can","testing",1200,800);
218   can->cd();
219
220   gr->Draw("ap");
221
222   //gSystem->Exec("if [ ! -d ./TrendingPlots ] ; then mkdir -p TrendingPlots ; fi");
223
224   //can->SaveAs( Form("./TrendingPlots/%s.png", name) );
225   can->SaveAs( Form("%s.png", name) );
226
227   delete can;
228
229 }