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

//_________________________________________________________________________
// Class that contains methods to select candidate pairs to neutral meson 
// 2 main selections, invariant mass around pi0 (also any other mass),
// apperture angle to distinguish from combinatorial.
// There is a 3rd cut based on the gamma correlation on phi or pt.
//-- Author: Gustavo Conesa (INFN-LNF)

// --- ROOT system ---
#include<TObject.h>
#include<TArrayD.h>
#include<TString.h>

class TLorentzVector ;
class TList   ;
class TH2F    ;

class AliNeutralMesonSelection : public TObject {
  
 public: 
  AliNeutralMesonSelection() ; // default ctor
  virtual ~AliNeutralMesonSelection() { ; } //virtual dtor  

  // General

  TList *  GetCreateOutputObjects();
  
  void     InitParameters();	
  
  void     Print(const Option_t * opt) const;

  Bool_t   AreNeutralMesonSelectionHistosKept()   const { return fKeepNeutralMesonHistos ; }
  void     KeepNeutralMesonSelectionHistos(Bool_t keep) { fKeepNeutralMesonHistos = keep ; }
  
  Bool_t   SelectPair(TLorentzVector particlei,  TLorentzVector particlej, Int_t calo)  ;
  
  void     SetParticle(TString particleName) ;  // Do some default settings for "Pi0" or "Eta"
  TString  GetParticle()                          const { return fParticle               ; }
  
  // Asymmetry selection
    
  Float_t  GetAsymmetryCut()                      const { return fAsymmetryCut           ; }
  void     SetAsymmetryCut(Float_t asy)                 { fAsymmetryCut = asy            ; }
  
  void     SwitchOnAsymmetryCut()                       { fUseAsymmetryCut = kTRUE       ; }
  void     SwitchOffAsymmetryCut()                      { fUseAsymmetryCut = kFALSE      ; }
  
  //Opening angle selection 
  
  Double_t GetAngleMaxParam(Int_t i)              const { return fAngleMaxParam.At(i)    ; }
  void     SetAngleMaxParam(Int_t i, Double_t par)      { fAngleMaxParam.AddAt(par,i)    ; }
  
  void     SetShiftMinAngleCut(Float_t a, Float_t b)    { fShiftMinAngle[0] = a          ;
                                                          fShiftMinAngle[1] = b          ; }
  
  void     SwitchOnAngleSelection()                     { fUseAngleCut = kTRUE           ; }
  void     SwitchOffAngleSelection()                    { fUseAngleCut = kFALSE          ; }

  Bool_t   IsAngleInWindow(Float_t angle, Float_t e) const ;
  
  //Invariant mass selection
  
  Double_t GetInvMassMaxCut()                     const { return fInvMassMaxCut          ; }
  Double_t GetInvMassMinCut()                     const { return fInvMassMinCut          ; }
  
  void     SetInvMassCutRange(Double_t invmassmin, Double_t invmassmax)
            { fInvMassMaxCut =invmassmax;  fInvMassMinCut =invmassmin                    ; }	
  
  void     SetSideBandCutRanges( Double_t lmin, Double_t lmax, 
                                 Double_t rmin, Double_t rmax )
            { fLeftBandMinCut  = lmin ; fLeftBandMaxCut  = lmax ; 
              fRightBandMinCut = rmin ; fRightBandMaxCut = rmax ; }	
  
  void     SetInvMassCutMaxParameters(Float_t a, Float_t b, Float_t c)
            { fInvMassMaxCutParam[0] = a ; 
              fInvMassMaxCutParam[1] = b ; 
              fInvMassMaxCutParam[2] = c ; }	

  Double_t GetMass()                              const { return fM                      ; }
  void     SetMass(Double_t m)                          { fM = m                         ; }
  
  
  // Decay photon bit setting
  
  enum decayTypes { kPi0, kEta, kPi0Side, kEtaSide} ;

