]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGHF/correlationHF/AliDxHFEParticleSelectionD0.cxx
Fixes for merging output of D2H QC/SP task (Grazia)
[u/mrichter/AliRoot.git] / PWGHF / correlationHF / AliDxHFEParticleSelectionD0.cxx
CommitLineData
72c0a987 1// $Id$
2
3//**************************************************************************
4//* This file is property of and copyright by the ALICE Project *
5//* ALICE Experiment at CERN, All rights reserved. *
6//* *
7//* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8//* Sedat Altinpinar <Sedat.Altinpinar@cern.ch> *
9//* Hege Erdal <hege.erdal@gmail.com> *
10//* *
11//* Permission to use, copy, modify and distribute this software and its *
12//* documentation strictly for non-commercial purposes is hereby granted *
13//* without fee, provided that the above copyright notice appears in all *
14//* copies and that both the copyright notice and this permission notice *
15//* appear in the supporting documentation. The authors make no claims *
16//* about the suitability of this software for any purpose. It is *
17//* provided "as is" without express or implied warranty. *
18//**************************************************************************
19
20/// @file AliDxHFEParticleSelectionD0.cxx
21/// @author Sedat Altinpinar, Hege Erdal, Matthias Richter
22/// @date 2012-03-19
23/// @brief D0 selection for D0-HFE correlation
24///
25
26#include "AliDxHFEParticleSelectionD0.h"
27#include "AliVParticle.h"
93fcaf9f 28#include "AliAODRecoDecayHF2Prong.h" // libPWGHFvertexingHF
72c0a987 29#include "TObjArray.h"
93fcaf9f 30#include "THnSparse.h"
31#include "TAxis.h"
32#include <iostream>
33#include <cerrno>
34#include <memory>
72c0a987 35
36/// ROOT macro for the implementation of ROOT specific class methods
37ClassImp(AliDxHFEParticleSelectionD0)
38
39AliDxHFEParticleSelectionD0::AliDxHFEParticleSelectionD0(const char* opt)
93fcaf9f 40 : AliDxHFEParticleSelection("D0", opt)
41 , fD0Properties(NULL)
72c0a987 42{
43 // constructor
44 //
45 //
46 //
47 //
48}
49
50AliDxHFEParticleSelectionD0::~AliDxHFEParticleSelectionD0()
51{
52 // destructor
53}
54
93fcaf9f 55int AliDxHFEParticleSelectionD0::InitControlObjects()
56{
57 /// init the control objects, can be overloaded by childs which should
58 /// call AliDxHFEParticleSelection::InitControlObjects() explicitly
59 TString name;
60 const int thnSize = 4;
61 const double pi=TMath::Pi();
62
63 // TODO: very specific D0 for the moment, sort out later
64 // TODO: theta?
65 // 0 1 2 3
66 // mass Pt Phi Ptbin
67 int thnBins[thnSize] = { 200, 1000, 100, 100};
68 double thnMin [thnSize] = { 1.5648, 0, 0, 0};
69 double thnMax [thnSize] = { 2.1648, 100, (2*pi), 100};
70
71 name.Form("%s info", GetName());
72 std::auto_ptr<THnSparseF> D0Properties(new THnSparseF(name, name, thnSize, thnBins, thnMin, thnMax));
73
74 if (D0Properties.get()==NULL) {
75 return -ENOMEM;
76 }
77 int axis=0;
78 D0Properties->GetAxis(axis++)->SetTitle("mass");
79 D0Properties->GetAxis(axis++)->SetTitle("Pt");
80 D0Properties->GetAxis(axis++)->SetTitle("Phi");
81 D0Properties->GetAxis(axis++)->SetTitle("Ptbin");
82
83 fD0Properties=D0Properties.release();
84 AddControlObject(fD0Properties);
85
86 return AliDxHFEParticleSelection::InitControlObjects();
87}
88
89int AliDxHFEParticleSelectionD0::HistogramParticleProperties(AliVParticle* p, bool selected)
90{
91 /// histogram particle properties
92 if (!p) return -EINVAL;
93
94 // fill the common histograms
95 AliDxHFEParticleSelection::HistogramParticleProperties(p, selected);
96
97 // TODO: histograms for all and selected particles
98 if (!selected) return 0;
99
100 // TODO: find out which type is necessary
101 AliAODRecoDecayHF2Prong* part=dynamic_cast<AliAODRecoDecayHF2Prong*>(p);
102 if (part) {
103 Double_t invmassD0 = part->InvMassD0();
104 // TODO: use cut object to define pt bin
105 Int_t ptbin=0;//cuts->PtBin(part->Pt());
106 Double_t D0Stuff[] = {invmassD0,part->Pt(),part->Phi(),ptbin};
107 if (fD0Properties) fD0Properties->Fill(D0Stuff);
108 }
109
110 return 0;
111}
112
72c0a987 113bool AliDxHFEParticleSelectionD0::IsSelected(AliVParticle* /*p*/)
114{
115 /// TODO: implement specific selection of D0 candidates
116 return true;
117}