LauSPlot.cc
Go to the documentation of this file.
113 cerr<<"ERROR in LauSPlot::createFileAndTree : Bad filename supplied, not creating file or tree."<<endl;
118 cerr<<"ERROR in LauSPlot::createFileAndTree : Problem opening file \""<<fileName_<<"\" for updating, can't do anything."<<endl;
164 cerr<<"ERROR in LauSPlot::readInputInfo : List of leaves is smaller than number of branches - this is strange!"<<endl;
175 cerr<<"ERROR in LauSPlot::readInputInfo : Tree has array branches, can't deal with those."<<endl;
196 for ( TwoDMap::const_iterator twodim_iter = twodimPDFs_.begin(); twodim_iter != twodimPDFs_.end(); ++twodim_iter ) {
208 for (LeafMap::const_iterator leaf_iter = leaves_.begin(); leaf_iter != leaves_.end(); ++leaf_iter) {
219 cerr<<"ERROR in LauSPlot::checkLeaves : Could not find expected leaf \""<<expectedName<<"\"."<<endl;
226 for (NumbMap::const_iterator fixd_iter = fixdSpecies_.begin(); fixd_iter != fixdSpecies_.end(); ++fixd_iter) {
236 for (NameSet::const_iterator vars_iter = variableNames_.begin(); vars_iter != variableNames_.end(); ++vars_iter) {
242 for (LeafMap::const_iterator leaf_iter = leaves_.begin(); leaf_iter != leaves_.end(); ++leaf_iter) {
253 cerr<<"ERROR in LauSPlot::checkLeaves : Could not find expected leaf \""<<expectedName<<"\"."<<endl;
259 for (NumbMap::const_iterator free_iter = freeSpecies_.begin(); free_iter != freeSpecies_.end(); ++free_iter) {
269 for (NameSet::const_iterator vars_iter = variableNames_.begin(); vars_iter != variableNames_.end(); ++vars_iter) {
275 for (LeafMap::const_iterator leaf_iter = leaves_.begin(); leaf_iter != leaves_.end(); ++leaf_iter) {
286 cerr<<"ERROR in LauSPlot::checkLeaves : Could not find expected leaf \""<<expectedName<<"\"."<<endl;
296 for (NameSet::const_iterator vars_iter = variableNames_.begin(); vars_iter != variableNames_.end(); ++vars_iter) {
302 for (LeafMap::const_iterator leaf_iter = leaves_.begin(); leaf_iter != leaves_.end(); ++leaf_iter) {
313 cerr<<"ERROR in LauSPlot::checkLeaves : Could not find expected leaf \""<<expectedName<<"\"."<<endl;
321 for (LeafMap::const_iterator leaf_iter = leaves_.begin(); leaf_iter != leaves_.end(); ++leaf_iter) {
332 cerr<<"ERROR in LauSPlot::checkLeaves : Could not find expected leaf \""<<expectedName<<"\"."<<endl;
338 for (LeafMap::const_iterator leaf_iter = leaves_.begin(); leaf_iter != leaves_.end(); ++leaf_iter) {
349 cerr<<"ERROR in LauSPlot::checkLeaves : Could not find expected leaf \""<<expectedName<<"\"."<<endl;
389 cerr<<"ERROR in LauSPlot::defineCNBranches : Already defined branches, not doing it again."<<endl;
393 cerr<<"ERROR in LauSPlot::defineCNBranches : No entries in the cN container, can't define branches."<<endl;
397 cerr<<"ERROR in LauSPlot::defineCNBranches : Invalid pointer to the tree, can't define branches."<<endl;
404 for (std::map<TString,NumbMap>::iterator excl_iter = cN_.begin(); excl_iter != cN_.end(); ++excl_iter) {
427 cerr<<"ERROR in LauSPlot::defineSWeightBranches : Already defined branches, not doing it again."<<endl;
431 cerr<<"ERROR in LauSPlot::defineSWeightBranches : No entries in the sWeights container, can't define branches."<<endl;
435 cerr<<"ERROR in LauSPlot::defineSWeightBranches : Invalid pointer to the tree, can't define branches."<<endl;
439 for (std::map<TString,NumbMap>::iterator excl_iter = sWeightsCurrent_.begin(); excl_iter != sWeightsCurrent_.end(); ++excl_iter) {
509 for (LeafMap::const_iterator leaf_iter = leaves_.begin(); leaf_iter != leaves_.end(); ++leaf_iter) {
520 for ( TwoDMap::const_iterator twodim_iter = twodimPDFs_.begin(); twodim_iter != twodimPDFs_.end(); ++twodim_iter ) {
531 for (LeafMap::const_iterator leaf_iter = leaves_.begin(); leaf_iter != leaves_.end(); ++leaf_iter) {
542 for (NumbMap::const_iterator fixd_iter = fixdSpecies_.begin(); fixd_iter != fixdSpecies_.end(); ++fixd_iter) {
552 for (NameSet::const_iterator vars_iter = variableNames_.begin(); vars_iter != variableNames_.end(); ++vars_iter) {
557 for (LeafMap::const_iterator leaf_iter = leaves_.begin(); leaf_iter != leaves_.end(); ++leaf_iter) {
568 for (NumbMap::const_iterator free_iter = freeSpecies_.begin(); free_iter != freeSpecies_.end(); ++free_iter) {
578 for (NameSet::const_iterator vars_iter = variableNames_.begin(); vars_iter != variableNames_.end(); ++vars_iter) {
583 for (LeafMap::const_iterator leaf_iter = leaves_.begin(); leaf_iter != leaves_.end(); ++leaf_iter) {
595 for (NameSet::const_iterator vars_iter = variableNames_.begin(); vars_iter != variableNames_.end(); ++vars_iter) {
601 for (LeafMap::const_iterator leaf_iter = leaves_.begin(); leaf_iter != leaves_.end(); ++leaf_iter) {
613 for (LeafMap::const_iterator leaf_iter = leaves_.begin(); leaf_iter != leaves_.end(); ++leaf_iter) {
635 cerr<<"ERROR in LauSPlot::runCalculations : The input ntuple has not been successfully read, can't calculate anything."<<endl;
640 cerr<<"ERROR in LauSPlot::runCalculations : Numbers of events in species have not been set."<<endl;
657 cerr<<"ERROR in LauSPlot::runCalculations : Zero events in experiment "<<iExpt_<<", skipping..."<<endl;
670 for (NameSet::const_iterator excl_iter = excludePdf.begin(); excl_iter != excludePdf.end(); ++excl_iter) {
769 for (NumbMap::const_iterator spec_iter = species.begin(); spec_iter != species.end(); ++spec_iter) {
818 for (NumbMap::const_iterator iter_a = freeSpecies_.begin(); iter_a != freeSpecies_.end(); ++iter_a) {
820 for (NumbMap::const_iterator iter_b = freeSpecies_.begin(); iter_b != freeSpecies_.end(); ++iter_b) {
845 for (NumbMap::const_iterator spec_iter = species.begin(); spec_iter != species.end(); ++spec_iter) {
861 for (NumbMap::const_iterator spec_iter = freeSpecies_.begin(); spec_iter != freeSpecies_.end(); ++spec_iter) {
884 for (NumbMap::const_iterator spec_iter = freeSpecies_.begin(); spec_iter != freeSpecies_.end(); ++spec_iter) {
889 for (NumbMap::const_iterator spec_iter = fixdSpecies_.begin(); spec_iter != fixdSpecies_.end(); ++spec_iter) {
900 for (NumbMap::const_iterator spec_iter_i = freeSpecies_.begin(); spec_iter_i != freeSpecies_.end(); ++spec_iter_i) {
903 for (NumbMap::const_iterator spec_iter_j = freeSpecies_.begin(); spec_iter_j != freeSpecies_.end(); ++spec_iter_j) {
917 cerr<<"ERROR in LauSPlot::calcCovMatrix : Calculated inverse covariance matrix is singular, can't invert it."<<endl;
934 for (NumbMap::const_iterator spec_iter = fixdSpecies_.begin(); spec_iter != fixdSpecies_.end(); ++spec_iter) {
948 for ( TwoDMap::const_iterator twodim_iter = twodimPDFs_.begin(); twodim_iter != twodimPDFs_.end(); ++twodim_iter ) {
970 for (NameSet::const_iterator var_iter = variableNames_.begin(); var_iter != variableNames_.end(); ++var_iter) {
983 for (NumbMap::const_iterator spec_iter = freeSpecies_.begin(); spec_iter != freeSpecies_.end(); ++spec_iter) {
997 for ( TwoDMap::const_iterator twodim_iter = twodimPDFs_.begin(); twodim_iter != twodimPDFs_.end(); ++twodim_iter ) {
1019 for (NameSet::const_iterator var_iter = variableNames_.begin(); var_iter != variableNames_.end(); ++var_iter) {
1038 for ( TwoDMap::const_iterator twodim_iter = twodimPDFs_.begin(); twodim_iter != twodimPDFs_.end(); ++twodim_iter ) {
1060 for (NameSet::const_iterator var_iter = variableNames_.begin(); var_iter != variableNames_.end(); ++var_iter) {
1079 for ( TwoDMap::const_iterator twodim_iter = twodimPDFs_.begin(); twodim_iter != twodimPDFs_.end(); ++twodim_iter ) {
1101 for (NameSet::const_iterator var_iter = variableNames_.begin(); var_iter != variableNames_.end(); ++var_iter) {
1131 for (NumbMap::const_iterator iter_n = freeSpecies_.begin(); iter_n != freeSpecies_.end(); ++iter_n) {
1136 for (NumbMap::const_iterator iter_j = freeSpecies_.begin(); iter_j != freeSpecies_.end(); ++iter_j) {
1158 for (NumbMap::const_iterator free_iter = freeSpecies_.begin(); free_iter != freeSpecies_.end(); ++free_iter) {
1161 for (NumbMap::const_iterator fixd_iter = fixdSpecies_.begin(); fixd_iter != fixdSpecies_.end(); ++fixd_iter) {
1165 for (NumbMap::const_iterator iter_n = freeSpecies_.begin(); iter_n != freeSpecies_.end(); ++iter_n) {
1168 for (NumbMap::const_iterator iter_j = freeSpecies_.begin(); iter_j != freeSpecies_.end(); ++iter_j) {
1196 cerr<<"ERROR in LauSPlot::fillSWeightBranches : Tree not created, cannot fill branches."<<endl;
1199 cerr<<"ERROR in LauSPlot::fillSWeightBranches : No sWeights calculated, can't fill branches."<<endl;
1214 for (std::map<TString,NumbMap>::const_iterator excl_iter = sWeights_[iEvent].begin(); excl_iter != sWeights_[iEvent].end(); ++excl_iter) {
1217 for (NumbMap::const_iterator spec_iter = species.begin(); spec_iter != species.end(); ++spec_iter) {
1266 for (std::vector<LauSPlot::NumbMap>::const_iterator evt_iter = pdfTot.begin(); evt_iter != pdfTot.end(); ++evt_iter) { // loop over events
1271 for (LauSPlot::NumbMap::const_iterator spec_iter = species.begin(); spec_iter != species.end(); ++spec_iter) { // loop over species
std::map< TString, NumbMap > cN_ The extended sPlot coefficients (for each species and for each combination of excluded vars) ... Definition: LauSPlot.hh:349 Bool_t fixed() const Check whether the parameter is fixed or floated. Definition: LauParameter.hh:193 std::vector< NumbMap > pdfTot_ The per-event values of the total PDF for each species. Definition: LauSPlot.hh:335 void initialiseFitter(const TString &opt) Initialise Minuit, set the verbosity. Definition: LauSPlot.cc:735 void setFitParameters() const Add the species yields as fit parameters and fix them as appropriate. Definition: LauSPlot.cc:761 void runCalculations(const TString &option="q") Method to calculate the sWeights and cN coeffs. Definition: LauSPlot.cc:626 void calcTotPDFValues(const TString &exclName) Calculate the total likelihood for each species by multiply together all the PDFs for that species... Definition: LauSPlot.cc:928 void readInputInfo() Read the leaf structure from the tree and check the status of the read (calls LauSPlot::readInputLeav... Definition: LauSPlot.cc:130 std::vector< std::map< TString, NumbMap > > discPdf_ The per-event values of the PDFs for each species for each disc variable. Definition: LauSPlot.hh:337 TEventList * eventList_ Pointer to an event list, that is used to loop through the experiments. Definition: LauSPlot.hh:287 void printSumOfWeights(const TString &exclName) const Print the sum of sWeights for all species. Definition: LauSPlot.cc:859 std::multimap< TString, std::pair< TString, TString > > TwoDMap Type to associate the name of the species that have 2D PDFs with the names of the two variables invol... Definition: LauSPlot.hh:68 void Yields(Int_t &, Double_t *, Double_t &f, Double_t *x, Int_t iflag) Definition: LauSPlot.cc:1255 void createCNTree() Create (if not already done) the tree for storing the cN coeffs. Definition: LauSPlot.cc:358 TString inputTreeName_ The name of the input tree (containing the per-event llhds) Definition: LauSPlot.hh:272 void readExpt() Reads the values of each PDF likelihood for every event in the experiment. Definition: LauSPlot.cc:494 TwoDMap twodimPDFs_ The names of the species that have 2D PDFs and the names of the variables involved. Definition: LauSPlot.hh:303 std::vector< Double_t > scfFrac_ The per-event values of the SCF fraction. Definition: LauSPlot.hh:339 TString cnTreeName_ The name of the cn tree (containing the cN coefficients) Definition: LauSPlot.hh:274 Bool_t signalSplit() const Check whether the signal is split into Truth Matched and Self Cross Feed. Definition: LauSPlot.hh:131 void writeOutResults() Save the sWeight results as a friend tree to the input tree (in the same file) Definition: LauSPlot.cc:1224 void calcSWeights(const TString &exclName, Double_t *covmat=0) Computes the sWeights from the PDFs and covariance matrix. Definition: LauSPlot.cc:1148 NumbMap origFreeSpecies_ The names and estimated yields of the free species - need to keep the original values. Definition: LauSPlot.hh:299 LeafMap leaves_ Collection to hold pointers to the leaves of the input tree. Definition: LauSPlot.hh:290 TTree * cnTree_ Pointer to the output tree containing the cN coefficients. Definition: LauSPlot.hh:282 void copyEventWeights(Int_t iEvent) Copy the sWeight of a given event into LauSPlot::sWeightsCurrent_, from which they can be stored in t... Definition: LauSPlot.cc:1212 void openInputFileAndTree() Method to open the file in "update" mode and grab the input tree for reading. Definition: LauSPlot.cc:107 void setExperiment(Int_t iExpt) Set the event list to contain only events from the given experiment. Definition: LauSPlot.cc:459 std::map< TString, Double_t > NumbMap Type to associate a category name with a double precision number, e.g. a yield or PDF value for a giv... Definition: LauSPlot.hh:62 File containing declaration of LauSPlot class. TString sweightTreeName_ The name of the sweight tree (containing the sWeights) Definition: LauSPlot.hh:276 void printCovMatrixElements(const Double_t *covmat=0) const Print the supplied covariance matrix or, if pointer is null, the one previously calculated. Definition: LauSPlot.cc:814 void createSWeightTree() Create (if not already done) the tree for storing the sWeights. Definition: LauSPlot.cc:372 Bool_t readInput() const Check whether the input tree has been successfully read. Definition: LauSPlot.hh:119 void calcCNCoeffs(const TString &exclName, const Double_t *covmat=0) Computes the cN for the extended sPlots from the covariance matrix. Definition: LauSPlot.cc:1122 const std::vector< LauSPlot::NumbMap > & totalPdf() const Access the per-event total PDF values for each species. Definition: LauSPlot.hh:112 std::map< TString, NumbMap > sWeightsCurrent_ The current-event values of the computed sWeights. Definition: LauSPlot.hh:347 Bool_t readInputLeaves() Read the leaf structure from the tree and setup the leaf map. Definition: LauSPlot.cc:146 NumbMap fixdSpecies_ The names and estimated yields of the fixed species. Definition: LauSPlot.hh:297 void retrieveFittedParameters(const TString &opt) Update the yields with the newly fitted values and print them (unless print option is "Q")... Definition: LauSPlot.cc:837 void addFriendTree() Add the sWeightTree as a friend tree of the input tree. Definition: LauSPlot.cc:1246 Bool_t definedSWeightBranches() const Check whether the sWeights branches have been already created. Definition: LauSPlot.hh:155 Bool_t definedCNBranches() const Check whether the cN branches have been already created. Definition: LauSPlot.hh:143 std::vector< std::map< TString, NumbMap > > sWeights_ The per-event values of the computed sWeights (for each species and for each combination of excluded ... Definition: LauSPlot.hh:345 Bool_t checkLeaves() const Check whether the leaf structure makes sense given the PDFs we are expecting. Definition: LauSPlot.cc:189 std::set< TString > NameSet Type to store names, e.g. of the discriminating/control variables. Definition: LauSPlot.hh:59 Bool_t scfDPSmear() const Check whether the Self Cross Feed is smeared in the DP. Definition: LauSPlot.hh:137 NumbMap origFixdSpecies_ The names and estimated yields of the fixed species - need to keep the original values. Definition: LauSPlot.hh:301 Generated by 1.8.5 |