20 #include "AliVZEROCalibData.h" 21 #include "AliVZEROdigit.h" 26 #include <TClonesArray.h> 33 #include <Riostream.h> 81 switch (triggerMapping + 3*(iTRU >= 32)) {
86 iy = (iTRU % 2) ? 24 : 0;
93 if ((iTRU == 30) || (iTRU == 31)) iy = 24 * (iTRU % 2);
96 AliFatal(
"EMCAL STU object tried to use run 1 trigger mapping with a DCAL TRU");
106 if ((iTRU == 18) || (iTRU == 19)) iy = (iTRU % 2) * 24;
109 AliFatal(
"EMCAL STU object tried an unknown combination of Trigger Mapping and TRU index");
115 if (str.Contains(
"map"))
119 else if (str.Contains(
"region"))
125 AliError(
"Operation not allowed: STU won't be configured properly!");
129 for (Int_t i=0; i<rSize->X(); i++)
130 for (Int_t j=0; j<rSize->Y(); j++) {
131 v[i + ix][j + iy] = M[i][j];
142 TVector2 s1, s2, s3, s4;
159 AliError(
"Not supported L1 trigger type");
164 AliDebug(999,Form(
"STU L1 subtracting Bkg = %d\n",fBkg));
167 AliDebug(999,Form(
"STU has 0 threshold for type %d. Skipping this trigger calculation. Check OCDB!!!",type));
205 AliError(
"AliEMCALTriggerSTU::ComputeThFromV0(): Undefined trigger type, pls check!");
209 ULong64_t v0sum = M[0] + M[1];
211 ULong64_t sqrV0 = v0sum * v0sum;
244 AliError(
"AliEMCALTriggerSTU::SetThreshold(): Undefined trigger type, pls check!");
270 AliError(
"AliEMCALTriggerSTU::GetThreshold(): Undefined trigger type, pls check!");
283 const int kPatchXSize = 8;
284 const int kPatchYSize = 8;
286 std::vector<int> fPatchEnergies ;
293 for (
int i = 0; i < nX; i++) {
294 for (
int j = 0; j < nY; j++) {
295 if (fZeroPHOS && (j == 2 || j == 3))
continue;
297 int fXAnchor = i * kPatchXSize;
298 int fYAnchor = j * kPatchYSize;
299 for (
int k = 0; k < kPatchXSize; k++) {
300 for (
int l = 0; l < kPatchYSize; l++) {
301 fLocalSum +=
fRegion[fXAnchor+k][fYAnchor+l];
304 fPatchEnergies.push_back(fLocalSum);
307 sort(fPatchEnergies.begin(),fPatchEnergies.end());
313 return fPatchEnergies.at(fPatchEnergies.size()/2-1);
Int_t ** fRegion
! add comment
Int_t fGammaTh[2]
Gamma threshold.
virtual ~AliEMCALTriggerSTU()
Destructor.
virtual TVector2 * PatchSize() const
virtual TVector2 * SubRegionSize() const
TClonesArray * fPatches
! add comment
Int_t GetJ(int vzpar, int ithresh) const
Bool_t fActive
Active status for STU, if inactive the L1 trigger will not be simulated.
AliEMCALTriggerSTUDCSConfig * fDCSConfig
Int_t fJetTh[2]
Jet threshold.
Int_t GetG(int vzpar, int ithresh) const
EMCal trigger board super class.
virtual void Build(TString &str, Int_t i, Int_t **Map, const TVector2 *rSize, Int_t triggerMapping)
Build.
AliEMCALTriggerSTU()
Default constructor.
void GetSegmentation(TVector2 &v1, TVector2 &v2, TVector2 &v3, TVector2 &v4) const
Get Segmentation.
EMCal trigger STU handling.
virtual Int_t GetMedianEnergy()
Calculate median energy of patches.
EMCal trigger STU DCS Config.
Int_t fBkgRho
BkgRho for L1 calculation. Calculated from the other STU.
virtual void SetSubRegionSize(const TVector2 &Size)
#define AliFatal(message)
virtual void SetPatchSize(const TVector2 &Size)
virtual void ComputeThFromV0(int type, const Int_t M[])
Compute threshold from V0.
#define AliDebug(logLevel, message)
virtual Int_t GetThreshold(int type)
virtual void Reset()
Reset.
Int_t ** fMap
! Map the position to digit index (which eq. to ADC channel)
#define AliError(message)
virtual void SetThreshold(int type, Int_t v)
Set threshold.
TVector2 * fRegionSize
! in FastOR unit
virtual void L1(int type)
L1.
virtual void SlidingWindow(Int_t Threshold)
Sliding window algo.