ROOT logo
#ifndef ALIESDVZEROFRIEND_H
#define ALIESDVZEROFRIEND_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

///////////////////////////////////////////////////////////////////////////////
///
/// This is a class for containing all the VZERO DDL raw data
/// It is written to the ESD-friend file
///
///////////////////////////////////////////////////////////////////////////////

#include <TObject.h>

class AliESDVZEROfriend: public TObject {
  public :
    AliESDVZEROfriend();
    virtual ~AliESDVZEROfriend();

    AliESDVZEROfriend(const AliESDVZEROfriend& vzerofriend);
    AliESDVZEROfriend& operator = (const AliESDVZEROfriend& vzerofriend);

    void Reset();

// Getters of various scalers and Minimum Bias flags :

   ULong64_t          GetBBScalers(Int_t channel) const  
      { return        fBBScalers[channel]; }
   ULong64_t          GetBGScalers(Int_t channel) const  
      { return        fBGScalers[channel]; }
   UInt_t             GetTriggerScalers(Int_t num_scaler) const 
      { return        fScalers[num_scaler]; }
   UInt_t             GetBunchNumbersMB(Int_t num_bunch) const 
      { return        fBunchNumbers[num_bunch]; }
   UShort_t           GetChargeMB(Int_t channel, Int_t num_bunch) const  
      { return        fChargeMB[channel][num_bunch]; } 
   Bool_t             GetIntMBFlag(Int_t channel, Int_t num_bunch) const   
      { return        fIsIntMB[channel][num_bunch]; } 
   Bool_t             GetBBMBFlag(Int_t channel, Int_t num_bunch) const   
      { return        fIsBBMB[channel][num_bunch]; }  
   Bool_t             GetBGMBFlag(Int_t channel, Int_t num_bunch) const   
      { return        fIsBGMB[channel][num_bunch]; }      
       
// Getters of ADC signals, ADC pedestals, time information and corresponding flags :

    Float_t           GetADC(Int_t channel) const
      { return fADC[channel][kNEvOfInt/2]; }
    Float_t           GetPedestal(Int_t channel, Int_t event) const
      { return fADC[channel][event]; }
    Bool_t            GetIntegratorFlag(Int_t channel, Int_t event) const
      { return fIsInt[channel][event]; }
    Bool_t            GetBBFlag(Int_t channel, Int_t event) const
      { return fIsBB[channel][event]; } 
    Bool_t            GetBGFlag(Int_t channel, Int_t event) const
      { return fIsBG[channel][event]; }   
    Float_t            GetTime(Int_t channel) const
      { return fTime[channel]; }
    Float_t            GetWidth(Int_t channel) const
      { return fWidth[channel]; }

    // Setters
    void              SetBBScalers(Int_t channel, ULong64_t scalers)
      { fBBScalers[channel] = scalers; }
    void              SetBGScalers(Int_t channel, ULong64_t scalers)
      { fBGScalers[channel] = scalers; }
    void              SetTriggerScalers(Int_t num_scaler, UInt_t scaler)
      { fScalers[num_scaler] = scaler; }
    void              SetBunchNumbersMB(Int_t num_bunch, UInt_t bunch)
      { fBunchNumbers[num_bunch] = bunch; }
    void              SetChargeMB(Int_t channel,Int_t num_bunch, UShort_t charge)
      { fChargeMB[channel][num_bunch] = charge; }
    void              SetIntMBFlag(Int_t channel,Int_t num_bunch, Bool_t flag)
      { fIsIntMB[channel][num_bunch] = flag; }
    void              SetBBMBFlag(Int_t channel,Int_t num_bunch, Bool_t flag)
      { fIsBBMB[channel][num_bunch] = flag; }
    void              SetBGMBFlag(Int_t channel,Int_t num_bunch, Bool_t flag)
      { fIsBGMB[channel][num_bunch] = flag; }

    void              SetPedestal(Int_t channel, Int_t event, Float_t adc)
      { fADC[channel][event] = adc; }
    void              SetIntegratorFlag(Int_t channel, Int_t event, Bool_t flag)
      { fIsInt[channel][event] = flag; }
    void              SetBBFlag(Int_t channel, Int_t event, Bool_t flag)
      { fIsBB[channel][event] = flag; }
    void              SetBGFlag(Int_t channel, Int_t event, Bool_t flag)
      { fIsBG[channel][event] = flag; }
    void              SetTime(Int_t channel, Float_t time)
      { fTime[channel] = time; }
    void              SetWidth(Int_t channel, Float_t width)
      { fWidth[channel] = width; }

