]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnInputHandler.cxx
07379c7d840b05159cd4812d226eaebf7128c1d0
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnInputHandler.cxx
1 #include "AliLog.h"
2
3 #include "AliRsnEvent.h"
4 #include "AliMultiInputEventHandler.h"
5 #include "AliMixInputEventHandler.h"
6 #include "AliMCEventHandler.h"
7
8 #include "AliRsnInputHandler.h"
9 ClassImp(AliRsnInputHandler)
10
11 //_____________________________________________________________________________
12 AliRsnInputHandler::AliRsnInputHandler(const char *name) :
13    AliInputEventHandler(name, name),
14    fRsnEvent(0),
15    fRsnSelector()
16 {
17 //
18 // Default constructor.
19 //
20    AliDebug(AliLog::kDebug + 10, "<-");
21    AliDebug(AliLog::kDebug + 10, "->");
22 }
23
24 //_____________________________________________________________________________
25 AliRsnInputHandler::~AliRsnInputHandler()
26 {
27 //
28 // Destructor
29 //
30    AliDebug(AliLog::kDebug + 10, "<-");
31    delete fRsnEvent;
32    AliDebug(AliLog::kDebug + 10, "->");
33 }
34
35 //_____________________________________________________________________________
36 Bool_t AliRsnInputHandler::Init(Option_t *opt)
37 {
38 //
39 // Init() is called for all mix input handlers.
40 //
41    AliDebug(AliLog::kDebug + 5, Form("<- opt=%s", opt));
42
43    AliDebug(AliLog::kDebug + 5, Form("->"));
44    return kTRUE;
45 }
46 //_____________________________________________________________________________
47 Bool_t AliRsnInputHandler::Init(TTree *tree, Option_t *opt)
48 {
49 //
50 // Init(const char*path) is called for all mix input handlers.
51 // Create event pool if needed
52 //
53    AliDebug(AliLog::kDebug + 5, Form("<- %p %s opt=%s", (void *) tree, tree->GetName(), opt));
54    AliDebug(AliLog::kDebug + 5, Form("->"));
55    return kTRUE;
56 }
57 //_____________________________________________________________________________
58 Bool_t AliRsnInputHandler::Notify()
59 {
60 //
61 // Notify() is called for all mix input handlers
62 //
63    AliDebug(AliLog::kDebug + 5, Form("<-"));
64    AliDebug(AliLog::kDebug + 5, Form("->"));
65    return kTRUE;
66 }
67
68 //_____________________________________________________________________________
69 Bool_t AliRsnInputHandler::Notify(const char *path)
70 {
71 //
72 // Notify(const char*path) is called for all mix input handlers
73 //
74    AliDebug(AliLog::kDebug + 5, Form("<- %s", path));
75    AliDebug(AliLog::kDebug + 5, "->");
76    return kTRUE;
77 }
78 //_____________________________________________________________________________
79 Bool_t AliRsnInputHandler::BeginEvent(Long64_t entry)
80 {
81 //
82 // BeginEvent(Long64_t entry) is called for all mix input handlers
83 //
84    AliDebug(AliLog::kDebug + 5, Form("<- %lld", entry));
85
86    if (fParentHandler) {
87       TString tmp = "";
88       AliInputEventHandler *ih = 0;
89       AliMultiInputEventHandler *multiIH = dynamic_cast<AliMultiInputEventHandler*>(fParentHandler);
90       if (multiIH) {
91          ih = multiIH->GetFirstInputEventHandler();
92          if (ih) {
93             if (!fRsnEvent) fRsnEvent = new AliRsnEvent();
94             fRsnEvent->SetRef(ih->GetEvent());
95             fRsnEvent->SetPIDResponse(ih->GetPIDResponse());
96             if (fRsnEvent->GetRefESD()) {
97                AliMCEventHandler *mcH =  multiIH->GetFirstMCEventHandler();
98                if (mcH) fRsnEvent->SetRefMC(mcH->MCEvent());
99             } else if (fRsnEvent->GetRefAOD()) {
100                // TODO AOD MC
101 //                fRsnEvent->SetRefMC(mcH->MCEvent());
102             }
103             if (fParentHandler->ParentHandler()) tmp = "MIX";
104             // applying pid cuts
105             //fRsnPIDManager.Reset();
106
107             //fRsnPIDManager.ApplyCuts(fRsnEvent);
108             fRsnSelector.Reset();
109             fRsnSelector.ScanEvent(fRsnEvent);
110          }
111       }
112    }
113    AliDebug(AliLog::kDebug + 5, "->");
114    return kTRUE;
115 }
116
117 Bool_t AliRsnInputHandler::GetEntry()
118 {
119    AliDebug(AliLog::kDebug + 5, "<-");
120    AliDebug(AliLog::kDebug + 5, "->");
121    return kTRUE;
122 }
123
124 //_____________________________________________________________________________
125 Bool_t AliRsnInputHandler::FinishEvent()
126 {
127    //
128    // FinishEvent() is called for all mix input handlers
129    //
130    AliDebug(AliLog::kDebug + 5, Form("<-"));
131    AliDebug(AliLog::kDebug + 5, Form("->"));
132    return kTRUE;
133 }