- //######################################################
- //#########Calculate trigger and set trigger info###########
- //######################################################
-
- AliEMCALTrigger tr;
- // tr.SetPatchSize(1); // create 4x4 patches
- tr.SetSimulation(kFALSE); // Reconstruction mode
- tr.SetDigitsList(fgDigitsArr);
- // Get VZERO total multiplicity for jet trigger simulation
- // The simulation of jey trigger will be incorrect if no VZERO data
- // at ESD
- AliESDVZERO* vZero = esd->GetVZEROData();
- if(vZero) {
- tr.SetVZER0Multiplicity(vZero->GetMTotV0A() + vZero->GetMTotV0C());
- }
- //
- tr.Trigger();
-
- Float_t maxAmp2x2 = tr.Get2x2MaxAmplitude();
- Float_t maxAmpnxn = tr.GetnxnMaxAmplitude();
- Float_t ampOutOfPatch2x2 = tr.Get2x2AmpOutOfPatch() ;
- Float_t ampOutOfPatchnxn = tr.GetnxnAmpOutOfPatch() ;
-
- Int_t iSM2x2 = tr.Get2x2SuperModule();
- Int_t iSMnxn = tr.GetnxnSuperModule();
- Int_t iModulePhi2x2 = tr.Get2x2ModulePhi();
- Int_t iModulePhinxn = tr.GetnxnModulePhi();
- Int_t iModuleEta2x2 = tr.Get2x2ModuleEta();
- Int_t iModuleEtanxn = tr.GetnxnModuleEta();
-
- AliDebug(2, Form("Trigger 2x2 max amp %f, out amp %f, SM %d, iphi %d ieta %d", maxAmp2x2, ampOutOfPatch2x2, iSM2x2,iModulePhi2x2, iModuleEta2x2));
- AliDebug(2, Form("Trigger 4x4 max amp %f , out amp %f, SM %d, iphi %d, ieta %d", maxAmpnxn, ampOutOfPatchnxn, iSMnxn,iModulePhinxn, iModuleEtanxn));
-
- TVector3 pos2x2(-1,-1,-1);
- TVector3 posnxn(-1,-1,-1);
-
- Int_t iAbsId2x2 = fGeom->GetAbsCellIdFromCellIndexes( iSM2x2, iModulePhi2x2, iModuleEta2x2) ; // should be changed to Module
- Int_t iAbsIdnxn = fGeom->GetAbsCellIdFromCellIndexes( iSMnxn, iModulePhinxn, iModuleEtanxn) ;
- fGeom->GetGlobal(iAbsId2x2, pos2x2);
- fGeom->GetGlobal(iAbsIdnxn, posnxn);
- //printf(" iAbsId2x2 %i iAbsIdnxn %i \n", iAbsId2x2, iAbsIdnxn);
+ //########################################
+ // Trigger
+ //########################################
+
+ Int_t v0M[2] = {0, 0};
+
+ AliESDVZERO* esdV0 = esd->GetVZEROData();
+
+ if (esdV0)
+ {
+ for (Int_t i = 0; i < 32; i++)
+ {
+ v0M[0] += (Int_t)esdV0->GetAdcV0C(i);
+ v0M[1] += (Int_t)esdV0->GetAdcV0A(i);
+ }
+ }
+ else
+ {
+ AliWarning("Cannot retrieve V0 ESD! Run w/ null V0 charges");
+ }
+
+ TClonesArray *trgDigits = new TClonesArray("AliEMCALTriggerRawDigit",1000);
+
+ TBranch *branchtrg = digitsTree->GetBranch("EMTRG");
+
+ if (!branchtrg)
+ {
+ AliError("Can't get the branch with the EMCAL trigger digits!");
+ return;
+ }
+
+ branchtrg->SetAddress(&trgDigits);
+ branchtrg->GetEntry(0);