Changes for report #76063 Commit to trunk + v4-20-Release
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 9 Dec 2010 14:25:38 +0000 (14:25 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 9 Dec 2010 14:25:38 +0000 (14:25 +0000)
EMCAL/AliEMCALReconstructor.cxx
EMCAL/AliEMCALTriggerBoard.cxx
EMCAL/AliEMCALTriggerData.cxx
EMCAL/AliEMCALTriggerElectronics.cxx
EMCAL/AliEMCALTriggerRawDigit.cxx
EMCAL/AliEMCALTriggerRawDigit.h
EMCAL/AliEMCALTriggerRawDigitMaker.cxx
STEER/AliESDCaloTrigger.cxx
STEER/AliESDCaloTrigger.h

index 526a5680eaa46310f8ac80133408c635946e2215..0dc6810ece36e922cb196a860fda5f9d99202529 100644 (file)
@@ -372,29 +372,14 @@ void AliEMCALReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree,
                          
                          rdig->GetMaximum(a, t);
                          rdig->GetL0Times(times);
-                                                 
-                         trgESD->Add(px, py, a, t, times, rdig->GetNL0Times(), rdig->GetL1TimeSum());
+                                 
+                         trgESD->Add(px, py, a, t, times, rdig->GetNL0Times(), rdig->GetL1TimeSum(), rdig->GetTriggerBits());
                  }
          }
          
          trgESD->SetL1Threshold(0, fTriggerData->GetL1GammaThreshold());
          
          trgESD->SetL1Threshold(1, fTriggerData->GetL1JetThreshold()  );
-
-         for (Int_t i = 0; i < kTriggerTypeEnd; i++)
-         {       
-                 for (Int_t j = 0; j < 2; j++)
-                 {
-                         TClonesArray* patches = fTriggerData->GetPatches((TriggerType_t)i, j);
-                         
-                         TIter NextPatch(patches);
-                         while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)NextPatch())
-                         {
-                                 TVector2 pos; p->Position(pos);
-                                 trgESD->SetTriggerBits((Int_t) pos.X(), (Int_t) pos.Y(), i, j);
-                         }
-                 }
-         }
    }
 
    // Resetting
index 4841bc250f75909dde0e8cabe95eada5639f415e..517151ce9343ed570a8a379e47bd50ff471fa6ed 100644 (file)
@@ -113,7 +113,7 @@ void AliEMCALTriggerBoard::ZeroRegion()
 }
 
 //_______________
-void AliEMCALTriggerBoard::SlidingWindow(TriggerType_t /*type*/, Int_t thres, Int_t time)
+void AliEMCALTriggerBoard::SlidingWindow(TriggerType_t type, Int_t thres, Int_t time)
 {
        //
        Int_t ipatch = 0;
@@ -134,10 +134,10 @@ void AliEMCALTriggerBoard::SlidingWindow(TriggerType_t /*type*/, Int_t thres, In
                                }
                        }
 
+                       if ( type == kL1Jet ) sum /= 4; // truncate patch sum for jet case
+
                        if ( sum > thres ) 
                        {
-                               //if ( type == kJet ) sum /= 4; // truncate patch sum for jet case
-                               
                                new((*fPatches)[fPatches->GetLast()+1]) 
                                                AliEMCALTriggerPatch(int(i/fSubRegionSize->X()), int(j/fSubRegionSize->Y()), int(sum), time);
                        }
index 1a0e03a2f0de1dfe0c6be131acf17f60db7d109d..ce4bef701d7815c8fc415fce8fee34056f0d93d7 100644 (file)
@@ -24,6 +24,7 @@ Author: R. GUERNANE LPSC Grenoble CNRS/IN2P3
 #include "AliEMCALTriggerData.h"
 #include "AliEMCALTriggerPatch.h"
 #include "AliLog.h"
+#include "TIterator.h"
 #include "Riostream.h"
 
 ClassImp(AliEMCALTriggerData)
