#include "TCanvas.h"
#include "TVector3.h"
#include "TParticle.h"
+#include "AliVParticle.h"
+#include "AliMCParticle.h"
#include "AliESDEvent.h"
#include "AliESDv0.h"
#include "AliESDcascade.h"
fV0ampl(0)
{
// Constructor
- AliInfo("Constructor AliAnaFwdDetsQA");
// Define input and output slots here
// Input slot #0 works with a TChain
+ AliInfo("Constructor AliAnaFwdDetsQA");
DefineInput(0, TChain::Class());
// Output slot #1 TList
DefineOutput(1, TList::Class());
Double_t xMin, Double_t xMax,
const char* xLabel, const char* yLabel)
{
- // create a histogram
+ // helper method which can be used
+ // in order to create a histogram
TH1F* result = new TH1F(name, title, nBins, xMin, xMax);
result->SetOption("E");
if (xLabel) result->GetXaxis()->SetTitle(xLabel);
TH1F *AliAnaFwdDetsQA::CreateEffHisto(const TH1F* hGen, const TH1F* hRec)
{
- // create an efficiency histogram
+ // helper method which can be used
+ // in order create an efficiency histogram
Int_t nBins = hGen->GetNbinsX();
TH1F* hEff = (TH1F*) hGen->Clone("hEff");
hEff->SetTitle("");
Double_t eff = nRecEff/nGenEff;
hEff->SetBinContent(iBin, 100. * eff);
Double_t error = sqrt(eff*(1.-eff) / nGenEff);
- if (error == 0) error = 0.0001;
+ if (error < 1e-12) error = 0.0001;
hEff->SetBinError(iBin, 100. * error);
}
else {
Bool_t AliAnaFwdDetsQA::FitHisto(TH1* histo, Double_t& res, Double_t& resError)
{
- // fit a gaussian to a histogram
+ // fit a gaussian to
+ // a histogram
static TF1* fitFunc = new TF1("fitFunc", "gaus");
fitFunc->SetLineWidth(2);
fitFunc->SetFillStyle(0);
void AliAnaFwdDetsQA::UserCreateOutputObjects()
{
// Create histograms
- AliInfo("AliAnaFwdDetsQA::UserCreateOutputObjects");
// Create output container
+ AliInfo("AliAnaFwdDetsQA::UserCreateOutputObjects");
fListOfHistos = new TList();
fT0vtxRec = CreateHisto("hT0vtxRec", "Z vertex reconstructed with T0", 100, -25, 25, "Z_{vtx} [cm]", "");
void AliAnaFwdDetsQA::UserExec(Option_t */*option*/)
{
-
+ // The analysis code
+ // goes here
AliMCEvent* mcEvent = MCEvent();
if (!mcEvent) {
Printf("ERROR: Could not retrieve MC event");
Int_t nV0C = 0;
for (Int_t iTracks = 0; iTracks < mcEvent->GetNumberOfTracks(); iTracks++) {//Check this loop again
if (!stack->IsPhysicalPrimary(iTracks)) continue;
- AliMCParticle* track = mcEvent->GetTrack(iTracks);
+ AliMCParticle* track = (AliMCParticle*)mcEvent->GetTrack(iTracks);
TParticle* particle = track->Particle();
if (!particle) continue;
if (track->Charge() == 0) continue;
void AliAnaFwdDetsQA::Terminate(Option_t *)
{
+ // Terminate
+ // Store the output histos
fListOfHistos = dynamic_cast<TList*>(GetOutputData(1));
if (!fListOfHistos) {
Printf("ERROR: fListOfHistos not available");