- //
- for (Int_t i = 0; i < 2; i++)
- {
- if ( fL0Patches[i]) fL0Patches[i]->Delete();
- if (fL1GammaPatches[i]) fL1GammaPatches[i]->Delete();
- if ( fL1JetPatches[i]) fL1JetPatches[i]->Delete();
- }
-}
-
-//_____________
-void AliEMCALTriggerData::SetL0Region(Int_t i, const Int_t**& region)
-{
- //
- if (i < 0 || i > 31)
- {
- AliError("Bad index!");
- return;
- }
-
- for (Int_t j=0;j<24;j++)
- for (Int_t k=0;k<4;k++) fL0Region[i][j][k] = region[j][k];
-}
-
-//_____________
-void AliEMCALTriggerData::GetPatches(TriggerType_t type, Int_t i, TClonesArray& patches) const
-{
- //
- if (i < 0 || i > 1)
- {
- AliError("Bad index!");
- return;
- }
-
- switch (type)
- {
- case kL0:
- patches = *fL0Patches[i];
- break;
- case kL1Gamma:
- patches = *fL1GammaPatches[i];
- break;
- case kL1Jet:
- patches = *fL1JetPatches[i];
- break;
- default:
- AliError("Unknown trigger type!");
- break;
- }
-}
-
-//_____________
-TClonesArray* AliEMCALTriggerData::GetPatches(TriggerType_t type, Int_t i) const
-{
- //
- if (i < 0 || i > 1)
- {
- AliError("Bad index!");
- return 0x0;
- }
-
- switch (type)
- {
- case kL0:
- return fL0Patches[i];
- break;
- case kL1Gamma:
- return fL1GammaPatches[i];
- break;
- case kL1Jet:
- return fL1JetPatches[i];
- break;
- default:
- AliError("Unknown trigger type!");
- break;
- }
-
- return 0x0;
-}
-
-//_____________
-void AliEMCALTriggerData::SetPatches(TriggerType_t type, Int_t i, const TClonesArray& patches)
-{
- //
- if (i < 0 || i > 1)
- {
- AliError("Bad index!");
- return;
- }
-
- if (patches.GetEntriesFast())
- {
- TClonesArray* arr = 0x0;
-
- switch (type)
- {
- case kL0:
- arr = fL0Patches[i];
- break;
- case kL1Gamma:
- arr = fL1GammaPatches[i];
- break;
- case kL1Jet:
- arr = fL1JetPatches[i];
- break;
- default:
- AliError("Unknown trigger type!");
- return;
- }
-
- if (arr)
- {
- Int_t size = arr->GetSize() + patches.GetSize();
-
- arr->Expand(size);
-
- for (Int_t k = 0; k < patches.GetEntriesFast(); k++)
- {
- AliEMCALTriggerPatch* p = static_cast<AliEMCALTriggerPatch*>(patches.At(k));
- new((*arr)[arr->GetEntriesFast()]) AliEMCALTriggerPatch(*p);
- }
- }
- else
- {
- AliError("TClonesArray is NULL!");
- }
- }