<commit_before>#ifndef ALIFMDANAPARAMETERS_H
#define ALIFMDANAPARAMETERS_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
 * reserved. 
 *
 * Latest changes by <NAME>, NBI, <EMAIL>
 *
 * See cxx source for full Copyright notice                               
 */
//
//The design of this class is based on the AliFMDParameters class. Its purpose
//is to hold parameters for the analysis such as background correction and 
//fit functions.
//
//Author: <NAME>, NBI, <EMAIL>
//
//____________________________________________________________________

#ifndef ROOT_TNamed
# include <TNamed.h>
#endif
#ifndef ROOT_TArrayI
# include <TArrayI.h>
#endif
#ifndef ALIFMDUSHORTMAP_H
# include <AliFMDUShortMap.h>
#endif
#ifndef ALIFMDBOOLMAP_H
# include <AliFMDBoolMap.h>
#endif
#include "AliCDBEntry.h"

#include "TFile.h"
#include "TObjArray.h"
#include "TH2F.h"
#include "TAxis.h"
#include "TH1F.h"
#include "AliFMDAnaCalibBackgroundCorrection.h"
#include "AliFMDAnaCalibEnergyDistribution.h"
#include "AliFMDAnaCalibEventSelectionEfficiency.h"
#include "AliFMDAnaCalibSharingEfficiency.h"
#include <TVector2.h>
#include <TString.h>
//#include "AliPWG0Helper.h"
class AliESDEvent;

/**
 * @ingroup FMD_ana
 */
class AliFMDAnaParameters : public TNamed
{
public:
  /** Enumeration of things to initialize */ 
  enum What { 
    /** Pulser gain */ 
    kBackgroundCorrection         = 0x1, // Background Correction 
    kEnergyDistributions          = 0x2, // Energy Distributions
    kEventSelectionEfficiency     = 0x4, // Event Selection Efficiency
    kSharingEfficiency            = 0x8  // Sharing algorithm efficiency
  };
  
  enum Trigger { kMB1 = 0, kMB2, kSPDFASTOR, kNOCTP };
  
  enum Energy { k900 , k10000, k14000 , k7000, k2400};
  
  enum MagField {k0G, k5G};
  
  enum Species {kPP, kPbPb};

  /** DO NOT USE THIS - ONLY FOR IO */
  AliFMDAnaParameters();
  
  /** Singleton access
      @return  single to */
  static AliFMDAnaParameters* Instance();
  
  void Init(Bool_t forceReInit=kTRUE, UInt_t what=kBackgroundCorrection|kEnergyDistributions|kEventSelectionEfficiency|kSharingEfficiency);
  Float_t GetVtxCutZ();
  Int_t GetNvtxBins();
  Int_t GetNetaBins();
  Float_t GetEtaMin();  
  Float_t GetEtaMax();
  Float_t GetMPV(Int_t det, Char_t ring, Float_t eta);
  Float_t GetSigma(Int_t det, Char_t ring, Float_t eta);
  Float_t Get2MIPWeight(Int_t det, Char_t ring, Float_t eta);
  Float_t Get3MIPWeight(Int_t det, Char_t ring, Float_t eta);
  //static const char* GetBackgroundPath() { return fgkBackgroundCorrection;}
  // static const char* GetEdistPath()      { return fgkEnergyDists;}
  static const char* GetBackgroundID() { return fgkBackgroundID;}
  static const char* GetEdistID()      { return fgkEnergyDistributionID;}
  static const char* GetEventSelectionEffID()      { return fgkEventSelectionEffID;}
  static const char* GetSharingEffID()      { return fgkSharingEffID;}
  TH2F* GetBackgroundCorrection(Int_t det, Char_t ring, Int_t vtxbin);
  TH1F* GetDoubleHitCorrection(Int_t det, Char_t ring);
  
