4 #include "AliRsnEvent.h"
5 #include "AliMultiInputEventHandler.h"
6 #include "AliMixInputEventHandler.h"
7 #include "AliMCEventHandler.h"
9 #include "AliRsnInputHandler.h"
10 ClassImp(AliRsnInputHandler)
12 //_____________________________________________________________________________
13 AliRsnInputHandler::AliRsnInputHandler(const char *name) :
14 AliInputEventHandler(name, name),
19 // Default constructor.
21 AliDebug(AliLog::kDebug + 10, "<-");
22 AliDebug(AliLog::kDebug + 10, "->");
25 //_____________________________________________________________________________
26 AliRsnInputHandler::~AliRsnInputHandler()
31 AliDebug(AliLog::kDebug + 10, "<-");
33 AliDebug(AliLog::kDebug + 10, "->");
36 //_____________________________________________________________________________
37 Bool_t AliRsnInputHandler::Init(Option_t *opt)
40 // Init() is called for all mix input handlers.
42 AliDebug(AliLog::kDebug + 5, Form("<- opt=%s", opt));
44 AliDebug(AliLog::kDebug + 5, Form("->"));
47 //_____________________________________________________________________________
48 Bool_t AliRsnInputHandler::Init(TTree *tree, Option_t *opt)
51 // Init(const char*path) is called for all mix input handlers.
52 // Create event pool if needed
54 AliDebug(AliLog::kDebug + 5, Form("<- %p %s opt=%s", (void *) tree, tree->GetName(), opt));
55 AliDebug(AliLog::kDebug + 5, Form("->"));
58 //_____________________________________________________________________________
59 Bool_t AliRsnInputHandler::Notify()
62 // Notify() is called for all mix input handlers
64 AliDebug(AliLog::kDebug + 5, Form("<-"));
65 AliDebug(AliLog::kDebug + 5, Form("->"));
69 //_____________________________________________________________________________
70 Bool_t AliRsnInputHandler::Notify(const char *path)
73 // Notify(const char*path) is called for all mix input handlers
75 AliDebug(AliLog::kDebug + 5, Form("<- %s", path));
76 AliDebug(AliLog::kDebug + 5, "->");
79 //_____________________________________________________________________________
80 Bool_t AliRsnInputHandler::BeginEvent(Long64_t entry)
83 // BeginEvent(Long64_t entry) is called for all mix input handlers
85 AliDebug(AliLog::kDebug + 5, Form("<- %lld", entry));
89 AliInputEventHandler *ih = 0;
90 AliMultiInputEventHandler *multiIH = dynamic_cast<AliMultiInputEventHandler*>(fParentHandler);
92 ih = multiIH->GetFirstInputEventHandler();
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());
105 if (fParentHandler->ParentHandler()) tmp = "MIX";
107 //fRsnPIDManager.Reset();
109 //fRsnPIDManager.ApplyCuts(fRsnEvent);
110 fRsnSelector.Reset();
111 fRsnSelector.ScanEvent(fRsnEvent);
115 AliDebug(AliLog::kDebug + 5, "->");
119 Bool_t AliRsnInputHandler::GetEntry()
121 AliDebug(AliLog::kDebug + 5, "<-");
122 AliDebug(AliLog::kDebug + 5, "->");
126 //_____________________________________________________________________________
127 Bool_t AliRsnInputHandler::FinishEvent()
130 // FinishEvent() is called for all mix input handlers
132 AliDebug(AliLog::kDebug + 5, Form("<-"));
133 AliDebug(AliLog::kDebug + 5, Form("->"));