00001 #ifndef XeTest_h 00002 #define XeTest_h 00003 #include "XeAnalysis.h" 00004 00005 enum EbLKTestParams{FB,X0}; 00006 00007 /** 00008 * Example of ML fit of the parameters of a distribution made of 00009 * an exponential distribution plus a flat background 00010 */ 00011 class ebLKTest : public LikelihoodFromDataSet { 00012 00013 protected: 00014 double bMax; 00015 00016 public: 00017 00018 ~ebLKTest(); 00019 ebLKTest(DataSet* da); 00020 double computeIndividualLog(double *val); 00021 00022 ClassDef(ebLKTest,1) 00023 00024 }; 00025 00026 /** 00027 * Test and Demonstration package 00028 */ 00029 class XeTest : virtual public S1S2Display, virtual public XeStat 00030 , virtual public XeCore { 00031 00032 public : 00033 00034 ~XeTest(); 00035 XeTest(); 00036 00037 00038 /** 00039 * Plot rate for Xenon target, spin independent 00040 * @param mass Wimp mass 00041 * @param sigma wimp-nucleon cross section 00042 * @param A NATURAL, DEPLETED, or nuclear number 00043 */ 00044 void plotSigmaSI(double mass=50.*GeV, double sigma=2.E-45, int A=NATURAL); 00045 00046 /** 00047 * Plots the expected number of events for Xenon100(r) Run 10 00048 * and the theoretical exclusion limit in case of no candidates 00049 * @param runNumber Run number to be mimicked 00050 */ 00051 void plotLimitsSI(int runNumber); 00052 00053 00054 /** 00055 * Plots S1 and Er distributions for SI, various LEff t-values 00056 * @param mass Wimp mass 00057 * @param runNumber Run number to be mimicked 00058 */ 00059 void plotS1SI(double mass=50.*GeV,int runNumber=10); 00060 00061 /** 00062 * Plots S1 and Er distributions for various models of SD 00063 * @param mass Wimp mass 00064 * @param runNumber Run number to be mimicked 00065 */ 00066 void plotS1SD(double mass=50.*GeV,int runNumber=10); 00067 00068 00069 /** 00070 * Plot Energy recoil for various SD parametrizations 00071 * @param mass Wimp mass 00072 * @param sigma wimp-nucleon cross section 00073 */ 00074 void plotSigmaSD(double mass=50.*GeV,double sig=1.E-45*cm2); 00075 00076 /** 00077 * Plot theoretical cross section limits for various SD parametrizations 00078 * @param runNumber Run number to be mimicked 00079 */ 00080 void plotLimitsSD(int runNumber=10) ; 00081 00082 /** 00083 * Thorough comparison of FF and Structure functions for SD parametrizations 00084 */ 00085 void plotFFSD(); 00086 00087 /** 00088 * ML fit of the parameters of a distribution made of 00089 * an exponential distribution plus a flat background 00090 */ 00091 00092 void testLK(); 00093 00094 /** 00095 * shows how the Exclusion class runs on simple Signal+background PL 00096 * @param sMin Lower bound of the interval 00097 * @param sMax Upper bound of the interval 00098 */ 00099 void testExclusionPL(int sMin=0,int sMax=10); 00100 00101 /** 00102 * Compute the coverage of Poisson confidence levels 00103 */ 00104 void studyPoissonCoverage(); 00105 00106 /** 00107 * Print a table of combined PL 00108 */ 00109 void tableCombinedPL(); 00110 00111 /** 00112 * Print a table of combined CLs thru Fisher method 00113 * @param withCls Apply CLs correction? 00114 */ 00115 void tableCombinedCLs(bool withCLs=true); 00116 00117 /** 00118 * Print a table of simple CLs exclusoin 00119 * @param withCls Apply CLs correction? 00120 */ 00121 void tableCLs(bool withCLs=true); 00122 00123 /** 00124 * Compute the CLs limits making poisson a maximum likekihood 00125 * @param withCls Apply CLs correction? 00126 * @param sigToE Conversion from cm2 to number of events 00127 */ 00128 void PLexclusionComputedBackground(bool withCLs=true, double sigToE=1.); 00129 00130 /** 00131 * Demonstrates Yellin's method 00132 * @param s signal 00133 * @param b background 00134 * @param n number of points 00135 */ 00136 void testYellin(int s=5, int b=0, int n=100); 00137 00138 /** 00139 * Plot cut acceptances, for both smeared and unsmeared cuts 00140 */ 00141 void plotAcceptance(); 00142 00143 /** 00144 * Technical method for interactive operation: setup an analysis 00145 * @param mode either PL_ANALYSIS or CUTS_ANALYSIS 00146 * @param forSigmaPositive Do we force sigmaHat to be positive? 00147 * @param doFitSystBkTvalue do we also fit the syst unc. on background? 00148 * @param doFitLeffTValue Do we want to fit LEFF t-value? 00149 * @param withS1Shape consider S1 shape? 00150 */ 00151 00152 void setupTheAnalysis(int mode=PL_ANALYSIS 00153 , bool forSigmaPositive=true 00154 , bool doFitSystBkTvalue=true 00155 , bool doFitLeffTValue=true 00156 , bool withS1Shape=true 00157 ); 00158 00159 /** 00160 * technical method for interactive operation: setup a run 00161 * @param publishedBackground use PRL background instead of computed one 00162 * @param mass Wimp Mass for initial print-out 00163 * @param runNumber Where to take data from 00164 */ 00165 void setupTheRun(bool publishedBackground=true 00166 , double mass=DEFAULT_WIMP_MASS,int runNumber=10); 00167 00168 /** 00169 * Print the result of the setup 00170 * @return ok or not 00171 */ 00172 bool printTheSetup(); 00173 00174 /** 00175 * Show data, S1S2 bands for signal and background 00176 * @param mass Wimp Mass for initial print-out 00177 * @param runNumber Where to take data from 00178 * @param analysisMode PL_ANALYSIS or CUTS_ANALYSIS 00179 * @param displayMode S2_VS_S1, _OVER_S1_VS_S1, or FLATTENED_S2_VS_S1 00180 */ 00181 void showRunData( bool publishedEr=true 00182 , double mass=DEFAULT_WIMP_MASS, int runNumber=10 00183 , int analysisMode=PL_ANALYSIS 00184 , int displayMode=FLATTENED_S2_VS_S1); 00185 00186 /** 00187 * Compute limit of sigma SI for runs 8 and 10 Profile likelihood 00188 * @param s1 with s1 profile likelihood 00189 * @param publishedBkg use PRL background instead of computed one 00190 * @param doFitSystBkTvalue do we also fit the syst unc. on background? 00191 * @param specialMass if >0., print detailed computation for this mass 00192 * @param runNumber Where to take data from 00193 */ 00194 void runAnalysis(bool s1=true, bool publishedBkg=true 00195 ,bool doFitSystBkTvalue=false 00196 ,double specialMass=0.,int runNumber=10); 00197 00198 /** 00199 * Plot log likelihood as a function of number of events 00200 * @param s1 with s1 profile likelihood 00201 * @param publishedBkg use PRL background instead of computed one 00202 * @param doFitSystBkTvalue do we also fit the syst unc. on background? 00203 * @param specialMass if >0., do it for one mass only 00204 * @aram nMasses number of masses to be drawns 00205 * @param runNumber Where to take data from 00206 */ 00207 void plotLogLL(bool s1=true, bool publishedBkg=true 00208 ,bool doFitSystBkTvalue=false 00209 ,double specialMass=0.,int nMasses=0 00210 ,int runNumber=10); 00211 00212 00213 /** 00214 * Compute Sensitivity bands of sigma 00215 * @param s1 with s1 profile likelihood 00216 * @param publishedBkg use PRL background instead of computed one 00217 * @param nSimulations number of runs per mass points 00218 * @param runNumber Where to take data from 00219 */ 00220 void computeSensitivityBands( bool s1=true, bool publishedBkg=true 00221 , int nSimulations=100, int runNumber=10); 00222 00223 /** 00224 * Show how far we are from Wilk's theorem 00225 * @param number of masses to study (default: all of them) 00226 * @param nSimulations number of runs per mass points 00227 * @param s1 with s1 profile likelihood 00228 * @param publishedBkg use PRL background instead of computed one 00229 * @param runNumber Where to take data from 00230 */ 00231 void studyQValuesForBackground( int nm=0, int nSimulations=100000 00232 , bool s1=true, bool publishedBkg=true 00233 , int runNumber=10) ; 00234 00235 Wimp *wimp ; /*!< a WIMP*/ 00236 Target *target ; /*!< a mixture of Xenon isotopes */ 00237 SIInteraction *interSI ; /*!< a Spin Independent interaction*/ 00238 SDInteraction *interSD ; /*!< a Spin Dependent interaction*/ 00239 XeRun *run ; /*!< a xenon run */ 00240 OneDimSimulatedDataSet *simData ; /*!< simulated data set*/ 00241 Exclusion *exclusion ; /*!< A machinery for exclusion finding*/ 00242 PValue *pv ; /*!< pvalue used in many examples*/ 00243 S1S2PL *pl ; /*!< P.L. used in many examples*/ 00244 S1S2Bands *bands ; /*!< a collection of S1/S2 bands*/ 00245 XeSetOfCuts *cuts ; /*!< Set of cuts applied to the data */ 00246 XeGraph *gr ; /*!< An XeGraph used in many opprtunities*/ 00247 XeMultiGraph *mg ; /*!< An XeMultigraph used a lot*/ 00248 00249 ClassDef(XeTest,1) 00250 }; 00251 #endif 00252