  TH1F* GetSharingEfficiency(Int_t det, Char_t ring, Int_t vtxbin);
  TH1F* GetSharingEfficiencyTrVtx(Int_t det, Char_t ring, Int_t vtxbin);
  Float_t  GetEventSelectionEfficiency(Int_t vtxbin);
  Float_t  GetPhiFromSector(UShort_t det, Char_t ring, UShort_t sec) const;
  Float_t  GetEtaFromStrip(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip, Float_t zvtx) const;
  Float_t  GetStripLength(Char_t ring, UShort_t strip)  ;
  Float_t  GetBaseStripLength(Char_t ring, UShort_t strip)  ;
  Float_t  GetMaxR(Char_t ring) const;
  Float_t  GetMinR(Char_t ring) const;
  void     SetBackgroundPath(const Char_t* bgpath) {fBackgroundPath.Form(bgpath);}
  void     SetEnergyPath(const Char_t* epath) {fEnergyPath.Form(epath);}
  void     SetEventSelectionPath(const Char_t* evpath) {fEventSelectionEffPath.Form(evpath);}
  void     SetSharingEfficiencyPath(const Char_t* sharpath) {fSharingEffPath.Form(sharpath);}
  void     SetProcessPrimary(Bool_t prim=kTRUE) {fProcessPrimary = prim;}
  void     SetProcessHits(Bool_t hits=kTRUE) {fProcessHits = hits;}
  Bool_t   GetProcessPrimary() const {return fProcessPrimary;} 
  Bool_t   GetProcessHits() const {return fProcessHits;}
  Bool_t   GetVertex(AliESDEvent* esd, Double_t* vertexXYZ);
  void     SetTriggerDefinition(Trigger trigger) {fTrigger = trigger;}
  Trigger  GetTriggerDefinition() const {return fTrigger;}
  Bool_t   IsEventTriggered(AliESDEvent* esd) const;
  void     SetEnergy(Energy energy) {fEnergy = energy;}
  void     SetMagField(MagField magfield) {fMagField = magfield;}
  char*    GetPath(const char* species);
  void     SetCollisionSystem(Species collsystem) {fSpecies = collsystem;}
  void     PrintStatus() const;
  void     Print(Option_t* /* option */) const { PrintStatus(); }
  char*    GetDndetaAnalysisName() {return "PWG2forwardDnDeta";}
  void     SetCentralTriggerSelection(Bool_t selection) {fCentralSelection = selection;}
protected:
  
  AliFMDAnaParameters(const AliFMDAnaParameters& o) 
    : TNamed(o),
      fIsInit(o.fIsInit),
      fBackground(o.fBackground),
      fEnergyDistribution(o.fEnergyDistribution),
      fEventSelectionEfficiency(o.fEventSelectionEfficiency),
      fSharingEfficiency(o.fSharingEfficiency),
      fCorner1(o.fCorner1),
      fCorner2(o.fCorner2),
      fEnergyPath(o.fEnergyPath),
      fBackgroundPath(o.fBackgroundPath),
      fEventSelectionEffPath(o.fEventSelectionEffPath),
      fSharingEffPath(o.fSharingEffPath),
      fProcessPrimary(o.fProcessPrimary),
      fProcessHits(o.fProcessHits),
      fTrigger(o.fTrigger),
      fEnergy(o.fEnergy),
      fMagField(o.fMagField),
      fSpecies(o.fSpecies),
      fCentralSelection(o.fCentralSelection)
  {}
  AliFMDAnaParameters& operator=(const AliFMDAnaParameters&) { return *this; }
  virtual ~AliFMDAnaParameters() {}
  
  static AliFMDAnaParameters* fgInstance;   // Static singleton instance
  
  //  AliCDBEntry* GetEntry(const char* path, Bool_t fatal=kTRUE) const ;
  void InitBackground();
  void InitEnergyDists();
  void InitEventSelectionEff();
  void InitSharingEff();
  
  TH1F* GetEnergyDistribution(Int_t det, Char_t ring, Float_t eta);
  TObjArray* GetBackgroundArray();
  
