ROOT logo
#ifndef ALIESDFMD_H
#define ALIESDFMD_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
 * reserved. 
 *
 * See cxx source for full Copyright notice                               
 */
//___________________________________________________________________
//
// AliESDFMD is the Event Summary Data entry for the FMD.  It contains
// a rough estimate of the charged particle multiplicity in each strip
// of the FMD.    It also contains the psuedo-rapidity of each strip.
// This is important, as it varies from event to event, due to a
// finite interaction point probability distribution. 
//
#ifndef ROOT_TObject
# include <TObject.h>
#endif
#ifndef ALIFMDFLOATMAP_H
# include "AliFMDFloatMap.h"
#endif

//___________________________________________________________________
/** @class AliESDFMD 
    @brief Event Summary Data for the Forward Multiplicity Detector. 
    @ingroup FMD_data
    This stores the psuedo-multiplicity and -rapidiy for each strip of
    the FMD. 
 */
class AliESDFMD : public TObject
{
public:
  /** 
   * Base class of looping over the FMD ESD object 
   *
   * A simple example could be 
   * 
   * @code 
   * struct ESDFMDPrinter : AliESDFMD::ForOne
   * { 
   *   Bool_t operator()(UShort_t d, Char_t r, UShort_t s, UShort_t t,
   *                     Float_t m, Float_t e) 
   *   { 
   *     Printf("FMD%d%c[%2d,%3d]=%7.4f @ %7.4f", d, r, s, t, m, e);
   *     return kTRUE;
   *   }
   * };
   * @endcode
   */
  class ForOne 
  {
  public:
    /** 
     * Destructor
     */    
    virtual ~ForOne() {}
    /** 
     * Functional operator called for each entry 
     * 
     * @param d Detector number
     * @param r Ring identifier 
     * @param s Sector number
     * @param t Strip number
     * @param m 'Bare' multiplicity of this strip
     * @param e Pseudo-rapidity of this strip
     * 
     * @return @c kTRUE in case of success, @c kFALSE in case of failure.
     *         If the method returns @c kFALSE, the loop stops. 
     */    
    virtual bool operator()(UShort_t d, Char_t r, UShort_t s, UShort_t t, 
			      Float_t m, Float_t e) = 0;
  };
  enum { 
    kNeedNoiseFix = (1 << 14)
  };
  /** 
   * Default constructor 
   */
  AliESDFMD();
  /** 
   * Copy constructor 
   * 
   * @param other Object to construct from 
   */
  AliESDFMD(const AliESDFMD& other);
  /** 
   * Assignment operator 
   * 
   * @param other Object to assign from
   *
   * @return  reference to this object 
   */
  AliESDFMD& operator=(const AliESDFMD& other);
  /** 
   * Destructor - does nothing 
   */
  virtual ~AliESDFMD() {}
  /** 
   * Copy the content of this object to @a obj which must have been 
   * preallocated
   *
   * @param obj Object to copy to
   */
  virtual void Copy(TObject &obj) const;

