#include <rarDecay.hh>
Inheritance diagram for rarDecay:
Public Member Functions | |
rarDecay () | |
Trivial ctor. | |
rarDecay (const char *configFile, const char *configSec, const char *configStr, rarDatasets *theDatasets, RooDataSet *theData, const char *name, const char *title) | |
Default ctor. | |
virtual | ~rarDecay () |
virtual RooAbsPdf * | getProtGen () |
Return prototype var generator for toy study. | |
Protected Member Functions | |
void | init () |
Initial function called by ctor. | |
Protected Attributes | |
RooRealVar * | _x |
Default obs (deltaT). | |
RooAbsReal * | _tau |
B0 lifetime | |
rarBasePdf * | _model |
resolution model | |
TString | _decayType |
Decay type. | |
RooAbsReal * | _dm |
mixing frequency | |
RooAbsReal * | _dgamma |
DeltaGamma. | |
RooAbsCategory * | _tag |
tagFlav | |
RooAbsReal * | _w |
avg mistag rate | |
RooAbsReal * | _dw |
diff mistag rate | |
RooAbsReal * | _mu |
diff tagging efficiency | |
TString | _blindStatus |
Blind status. | |
TString | _blindString |
Blind string. | |
RooAbsReal * | _Cb |
C blinded. | |
RooAbsReal * | _Sb |
S blinded. | |
RooAbsReal * | _f0 |
f0 | |
RooAbsReal * | _f1 |
f1 | |
RooAbsReal * | _f2 |
f2 | |
RooAbsReal * | _f3 |
f3 | |
Private Member Functions | |
rarDecay (const rarDecay &) | |
ClassDef (rarDecay, 0) |
Build RooBCPGenDecay / RooBDecay / RooDecay model.
Definition at line 31 of file rarDecay.hh.
rarDecay::rarDecay | ( | ) |
Trivial ctor.
Usually the objects should be created using other ctors.
Definition at line 42 of file rarDecay.cc.
References init().
00043 : rarBasePdf(), 00044 _x(0), _tau(0), _model(0), _decayType("DoubleSided"), 00045 _dm(0), _dgamma(0), _tag(0), _w(0), _dw(0), _mu(0), 00046 _Cb(0), _Sb(0), 00047 _f0(0), _f1(0), _f2(0), _f3(0) 00048 { 00049 init(); 00050 }
rarDecay::rarDecay | ( | const char * | configFile, | |
const char * | configSec, | |||
const char * | configStr, | |||
rarDatasets * | theDatasets, | |||
RooDataSet * | theData, | |||
const char * | name, | |||
const char * | title | |||
) |
Default ctor.
configFile | The config file | |
configSec | The config section | |
configStr | The config string | |
theDatasets | Available datasets | |
theData | Default dataset for this PDF | |
name | The name | |
title | The title |
Definition at line 64 of file rarDecay.cc.
References init().
00068 : rarBasePdf(configFile, configSec, configStr, theDatasets, theData, 00069 name, title), 00070 _x(0), _tau(0), _model(0), _decayType("DoubleSided"), 00071 _dm(0), _dgamma(0), _tag(0), _w(0), _dw(0), _mu(0), 00072 _Cb(0), _Sb(0), 00073 _f0(0), _f1(0), _f2(0), _f3(0) 00074 { 00075 init(); 00076 }
rarDecay::~rarDecay | ( | ) | [virtual] |
rarDecay::rarDecay | ( | const rarDecay & | ) | [private] |
rarDecay::ClassDef | ( | rarDecay | , | |
0 | ||||
) | [private] |
RooAbsPdf * rarDecay::getProtGen | ( | ) | [virtual] |
Return prototype var generator for toy study.
Reimplemented from rarBasePdf.
Definition at line 219 of file rarDecay.cc.
References _model, rarBasePdf::_protGenPdfs, rarBasePdf::_theProtGen, rarBasePdf::getProtGen(), and rarBasePdf::protGenIsDummy().
00220 { 00221 if (_theProtGen) return _theProtGen; 00222 // do we have model generator? 00223 if (_model) { 00224 RooAbsPdf *modelGen=_model->getProtGen(); 00225 if (!_model->protGenIsDummy()) _protGenPdfs.add(*modelGen); 00226 } 00227 // call super class' getProtGen 00228 return rarBasePdf::getProtGen(); 00229 }
void rarDecay::init | ( | ) | [protected, virtual] |
Initial function called by ctor.
init
is called by the ctor. It first creates the parameters by calling createAbsReal, and finally it builds RooArgusBG PDF.
Reimplemented from rarBasePdf.
Definition at line 87 of file rarDecay.cc.
References _blindStatus, _blindString, _Cb, rarConfig::_configSec, _decayType, _dgamma, _dm, _dw, _f0, _f1, _f2, _f3, _model, _mu, rarBasePdf::_obsSet, rarBasePdf::_params, rarBasePdf::_pdfType, _Sb, _tag, _tau, rarBasePdf::_thePdf, _w, _x, rarBasePdf::_xPdfList, rarConfig::addToConfStr(), rarConfig::createAbsReal(), rarConfig::createAbsVar(), rarBasePdf::createPdfs(), rarBasePdf::getPdf(), rarBasePdf::getVarSec(), rarStrParser::nArgs(), rarConfig::readConfStr(), and rarBasePdf::setControlBit().
Referenced by rarDecay().
00088 { 00089 cout<<"init of rarDecay for "<<GetName()<<":"<<endl; 00090 00091 // first get its obs 00092 _x=(RooRealVar*)createAbsReal("x", "observable"); assert(_x); 00093 RooRealVar *x=(RooRealVar *)RooArgList(_obsSet).at(0); assert(x); 00094 // make sure theDep is not derived 00095 if (_x!=x) { 00096 cout <<"No derived dependent allowed in rarDecay"<<endl; 00097 exit(-1); 00098 } 00099 // Config pdf params 00100 _tau=createAbsReal("tau", "#tau", 1.5, 0, 10, "ps"); 00101 if ("BCPGenDecay"==_pdfType||"BDecay"==_pdfType) { 00102 _dm=createAbsReal("dm", "#Delta m", 0.502, 0, 1, "ps^{-1}"); 00103 _dgamma=createAbsReal("dgamma", "#Delta#Gamma", 0, "RooConstVar"); 00104 //_dgamma=createAbsReal("dgamma", "#Delta#Gamma", 0); 00105 _tag=(RooAbsCategory*)createAbsReal("tag", "tag"); 00106 _w=createAbsReal("w", "w", 0.2, 0., 1.); 00107 _dw=createAbsReal("dw", "dw", 0., -2., 2.); 00108 _mu=createAbsReal("mu", "#mu", 0., -2., 2.); 00109 createAbsReal("S", "S_{CP}", .7, -2., 2.); 00110 createAbsReal("C", "C_{CP}", 0., -2., 2.); 00111 // get blind status and blind string 00112 _blindStatus=readConfStr("blindStatus", "blind", getVarSec()); 00113 _blindString=readConfStr("blindString", "notSet", getVarSec()); 00114 if ("notSet"==_blindString) { 00115 cout<<"You must specify blinding string in section \"" 00116 <<getVarSec()<<"\""<<endl; 00117 exit(-1); 00118 } 00119 // let's remove any " 00120 _blindString.ReplaceAll("\"", " "); 00121 // get blinding values 00122 TString bVStr=readConfStr("blindValues", ".2 .2 .2 .2", getVarSec()); 00123 rarStrParser bVStrParser=bVStr; 00124 if (bVStrParser.nArgs()<4) { 00125 cout<<"Please specify 4 blind values"<<endl; 00126 exit(-1); 00127 } 00128 Double_t Cv=atof(bVStrParser[0]); 00129 Double_t Cs=atof(bVStrParser[1]); 00130 Double_t Sv=atof(bVStrParser[2]); 00131 Double_t Ss=atof(bVStrParser[3]); 00132 // create blind state cat 00133 RooCategory *blindCat=(RooCategory*) 00134 createAbsVar(Form("%s %s %s", "blindCat RooCategory", 00135 "\"CP blinding category\"", 00136 "useIdx Unblind 0 Blind 1")); 00137 blindCat->setLabel("Blind"); 00138 if ("unblind"==_blindStatus) blindCat->setLabel("Unblind"); 00139 // put blindCat into ignore list 00140 addToConfStr("Ignored", blindCat->GetName(), getVarSec()); 00141 // create blind variables for C and S 00142 _Cb=(RooAbsReal*)createAbsVar(Form("%s \"%s\" %f %f C blindCat kTRUE", 00143 "Cb RooUnblindPrecision \"C blind\"", 00144 _blindString.Data(), Cv, Cs)); 00145 _Sb=(RooAbsReal*)createAbsVar(Form("%s \"%s\" %f %f S blindCat kTRUE", 00146 "Sb RooUnblindPrecision \"S blind\"", 00147 _blindString.Data(), Sv, Ss)); 00148 if ("BDecay"==_pdfType) { 00149 cout<<" Due to bugs in PDF RooBDecay," 00150 <<" please use RooBCPGenDecay with"<<endl 00151 <<" configStr = BCPGenDecay"<<endl 00152 <<" in config section ["<<_configSec<<"]"<<endl; 00153 exit(-1); 00154 00155 // creat f0, f1, f2, f3 00156 _f0=(RooAbsReal*) 00157 createAbsVar(Form("%s %s %s", "f0 RooFormulaVar", 00158 "\"(1-@0*@2+@3*@0*(1.-2.*@1))\"", "tag w dw mu")); 00159 _f1=(RooAbsReal*)createAbsVar("f1 RooConstVar \"f1\" 0."); 00160 //_f1=createAbsReal("f1", "f1", 0); 00161 _f2=(RooAbsReal*) 00162 createAbsVar(Form("%s %s %s", "f2 RooFormulaVar", 00163 "\"-1.*(@0*(1-2*@1)+@3*(1.-@0*@2))*@4\"", 00164 "tag w dw mu Cb")); 00165 _f3=(RooAbsReal*) 00166 createAbsVar(Form("%s %s %s", "f3 RooFormulaVar", 00167 "\"(@0*(1-2*@1)+@3*(1.-@0*@2))*@4\"", 00168 "tag w dw mu Sb")); 00169 } 00170 } 00171 _params.Print("v"); 00172 00173 // resolution model 00174 _model=createPdfs("model", &_xPdfList); 00175 // let's make sure the default for model is noPdfFit noPdfPlot 00176 _model->setControlBit("noPdfFit", "pdfFit"); 00177 _model->setControlBit("noPdfPlot", "pdfPlot"); 00178 00179 // parse the decay type 00180 RooBCPGenDecay::DecayType bcpGenDecayType=RooBCPGenDecay::DoubleSided; 00181 RooBDecay::DecayType bDecayType=RooBDecay::DoubleSided; 00182 RooDecay::DecayType decayType=RooDecay::DoubleSided; 00183 _decayType=readConfStr("decayType", "DoubleSided", getVarSec()); 00184 if ("SingleSided"==_decayType) { 00185 decayType=RooDecay::SingleSided; 00186 bDecayType=RooBDecay::SingleSided; 00187 bcpGenDecayType=RooBCPGenDecay::SingleSided; 00188 } else if ("DoubleSided"==_decayType) { 00189 decayType=RooDecay::DoubleSided; 00190 bDecayType=RooBDecay::DoubleSided; 00191 bcpGenDecayType=RooBCPGenDecay::DoubleSided; 00192 } else if ("Flipped"==_decayType) { 00193 decayType=RooDecay::Flipped; 00194 bDecayType=RooBDecay::Flipped; 00195 bcpGenDecayType=RooBCPGenDecay::Flipped; 00196 } 00197 00198 // create pdf 00199 if ("BCPGenDecay"==_pdfType) { 00200 _thePdf=new 00201 RooBCPGenDecay(Form("the_%s",GetName()), _pdfType+" "+GetTitle(), 00202 *_x, *_tag, *_tau, *_dm, *_w, *_Cb, *_Sb, *_dw, *_mu, 00203 *((RooResolutionModel*)_model->getPdf()),bcpGenDecayType); 00204 } else if ("BDecay"==_pdfType) { 00205 _thePdf=new RooBDecay(Form("the_%s",GetName()), _pdfType+" "+GetTitle(), 00206 *_x, *_tau, *_dgamma, *_f0, *_f1, *_f2, *_f3, *_dm, 00207 *((RooResolutionModel*)_model->getPdf()),bDecayType); 00208 } else { 00209 _thePdf=new RooDecay(Form("the_%s",GetName()), _pdfType+" "+GetTitle(), 00210 *_x, *_tau, 00211 *((RooResolutionModel*)_model->getPdf()), decayType); 00212 } 00213 }
TString rarDecay::_blindStatus [protected] |
TString rarDecay::_blindString [protected] |
RooAbsReal* rarDecay::_Cb [protected] |
TString rarDecay::_decayType [protected] |
RooAbsReal* rarDecay::_dgamma [protected] |
RooAbsReal* rarDecay::_dm [protected] |
RooAbsReal* rarDecay::_dw [protected] |
RooAbsReal* rarDecay::_f0 [protected] |
RooAbsReal* rarDecay::_f1 [protected] |
RooAbsReal* rarDecay::_f2 [protected] |
RooAbsReal* rarDecay::_f3 [protected] |
rarBasePdf* rarDecay::_model [protected] |
RooAbsReal* rarDecay::_mu [protected] |
RooAbsReal* rarDecay::_Sb [protected] |
RooAbsCategory* rarDecay::_tag [protected] |
RooAbsReal* rarDecay::_tau [protected] |
RooAbsReal* rarDecay::_w [protected] |
RooRealVar* rarDecay::_x [protected] |