  TAxis* GetRefAxis();
  void SetCorners(Char_t ring) ;
  
  Bool_t fIsInit;                      //Have we been init ?
  //TObjArray*  fBackgroundArray;
  // TObjArray*  fEdistArray;
  AliFMDAnaCalibBackgroundCorrection*         fBackground;   
  AliFMDAnaCalibEnergyDistribution*           fEnergyDistribution;
  AliFMDAnaCalibEventSelectionEfficiency*     fEventSelectionEfficiency;
  AliFMDAnaCalibSharingEfficiency*            fSharingEfficiency;
  //static const char* fgkBackgroundCorrection;
  //static const char* fgkEnergyDists;
  static const char* fgkBackgroundID;
  static const char* fgkEnergyDistributionID ;
  static const char* fgkEventSelectionEffID ;
  static const char* fgkSharingEffID ;
  
  TVector2 fCorner1;                  //First corner of hybrid
  TVector2 fCorner2;                  //Second corner of hybrid
  TString  fEnergyPath;               //Path of energy calib
  TString  fBackgroundPath;           //Path of BG correction
  TString  fEventSelectionEffPath;    //Path of event selection eff
  TString  fSharingEffPath;           //Path of sharing eff
  Bool_t   fProcessPrimary;           //Do we process primary ?
  Bool_t   fProcessHits;              //Do we process hits ?
  Trigger  fTrigger;                  //Which trigger are we using ?
  Energy   fEnergy;                   // CM energy
  MagField fMagField;                 //Magnetic field
  Species  fSpecies;                  //PbPb or pp ?
  Bool_t   fCentralSelection          //if event selection is done centrally
  
  ClassDef(AliFMDAnaParameters,1) // Manager of parameters
};

#endif
//____________________________________________________________________
//
// Local Variables:
//   mode: C++
// End:
//
// EOF
//

<commit_msg>Adapting for real data and central event selection (bug fix)<commit_after>#ifndef ALIFMDANAPARAMETERS_H
#define ALIFMDANAPARAMETERS_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
 * reserved. 
 *
 * Latest changes by <NAME>, NBI, <EMAIL>
 *
 * See cxx source for full Copyright notice                               
 */
//
//The design of this class is based on the AliFMDParameters class. Its purpose
//is to hold parameters for the analysis such as background correction and 
//fit functions.
//
//Author: <NAME>, NBI, <EMAIL>
//
//____________________________________________________________________

#ifndef ROOT_TNamed
# include <TNamed.h>
#endif
#ifndef ROOT_TArrayI
# include <TArrayI.h>
#endif
#ifndef ALIFMDUSHORTMAP_H
# include <AliFMDUShortMap.h>
#endif
#ifndef ALIFMDBOOLMAP_H
# include <AliFMDBoolMap.h>
#endif
#include "AliCDBEntry.h"

#include "TFile.h"
#include "TObjArray.h"
#include "TH2F.h"
#include "TAxis.h"
#include "TH1F.h"
#include "AliFMDAnaCalibBackgroundCorrection.h"
#include "AliFMDAnaCalibEnergyDistribution.h"
#include "AliFMDAnaCalibEventSelectionEfficiency.h"
#include "AliFMDAnaCalibSharingEfficiency.h"
#include <TVector2.h>
#include <TString.h>
//#include "AliPWG0Helper.h"
class AliESDEvent;

/**
 * @ingroup FMD_ana
 */
class AliFMDAnaParameters : public TNamed
{
public:
  /** Enumeration of things to initialize */ 
  enum What { 
    /** Pulser gain */ 
    kBackgroundCorrection         = 0x1, // Background Correction 
    kEnergyDistributions          = 0x2, // Energy Distributions
    kEventSelectionEfficiency     = 0x4, // Event Selection Efficiency
    kSharingEfficiency            = 0x8  // Sharing algorithm efficiency
  };
  
  enum Trigger { kMB1 = 0, kMB2, kSPDFASTOR, kNOCTP };
  