@@ -214,11 +215,31 @@ void AliEMCALTriggerData::GetL1Region(Int_t i, Int_t arr[][64]) const
 void AliEMCALTriggerData::Scan() const
 {
        //
+       TIterator* nP;
+
        printf("L0:\n");
-       printf("\tFound (%2d , %2d) patches\n", fL0Patches[0]->GetEntriesFast(), fL0Patches[1]->GetEntriesFast());
+       printf("\tFound (%2d,%2d) patches\n", fL0Patches[1]->GetEntriesFast(), fL0Patches[0]->GetEntriesFast());
+       printf("\tRAW:\n");
+       nP = fL0Patches[1]->MakeIterator();
+       while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)nP->Next()) {printf("\t"); p->Print("");}
+       printf("\tREC:\n");
+       nP = fL0Patches[0]->MakeIterator();
+       while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)nP->Next()) {printf("\t"); p->Print("");}
        printf("L1:\n");
-       printf("\tFound (%4d,%4d) gamma patches\n",fL1GammaPatches[0]->GetEntriesFast(), fL1GammaPatches[1]->GetEntriesFast());
-       printf("\tFound (%4d,%4d) jet patches\n",fL1JetPatches[0]->GetEntriesFast(), fL1JetPatches[1]->GetEntriesFast());
+       printf("\tFound (%4d,%4d) gamma patches\n",fL1GammaPatches[1]->GetEntriesFast(), fL1GammaPatches[0]->GetEntriesFast());
+       printf("\tRAW:\n");
+       nP = fL1GammaPatches[1]->MakeIterator();
+       while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)nP->Next()) {printf("\t"); p->Print("");}
+       printf("\tREC:\n");
+       nP = fL1GammaPatches[0]->MakeIterator();
+       while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)nP->Next()) {printf("\t"); p->Print("");}
+       printf("\tFound (%4d,%4d) jet patches\n",fL1JetPatches[1]->GetEntriesFast(), fL1JetPatches[0]->GetEntriesFast());
+       printf("\tRAW:\n");
+       nP = fL1JetPatches[1]->MakeIterator();
+       while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)nP->Next()) {printf("\t"); p->Print("");}
+       printf("\tREC:\n");
+       nP = fL1JetPatches[0]->MakeIterator();
+       while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)nP->Next()) {printf("\t"); p->Print("");}
 }
 
 //_____________
index cb183ab0f986e61715f75530596e61f1dd427305..9a3ef252af929f0067f7db38fa6e306a551d559d 100644 (file)
@@ -167,23 +167,22 @@ void AliEMCALTriggerElectronics::Digits2Trigger(TClonesArray* digits, const Int_
                                        && 
                                        geom->GetPositionInEMCALFromAbsFastORIndex(id, px, py)) p->SetPosition(px, py);
                                
-                               if (!data->GetMode())
+                               if (!data->GetMode()) // Simulation
                                {
                                        Int_t peaks = p->Peaks();
                                        
+                                       Int_t pos;
+                                       AliEMCALTriggerRawDigit* dig = 0x0;
+                                       
                                        for (Int_t j = 0; j < sizeX * sizeY; j++)
                                        {
                                                if (peaks & (1 << j))
                                                {
-                                                       
-                                                       Int_t pos = posMap[px + j % sizeX][py + j / sizeX];
-                                                       
-//                                                     cout << "px: " << px << " py: " << py << " j: " << j << " mod: " << j%sizeX << " ratio: " << j / sizeX << " pos: " << pos << endl;
-                                                       
-                                                       AliEMCALTriggerRawDigit* dig = 0x0;
+                                                       pos = posMap[px + j % sizeX][py + j / sizeX];
                                                        
                                                        if (pos == -1)
                                                        {
+                                                               // Add a new digit
                                                                new((*digits)[digits->GetEntriesFast()]) AliEMCALTriggerRawDigit(id, 0x0, 0);
                                                                
                                                                dig = (AliEMCALTriggerRawDigit*)digits->At(digits->GetEntriesFast() - 1);
@@ -195,13 +194,27 @@ void AliEMCALTriggerElectronics::Digits2Trigger(TClonesArray* digits, const Int_
                                                        
                                                        dig->SetL0Time(p->Time());
                                                }
-                                       }                                                               
+                                       }
+                                       
+                                       pos = posMap[px][py];
+                                       
+                                       if (pos == -1)
+                                       {
+                                               // Add a new digit
+                                               new((*digits)[digits->GetEntriesFast()]) AliEMCALTriggerRawDigit(id, 0x0, 0);
+                                               
+                                               dig = (AliEMCALTriggerRawDigit*)digits->At(digits->GetEntriesFast() - 1);
+                                       }
+                                       else
+                                       {
+                                               dig = (AliEMCALTriggerRawDigit*)digits->At(pos);
+                                       }
+                                       
+                                       dig->SetTriggerBit(kL0,0);
                                }
                        }
                        
                        data->SetL0Trigger(0, i, 1);