  UInt_t    GetDecayBit()                         const { return fDecayBit               ; }
  
  void    SetDecayBit(Int_t &tag, UInt_t set) const {
    // Set bit of type set (decayTypes) in tag
    tag |= (1<<set) ;
  }
  
  void    SetDecayBit(Int_t &tag) const {
    // Set bit of type set (decayTypes) in tag
    tag |= (1<<fDecayBit) ;
  }
  
  Bool_t  CheckDecayBit(Int_t tag, UInt_t test) const {
    // Check if in tag the bit test (decayTypes) is set.
    if (tag & (1<<test) ) return  kTRUE ;
    else return kFALSE ;
  }

  Bool_t  CheckDecayBit(Int_t tag) const {
    // Check if in tag the bit test (decayTypes) is set.
    if (tag & (1<<fDecayBit) ) return  kTRUE ;
    else return kFALSE ;
  }
  
  // Histograms setters and getters
  
  virtual void SetHistoERangeAndNBins(Float_t min, Float_t max, Int_t n) {
    fHistoNEBins = n ;
    fHistoEMax = max ;
    fHistoEMin = min ;
  }
  
  Int_t   GetHistoNEBins()     const { return fHistoNEBins    ; }
  Float_t GetHistoEMin()       const { return fHistoEMin      ; }
  Float_t GetHistoEMax()       const { return fHistoEMax      ; }
    
  virtual void SetHistoAngleRangeAndNBins(Float_t min, Float_t max, Int_t n) {
    fHistoNAngleBins = n ;
    fHistoAngleMax = max ;
    fHistoAngleMin = min ;
  }
  
  Int_t   GetHistoNAngleBins() const { return fHistoNAngleBins ; }
  Float_t GetHistoAngleMin()   const { return fHistoAngleMin   ; }
  Float_t GetHistoAngleMax()   const { return fHistoAngleMax   ; }
  
  virtual void SetHistoIMRangeAndNBins(Float_t min, Float_t max, Int_t n) {
    fHistoNIMBins = n ;
    fHistoIMMax = max ;
    fHistoIMMin = min ;
  }
  
  Int_t   GetHistoNIMBins()    const { return fHistoNIMBins    ; }
  Float_t GetHistoIMMin()      const { return fHistoIMMin      ; }
  Float_t GetHistoIMMax()      const { return fHistoIMMax      ; }
  
 private:
  
  Float_t  fAsymmetryCut  ;               // Asymmetry cut
  Bool_t   fUseAsymmetryCut;              // Use the asymmetry cut

  Double_t fM ;                           // Mass of the neutral meson
  Double_t fInvMassMaxCut ;               // Invariant Mass cut maximum
  Double_t fInvMassMinCut ;               // Invariant Masscut minimun
  Double_t fInvMassMaxCutParam[3];        // Variable invariant mass max cut, for pi0 in EMCAL
  
  Double_t fLeftBandMinCut  ;             // Side Band selection, min left  band cut
  Double_t fLeftBandMaxCut  ;             // Side Band selection, max left  band cut
  Double_t fRightBandMinCut ;             // Side Band selection, min right band cut
  Double_t fRightBandMaxCut ;             // Side Band selection, max right band cut
  
  TArrayD  fAngleMaxParam ;               // Max opening angle selection parameters
  Bool_t   fUseAngleCut   ;               // Select pairs depending on their opening angle
  Float_t  fShiftMinAngle[2] ;            // Correction shift for min angle from true kinematic limit, resolution effects
  
  Bool_t   fKeepNeutralMesonHistos ;      // Keep neutral meson selection histograms
  
  TString  fParticle ;                    // neutral meson name (Pi0, Eta, +SideBand)
  UInt_t   fDecayBit;                     // Decay type flag, set when fParticle is set

