]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGJE/EMCALJetTasks/Tracks/AliEMCalTriggerAnaTriggerDecision.cxx
Refactoring of the EMCAL jet package:
[u/mrichter/AliRoot.git] / PWGJE / EMCALJetTasks / Tracks / AliEMCalTriggerAnaTriggerDecision.cxx
CommitLineData
08f5b3a3 1/**************************************************************************
2 * Copyright(c) 1998-2014, 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 * Class performing the selection of triggered events
17 *
18 * Author:
19 * Markus Fasel
20 */
d824c93c 21#include <TClonesArray.h>
22#include <TString.h>
d824c93c 23#include "AliVEvent.h"
d824c93c 24#include "AliEmcalTriggerPatchInfo.h"
25#include "AliEMCalTriggerAnaTriggerDecision.h"
26#include "AliEMCalTriggerEventData.h"
27
28ClassImp(EMCalTriggerPtAnalysis::AliEMCalTriggerAnaTriggerDecision)
29
30namespace EMCalTriggerPtAnalysis {
31
32//______________________________________________________________________________
33AliEMCalTriggerAnaTriggerDecision::AliEMCalTriggerAnaTriggerDecision() :
34 fSwapThresholds(kFALSE),
35 fIsMinBias(kFALSE)
36{
37 /*
38 * Main constructor
39 */
40 Reset();
41}
42
43//______________________________________________________________________________
44void AliEMCalTriggerAnaTriggerDecision::Create(const AliEMCalTriggerEventData* const data) {
45 /*
46 * Steer creation of the trigger decision
47 *
48 * @param data: all event information
49 */
50 Reset();
51 MakeDecisionFromPatches(*(data->GetTriggerPatchContainer()));
52 MakeDecisionFromString(data->GetRecEvent()->GetFiredTriggerClasses());
53}
54
55//______________________________________________________________________________
56void AliEMCalTriggerAnaTriggerDecision::Reset() {
57 for(int itrg = 0; itrg < 4; itrg++){
58 fDecisionFromPatches[itrg] = kFALSE;
59 fDecisionFromString[itrg] = kFALSE;
60 }
61}
62
63//______________________________________________________________________________
64void AliEMCalTriggerAnaTriggerDecision::MakeDecisionFromString(const TString& triggerstring) {
65 /*
66 * Create trigger decision from trigger string
67 *
68 * @param triggerstring: the trigger string
69 */
70 if(triggerstring.Contains("EJ1")) fDecisionFromString[kTAEMCJHigh] = kTRUE;
71 if(triggerstring.Contains("EJ2")) fDecisionFromString[kTAEMCJLow] = kTRUE;
72 if(triggerstring.Contains("EG1")) fDecisionFromString[kTAEMCGHigh] = kTRUE;
73 if(triggerstring.Contains("EG2")) fDecisionFromString[kTAEMCGLow] = kTRUE;
74}
75
76//______________________________________________________________________________
77void AliEMCalTriggerAnaTriggerDecision::MakeDecisionFromPatches(const TClonesArray& listOfPatches) {
78 /*
79 * Create trigger decision from trigger patches. In case swap thresholds is requested, the low threshold
80 * triggers are replaced by the high threshold triggers and vice versa
81 *
82 * @param triggerstring: the TClonesArray of the trigger patches, created by the trigger patch maker
83 */
84 TIter patchIter(&listOfPatches);
85 AliEmcalTriggerPatchInfo *mypatch(NULL);
86 while((mypatch = dynamic_cast<AliEmcalTriggerPatchInfo *>(patchIter()))){
87 if(mypatch->IsJetHigh()) fDecisionFromPatches[fSwapThresholds ? kTAEMCJLow : kTAEMCJHigh] = kTRUE;
88 if(mypatch->IsJetLow()) fDecisionFromPatches[fSwapThresholds ? kTAEMCJHigh : kTAEMCJLow] = kTRUE;
89 if(mypatch->IsGammaHigh()) fDecisionFromPatches[fSwapThresholds ? kTAEMCGLow : kTAEMCGHigh] = kTRUE;
90 if(mypatch->IsGammaLow()) fDecisionFromPatches[fSwapThresholds ? kTAEMCGHigh : kTAEMCJLow] = kTRUE;
91 }
92}
93
94} /* namespace EMCalTriggerPtAnalysis */