)
string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
+set ( HDRS ${HDRS} FORWARD/analysis2/AliFMDStripIndex.h )
set ( EINCLUDE ANALYSIS )
+set ( EXPORT FORWARD/analysis2/AliAODForwardMult.h )
+
set ( DHDR PWG2forward2LinkDef.h)
# --------------------------------------------------------------------
fout.Close();
AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
- if(storeInOCDB) {
- TFile fbg(pars->GetPath(pars->GetBackgroundID()),"RECREATE");
- fBackground->Write(AliFMDAnaParameters::GetBackgroundID());
- fbg.Close();
- TFile feselect(pars->GetPath(pars->GetEventSelectionEffID()),"RECREATE");
- fEventSelectionEff->Write(AliFMDAnaParameters::GetEventSelectionEffID());
- feselect.Close();
-
+ if (!storeInOCDB) {
+ pars->SetBackgroundPath(".");
+ pars->SetEnergyPath(".");
+ pars->SetEventSelectionPath(".");
+ pars->SetSharingEfficiencyPath(".");
}
-
-
-
-
+ AliInfo(Form("Generating %s", pars->GetPath(pars->GetBackgroundID())));
+ TFile fbg(pars->GetPath(pars->GetBackgroundID()),"RECREATE");
+ fBackground->Write(AliFMDAnaParameters::GetBackgroundID());
+ fbg.Close();
+
+ AliInfo(Form("Generating %s", pars->GetPath(pars->GetEventSelectionEffID())));
+ TFile feselect(pars->GetPath(pars->GetEventSelectionEffID()),"RECREATE");
+ fEventSelectionEff->Write(AliFMDAnaParameters::GetEventSelectionEffID());
+ feselect.Close();
}
//_____________________________________________________________________
//
// Set maximum energy loss to consider
task->GetEnergyFitter().SetMaxE(15);
// Set number of energy loss bins
- task->GetEnergyFitter().SetNEbins(100);
+ task->GetEnergyFitter().SetNEbins(450);
// Set whether to use increasing bin sizes
task->GetEnergyFitter().SetUseIncreasingBins(true);
// Set whether to do fit the energy distributions
// Set the minimum number of entries in the distribution before
// trying to fit to the data
task->GetEnergyFitter().SetMinEntries(1000);
+ task->GetEnergyFitter().SetMaxRelativeParameterError(0.12);
+ task->GetEnergyFitter().SetMaxChi2PerNDF(10);
+ task->GetEnergyFitter().SetMinWeight(1e-5);
// --- Set limits on fits the energy -------------------------------
// Maximum relative error on parameters
AliFMDCorrELossFit::ELossFit::fgMaxRelError = .12;
//____________________________________________________________________
AliFMDCorrector::AliFMDCorrector(const char* title)
- : TNamed("fmdCorrections", title),
+ : TNamed("fmdCorrector", title),
fRingHistos(),
fUseMergingEfficiency(true),
fDebug(0)
// Return:
// true on success, false
//
+ // AliInfo(Form("Parameters from 1st ESD event: cms=%s, sNN=%f, field=%f",
+ // esd->GetBeamType(), 2*esd->GetBeamEnergy(),
+ // esd->GetMagneticField()));
fCollisionSystem =
AliForwardUtil::ParseCollisionSystem(esd->GetBeamType());
fEnergy =
return *this;
}
+//____________________________________________________________________
+void
+AliForwardCorrectionManager::SetPrefix(const char* prefix)
+{
+ fELossFitsPath = Form("%s/%s", prefix, ELOSSFIT_DIR);
+ fMergingEffPath = Form("%s/%s", prefix, MERGING_DIR);
+ fSecondaryMapPath = Form("%s/%s", prefix, SECONDARY_DIR);
+ fDoubleHitPath = Form("%s/%s", prefix, DOUBLE_DIR);
+ fVertexBiasPath = Form("%s/%s", prefix, VERTEX_DIR);
+ fAcceptancePath = Form("%s/%s", prefix, ACCEPTANCE_DIR);
+
+}
+//____________________________________________________________________
+void
+AliForwardCorrectionManager::SetFileDir(ECorrection what, const char* dir)
+{
+ TString *path = 0;
+ //
+ // Get the path to the specified object
+ //
+ // Parameters:
+ // what Which stuff to get the path for
+ //
+ // Return:
+ // The full path or null
+ //
+ if (what & kSecondaryMap) path = &fSecondaryMapPath;
+ else if (what & kDoubleHit) path = &fDoubleHitPath;
+ else if (what & kELossFits) path = &fELossFitsPath;
+ else if (what & kVertexBias) path = &fVertexBiasPath;
+ else if (what & kMergingEfficiency) path = &fMergingEffPath;
+ else if (what & kAcceptance) path = &fAcceptancePath;
+ else {
+ AliWarning(Form("No such path defined for 0x%02x", what));
+ return;
+ }
+ if (!path) {
+ AliWarning(Form("Couldn't find string for path 0x%02x", what));
+ return;
+ }
+ *path = dir;
+}
+
//____________________________________________________________________
Bool_t
AliForwardCorrectionManager::Init(const char* cms,
// true on success
//
UShort_t col = AliForwardUtil::ParseCollisionSystem(cms);
+ // AliInfo(Form("Initialising with cms='%s', sNN=%fGeV field=%fkG",
+ // cms, sNN, field));
return Init(col,
AliForwardUtil::ParseCenterOfMassEnergy(col, sNN),
AliForwardUtil::ParseMagneticField(field),
//
//
if (force) fInit = kFALSE;
- if (fInit) return kTRUE;
+ if (fInit) {
+ // Check that the initialisation and the passed parameters
+ // match - if not give an error but continue - this allows
+ // users to override particular settings.
+ Bool_t same = true;
+ if (fSys != cms) {
+ AliWarning(Form("Initialised collision system %s (%d) and "
+ "passed same %s (%d) does not match",
+ AliForwardUtil::CollisionSystemString(fSys), fSys,
+ AliForwardUtil::CollisionSystemString(cms), cms));
+ same = false;
+ }
+ if (TMath::Abs(fSNN - sNN) >= 10) {
+ AliWarning(Form("Initialised center of mass energy per nuclean "
+ "%s (%d) and passed same %s (%d) does not match",
+ AliForwardUtil::CenterOfMassEnergyString(fSNN), fSNN,
+ AliForwardUtil::CenterOfMassEnergyString(sNN), sNN));
+ same = false;
+ }
+ if (fField != field) {
+ AliWarning(Form("Initialied L3 magnetic field %s (%d) and passed "
+ "same %s (%d) does not match",
+ AliForwardUtil::MagneticFieldString(fField), fField,
+ AliForwardUtil::MagneticFieldString(field), field));
+ same = false;
+ }
+ if (!same)
+ AliWarning("Intialised parameters and these are not the same "
+ "- PROCEED WITH CAUTION!");
+
+ return kTRUE;
+ }
Bool_t ret = kTRUE;
if (fSys == cms && TMath::Abs(fSNN - sNN) < 10 && fField == field) {
fSys = cms;
fSNN = sNN;
fField = field;
-
+
+ // AliInfo(Form("Initialising with cms=%d, sNN=%dGeV field=%dkG",
+ // cms, sNN, field));
// Read secondary map if requested
if (what & kSecondaryMap) {
if (!ReadSecondaryMap(cms, sNN, field)) {
* @return Reference to the singleton object
*/
static AliForwardCorrectionManager& Instance();
+ /**
+ *
+ * @param prefix Prefix to correction objects.
+ */
+ void SetPrefix(const char* prefix);
+ void SetFileDir(ECorrection what, const char* dirname);
+ void SetSecondaryMapPath(const char* d) { SetFileDir(kSecondaryMap, d); }
+ void SetDoubleHitPath(const char* d) { SetFileDir(kDoubleHit, d); }
+ void SetELossFitsPath(const char* d) { SetFileDir(kELossFits, d); }
+ void SetVertexBiasPath(const char* d) { SetFileDir(kVertexBias, d); }
+ void SetMergingEffPath(const char* d) { SetFileDir(kMergingEfficiency, d); }
+ void SetAcceptancePath(const char* d) { SetFileDir(kAcceptance, d); }
/**
* Read in corrections based on the parameters given
*
// Get the input data - MC event
AliMCEvent* mcEvent = MCEvent();
- if (mcEvent) {
+ if (!mcEvent) {
AliWarning("No MC event found");
return;
}
AliFatal("No merging efficiencies");
return false;
}
+ // Check that we have the acceptance correction, needed by
+ // AliFMDCorrector
+ if (what & AliForwardCorrectionManager::kAcceptance &&
+ !fcm.GetAcceptance()) {
+ AliFatal("No acceptance corrections");
+ return false;
+ }
return true;
}
}
//____________________________________________________________________
UShort_t
-AliForwardUtil::ParseCenterOfMassEnergy(UShort_t sys, Float_t v)
+AliForwardUtil::ParseCenterOfMassEnergy(UShort_t /* sys */, Float_t v)
{
//
// Parse the center of mass energy given as a float and return known
// Center of mass energy per nucleon
//
Float_t energy = v;
- if (sys != AliForwardUtil::kPP) energy = energy / 208 * 82;
+ // Below no longer needed apparently
+ // if (sys == AliForwardUtil::kPbPb) energy = energy / 208 * 82;
if (TMath::Abs(energy - 900.) < 10) return 900;
if (TMath::Abs(energy - 2400.) < 10) return 2400;
if (TMath::Abs(energy - 2750.) < 10) return 2750;
class AliForwardUtil : public TObject
{
public:
+ /**
+ * Get the standard color for a ring
+ *
+ * @param d Detector
+ * @param r Ring
+ *
+ * @return
+ */
+ static Color_t RingColor(UShort_t d, Char_t r)
+ {
+ return ((d == 1 ? kRed : (d == 2 ? kGreen : kBlue))
+ + ((r == 'I' || r == 'i') ? 2 : -2));
+ }
//==================================================================
/**
* @{
*/
Color_t Color() const
{
- return ((fDet == 1 ? kRed : (fDet == 2 ? kGreen : kBlue))
- + ((fRing == 'I' || fRing == 'i') ? 2 : -2));
+ return AliForwardUtil::RingColor(fDet, fRing);
}
UShort_t fDet; // Detector
Char_t fRing; // Ring
*/
void ScanDirectory(TSystemDirectory* dir, TChain* chain, bool recursive)
{
- gROOT->IndentLevel();
- printf("Scanning %s ...\n", dir->GetName());
- gROOT->IncreaseDirLevel();
+ // gROOT->IndentLevel();
+ // printf("Scanning %s ...\n", dir->GetName());
+ // gROOT->IncreaseDirLevel();
// Get list of files, and go back to old working directory
TString oldDir(gSystem->WorkingDirectory());
TString aod(Form("%s/%s", file->GetTitle(), name.Data()));
// Print and add
- gROOT->IndentLevel();
- printf("adding %s\n", aod.Data());
+ // gROOT->IndentLevel();
+ // printf("adding %s\n", aod.Data());
chain->Add(aod);
}
- gROOT->DecreaseDirLevel();
+ // gROOT->DecreaseDirLevel();
}
//__________________________________________________________________
fTree->SetBranchAddress("Forward", &fAOD);
// Set the branch pointer
- fTree->SetBranchAddress("ForwardMC", &fMCAOD);
+ if (fTree->GetBranch("ForwardMC"))
+ fTree->SetBranchAddress("ForwardMC", &fMCAOD);
// Set the branch pointer
- fTree->SetBranchAddress("primary", &fPrimary);
+ if (fTree->GetBranch("primary"))
+ fTree->SetBranchAddress("primary", &fPrimary);
fOut = TFile::Open(outname, "RECREATE");
if (!fOut) {
Int_t bin = (i-1)*rebin + j;
if(h->GetBinContent(bin) <= 0) continue;
Double_t c = h->GetBinContent(bin);
-
- //Double_t w = 1 / TMath::Power(c,2);
- Double_t w = 1 / TMath::Power(h->GetBinError(bin),2);
+ Double_t e = h->GetBinError(bin);
+ Double_t w = 1 / (e*e); // 1/c/c
content += c;
sumw += w;
wsum += w * c;
nbins++;
}
- if(content > 0 ) {
+ if(content > 0 && nbins > 0) {
tmp->SetBinContent(i, wsum / sumw);
- tmp->SetBinError(i,1/TMath::Sqrt(sumw));
+ tmp->SetBinError(i,1./TMath::Sqrt(sumw));
}
}
// Finally, rebin the histogram, and set new content
h->Rebin(rebin);
h->Reset();
- for(Int_t i =1;i<=nBinsNew; i++) {
+ for(Int_t i = 1; i<= nBinsNew; i++) {
h->SetBinContent(i,tmp->GetBinContent(i));
- h->SetBinError(i,tmp->GetBinError(i));
+ h->SetBinError(i, tmp->GetBinError(i));
}
delete tmp;
// --- ESD input handler -------------------------------------------
AliESDInputHandler *esdHandler = new AliESDInputHandler();
- esdHandler->SetInactiveBranches("AliESDACORDE "
- "AliRawDataErrorLogs "
- "CaloClusters "
- "Cascades "
- "EMCALCells "
+ esdHandler->SetInactiveBranches(// "AliESDRun "
+ // "AliESDHeader "
+ // "AliESDZDC "
+ // "AliESDFMD "
+ // "AliESDVZERO "
+ "AliESDTZERO "
+ "TPCVertex "
+ // "SPDVertex "
+ // "PrimaryVertex "
+ // "AliMultiplicity "
+ "PHOSTrigger "
"EMCALTrigger "
- "Kinks "
- "Cascades "
- "MuonTracks "
+ "SPDPileupVertices "
+ "TrkPileupVertices "
+ "Tracks "
+ "MuonTracks "
+ "PmdTracks "
"TrdTracks "
+ "V0s "
+ "Cascades "
+ "Kinks "
+ "CaloClusters "
+ "EMCALLCells "
+ "PHOSCells "
+ "AliRawDataErrorLogs "
+ "ALIESDCACORDE "
"HLTGlobalTrigger");
mgr->SetInputEventHandler(esdHandler);
gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
AddTaskPhysicsSelection(mc, kTRUE, kTRUE);
-#if 0
+#if 1
// Centrality
gROOT->LoadMacro("$ALICE_ROOT/PWG2/FORWARD/analysis2/scripts/Compile.C");
// gDebug = 10;
Compile("$ALICE_ROOT/PWG2/FORWARD/analysis2/AddTaskCopyHeader.C","+");
+ // gDebug = 10;
+ Compile("$ALICE_ROOT/PWG2/FORWARD/analysis2/scripts/AliESDCentrality.C","+g");
// gDebug = 0;
AddTaskCopyHeader();
#endif
--- /dev/null
+/**
+ * Make ratio of two specific maps
+ *
+ * @param d Detector
+ * @param r Ring
+ * @param v Vertex bin (1 based)
+ * @param first First correction
+ * @param second Second correction
+ *
+ * @return Ratio of the two, or null
+ */
+TH2*
+Compare2Maps(UShort_t d, Char_t r, UShort_t v,
+ const AliFMDCorrSecondaryMap& first,
+ const AliFMDCorrSecondaryMap& second)
+{
+ TH2* h1 = first.GetCorrection(d, r, v);
+ TH2* h2 = second.GetCorrection(d, r, v);
+
+ if (!h1) {
+ Error("Compare2Maps", "Map for FMD%d%c, vtxbin %3d not found in first",
+ d, r, v);
+ return 0;
+ }
+ if (!h1) {
+ Error("Compare2Maps", "Map for FMD%d%c, vtxbin %3d not found in second",
+ d, r, v);
+ return 0;
+ }
+
+ Double_t vl = first.GetVertexAxis().GetBinLowEdge(v);
+ Double_t vh = first.GetVertexAxis().GetBinUpEdge(v);
+ TH2* ratio = static_cast<TH2*>(h1->Clone(Form("tmpFMD%d%c_%3d",d,r,v)));
+ ratio->SetName(Form("FMD%d%c_vtx%03d_ratio", d, r, v));
+ ratio->SetTitle(Form("%+5.1f<v_{z}<%-+5.1f", vl, vh));
+ ratio->Divide(h2);
+ ratio->SetStats(0);
+ ratio->SetDirectory(0);
+ ratio->SetZTitle("ratio");
+ // ratio->SetMinimum(0.9);
+ // ratio->SetMaximum(1.5);
+
+ return ratio;
+}
+
+//____________________________________________________________________
+TPad*
+ClearCanvas(TCanvas* c, UShort_t nVtx, UShort_t d, Char_t r,
+ const char* n1, const char* n2)
+{
+ c->Clear();
+ TPad* p1 = new TPad("top", "Top", 0, .95, 1, 1, 0, 0);
+ p1->Draw();
+ p1->cd();
+
+ TLatex* l = new TLatex(.5, .5, Form("Ratio of secondary maps for "
+ "FMD%d%c (%s / %s)", d, r, n1, n2));
+ l->SetNDC();
+ l->SetTextAlign(22);
+ l->SetTextSize(0.3);
+ l->Draw();
+
+ c->cd();
+ TPad* body = new TPad("body", "Body", 0, 0, 1, .95, 0, 0);
+ body->SetTopMargin(0.05);
+ body->SetRightMargin(0.05);
+ body->Divide(2, (nVtx+1)/2, 0.001, 0.001);
+ body->Draw();
+
+ return body;
+}
+
+//____________________________________________________________________
+void
+CompareSecMaps(const char* fn1, const char* fn2,
+ const char* n1=0, const char* n2=0)
+{
+
+ // --- Load libraries ----------------------------------------------
+ // gROOT->Macro("$ALICE_ROOT/PWG2/FORWARD/analysis2/scripts/LoadLibs.C");
+
+ // --- Open files --------------------------------------------------
+ const char* nam1 = n1;
+ const char* nam2 = n2;
+ if (!n1) nam1 = fn1;
+ if (!n2) nam2 = fn2;
+
+ TFile* file1 = TFile::Open(fn1, "READ");
+ TFile* file2 = TFile::Open(fn2, "READ");
+
+ if (!file1) {
+ Error("CompareSecMaps", "File %s cannot be opened for %s", fn1, n1);
+ return;
+ }
+
+ if (!file2) {
+ Error("CompareSecMaps", "File %s cannot be opened for %s", fn2, n2);
+ return;
+ }
+
+ // --- Find Objects ------------------------------------------------
+ const char* objName = AliForwardCorrectionManager::Instance()
+ .GetObjectName(AliForwardCorrectionManager::kSecondaryMap);
+
+ AliFMDCorrSecondaryMap* obj1 =
+ static_cast<AliFMDCorrSecondaryMap*>(file1->Get(objName));
+ AliFMDCorrSecondaryMap* obj2 =
+ static_cast<AliFMDCorrSecondaryMap*>(file2->Get(objName));
+
+ if (!obj1) {
+ Error("CompareSecMaps", "File %s does not contain an object named %s",
+ fn1, objName);
+ return;
+ }
+ if (!obj2) {
+ Error("CompareSecMaps", "File %s does not contain an object named %s",
+ fn2, objName);
+ return;
+ }
+ UShort_t nVtx = obj1->GetVertexAxis().GetNbins();
+
+ // --- Make canvas -------------------------------------------------
+ const char* pdfName = "secMapComparison.pdf";
+ gStyle->SetPalette(1);
+ gStyle->SetTitleX(.10);
+ gStyle->SetTitleY(.99);
+ gStyle->SetTitleW(.85);
+ gStyle->SetTitleH(.085);
+ gStyle->SetTitleFillColor(0);
+ gStyle->SetTitleBorderSize(0);
+
+ TCanvas* c = new TCanvas("c", "c", 800, TMath::Sqrt(2)*800);
+ c->SetFillColor(0);
+
+ c->Print(Form("%s[", pdfName), "pdf");
+
+ for (UShort_t d = 1; d <= 3; d++) {
+ UShort_t nR = (d == 1 ? 1 : 2);
+ for (UShort_t q = 0; q < nR; q++) {
+ Char_t r = (q == 0 ? 'I' : 'O');
+ UShort_t nS = (q == 0 ? 20 : 40);
+
+ TPad* body = ClearCanvas(c, nVtx, d, r, nam1, nam2);
+ TList hists;
+ for (UShort_t v=1; v <= nVtx; v++) {
+ TVirtualPad* p = body->cd(v);
+ // p->SetTopMargin(0.1);
+ // p->SetBottomMargin(0.05);
+ // p->SetRightMargin(0.05);
+
+ TH2* ratio = Compare2Maps(d, r, v, *obj1, *obj2);
+ if (ratio->GetMaximum()-ratio->GetMinimum() > 10)
+ p->SetLogz();
+
+ ratio->Draw("colz");
+ hists.AddAt(ratio, v-1);
+ }
+ c->Print(pdfName, Form("Title:FMD%d%c", d, r));
+
+ body = ClearCanvas(c, nVtx, d, r, nam1, nam2);
+
+ for (UShort_t v=1; v <= nVtx; v++) {
+ TVirtualPad* p = body->cd(v);
+ TH2* hist = static_cast<TH2*>(hists.At(v-1));
+ TH1* prof = hist->ProjectionX();
+ prof->Scale(1. / nS);
+ prof->SetStats(0);
+ prof->SetMinimum(0.8);
+ prof->SetMaximum(1.2);
+
+ // prof->Draw("hist");
+ // prof->DrawCopy("e same");
+ prof->Draw();
+ prof->Fit("pol0","Q");
+
+ TF1* f = prof->GetFunction("pol0");
+
+ TLatex* l = new TLatex(0.5, 0.4, Form("A = %f #pm %f",
+ f->GetParameter(0),
+ f->GetParError(0)));
+ l->SetTextAlign(22);
+ l->SetNDC();
+ l->Draw();
+ l->DrawLatex(0.5, 0.3, Form("#chi^2/NDF = %f / %d = %f",
+ f->GetChisquare(),
+ f->GetNDF(),
+ f->GetChisquare() / f->GetNDF()));
+ Double_t dist = TMath::Abs(1 - f->GetParameter(0));
+ l->DrawLatex(0.5, 0.35, Form("|1 - A| = %f %s #deltaA",
+ dist, dist <= f->GetParError(0) ?
+ "#leq" : ">"));
+
+ TLine* l1 = new TLine(-4, 1, 6, 1);
+ l1->SetLineColor(kRed);
+ l1->SetLineStyle(2);
+ l1->Draw();
+ }
+
+ c->Print(pdfName, Form("Title:FMD%d%c profiles", d, r));
+ }
+ }
+
+ c->Print(Form("%s]", pdfName), "pdf");
+ file1->Close();
+ file2->Close();
+}
+
+
+ ((r == 'I' || r == 'i') ? 2 : -2));
}
+void
+RunCopyELossFit(UShort_t sys, UShort_t cms, Short_t field, Bool_t mc=false,
+ const Char_t* path=0)
+{
+ RunCopyELossFit(sys == 1 ? "pp" : "PbPb",
+ cms,
+ field,
+ mc,
+ path);
+}
+
/**
*
* @param sys Collision system
* @ingroup pwg2_forward_analysis_scripts
*/
void
-RunCopyELossFit(UShort_t sys, UShort_t cms, Short_t field, bool mc=false)
+RunCopyELossFit(const char* sys, UShort_t cms, Short_t field, bool mc=false,
+ const char* path=0)
{
gROOT->Macro("$ALICE_ROOT/PWG2/FORWARD/analysis2/scripts/LoadLibs.C");
gSystem->Load("libPWG2forward.so");
p->SetRealData(!mc);
p->SetEnergy(Float_t(cms));
p->SetMagField(Float_t(field));
- p->SetCollisionSystem(sys == 1 ? "pp" : "PbPb");
+ p->SetCollisionSystem(sys);
+ if (path) {
+ p->SetBackgroundPath(path);
+ p->SetEnergyPath(path);
+ p->SetEventSelectionPath(path);
+ p->SetSharingEfficiencyPath(path);
+ }
p->Init(true, AliFMDAnaParameters::kBackgroundCorrection|
AliFMDAnaParameters::kEnergyDistributions);
}
}
}
+ UShort_t isys = AliForwardUtil::ParseCollisionSystem(sys);
AliForwardCorrectionManager& mgr = AliForwardCorrectionManager::Instance();
TString fname(mgr.GetFileName(AliForwardCorrectionManager::kELossFits,
- sys, cms, field, mc));
+ isys, cms, field, mc));
TFile* output = TFile::Open(fname.Data(), "RECREATE");
if (!output) {
Warning("RunCopyELossFit", "Failed to open output file %s", fname.Data());
+ ((r == 'I' || r == 'i') ? 2 : -2));
}
+void
+RunCopyMergeEff(UShort_t sys, UShort_t cms, Short_t field, const Char_t* path=0)
+{
+ RunCopyMergeEff(sys == 1 ? "pp" : "PbPb",
+ cms,
+ field,
+ path);
+}
+
/**
*
* @param sys Collision system
* @ingroup pwg2_forward_analysis_scripts
*/
void
-RunCopyMergeEff(UShort_t sys, UShort_t cms, Short_t field)
+RunCopyMergeEff(const char* sys, UShort_t cms,
+ Short_t field, const char* path=0)
{
gROOT->Macro("$ALICE_ROOT/PWG2/FORWARD/analysis2/scripts/LoadLibs.C");
gSystem->Load("libPWG2forward.so");
AliFMDAnaParameters* p = AliFMDAnaParameters::Instance();
p->SetEnergy(Float_t(cms));
p->SetMagField(Float_t(field));
- p->SetCollisionSystem(sys == 1 ? "pp" : "PbPb");
+ p->SetCollisionSystem(sys);
+ if (path) {
+ p->SetBackgroundPath(path);
+ p->SetEnergyPath(path);
+ p->SetEventSelectionPath(path);
+ p->SetSharingEfficiencyPath(path);
+ }
p->Init(true, AliFMDAnaParameters::kBackgroundCorrection|
AliFMDAnaParameters::kSharingEfficiency);
}
}
}
+ UShort_t isys = AliForwardUtil::ParseCollisionSystem(sys);
AliForwardCorrectionManager& mgr = AliForwardCorrectionManager::Instance();
TString fname(mgr.GetFileName(AliForwardCorrectionManager::kMergingEfficiency,
- sys, cms, field, false));
+ isys, cms, field, false));
TFile* output = TFile::Open(fname.Data(), "RECREATE");
if (!output) {
Warning("Run", "Failed to open output file %s", fname.Data());
+ ((r == 'I' || r == 'i') ? 2 : -2));
}
+void
+RunCopySecMap(UShort_t sys, UShort_t cms, Short_t field, const Char_t* path=0)
+{
+ RunCopySecMap(sys == 1 ? "pp" : "PbPb",
+ cms,
+ field,
+ path);
+}
/**
*
* @param sys Collision system
* @ingroup pwg2_forward_analysis_scripts
*/
void
-RunCopySecMap(UShort_t sys, UShort_t cms, Short_t field)
+RunCopySecMap(const char* sys, UShort_t cms, Short_t field,
+ const Char_t* path=0)
{
gROOT->Macro("$ALICE_ROOT/PWG2/FORWARD/analysis2/scripts/LoadLibs.C");
gSystem->Load("libPWG2forward.so");
AliFMDAnaParameters* p = AliFMDAnaParameters::Instance();
p->SetEnergy(Float_t(cms));
p->SetMagField(Float_t(field));
- p->SetCollisionSystem(sys == 1 ? "pp" : "PbPb");
+ p->SetCollisionSystem(sys);
+ if (path) {
+ p->SetBackgroundPath(path);
+ p->SetEnergyPath(path);
+ p->SetEventSelectionPath(path);
+ p->SetSharingEfficiencyPath(path);
+ }
p->Init(true, AliFMDAnaParameters::kBackgroundCorrection);
Int_t nVtx = p->GetNvtxBins();
}
}
}
+ UShort_t isys = AliForwardUtil::ParseCollisionSystem(sys);
AliForwardCorrectionManager& mgr = AliForwardCorrectionManager::Instance();
TString fname(mgr.GetFileName(AliForwardCorrectionManager::kSecondaryMap,
- sys, cms, field, false));
+ isys, cms, field, false));
TFile* output = TFile::Open(fname.Data(), "RECREATE");
if (!output) {
Warning("Run", "Failed to open output file %s", fname.Data());
fname.Data(),mgr.GetFileDir(AliForwardCorrectionManager::kSecondaryMap));
fname = mgr.GetFileName(AliForwardCorrectionManager::kDoubleHit,
- sys, cms, field, false);
+ isys, cms, field, false);
output = TFile::Open(fname.Data(), "RECREATE");
if (!output) {
Warning("Run", "Failed to open output file %s", fname.Data());
+ ((r == 'I' || r == 'i') ? 2 : -2));
}
+void
+RunCopyVtxBias(UShort_t sys, UShort_t cms, Short_t field, const char* path=0)
+{
+ RunCopyVtxBias(sys == 1 ? "pp" : "PbPb", cms, field, path);
+}
+
/**
*
* @param sys Collision system
* @ingroup pwg2_forward_analysis_scripts
*/
void
-RunCopyVtxBias(UShort_t sys, UShort_t cms, Short_t field)
+RunCopyVtxBias(const char* sys, UShort_t cms, Short_t field, const char* path=0)
{
gROOT->Macro("$ALICE_ROOT/PWG2/FORWARD/analysis2/scripts/LoadLibs.C");
gSystem->Load("libPWG2forward.so");
AliFMDAnaParameters* p = AliFMDAnaParameters::Instance();
p->SetEnergy(Float_t(cms));
p->SetMagField(Float_t(field));
- p->SetCollisionSystem(sys == 1 ? "pp" : "PbPb");
+ p->SetCollisionSystem(sys);
+ if (path) {
+ p->SetBackgroundPath(path);
+ p->SetEnergyPath(path);
+ p->SetEventSelectionPath(path);
+ p->SetSharingEfficiencyPath(path);
+ }
p->Init(true, AliFMDAnaParameters::kBackgroundCorrection|
AliFMDAnaParameters::kEventSelectionEfficiency);
obj->SetCorrection(r, b, newcorr);
}
}
+ UShort_t isys = AliForwardUtil::ParseCollisionSystem(sys);
AliForwardCorrectionManager& mgr = AliForwardCorrectionManager::Instance();
TString fname(mgr.GetFileName(AliForwardCorrectionManager::kVertexBias,
- sys, cms, field, false));
+ isys, cms, field, false));
TFile* output = TFile::Open(fname.Data(), "RECREATE");
if (!output) {
Warning("Run", "Failed to open output file %s", fname.Data());
#pragma link C++ nestedclasses;
+#pragma link C++ class AliForwardUtil+;
#pragma link C++ class AliForwardUtil::Histos+;
#pragma link C++ class AliForwardUtil::RingHistos+;
#pragma link C++ class AliFMDEventInspector+;