Changes for #80800 following bugs #80687: commit to trunk + port to the release ...
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 13 Apr 2011 08:14:47 +0000 (08:14 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 13 Apr 2011 08:14:47 +0000 (08:14 +0000)
EMCAL/AliEMCALReconstructor.cxx
EMCAL/AliEMCALTriggerData.cxx
EMCAL/AliEMCALTriggerData.h
EMCAL/AliEMCALTriggerRawDigitMaker.cxx
STEER/AliESDCaloTrigger.cxx
STEER/AliESDCaloTrigger.h
STEER/AliESDEvent.h
STEER/AliESDRun.h

index fd67b8d..e41a446 100644 (file)
@@ -322,6 +322,8 @@ void AliEMCALReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree,
   // Trigger
   //########################################
   
+  static int saveOnce = 0;
+       
   Int_t v0M[2] = {0, 0};
   
   AliESDVZERO* esdV0 = esd->GetVZEROData();
@@ -381,6 +383,22 @@ void AliEMCALReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree,
       trgESD->SetL1Threshold(0, fTriggerData->GetL1GammaThreshold());
       
       trgESD->SetL1Threshold(1, fTriggerData->GetL1JetThreshold()  );
+
+         Int_t v0[2];
+         fTriggerData->GetL1V0(v0);
+               
+         trgESD->SetL1V0(v0);  
+         trgESD->SetL1FrameMask(fTriggerData->GetL1FrameMask());            
+
+         if (!saveOnce) 
+         {
+                 int type[8] = {0};
+                 fTriggerData->GetL1TriggerType(type);
+
+                 esd->SetCaloTriggerType(type);
+                 
+                 saveOnce = 1;
+         }
     }
   
   // Resetting
index ce4bef7..6ecd9d0 100644 (file)
@@ -38,7 +38,10 @@ fL1GammaPatches(),
 fL1JetPatches(),
 fL1Region(),
 fL1GammaThreshold(0),
-fL1JetThreshold(0)
+fL1JetThreshold(0),
+fL1V0(),
+fL1FrameMask(0),
+fL1TriggerType()
 {  
        //
        for (Int_t i = 0; i < 2; i++)
@@ -50,6 +53,9 @@ fL1JetThreshold(0)
        
        for (Int_t i = 0; i < 32; i++) for (Int_t j = 0; j < 24; j++) for (Int_t k = 0; k <  4; k++) fL0Region[i][j][k] = 0;
        for (Int_t i = 0; i <  2; i++) for (Int_t j = 0; j < 48; j++) for (Int_t k = 0; k < 64; k++) fL1Region[i][j][k] = 0;
+       
+       fL1V0[0] = fL1V0[1] = 0;
+       for (Int_t i = 0; i < 8; i++) fL1TriggerType[i] = 0;    
 }
 
 //_____________
index 8f311f5..0391aa7 100644 (file)
@@ -5,7 +5,7 @@
 
 /*
 EMCal trigger data container: can be used independently of the data stream (simulation or raw data)
-for persistency of produced data presently stored in TTreeD
+for transient storage of trigger data
 Author: R. GUERNANE LPSC Grenoble CNRS/IN2P3
 */
 
@@ -30,9 +30,13 @@ public:
        
        virtual void SetPatches(TriggerType_t type, Int_t i, const TClonesArray& patches);
        
-       virtual void SetL1GammaThreshold(Int_t v) {fL1GammaThreshold = v;}
-       virtual void SetL1JetThreshold(  Int_t v) {  fL1JetThreshold = v;}
+       virtual void SetL1GammaThreshold(Int_t  v) {fL1GammaThreshold = v;}
+       virtual void SetL1JetThreshold(  Int_t  v) {  fL1JetThreshold = v;}
+       virtual void SetL1V0(            Int_t* v) {for (int i = 0; i < 2; i++) fL1V0[i] = v[i];}
+       virtual void SetL1FrameMask(     Int_t  v) {     fL1FrameMask = v;}            
+       virtual void SetL1TriggerType(   Int_t* v) {for (int i = 0; i < 8; i++) fL1TriggerType[i] = v[i];}
 
+       
        virtual void          GetL0Trigger(  Int_t i, Int_t j, Int_t& k  ) const {   k = fL0Trigger[i][j];}
        virtual Int_t         GetL0Trigger(  Int_t i, Int_t j            ) const {return fL0Trigger[i][j];}
        
