]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnReader.h
Package upgrade.
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnReader.h
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * See cxx source for full Copyright notice                               *
4  **************************************************************************/
5
6 //
7 // ==== Class AliRsnReader ========
8 //
9 // This object reads a 'standard' event and converts it into the internal
10 // format used for resonance analysis (AliRsnEvent).
11 // 'Standard' event means ESD, standard AOD and MC event.
12 //
13 // The input-2-AliRsnEvent conversion is done through a class which reads
14 // from AliAnalysisTaskSE, which is the standard analysis object. 
15 // This class creates the AliRsnEvent's before the input event is read, 
16 // so this class has not to 'create' a new outpu event, but instead it has 
17 // to 'fill' one which has already been created elsewhere.
18 // Then, the methods provided here accept an AliRsnEvent as argument passed
19 // by reference, and they 'fill' this object using the data from the inputs
20 // passed to them.
21 // 
22 // author: A. Pulvirenti
23 // email : alberto.pulvirenti@ct.infn.it
24 //
25
26 #ifndef ALIRSNREADER_H
27 #define ALIRSNREADER_H
28
29 class AliVEvent;
30 class AliESDEvent;
31 class AliAODEvent;
32 class AliMCEvent;
33 class AliRsnEvent;
34 class AliRsnPIDWeightsMgr;
35
36 class AliRsnReader : public TObject
37 {
38 public:
39
40     enum ESource {
41         kESD = 0,
42         kESDTPC,
43         kAOD,
44         kMC,
45         kSources
46     };
47
48     AliRsnReader(ESource source = kESD, AliRsnPIDWeightsMgr *mgr = 0x0);
49     AliRsnReader(const AliRsnReader& copy);
50     AliRsnReader& operator=(const AliRsnReader& copy);
51     virtual ~AliRsnReader() {}
52     
53     void    SetWeightsMgr(AliRsnPIDWeightsMgr *mgr) {fWeightsMgr = mgr;}
54     void    SetCheckSplit(Bool_t doit = kTRUE) {fCheckSplit = doit;}
55     void    SetRejectFakes(Bool_t doit = kTRUE) {fRejectFakes = doit;}
56     
57     Bool_t  Fill(AliRsnEvent *rsn, AliVEvent *event, AliMCEvent *refMC = 0);
58     
59 protected:
60
61     Bool_t  FillFromESD(AliRsnEvent *rsn, AliESDEvent *event, AliMCEvent *refMC = 0, Bool_t useTPCOnly = kFALSE);
62     Bool_t  FillFromAOD(AliRsnEvent *rsn, AliAODEvent *event, AliMCEvent *refMC = 0);
63     Bool_t  FillFromMC(AliRsnEvent *rsn, AliMCEvent *mc);
64
65     ESource              fSource;        // flag to choose what kind of data to be read
66     Bool_t               fCheckSplit;    // flag to check and remove split tracks
67     Bool_t               fRejectFakes;   // flag to reject fake tracks (negative label)
68     AliRsnPIDWeightsMgr *fWeightsMgr;    // manager for alternative PID weights
69
70 private:
71     
72     ClassDef(AliRsnReader, 1);
73 };
74
75 #endif