QA Documentation
New embedding Base QA instructions
Instructions how to run the QA codes, make QA plots (pdf file) for Embedding Helpers
Last updated on Apr/19/2013 by Patrick Huck
Revised history
-
Apr/12/2011: Update NOTE in Section1
- Feb/17/2011: Update NOTE in Section1, and for checking out StAssociationMaker
-
Jan/27/2011: Update the Section 3 for some special decay daughters
-
Oct/25/2010: Added minimc reproduction in Section 1 and StAssociationMaker in Section
-
Jul/23/2010: Update the real data QA
-
-
May/14/2010: Update rapidity/trigger selections for real data
- Apr/07/2010: Update the instructions on "drawEmbeddingQA.C"
- Feb/22/2010: Added how to change the z-vertex cut and about 'isEmbeddingOnly' flag in "drawEmbeddingQA.C"
- Jan/29/2010: Update the NOTE for "doEmbeddingQAMaker" (see below)
- Jan/22/2010: Update the documentation for the latest QA code
- Sep/21/2009: Add how to plot the QA histograms in the Section 3
- Sep/18/2009: Modify codes to "StEmbeddingQA*", and macro to "doEmbeddingQAMaker.C" (Please have a look at the instructions below carefully).
- Sep/17/2009: Modify Section 2.1
- Sep/15/2009: Add new embedding QA instructions
e-mail the coordinator/deputies or embedding hyper-news if you have any questions and suggestions
Contents
-
-
-
-
IMPORTANT NOTE:
- Please make sure that you've used the latest codes/macros.
If "cvs update StRoot/StEmbeddingUtilities" and
"cvs update StRoot/macros/embedding" return nothing,
you have the latest codes in your working directory.
Sometime, I forget to send an e-mail about the update of QA codes,
Please do "cvs update" and try again if you encounter some unknown issues.
If this doesn't solve the problem, please contact me (Hiroshi).
- Check out StRoot/StEmbeddingUtilities for the embedding QA
- QA codes are supposed to work for DEV so they might be crashed in other libraries
- If the MC geantid >= 50, it is most likely the particle that is
specifically defined for the STAR simulation.
If this is the case, please check out "StRoot/StarClassLibrary"
in your local working directory and recompile.
NOTE1: From Run9, you don't need to reproduce the minimc files.
Please use the minimc produced together by the embedding productions for the base QA
NOTE1-1: Sometimes you might need to reproduce minimc even if the embedding is done for Run9
or above. Please contact production helpers, or deputies if you are not clear enough to reproduce
the minimc files
NOTE2: If the embedding production is done (1) by the library prior to SL10j and
(2) for particles with user defined geantid that is larger than 65535/2 = 32767,
the geantid in the minimc will be some negative value or compeletely different from
> cvs co StRoot/StMiniMcEvent
> cvs co StRoot/StMiniMcMaker
> cons
NOTE3: Prior to SL10j library, StTrack doesn't have "mSeedQuality" so the cons will complain
when you compile StRoot/StMiniMcMaker like
.sl53_gcc432/obj/StRoot/StMiniMcMaker/StMiniMcMaker.cxx: In member function 'void StMiniMcMaker::fillRcTrackInfo(StTinyRcTrack*, const StTrack*, const StTrack*, Int_t)':
.sl53_gcc432/obj/StRoot/StMiniMcMaker/StMiniMcMaker.cxx:1622: error: 'const class StTrack' has no member named 'seedQuality'
Please comment out the line 1622 and recompile if you see this error.
1.1 Check out the relevant codes and macros in your working directory (suppose your working directory is ${work})
> cp /eliza8/rnc/hmasui/embedding/QA/StMiniHijing.C ${work}
- If the eliza8 is down, you can also copy the macro from the link below
- The current "StMiniHijing.C" has been slightly modified from the original version
to obtain a proper minimc filename based on the input geant.root file, see line 159-162 in "StMiniHijing.C"
159 TString filename = MainFile;
160 // int fileBeginIndex = filename.Index(filePrefix,0);
161 // filename.Remove(0,fileBeginIndex);
162 filename.Remove(0, filename.Last('/')+1);
- You don't need to modify the argument "filePrefix".
> cvs co StRoot/StAssociationMaker
> cons
NOTE: If you are working for the QA under SL10j (or above), SL10c_emb, or SL10h_emb,
you don't need to check out StAssociationMaker.
Below is copy of the latest StAssociationMaker.cxx.
1.2 Run "StMiniHijing.C"
Suppose your input file is
"/eliza9/starprod/embedding/P08ie/dAu/Piplus_201_1233091546/
Piplus_st_physics_adc_9020060_raw_2060010_201/st_physics_adc_9020060_raw_2060010.geant.root"
Either
> root4star -b -q StMiniHijing.C'(1000, "/eliza9/starprod/embedding/P08ie/dAu/Piplus_201_1233091546/Piplus_st_physics_adc_9020060_raw_2060010_201/st_physics_adc_9020060_raw_2060010.geant.root", "./")'
or
> root4star -b
[0] .L StMiniHijing.C
[1] StMiniHijing(1000, "/eliza9/starprod/embedding/P08ie/dAu/Piplus_201_1233091546/Piplus_st_physics_adc_9020060_raw_2060010_201/st_physics_adc_9020060_raw_2060010.geant.root", "./");
....
....
....
[2].q
- The 1st argument is maximum number of events.
- The 2nd argument is your input geant.root file.
- The 3rd argument is your output directory. For example, if you would like to put the output into
"./output" directory, you can set the 3rd argument as "./output/".
NOTE: You must separate the outputs in different directories from different groups,
such as PiPlus_201_1233091546, PiPlus_202_1233091546 etc.
Since the filename of input geant.root's are usually identical among different groups,
you will overwrite your minimc.root if you put the minimc outputs under the same directory.
1.3 Make sure MC geantid is correct
This step is not always necessary but may help to reduce your time if we did something wrong for geantid.
Before running the QA code, you can easily check whether MC geant id is correct or not.
Suppose we have one minimc file, "st_physics_adc_9020060_raw_2060010.minimc.root" in the current directory, then you can do
> root4star st_physics_adc_9020060_raw_2060010.minimc.root
[0] StMiniMcTree->Draw("mMcTracks.mGeantId")
or
[0] StMiniMcTree->Scan("mMcTracks.mGeantId")
[1].q
Please make sure that the geant id is identical with the requested particle.
If you don't know the geantid for the requested particles, please take a look at the
manual of GEANT3, or ask other Embedding Helpers/Deputy/Coordinator.
For unstable (decay) particles, we mostly use some special geantid which was
defined for the STAR simulation only. In that case, the geantid should be
different from the original one in the GEANT manual.
2.1 Check out the QA codes from CVS
doMiniMcAnalyzer.C will be deleted from CVS sometime in a future.
QA macro
> cvs checkout StRoot/macros/embedding/doEmbeddingQAMaker.C
QA codes
> cvs checkout StRoot/StEmbeddingUtilities
2.2 Run the QA macro
2.2.1 QA for embedding outputs
Suppose you've prepared the minimc.root filelist "minimc.list"
and the output filename for your QA histograms is "embedding.root"
NOTE: you don't need to specify your input particle name (or geantid).
The QA code will automatically find out the input geant id from the minimc files.
Either
> root4star -b -q doEmbeddingQAMaker.C'(2008, "P08ie", "minimc.list", "embedding.root")'
or
> root4star -b
[0] .L doEmbeddingQAMaker.C
[1] doEmbeddingQAMaker(2008, "P08ie", "minimc.list", "embedding.root");
...
...
...
[2] .q
The details of arguments can be found in the "doEmbeddingQAMaker.C"
NOTE:
- Output file name (4th argument, in this case "embedding.root") will be
automatically detemined according to the "year", "production"
and "particle name" if you leave it blank.
The default z-vertex cut is 30cm. If you would like to change the z-vertex cut,
you can modify the 6th argument like
> roo4star -b
[0] .L doEmbeddingQAMaker.C
[1] doEmbeddingQAMaker(2008, "P08ie", "minimc.list", "", kTRUE, 60.0);
...
...
...
[2] .q
where the 5th argument is the switch to analyze embedding (kTRUE) or real data (kFALSE).
2.2.2 QA for real data
> roo4star -b
[0] .L doEmbeddingQAMaker.C
[1] doEmbeddingQAMaker(2008, "P08ie", "mudst.list", "", kFALSE);
...
...
...
[2] .q
where mudst.list is the file list for muDst.
NOTE: You must use muDst from the original production, not from embedding production.
Because the muDst's in the embedding production contain both real data tracks and embedding tracks.
Please contact POC for the location of muDst's from original production at PDSF.
2.2.3 Trigger selections and rapidity cuts for real data
In order to compare the real data with the embedding outputs with the same event and track conditions,
you may need to apply the primary z-vertex, trigger and rapidity cuts in the real data. Please find the
z-vertex cut selection in the Section 2.2.1.
- The trigger id can be also selected by
StEmbeddingQAUtilities::addTriggerIdCut(const UInt_t id)
StEmbeddingQAUtilities accept multiple trigger id's while current code assumes 1 trigger id per event,
The trigger id cut only affects the real data, not for the embedding outputs.
- You can also apply rapidity cut by
StEmbeddingQAUtilities::setRapidityCut(const Double_t ycut)
It would be good to have the same rapidity cut in the real data as the embedding production.
Please have a look at the simulation request page for rapidity cut or ask embedding helpers
what rapidity cuts they used for the productions.
You can make the QA plots by "drawEmbeddingQA.C" under "StRoot/macros/embedding".
> cvs checkout StRoot/macros/embedding/drawEmbeddingQA.C
Suppose you have output ROOT files in your current directory: "qa_embedding_2007_P08ic.root",
and "qa_real_2007_P08ic.root" (the output file format is automatically
determined like this if you leave the output filename blank in StEmbeddingQA).
> root4star -l drawEmbeddingQA.C'("./", "qa_embedding_2007_P08ic.root", "qa_real_2007_P08ic.root", 8, 10.0)'
First argument is the directory where the output PDF file is printed.
The default output directory is the current directory.
The fourth argument is the geantid that you want to look at. Actually, the code will try to find out
the geantid from the output histograms including the decay daughters so it doesn't matter if you put the wrong geantid.
NOTE: I recommend to produce the output ROOT files for QA histograms as described above
i.e. produce outputs without specifying the output filename in StEmbeddingQA
Otherwise you have to put the year, production and particle name by had as you'll see below (Hiroshi)
The fifth argument is the maximum pt cut off (GeV/c) for all histograms.
The default pt cut off is 5 GeV/c. If the requested maximum pt is different from 5, then you need to
put another value, in this case 10 GeV/c, in this argument.
You can now check the QA histograms from embedding outputs only by
> root4star -l drawEmbeddingQA.C'("./", "qa_embedding_2007_P08ic.root", "qa_real_2007_P08ic.root", 8, 10.0, kTRUE)'
where the last argument 'isEmbeddingOnly' (default is kFALSE) is the switch
to draw the QA histograms for embedding outputs only if it is true.
If you name the output ROOT files by hand, you need to put the year and
production by yourself since those are used
for the output figure name and to print those informations in
the legend for each QA plot.
Suppose you have output ROOT files in your current directory: "qa_embedding.root" and "qa_real.root"
> root4star -l drawEmbeddingQA.C'("./", "qa_embedding.root", "qa_real.root", 2005, "P08ic", 8, 10.0, kFALSE)'
where there are additional arguments "2005" and "P08ic" in the 5th and 6th arguments.
The arguments are basically the same compared to previous example, except for the input filename's.
NOTE:
- In this case, you have to put all arguments by hand (no default arguments in the function)
- You may notice that the order of arguments are slightly different from the example above.
This should be fine since we define the two functions "drawEmbeddingQA" with the same
function name but different arguments in "drawEmbeddingQA.C" (you can directly check the macro how it works)
If you are going to do the base QA for the daughter particles produced by one of the daughter from input MC,
for example "D* -> D0 -> pi K", we have to specify the geantid for D0 in the macro like
> root4star -l drawEmbeddingQA.C'("./", "qa_embedding_2007_P08ic.root", "qa_real_2007_P08ic.root", 8, 10, kFALSE, 37)'
where the last argument (37) is the D0 geantid. The relevant function to set parent geant id can be
found in the drawEmbeddingQA.C
maker->setParentGeantId(parentGeantId) ;
NOTE: Omegas are labelled as Ant-Omegas and vice versa. This is a known issue due to
the wrong Geant Ids for those two particles in STAR libaries SL13b and earlier. Future updates
of these libraries might fix it. For now, it has not been considered necessary to update all
embedding libraries to fix this issue. Please take note of this in all presentations regarding
(Anti-)Omega embedding.
End of New embedding QA instructions
------------------------------------------------------------------------------------
This document is intended to describe the macros used during the quality assurance(Q/A) studies. This page is being updated today April 19 2009
* Macro : scan_embed_mc.C
After knowing the location of the minimc.root files use this macro to generate and output files with extension .root, in which all the histogramas for a basic QA had been filled. New histogramas had been added, ofr instacne a 3D histogram for Dca (pt, eta, dca) will give the distribution of dca as a function of pt and eta simultaneously. Same is done for the number of fit points (pr, eta, nfit). Also histograms to evaluate the randomness of the embedding files had been added to this macro.
* Macros: scan_embed_mudst.C
This macro hopefully you won't have to use it unless is requested. This macro is meant to generate and output root file with distributions coming from the MuDst (MuDst from Lidia) for a particular production. You will need just the location of the output file.
* Macro : plot_embed.C
This macro will take both outputs ( the one coming from minimc and that one coming from MuDst) and plot all the basic qa distributions for a particular production.
Hit Level
At the hit level, this is the documentation:
* StEmbedHitsMaker.C
* doEmbedHits.C
* ScanHits.C
* PlotHits.C
See below the links for these macros
Plot_embed
<code>
//First run scan_embed.C to generate root file with all the histograms
// V. May 31 2007 - Cristina
#ifndef __CINT__
#include "TROOT.h"
#include "TSystem.h"
#include <iostream.h>
#include "TH1.h"
#include "TH2.h"
#include "TH3.h"
#include "TFile.h"
#include "TTree.h"
#include "TChain.h"
#include "TTreeHelper.h"
#include "TText.h"
#include "TLatex.h"
#include "TAttLine.h"
#include "TCanvas.h"
#endif
void plot_embed(Int_t id=9) {
gROOT->LoadMacro("~/macros/Utility.C"); //location of Utility.C
gStyle->SetOptStat(1);
//gStyle->SetOptTitle(0);
gStyle->SetOptDate(0);
gStyle->SetOptFit(0);
gStyle->SetPalette(1);
float mass2;
if (id == 8) { TString tag = "Piplus"; mass2 = 0.019;}
if (id == 9) { TString tag = "Piminus"; mass2 = 0.019;}
if (id == 11) { TString tag = "Kplus"; mass2 = 0.245;}
if (id == 12) { TString tag = "Kminus"; mass2 = 0.245;}
if (id == 14) { TString tag = "Proton"; mass2 = 0.880;}
if (id == 15) { TString tag = "Pbar"; mass2 = 0.880;}
if (id == 50) { TString tag = "Phi"; mass2 = 1.020;}
if (id == 2) { TString tag = "Eplus"; mass2 = 0.511;}
if (id == 1) { TString tag = "Dmeson"; mass2 = 1.864;}
char text1[80];
sprintf(text1,"P05_CuCu200_01_02_08");//this is going to show in all the histograms
char title[100],
char gif[100];
TString prod = "P05_CuCu200_01_02_08";
int nch1 = 0;
int nch2 = 1000;
/////////////////////////////////////////////////
//Cloning Histograms
/////////////////////////////////////////////////
f1 = new TFile ("~/data/P05_CuCu200_010208.root");
TH3D *hDca1 = (TH3D*)hDca -> Clone("hDca1");//DCA
TH3D *hNfit1 = (TH3D*)hNfit -> Clone("hNFit1");//Nfit
TH2D *hPtM_E1 = (TH2D*)hPtM_E -> Clone("hPtM_E1");//Energy Loss
TH2D *dedx1 = (TH2D*)dedx -> Clone("dedx1");
TH2D *dedxG1 = (TH2D*)dedxG -> Clone("dedxG1");
TH2D *vxy1 = (TH2D*)vxy -> Clone("vxy1");
TH1D *vz1 = (TH1D*)vz -> Clone("vz1");
TH1D *dvx1 = (TH1D*)dvx -> Clone("dvx1");
TH1D *dvy1 = (TH1D*)dvy -> Clone("dvy1");
TH1D *dvz1 = (TH1D*)dvz -> Clone("dvz1");
TH1D *PhiMc1 = (TH1D*)PhiMc -> Clone("PhiMc1");
TH1D *EtaMc1 = (TH1D*)EtaMc -> Clone("EtaMc1");
TH1D *PtMc1 = (TH1D*)PtMc -> Clone("PtMc1");
TH1D *PhiM1 = (TH1D*)PhiM -> Clone("PhiM1");
TH1D *EtaM1 = (TH1D*)EtaM -> Clone("EtaM1");
TH1D *PtM1 = (TH1D*)PtM -> Clone("PtM1");
TH2D *PtM_eff1 = (TH2D*)hPtM_eff ->Clone("PtM_eff1");//efficiency
//if you have MuDst hist
TH3D *hDca1r = (TH3D*)hDcaR -> Clone("hDca1r");
TH3D *hNfit1r = (TH3D*)hNfitR -> Clone("hNFit1r");
TH2D *dedx1R = (TH2D*)dedxR -> Clone("dedx1R");
/*
//use the following if you need to compare
f2 = new TFile ("~/data/test_P07ib_pi_10percent_10_03_07.root");
TH2D *PtM_eff2 = (TH2D*)hPtM_eff ->Clone("PtM_eff2");
TH3D *hNfit2 = (TH3D*)hNfit -> Clone("hNFit2");//Nfit
TH1D *PtM2 = (TH1D*)PtM -> Clone("PtM2");
TH1D *PtMc2 = (TH1D*)PtMc -> Clone("PtMc2");
f3 = new TFile ("~/data/test_P07ib_pi_10percent_10_12_07.root");
TH3D *hNfit3 = (TH3D*)hNfit -> Clone("hNFit3");//Nfit
TH2D *PtM_eff3 = (TH2D*)hPtM_eff ->Clone("PtM_eff3");
TH1D *PtM3 = (TH1D*)PtM -> Clone("PtM3");
TH1D *PtMc3 = (TH1D*)PtMc -> Clone("PtMc3");
*/
int nch1 = 0;
int nch2 = 1000;
Double_t pt[4]= {0.3,0.4, 0.5, 0.6};
////////////////////////////////////////////////////////////
//efficiency
/////////////////////////////////////////////////////////////
/*
TCanvas *c10= new TCanvas("c10","Efficiency",500, 500);
c10->SetGridx(0);
c10->SetGridy(0);
c10->SetLeftMargin(0.15);
c10->SetRightMargin(0.05);
//c10->SetTitleOffSet(0.1, "Y");
c10->cd;
PtM1->Rebin(2);
PtMc1->Rebin(2);
PtM1->Divide(PtMc1);
PtM1->SetLineColor(1);
PtM1->SetMarkerStyle(23);
PtM1->SetMarkerColor(1);
PtM1->Draw();
PtM1->SetXTitle ("pT (GeV/c)");
PtM1->SetAxisRange(0.0, 6.0, "X");
return;
/*
PtM2->Rebin(2);
PtMc2->Rebin(2);
PtM2->Divide(PtMc2);
PtM2->SetLineColor(9);
PtM2->SetMarkerStyle(21);
PtM2->SetMarkerColor(9);
PtM2->Draw("same");
PtM3->Rebin(2);
PtMc3->Rebin(2);
PtM3->Divide(PtMc2);
PtM3->SetLineColor(2);
PtM3->SetMarkerStyle(22);
PtM3->SetMarkerColor(2);
PtM3->Draw("same");
keySymbol(0.08, 1.0, text1, 1, 23, 0.04);
/////////////////////////////////////////////////////////////
//Vertex position
//////////////////////////////////////////////////////////
TCanvas *c6= new TCanvas("c6","Vertex position",600, 400);
c6->Divide(2,1);
c6_1->cd();
vz1->Rebin(2);
vz1->SetXTitle("Vertex Z");
vz1->Draw();
c6_2->cd();
vxy1->Draw("colz");
vxy1->SetAxisRange(-1.5, 1.5, "X");
vxy1->SetAxisRange(-1.5, 1.5, "Y");
vxy1->SetXTitle ("vertex X");
vxy1->SetYTitle ("vertex Y");
keyLine(.2, 1.05,text1,1);
c6->Update();
/////////////////////////////////////////////////////////////////////
//Dedx
////////////////////////////////////////////////////////////////////
TCanvas *c8= new TCanvas("c8","dEdx vs P",500, 500);
c8->SetGridx(0);
c8->SetGridy(0);
c8->SetLeftMargin(0.15);
c8->SetRightMargin(0.05);
c8->cd;
dedxG1->SetXTitle("Momentum P (GeV/c)");
dedxG1->SetYTitle("dE/dx");
dedxG1->SetAxisRange(0, 5., "X");
dedxG1->SetAxisRange(0, 8., "Y");
dedxG1->SetMarkerColor(1);
dedxG1->Draw();//"colz");
dedx1->SetMarkerStyle(7);
dedx1->SetMarkerSize(0.3);
dedx1->SetMarkerColor(2);
dedx1->Draw("same");
keyLine(.3, 0.87,"Embedded Tracks",2);
keyLine(.3, 0.82,"Ghost Tracks",1);
keyLine(.2, 1.05,text1,1);
c8->Update();
/////////////////////////////////////////////////////
//MIPS (just for pions)
/////////////////////////////////////////////////////
if (id==8 || id==9)
{
TCanvas *c9= new TCanvas("c9","MIPS",500, 500);
c9->SetGridx(0);
c9->SetGridy(0);
c9->SetLeftMargin(0.15);
c9->SetRightMargin(0.05);
c9->cd;
double pt1 = 0.4;
double pt2 = 0.6;
dedxG1 -> ProjectionX("rpx");
int blG = rpx->FindBin(pt1);
int bhG = rpx->FindBin(pt2);
cout<<blG<<endl;
cout<<bhG<<endl;
dedxG1->ProjectionY("rpy",blG,bhG);
rpy->SetTitle("MIPS");
rpy->SetMarkerStyle(22);
// rpy->SetMarkerColor(2);
rpy->SetAxisRange(1.3, 4, "X");
//dedxG1->Draw();
dedx1->ProjectionX("mpx");
int blm = mpx->FindBin(pt1);
int bhm = mpx->FindBin(pt2);
cout<<blm<<endl;
cout<<bhm<<endl;
dedx1->ProjectionY("mpy", blm,bhm);
mpy->SetAxisRange(0.5, 6, "X");
mpy->SetMarkerStyle(22);
mpy->SetMarkerColor(2);
float max_rpy = rpy->GetMaximum();
max_rpy /= 1.*mpy->GetMaximum();
mpy->Scale(max_rpy);
cout<<"max_rpy is: "<<max_rpy<<endl;
cout<<"mpy is: "<<mpy<<endl;
rpy->Sumw2();
mpy->Sumw2();
rpy->Fit("gaus","","",1,4);
mpy->Fit("gaus","","", 1, 4);
mpy->GetFunction("gaus")->SetLineColor(2);
rpy->SetAxisRange(0.5 ,6.0, "X");
mpy->Draw();
rpy->Draw("same");
float mipMc = mpy->GetFunction("gaus")->GetParameter(1);//mean
float mipGhost = rpy->GetFunction("gaus")->GetParameter(1);
float sigmaMc = mpy->GetFunction("gaus")->GetParameter(2);//mean
float sigmaGhost = rpy->GetFunction("gaus")->GetParameter(2);
char label1[80];
char label2[80];
char label3[80];
char label4[80];
sprintf(label1,"mip MC %.3f",mipMc);
sprintf(label2,"mip Ghost %.3f",mipGhost);
sprintf(label3,"sigma MC %.3f",sigmaMc);
sprintf(label4,"sigma Ghost %.3f",sigmaGhost);
keySymbol(.5, .9, label1,2,1);
keySymbol(.5, .85, label3,2,1);
keySymbol(.5, .75, label2,1,1);
keySymbol(.5, .70, label4,1,1);
keyLine(.2, 1.05,text1,1);
char name[30];
sprintf(name,"%.2f GeV/c < Pt < %.2f GeV/c",pt1, pt2);
keySymbol(0.3, 0.65, name, 1, 1, 0.04);
c9->Update();
}//close if pion
/////////////////////////////////////////////////////////////////////////
//Energy loss
//////////////////////////////////////////////////////////////////////////
TCanvas *c7= new TCanvas("c7","Energy Loss",400, 400);
c7->SetGridx(0);
c7->SetGridy(0);
c7->SetLeftMargin(0.20);
c7->SetRightMargin(0.05);
c7->cd;
hPtM_E->ProfileX("pfx");
pfx->SetAxisRange(-0.01, 0.01, "Y");
pfx->SetAxisRange(0, 6, "X");
pfx->GetYaxis()->SetDecimals();
pfx->SetMarkerStyle(23);
pfx->SetMarkerSize(0.038);
pfx->SetMarkerColor(4);
pfx->SetLineColor(4);
pfx->SetXTitle ("Pt-Reco");
pfx->SetYTitle ("ptM - PtMc");
pfx->SetTitleOffset(2,"Y");
pfx->Draw();
/*hPtM_E1->ProfileX("pfx1");
pfx1->SetAxisRange(-0.007, 0.007, "Y");
pfx1->GetYaxis()->SetDecimals();
pfx1->SetLineColor(2);
pfx1->SetMarkerStyle(21);
pfx1->SetMarkerSize(0.035);
pfx1->SetXTitle ("Pt-Reco");
pfx1->SetYTitle ("ptM - PtMc");
pfx1->SetTitleOffset(2,"Y");
pfx1->Draw("same");
c7->Update();
//////////////////////////////////////////////////////
//pt
//////////////////////////////////////////////////////
TCanvas *c2= new TCanvas("c2","pt",500, 500);
c2->SetGridx(0);
c2->SetGridy(0);
c2->SetTitle(0);
c2->cd();
//embedded
PtMc1->Rebin(2);
PtMc1->SetLineColor(2);
PtMc1->SetMarkerStyle(20);
PtMc1->SetMarkerColor(2);
PtMc1->Draw();
PtMc1->SetXTitle ("pT (GeV/c)");
PtMc1->SetAxisRange(0.0, 6.0, "X");
//Reco
PtM1->Rebin(2);
PtM1->SetMarkerStyle(20);
PtM1->SetMarkerColor(1);
PtM1->Draw("same");
keySymbol(.2, 1.05,text1,1);
keyLine(.3, 0.20,"Embeded-McTracks",2);
keyLine(.3, 0.16,"Matched Pairs",1);
// keyLine(.4, 0.82,"Previous Embedding",4);
c2->Update();
//////////////////////////////////////////////////////////////////
//phi
/////////////////////////////////////////////////////////////////
TCanvas *c5= new TCanvas("c5","pt",500, 500);
//c5->Divide(2,1);
c5->SetGridx(0);
c5->SetGridy(0);
c5->SetTitle(0);
c5->cd();
//embedded
PhiMc1->Rebin(2);
PhiMc1->SetLineColor(2);
PhiMc1->SetMarkerStyle(20);
PhiMc1->SetMarkerColor(2);
PhiMc1->Draw();
PhiMc1->SetXTitle ("Phi");
PhiMc1->SetAxisRange(-4, 4.0, "X");
//Reco
PhiM1->Rebin(2);
PhiM1->SetMarkerStyle(20);
PhiM1->SetMarkerColor(1);
PhiM1->Draw("same");
//Previous
// PhiM ->Rebin(2);
// PtM->SetLineColor(4);
// PtM->SetMarkerColor(4);
//PtM->Draw("same");
TLatex l;
l.DrawLatex(7.0, 450.0, prod);
keySymbol(.2, 1.05,text1,1);
keyLine(.3, 0.20,"Embeded-McTracks",2);
keyLine(.3, 0.16,"Reco - Matched Pairs",1);
// keyLine(.4, 0.82,"Previous Embedding",4);
c2->Update();
c5->Update();
/////////////////////////////////////
//eta
///////////////////////////////////////////////////////////////
TCanvas *c2= new TCanvas("c2","Eta",500, 500);
c2->SetGridx(0);
c2->SetGridy(0);
c2->SetTitle(0);
c2->cd();
//embedded
EtaMc1->Rebin(2);
EtaMc1->SetLineColor(2);
EtaMc1->SetMarkerStyle(20);
EtaMc1->SetMarkerColor(2);
EtaMc1->Draw();
EtaMc1->SetXTitle ("Eta");
EtaMc1->SetAxisRange(-1.2, 1.2, "X");
//Reco
EtaM1->Rebin(2);
EtaM1->SetMarkerStyle(20);
EtaM1->SetMarkerColor(1);
EtaM1->Draw("same");
TLatex l;
l.DrawLatex(7.0, 450.0, prod);
keySymbol(.2, 1.05,text1,1);
keyLine(.3, 0.20,"Embeded-McTracks",2);
keyLine(.3, 0.16,"Reco - Matched Pairs",1);
// keyLine(.4, 0.82,"Previous Embedding",4);
c2->Update();
/////////////////////////////////////////////////////////////
//DCA
////////////////////////////////////////////////////////////
TCanvas *c= new TCanvas("c","DCA",800, 400);
c->Divide(3,1);
c->SetGridx(0);
c->SetGridy(0);
//Matched (Bins for Multiplicity)
TH1D *hX1 = (TH1D*)hDca1->Project3D("X");
Int_t bin_nch1 = hX1->FindBin(nch1);
Int_t bin_nch2 = hX1->FindBin(nch2);//this should be the same for both graphs (for 3 graphs)
//Bins for Pt
TString name1 = "hDca1";
TString namer1 = "hDcar1";
TString name = "hDca";
TH1D *hY1 = (TH1D*)hDca1->Project3D("Y");
TH1D *hY1_r = (TH1D*)hDca1r->Project3D("Y");
TH1D *hY = (TH1D*)hDca->Project3D("Y");
Double_t Sum1_MC;
Double_t Sum1_Real;
Double_t Sum_MC;
for(Int_t i=0; i<3 ; i++)
{
c->cd(i+1);
Int_t bin_ptl_1 = hY1->FindBin(pt[i]);
Int_t bin_pth_1 = hY1->FindBin(pt[i+1]);
TH1D *hDcaNew1= (TH1D*)hDca1->ProjectionZ(name1+i,bin_nch1, bin_nch2, bin_ptl_1, bin_pth_1);
Sum1_MC = hDcaNew1 ->GetSum();
cout<<Sum1_MC<<endl;
hDcaNew1->Scale(1./Sum1_MC);
hDcaNew1 ->SetLineColor(2);
hDcaNew1->Draw();
hDcaNew1->SetXTitle("Dca (cm)");
sprintf(title," %.2f GeV < pT < %.2f GeV, %d < nch < %d", pt[i],pt[i+1],nch1,nch2);
hDcaNew1->SetTitle(title);
//----Now MuDSt
Int_t bin_ptrl_1r = hY1_r->FindBin(pt[i]);
Int_t bin_ptrh_1r = hY1_r->FindBin(pt[i+1]);
TH1D *hDca_r1= (TH1D*)hDca1r->ProjectionZ(namer1+i,bin_nch1, bin_nch2, bin_ptrl_1r, bin_ptrh_1r);
Sum1_Real = hDca_r1 ->GetSum();
cout<<Sum1_Real<<endl;
hDca_r1->Scale(1./Sum1_Real);
hDca_r1->Draw("same");
//Now Previous Embedding
Int_t bin_ptl = hY->FindBin(pt[i]);
Int_t bin_pth = hY->FindBin(pt[i+1]);
TH1D *hDcaNew = (TH1D*)hDca->ProjectionZ(name+i,bin_nch1, bin_nch2, bin_ptl, bin_pth);
Sum_MC = hDcaNew ->GetSum();
cout<<Sum_MC<<endl;
hDcaNew->Scale(1./Sum_MC);
hDcaNew ->SetLineColor(4);
hDcaNew->Draw("same");
keySymbol(.4, .95,text1,1,1);
keyLine(0.4, 0.90,"MC- Matched Pairs",2);
keyLine(0.4, 0.85,"MuDst",1);
keyLine(0.4, 0.80,"Previous Embedding P06ib",4);
}
c->Update();
///////////////////////////////////////////////////
//NFIT
////////////////////////////////////////////////////
TCanvas *c1= new TCanvas("c1","NFIT",800, 400);
c1->Divide(3,1);
c1->SetGridx(0);
c1->SetGridy(0);
//Bins for Multiplicity -Matched tracks
TH1D *hX1 = (TH1D*)hNfit1->Project3D("X");
Int_t bin_nch1 = hX1->FindBin(nch1);
Int_t bin_nch2 = hX1->FindBin(nch2);//this should be the same for both graphs (for 3 graphs)
//Bins for Pt
TString name_nfit1 = "hNfit1";
TString name_nfitr1 = "hNfitr1";
TString name_nfit = "hNfit";
TH1D *hY1 = (TH1D*)hNfit1->Project3D("Y");
TH1D *hY1_r = (TH1D*)hNfit1r->Project3D("Y");
TH1D *hY = (TH1D*)hNfit->Project3D("Y");
Double_t Sum1_Nfit_MC;
Double_t Sum1_Nfit_Real;
Double_t Sum__Nfit_MC;
for(Int_t i=0; i<3 ; i++)
{
c1->cd(i+1);
Int_t bin_ptl_1 = hY1->FindBin(pt[i]);
Int_t bin_pth_1 = hY1->FindBin(pt[i+1]);
TH1D *hNfitNew1= (TH1D*)hNfit1->ProjectionZ(name_nfit1+i,bin_nch1, bin_nch2, bin_ptl_1, bin_pth_1);
Sum1_Nfit_MC = hNfitNew1 ->GetSum();
cout<<Sum1_Nfit_MC<<endl;
hNfitNew1->Scale(1./Sum1_Nfit_MC);
hNfitNew1 ->SetLineColor(2);
hNfitNew1->Draw();
hNfitNew1->SetXTitle("Nfit");
sprintf(title," %.2f GeV < pT < %.2f GeV, %d < nch < %d", pt[i],pt[i+1],nch1,nch2);
hNfitNew1->SetTitle(title);
//----Now MuDSt
Int_t bin_ptrl_1r = hY1_r->FindBin(pt[i]);
Int_t bin_ptrh_1r = hY1_r->FindBin(pt[i+1]);
TH1D *hNfit_r1= (TH1D*)hNfit1r->ProjectionZ(name_nfitr1+i,bin_nch1, bin_nch2, bin_ptrl_1r, bin_ptrh_1r);
Sum1_Nfit_Real = hNfit_r1 ->GetSum();
cout<<Sum1_Nfit_Real<<endl;
hNfit_r1->Scale(1./Sum1_Nfit_Real);
hNfit_r1->Draw("same");
//Now Previous Embedding
Int_t bin_ptl = hY->FindBin(pt[i]);
Int_t bin_pth = hY->FindBin(pt[i+1]);
TH1D *hNfitNew = (TH1D*)hNfit->ProjectionZ(name_nfit+i,bin_nch1, bin_nch2, bin_ptl, bin_pth);
Sum_Nfit_MC = hNfitNew ->GetSum();
cout<<Sum__Nfit_MC<<endl;
hNfitNew->Scale(1./Sum_Nfit_MC);
hNfitNew ->SetLineColor(4);
hNfitNew->Draw("same");
///*T = new TBox(40, 0, 50, 0.01);
//T->SetLineColor(2);
//T->SetLineWidth(2);
//T->Draw("same");
//check this....
keySymbol(.2, .95,text1,1,1);
keyLine(0.2, 0.90,"MC- Matched Pairs",2);
keyLine(0.2, 0.85,"MuDst",1);
keyLine(0.2, 0.80,"Previous Embedding P06ib",4);
}
return;
}
</code>