-                                               
-               data->SetPatches(kL0, 0, iTRU->Patches());
                }
                else
                        data->SetL0Trigger(0, i, 0);
@@ -242,13 +255,66 @@ void AliEMCALTriggerElectronics::Digits2Trigger(TClonesArray* digits, const Int_
 
                fSTU->L1(kL1Gamma);
                
-               data->SetPatches(kL1Gamma, 0, fSTU->Patches());
+               Int_t id, px, py;
+               AliEMCALTriggerRawDigit* dig = 0x0;
+               
+               TIterator* nP = 0x0;
+               
+               nP = (fSTU->Patches()).MakeIterator();
+               
+               while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)nP->Next()) 
+               {                       
+                       p->Position(px, py);
+                       
+                       if (geom->GetAbsFastORIndexFromPositionInEMCAL(px, py, id))
+                       {
+                               if (posMap[px][py] == -1)
+                               {
+                                       // Add a new digit
+                                       new((*digits)[digits->GetEntriesFast()]) AliEMCALTriggerRawDigit(id, 0x0, 0);
+                                       
+                                       dig = (AliEMCALTriggerRawDigit*)digits->At(digits->GetEntriesFast() - 1);
+                               } 
+                               else
+                               {
+                                       dig = (AliEMCALTriggerRawDigit*)digits->At(posMap[px][py]);                                                             
+                               }
+                               
+                               dig->SetTriggerBit(kL1Gamma,0);
+                       }
+               }
 
                fSTU->Reset();
 
                fSTU->L1(kL1Jet);
                
-               data->SetPatches(kL1Jet,   0, fSTU->Patches());
+               nP = (fSTU->Patches()).MakeIterator();
+               
+               while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)nP->Next()) 
+               {                       
+                       p->Position(px, py);
+
+                       px *= (Int_t)((fSTU->SubRegionSize())->X());
+
+                       py *= (Int_t)((fSTU->SubRegionSize())->Y());
+                       
+                       if (geom->GetAbsFastORIndexFromPositionInEMCAL(px, py, id))
+                       {
+                               if (posMap[px][py] == -1)
+                               {
+                                       // Add a new digit
+                                       new((*digits)[digits->GetEntriesFast()]) AliEMCALTriggerRawDigit(id, 0x0, 0);
+                                       
+                                       dig = (AliEMCALTriggerRawDigit*)digits->At(digits->GetEntriesFast() - 1);
+                               } 
+                               else
+                               {
+                                       dig = (AliEMCALTriggerRawDigit*)digits->At(posMap[px][py]);                                                             
+                               }
+                               
+                               dig->SetTriggerBit(kL1Jet,0);
+                       }
+               }
                
                Int_t** reg = fSTU->Region();
                
