AliRoot Core  edcc906 (edcc906)
AliEMCALTriggerQA.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2016, 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  **************************************************************************/
23 #include "AliEMCALGeometry.h"
24 
25 #include "AliEMCALTriggerQA.h"
26 
27 using namespace EMCALTrigger;
28 
30 ClassImp(AliEMCALTriggerQA)
32 
33 const Int_t AliEMCALTriggerQA::fgkMaxPatchAmp[6] = {2000, 2000, 2000, 6000, 6000, 5000};
34 const TString AliEMCALTriggerQA::fgkPatchTypes[3] = {"Online", "Recalc", "Offline"};
35 
40  TNamed(),
41  fFastorL0Th(400),
42  fFastorL1Th(400),
43  fADCperBin(16),
44  fDebugLevel(0),
45  fTimeStampBinWidth(0),
46  fGeom(0),
47  fEventTimeStamp(0),
48  fEventTimeStampBin(0)
49 {
51 }
52 
58  TNamed(name,name),
59  fFastorL0Th(400),
60  fFastorL1Th(400),
61  fADCperBin(16),
62  fDebugLevel(0),
64  fGeom(0),
65  fEventTimeStamp(0),
67 {
69 }
70 
76  TNamed(ref),
82  fGeom(0),
83  fEventTimeStamp(0),
85 {
87 }
88 
93 {
94 }
95 
103 {
104  if (e) {
105  fEnabledTriggerPatches[patchtype] |= BIT(triggertype);
106  }
107  else {
108  fEnabledTriggerPatches[patchtype] &= ~(BIT(triggertype));
109  }
110 }
111 
117 Bool_t AliEMCALTriggerQA::IsPatchTypeEnabled(Int_t patchtype, Int_t triggertype) const
118 {
119  if (patchtype < 0 || patchtype > 2) return kFALSE;
120  if (triggertype < 0 || triggertype > 31) return kFALSE;
121  if ((fEnabledTriggerPatches[patchtype] & BIT(triggertype)) != 0) {
122  return kTRUE;
123  }
124  else {
125  return kFALSE;
126  }
127 }
128 
136 {
137  if (!patch) return 0;
138  if (itype == 0 || itype == 1) {
139  return patch->GetADCAmp();
140  }
141  else if (itype == 2) {
142  return patch->GetADCOfflineAmp();
143  }
144  else {
145  return 0;
146  }
147 }
148 
155 void AliEMCALTriggerQA::EventTimeStamp(UInt_t timeStamp)
156 {
157  fEventTimeStamp = timeStamp;
158 
159  if (fTimeStampBinWidth == 0) return;
160 
161  UInt_t timeStampBins = fEventTimeStamp / fTimeStampBinWidth;
162  fEventTimeStampBin = timeStampBins*fTimeStampBinWidth;
163 }
164 
167 {
168  if (!fGeom) {
170  if (!fGeom) {
171  AliError("Could not get geometry!");
172  }
173  }
174 }
static const TString fgkPatchTypes[fgkNPatchTypes]
Patch type names.
UInt_t fEventTimeStamp
! Time stamp of the current event
Int_t fADCperBin
ADC counts per bin.
virtual void ExecOnce()
Actions to be executed only once for the first event.
static Int_t GetAmplitude(const AliEMCALTriggerPatchInfo *patch, Int_t itype)
Int_t fDebugLevel
Debug level.
virtual void EventTimeStamp(UInt_t timeStamp)
UInt_t fEventTimeStampBin
! Time stamp bin
Bool_t IsPatchTypeEnabled(Int_t patchtype, Int_t triggertype) const
UInt_t fTimeStampBinWidth
Time stamp bin width.
UInt_t fEnabledTriggerPatches[fgkNPatchTypes]
Patch types to be plotted.
Main data structure storing all relevant information of EMCAL/DCAL trigger patches.
Class to generate EMCal trigger QA plots.
Int_t fFastorL1Th
FastOR L1 threshold.
Int_t fFastorL0Th
FastOR L0 threshold.
#define AliError(message)
Definition: AliLog.h:591
static AliEMCALGeometry * GetInstance()
EMCalTriggerType_t
Definition of different trigger patch types.
const AliEMCALGeometry * fGeom
! Pointer to the EMCal geometry
void EnablePatchType(PatchTypes_t patchtype, EMCalTriggerType_t triggertype, Bool_t e)