15 #include <TClonesArray.h>
17 #include <THashList.h>
19 #include <TObjArray.h>
20 #include <TParameter.h>
22 #include "AliEMCALTriggerBitConfig.h"
23 #include "AliEMCALTriggerPatchInfo.h"
27 #include "AliOADBContainer.h"
41 fCaloTriggersOutName("EmcalTriggers"),
42 fV0InName("AliAODVZERO"),
43 fBadFEEChannelOADB(""),
44 fUseL0Amplitudes(kFALSE),
56 fCaloTriggersOutName(
"EmcalTriggers"),
57 fV0InName(
"AliAODVZERO"),
58 fBadFEEChannelOADB(
""),
59 fUseL0Amplitudes(kFALSE),
60 fCaloTriggersOut(NULL),
76 const TString kTriggerTypeNames[3] = {
"EJE",
"EGA",
"EL0"},
77 kPatchTypes[3] = {
"Online",
"Offline",
"Recalc"};
82 for(
const TString *triggertype = kTriggerTypeNames; triggertype < kTriggerTypeNames +
sizeof(kTriggerTypeNames)/
sizeof(TString); triggertype++){
83 for(
const TString *patchtype = kPatchTypes; patchtype < kPatchTypes +
sizeof(kPatchTypes)/
sizeof(TString); ++patchtype){
85 Form(
"RCPos%s%s", triggertype->Data(), patchtype->Data()),
86 Form(
"Lower edge position of %s %s patches (col-row);iEta;iPhi", patchtype->Data(), triggertype->Data()),
87 48, -0.5, 47.5, 104, -0.5, 103.5
90 Form(
"EPCentPos%s%s", triggertype->Data(), patchtype->Data()),
91 Form(
"Center position of the %s %s trigger patches;#eta;#phi", patchtype->Data(), triggertype->Data()),
92 20, -0.8, 0.8, 700, 0., 7.
95 Form(
"PatchADCvsE%s%s", triggertype->Data(), patchtype->Data()),
96 Form(
"Patch ADC value for trigger type %s %s;Trigger ADC;FEE patch energy (GeV)", patchtype->Data(), triggertype->Data()),
97 2000, 0., 2000, 200, 0., 200
100 Form(
"PatchADCOffvsE%s%s", triggertype->Data(), patchtype->Data()),
101 Form(
"Patch offline ADC value for trigger type %s %s;Trigger ADC;FEE patch energy (GeV)", patchtype->Data(), triggertype->Data()),
102 2000, 0., 2000, 200, 0., 200
106 fQAHistos->
CreateTH1(
"triggerBitsAll",
"Trigger bits for all incoming patches;bit nr", 64, -0.5, 63.5);
107 fQAHistos->
CreateTH1(
"triggerBitsSel",
"Trigger bits for reconstructed patches;bit nr", 64, -0.5, 63.5);
115 AliEMCALTriggerBitConfig *triggerBitConfig(NULL);
118 triggerBitConfig =
new AliEMCALTriggerBitConfigNew();
121 triggerBitConfig =
new AliEMCALTriggerBitConfigOld();
144 AliFatal(Form(
"%s: Container with same name %s already present. Aborting", GetName(),
fCaloTriggersOutName.Data()));
150 fV0 = (AliVVZERO*)InputEvent()->FindListObject(
fV0InName);
172 AliEMCALTriggerPatchInfo *recpatch = NULL;
173 Int_t patchcounter = 0;
174 TString triggerstring;
175 AliDebug(2,Form(
"Trigger maker - Found %d patches\n", patches->GetEntries()));
176 for(TIter patchIter = TIter(patches).Begin(); patchIter != TIter::End(); ++patchIter){
177 recpatch =
dynamic_cast<AliEMCALTriggerPatchInfo *
>(*patchIter);
180 std::stringstream triggerbitstring;
181 AliDebug(1, Form(
"Trigger maker - next patch: size %d, trigger bits %s", recpatch->GetPatchSize(), triggerbitstring.str().c_str()));
183 if(recpatch->IsJetHigh() || recpatch->IsJetLow())
FillQAHistos(
"EJEOnline", *recpatch);
184 if(recpatch->IsGammaHigh() || recpatch->IsGammaLow())
FillQAHistos(
"EGAOnline", *recpatch);
185 if(recpatch->IsJetHighSimple() || recpatch->IsJetLowSimple())
FillQAHistos(
"EJEOffline", *recpatch);
186 if(recpatch->IsGammaHighSimple() || recpatch->IsGammaLowSimple())
FillQAHistos(
"EGAOffline", *recpatch);
187 if(recpatch->IsLevel0())
FillQAHistos(
"EL0Online", *recpatch);
188 if(recpatch->IsRecalcJet())
FillQAHistos(
"EJERecalc", *recpatch);
189 if(recpatch->IsRecalcGamma())
FillQAHistos(
"EGARecalc", *recpatch);
191 int tBits = recpatch->GetTriggerBits();
192 for(
unsigned int ibit = 0; ibit <
sizeof(tBits)*8; ibit++) {
193 if(tBits & (1 << ibit)){
198 new((*fCaloTriggersOut)[patchcounter++]) AliEMCALTriggerPatchInfo(*recpatch);
200 if(patches)
delete patches;
211 AliOADBContainer badchannelDB(
"EmcalBadChannelsAdditional");
213 TObjArray *badchannelmap =
static_cast<TObjArray *
>(badchannelDB.GetObject(InputEvent()->
GetRunNumber()));
214 if(!badchannelmap || !badchannelmap->GetEntries())
return;
215 for(TIter citer = TIter(badchannelmap).Begin(); citer != TIter::End(); ++citer){
222 fQAHistos->
FillTH2(Form(
"RCPos%s", patchtype.Data()), recpatch.GetColStart(), recpatch.GetRowStart());
223 fQAHistos->
FillTH2(Form(
"EPCentPos%s", patchtype.Data()), recpatch.GetEtaGeo(), recpatch.GetPhiGeo());
224 fQAHistos->
FillTH2(Form(
"PatchADCvsE%s", patchtype.Data()), recpatch.GetADCAmp(), recpatch.GetPatchE());
225 fQAHistos->
FillTH2(Form(
"PatchADCOffvsE%s", patchtype.Data()), recpatch.GetADCOfflineAmp(), recpatch.GetPatchE());
AliVVZERO * fV0
! VZERO data
AliEmcalTriggerMakerTask()
New configuration, distiction between high and low threshold.
void InitializeBadFEEChannels()
Base task in the EMCAL framework.
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
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()
void SetIsMC(Bool_t isMC)
virtual void RunChanged()
void ReadTriggerData(AliVCaloTrigger *trigger)
virtual ~AliEmcalTriggerMakerTask()
TString fV0InName
name of output track array
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
Old configuration, no distinction between high and low threshold.
THashList * GetListOfHistograms() const
AliEMCALGeometry * fGeom
!emcal geometry
void SetUseTriggerBitConfig(TriggerMakerBitConfig_t bitConfig)
AliEmcalTriggerMakerKernel * fTriggerMaker
The actual trigger maker kernel.
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
void AddOfflineBadChannel(Short_t absId)
EMCAL trigger maker taskThe EMCAL trigger maker task steers the process building trigger patches...
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
AliVCaloCells * fCaloCells
!cells
void BuildL1ThresholdsOffline(const AliVVZERO *vzdata)
AliEmcalList * fOutput
!output list
void SetGeometry(const AliEMCALGeometry *const geo)
void FillQAHistos(const TString &patchtype, const AliEMCALTriggerPatchInfo &recpatch)
TString fBadFEEChannelOADB
name of the OADB container containing channels to be masked inside the trigger maker ...
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
TString fCaloTriggersOutName
name of output track array
TClonesArray * fCaloTriggersOut
! trigger array out
void ClearOfflineBadChannels()
Container class for histograms for the high- charged particle analysis.
Kernel of the EMCAL trigger patch makerThe trigger maker kernel contains the core functionality of th...
Int_t GetRunNumber(TString)
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)