3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
8 ////////////////////////////////////////////////////////////////////////////////
10 // Construction of invariant mass and combinatorial background.
15 // TObjArray* photons=new TObjArray(); // Array with photon tracks for pi0 rec.
17 // // Code to create some photon tracks from pi0 decays
19 // for (Int_t i=0; i<ntracks; i++)
21 // photons->Add(new Alitrack);
27 // // Perform the invariant mass and comb. bkg. reconstruction
29 // TObjArray* allm=q.Invmass(photons,photons); // All reconstructed invariant masses
31 // TH1F* hall=new TH1F("hall","hall",200,0,2); // Histo with M_inv of all combinations
34 // if (allm) nall=allm->GetEntries();
38 // for (Int_t j=0; j<nall; j++)
40 // t=(AliTrack*)allm->At(j);
48 // TObjArray* bkgm=q.CombBkg(photons,photons); // Reconstructed comb. background
50 // TH1F* hbkg=new TH1F("hbkg","hbkg",200,0,2); // Histo with M_inv. of comb. background
53 // if (bkgm) nbkg=bkgm->GetEntries();
55 // for (Int_t j=0; j<nbkg; j++)
57 // t=(AliTrack*)bkgm->At(j);
65 // TH1F* hsig=new TH1F("sig","sig",200,0,2); // Histo with the bkg. subtracted signal
67 // hsig->Add(hall,hbkg,1,-1);
70 // Note : By default the storage of the reconstructed information is performed
71 // in separate TObjArrays for the signal and comb. background resp.
72 // In order to limit the memory usage, AliInvmass::SetStorageMode(1) may be
73 // used to activate only a single TObjArray to store the reconstructed information.
74 // Consequently, the following statements
76 // TObjArray* allm=q.Invmass(photons,photons);
77 // TObjArray* bkgm=q.CombBkg(photons,photons);
79 // will result in the fact that after he invokation of CombBkg
80 // the information of "allm" is lost due to the fact that the storage is
81 // is re-used for "bkgm" in case the "single storage" option has been selected.
82 // Usage of the, in that case invalid, pointer "allm" may cause your
85 // * Thus : In case of single storage usage, all invokations of the returned
86 // array pointer have to be completed before invoking any memberfunction
87 // of the same AliInvmass object again.
91 //--- NvE 12-apr-1999 UU-SAP Utrecht
92 ////////////////////////////////////////////////////////////////////////////////
98 #include "TObjArray.h"
100 #include "AliRandom.h"
101 #include "AliTrack.h"
103 class AliInvmass : public TObject
106 AliInvmass(); // Default constructor
107 ~AliInvmass(); // Destructor
108 void SetStorageMode(Int_t m); // Set storage mode (1=single, 2=multiple)
109 void SetThetaSwitch(Int_t i=1); // Enable (1/0) new theta for comb. bkg. reco.
110 void SetPhiSwitch(Int_t i=1); // Enable (1/0) new phi for comb. bkg. reco.
111 Int_t GetStorageMode(); // Provide storage mode
112 Int_t GetThetaSwitch(); // Provide theta switch flag
113 Int_t GetPhiSwitch(); // Provide phi switch flag
114 TObjArray* Invmass(TObjArray* a1,TObjArray* a2); // Two-particle inv. mass reco.
115 TObjArray* CombBkg(TObjArray* a1,TObjArray* a2); // Two-particle comb. background reco.
118 Double_t fPi; // Value of pi
119 Int_t fMode; // Storage mode for signal and bkg. results (2=separate arrays)
120 Int_t fBkg; // Flag to denote comb. background processing
121 AliRandom fRndm; // The random number generator for the comb. bkg. reconstruction
122 Int_t fNewtheta; // Flag to denote enabling of switching theta for comb. bkg. reco.
123 Int_t fNewphi; // Flag to denote enabling of switching phi for comb. bkg. reco.
124 TObjArray* fMinv; // Array with reconstructed invariant mass 'tracks'
125 TObjArray* fMbkg; // Array with reconstructed comb. background 'tracks'
128 void Combine(TObjArray* a1,TObjArray* a2); // Make two-particle combinations
130 ClassDef(AliInvmass,1) // Class definition to enable ROOT I/O