@@ -41,9 +45,12 @@ public:
 
        virtual void          GetL1Region( Int_t i, Int_t arr[][64]             ) const;
        
-       virtual Int_t         GetL1GammaThreshold() const {return fL1GammaThreshold;}
-       virtual Int_t         GetL1JetThreshold()   const {return   fL1JetThreshold;}
-
+       virtual Int_t         GetL1GammaThreshold()           const {return fL1GammaThreshold;}
+       virtual Int_t         GetL1JetThreshold()             const {return   fL1JetThreshold;}
+       virtual void          GetL1V0(            Int_t  v[]) const {for (int i = 0; i < 2; i++) v[i] = fL1V0[i];}
+       virtual Int_t         GetL1FrameMask(               ) const {return fL1FrameMask;}            
+       virtual void          GetL1TriggerType(   Int_t  v[]) const {for (int i = 0; i < 8; i++) v[i] = fL1TriggerType[i];}
+       
        virtual Int_t         GetMode() const {return fMode;}
        
        virtual void          Scan() const;
@@ -70,7 +77,11 @@ private:
        Int_t        fL1GammaThreshold;             //
        Int_t          fL1JetThreshold;             //  
        
-       ClassDef(AliEMCALTriggerData,1)
+       Int_t                    fL1V0[2];          //
+       Int_t             fL1FrameMask;             //
+       Int_t           fL1TriggerType[8];          //
+       
+       ClassDef(AliEMCALTriggerData,2)
 };
 
 #endif
index 881fd3d..41ac1e1 100644 (file)
@@ -314,6 +314,24 @@ void AliEMCALTriggerRawDigitMaker::PostProcess()
                fTriggerData->SetL1GammaThreshold(fSTURawStream->GetL1GammaThreshold());
                fTriggerData->SetL1JetThreshold(  fSTURawStream->GetL1JetThreshold()  );
                
+               Int_t v0[2] = {fSTURawStream->GetV0A(), fSTURawStream->GetV0C()};
+               
+               Int_t type[8] = 
+               {
+                       fSTURawStream->GetGA(),
+                       fSTURawStream->GetGB(),
+                       fSTURawStream->GetGC(),
+                       fSTURawStream->GetJA(),
+                       fSTURawStream->GetJB(),
+                       fSTURawStream->GetJC(),
+                       fSTURawStream->GetRegionEnable(), 
+                       fSTURawStream->GetFwVersion()
+               };
+               
+               fTriggerData->SetL1FrameMask(fSTURawStream->GetFrameReceived());
+               fTriggerData->SetL1V0(v0);
+               fTriggerData->SetL1TriggerType(type);
+               
                Int_t iTRU, x, y;
 
                if (fSTURawStream->GetRawData())
index 391b14a..d436b99 100644 (file)
@@ -41,9 +41,14 @@ fTime(0x0),
 fNL0Times(0x0),
 fL0Times(new TArrayI()),
 fL1TimeSum(0x0),
-fTriggerBits(0x0)
+fTriggerBits(0x0),
+fL1Threshold(),
+fL1V0(),
+fL1FrameMask(0)
 {
        //
+       fL1Threshold[0] = fL1Threshold[1] = 0;
+       fL1V0[0] = fL1V0[1] = 0;        
 }
 
 //_______________
@@ -57,7 +62,10 @@ fTime(0x0),
 fNL0Times(0x0),
 fL0Times(new TArrayI()),
 fL1TimeSum(0x0),
-fTriggerBits(0x0)
+fTriggerBits(0x0),
+fL1Threshold(),
+fL1V0(),
+fL1FrameMask(0)
 {
        //
        src.Copy(*this);
@@ -118,6 +126,11 @@ void AliESDCaloTrigger::Copy(TObject &obj) const
          
                dest.Add(fColumn[i], fRow[i], fAmplitude[i], fTime[i], times, fNL0Times[i], fL1TimeSum[i], fTriggerBits[i]);
        }       
+
+       dest.SetL1Threshold(0, fL1Threshold[0]);
+       dest.SetL1Threshold(1, fL1Threshold[1]);
+       dest.SetL1V0(fL1V0);
+       dest.SetL1FrameMask(fL1FrameMask);
 }
 
 //_______________