    UShort_t          GetTriggerInputs() const
      { return fTrigger; }
    UShort_t          GetTriggerInputsMask() const
      { return fTriggerMask; }
    void              SetTriggerInputs(UShort_t inputs)
      { fTrigger = inputs; }
    void              SetTriggerInputsMask(UShort_t mask)
      { fTriggerMask = mask; }

    enum EESDVZEROfriendParams {
      kNChannels = 64, // number of electronic channels in V0 (FEE numbering)
      kNEvOfInt  = 21, // number of events of interest
      kNScalers  = 16, // number of scalers
      kNBunches  = 10  // number of bunches used in Minimum Bias information 
    };

  private:

    ULong64_t     fBBScalers[kNChannels];        // 'Beam-Beam' scalers for all channels
    ULong64_t     fBGScalers[kNChannels];        // 'Beam-Gas' scalers for all channels
    UInt_t        fScalers[kNScalers];           // Trigger scalers
    UInt_t        fBunchNumbers[kNBunches];      // Bunch numbers for the previous 10 MB events
    UShort_t      fChargeMB[kNChannels][kNBunches]; // ADC counts for all channels for the previous 10 MB events
    Bool_t        fIsIntMB[kNChannels][kNBunches];  // 'Integrator' flag for all channels for the previous 10 MB events
    Bool_t        fIsBBMB[kNChannels][kNBunches];   // 'Beam-Beam' flag for all channels for the previous 10 MB events
    Bool_t        fIsBGMB[kNChannels][kNBunches];   // 'Beam-Gas' for all channels for the previous 10 MB events

    Float_t       fADC[kNChannels][kNEvOfInt];   // ADC counts for all channels and all events of interest
    Bool_t        fIsInt[kNChannels][kNEvOfInt]; // 'Integrator' flag for all channels 
    Bool_t        fIsBB[kNChannels][kNEvOfInt];  // 'Beam-Beam' flag for all channels
    Bool_t        fIsBG[kNChannels][kNEvOfInt];  // 'Beam-Gas' flag for all channels
    Float_t       fTime[kNChannels];             // leading time for all channels - from HPTDC - in nanoseconds
    Float_t       fWidth[kNChannels];            // pulse width for all channels - from HPTDC - in nanoseconds

    UShort_t      fTrigger;        // VZERO trigger inputs
    UShort_t      fTriggerMask;    // VZERO trigger inputs mask

    ClassDef(AliESDVZEROfriend, 2) // container class for VZERO DDL raw data
};

