]> git.uio.no Git - u/mrichter/AliRoot.git/blame - RALICE/AliInvmass.h
Introduction of the Copyright and cvs Log
[u/mrichter/AliRoot.git] / RALICE / AliInvmass.h
CommitLineData
d88f97cc 1#ifndef ALIINVMASS_H
2#define ALIINVMASS_H
3////////////////////////////////////////////////////////////////////////////////
4// Class AliInvmass
5// Construction of invariant mass and combinatorial background.
6//
7// Example :
8// ---------
9//
10// TObjArray* photons=new TObjArray(); // Array with photon tracks for pi0 rec.
11//
12// // Code to create some photon tracks from pi0 decays
13// Int_t ntracks=200;
14// for (Int_t i=0; i<ntracks; i++)
15// {
16// photons->Add(new Alitrack);
17// ...
18// ...
19// ...
20// }
21//
22// // Perform the invariant mass and comb. bkg. reconstruction
23//
24// TObjArray* allm=q.Invmass(photons,photons); // All reconstructed invariant masses
25//
26// TH1F* hall=new TH1F("hall","hall",200,0,2); // Histo with M_inv of all combinations
27//
28// Int_t nall=0;
29// if (allm) nall=allm->GetEntries();
30//
31// AliTrack* t;
32// Float_t minv;
33// for (Int_t j=0; j<nall; j++)
34// {
35// t=(AliTrack*)allm->At(j);
36// if (t)
37// {
38// minv=t->GetMass();
39// hall->Fill(minv);
40// }
41// }
42//
43// TObjArray* bkgm=q.CombBkg(photons,photons); // Reconstructed comb. background
44//
45// TH1F* hbkg=new TH1F("hbkg","hbkg",200,0,2); // Histo with M_inv. of comb. background
46//
47// Int_t nbkg=0;
48// if (bkgm) nbkg=bkgm->GetEntries();
49//
50// for (Int_t j=0; j<nbkg; j++)
51// {
52// t=(AliTrack*)bkgm->At(j);
53// if (t)
54// {
55// minv=t->GetMass();
56// hbkg->Fill(minv);
57// }
58// }
59//
60// TH1F* hsig=new TH1F("sig","sig",200,0,2); // Histo with the bkg. subtracted signal
61// hsig->Sumw2();
62// hsig->Add(hall,hbkg,1,-1);
63//
64//
65// Note : By default the storage of the reconstructed information is performed
66// in separate TObjArrays for the signal and comb. background resp.
67// In order to limit the memory usage, AliInvmass::SetStorageMode(1) may be
68// used to activate only a single TObjArray to store the reconstructed information.
69// Consequently, the following statements
70//
71// TObjArray* allm=q.Invmass(photons,photons);
72// TObjArray* bkgm=q.CombBkg(photons,photons);
73//
74// will result in the fact that after he invokation of CombBkg
75// the information of "allm" is lost due to the fact that the storage is
76// is re-used for "bkgm" in case the "single storage" option has been selected.
77// Usage of the, in that case invalid, pointer "allm" may cause your
78// program to crash.
79//
80// * Thus : In case of single storage usage, all invokations of the returned
81// array pointer have to be completed before invoking any memberfunction
82// of the same AliInvmass object again.
83//
84//
85//
86//--- NvE 12-apr-1999 UU-SAP Utrecht
87////////////////////////////////////////////////////////////////////////////////
88
89#include <iostream.h>
90#include <math.h>
91
92#include "TObject.h"
93#include "TObjArray.h"
94
95#include "AliRandom.h"
96#include "AliTrack.h"
97
98class AliInvmass : public TObject
99{
100 public:
101 AliInvmass(); // Default constructor
102 ~AliInvmass(); // Destructor
103 void SetStorageMode(Int_t m); // Set storage mode (1=single, 2=multiple)
104 void SetThetaSwitch(Int_t i=1); // Enable (1/0) new theta for comb. bkg. reco.
105 void SetPhiSwitch(Int_t i=1); // Enable (1/0) new phi for comb. bkg. reco.
106 Int_t GetStorageMode(); // Provide storage mode
107 Int_t GetThetaSwitch(); // Provide theta switch flag
108 Int_t GetPhiSwitch(); // Provide phi switch flag
109 TObjArray* Invmass(TObjArray* a1,TObjArray* a2); // Two-particle inv. mass reco.
110 TObjArray* CombBkg(TObjArray* a1,TObjArray* a2); // Two-particle comb. background reco.
111
112 protected:
113 Double_t fPi; // Value of pi
114 Int_t fMode; // Storage mode for signal and bkg. results (2=separate arrays)
115 Int_t fBkg; // Flag to denote comb. background processing
116 AliRandom fRndm; // The random number generator for the comb. bkg. reconstruction
117 Int_t fNewtheta; // Flag to denote enabling of switching theta for comb. bkg. reco.
118 Int_t fNewphi; // Flag to denote enabling of switching phi for comb. bkg. reco.
119 TObjArray* fMinv; // Array with reconstructed invariant mass 'tracks'
120 TObjArray* fMbkg; // Array with reconstructed comb. background 'tracks'
121
122 private:
123 void Combine(TObjArray* a1,TObjArray* a2); // Make two-particle combinations
124
125 ClassDef(AliInvmass,1) // Class definition to enable ROOT I/O
126};
127#endif