@@ -262,11 +328,8 @@ void AliEMCALTriggerElectronics::Digits2Trigger(TClonesArray* digits, const Int_
                                {
                                        if (reg[i][j])
                                        {
-                                               Int_t id;
                                                if (geom->GetAbsFastORIndexFromPositionInEMCAL(i, j, id))
                                                {
-                                                       AliEMCALTriggerRawDigit* dig = 0x0;
-
                                                        if (posMap[i][j] == -1)
                                                        {
                                                                // Add a new digit with L1 time sum
index 7332439fd60603b8ef90b26ee6854b55928398c0..e11cb815ed654cd07a95e7ed8a58bab8790664e9 100644 (file)
@@ -31,7 +31,7 @@ ClassImp(AliEMCALTriggerRawDigit)
 
 //____________________________________________________________________________
 AliEMCALTriggerRawDigit::AliEMCALTriggerRawDigit() : AliEMCALRawDigit(),
-fL0Trigger(0),
+fTriggerBits(0),
 fNL0Times(0),
 fL0Times(),
 fL1TimeSum(-1)
@@ -42,7 +42,7 @@ fL1TimeSum(-1)
 
 //____________________________________________________________________________
 AliEMCALTriggerRawDigit::AliEMCALTriggerRawDigit(Int_t id, Int_t timeSamples[], Int_t nSamples) : AliEMCALRawDigit(id, timeSamples, nSamples),
-fL0Trigger(0),
+fTriggerBits(0),
 fNL0Times(0),
 fL0Times(),
 fL1TimeSum(-1)
@@ -132,6 +132,16 @@ Int_t AliEMCALTriggerRawDigit::GetL0TimeSum(const Int_t time) const
        return value;
 }
 
+//____________________________________________________________________________
+Int_t AliEMCALTriggerRawDigit::GetTriggerBit(const TriggerType_t type, const Int_t mode) const
+{
+       //
+       Int_t shift = kTriggerTypeEnd * mode;
+       Int_t mask  = 1 << type;
+       
+       return ((fTriggerBits >> shift) & mask);
+}      
+
 //____________________________________________________________________________
 void AliEMCALTriggerRawDigit::Print(const Option_t* /*opt*/) const
 {
@@ -144,13 +154,14 @@ void AliEMCALTriggerRawDigit::Print(const Option_t* /*opt*/) const
                printf("| (%d,%d) ",timeBin,amp);
        }       
        printf("\n");
-       printf("| L0: %4d / %d Time(s): \n",fL0Trigger,fNL0Times);
+       printf("| L0: (%d,%d) / %d Time(s): \n",GetTriggerBit(kL0,1),GetTriggerBit(kL0,0),fNL0Times);
        for (Int_t i = 0; i < fNL0Times; i++) 
        {
                Int_t time;
                if (GetL0Time(i, time)) printf("| %d ",time);
        }
        printf("\n");
-       printf("| Time sum: %d\n", fL1TimeSum);
+       printf("| L1: g (%d,%d) j (%d,%d) / Time sum: %d\n",
+                  GetTriggerBit(kL1Gamma,1),GetTriggerBit(kL1Gamma,0),GetTriggerBit(kL1Jet,1),GetTriggerBit(kL1Jet,0),fL1TimeSum);
 }
 
index 55e23d2dfac1bfffe7de8d81a22b64af2688429a..808621e7b922b511d21b9444ffa350b4ae0b8002 100644 (file)
@@ -10,6 +10,7 @@
 */
 
 #include "AliEMCALRawDigit.h" 
+#include "AliEMCALTriggerTypes.h" 
 
 class AliEMCALTriggerRawDigit : public AliEMCALRawDigit 
 {
@@ -20,10 +21,14 @@ public:
        
        virtual ~AliEMCALTriggerRawDigit();
        
-       void    SetL0Trigger(Int_t v) {fL0Trigger = v;}
+       void    SetTriggerBit(const TriggerType_t type, const Int_t mode) {fTriggerBits = (fTriggerBits | (1 << (type + kTriggerTypeEnd * mode)));}
+       
        Bool_t  SetL0Time(   Int_t i);
        
-       Int_t   GetL0Trigger(                       ) const {return  fL0Trigger;}
+       Int_t   GetTriggerBit(const TriggerType_t type, const Int_t mode) const;
+
+       Int_t   GetTriggerBits() const {return fTriggerBits;}
+       
        Bool_t  GetL0Time(const Int_t i, Int_t& time) const;
        Bool_t  GetL0Times(Int_t times[]            ) const;
        Int_t   GetNL0Times(                        ) const {return fNL0Times;}
@@ -40,7 +45,7 @@ private:
        AliEMCALTriggerRawDigit(const AliEMCALTriggerRawDigit &cd);            // Not implemented
        AliEMCALTriggerRawDigit &operator=(const AliEMCALTriggerRawDigit &cd); // Not implemented
 
-       Int_t   fL0Trigger;
+       Int_t   fTriggerBits;
        Int_t   fNL0Times;
        Int_t   fL0Times[10];
        
index 964be5da5b9169b2ebf963835be65371a4c1a361..cc6a9c15d3360dba60092034e9d5224f8a484bb5 100644 (file)
@@ -198,7 +198,6 @@ void AliEMCALTriggerRawDigitMaker::Add(const std::vector<AliCaloBunchInfo> &bunc
                                                        dig = (AliEMCALTriggerRawDigit*)fRawDigits->At(fRawDigitIndex[idx]);
                                                }
                                                
-                                               dig->SetL0Trigger(1);
                                                dig->SetL0Time(iBin);
                                        }
                                }
@@ -324,7 +323,7 @@ void AliEMCALTriggerRawDigitMaker::PostProcess()
                                
                                for (Int_t j = 0; j < 96; j++)
                                {
-                                       if (adc[j] < 5) continue;
+                                       //if (adc[j] < 5) continue;
                                        
                                        if (AliDebugLevel()) printf("| STU => TRU# %2d raw data: ADC# %2d: %d\n", iTRU, j, adc[j]);
                                        
@@ -334,10 +333,7 @@ void AliEMCALTriggerRawDigitMaker::PostProcess()
                                        {
                                                dig = (AliEMCALTriggerRawDigit*)fRawDigits->At(fRawDigitIndex[idx]);
                                                
-                                               if (!dig->GetNSamples())
-                                                       AliDebug(10,Form("TRG digit of id: %4d found in STU but has 0 sample in F-ALTRO!",idx));
-                                                       
-                                               dig->SetL1TimeSum(adc[j]);
+                                               if (!dig->GetNSamples()) AliDebug(10,Form("TRG digit of id: %4d found in STU but has no time sample in F-ALTRO!",idx));
                                        }
                                        else
                                        {
@@ -347,14 +343,14 @@ void AliEMCALTriggerRawDigitMaker::PostProcess()
                                                new((*fRawDigits)[fRawDigits->GetEntriesFast()]) AliEMCALTriggerRawDigit(idx, 0x0, 0);
                                                
                                                dig = (AliEMCALTriggerRawDigit*)fRawDigits->At(fRawDigitIndex[idx]);
-                                               dig->SetL1TimeSum(adc[j]);
                                        }
+                                       
+                                       dig->SetL1TimeSum(adc[j]);
                                }
                        }
                }
                
                // List of patches in EMCal coordinate system