  //Histograms
  TH2F *   fhAnglePairNoCut ;             //! Aperture angle of decay photons, no cuts
  TH2F *   fhAnglePairOpeningAngleCut ;   //! Aperture angle of decay photons, cut on opening angle
  TH2F *   fhAnglePairAsymmetryCut ;      //! Aperture angle of decay photons, asymmetry cut
  TH2F *   fhAnglePairAllCut ;            //! Aperture angle of decay photons, all cuts
  
  TH2F *   fhInvMassPairNoCut ;           //! Invariant mass of decay photons, no cuts
  TH2F *   fhInvMassPairOpeningAngleCut ; //! Invariant mass of decay photons, cut on opening angle
  TH2F *   fhInvMassPairAsymmetryCut ;    //! Invariant mass of decay photons, asymmetry cut  
  TH2F *   fhInvMassPairAllCut ;          //! Invariant mass of decay photons, all cuts

  TH2F *   fhAsymmetryNoCut ;             //! Asymmetry of decay photons, no cuts
  TH2F *   fhAsymmetryOpeningAngleCut ;   //! Asymmetry of decay photons, cut on opening angle
  TH2F *   fhAsymmetryAllCut ;            //! Asymmetry of decay photons, all cuts
  
  //Histograms binning and range    
  Int_t    fHistoNEBins ;                 // Number of bins in pi0 E axis
  Float_t  fHistoEMax ;                   // Maximum value of pi0 E histogram range
  Float_t  fHistoEMin ;                   // Minimum value of pi0 E histogram range
  
  Int_t    fHistoNAngleBins ;             // Number of bins in angle axis
  Float_t  fHistoAngleMax ;               // Maximum value of angle histogram range
  Float_t  fHistoAngleMin ;               // Minimum value of angle histogram range
  
  Int_t    fHistoNIMBins ;                // Number of bins in Invariant Mass axis
  Float_t  fHistoIMMax ;                  // Maximum value of Invariant Mass histogram range
  Float_t  fHistoIMMin ;                  // Minimum value of Invariant Mass histogram range  
  
  AliNeutralMesonSelection(              const AliNeutralMesonSelection & g) ; // cpy ctor
  AliNeutralMesonSelection & operator = (const AliNeutralMesonSelection & g) ; // cpy assignment
  
  ClassDef(AliNeutralMesonSelection,8)
    
} ;

