]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALTriggerSTU.cxx
remove exec
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALTriggerSTU.cxx
index 405c07ccfab42f5f3ac03da4b76c42e65df37dce..bf1eb1b48eeacc5d20b9a9a43ea473b1339ba1ce 100644 (file)
@@ -49,7 +49,7 @@ AliEMCALTriggerSTU::AliEMCALTriggerSTU() : AliEMCALTriggerBoard()
 ,fJetTh(0)
 ,fDCSConfig(0x0)
 {
 ,fJetTh(0)
 ,fDCSConfig(0x0)
 {
-       //
+       // Ctor
 }
 
 //_______________
 }
 
 //_______________
@@ -58,26 +58,20 @@ AliEMCALTriggerSTU::AliEMCALTriggerSTU(AliEMCALTriggerSTUDCSConfig *dcsConf, con
 ,fJetTh(0)
 ,fDCSConfig(dcsConf)
 {
 ,fJetTh(0)
 ,fDCSConfig(dcsConf)
 {
-       //
+       // Ctor
 }
 
 //_______________
 AliEMCALTriggerSTU::~AliEMCALTriggerSTU()
 {
 }
 
 //_______________
 AliEMCALTriggerSTU::~AliEMCALTriggerSTU()
 {
-       //
-}
-
-//_______________
-Int_t AliEMCALTriggerSTU::GetRawData() const
-{
-       //
-       return fDCSConfig->GetRawData();
+       // Dtor
 }
 
 //_______________
 void AliEMCALTriggerSTU::Build( TString& str, Int_t iTRU, Int_t** M, const TVector2* rSize )
 {
 }
 
 //_______________
 void AliEMCALTriggerSTU::Build( TString& str, Int_t iTRU, Int_t** M, const TVector2* rSize )
 {
-       //
+       // Build
+       
        str.ToLower();
        
        Int_t ix = (iTRU % 2) ? 24 : 0;
        str.ToLower();
        
        Int_t ix = (iTRU % 2) ? 24 : 0;
@@ -108,7 +102,8 @@ void AliEMCALTriggerSTU::Build( TString& str, Int_t iTRU, Int_t** M, const TVect
 //_______________
 void AliEMCALTriggerSTU::L1(TriggerType_t type)
 {
 //_______________
 void AliEMCALTriggerSTU::L1(TriggerType_t type)
 {
-       //
+       // L1
+       
        TVector2 s1, s2, s3, s4;
        fDCSConfig->GetSegmentation(s1, s2, s3, s4);
        
        TVector2 s1, s2, s3, s4;
        fDCSConfig->GetSegmentation(s1, s2, s3, s4);
        
@@ -134,7 +129,8 @@ void AliEMCALTriggerSTU::L1(TriggerType_t type)
 //________________
 void AliEMCALTriggerSTU::PrintADC( TriggerType_t type, TVector2& pos, TVector2& idx )
 {
 //________________
 void AliEMCALTriggerSTU::PrintADC( TriggerType_t type, TVector2& pos, TVector2& idx )
 {
-       //
+       // Dump
+       
        Int_t ix = (Int_t) (( pos.X() + fPatchSize->X() ) * fSubRegionSize->X());
        
        Int_t iy = (Int_t) (( pos.Y() + fPatchSize->Y() ) * fSubRegionSize->Y());
        Int_t ix = (Int_t) (( pos.X() + fPatchSize->X() ) * fSubRegionSize->X());
        
        Int_t iy = (Int_t) (( pos.Y() + fPatchSize->Y() ) * fSubRegionSize->Y());
@@ -213,6 +209,8 @@ void AliEMCALTriggerSTU::PrintADC( TriggerType_t type, TVector2& pos, TVector2&
 //___________
 void AliEMCALTriggerSTU::PatchGenerator(const TClonesArray* lpos, Int_t val)
 {
 //___________
 void AliEMCALTriggerSTU::PatchGenerator(const TClonesArray* lpos, Int_t val)
 {
+       // Patch generator
+       
        ZeroRegion();
        
        Int_t vTRU[32][24][4] ;//= {0};
        ZeroRegion();
        
        Int_t vTRU[32][24][4] ;//= {0};
@@ -281,20 +279,48 @@ void AliEMCALTriggerSTU::PatchGenerator(const TClonesArray* lpos, Int_t val)
 }
 
 //___________
 }
 
 //___________
-void AliEMCALTriggerSTU::ComputeThFromV0(const Int_t M[])
+void AliEMCALTriggerSTU::ComputeThFromV0(TriggerType_t type, const Int_t M[])
 {
 {
-       //
-       if (!(M[0] + M[1])) AliWarning("V0A + V0C is null!"); // 0/1: V0C/V0A
-
+       // Compute threshold from V0
+       
+       Short_t P[3] = {0};
+       
+       switch (type)
+       {
+               case kL1Gamma:
+                       P[0] = fDCSConfig->GetGA();
+                       P[1] = fDCSConfig->GetGB();
+                       P[2] = fDCSConfig->GetGC();                     
+                       break;
+               case kL1Jet:
+                       P[0] = fDCSConfig->GetJA();
+                       P[1] = fDCSConfig->GetJB();
+                       P[2] = fDCSConfig->GetJC();                     
+                       break;
+               default:
+                       AliError("AliEMCALTriggerSTU::ComputeThFromV0(): Undefined trigger type, pls check!");
+                       return;
+       }
        
        
-       fGammaTh = fDCSConfig->GetGA()*(M[0] + M[1])*(M[0] + M[1]) + fDCSConfig->GetGB()*(M[0] + M[1]) + fDCSConfig->GetGC();
+       ULong64_t v0sum = M[0] + M[1];
        
        
-       fJetTh   = fDCSConfig->GetJA()*(M[0] + M[1])*(M[0] + M[1]) + fDCSConfig->GetJB()*(M[0] + M[1]) + fDCSConfig->GetJC();   
+       ULong64_t sqrV0 = v0sum * v0sum;
+       
+       sqrV0 *= P[0];  
+       sqrV0 >>= 32;
+       
+       v0sum *= P[1];
+       
+       v0sum >>= 16;
+       
+       SetThreshold(type, (UShort_t)(sqrV0 + v0sum + P[2]));
 }
 
 //___________
 void AliEMCALTriggerSTU::SetThreshold(TriggerType_t type, Int_t v)
 {
 }
 
 //___________
 void AliEMCALTriggerSTU::SetThreshold(TriggerType_t type, Int_t v)
 {
+       // Set threshold
+       
        switch (type)
        {
                case kL1Gamma:
        switch (type)
        {
                case kL1Gamma:
@@ -333,5 +359,7 @@ Int_t AliEMCALTriggerSTU::GetThreshold(TriggerType_t type)
 //__________
 void AliEMCALTriggerSTU::Reset()
 {
 //__________
 void AliEMCALTriggerSTU::Reset()
 {
+       // Reset
+       
        fPatches->Delete();
 }
        fPatches->Delete();
 }