-               TClonesArray* patches = new TClonesArray("AliEMCALTriggerPatch", 96);
                
                for (Int_t i = 0; i < fSTURawStream->GetNL0GammaPatch(); i++)
                {
@@ -372,21 +368,31 @@ void AliEMCALTriggerRawDigitMaker::PostProcess()
                        
                        if (fGeometry->GetFastORIndexFromL0Index(iTRU, x, idFastOR, sizePatchL0))
                        {
+                               idx = idFastOR[1];
+                               
                                Int_t px, py;
-                               if (fGeometry->GetPositionInEMCALFromAbsFastORIndex(idFastOR[1], px, py))
+                               if (fGeometry->GetPositionInEMCALFromAbsFastORIndex(idx, px, py))
                                {
-                                       new((*patches)[patches->GetEntriesFast()]) AliEMCALTriggerPatch(px, py);
-                                       
                                        if (AliDebugLevel()) printf("| STU => Add L0 patch at (%2d , %2d)\n", px, py);
+                                                                               
+                                       if (fRawDigitIndex[idx] >= 0)
+                                       {
+                                               dig = (AliEMCALTriggerRawDigit*)fRawDigits->At(fRawDigitIndex[idx]);
                                }
-                       }
+                                       else
+                                       {
+                                               fRawDigitIndex[idx] = fRawDigits->GetEntriesFast();
+                                               new((*fRawDigits)[fRawDigits->GetEntriesFast()]) AliEMCALTriggerRawDigit(idx, 0x0, 0);
                        
-                       delete [] idFastOR;
+                                               dig = (AliEMCALTriggerRawDigit*)fRawDigits->At(fRawDigitIndex[idx]);
                }
                
-               fTriggerData->SetPatches(kL0, 1, *patches);                     
+                                       dig->SetTriggerBit(kL0,1);
+                               }
+                       }
                