  /**
   * Reset the object 
   */
  void Clear(Option_t *option="");
  /** 
   * Get the pseudo-multiplicity of 
   * @f$ \text{FMD}\langle detector\rangle\lange ring\rangle_{\langle
   * sector\rangle\langle strip\rangle}@f$ 
   * 
   * @param detector Detector number (1-3)
   * @param ring     Ring identifier ('I' or 'O')
   * @param sector   Sector number (0-511, or 0-255)
   * @param strip    Strip number (0-19, or 0-39)
   *
   * @return Psuedo multiplicity 
   */
  Float_t Multiplicity(UShort_t detector, Char_t ring, 
		       UShort_t sector, UShort_t strip) const;
  /** 
   * Get the pseudo-rapidity of 
   * @f$ \text{FMD}\langle detector\rangle\lange ring\rangle_{\langle
   * sector\rangle\langle strip\rangle}@f$ 
   *
   * @param detector Detector number (1-3)
   * @param ring     Ring identifier ('I' or 'O')
   * @param sector   Sector number (0-511, or 0-255)
   * @param strip    Strip number (0-19, or 0-39)
   *
   * @return Psuedo rapidity 
   */
  Float_t Eta(UShort_t detector, Char_t ring, 
	      UShort_t sector, UShort_t strip) const;
  /** 
   * Get the azimuthal angle of 
   * @f$ \text{FMD}\langle detector\rangle\lange ring\rangle_{\langle
   * sector\rangle\langle strip\rangle}@f$ 
   *
   * @param detector Detector number (1-3)
   * @param ring     Ring identifier ('I' or 'O')
   * @param sector   Sector number (0-511, or 0-255)
   * @param strip    Strip number (0-19, or 0-39)
   *
   * @return Azimuthal angle 
   */
  Float_t Phi(UShort_t detector, Char_t ring, 
	      UShort_t sector, UShort_t strip) const;
  /** 
   * Get the polar angle (in degrees) from beam line of 
   * @f$ \text{FMD}\langle detector\rangle\lange ring\rangle_{\langle
   * sector\rangle\langle strip\rangle}@f$ 
   *
   * @param detector Detector number (1-3)
   * @param ring     Ring identifier ('I' or 'O')
   * @param sector   Sector number (0-511, or 0-255)
   * @param strip    Strip number (0-19, or 0-39)
   *
   * @return Polar angle
   */
  Float_t Theta(UShort_t detector, Char_t ring, 
		UShort_t sector, UShort_t strip) const;
  /** 
   * Get the radial distance (in cm) from beam line of 
   * @f$ \text{FMD}\langle detector\rangle\lange ring\rangle_{\langle
   * sector\rangle\langle strip\rangle}@f$ 
   *
   * @param detector Detector number (1-3)
   * @param ring     Ring identifier ('I' or 'O')
   * @param sector   Sector number (0-511, or 0-255)
   * @param strip    Strip number (0-19, or 0-39)
   *
   * @return Radial distance
   */
  Float_t R(UShort_t detector, Char_t ring, 
	    UShort_t sector, UShort_t strip) const;
  /** 
   * Set the pseudo-multiplicity of 
   * @f$ \text{FMD}\langle detector\rangle\lange ring\rangle_{\langle
   * sector\rangle\langle strip\rangle}@f$ 
   * 
   * @param detector Detector number (1-3)
   * @param ring     Ring identifier ('I' or 'O')
   * @param sector   Sector number (0-511, or 0-255)
   * @param strip    Strip number (0-19, or 0-39)
   * @param mult     Psuedo multiplicity 
   */
  void SetMultiplicity(UShort_t detector, Char_t ring, 
		       UShort_t sector, UShort_t strip, 
		       Float_t mult);
  /** 
   * Set the pseudo-rapidity of 
   * @f$ \text{FMD}\langle detector\rangle\lange ring\rangle_{\langle
   * sector\rangle\langle strip\rangle}@f$ 
   * 
   * @param detector Detector number (1-3)
   * @param ring     Ring identifier ('I' or 'O')
   * @param sector   Sector number (0-511, or 0-255)
   * @param strip    Strip number (0-19, or 0-39)
   * @param eta      Psuedo rapidity 
   */
  void SetEta(UShort_t detector, Char_t ring, 
	      UShort_t sector, UShort_t strip, 
	      Float_t eta);
  /** 
   * @param f the factor for noise suppression 
   */
  void SetNoiseFactor(Float_t f) { fNoiseFactor = f; }
  /** 
   * @param done Whether we've done angle correction or not 
   */
  void SetAngleCorrected(Bool_t done) { fAngleCorrected = done; }
  /** 
   * @return Whether we've done angle correction or not 
   */
  Bool_t IsAngleCorrected() const { return fAngleCorrected; }
  /** 
   * @return the  factor for noise suppression 
   */
  Float_t GetNoiseFactor() const { return fNoiseFactor; }
  /** 
   * @return maximum number of detectors 
   */
  UShort_t MaxDetectors() const { return fMultiplicity.MaxDetectors(); }
  /** 
   * @return maximum number of rings 
   */
  UShort_t MaxRings()     const { return fMultiplicity.MaxRings(); }
  /** 
   * @return maximum number of sectors 
   */
  UShort_t MaxSectors()   const { return fMultiplicity.MaxSectors(); }
  /** 
   * @return Maximum number of strips 
   */
  UShort_t MaxStrips()    const { return fMultiplicity.MaxStrips(); }
  /** 
   * Print this object to standard out. 
   * 
   * @param option Options 
   */
  void Print(Option_t* option="") const;
  /** 
   * Check if we need the @c UShort_t fix 
   * 
   * @param file File this object was read from 
   */
  void CheckNeedUShort(TFile* file);
  /** 
   * Check if we need the noise fix 
   * 
   * @return true if class version of read object is 3 or smaller 
   */
  Bool_t NeedNoiseFix() const { return TestBit(kNeedNoiseFix); }
  /** 
   * Call the function operator of the passed object @a algo for each
   * entry in this object
   * 
   * @param algo Algorithm
   * 
   * @return @c kTRUE on success, @c kFALSE if the passed object
   * failed at any entry.  It will return immediately on error. 
   */
  Bool_t ForEach(ForOne& algo) const;
  enum {
    /** Value used for undefined multiplicity */
    kInvalidMult = 1024
  };
  enum {
    /** Value used for undefined pseudo rapidity */
    kInvalidEta = 1024
  };
  /** 
   * @return constant reference to multiplicity map 
   */
  const AliFMDFloatMap& MultiplicityMap() const { return fMultiplicity; }
  /** 
   * @return constant reference to pseudo-rapidity map 
   */
  const AliFMDFloatMap& EtaMap() const { return fEta; }
protected:
  AliFMDFloatMap fMultiplicity;   // Psuedo multplicity per strip
  AliFMDFloatMap fEta;            // Psuedo-rapidity per strip
  Float_t        fNoiseFactor;    // Factor used for noise suppresion
  Bool_t         fAngleCorrected; // Whether we've done angle correction
  ClassDef(AliESDFMD,4)           // ESD info from FMD
};
#endif
//____________________________________________________________________
//
// Local Variables:
//   mode: C++
// End:
//
// EOF
//
 AliESDFMD.h:1
 AliESDFMD.h:2
 AliESDFMD.h:3
 AliESDFMD.h:4
 AliESDFMD.h:5
 AliESDFMD.h:6
 AliESDFMD.h:7
 AliESDFMD.h:8
 AliESDFMD.h:9
 AliESDFMD.h:10
 AliESDFMD.h:11
 AliESDFMD.h:12
 AliESDFMD.h:13
 AliESDFMD.h:14
 AliESDFMD.h:15
 AliESDFMD.h:16
 AliESDFMD.h:17
 AliESDFMD.h:18
 AliESDFMD.h:19
 AliESDFMD.h:20
 AliESDFMD.h:21
 AliESDFMD.h:22
 AliESDFMD.h:23
 AliESDFMD.h:24
 AliESDFMD.h:25
 AliESDFMD.h:26
 AliESDFMD.h:27
 AliESDFMD.h:28
 AliESDFMD.h:29
 AliESDFMD.h:30
 AliESDFMD.h:31
 AliESDFMD.h:32
 AliESDFMD.h:33
 AliESDFMD.h:34
 AliESDFMD.h:35
 AliESDFMD.h:36
 AliESDFMD.h:37
 AliESDFMD.h:38
 AliESDFMD.h:39
 AliESDFMD.h:40
 AliESDFMD.h:41
 AliESDFMD.h:42
 AliESDFMD.h:43
 AliESDFMD.h:44
 AliESDFMD.h:45
 AliESDFMD.h:46
 AliESDFMD.h:47
 AliESDFMD.h:48
 AliESDFMD.h:49
 AliESDFMD.h:50
 AliESDFMD.h:51
 AliESDFMD.h:52
 AliESDFMD.h:53
 AliESDFMD.h:54
 AliESDFMD.h:55
 AliESDFMD.h:56
 AliESDFMD.h:57
 AliESDFMD.h:58
 AliESDFMD.h:59
 AliESDFMD.h:60
 AliESDFMD.h:61
 AliESDFMD.h:62
 AliESDFMD.h:63
 AliESDFMD.h:64
 AliESDFMD.h:65
 AliESDFMD.h:66
 AliESDFMD.h:67
 AliESDFMD.h:68
 AliESDFMD.h:69
 AliESDFMD.h:70
 AliESDFMD.h:71
 AliESDFMD.h:72
 AliESDFMD.h:73
 AliESDFMD.h:74
 AliESDFMD.h:75
 AliESDFMD.h:76
 AliESDFMD.h:77
 AliESDFMD.h:78
 AliESDFMD.h:79
 AliESDFMD.h:80
 AliESDFMD.h:81
 AliESDFMD.h:82
 AliESDFMD.h:83
 AliESDFMD.h:84
 AliESDFMD.h:85
 AliESDFMD.h:86
 AliESDFMD.h:87
 AliESDFMD.h:88
 AliESDFMD.h:89
 AliESDFMD.h:90
 AliESDFMD.h:91
 AliESDFMD.h:92
 AliESDFMD.h:93
 AliESDFMD.h:94
 AliESDFMD.h:95
 AliESDFMD.h:96
 AliESDFMD.h:97
 AliESDFMD.h:98
 AliESDFMD.h:99
 AliESDFMD.h:100
 AliESDFMD.h:101
 AliESDFMD.h:102
 AliESDFMD.h:103
 AliESDFMD.h:104
 AliESDFMD.h:105
 AliESDFMD.h:106
 AliESDFMD.h:107
 AliESDFMD.h:108
 AliESDFMD.h:109
 AliESDFMD.h:110
 AliESDFMD.h:111
 AliESDFMD.h:112
 AliESDFMD.h:113
 AliESDFMD.h:114
 AliESDFMD.h:115
 AliESDFMD.h:116
 AliESDFMD.h:117
 AliESDFMD.h:118
 AliESDFMD.h:119
 AliESDFMD.h:120
 AliESDFMD.h:121
 AliESDFMD.h:122
 AliESDFMD.h:123
 AliESDFMD.h:124
 AliESDFMD.h:125
 AliESDFMD.h:126
 AliESDFMD.h:127
 AliESDFMD.h:128
 AliESDFMD.h:129
 AliESDFMD.h:130
 AliESDFMD.h:131
 AliESDFMD.h:132
 AliESDFMD.h:133
 AliESDFMD.h:134
 AliESDFMD.h:135
 AliESDFMD.h:136
 AliESDFMD.h:137
 AliESDFMD.h:138
 AliESDFMD.h:139
 AliESDFMD.h:140
 AliESDFMD.h:141
 AliESDFMD.h:142
 AliESDFMD.h:143
 AliESDFMD.h:144
 AliESDFMD.h:145
 AliESDFMD.h:146
 AliESDFMD.h:147
 AliESDFMD.h:148
 AliESDFMD.h:149
 AliESDFMD.h:150
 AliESDFMD.h:151
 AliESDFMD.h:152
 AliESDFMD.h:153
 AliESDFMD.h:154
 AliESDFMD.h:155
 AliESDFMD.h:156
 AliESDFMD.h:157
 AliESDFMD.h:158
 AliESDFMD.h:159
 AliESDFMD.h:160
 AliESDFMD.h:161
 AliESDFMD.h:162
 AliESDFMD.h:163
 AliESDFMD.h:164
 AliESDFMD.h:165
 AliESDFMD.h:166
 AliESDFMD.h:167
 AliESDFMD.h:168
 AliESDFMD.h:169
 AliESDFMD.h:170
 AliESDFMD.h:171
 AliESDFMD.h:172
 AliESDFMD.h:173
 AliESDFMD.h:174
 AliESDFMD.h:175
 AliESDFMD.h:176
 AliESDFMD.h:177
 AliESDFMD.h:178
 AliESDFMD.h:179
 AliESDFMD.h:180
 AliESDFMD.h:181
 AliESDFMD.h:182
 AliESDFMD.h:183
 AliESDFMD.h:184
 AliESDFMD.h:185
 AliESDFMD.h:186
 AliESDFMD.h:187
 AliESDFMD.h:188
 AliESDFMD.h:189
 AliESDFMD.h:190
 AliESDFMD.h:191
 AliESDFMD.h:192
 AliESDFMD.h:193
 AliESDFMD.h:194
 AliESDFMD.h:195
 AliESDFMD.h:196
 AliESDFMD.h:197
 AliESDFMD.h:198
 AliESDFMD.h:199
 AliESDFMD.h:200
 AliESDFMD.h:201
 AliESDFMD.h:202
 AliESDFMD.h:203
 AliESDFMD.h:204
 AliESDFMD.h:205
 AliESDFMD.h:206
 AliESDFMD.h:207
 AliESDFMD.h:208
 AliESDFMD.h:209
 AliESDFMD.h:210
 AliESDFMD.h:211
 AliESDFMD.h:212
 AliESDFMD.h:213
 AliESDFMD.h:214
 AliESDFMD.h:215
 AliESDFMD.h:216
 AliESDFMD.h:217
 AliESDFMD.h:218
 AliESDFMD.h:219
 AliESDFMD.h:220
 AliESDFMD.h:221
 AliESDFMD.h:222
 AliESDFMD.h:223
 AliESDFMD.h:224
 AliESDFMD.h:225
 AliESDFMD.h:226
 AliESDFMD.h:227
 AliESDFMD.h:228
 AliESDFMD.h:229
 AliESDFMD.h:230
 AliESDFMD.h:231
 AliESDFMD.h:232
 AliESDFMD.h:233
 AliESDFMD.h:234
 AliESDFMD.h:235
 AliESDFMD.h:236
 AliESDFMD.h:237
 AliESDFMD.h:238
 AliESDFMD.h:239
 AliESDFMD.h:240
 AliESDFMD.h:241
 AliESDFMD.h:242
 AliESDFMD.h:243
 AliESDFMD.h:244
 AliESDFMD.h:245
 AliESDFMD.h:246
 AliESDFMD.h:247
 AliESDFMD.h:248
 AliESDFMD.h:249
 AliESDFMD.h:250
 AliESDFMD.h:251
 AliESDFMD.h:252
 AliESDFMD.h:253
 AliESDFMD.h:254
 AliESDFMD.h:255
 AliESDFMD.h:256
 AliESDFMD.h:257
 AliESDFMD.h:258
 AliESDFMD.h:259
 AliESDFMD.h:260
 AliESDFMD.h:261
 AliESDFMD.h:262
 AliESDFMD.h:263
 AliESDFMD.h:264
 AliESDFMD.h:265
 AliESDFMD.h:266
 AliESDFMD.h:267
 AliESDFMD.h:268
 AliESDFMD.h:269
 AliESDFMD.h:270
 AliESDFMD.h:271
 AliESDFMD.h:272
 AliESDFMD.h:273
 AliESDFMD.h:274
 AliESDFMD.h:275
 AliESDFMD.h:276
 AliESDFMD.h:277
 AliESDFMD.h:278
 AliESDFMD.h:279
 AliESDFMD.h:280
 AliESDFMD.h:281
 AliESDFMD.h:282
 AliESDFMD.h:283
 AliESDFMD.h:284
 AliESDFMD.h:285
 AliESDFMD.h:286
 AliESDFMD.h:287
 AliESDFMD.h:288
 AliESDFMD.h:289
 AliESDFMD.h:290
 AliESDFMD.h:291
 AliESDFMD.h:292
 AliESDFMD.h:293
 AliESDFMD.h:294
 AliESDFMD.h:295
 AliESDFMD.h:296
 AliESDFMD.h:297
 AliESDFMD.h:298
 AliESDFMD.h:299