@@ -176,21 +189,6 @@ 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)
-{
-       //
-       if (col < 0 || col > 47 || row < 0 || row > 63) 
-       {
-               AliError("Bad position!");
-               return;
-       }
-
-       fTriggerBits[col][row] = (fTriggerBits[col][row] | (1 << (i + 3 * j))); // L0 L1g L1j
-}
-*/
-
-//_______________
 Bool_t AliESDCaloTrigger::Next()
 {
        //
index 354cb86..cfa3049 100644 (file)
@@ -34,8 +34,9 @@ public:
        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    SetL1V0(const Int_t* v) {for (int i = 0; i < 2; i++) fL1V0[i] = v[i];}
+       void    SetL1FrameMask(Int_t m) {fL1FrameMask = m;}
+       
        void    GetPosition(     Int_t& col, Int_t& row           ) const;
        
        void    GetAmplitude(  Float_t& amp                       ) const;
@@ -47,9 +48,10 @@ public:
        Int_t   GetEntries(                                       ) const {return fNEntries;}
 
        void    GetL1TimeSum(    Int_t& timesum                   ) const;
-
        Int_t   GetL1Threshold(  Int_t  i                         ) const {return fL1Threshold[i];}
-
+       Int_t   GetL1V0(         Int_t  i                         ) const {return fL1V0[i];}
+       Int_t   GetL1FrameMask(                                   ) const {return fL1FrameMask;}
+       
        virtual Bool_t Next();
 
        virtual void Copy(TObject& obj) const;
@@ -71,8 +73,11 @@ private:
        Int_t*   fTriggerBits;    // [fNEntries]
        
        Int_t    fL1Threshold[2]; // L1 thresholds from raw data
+       Int_t    fL1V0[2];        // L1 threshold components
+       Int_t    fL1FrameMask;    // Validation flag for L1 data
+       
        
-       ClassDef(AliESDCaloTrigger, 3)
+       ClassDef(AliESDCaloTrigger, 4)
 };
 #endif
 
index ff9f257..36d84a6 100644 (file)
@@ -133,6 +133,9 @@ public:
   const TGeoHMatrix* GetPHOSMatrix(Int_t i) const {return fESDRun?fESDRun->GetPHOSMatrix(i):0x0;}
   void     SetEMCALMatrix(TGeoHMatrix*matrix, Int_t i) {if(fESDRun) fESDRun->SetEMCALMatrix(matrix,i);}
   const TGeoHMatrix* GetEMCALMatrix(Int_t i) const {return fESDRun?fESDRun->GetEMCALMatrix(i):0x0;}
+  void     SetCaloTriggerType(const Int_t* type) {if (fESDRun) fESDRun->SetCaloTriggerType(type);}
+  Int_t*   GetCaloTriggerType() const {return fESDRun?fESDRun->GetCaloTriggerType():0x0;};
+       
   //
   void        SetCurrentL3(Float_t cur)           const  {if(fESDRun) fESDRun->SetCurrentL3(cur);}
   void        SetCurrentDip(Float_t cur)          const  {if(fESDRun) fESDRun->SetCurrentDip(cur);}
index 991f138..96aa044 100644 (file)
@@ -100,6 +100,9 @@ public:
     return ((i >= 0)  && (i<kT0spreadSize)) ? fT0spread[i] : 0;}
   void       SetT0spread(Int_t i, Float_t t);
   void       SetT0spread(Float_t *t);
+       
+  void       SetCaloTriggerType(const Int_t* in) {for (int i = 0; i < 8; i++) fCaloTriggerType[i] = in[i];}
+  Int_t*     GetCaloTriggerType() {return fCaloTriggerType;}
 
 private:
   Float_t         fCurrentL3;       // signed current in the L3     (LHC convention: +current -> +Bz)
@@ -121,8 +124,9 @@ private:
   TGeoHMatrix*    fPHOSMatrix[kNPHOSMatrix]; //PHOS module position and orientation matrices
   TGeoHMatrix*    fEMCALMatrix[kNEMCALMatrix]; //EMCAL supermodule position and orientation matrices
   Float_t         fT0spread[kT0spreadSize];     // spread of time distributions on T0A, T0C, (T0A+T0C)/2, (T0A-T0C)/2
-
-  ClassDef(AliESDRun,10)
+  Int_t           fCaloTriggerType[8]; // Calorimeter trigger type
+       
+  ClassDef(AliESDRun,11)
 };
 
 #endif