-               patches->Delete();
+                       delete [] idFastOR;
+               }
                
                for (Int_t i = 0; i < fSTURawStream->GetNL1GammaPatch(); i++)
                {
@@ -404,16 +410,27 @@ void AliEMCALTriggerRawDigitMaker::PostProcess()
                                
                                if (vx >= 0) 
                                {
-                                       new((*patches)[patches->GetEntriesFast()]) AliEMCALTriggerPatch(vx, vy);
-                                       
+                                       if (fGeometry->GetAbsFastORIndexFromPositionInEMCAL(vx, vy, idx))
+                                       {
                                        if (AliDebugLevel()) printf("| STU => Add L1 gamma patch at (%2d , %2d)\n", vx, vy);
+                                               
+                                               if (fRawDigitIndex[idx] >= 0)
+                                               {
+                                                       dig = (AliEMCALTriggerRawDigit*)fRawDigits->At(fRawDigitIndex[idx]);
                                }
-                       }
-               }
+                                               else
+                                               {
+                                                       fRawDigitIndex[idx] = fRawDigits->GetEntriesFast();
+                                                       new((*fRawDigits)[fRawDigits->GetEntriesFast()]) AliEMCALTriggerRawDigit(idx, 0x0, 0);
 
-               fTriggerData->SetPatches(kL1Gamma, 1, *patches);                        
+                                                       dig = (AliEMCALTriggerRawDigit*)fRawDigits->At(fRawDigitIndex[idx]);
+                                               }
                
-               patches->Delete();
+                                               dig->SetTriggerBit(kL1Gamma,1);
+                                       }
+                               }
+                       }
+               }
                
                for (Int_t i = 0; i < fSTURawStream->GetNL1JetPatch(); i++)
                {
@@ -429,18 +446,27 @@ void AliEMCALTriggerRawDigitMaker::PostProcess()
                                
                                if (ix >= 0 && iy >= 0)
                                {       
-                                       new((*patches)[patches->GetEntriesFast()]) AliEMCALTriggerPatch(ix, iy);
-                                       
+                                       if (fGeometry->GetAbsFastORIndexFromPositionInEMCAL(ix, iy, idx))
+                                       {
                                        if (AliDebugLevel()) printf("| STU => Add L1 jet patch at (%2d , %2d)\n", ix, iy);
-                               }
-                       }
-               }
                
-               fTriggerData->SetPatches(kL1Jet, 1, *patches);                  
+                                               if (fRawDigitIndex[idx] >= 0)
+                                               {
+                                                       dig = (AliEMCALTriggerRawDigit*)fRawDigits->At(fRawDigitIndex[idx]);
+                                               }
+                                               else
+                                               {
+                                                       fRawDigitIndex[idx] = fRawDigits->GetEntriesFast();
+                                                       new((*fRawDigits)[fRawDigits->GetEntriesFast()]) AliEMCALTriggerRawDigit(idx, 0x0, 0);
                
-               patches->Delete();
+                                                       dig = (AliEMCALTriggerRawDigit*)fRawDigits->At(fRawDigitIndex[idx]);
+                                               }
                
-               delete patches;
+                                               dig->SetTriggerBit(kL1Jet,1);
+                                       }
+                               }
+                       }
+               }               
        }
 }
 
index 8d843b26bca6b18bcc48619d2e0db975cb139332..391b14a2eeb17f0f86298781f138d57088d07359 100644 (file)
@@ -40,10 +40,10 @@ fAmplitude(0x0),
 fTime(0x0),
 fNL0Times(0x0),
 fL0Times(new TArrayI()),
-fL1TimeSum(0x0)
+fL1TimeSum(0x0),
+fTriggerBits(0x0)
 {
        //
-       for (Int_t i = 0; i < 48; i++) for (Int_t j = 0; j < 64; j++) fTriggerBits[i][j] = 0;
 }
 
 //_______________
@@ -56,7 +56,8 @@ fAmplitude(0x0),
 fTime(0x0),
 fNL0Times(0x0),
 fL0Times(new TArrayI()),