  enum Energy { k900 , k10000, k14000 , k7000, k2400};
  
  enum MagField {k0G, k5G};
  
  enum Species {kPP, kPbPb};

  /** DO NOT USE THIS - ONLY FOR IO */
  AliFMDAnaParameters();
  
  /** Singleton access
      @return  single to */
  static AliFMDAnaParameters* Instance();
  
  void Init(Bool_t forceReInit=kTRUE, UInt_t what=kBackgroundCorrection|kEnergyDistributions|kEventSelectionEfficiency|kSharingEfficiency);
  Float_t GetVtxCutZ();
  Int_t GetNvtxBins();
  Int_t GetNetaBins();
  Float_t GetEtaMin();  
  Float_t GetEtaMax();
  Float_t GetMPV(Int_t det, Char_t ring, Float_t eta);
  Float_t GetSigma(Int_t det, Char_t ring, Float_t eta);
  Float_t Get2MIPWeight(Int_t det, Char_t ring, Float_t eta);
  Float_t Get3MIPWeight(Int_t det, Char_t ring, Float_t eta);
  //static const char* GetBackgroundPath() { return fgkBackgroundCorrection;}
  // static const char* GetEdistPath()      { return fgkEnergyDists;}
  static const char* GetBackgroundID() { return fgkBackgroundID;}
  static const char* GetEdistID()      { return fgkEnergyDistributionID;}
  static const char* GetEventSelectionEffID()      { return fgkEventSelectionEffID;}
  static const char* GetSharingEffID()      { return fgkSharingEffID;}
  TH2F* GetBackgroundCorrection(Int_t det, Char_t ring, Int_t vtxbin);
  TH1F* GetDoubleHitCorrection(Int_t det, Char_t ring);
  
  TH1F* GetSharingEfficiency(Int_t det, Char_t ring, Int_t vtxbin);
  TH1F* GetSharingEfficiencyTrVtx(Int_t det, Char_t ring, Int_t vtxbin);
  Float_t  GetEventSelectionEfficiency(Int_t vtxbin);
  Float_t  GetPhiFromSector(UShort_t det, Char_t ring, UShort_t sec) const;
  Float_t  GetEtaFromStrip(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip, Float_t zvtx) const;
  Float_t  GetStripLength(Char_t ring, UShort_t strip)  ;
  Float_t  GetBaseStripLength(Char_t ring, UShort_t strip)  ;
  Float_t  GetMaxR(Char_t ring) const;
  Float_t  GetMinR(Char_t ring) const;
  void     SetBackgroundPath(const Char_t* bgpath) {fBackgroundPath.Form(bgpath);}
  void     SetEnergyPath(const Char_t* epath) {fEnergyPath.Form(epath);}
  void     SetEventSelectionPath(const Char_t* evpath) {fEventSelectionEffPath.Form(evpath);}
  void     SetSharingEfficiencyPath(const Char_t* sharpath) {fSharingEffPath.Form(sharpath);}
  void     SetProcessPrimary(Bool_t prim=kTRUE) {fProcessPrimary = prim;}
  void     SetProcessHits(Bool_t hits=kTRUE) {fProcessHits = hits;}
  Bool_t   GetProcessPrimary() const {return fProcessPrimary;} 
  Bool_t   GetProcessHits() const {return fProcessHits;}
  Bool_t   GetVertex(AliESDEvent* esd, Double_t* vertexXYZ);
  void     SetTriggerDefinition(Trigger trigger) {fTrigger = trigger;}
  Trigger  GetTriggerDefinition() const {return fTrigger;}
  Bool_t   IsEventTriggered(AliESDEvent* esd) const;
  void     SetEnergy(Energy energy) {fEnergy = energy;}
  void     SetMagField(MagField magfield) {fMagField = magfield;}
  char*    GetPath(const char* species);
  void     SetCollisionSystem(Species collsystem) {fSpecies = collsystem;}
  void     PrintStatus() const;
  void     Print(Option_t* /* option */) const { PrintStatus(); }
  char*    GetDndetaAnalysisName() {return "PWG2forwardDnDeta";}
  void     SetCentralTriggerSelection(Bool_t selection) {fCentralSelection = selection;}
protected:
  
