-
- //######################################################
- //#########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);
-
- TArrayF triggerPosition(6);
- triggerPosition[0] = pos2x2(0) ;
- triggerPosition[1] = pos2x2(1) ;
- triggerPosition[2] = pos2x2(2) ;
- triggerPosition[3] = posnxn(0) ;
- triggerPosition[4] = posnxn(1) ;
- triggerPosition[5] = posnxn(2) ;
- //printf(" triggerPosition ");
- //for(int i=0; i<6; i++) printf(" %i %f : ", i, triggerPosition[i]);
-
- TArrayF triggerAmplitudes(4);
- triggerAmplitudes[0] = maxAmp2x2 ;
- triggerAmplitudes[1] = ampOutOfPatch2x2 ;
- triggerAmplitudes[2] = maxAmpnxn ;
- triggerAmplitudes[3] = ampOutOfPatchnxn ;
- //printf("\n triggerAmplitudes ");
- //for(int i=0; i<4; i++) printf(" %i %f : ", i, triggerAmplitudes[i]);
- //printf("\n");
- //tr.Print("");
- //
- // Trigger jet staff
- //
- if(tr.GetNJetThreshold()>0) {
- // Jet phi/eta
- Int_t n0 = triggerPosition.GetSize();
- const TH2F *hpatch = tr.GetJetMatrixE();
- triggerPosition.Set(n0 + 2);
- for(Int_t i=0; i<2; i++) triggerPosition[n0+i] = hpatch->GetMean(i+1);
- // Add jet ampitudes
- n0 = triggerAmplitudes.GetSize();
- triggerAmplitudes.Set(n0 + tr.GetNJetThreshold());
- Double_t *ampJet = tr.GetL1JetThresholds();
- for(Int_t i=0; i<tr.GetNJetThreshold(); i++){
- triggerAmplitudes[n0 + i] = Float_t(ampJet[i]);