-fL1TimeSum(0x0)
+fL1TimeSum(0x0),
+fTriggerBits(0x0)
 {
        //
        src.Copy(*this);
@@ -75,18 +76,16 @@ AliESDCaloTrigger::~AliESDCaloTrigger()
 void AliESDCaloTrigger::DeAllocate()
 {
        //
-       delete [] fColumn;    fColumn    = 0x0;
-       delete [] fRow;       fRow       = 0x0;     
-       delete [] fAmplitude; fAmplitude = 0x0;
-       delete [] fTime;      fTime      = 0x0;   
-       delete [] fNL0Times;  fNL0Times  = 0x0;
-       delete [] fL1TimeSum; fL1TimeSum = 0x0;
-//     delete [] fL0Times;   fL0Times   = 0x0;
+       delete [] fColumn;      fColumn    = 0x0;
+       delete [] fRow;         fRow       = 0x0;     
+       delete [] fAmplitude;   fAmplitude = 0x0;
+       delete [] fTime;        fTime      = 0x0;   
+       delete [] fNL0Times;    fNL0Times  = 0x0;
+       delete [] fL1TimeSum;   fL1TimeSum = 0x0;
+       delete [] fTriggerBits; fTriggerBits   = 0x0;
 
        fNEntries =  0;
        fCurrent  = -1;
-       
-       for (Int_t i = 0; i < 48; i++) for (Int_t j = 0; j < 64; j++) fTriggerBits[i][j] = 0;
 
        fL0Times->Reset();
 }
@@ -117,10 +116,8 @@ void AliESDCaloTrigger::Copy(TObject &obj) const
                Int_t times[10];
                for (Int_t j = 0; j < 10; j++) times[j] = fL0Times->At(10 * i + j);
          
-               dest.Add(fColumn[i], fRow[i], fAmplitude[i], fTime[i], times, fNL0Times[i], fL1TimeSum[i]);
-       }
-       
-       for (Int_t i = 0; i < 48; i++) for (Int_t j = 0; j < 64; j++) dest.fTriggerBits[i][j] = fTriggerBits[i][j];
+               dest.Add(fColumn[i], fRow[i], fAmplitude[i], fTime[i], times, fNL0Times[i], fL1TimeSum[i], fTriggerBits[i]);
+       }       
 }
 
 //_______________
@@ -136,35 +133,37 @@ void AliESDCaloTrigger::Allocate(Int_t size)
        fAmplitude   = new Float_t[fNEntries];
        fTime        = new Float_t[fNEntries];
        fNL0Times    = new   Int_t[fNEntries];
-//     fL0Times     = new   Int_t[fNEntries * 10];
        fL1TimeSum   = new   Int_t[fNEntries];
+       fTriggerBits = new   Int_t[fNEntries];
 
        for (Int_t i = 0; i < fNEntries; i++) 
        {
-         fColumn[i]    = 0;
-         fRow[i]       = 0;
-         fAmplitude[i] = 0;
-         fTime[i]      = 0;
-         fNL0Times[i]  = 0;
-         fL1TimeSum[i] = 0;
+         fColumn[i]      = 0;
+         fRow[i]         = 0;
+         fAmplitude[i]   = 0;
+         fTime[i]        = 0;
+         fNL0Times[i]    = 0;
+         fL1TimeSum[i]   = 0;
+         fTriggerBits[i] = 0;
        }
        
        fL0Times->Set(fNEntries * 10);
 }
 
 //_______________