  AliFMDAnaParameters(const AliFMDAnaParameters& o) 
    : TNamed(o),
      fIsInit(o.fIsInit),
      fBackground(o.fBackground),
      fEnergyDistribution(o.fEnergyDistribution),
      fEventSelectionEfficiency(o.fEventSelectionEfficiency),
      fSharingEfficiency(o.fSharingEfficiency),
      fCorner1(o.fCorner1),
      fCorner2(o.fCorner2),
      fEnergyPath(o.fEnergyPath),
      fBackgroundPath(o.fBackgroundPath),
      fEventSelectionEffPath(o.fEventSelectionEffPath),
      fSharingEffPath(o.fSharingEffPath),
      fProcessPrimary(o.fProcessPrimary),
      fProcessHits(o.fProcessHits),
      fTrigger(o.fTrigger),
      fEnergy(o.fEnergy),
      fMagField(o.fMagField),
      fSpecies(o.fSpecies),
      fCentralSelection(o.fCentralSelection)
  {}
  AliFMDAnaParameters& operator=(const AliFMDAnaParameters&) { return *this; }
  virtual ~AliFMDAnaParameters() {}
  
  static AliFMDAnaParameters* fgInstance;   // Static singleton instance
  
  //  AliCDBEntry* GetEntry(const char* path, Bool_t fatal=kTRUE) const ;
  void InitBackground();
  void InitEnergyDists();
  void InitEventSelectionEff();
  void InitSharingEff();
  
  TH1F* GetEnergyDistribution(Int_t det, Char_t ring, Float_t eta);
  TObjArray* GetBackgroundArray();
  
  TAxis* GetRefAxis();
  void SetCorners(Char_t ring) ;
  
  Bool_t fIsInit;                      //Have we been init ?
  //TObjArray*  fBackgroundArray;
  // TObjArray*  fEdistArray;
  AliFMDAnaCalibBackgroundCorrection*         fBackground;   
  AliFMDAnaCalibEnergyDistribution*           fEnergyDistribution;
  AliFMDAnaCalibEventSelectionEfficiency*     fEventSelectionEfficiency;
  AliFMDAnaCalibSharingEfficiency*            fSharingEfficiency;
  //static const char* fgkBackgroundCorrection;
  //static const char* fgkEnergyDists;
  static const char* fgkBackgroundID;
  static const char* fgkEnergyDistributionID ;
  static const char* fgkEventSelectionEffID ;
  static const char* fgkSharingEffID ;
  
  TVector2 fCorner1;                  //First corner of hybrid
  TVector2 fCorner2;                  //Second corner of hybrid
  TString  fEnergyPath;               //Path of energy calib
  TString  fBackgroundPath;           //Path of BG correction
  TString  fEventSelectionEffPath;    //Path of event selection eff
  TString  fSharingEffPath;           //Path of sharing eff
  Bool_t   fProcessPrimary;           //Do we process primary ?
  Bool_t   fProcessHits;              //Do we process hits ?
  Trigger  fTrigger;                  //Which trigger are we using ?
  Energy   fEnergy;                   // CM energy
  MagField fMagField;                 //Magnetic field
  Species  fSpecies;                  //PbPb or pp ?
  Bool_t   fCentralSelection;         //if event selection is done centrally
  
  ClassDef(AliFMDAnaParameters,1) // Manager of parameters
};

#endif
//____________________________________________________________________
//
// Local Variables:
//   mode: C++
// End:
//
// EOF
//


{'fraction_non_alphanumeric': 0.09065848004510996, 'fraction_numerical': 0.007894242215400037, 'mean_word_length': 3.771898355754858, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4141841', 'n_tokens_mistral': 5553, 'n_tokens_neox': 5322, 'n_words': 1235}