Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

LZfluk.h

Go to the documentation of this file.
00001 #ifndef LZFLUK_HH
00002 #define LZFLUK_HH 
00003 /***************************************************************************
00004  *       
00005  *   This function reweights pions and kaons depending on their pT & xF
00006  *
00007  *   Several functional forms are available which were used for:
00008  *   minos-1650 (SKZP and TV from PRL 2006 era), 
00009  *   minos-1945 (Boston 16 parameter fit)
00010  *   minos-2965 & minos-4166 
00011  *
00012  **************************************************************************/ 
00013 #include <map>
00014 #include <vector>
00015 #include <iostream>
00016 #include <fstream>
00017 #include "Rtypes.h"
00018 #include <cmath>
00019 
00020 class TFile;
00021 class TH2F;
00022 class TH2D;
00023 
00024 class Registry;
00025 
00026 class LZfluk {
00027 
00028 public:
00029    
00030    LZfluk(/*const char* dir=""*/);
00031    virtual ~LZfluk();
00032 
00033    void Config(const Registry &reg);
00034 
00035    void Init();
00036    
00038    void SetParameters(std::vector<double> par) {fPar=par; RecalculateWeights();};
00039    const std::vector<double>& GetParameters() {return fPar;};
00040    
00042    double GetWeight(int ptype, double pt, double pz);
00043    double CalcWeight(int ptype, double pt, double pz);
00044    
00045    
00046    double GetMeanPT(int ptype) {return fMeanPT[GetParticleEnum(ptype)];};
00047    double GetReweightedMeanPT(int ptype) {return fWeightedMeanPT[GetParticleEnum(ptype)];};
00048    
00052    double GetPTshift(int ptype, double pz_low=0.,double pz_up=120.);
00053    
00056    double GetNFrac(int ptype, double pz_low=0., double pz_up=120., double pt_low=0., double pt_up=1.);
00057    
00058    TH2F* GetReweightedPTXF(int ptype) {return fWeightedPTXF[GetParticleEnum(ptype)];};
00059    TH2F* GetPTXF(int ptype) {return fPTXF[GetParticleEnum(ptype)];};
00060    TH2D* GetWeightHistogram(int ptype) {return fWeightHist[GetParticleEnum(ptype)];};
00061    
00063    inline void UseParameterization(const char *which){
00064       std::string temp=which;
00065       if (temp=="SKZP") whichParameterization=0;
00066       else whichParameterization=1;
00067    };
00068    
00069 private:
00070    typedef enum EParticleType 
00071    {
00072       kPiPlus  = 8,
00073       kPiMinus = 9,
00074       kKPlus   = 11,
00075       kKMinus  = 12,
00076       kK0L     = 10,
00077       kUnknown = 0
00078    } ParticleType_t;
00079  
00080    std::string GetParticleName(LZfluk::ParticleType_t ptype); 
00081    LZfluk::ParticleType_t GetParticleEnum(int ptype);
00082    void RecalculateWeights();
00083    
00084    int whichParameterization;
00085    
00086    std::vector<double> fPar;
00087    std::vector<ParticleType_t> fPlist;
00088    
00089    std::map<LZfluk::ParticleType_t, TH2F* > fPTXF;
00090    std::map<LZfluk::ParticleType_t, TH2F* > fWeightedPTXF;
00091    std::map<LZfluk::ParticleType_t, TH2D* > fWeightHist;
00092    std::map<LZfluk::ParticleType_t, double > fMeanPT;
00093    std::map<LZfluk::ParticleType_t, double > fN;
00094    std::map<LZfluk::ParticleType_t, double > fNWeighted;
00095    std::map<LZfluk::ParticleType_t, double > fWeightedMeanPT;
00096    std::map<LZfluk::ParticleType_t, int > fNBinsY,fNBinsX;
00097 
00098    
00099 
00100    bool fWghtFromHist;
00101    
00102    ClassDef(LZfluk,0)
00103       };
00104 
00105 #endif

Generated on Mon Feb 15 11:06:53 2010 for loon by  doxygen 1.3.9.1