1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
21 Author: R. GUERNANE LPSC Grenoble CNRS/IN2P3
24 #include "AliEMCALTriggerSTU.h"
25 #include "AliCDBManager.h"
26 #include "AliCDBEntry.h"
27 #include "AliEMCALTriggerSTUDCSConfig.h"
28 #include "AliVZEROCalibData.h"
29 #include "AliVZEROdigit.h"
30 #include "AliEMCALTriggerPatch.h"
31 #include "AliESDVZERO.h"
34 #include <TClonesArray.h>
41 #include <Riostream.h>
44 ClassImp(AliEMCALTriggerSTU)
47 AliEMCALTriggerSTU::AliEMCALTriggerSTU() : AliEMCALTriggerBoard()
51 fGammaTh[0] = fGammaTh[1] = 0;
52 fJetTh[0] = fJetTh[1] = 0;
56 AliEMCALTriggerSTU::AliEMCALTriggerSTU(AliEMCALTriggerSTUDCSConfig *dcsConf, const TVector2& RS) : AliEMCALTriggerBoard(RS)
60 fGammaTh[0] = fGammaTh[1] = 0;
61 fJetTh[0] = fJetTh[1] = 0;
65 AliEMCALTriggerSTU::~AliEMCALTriggerSTU()
71 void AliEMCALTriggerSTU::Build( TString& str, Int_t iTRU, Int_t** M, const TVector2* rSize )
77 Int_t ix = (iTRU % 2) ? 24 : 0;
83 if (str.Contains("map"))
87 else if (str.Contains("region"))
93 AliError("Operation not allowed: STU won't be configured properly!");
97 for (Int_t i=0; i<rSize->X(); i++)
98 for (Int_t j=0; j<rSize->Y(); j++) v[i + ix][j + iy * 4] = M[i][j];
103 void AliEMCALTriggerSTU::L1(int type)
107 TVector2 s1, s2, s3, s4;
108 fDCSConfig->GetSegmentation(s1, s2, s3, s4);
114 SetSubRegionSize(s1);
119 SetSubRegionSize(s3);
123 AliError("Not supported L1 trigger type");
128 SlidingWindow(GetThreshold(type));
129 AliDebug(999, Form("STU type %d sliding window w/ thr %d found %d patches", type, GetThreshold(type), fPatches->GetEntriesFast()));
133 void AliEMCALTriggerSTU::ComputeThFromV0(int type, const Int_t M[])
135 // Compute threshold from V0
142 P[0] = fDCSConfig->GetG(0, 0);
143 P[1] = fDCSConfig->GetG(1, 0);
144 P[2] = fDCSConfig->GetG(2, 0);
147 P[0] = fDCSConfig->GetG(0, 1);
148 P[1] = fDCSConfig->GetG(1, 1);
149 P[2] = fDCSConfig->GetG(2, 1);
152 P[0] = fDCSConfig->GetJ(0, 0);
153 P[1] = fDCSConfig->GetJ(1, 0);
154 P[2] = fDCSConfig->GetJ(2, 0);
157 P[0] = fDCSConfig->GetJ(0, 1);
158 P[1] = fDCSConfig->GetJ(1, 1);
159 P[2] = fDCSConfig->GetJ(2, 1);
162 AliError("AliEMCALTriggerSTU::ComputeThFromV0(): Undefined trigger type, pls check!");
166 ULong64_t v0sum = M[0] + M[1];
168 ULong64_t sqrV0 = v0sum * v0sum;
178 SetThreshold(type, (UShort_t)(sqrV0 + v0sum + P[2]));
182 void AliEMCALTriggerSTU::SetThreshold(int type, Int_t v)
201 AliError("AliEMCALTriggerSTU::SetThreshold(): Undefined trigger type, pls check!");
206 Int_t AliEMCALTriggerSTU::GetThreshold(int type)
208 // Compute threshold FIXME: need an access to the OCDB
209 // to get f(V0) parameters depending on trigger type
226 AliError("AliEMCALTriggerSTU::GetThreshold(): Undefined trigger type, pls check!");
233 void AliEMCALTriggerSTU::Reset()