- if (trgESD)
- {
- trgESD->Allocate(trgDigits->GetEntriesFast());
-
- for (Int_t i = 0; i < trgDigits->GetEntriesFast(); i++)
- {
- AliEMCALTriggerRawDigit* rdig = (AliEMCALTriggerRawDigit*)trgDigits->At(i);
-
- Int_t px, py;
- if (fGeom->GetPositionInEMCALFromAbsFastORIndex(rdig->GetId(), px, py))
- {
- Int_t a = -1, t = -1, times[10];
-
- rdig->GetMaximum(a, t);
- rdig->GetL0Times(times);
-
- trgESD->Add(px, py, a, t, times, rdig->GetNL0Times(), rdig->GetL1TimeSum(), rdig->GetTriggerBits());
- }
- }
+ Int_t v0M[2] = {0, 0};
+
+ AliESDVZERO* esdV0 = esd->GetVZEROData();
+
+ if (esdV0)
+ {
+ v0M[0] = esdV0->GetTriggerChargeC();
+ v0M[1] = esdV0->GetTriggerChargeA();
+ }
+ else
+ {
+ AliWarning("No V0 ESD! Run trigger processor w/ null V0 charges");
+ }
+
+ if (fgTriggerDigits && fgTriggerDigits->GetEntriesFast()) fgTriggerDigits->Delete();
+
+ TBranch *branchtrg = digitsTree->GetBranch("EMTRG");
+
+ if (!branchtrg)
+ {
+ AliError("Can't get the branch with the EMCAL trigger digits!");
+ return;
+ }
+
+ branchtrg->SetAddress(&fgTriggerDigits);
+ branchtrg->GetEntry(0);
+
+ // Note: fgTriggerProcessor reset done at the end of this method
+ fgTriggerProcessor->Digits2Trigger(fgTriggerDigits, v0M, fTriggerData);
+
+ // Fill ESD
+ AliESDCaloTrigger* trgESD = esd->GetCaloTrigger("EMCAL");
+
+ if (trgESD)
+ {
+ trgESD->Allocate(fgTriggerDigits->GetEntriesFast());
+
+ for (Int_t i = 0; i < fgTriggerDigits->GetEntriesFast(); i++)
+ {
+ AliEMCALTriggerRawDigit* rdig = (AliEMCALTriggerRawDigit*)fgTriggerDigits->At(i);
+ if (AliDebugLevel() > 999) rdig->Print("");
+
+ Int_t px, py;
+ if (fGeom->GetPositionInEMCALFromAbsFastORIndex(rdig->GetId(), px, py))
+ {
+ Int_t a = -1, t = -1, times[10];
+
+ rdig->GetMaximum(a, t);
+ rdig->GetL0Times(times);
+
+ trgESD->Add(px, py, a, t, times, rdig->GetNL0Times(), rdig->GetL1TimeSum(), rdig->GetTriggerBits());
+ }
+ }
+
+ for (int i = 0; i < 2; i++) {
+ trgESD->SetL1Threshold(2 * i , fTriggerData->GetL1JetThreshold( i));
+ trgESD->SetL1Threshold(2 * i + 1, fTriggerData->GetL1GammaThreshold(i));
+ }
+
+ Int_t v0[2];
+ fTriggerData->GetL1V0(v0);
+
+ trgESD->SetL1V0(v0);
+ trgESD->SetL1FrameMask(fTriggerData->GetL1FrameMask());
+
+ if (!saveOnce && fTriggerData->GetL1DataDecoded())
+ {
+ int type[15] = {0};
+ fTriggerData->GetL1TriggerType(type);