#endif //ALINEUTRALMESONSELECTION_H



 AliNeutralMesonSelection.h:1
 AliNeutralMesonSelection.h:2
 AliNeutralMesonSelection.h:3
 AliNeutralMesonSelection.h:4
 AliNeutralMesonSelection.h:5
 AliNeutralMesonSelection.h:6
 AliNeutralMesonSelection.h:7
 AliNeutralMesonSelection.h:8
 AliNeutralMesonSelection.h:9
 AliNeutralMesonSelection.h:10
 AliNeutralMesonSelection.h:11
 AliNeutralMesonSelection.h:12
 AliNeutralMesonSelection.h:13
 AliNeutralMesonSelection.h:14
 AliNeutralMesonSelection.h:15
 AliNeutralMesonSelection.h:16
 AliNeutralMesonSelection.h:17
 AliNeutralMesonSelection.h:18
 AliNeutralMesonSelection.h:19
 AliNeutralMesonSelection.h:20
 AliNeutralMesonSelection.h:21
 AliNeutralMesonSelection.h:22
 AliNeutralMesonSelection.h:23
 AliNeutralMesonSelection.h:24
 AliNeutralMesonSelection.h:25
 AliNeutralMesonSelection.h:26
 AliNeutralMesonSelection.h:27
 AliNeutralMesonSelection.h:28
 AliNeutralMesonSelection.h:29
 AliNeutralMesonSelection.h:30
 AliNeutralMesonSelection.h:31
 AliNeutralMesonSelection.h:32
 AliNeutralMesonSelection.h:33
 AliNeutralMesonSelection.h:34
 AliNeutralMesonSelection.h:35
 AliNeutralMesonSelection.h:36
 AliNeutralMesonSelection.h:37
 AliNeutralMesonSelection.h:38
 AliNeutralMesonSelection.h:39
 AliNeutralMesonSelection.h:40
 AliNeutralMesonSelection.h:41
 AliNeutralMesonSelection.h:42
 AliNeutralMesonSelection.h:43
 AliNeutralMesonSelection.h:44
 AliNeutralMesonSelection.h:45
 AliNeutralMesonSelection.h:46
 AliNeutralMesonSelection.h:47
 AliNeutralMesonSelection.h:48
 AliNeutralMesonSelection.h:49
 AliNeutralMesonSelection.h:50
 AliNeutralMesonSelection.h:51
 AliNeutralMesonSelection.h:52
 AliNeutralMesonSelection.h:53
 AliNeutralMesonSelection.h:54
 AliNeutralMesonSelection.h:55
 AliNeutralMesonSelection.h:56
 AliNeutralMesonSelection.h:57
 AliNeutralMesonSelection.h:58
 AliNeutralMesonSelection.h:59
 AliNeutralMesonSelection.h:60
 AliNeutralMesonSelection.h:61
 AliNeutralMesonSelection.h:62
 AliNeutralMesonSelection.h:63
 AliNeutralMesonSelection.h:64
 AliNeutralMesonSelection.h:65
 AliNeutralMesonSelection.h:66
 AliNeutralMesonSelection.h:67
 AliNeutralMesonSelection.h:68
 AliNeutralMesonSelection.h:69
 AliNeutralMesonSelection.h:70
 AliNeutralMesonSelection.h:71
 AliNeutralMesonSelection.h:72
 AliNeutralMesonSelection.h:73
 AliNeutralMesonSelection.h:74
 AliNeutralMesonSelection.h:75
 AliNeutralMesonSelection.h:76
 AliNeutralMesonSelection.h:77
 AliNeutralMesonSelection.h:78
 AliNeutralMesonSelection.h:79
 AliNeutralMesonSelection.h:80
 AliNeutralMesonSelection.h:81
 AliNeutralMesonSelection.h:82
 AliNeutralMesonSelection.h:83
 AliNeutralMesonSelection.h:84
 AliNeutralMesonSelection.h:85
 AliNeutralMesonSelection.h:86
 AliNeutralMesonSelection.h:87
 AliNeutralMesonSelection.h:88
 AliNeutralMesonSelection.h:89
 AliNeutralMesonSelection.h:90
 AliNeutralMesonSelection.h:91
 AliNeutralMesonSelection.h:92
 AliNeutralMesonSelection.h:93
 AliNeutralMesonSelection.h:94
 AliNeutralMesonSelection.h:95
 AliNeutralMesonSelection.h:96
 AliNeutralMesonSelection.h:97
 AliNeutralMesonSelection.h:98
 AliNeutralMesonSelection.h:99
 AliNeutralMesonSelection.h:100
 AliNeutralMesonSelection.h:101
 AliNeutralMesonSelection.h:102
 AliNeutralMesonSelection.h:103
 AliNeutralMesonSelection.h:104
 AliNeutralMesonSelection.h:105
 AliNeutralMesonSelection.h:106
 AliNeutralMesonSelection.h:107
 AliNeutralMesonSelection.h:108
 AliNeutralMesonSelection.h:109
 AliNeutralMesonSelection.h:110
 AliNeutralMesonSelection.h:111
 AliNeutralMesonSelection.h:112
 AliNeutralMesonSelection.h:113
 AliNeutralMesonSelection.h:114
 AliNeutralMesonSelection.h:115
 AliNeutralMesonSelection.h:116
 AliNeutralMesonSelection.h:117
 AliNeutralMesonSelection.h:118
 AliNeutralMesonSelection.h:119
 AliNeutralMesonSelection.h:120
 AliNeutralMesonSelection.h:121
 AliNeutralMesonSelection.h:122
 AliNeutralMesonSelection.h:123
 AliNeutralMesonSelection.h:124
 AliNeutralMesonSelection.h:125
 AliNeutralMesonSelection.h:126
 AliNeutralMesonSelection.h:127
 AliNeutralMesonSelection.h:128
 AliNeutralMesonSelection.h:129
 AliNeutralMesonSelection.h:130
 AliNeutralMesonSelection.h:131
 AliNeutralMesonSelection.h:132
 AliNeutralMesonSelection.h:133
 AliNeutralMesonSelection.h:134
 AliNeutralMesonSelection.h:135
 AliNeutralMesonSelection.h:136
 AliNeutralMesonSelection.h:137
 AliNeutralMesonSelection.h:138
 AliNeutralMesonSelection.h:139
 AliNeutralMesonSelection.h:140
 AliNeutralMesonSelection.h:141
 AliNeutralMesonSelection.h:142
 AliNeutralMesonSelection.h:143
 AliNeutralMesonSelection.h:144
 AliNeutralMesonSelection.h:145
 AliNeutralMesonSelection.h:146
 AliNeutralMesonSelection.h:147
 AliNeutralMesonSelection.h:148
 AliNeutralMesonSelection.h:149
 AliNeutralMesonSelection.h:150
 AliNeutralMesonSelection.h:151
 AliNeutralMesonSelection.h:152
 AliNeutralMesonSelection.h:153
 AliNeutralMesonSelection.h:154
 AliNeutralMesonSelection.h:155
 AliNeutralMesonSelection.h:156
 AliNeutralMesonSelection.h:157
 AliNeutralMesonSelection.h:158
 AliNeutralMesonSelection.h:159
 AliNeutralMesonSelection.h:160
 AliNeutralMesonSelection.h:161
 AliNeutralMesonSelection.h:162
 AliNeutralMesonSelection.h:163
 AliNeutralMesonSelection.h:164
 AliNeutralMesonSelection.h:165
 AliNeutralMesonSelection.h:166
 AliNeutralMesonSelection.h:167
 AliNeutralMesonSelection.h:168
 AliNeutralMesonSelection.h:169
 AliNeutralMesonSelection.h:170
 AliNeutralMesonSelection.h:171
 AliNeutralMesonSelection.h:172
 AliNeutralMesonSelection.h:173
 AliNeutralMesonSelection.h:174
 AliNeutralMesonSelection.h:175
 AliNeutralMesonSelection.h:176
 AliNeutralMesonSelection.h:177
 AliNeutralMesonSelection.h:178
 AliNeutralMesonSelection.h:179
 AliNeutralMesonSelection.h:180
 AliNeutralMesonSelection.h:181
 AliNeutralMesonSelection.h:182
 AliNeutralMesonSelection.h:183
 AliNeutralMesonSelection.h:184
 AliNeutralMesonSelection.h:185
 AliNeutralMesonSelection.h:186
 AliNeutralMesonSelection.h:187
 AliNeutralMesonSelection.h:188
 AliNeutralMesonSelection.h:189
 AliNeutralMesonSelection.h:190
 AliNeutralMesonSelection.h:191
 AliNeutralMesonSelection.h:192
 AliNeutralMesonSelection.h:193
 AliNeutralMesonSelection.h:194
 AliNeutralMesonSelection.h:195
 AliNeutralMesonSelection.h:196
 AliNeutralMesonSelection.h:197
 AliNeutralMesonSelection.h:198
 AliNeutralMesonSelection.h:199
 AliNeutralMesonSelection.h:200
 AliNeutralMesonSelection.h:201
 AliNeutralMesonSelection.h:202
 AliNeutralMesonSelection.h:203
 AliNeutralMesonSelection.h:204
 AliNeutralMesonSelection.h:205
 AliNeutralMesonSelection.h:206
 AliNeutralMesonSelection.h:207
 AliNeutralMesonSelection.h:208
 AliNeutralMesonSelection.h:209