Utility.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #ifndef QATOOLS_UTILITY_H
  2. #define QATOOLS_UTILITY_H
  3. #include <iostream>
  4. #include <fstream>
  5. #include <vector>
  6. #include <algorithm>
  7. #include <iterator>
  8. #include <cassert>
  9. #include <sstream>
  10. #include <string>
  11. #include <Rtypes.h>
  12. #include <TString.h>
  13. #include <TChain.h>
  14. #include <TEnv.h>
  15. #include <qaEvent.h>
  16. #include <qaParticle.h>
  17. #include <qaParticleLight.h>
  18. class qaUtility
  19. {
  20. protected:
  21. qaUtility();
  22. virtual ~qaUtility();
  23. static qaUtility *fUtility;
  24. public:
  25. qaUtility(qaUtility &other) = delete;
  26. void operator=(const qaUtility &) = delete;
  27. static qaUtility *GetInstance();
  28. const Double_t error_code = -999.;
  29. const Int_t npid = 10;
  30. const std::vector<Int_t> vpdg = {0, 211, 321, 2212, 2112, 0, -211, -321, -2212, -2112};
  31. const std::vector<Double_t> mpdg = {error_code, 0.13957, 0.493677, 0.938272, 0.88277299, error_code, 0.13957, 0.493677, 0.938272, 0.88277299};
  32. const Int_t maxCentBins = 20;
  33. Int_t Nevents;
  34. Int_t debug;
  35. std::string format;
  36. Int_t Is_minbias;
  37. Int_t Is_refmult;
  38. Int_t Is_v1;
  39. Int_t Is_v2;
  40. Int_t Is_v3;
  41. Int_t Is_v4;
  42. Double_t Cut_minbias_Event_bmin;
  43. Double_t Cut_minbias_Event_bmax;
  44. Double_t Cut_minbias_Particle_ptmin;
  45. Double_t Cut_minbias_Particle_ptmax;
  46. Double_t Cut_minbias_Particle_etamin;
  47. Double_t Cut_minbias_Particle_etamax;
  48. Double_t Cut_minbias_Particle_ymin;
  49. Double_t Cut_minbias_Particle_ymax;
  50. Double_t Cut_refmult_Event_bmin;
  51. Double_t Cut_refmult_Event_bmax;
  52. Double_t Cut_refmult_Particle_ptmin;
  53. Double_t Cut_refmult_Particle_ptmax;
  54. Double_t Cut_refmult_Particle_etamin;
  55. Double_t Cut_refmult_Particle_etamax;
  56. Int_t Cut_refmult_Particle_isCharged;
  57. Bool_t ReadConfig(const TString &configFileName);
  58. TChain *initChain(const TString &inputFileName, const char *chainName);
  59. std::vector<Float_t> ParseVector(std::string _input);
  60. Bool_t initCentrality();
  61. Bool_t Cut_Event_minbias(qaEvent *const &event);
  62. Bool_t Cut_Event_refmult(qaEvent *const &event);
  63. Bool_t Cut_Particle_minbias(qaParticle *const &particle);
  64. Bool_t Cut_Particle_refmult(qaParticle *const &particle);
  65. Double_t GetCharge(Int_t pdg);
  66. Int_t GetPdgId(Int_t pdg);
  67. Int_t GetCentralityBin(Float_t b, std::vector<Float_t> vcent);
  68. Int_t GetCentMultBin(Int_t mult, std::vector<Float_t> vcent);
  69. ClassDef(qaUtility, 0);
  70. }; // class qaUtility
  71. #endif