*
*/
~AliFMDBaseDA() ;
+ AliFMDBaseDA& operator=(const AliFMDBaseDA&) { return *this; }
/**
* Run this DA
*
// Return:
// Reference to this object
//
+ if (&o == this) return *this;
AliDigitizer::operator=(o);
fRunLoader = o.fRunLoader;
fEdep = o.fEdep;
AliFMDBoolMap::operator=(const AliFMDBoolMap& other)
{
// Assignment operator
+ if (&other == this) return *this;
fMaxDetectors = other.fMaxDetectors;
fMaxRings = other.fMaxRings;
fMaxSectors = other.fMaxSectors;
AliFMDCalibGain::operator=(const AliFMDCalibGain& o)
{
// Assignment operator
+ if (&o == this) return *this;
fValue = o.fValue;
fThreshold = o.fThreshold;
return (*this);
{}
MakeDead& operator=(const MakeDead& other)
{
+ if (&other == this) return *this;
fDead = other.fDead;
fMin = other.fMin;
fMax = other.fMax;
AliFMDCalibPedestal::operator=(const AliFMDCalibPedestal& o)
{
// Assignment operator
+ if (&o == this) return *this;
fValue = o.fValue;
fWidth = o.fWidth;
return (*this);
{}
MakeDead& operator=(const MakeDead& other)
{
+ if (&other == this) return *this;
fDead = other.fDead;
fMax = other.fMax;
fCount = other.fCount;
AliFMDDetector::operator=(const AliFMDDetector& other)
{
// Assignment operator
+ if (&other == this) return *this;
SetName(other.GetName());
SetTitle(other.GetTitle());
fId = other.fId;
@return Reference to this object */
AliFMDEdepHitPair& operator=(const AliFMDEdepHitPair& o)
{
+ if (&o == this) return *this;
fEdep = o.fEdep;
fN = o.fN;
fNPrim = o.fNPrim;
AliFMDEdepMap::operator=(const AliFMDEdepMap& other)
{
// Assignment operator
+ if (&other == this) return *this;
fMaxDetectors = other.fMaxDetectors;
fMaxRings = other.fMaxRings;
fMaxSectors = other.fMaxSectors;
// Return:
// reference to this.
//
+ if (&other == this) return *this;
fUseFMD1 = other.fUseFMD1;
fUseFMD2 = other.fUseFMD2;
fUseFMD3 = other.fUseFMD3;
* @param o Object to assign from
* @return Reference to this
*/
+ if (&o == this) return *this;
AliFMDBaseDigitizer::operator=(o);
fHoldTime = o.fHoldTime;
fOutput = o.fOutput;
AliFMDIndex::operator=(const AliFMDIndex& o)
{
// Assignment operator
+ if (&o == this) return *this;
fDetector = o.fDetector;
fRing = o.fRing;
fSector = o.fSector;
{}
/** DTOR */
virtual ~AliFMDObjIndex() {}
+ AliFMDObjIndex& operator=(const AliFMDObjIndex& o)
+ {
+ if (&o == this) return *this;
+ AliFMDIndex::operator=(o);
+ return *this;
+ }
/** @return name */
virtual const char* GetName() const { return AliFMDIndex::Name(); }
/** sort compare for TCollection's
AliFMDUShortMap::operator=(const AliFMDUShortMap& other)
{
// Assignment operator
+ if (&other == this) return *this;
fMaxDetectors = other.fMaxDetectors;
fMaxRings = other.fMaxRings;
fMaxSectors = other.fMaxSectors;
// Return:
// Reference to this
//
+ if (&o == this) return *this;
SetName(o.GetName());
SetTitle(o.GetTitle());
fSums = o.fSums;
// Return:
// Reference to this object
//
+ if (&o == this) return *this;
fInspector = o.fInspector;
fTrackDensity = o.fTrackDensity;
fVtxBins = o.fVtxBins;
AliCentralMCCorrectionsTask::VtxBin&
AliCentralMCCorrectionsTask::VtxBin::operator=(const VtxBin& o)
{
+ if (&o == this) return *this;
TNamed::operator=(o);
fHits = 0;
fPrimary = 0;
//
// Assignment operator
//
+ if (&o == this) return *this;
fInspector = o.fInspector;
fData = o.fData;
fList = o.fList;
//
// Assignment operator
//
+ if (&o == this) return *this;
fAcceptancePath = o.fAcceptancePath;
fSecMapPath = o.fSecMapPath;
fAcceptance = o.fAcceptance;
// Return:
// Reference to this object
//
+ if (&o == this) return *this;
fN = o.fN;
fNu = o.fNu;
fChi2 = o.fChi2;
// Return:
// Reference to this object
//
+ if (&o == this) return *this;
fRings = o.fRings;
fLowCut = o.fLowCut;
SetEtaAxis(o.fEtaAxis.GetNbins(), o.fEtaAxis.GetXmin(), o.fEtaAxis.GetXmax());
//
// Parameters:
// o Object to assign from
+ if (&o == this) return *this;
TNamed::operator=(o);
fDebug = o.fDebug;
// Return:
// Reference to this
//
+ if (&o == this) return *this;
AliForwardUtil::RingHistos::operator=(o);
if (fDensity) delete fDensity;
// Return:
// Reference to this object
//
+ if (&o == this) return *this;
TNamed::operator=(o);
fDebug = o.fDebug;
// Return:
// Reference to this
//
+ if (&o == this) return *this;
AliForwardUtil::RingHistos::operator=(o);
if (fEvsN) delete fEvsN;
// Return:
// Reference to this
//
+ if (&o == this) return *this;
TNamed::operator=(o);
fLowCut = o.fLowCut;
// Return:
// Reference to this
//
+ if (&o == this) return *this;
AliForwardUtil::RingHistos::operator=(o);
if (fEDist) delete fEDist;
// Return:
// Reference to this object
//
+ if (&o == this) return *this;
AliAnalysisTaskSE::operator=(o);
fFirstEvent = o.fFirstEvent;
// Return:
// Reference to this object
//
+ if (&o == this) return *this;
TNamed::operator=(o);
fHEventsTr = o.fHEventsTr;
fHEventsTrVtx = o.fHEventsTrVtx;
// Return:
// Reference to this object
//
+ if (&o == this) return *this;
TNamed::operator=(o);
fNCutBins = o.fNCutBins;
// Return:
// Reference to this object
//
+ if (&o == this) return *this;
AliFMDCorrector::operator=(o);
fSecondaryForMC = o.fSecondaryForMC;
return *this;
AliFMDMCTrackDensity::operator=(const AliFMDMCTrackDensity& o)
{
// Assignment operator
+ if (&o == this) return *this;
TNamed::operator=(o);
fUseOnlyPrimary = o.fUseOnlyPrimary;
fMaxConsequtiveStrips = o.fMaxConsequtiveStrips;
AliFMDMultCuts&
AliFMDMultCuts::operator=(const AliFMDMultCuts& o)
{
+ if (&o == this) return *this;
fMPVFraction = o.fMPVFraction;
fNXi = o.fNXi;
fIncludeSigma = o.fIncludeSigma;
// Return:
// Reference to this
//
+ if (&o == this) return *this;
TNamed::operator=(o);
fCorrectAngles = o.fCorrectAngles;
// Return:
// Reference to this
//
+ if (&o == this) return *this;
AliForwardUtil::RingHistos::operator=(o);
fDet = o.fDet;
fRing = o.fRing;
//
// Default constructor
//
+ for (Int_t n = 0; n <= 6; n++) fv[n] = kTRUE;
}
//_____________________________________________________________________
AliForwardFlowTaskQC::AliForwardFlowTaskQC(const char* name) :
// Return:
// Reference to this object
//
+ if (&o == this) return *this;
fInspector = o.fInspector;
fTrackDensity = o.fTrackDensity;
fESDFMD = o.fESDFMD;
AliForwardMCCorrectionsTask::VtxBin&
AliForwardMCCorrectionsTask::VtxBin::operator=(const VtxBin& o)
{
+ if (&o == this) return *this;
TNamed::operator=(o);
fHists = o.fHists;
fPrimary = 0;
// Return:
// Reference to this object
//
+ if (&o == this) return *this;
AliForwardMultiplicityBase::operator=(o);
fHData = o.fHData;
AliForwardMultiplicityBase&
AliForwardMultiplicityBase::operator=(const AliForwardMultiplicityBase& o)
{
+ if (&o == this) return *this;
fEnableLowFlux = o.fEnableLowFlux;
fFirstEvent = o.fFirstEvent;
fCorrManager = o.fCorrManager;
// Return:
// Reference to this object
//
+ if (&o == this) return *this;
AliForwardMultiplicityBase::operator=(o);
fHData = o.fHData;
// Return:
// Reference to this object
//
+ if (&o == this) return *this;
AliAnalysisTaskSE::operator=(o);
fEnableLowFlux = o.fEnableLowFlux;
*/
RingHistos& operator=(const RingHistos& o)
{
+ if (&o == this) return *this;
TObject::operator=(o);
fDet = o.fDet;
fRing = o.fRing;
AliPoissonCalculator&
AliPoissonCalculator::operator=(const AliPoissonCalculator& o)
{
+ if (&o == this) return *this;
TNamed::operator=(o);
fEtaLumping = o.fEtaLumping;
fPhiLumping = o.fPhiLumping;
AliSPDMCTrackDensity::operator=(const AliSPDMCTrackDensity& o)
{
// Assignment operator
+ if (&o == this) return *this;
TNamed::operator=(o);
fUseOnlyPrimary = o.fUseOnlyPrimary;
fMinR = o.fMinR;
TList* fitter = 0;
TCanvas* canvas = 0;
const char* pdfName = "FitResults.pdf";
+bool landscape = true;
//____________________________________________________________________
/**
gStyle->SetStatColor(0);
gStyle->SetStatBorderSize(1);
- canvas = new TCanvas("c", "C", Int_t(800 / TMath::Sqrt(2)), 800);
+ Int_t w = Int_t(800 / TMath::Sqrt(2));
+ Int_t h = 800;
+ if (landscape) {
+ Int_t tmp = h;
+ h = w;
+ w = tmp;
+ }
+ canvas = new TCanvas("c", "C", w, h);
canvas->SetFillColor(0);
canvas->SetBorderMode(0);
canvas->SetBorderSize(0);
//____________________________________________________________________
THStack*
-AddToStack(TList* stacks, TList* fitter, const char* name)
+AddToStack(TList* stacks, TList* list, const char* name)
{
- TObject* o = fitter->FindObject(name);
+ TObject* o = list->FindObject(name);
if (!o) {
Warning("AddToStack", "Object %s not found in %s", name,
- fitter->GetName());
- // fitter->ls();
+ list->GetName());
+ // list->ls();
return 0;
}
THStack* toAdd = static_cast<THStack*>(o);
*
* @ingroup pwg2_forward_scripts_corr
*/
-void DrawSummary(const char* fname="forward_eloss.root")
+void DrawSummary(const char* fname="forward_eloss.root",
+ bool onlySummary=true)
{
if (!CheckFitter(fname)) {
Error("DrawFits", "File not opened");
canvas->Clear();
TList stacks;
- THStack* chi2nu = AddToStack(&stacks, fitter, "chi2");
- THStack* c = AddToStack(&stacks, fitter, "c");
- THStack* delta = AddToStack(&stacks, fitter, "delta");
- THStack* xi = AddToStack(&stacks, fitter, "xi");
- THStack* sigma = AddToStack(&stacks, fitter, "sigma");
- THStack* sigman = AddToStack(&stacks, fitter, "sigman");
- THStack* n = AddToStack(&stacks, fitter, "n");
+ /* THStack* chi2nu = */ AddToStack(&stacks, fitter, "chi2");
+ /* THStack* c = */ AddToStack(&stacks, fitter, "c");
+ /* THStack* delta = */ AddToStack(&stacks, fitter, "delta");
+ /* THStack* xi = */ AddToStack(&stacks, fitter, "xi");
+ /* THStack* sigma = */ AddToStack(&stacks, fitter, "sigma");
+ /* THStack* sigman = */ AddToStack(&stacks, fitter, "sigman");
+ /* THStack* n = */ AddToStack(&stacks, fitter, "n");
Int_t baseA = stacks.GetEntries()+1;
Int_t i = 2;
while (true) {
}
// stacks.ls();
Int_t nMax = stacks.GetEntries();
- for (Int_t i = nMax-1; i >= baseA; i--) {
+ for (i = nMax-1; i >= baseA; i--) {
THStack* stack = static_cast<THStack*>(stacks.At(i));
TIter nextH(stack->GetHists());
TH1* hist = 0;
canvas->SetRightMargin(0.01);
canvas->SetTopMargin(0.01);
+ Int_t nL = (nMax+1) / 2;
Int_t nX = 2;
- Int_t nY = (nMax+1) / 2;
+ Int_t nY = nL;
+ if (landscape) {
+ Int_t tmp = nY;
+ nY = nX;
+ nX = tmp;
+ }
+
canvas->Divide(nX, nY, 0.1, 0, 0);
TIter next(&stacks);
THStack* stack = 0;
i = 0;
- Int_t b = 1;
+ // Int_t b = 1;
while ((stack = static_cast<THStack*>(next()))) {
if (i > nMax) break;
- Int_t ipad = 1+i/nY + 2 * (i % nY);
+ Int_t ipad = 1+i/nL + 2 * (i % nL);
Info("DrawSummary", "cd'ing to canvas %d for %s", ipad,
stack->GetName());
TVirtualPad* p = canvas->cd(ipad);
- p->SetLeftMargin(.6/nY);
+ p->SetLeftMargin(.6/nL);
p->SetTopMargin(.01);
p->SetRightMargin(.01);
p->SetFillColor(0);
if (i == 4 || i == 5) stack->SetMaximum(0.5); // sigma{,n}
if (i == 7) stack->SetMaximum(0.5); // a
if (i == 0) p->SetLogy();
- yaxis->SetTitleSize(0.3/nY);
+ yaxis->SetTitleSize(0.3/nL);
yaxis->SetLabelSize(0.08);
- yaxis->SetTitleOffset(2.5/nY);
+ yaxis->SetTitleOffset(2.5/nL);
yaxis->SetNdivisions(5);
yaxis->SetTitleFont(42);
yaxis->SetLabelFont(42);
yaxis->SetDecimals();
TAxis* xaxis = stack->GetHistogram()->GetXaxis();
- xaxis->SetTitleSize(0.3/nY);
+ xaxis->SetTitleSize(0.3/nL);
xaxis->SetLabelSize(0.08);
- xaxis->SetTitleOffset(2./nY);
+ xaxis->SetTitleOffset(2./nL);
xaxis->SetNdivisions(10);
xaxis->SetTitleFont(42);
xaxis->SetLabelFont(42);
// Redraw
stack->Draw("nostack");
i++;
- if (i >= 5) b = 2;
+ // if (i >= 5) b = 2;
p->cd();
}
canvas->SaveAs("fit_results.png");
- canvas->Print(pdfName, "Title:Fit summary");
+ if (!onlySummary)
+ canvas->Print(pdfName, "Title:Fit summary");
}
//____________________________________________________________________
return;
}
if (!onlySummary) canvas->Print(Form("%s[", pdfName));
- DrawSummary(fname);
+ DrawSummary(fname, onlySummary);
if (onlySummary) return;
DrawRings(fname);
DrawEtaBins(fname);
--- /dev/null
+#ifndef __CINT__
+# include <TH1.h>
+# include <TH2.h>
+# include <TList.h>
+# include <TFile.h>
+# include <TString.h>
+# include <TError.h>
+# include <TPad.h>
+# include <TCanvas.h>
+# include <TLine.h>
+# include <TLatex.h>
+# include <TStyle.h>
+# include <TLegend.h>
+#else
+class TList;
+#endif
+
+/**
+ * Draw the before/after merging image for a single ring
+ *
+ * @param p
+ * @param d
+ * @param r
+ *
+ * @ingroup pwg2_forward_scripts_qa
+ */
+void
+DrawRing123(TList* p, UShort_t d, Char_t r)
+{
+ if (!p) return;
+
+ TList* ring = static_cast<TList*>(p->FindObject(Form("FMD%d%c",d,r)));
+ if (!ring) {
+ Error("Draw123", "List FMD%d%c not found in %s",d,r,p->GetName());
+ return;
+ }
+
+ TH1* one = static_cast<TH1*>(ring->FindObject("singleEloss"));
+ TH1* two = static_cast<TH1*>(ring->FindObject("doubleEloss"));
+ TH1* three = static_cast<TH1*>(ring->FindObject("tripleEloss"));
+ if (!one || !two || !three) {
+ Error("DrawRing123", "Histograms of Eloss not found in FMD%d%c", d, r);
+ return;
+ }
+ one->SetStats(0);
+ one->SetTitle(Form("FMD%d%c", d, r));
+ one->GetXaxis()->SetRangeUser(0, 8);
+
+ gPad->SetLogy();
+ gPad->SetFillColor(0);
+
+ one->Draw();
+ if (two) two->Draw("same");
+ if (three) three->Draw("same");
+
+ TLegend* l = new TLegend(.6, .6, .95, 1);
+ l->SetFillColor(0);
+ l->SetBorderSize(0);
+ l->AddEntry(one);
+ if (two) l->AddEntry(two);
+ if (three) l->AddEntry(three);
+ l->Draw();
+
+ gPad->cd();
+}
+
+
+/**
+ * Draw the before/after sharing image for all rings
+ *
+ * @param filename
+ *
+ * @ingroup pwg2_forward_scripts_qa
+ */
+void
+Draw123(const char* filename="forward.root",
+ const char* folder="ForwardResults")
+{
+ gStyle->SetPalette(1);
+ gStyle->SetOptFit(0);
+ gStyle->SetOptStat(0);
+ gStyle->SetOptTitle(1);
+ gStyle->SetTitleW(.4);
+ gStyle->SetTitleH(.1);
+ gStyle->SetTitleColor(0);
+ gStyle->SetTitleStyle(0);
+ gStyle->SetTitleBorderSize(0);
+ gStyle->SetTitleX(.6);
+
+ TFile* file = TFile::Open(filename, "READ");
+ if (!file) {
+ Error("Draw123", "failed to open %s", filename);
+ return;
+ }
+
+ TList* forward = static_cast<TList*>(file->Get(folder));
+ if (!forward) {
+ Error("Draw123", "List %s not found in %s", folder, filename);
+ return;
+ }
+
+ TList* sf = static_cast<TList*>(forward->FindObject("fmdSharingFilter"));
+ if (!sf) {
+ Error("Draw123", "List fmdSharingFilter not found in Forward");
+ return;
+ }
+
+ TCanvas* c = new TCanvas("123",
+ "singles, doubles, and tripples", 900, 700);
+ c->SetFillColor(0);
+ c->SetBorderSize(0);
+ c->SetLeftMargin(0.15);
+ c->SetRightMargin(0.02);
+ c->SetTopMargin(0.02);
+ c->Divide(3, 2, 0, 0);
+
+ c->cd(1); DrawRing123(sf, 1, 'I');
+ c->cd(2); DrawRing123(sf, 2, 'I');
+ c->cd(5); DrawRing123(sf, 2, 'O');
+ c->cd(3); DrawRing123(sf, 3, 'I');
+ c->cd(6); DrawRing123(sf, 3, 'O');
+ TVirtualPad* p = c->cd(4);
+ // p->SetTopMargin(0.05);
+ p->SetRightMargin(0.15);
+ p->SetFillColor(0);
+ TH2D* highCuts = static_cast<TH2D*>(sf->FindObject("highCuts"));
+ if (highCuts) highCuts->Draw("colz");
+ c->cd();
+ c->SaveAs("123.png");
+}
+
+
+
+
+//
+// EOF
+//
+#ifndef __CINT__
+# include <TH1.h>
+# include <TH2.h>
+# include <TList.h>
+# include <TFile.h>
+# include <TString.h>
+# include <TError.h>
+# include <TPad.h>
+# include <TCanvas.h>
+# include <TLine.h>
+# include <TLatex.h>
+# include <TStyle.h>
+#else
+class TList;
+#endif
+
/**
* Draw the before/after merging image for a single ring
*
* @ingroup pwg2_forward_scripts_qa
*/
void
-DrawBeforeAfter(const char* filename="forward.root")
+DrawBeforeAfter(const char* filename="forward.root",
+ const char* folder="ForwardResults")
{
gStyle->SetPalette(1);
gStyle->SetOptFit(0);
return;
}
- TList* forward = static_cast<TList*>(file->Get("Forward"));
+ TList* forward = static_cast<TList*>(file->Get(folder));
if (!forward) {
- Error("DrawBeforeAfter", "List Forward not found in %s", filename);
+ Error("DrawBeforeAfter", "List %s not found in %s", folder, filename);
return;
}
TH2D* highCuts = static_cast<TH2D*>(sf->FindObject("highCuts"));
if (highCuts) highCuts->Draw("colz");
c->cd();
-
+ c->SaveAs("beforeAfter.png");
}
* @ingroup pwg2_forward_scripts_qa
*
*/
+#ifndef __CINT__
+# include <TH1.h>
+# include <TH2.h>
+# include <TList.h>
+# include <TFile.h>
+# include <TString.h>
+# include <TError.h>
+# include <TPad.h>
+# include <TCanvas.h>
+# include <TMath.h>
+# include <TF1.h>
+# include <TLine.h>
+# include <TLatex.h>
+# include <TLinearFitter.h>
+# include <TStyle.h>
+#else
+class TList;
+#endif
/**
* Draw the poisson @f$N_{ch}@f$ estimate against the @f$\Delta@f$
DrawRingELossPoisson(TList* p, UShort_t d, Char_t r,
Double_t xmin, Double_t xmax)
{
- if (!p) return;
+ if (!p) return 0;
TList* ring = static_cast<TList*>(p->FindObject(Form("FMD%d%c",d,r)));
if (!ring) {
Error("DrawELossPoisson", "List FMD%d%c not found in %s",d,r,p->GetName());
- return;
+ return 0;
}
TH2* corr = static_cast<TH2D*>(ring->FindObject("elossVsPoisson"));
if (!corr) {
Error("DrawRingELossPoisson", "Histogram esdEloss not found in FMD%d%c",
d, r);
- return;
+ return 0;
}
TPad* pad = static_cast<TPad*>(gPad);
pad->SetGridy();
corr->GetXaxis()->SetRangeUser(xmin,xmax);
corr->GetYaxis()->SetRangeUser(xmin,xmax);
corr->SetTitle(Form("FMD%d%c",d,r));
- Info("", "Entries: %d, integral: %f", corr->GetEntries(), corr->Integral());
+ // Info("", "Entries: %d, integral: %f",
+ // int(corr->GetEntries()), corr->Integral());
corr->Draw("colz");
+ if (corr->GetEntries() <= 0) return 0;
// Calculate the linear regression
- Double_t dx = (xmax-xmin);
+ // Double_t dx = (xmax-xmin);
Double_t rxy = corr->GetCorrelationFactor();
Double_t sx = corr->GetRMS(1);
Double_t sy = corr->GetRMS(2);
#if 0
Double_t beta = rxy * sy / sx;
#else
+ if (TMath::Abs(cxy) < 1e-6) return 0;
Double_t beta = ((sy2 - delta*sx2 +
TMath::Sqrt(TMath::Power(sy2-delta*sx2,2) +
4*delta*cxy*cxy))
l->Draw();
// corr->GetXaxis()->SetRangeUser(0, 2);
+#if 0
Info("", "FMD%d%c correlation coefficient: %9.5f%% "
"line y = %f + %f * x", d, r, 100*rxy, alpha, beta);
+#endif
Double_t x = pad->GetLeftMargin()+.01;
Double_t y = 1-pad->GetTopMargin()-.01;
fitter->EvalRobust();
else
fitter->Eval();
+#if 0
for (Int_t i = 0; i < 2; i++) {
std::cout << i << "\t"
<< fitter->GetParName(i) << "\t"
fitter->GetNumberFreeParameters() );
std::cout << "chi2/ndf: " << chi2 << '/' << ndf
<< '=' << chi2 / ndf << std::endl;
+#endif
// corr->Scale(1. / corr->GetMaximum());
pad->cd();
*/
void
DrawELossPoisson(const char* filename="forward.root",
+ const char* folder="ForwardResults",
Double_t xmax=-1,
Double_t xmin=-1)
{
return;
}
- TList* forward = static_cast<TList*>(file->Get("Forward"));
+ TList* forward = static_cast<TList*>(file->Get(folder));
if (!forward) {
- Error("DrawELossPoisson", "List Forward not found in %s", filename);
+ Error("DrawELossPoisson", "List %s not found in %s", folder, filename);
return;
}
+#ifndef __CINT__
+# include <TH1.h>
+# include <TH2.h>
+# include <TList.h>
+# include <TFile.h>
+# include <TString.h>
+# include <TError.h>
+# include <TPad.h>
+# include <TCanvas.h>
+# include <TLine.h>
+# include <TLatex.h>
+# include <TStyle.h>
+#else
+class TList;
+#endif
/**
* Draw the correlation of neighboring strips before/after merging
*
* @ingroup pwg2_forward_scripts_qa
*/
void
-DrawNeighbors(const char* filename="forward.root")
+DrawNeighbors(const char* filename="forward.root",
+ const char* folder="ForwardResults")
{
gStyle->SetPalette(1);
gStyle->SetOptFit(0);
return;
}
- TList* forward = static_cast<TList*>(file->Get("Forward"));
+ TList* forward = static_cast<TList*>(file->Get(folder));
if (!forward) {
- Error("DrawNeighbors", "List Forward not found in %s", filename);
+ Error("DrawNeighbors", "List %s not found in %s", folder, filename);
return;
}
c->cd(6); DrawRingNeighbors(sf, 3, 'O');
c->cd(4)->SetFillColor(0);
c->cd();
+ c->SaveAs("neighbors.png");
}
* @ingroup pwg2_forward_scripts_qa
*
*/
+#ifndef __CINT__
+# include <TH1.h>
+# include <TH2.h>
+# include <TList.h>
+# include <TFile.h>
+# include <TString.h>
+# include <TError.h>
+# include <TPad.h>
+# include <TCanvas.h>
+# include <TLine.h>
+# include <TLatex.h>
+# include <TStyle.h>
+#else
+class TList;
+#endif
/**
* Draw the poisson @f$N_{ch}@f$ estimate against the @f$\Delta@f$
Double_t
DrawRingOccupancy(TList* p, UShort_t d, Char_t r)
{
- if (!p) return;
+ if (!p) return 0;
TList* ring = static_cast<TList*>(p->FindObject(Form("FMD%d%c",d,r)));
if (!ring) {
Error("DrawOccupancy", "List FMD%d%c not found in %s",d,r,p->GetName());
- return;
+ return 0;
}
TH1* corr = static_cast<TH1*>(ring->FindObject("occupancy"));
if (!corr) {
Error("DrawRingOccupancy", "Histogram occupancy not found in FMD%d%c",
d, r);
- return;
+ return 0;
}
+ corr->Rebin(4);
+
TPad* pad = static_cast<TPad*>(gPad);
pad->SetGridy();
pad->SetGridx();
*/
void
DrawOccupancy(const char* filename="forward.root",
- Double_t xmax=-1,
- Double_t xmin=-1)
+ const char* folder="ForwardResults")
{
gStyle->SetPalette(1);
gStyle->SetOptFit(0);
return;
}
- TList* forward = static_cast<TList*>(file->Get("Forward"));
+ TList* forward = static_cast<TList*>(file->Get(folder));
if (!forward) {
- Error("DrawOccupancy", "List Forward not found in %s", filename);
+ Error("DrawOccupancy", "List %s not found in %s", folder, filename);
return;
}
gROOT->SetMacroPath(Form(".:$(ALICE_ROOT)/PWG2/FORWARD/analysis2/qa:"
"$(ALICE_ROOT)/PWG2/FORWARD/analysis2/corrs:%s",
gROOT->GetMacroPath()));
- gROOT->LoadMacro("DrawBeforeAfter.C");
- gROOT->LoadMacro("DrawELossPoisson.C");
- gROOT->LoadMacro("DrawNeighbors.C");
- gROOT->LoadMacro("DrawOccupancy.C");
- gROOT->LoadMacro("DrawRecAnaEloss.C");
+ gROOT->LoadMacro("DrawBeforeAfter.C+g");
+ gROOT->LoadMacro("DrawELossPoisson.C+g");
+ gROOT->LoadMacro("DrawNeighbors.C+g");
+ gROOT->LoadMacro("DrawOccupancy.C+g");
+ gROOT->LoadMacro("DrawRecAnaEloss.C+g");
+ gROOT->LoadMacro("Draw123.C+g");
+ Info("DrawQA", "Drawing before-after");
DrawBeforeAfter(file);
- DrawELossPoisson(file);
+ Info("DrawQA", "Drawing singles, doubles, tripples");
+ Draw123(file);
+ Info("DrawQA", "Drawing Neighbors");
DrawNeighbors(file);
- DrawOccupancy(file);
+ Info("DrawQA", "Drawing raw and analysed energy loss");
DrawRecAnaEloss(file);
+ Info("DrawQA", "Drawing poisson vs energy loss");
+ DrawELossPoisson(file);
+ Info("DrawQA", "Drawing Occupancies");
+ DrawOccupancy(file);
if (!full) {
+ Info("DrawQA", "Drawing fit results");
gROOT->LoadMacro("DrawAnaELoss.C");
DrawAnaELoss(file);
}
--- /dev/null
+#!/bin/sh
+
+file=trending.root
+
+# --- Help message ---------------------------------------------------
+usage ()
+{
+ cat <<EOF
+Usage: $0 [OPTIONS]
+
+Options:
+ -f,--file FILE Input file
+ -t,--title STRING Title string
+ -o,--output FILE Write output on this file
+ -h,--help Show this help
+EOF
+}
+
+# --- Command line parsing -------------------------------------------
+while test $# -gt 0 ; do
+ case $1 in
+ -f|--file) file=$2 ; shift ;;
+ -t|--title) title=$2 ; shift ;;
+ -h|--help) usage ; exit 0 ;;
+ *) echo "Uknown option $1" > /dev/stderr ; exit 1 ;;
+ esac
+ shift
+done
+
+# --- Run aliroot ----------------------------------------------------
+scr=$ALICE_ROOT/PWG2/FORWARD/analysis2/qa/DrawQA.C
+
+root -l -b -q ${scr}\(\"$file\"\)
+
+# --- Make LaTeX code ------------------------------------------------
+if test "x$title" = "x" ; then
+ title=`echo "QA from $file" | sed -e 's/_/\\_/g'`
+fi
+if test "x$output" = "x" ; then
+ output=`basename $file .root`
+else
+ output=`basename $file .pdf`
+fi
+doc=${output}.tex
+
+echo $title
+cat <<EOF > $doc
+\documentclass[landscape,12pt,a4paper]{article}
+\usepackage[a4paper,margin=2cm]{geometry}
+\usepackage{graphicx}
+\title{$title}
+\author{FMD Team}
+\date{\today}
+\begin{document}
+\maketitle
+\clearpage
+
+EOF
+pngs="fit_results neighbors beforeAfter 123 recAnaELoss occupancy elossVsPoisson"
+for i in $pngs ; do
+ case $i in
+ fit_results) t="Energy loss fits" ;;
+ neighbors) t="Correlation of neighbors" ;;
+ beforeAfter) t="Effect of sharing correction" ;;
+ 123) t="Energy loss from single, double, and tripple hits" ;;
+ recAnaELoss) t="Energy loss from reconstruction and used in analysis" ;;
+ occupancy) t="Calculated occupancy" ;;
+ elossVsPoisson) t="Correlation of Poisson and Energy loss methods" ;;
+ *) t="Unkknown" ;;
+ esac
+ cat <<EOF >> $doc
+\section*{$t}
+\begin{center}
+\includegraphics[keepaspectratio,height=.9\textheight]{$i}
+\end{center}
+\clearpage
+EOF
+done
+
+cat <<EOF >> $doc
+\end{document}
+EOF
+
+pdflatex $doc
+
+rm -f $doc $output.aux $output.log FitResults.pdf
+for i in $pngs ; do rm -f $i.png ; done
+
+#
+# EOF
+#
+
// after->Scale(1. / ib);
// presented->Scale(1. / ib);
// used->Scale(1. / ib);
-
+
gPad->SetLogy();
gPad->SetFillColor(0);
before->SetTitle(Form("FMD%d%c",d,r));
TLine* l = new TLine;
l->SetLineWidth(1);
l->DrawLineNDC(x, y-0.9*ts, 1-gPad->GetRightMargin()-0.01, y-0.9*ts);
- DrawText(ltx, x, y, "Change (merging)", Form("%5.1f%%", (100.*(ia-ib))/ib));
- DrawText(ltx, x, y, "Change (input)", Form("%5.1f%% (%5.1f%%)",
- (100.*(ip-ia))/ia,
- (100.*(ip-ib))/ib));
- DrawText(ltx, x, y, "Change (use)", Form("%5.1f%% (%5.1f%%)",
- (100.*(iu-ip))/ip,
- (100.*(iu-ib))/ib));
+ if (ib != 0 && ia != 0) {
+ DrawText(ltx, x, y, "Change (merging)", Form("%5.1f%%", (100.*(ia-ib))/ib));
+ DrawText(ltx, x, y, "Change (input)", Form("%5.1f%% (%5.1f%%)",
+ (100.*(ip-ia))/ia,
+ (100.*(ip-ib))/ib));
+ DrawText(ltx, x, y, "Change (use)", Form("%5.1f%% (%5.1f%%)",
+ (100.*(iu-ip))/ip,
+ (100.*(iu-ib))/ib));
+ }
before->GetXaxis()->SetRangeUser(0, 4);
gPad->cd();
}
* @ingroup pwg2_forward_scripts_qa
*/
void
-DrawRecAnaEloss(const char* filename="forward.root")
+DrawRecAnaEloss(const char* filename="forward.root",
+ const char* folder="ForwardResults")
{
gStyle->SetPalette(1);
gStyle->SetOptFit(0);
return;
}
- TList* forward = static_cast<TList*>(file->Get("Forward"));
+ TList* forward = static_cast<TList*>(file->Get(folder));
if (!forward) {
- Error("DrawRecAnaEloss", "List Forward not found in %s", filename);
+ Error("DrawRecAnaEloss", "List %s not found in %s", folder, filename);
return;
}
TH2D* highCuts = static_cast<TH2D*>(sf->FindObject("highCuts"));
if (highCuts) highCuts->Draw("colz");
c->cd();
-
+ c->SaveAs("recAnaELoss.png");
}