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