]>
Commit | Line | Data |
---|---|---|
6f791cc3 | 1 | Color_t Color(UShort_t d, Char_t r ) const |
2 | { | |
3 | return ((d == 1 ? kRed : (d == 2 ? kGreen : kBlue)) | |
4 | + ((r == 'I' || r == 'i') ? 2 : -2)); | |
5 | } | |
6 | ||
7 | /*void | |
8 | RunCopyCentralSecMap(UShort_t sys, UShort_t cms, Short_t field, const Char_t* path=0) | |
9 | { | |
10 | RunCopyCentralSecMap(sys == 1 ? "pp" : "PbPb", | |
11 | cms, | |
12 | field, | |
13 | path); | |
14 | }*/ | |
15 | /** | |
16 | * | |
17 | * @param sys Collision system | |
18 | * @param cms Center of mass energy per nucleon in GeV | |
19 | * @param field Magnetic field | |
20 | * | |
21 | * @ingroup pwg2_forward_analysis_scripts | |
22 | */ | |
23 | //void | |
24 | //RunCopyCentralSecMap(const char* sys, UShort_t cms, Short_t field, | |
25 | // const Char_t* path=0) | |
26 | void | |
27 | RunCopyCentralSecMap(UShort_t sys, UShort_t cms, Short_t field, const Char_t* path=0) | |
28 | { | |
29 | gROOT->Macro("$ALICE_ROOT/PWG2/FORWARD/analysis2/scripts/LoadLibs.C"); | |
30 | gSystem->Load("libPWG2forward.so"); | |
31 | ||
32 | AliFMDAnaParameters* p = AliFMDAnaParameters::Instance(); | |
33 | p->SetEnergy(Float_t(cms)); | |
34 | p->SetMagField(Float_t(field)); | |
35 | p->SetCollisionSystem(sys); | |
36 | if (path) { | |
37 | p->SetBackgroundPath(path); | |
38 | p->SetEnergyPath(path); | |
39 | p->SetEventSelectionPath(path); | |
40 | p->SetSharingEfficiencyPath(path); | |
41 | } | |
42 | p->Init(true, AliFMDAnaParameters::kBackgroundCorrection); | |
43 | ||
44 | Int_t nVtx = p->GetNvtxBins(); | |
45 | Double_t minVtx = -p->GetVtxCutZ(); | |
46 | Double_t maxVtx = p->GetVtxCutZ(); | |
47 | Int_t nEta = p->GetNetaBins(); | |
48 | Double_t minEta = p->GetEtaMin(); | |
49 | Double_t maxEta = p->GetEtaMax(); | |
50 | ||
51 | TAxis vtxAxis(nVtx, minVtx, maxVtx); | |
52 | AliCentralCorrSecondaryMap* m = new AliCentralCorrSecondaryMap; | |
53 | m->SetVertexAxis(nVtx, minVtx, maxVtx); | |
54 | ||
55 | AliCentralCorrAcceptance* a = new AliCentralCorrAcceptance; | |
56 | a->SetVertexAxis(nVtx, minVtx, maxVtx); | |
57 | ||
58 | ||
59 | //m->SetEtaAxis(nEta,minEta,maxEta); | |
60 | //AliFMDCorrDoubleHit* dh = new AliFMDCorrDoubleHit; | |
61 | ||
62 | ||
63 | ||
64 | for (UShort_t b = 1; b <= nVtx; b++) { | |
65 | TH2F* oldmap = p->GetBackgroundCorrection(0, 'Q', b-1); | |
66 | if (!oldmap) { | |
67 | Warning("RunCopySecMap", | |
68 | "Didn't find secondary map correction " | |
69 | "for SPD, vertex bin %3d", b); | |
70 | continue; | |
71 | } | |
72 | ||
73 | TH2D* newmap = new TH2D(Form("SPD_vtxbin%03d", b), | |
74 | Form("Secondary map correction for SPD " | |
75 | "in vertex bin %d [%+8.4f,%+8.4f]", | |
76 | b, vtxAxis.GetBinLowEdge(b), | |
77 | vtxAxis.GetBinUpEdge(b)), | |
78 | nEta, minEta, maxEta, | |
79 | oldmap->GetYaxis()->GetNbins(), | |
80 | oldmap->GetYaxis()->GetXmin(), | |
81 | oldmap->GetYaxis()->GetXmax()); | |
82 | newmap->SetXTitle("#eta"); | |
83 | newmap->SetYTitle("#phi [radians]"); | |
84 | newmap->SetZTitle("#sum_{i} N_{ch,i,primary} / #sum_{i} N_{ch,i,FMD}"); | |
85 | newmap->SetDirectory(0); | |
86 | newmap->SetStats(0); | |
87 | newmap->Sumw2(); | |
88 | newmap->Add(oldmap); | |
89 | ||
90 | Info("RunCopySecMap", | |
91 | "Copying %s to %s", oldmap->GetName(), newmap->GetName()); | |
92 | ||
93 | m->SetCorrection(b, newmap); | |
94 | std::cout<<m->GetCorrection(b)<<std::endl; | |
95 | ||
96 | //Acceptance | |
97 | TH1F* oldacc = p->GetSPDDeadCorrection(b-1); | |
98 | if (!oldacc) { | |
99 | Warning("RunCopySecMap", | |
100 | "Didn't find acceptance correction " | |
101 | "for SPD, vertex bin %3d", b); | |
102 | continue; | |
103 | } | |
104 | ||
105 | TH1D* newacc = new TH1D(Form("SPDdead_vtxbin%03d", b), | |
106 | Form("Acceptance correction for SPD " | |
107 | "in vertex bin %d [%+8.4f,%+8.4f]", | |
108 | b, vtxAxis.GetBinLowEdge(b), | |
109 | vtxAxis.GetBinUpEdge(b)), | |
110 | nEta, minEta, maxEta); | |
111 | newacc->SetXTitle("#eta"); | |
112 | newacc->SetYTitle("correction"); | |
113 | //newacc->SetZTitle("#sum_{i} N_{ch,i,primary} / #sum_{i} N_{ch,i,FMD}"); | |
114 | newacc->SetDirectory(0); | |
115 | newacc->SetStats(0); | |
116 | newacc->Sumw2(); | |
117 | newacc->Add(oldacc); | |
118 | ||
119 | Info("RunCopySecMap", | |
120 | "Copying %s to %s", oldacc->GetName(), newacc->GetName()); | |
121 | ||
122 | a->SetCorrection(b, newacc); | |
123 | std::cout<<a->GetCorrection(b)<<std::endl; | |
124 | ||
125 | ||
126 | } | |
127 | ||
e58000b7 | 128 | AliCentralMultiplicityTask::Manager* task = new AliCentralMultiplicityTask::Manager(); |
6f791cc3 | 129 | |
130 | TFile f(task->GetFullFileName(0.,sys+1,cms,field), "RECREATE"); | |
131 | m->Write(task->GetSecMapName()); | |
132 | f.Close(); | |
133 | TFile f2(task->GetFullFileName(1.,sys+1,cms,field), "RECREATE"); | |
134 | a->Write(task->GetAcceptanceName()); | |
135 | f2.Close(); | |
136 | ||
137 | } | |
138 | // | |
139 | // EOF | |
140 | // |