15 #include <TClonesArray.h>
16 #include <THashList.h>
17 #include <THistManager.h>
18 #include <TObjArray.h>
20 #include "AliEMCALTriggerBitConfig.h"
21 #include "AliEMCALTriggerPatchInfo.h"
38 fCaloTriggersOutName("EmcalTriggers"),
39 fV0InName("AliAODVZERO"),
40 fUseL0Amplitudes(kFALSE),
52 fCaloTriggersOutName(
"EmcalTriggers"),
53 fV0InName(
"AliAODVZERO"),
54 fUseL0Amplitudes(kFALSE),
55 fCaloTriggersOut(NULL),
71 const TString kTriggerTypeNames[3] = {
"EJE",
"EGA",
"EL0"},
72 kPatchTypes[3] = {
"Online",
"Offline",
"Recalc"};
75 fQAHistos =
new THistManager(
"TriggerQA");
77 for(
const TString *triggertype = kTriggerTypeNames; triggertype < kTriggerTypeNames +
sizeof(kTriggerTypeNames)/
sizeof(TString); triggertype++){
78 for(
const TString *patchtype = kPatchTypes; patchtype < kPatchTypes +
sizeof(kPatchTypes)/
sizeof(TString); ++patchtype){
80 Form(
"RCPos%s%s", triggertype->Data(), patchtype->Data()),
81 Form(
"Lower edge position of %s %s patches (col-row);iEta;iPhi", patchtype->Data(), triggertype->Data()),
82 48, -0.5, 47.5, 104, -0.5, 103.5
85 Form(
"EPCentPos%s%s", triggertype->Data(), patchtype->Data()),
86 Form(
"Center position of the %s %s trigger patches;#eta;#phi", patchtype->Data(), triggertype->Data()),
87 20, -0.8, 0.8, 700, 0., 7.
90 Form(
"PatchADCvsE%s%s", triggertype->Data(), patchtype->Data()),
91 Form(
"Patch ADC value for trigger type %s %s;Trigger ADC;FEE patch energy (GeV)", patchtype->Data(), triggertype->Data()),
92 2000, 0., 2000, 200, 0., 200
95 Form(
"PatchADCOffvsE%s%s", triggertype->Data(), patchtype->Data()),
96 Form(
"Patch offline ADC value for trigger type %s %s;Trigger ADC;FEE patch energy (GeV)", patchtype->Data(), triggertype->Data()),
97 2000, 0., 2000, 200, 0., 200
101 fQAHistos->CreateTH1(
"triggerBitsAll",
"Trigger bits for all incoming patches;bit nr", 64, -0.5, 63.5);
102 fQAHistos->CreateTH1(
"triggerBitsSel",
"Trigger bits for reconstructed patches;bit nr", 64, -0.5, 63.5);
110 AliEMCALTriggerBitConfig *triggerBitConfig(NULL);
113 triggerBitConfig =
new AliEMCALTriggerBitConfigNew();
116 triggerBitConfig =
new AliEMCALTriggerBitConfigOld();
139 AliFatal(Form(
"%s: Container with same name %s already present. Aborting", GetName(),
fCaloTriggersOutName.Data()));
145 fV0 = (AliVVZERO*)InputEvent()->FindListObject(
fV0InName);
167 AliEMCALTriggerPatchInfo *recpatch = NULL;
168 Int_t patchcounter = 0;
169 TString triggerstring;
170 AliDebug(2,Form(
"Trigger maker - Found %d patches\n", patches->GetEntries()));
171 for(TIter patchIter = TIter(patches).Begin(); patchIter != TIter::End(); ++patchIter){
172 recpatch =
dynamic_cast<AliEMCALTriggerPatchInfo *
>(*patchIter);
175 std::stringstream triggerbitstring;
176 AliDebug(1, Form(
"Trigger maker - next patch: size %d, trigger bits %s", recpatch->GetPatchSize(), triggerbitstring.str().c_str()));
178 if(recpatch->IsJetHigh() || recpatch->IsJetLow())
FillQAHistos(
"EJEOnline", *recpatch);
179 if(recpatch->IsGammaHigh() || recpatch->IsGammaLow())
FillQAHistos(
"EGAOnline", *recpatch);
180 if(recpatch->IsJetHighSimple() || recpatch->IsJetLowSimple())
FillQAHistos(
"EJEOffline", *recpatch);
181 if(recpatch->IsGammaHighSimple() || recpatch->IsGammaLowSimple())
FillQAHistos(
"EGAOffline", *recpatch);
182 if(recpatch->IsLevel0())
FillQAHistos(
"EL0Online", *recpatch);
183 if(recpatch->IsRecalcJet())
FillQAHistos(
"EJERecalc", *recpatch);
184 if(recpatch->IsRecalcGamma())
FillQAHistos(
"EGARecalc", *recpatch);
186 int tBits = recpatch->GetTriggerBits();
187 for(
unsigned int ibit = 0; ibit <
sizeof(tBits)*8; ibit++) {
188 if(tBits & (1 << ibit)){
189 fQAHistos->FillTH1(
"triggerBitsSel", ibit);
193 new((*fCaloTriggersOut)[patchcounter++]) AliEMCALTriggerPatchInfo(*recpatch);
195 if(patches)
delete patches;
200 fQAHistos->FillTH2(Form(
"RCPos%s", patchtype.Data()), recpatch.GetColStart(), recpatch.GetRowStart());
201 fQAHistos->FillTH2(Form(
"EPCentPos%s", patchtype.Data()), recpatch.GetEtaGeo(), recpatch.GetPhiGeo());
202 fQAHistos->FillTH2(Form(
"PatchADCvsE%s", patchtype.Data()), recpatch.GetADCAmp(), recpatch.GetPatchE());
203 fQAHistos->FillTH2(Form(
"PatchADCOffvsE%s", patchtype.Data()), recpatch.GetADCOfflineAmp(), recpatch.GetPatchE());
AliVVZERO * fV0
! VZERO data
AliEmcalTriggerMakerTask()
New configuration, distiction between high and low threshold.
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
Base task in the EMCAL framework.
TObjArray * CreateTriggerPatches(const AliVEvent *inputevent, Bool_t useL0amp=kFALSE)
void SetTriggerBitConfig(const AliEMCALTriggerBitConfig *const config)
Bool_t fUseL0Amplitudes
Use L0 amplitudes instead of L1 time sum (useful for runs where STU was not read) ...
virtual void UserCreateOutputObjects()
TList * fOutput
!output list
void SetIsMC(Bool_t isMC)
void ReadTriggerData(AliVCaloTrigger *trigger)
virtual ~AliEmcalTriggerMakerTask()
TString fV0InName
name of output track array
Old configuration, no distinction between high and low threshold.
AliEMCALGeometry * fGeom
!emcal geometry
void SetUseTriggerBitConfig(TriggerMakerBitConfig_t bitConfig)
AliEmcalTriggerMakerKernel * fTriggerMaker
The actual trigger maker kernel.
EMCAL trigger maker taskThe EMCAL trigger maker task steers the process building trigger patches...
AliVCaloCells * fCaloCells
!cells
void BuildL1ThresholdsOffline(const AliVVZERO *vzdata)
void SetGeometry(const AliEMCALGeometry *const geo)
void FillQAHistos(const TString &patchtype, const AliEMCALTriggerPatchInfo &recpatch)
TString fCaloTriggersOutName
name of output track array
TClonesArray * fCaloTriggersOut
! trigger array out
Kernel of the EMCAL trigger patch makerThe trigger maker kernel contains the core functionality of th...
AliVCaloTrigger * fCaloTriggers
!calo triggers
void UserCreateOutputObjects()
Bool_t fInitialized
whether or not the task has been already initialized
THistManager * fQAHistos
! Histograms for QA
Bool_t fDoQA
Fill QA histograms.
void ReadCellData(AliVCaloCells *cells)