]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGHF/correlationHF/AliDxHFECorrelationMC.cxx
Add Id
[u/mrichter/AliRoot.git] / PWGHF / correlationHF / AliDxHFECorrelationMC.cxx
1
2 //**************************************************************************
3 //* This file is property of and copyright by the ALICE Project            * 
4 //* ALICE Experiment at CERN, All rights reserved.                         *
5 //*                                                                        *
6 //* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no>        *
7 //*                  Sedat Altinpinar <Sedat.Altinpinar@cern.ch>           *
8 //*                  Hege Erdal       <hege.erdal@gmail.com>               *
9 //*                                                                        *
10 //* Permission to use, copy, modify and distribute this software and its   *
11 //* documentation strictly for non-commercial purposes is hereby granted   *
12 //* without fee, provided that the above copyright notice appears in all   *
13 //* copies and that both the copyright notice and this permission notice   *
14 //* appear in the supporting documentation. The authors make no claims     *
15 //* about the suitability of this software for any purpose. It is          *
16 //* provided "as is" without express or implied warranty.                  *
17 //**************************************************************************
18
19 // $Id$
20
21 /// @file   AliDxHFECorrelationMC.cxx
22 /// @author Sedat Altinpinar, Hege Erdal, Matthias Richter
23 /// @date   2012-11-02
24 /// @brief  Worker class for DxHFE correlation
25 ///
26
27 #include "AliDxHFECorrelationMC.h"
28 #include "AliVParticle.h"
29 #include "AliLog.h"
30 //#include "AliAnalysisCuts.h"         // required dependency libANALYSISalice.so
31 //#include "AliFlowTrackSimple.h"      // required dependency libPWGflowBase.so
32 //#include "AliFlowCandidateTrack.h"   // required dependency libPWGflowTasks.so
33 //#include "AliCFContainer.h"          // required dependency libCORRFW.so
34 //#include "AliAODRecoDecayHF2Prong.h"   // libPWGHFvertexingHF
35 #include "TObjArray.h"
36 #include "AliDxHFECorrelation.h"
37 #include "TMath.h"
38 #include "TFile.h"
39 #include "TCanvas.h"
40 #include "TDatabasePDG.h"
41 #include "TLorentzVector.h"
42 #include "AliReducedParticle.h"
43 #include "AliDxHFEParticleSelection.h"
44 #include <iostream>
45 #include <cerrno>
46 #include <memory>
47
48 using namespace std;
49
50 ClassImp(AliDxHFECorrelationMC)
51
52 AliDxHFECorrelationMC::AliDxHFECorrelationMC(const char* name)
53   : AliDxHFECorrelation(name?name:"AliDxHFECorrelationMC")
54   , fMCEventType(0)
55 {
56   // default constructor
57   // 
58   //
59
60 }
61
62
63 AliDxHFECorrelationMC::~AliDxHFECorrelationMC()
64 {
65   // destructor
66   //
67   //
68
69 }
70
71 THnSparse* AliDxHFECorrelationMC::DefineTHnSparse()
72 {
73   //
74   // Defines the THnSparse. 
75
76   // here is the only place to change the dimension
77   static const int sizeEventdphi = 10;  
78   InitTHnSparseArray(sizeEventdphi);
79   const double pi=TMath::Pi();
80   Double_t minPhi=GetMinPhi();
81   Double_t maxPhi=GetMaxPhi();
82
83   // TODO: Everything here needed for eventmixing? 
84   //                                            0        1     2      3      4     5       6      7    8      9
85   //                                          D0invmass  PtD0 PhiD0 PtbinD0 Pte  dphi    dEta OrigD0 origEl process
86   int         binsEventdphi[sizeEventdphi] = {   200,   1000,  100,  21,   1000, 100,     100,   10,     14,  100 };
87   double      minEventdphi [sizeEventdphi] = { 1.5648,     0,    0,   0,     0 , minPhi, -0.9, -1.5,   -1.5, -0.5 };
88   double      maxEventdphi [sizeEventdphi] = { 2.1648,   100, 2*pi,  20,    100, maxPhi,  0.9,  8.5,   12.5, 99.5 };
89   const char* nameEventdphi[sizeEventdphi] = {
90     "D0InvMass",
91     "PtD0",
92     "PhiD0",
93     "PtBinD0",
94     "PtEl",
95     "#Delta#Phi",
96     "#Delta#eta", 
97     "Origin D0", 
98     "Origin Electron",
99     "Original Process"
100 };
101
102   TString name;
103   name.Form("%s info", GetName());
104
105
106   return CreateControlTHnSparse(name,sizeEventdphi,binsEventdphi,minEventdphi,maxEventdphi,nameEventdphi);
107
108
109 }
110
111
112 int AliDxHFECorrelationMC::FillParticleProperties(AliVParticle* tr, AliVParticle *as, Double_t* data, int dimension) const
113 {
114   // fill the data array from the particle data
115   if (!data) return -EINVAL;
116   AliReducedParticle *ptrigger=(AliReducedParticle*)tr;
117   AliReducedParticle *assoc=(AliReducedParticle*)as;
118   if (!ptrigger || !assoc) return -ENODATA;
119   int i=0;
120   if (dimension!=GetDimTHnSparse()) {
121     // TODO: think about filling only the available data and throwing a warning
122     return -ENOSPC;
123   }
124   data[i++]=ptrigger->GetInvMass();
125   data[i++]=ptrigger->Pt();
126   data[i++]=ptrigger->Phi();
127   data[i++]=ptrigger->GetPtBin(); 
128   data[i++]=assoc->Pt();
129   data[i++]=AliDxHFECorrelation::GetDeltaPhi();
130   data[i++]=AliDxHFECorrelation::GetDeltaEta();
131   data[i++]=ptrigger->GetOriginMother();
132   data[i++]=assoc->GetOriginMother();
133   data[i++]=fMCEventType;
134   
135   return i;
136 }
137
138 int AliDxHFECorrelationMC::Fill(const TObjArray* triggerCandidates, TObjArray* associatedTracks, const AliVEvent* pEvent)
139 {
140   // TODO: Implement more on MC?? (Needed?)
141   return AliDxHFECorrelation::Fill(triggerCandidates,associatedTracks,pEvent);
142 }
143