1 Color_t Color(UShort_t d, Char_t r ) const
3 return ((d == 1 ? kRed : (d == 2 ? kGreen : kBlue))
4 + ((r == 'I' || r == 'i') ? 2 : -2));
8 RunCopyMergeEff(UShort_t sys, UShort_t cms, Short_t field, const Char_t* path=0)
10 RunCopyMergeEff(sys == 1 ? "pp" : "PbPb",
18 * @param sys Collision system
19 * @param cms Center of mass energy per nucleon in GeV
20 * @param field Magnetic field
22 * @ingroup pwg2_forward_analysis_scripts
25 RunCopyMergeEff(const char* sys, UShort_t cms,
26 Short_t field, const char* path=0)
28 gROOT->Macro("$ALICE_ROOT/PWG2/FORWARD/analysis2/scripts/LoadLibs.C");
29 gSystem->Load("libPWG2forward.so");
31 AliFMDAnaParameters* p = AliFMDAnaParameters::Instance();
32 p->SetEnergy(Float_t(cms));
33 p->SetMagField(Float_t(field));
34 p->SetCollisionSystem(sys);
36 p->SetBackgroundPath(path);
37 p->SetEnergyPath(path);
38 p->SetEventSelectionPath(path);
39 p->SetSharingEfficiencyPath(path);
41 p->Init(true, AliFMDAnaParameters::kBackgroundCorrection|
42 AliFMDAnaParameters::kSharingEfficiency);
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();
51 TAxis vtxAxis(nVtx, minVtx, maxVtx);
52 AliFMDCorrMergingEfficiency* m = new AliFMDCorrMergingEfficiency;
53 m->SetVertexAxis(nVtx, minVtx, maxVtx);
55 for (UShort_t d = 1; d <= 3; d++) {
56 UShort_t nQ = (d == 1 ? 1 : 2);
57 for (UShort_t q = 0; q < nQ; q++) {
58 Char_t r = (q == 0 ? 'I' : 'O');
60 for (UShort_t b = 1; b <= nVtx; b++) {
61 TH1F* oldmap = p->GetSharingEfficiency(d, r, b-1);
63 Warning("RunCopyMergeEff",
64 "Didn't find secondary map correction "
65 "for FMD%d%c, vertex bin %3d", d, r, b);
69 TH1D* newmap = new TH1D(Form("FMD%d%c_vtxbin%03d", d, r, b),
70 Form("Merging efficiency for FMD%d%c "
71 "in vertex bin %d [%+8.4f,%+8.4f]",
72 d, r, b, vtxAxis.GetBinLowEdge(b),
73 vtxAxis.GetBinUpEdge(b)),
74 nEta, minEta, maxEta);
75 newmap->SetXTitle("#eta");
76 newmap->SetYTitle("dN_{ch,i,incl}/d#eta / #sum_{i} N_{ch,i,FMD}");
77 newmap->SetDirectory(0);
82 Info("RunCopyMergeEff",
83 "Copying %s to %s", oldmap->GetName(), newmap->GetName());
85 m->SetCorrection(d, r, b, newmap);
89 UShort_t isys = AliForwardUtil::ParseCollisionSystem(sys);
90 AliForwardCorrectionManager& mgr = AliForwardCorrectionManager::Instance();
91 TString fname(mgr.GetFileName(AliForwardCorrectionManager::kMergingEfficiency,
92 isys, cms, field, false));
93 TFile* output = TFile::Open(fname.Data(), "RECREATE");
95 Warning("Run", "Failed to open output file %s", fname.Data());
98 m->Write(mgr.GetObjectName(AliForwardCorrectionManager::kMergingEfficiency));
101 Info("Run", "File %s created. It should be copied to %s and stored in SVN",
103 mgr.GetFileDir(AliForwardCorrectionManager::kMergingEfficiency));