Analysis example for the determination of priors for PID from a Bayesian iteration...
[u/mrichter/AliRoot.git] / ANALYSIS / AliPriorsTask.h
CommitLineData
9ab172e7 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16#ifndef AliPriorsTask_H
17#define AliPriorsTask_H
18
19#include "AliAnalysisTaskSE.h"
20#include "AliPID.h"
21class TH1I;
22class TH2D;
23
24class AliPriorsTask : public AliAnalysisTaskSE {
25 public:
26
27
28 AliPriorsTask();
29 AliPriorsTask(const Char_t* name);
30 AliPriorsTask& operator= (const AliPriorsTask& c);
31 AliPriorsTask(const AliPriorsTask& c);
32 virtual ~AliPriorsTask();
33
34 // ANALYSIS FRAMEWORK STUFF to loop on data and fill output objects
35 void UserCreateOutputObjects();
36 void UserExec(Option_t *option);
37 void Terminate(Option_t *);
38
39 void SetPriors(Double_t conc[AliPID::kSPECIES]) {for(Int_t i=0; i<AliPID::kSPECIES; i++) fPriors[i]=conc[i];}
40 void GetPriors(Double_t conc[AliPID::kSPECIES]) {for(Int_t i=0; i<AliPID::kSPECIES; i++) conc[i]=fPriors[i];}
41
42 void SetNiterations(Int_t nIter) {fNiterMax = nIter;}
43
44 Bool_t NotifyBinChange(); // method called at the end of the event loop
45
46 protected:
47
48 // Histograms
49
50 TH1I *fHistEventsProcessed; // simple histo for monitoring the number of events processed
51 TH2D *fCalcPriors; // histo monitoring priors during iterations
52
53 Double_t fPriors[AliPID::kSPECIES];
54 Double_t fRecId[AliPID::kSPECIES];
55 Double_t fMCId[AliPID::kSPECIES];
56
57 Int_t fNiterations; //counter
58 Int_t fNiterMax; //max number of iterations
59 ClassDef(AliPriorsTask,1);
60};
61
62#endif