AliPhysics  vAN-20151012 (2287573)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliAnalysisTaskEmcalTriggerSelection.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2007, 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  * Task providing an event selection for EMCAL-triggered events based on the
17  * reconstructed EMCAL trigger patches
18  *
19  * Author: Markus Fasel
20  */
21 
26 
28 
29 //______________________________________________________________________________
32  fGlobalDecisionContainerName(),
33  fTriggerSelections()
34 {
35  /*
36  * Dummy constructor, only for I/O, not to be used by the user
37  */
38  fTriggerSelections.SetOwner(kTRUE);
39 }
40 
41 //______________________________________________________________________________
43  AliAnalysisTaskEmcal(name, kFALSE),
44  fGlobalDecisionContainerName(),
45  fTriggerSelections()
46 {
47  /*
48  * Main constructor, to be called by the users
49  */
50  fTriggerSelections.SetOwner(kTRUE);
51 }
52 
53 //______________________________________________________________________________
55  /*
56  * Add trigger selection to the trigger selection task
57  *
58  * @param selection: the trigger selection to be added
59  */
60  fTriggerSelections.Add(selection);
61 }
62 
63 //______________________________________________________________________________
65  /*
66  * Run over all trigger selections, and append the selection to the global trigger selection container
67  */
69  cont->Reset();
70  TClonesArray *triggerPatches(fTriggerPatchInfo);
71  TIter selectionIter(&fTriggerSelections);
72  AliEmcalTriggerSelection *selection(NULL);
73  while((selection = dynamic_cast<AliEmcalTriggerSelection *>(selectionIter()))){
74  cont->AddTriggerDecision(selection->MakeDecison(triggerPatches));
75  }
76  return kTRUE;
77 }
78 
79 //______________________________________________________________________________
81  /*
82  * Find the main trigger container in the input event. If not available, create it and add it to the input event
83  */
84  AliEmcalTriggerDecisionContainer *cont(dynamic_cast<AliEmcalTriggerDecisionContainer *>(fInputEvent->FindListObject(fGlobalDecisionContainerName.Data())));
85  if(!cont){
87  fInputEvent->AddObject(cont);
88  }
89  return cont;
90 }
AliEmcalTriggerDecisionContainer * GetGlobalTriggerDecisionContainer()
ClassImp(AliAnalysisTaskEmcalTriggerSelection) AliAnalysisTaskEmcalTriggerSelection
void AddTriggerSelection(AliEmcalTriggerSelection *const selection)
AliEmcalTriggerDecision * MakeDecison(const TClonesArray *const reconstructedPatches) const
TClonesArray * fTriggerPatchInfo
calo triggers
void AddTriggerDecision(AliEmcalTriggerDecision *const decision)