1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 // Class AliHFEvarManager
17 // Common place for definiton of variables to be filled into the
18 // correction framework container
19 // More information can be found inside the implementation file
21 #ifndef ALIHFEVARMANAGER_H
22 #define ALIHFEVARMANAGER_H
31 typedef class THnSparseT<TArrayF> THnSparseF;
35 class AliHFEcontainer;
36 class AliHFEsignalCuts;
40 class AliHFEvarManager : public TNamed{
52 AliHFEvarManager(const Char_t *name);
53 AliHFEvarManager(const AliHFEvarManager &ref);
54 AliHFEvarManager &operator=(const AliHFEvarManager &ref);
55 void Copy(TObject &o) const;
58 TObjArray *GetVariables() const { return fVariables; }
60 void SetOwner(Bool_t owner = kTRUE) { SetBit(kOwner, owner); }
61 Bool_t IsOwner() const { return TestBit(kOwner); }
63 void AddVariable(TString name);
64 Bool_t IsVariableDefined(TString name);
65 void DefineVariables(AliHFEcontainer *cont);
66 void NewTrack(AliVParticle *track, AliVParticle *mcTrack = NULL, Float_t centrality = 99.0, Int_t aprioriPID = -1, Bool_t signal = kTRUE);
67 Bool_t IsSignalTrack() const { return fSignalTrack; }
68 void FillContainer(AliCFContainer *const cont, Int_t step, Bool_t useMC = kFALSE) const;
69 void FillContainer(const AliHFEcontainer *const cont, const Char_t *contname, UInt_t step, Bool_t useMC = kFALSE, Double_t externalWeight = 1.) const;
70 void FillContainerStepname(const AliHFEcontainer *const cont, const Char_t *contname, const Char_t *step, Bool_t useMC = kFALSE, Double_t externalWeight = 1.) const;
71 void FillCorrelationMatrix(THnSparseF *matrix) const;
73 void SetSignalCuts(AliHFEsignalCuts *signal) { fSignal = signal; }
74 void SetWeightFactors(TH3F *weightFactors);
75 void SetWeightFactorsFunction(TF3*weightFactorsFunction);
77 struct AliHFEvariable : public TNamed{
80 AliHFEvariable(const Char_t *name, const Char_t *title, UInt_t fCode, UInt_t nBins, Double_t min, Double_t max, Bool_t isLogarithmic = kFALSE);
81 AliHFEvariable(const AliHFEvariable &ref);
82 AliHFEvariable &operator=(const AliHFEvariable &ref);
85 UInt_t GetVarCode() const { return fCode; }
86 UInt_t GetNumberOfBins() const { return fNBins; }
87 Double_t GetMinimum() const { return fMin; }
88 Double_t GetMaximum() const { return fMax; }
89 Int_t IsLogarithmic() const { return fIsLogarithmic; }
91 UInt_t fCode; // Unique variable code
92 UInt_t fNBins; // Number of bins
93 Double_t fMin; // Minimum
94 Double_t fMax; // Maximum
95 Bool_t fIsLogarithmic; // Logarithmic binning
97 ClassDef(AliHFEvarManager::AliHFEvariable, 1) // HFE variable definition
101 Double_t GetValue(AliVParticle *track, UInt_t code, Float_t centrality = 99.0, Int_t aprioriPID = -1) const;
102 void FillArray(AliVParticle *track, Double_t *container, Float_t centrality = 99.0, Int_t aprioriPID = -1) const;
103 Double_t FindWeight(Double_t pt, Double_t eta, Double_t phi) const;
109 TObjArray *fVariables; // Variables to process
110 Double_t *fContent; //! Cache values for track in classmember
111 Double_t *fContentMC; //! Cache content of the asssociated MC track in class member
112 Double_t fWeightFactor; // Cache weighting factor
113 Bool_t fSignalTrack; // Signal Track
114 Bool_t fWeighting; // Weighting or not for the efficiency maps
115 AliHFEsignalCuts *fSignal; // MC Signal Definition
116 TH3F *fWeightFactors; // Weight factors
117 TF3 *fWeightFactorsFunction; // Weight factors
119 ClassDef(AliHFEvarManager, 1) // The variable Manager for the HFE Analysis
122 #endif /* ALIHFEVARMANAGER_H */