-Bool_t AliESDCaloTrigger::Add(Int_t col, Int_t row, Float_t amp, Float_t time, Int_t trgtimes[], Int_t ntrgtimes, Int_t trgts)
+Bool_t AliESDCaloTrigger::Add(Int_t col, Int_t row, Float_t amp, Float_t time, Int_t trgtimes[], Int_t ntrgtimes, Int_t trgts, Int_t trgbits)
 {
        //
        fCurrent++;
        
-          fColumn[fCurrent] = col;
-             fRow[fCurrent] = row;
-       fAmplitude[fCurrent] = amp;
-            fTime[fCurrent] = time;
-        fNL0Times[fCurrent] = ntrgtimes;
-       fL1TimeSum[fCurrent] = trgts;   
-
+            fColumn[fCurrent] = col;
+               fRow[fCurrent] = row;
+         fAmplitude[fCurrent] = amp;
+              fTime[fCurrent] = time;
+          fNL0Times[fCurrent] = ntrgtimes;
+         fL1TimeSum[fCurrent] = trgts; 
+       fTriggerBits[fCurrent] = trgbits;
+       
        if (ntrgtimes > 9) 
        {
                AliError("Should not have more than 10 L0 times");
@@ -177,6 +176,7 @@ Bool_t AliESDCaloTrigger::Add(Int_t col, Int_t row, Float_t amp, Float_t time, I
 }
 
 //_______________
+/*
 void AliESDCaloTrigger::SetTriggerBits(Int_t col, Int_t row, Int_t i, Int_t j)
 {
        //
@@ -188,6 +188,7 @@ void AliESDCaloTrigger::SetTriggerBits(Int_t col, Int_t row, Int_t i, Int_t j)
 
        fTriggerBits[col][row] = (fTriggerBits[col][row] | (1 << (i + 3 * j))); // L0 L1g L1j
 }
+*/
 
 //_______________
 Bool_t AliESDCaloTrigger::Next()
@@ -247,12 +248,12 @@ void AliESDCaloTrigger::GetNL0Times(Int_t& ntimes) const
 }
 
 //_______________
-void AliESDCaloTrigger::GetTriggerBits(Char_t& bits) const
+void AliESDCaloTrigger::GetTriggerBits(Int_t& bits) const
 {
        //
        if (fCurrent == -1) return;
 
-       bits = fTriggerBits[fColumn[fCurrent]][fRow[fCurrent]];
+       bits = fTriggerBits[fCurrent];
 }
 
 //_______________
@@ -280,5 +281,5 @@ void AliESDCaloTrigger::Print(const Option_t* /*opt*/) const
        printf("--L1:\n");
        printf("\tTIME SUM: %4d\n", fL1TimeSum[fCurrent]);
        printf("\tTHRESHOLDS (GAMMA: %4d, JET: %4d)\n", fL1Threshold[0], fL1Threshold[1]);
-       printf("--TRIGGER BITS: 0x%x\n", fTriggerBits[fColumn[fCurrent]][fRow[fCurrent]]);
+       printf("--TRIGGER BITS: 0x%x\n", fTriggerBits[fCurrent]);
 }      
index 8516d3de6874adb68eb9d045f691f922baf4e27e..aa7543e4896d428aa1d77f9762e9994edda02d9d 100644 (file)
@@ -31,17 +31,17 @@ public:
        void    Allocate(Int_t size);
        void    DeAllocate(        ); 
        
-       Bool_t  Add(Int_t col, Int_t row, Float_t amp, Float_t time, Int_t trgtimes[], Int_t ntrgtimes, Int_t trgts);
+       Bool_t  Add(Int_t col, Int_t row, Float_t amp, Float_t time, Int_t trgtimes[], Int_t ntrgtimes, Int_t trgts, Int_t trgbits);
        
        void    SetL1Threshold(Int_t i, Int_t thr) {fL1Threshold[i] = thr;}
-       void    SetTriggerBits(Int_t col, Int_t row, Int_t i, Int_t j);
+//     void    SetTriggerBits(Int_t col, Int_t row, Int_t i, Int_t j);
 
        void    GetPosition(     Int_t& col, Int_t& row           ) const;
        
        void    GetAmplitude(  Float_t& amp                       ) const;
        void    GetTime(       Float_t& time                      ) const;
        
-       void    GetTriggerBits( Char_t& bits                      ) const;
+       void    GetTriggerBits(  Int_t& bits                      ) const;
        void    GetNL0Times(     Int_t& ntimes                    ) const;
        void    GetL0Times(      Int_t  times[]                   ) const;
        Int_t   GetEntries(                                       ) const {return fNEntries;}
@@ -68,9 +68,9 @@ private:
        Int_t*   fNL0Times;       // [fNEntries]
        TArrayI* fL0Times;        //
        Int_t*   fL1TimeSum;      // [fNEntries]
-
-       Char_t   fTriggerBits[48][64]; //
-       Int_t    fL1Threshold[2];      // L1 thresholds from raw data
+       Int_t*   fTriggerBits;    // [fNEntries]
+       
+       Int_t    fL1Threshold[2]; // L1 thresholds from raw data
        
        ClassDef(AliESDCaloTrigger, 2)
 };