#endif
 AliESDVZEROfriend.h:1
 AliESDVZEROfriend.h:2
 AliESDVZEROfriend.h:3
 AliESDVZEROfriend.h:4
 AliESDVZEROfriend.h:5
 AliESDVZEROfriend.h:6
 AliESDVZEROfriend.h:7
 AliESDVZEROfriend.h:8
 AliESDVZEROfriend.h:9
 AliESDVZEROfriend.h:10
 AliESDVZEROfriend.h:11
 AliESDVZEROfriend.h:12
 AliESDVZEROfriend.h:13
 AliESDVZEROfriend.h:14
 AliESDVZEROfriend.h:15
 AliESDVZEROfriend.h:16
 AliESDVZEROfriend.h:17
 AliESDVZEROfriend.h:18
 AliESDVZEROfriend.h:19
 AliESDVZEROfriend.h:20
 AliESDVZEROfriend.h:21
 AliESDVZEROfriend.h:22
 AliESDVZEROfriend.h:23
 AliESDVZEROfriend.h:24
 AliESDVZEROfriend.h:25
 AliESDVZEROfriend.h:26
 AliESDVZEROfriend.h:27
 AliESDVZEROfriend.h:28
 AliESDVZEROfriend.h:29
 AliESDVZEROfriend.h:30
 AliESDVZEROfriend.h:31
 AliESDVZEROfriend.h:32
 AliESDVZEROfriend.h:33
 AliESDVZEROfriend.h:34
 AliESDVZEROfriend.h:35
 AliESDVZEROfriend.h:36
 AliESDVZEROfriend.h:37
 AliESDVZEROfriend.h:38
 AliESDVZEROfriend.h:39
 AliESDVZEROfriend.h:40
 AliESDVZEROfriend.h:41
 AliESDVZEROfriend.h:42
 AliESDVZEROfriend.h:43
 AliESDVZEROfriend.h:44
 AliESDVZEROfriend.h:45
 AliESDVZEROfriend.h:46
 AliESDVZEROfriend.h:47
 AliESDVZEROfriend.h:48
 AliESDVZEROfriend.h:49
 AliESDVZEROfriend.h:50
 AliESDVZEROfriend.h:51
 AliESDVZEROfriend.h:52
 AliESDVZEROfriend.h:53
 AliESDVZEROfriend.h:54
 AliESDVZEROfriend.h:55
 AliESDVZEROfriend.h:56
 AliESDVZEROfriend.h:57
 AliESDVZEROfriend.h:58
 AliESDVZEROfriend.h:59
 AliESDVZEROfriend.h:60
 AliESDVZEROfriend.h:61
 AliESDVZEROfriend.h:62
 AliESDVZEROfriend.h:63
 AliESDVZEROfriend.h:64
 AliESDVZEROfriend.h:65
 AliESDVZEROfriend.h:66
 AliESDVZEROfriend.h:67
 AliESDVZEROfriend.h:68
 AliESDVZEROfriend.h:69
 AliESDVZEROfriend.h:70
 AliESDVZEROfriend.h:71
 AliESDVZEROfriend.h:72
 AliESDVZEROfriend.h:73
 AliESDVZEROfriend.h:74
 AliESDVZEROfriend.h:75
 AliESDVZEROfriend.h:76
 AliESDVZEROfriend.h:77
 AliESDVZEROfriend.h:78
 AliESDVZEROfriend.h:79
 AliESDVZEROfriend.h:80
 AliESDVZEROfriend.h:81
 AliESDVZEROfriend.h:82
 AliESDVZEROfriend.h:83
 AliESDVZEROfriend.h:84
 AliESDVZEROfriend.h:85
 AliESDVZEROfriend.h:86
 AliESDVZEROfriend.h:87
 AliESDVZEROfriend.h:88
 AliESDVZEROfriend.h:89
 AliESDVZEROfriend.h:90
 AliESDVZEROfriend.h:91
 AliESDVZEROfriend.h:92
 AliESDVZEROfriend.h:93
 AliESDVZEROfriend.h:94
 AliESDVZEROfriend.h:95
 AliESDVZEROfriend.h:96
 AliESDVZEROfriend.h:97
 AliESDVZEROfriend.h:98
 AliESDVZEROfriend.h:99
 AliESDVZEROfriend.h:100
 AliESDVZEROfriend.h:101
 AliESDVZEROfriend.h:102
 AliESDVZEROfriend.h:103
 AliESDVZEROfriend.h:104
 AliESDVZEROfriend.h:105
 AliESDVZEROfriend.h:106
 AliESDVZEROfriend.h:107
 AliESDVZEROfriend.h:108
 AliESDVZEROfriend.h:109
 AliESDVZEROfriend.h:110
 AliESDVZEROfriend.h:111
 AliESDVZEROfriend.h:112
 AliESDVZEROfriend.h:113
 AliESDVZEROfriend.h:114
 AliESDVZEROfriend.h:115
 AliESDVZEROfriend.h:116
 AliESDVZEROfriend.h:117
 AliESDVZEROfriend.h:118
 AliESDVZEROfriend.h:119
 AliESDVZEROfriend.h:120
 AliESDVZEROfriend.h:121
 AliESDVZEROfriend.h:122
 AliESDVZEROfriend.h:123
 AliESDVZEROfriend.h:124
 AliESDVZEROfriend.h:125
 AliESDVZEROfriend.h:126
 AliESDVZEROfriend.h:127
 AliESDVZEROfriend.h:128
 AliESDVZEROfriend.h:129
 AliESDVZEROfriend.h:130
 AliESDVZEROfriend.h:131
 AliESDVZEROfriend.h:132