LauSPlot.cc
Go to the documentation of this file.
127 cerr<<"ERROR in LauSPlot::createFileAndTree : Bad filename supplied, not creating file or tree."<<endl;
132 cerr<<"ERROR in LauSPlot::createFileAndTree : Problem opening file \""<<fileName_<<"\" for updating, can't do anything."<<endl;
178 cerr<<"ERROR in LauSPlot::readInputInfo : List of leaves is smaller than number of branches - this is strange!"<<endl;
189 cerr<<"ERROR in LauSPlot::readInputInfo : Tree has array branches, can't deal with those."<<endl;
210 for ( TwoDMap::const_iterator twodim_iter = twodimPDFs_.begin(); twodim_iter != twodimPDFs_.end(); ++twodim_iter ) {
222 for (LeafMap::const_iterator leaf_iter = leaves_.begin(); leaf_iter != leaves_.end(); ++leaf_iter) {
233 cerr<<"ERROR in LauSPlot::checkLeaves : Could not find expected leaf \""<<expectedName<<"\"."<<endl;
240 for (NumbMap::const_iterator fixd_iter = fixdSpecies_.begin(); fixd_iter != fixdSpecies_.end(); ++fixd_iter) {
250 for (NameSet::const_iterator vars_iter = variableNames_.begin(); vars_iter != variableNames_.end(); ++vars_iter) {
256 for (LeafMap::const_iterator leaf_iter = leaves_.begin(); leaf_iter != leaves_.end(); ++leaf_iter) {
267 cerr<<"ERROR in LauSPlot::checkLeaves : Could not find expected leaf \""<<expectedName<<"\"."<<endl;
273 for (NumbMap::const_iterator free_iter = freeSpecies_.begin(); free_iter != freeSpecies_.end(); ++free_iter) {
283 for (NameSet::const_iterator vars_iter = variableNames_.begin(); vars_iter != variableNames_.end(); ++vars_iter) {
289 for (LeafMap::const_iterator leaf_iter = leaves_.begin(); leaf_iter != leaves_.end(); ++leaf_iter) {
300 cerr<<"ERROR in LauSPlot::checkLeaves : Could not find expected leaf \""<<expectedName<<"\"."<<endl;
310 for (NameSet::const_iterator vars_iter = variableNames_.begin(); vars_iter != variableNames_.end(); ++vars_iter) {
316 for (LeafMap::const_iterator leaf_iter = leaves_.begin(); leaf_iter != leaves_.end(); ++leaf_iter) {
327 cerr<<"ERROR in LauSPlot::checkLeaves : Could not find expected leaf \""<<expectedName<<"\"."<<endl;
335 for (LeafMap::const_iterator leaf_iter = leaves_.begin(); leaf_iter != leaves_.end(); ++leaf_iter) {
346 cerr<<"ERROR in LauSPlot::checkLeaves : Could not find expected leaf \""<<expectedName<<"\"."<<endl;
352 for (LeafMap::const_iterator leaf_iter = leaves_.begin(); leaf_iter != leaves_.end(); ++leaf_iter) {
363 cerr<<"ERROR in LauSPlot::checkLeaves : Could not find expected leaf \""<<expectedName<<"\"."<<endl;
403 cerr<<"ERROR in LauSPlot::defineCNBranches : Already defined branches, not doing it again."<<endl;
407 cerr<<"ERROR in LauSPlot::defineCNBranches : No entries in the cN container, can't define branches."<<endl;
411 cerr<<"ERROR in LauSPlot::defineCNBranches : Invalid pointer to the tree, can't define branches."<<endl;
418 for (std::map<TString,NumbMap>::iterator excl_iter = cN_.begin(); excl_iter != cN_.end(); ++excl_iter) {
441 cerr<<"ERROR in LauSPlot::defineSWeightBranches : Already defined branches, not doing it again."<<endl;
445 cerr<<"ERROR in LauSPlot::defineSWeightBranches : No entries in the sWeights container, can't define branches."<<endl;
449 cerr<<"ERROR in LauSPlot::defineSWeightBranches : Invalid pointer to the tree, can't define branches."<<endl;
453 for (std::map<TString,NumbMap>::iterator excl_iter = sWeightsCurrent_.begin(); excl_iter != sWeightsCurrent_.end(); ++excl_iter) {
523 for (LeafMap::const_iterator leaf_iter = leaves_.begin(); leaf_iter != leaves_.end(); ++leaf_iter) {
534 for ( TwoDMap::const_iterator twodim_iter = twodimPDFs_.begin(); twodim_iter != twodimPDFs_.end(); ++twodim_iter ) {
545 for (LeafMap::const_iterator leaf_iter = leaves_.begin(); leaf_iter != leaves_.end(); ++leaf_iter) {
556 for (NumbMap::const_iterator fixd_iter = fixdSpecies_.begin(); fixd_iter != fixdSpecies_.end(); ++fixd_iter) {
566 for (NameSet::const_iterator vars_iter = variableNames_.begin(); vars_iter != variableNames_.end(); ++vars_iter) {
571 for (LeafMap::const_iterator leaf_iter = leaves_.begin(); leaf_iter != leaves_.end(); ++leaf_iter) {
582 for (NumbMap::const_iterator free_iter = freeSpecies_.begin(); free_iter != freeSpecies_.end(); ++free_iter) {
592 for (NameSet::const_iterator vars_iter = variableNames_.begin(); vars_iter != variableNames_.end(); ++vars_iter) {
597 for (LeafMap::const_iterator leaf_iter = leaves_.begin(); leaf_iter != leaves_.end(); ++leaf_iter) {
609 for (NameSet::const_iterator vars_iter = variableNames_.begin(); vars_iter != variableNames_.end(); ++vars_iter) {
615 for (LeafMap::const_iterator leaf_iter = leaves_.begin(); leaf_iter != leaves_.end(); ++leaf_iter) {
627 for (LeafMap::const_iterator leaf_iter = leaves_.begin(); leaf_iter != leaves_.end(); ++leaf_iter) {
649 cerr<<"ERROR in LauSPlot::runCalculations : The input ntuple has not been successfully read, can't calculate anything."<<endl;
654 cerr<<"ERROR in LauSPlot::runCalculations : Numbers of events in species have not been set."<<endl;
671 cerr<<"ERROR in LauSPlot::runCalculations : Zero events in experiment "<<iExpt_<<", skipping..."<<endl;
684 for (NameSet::const_iterator excl_iter = excludePdf.begin(); excl_iter != excludePdf.end(); ++excl_iter) {
783 for (NumbMap::const_iterator spec_iter = species.begin(); spec_iter != species.end(); ++spec_iter) {
832 for (NumbMap::const_iterator iter_a = freeSpecies_.begin(); iter_a != freeSpecies_.end(); ++iter_a) {
834 for (NumbMap::const_iterator iter_b = freeSpecies_.begin(); iter_b != freeSpecies_.end(); ++iter_b) {
859 for (NumbMap::const_iterator spec_iter = species.begin(); spec_iter != species.end(); ++spec_iter) {
875 for (NumbMap::const_iterator spec_iter = freeSpecies_.begin(); spec_iter != freeSpecies_.end(); ++spec_iter) {
898 for (NumbMap::const_iterator spec_iter = freeSpecies_.begin(); spec_iter != freeSpecies_.end(); ++spec_iter) {
903 for (NumbMap::const_iterator spec_iter = fixdSpecies_.begin(); spec_iter != fixdSpecies_.end(); ++spec_iter) {
914 for (NumbMap::const_iterator spec_iter_i = freeSpecies_.begin(); spec_iter_i != freeSpecies_.end(); ++spec_iter_i) {
917 for (NumbMap::const_iterator spec_iter_j = freeSpecies_.begin(); spec_iter_j != freeSpecies_.end(); ++spec_iter_j) {
931 cerr<<"ERROR in LauSPlot::calcCovMatrix : Calculated inverse covariance matrix is singular, can't invert it."<<endl;
948 for (NumbMap::const_iterator spec_iter = fixdSpecies_.begin(); spec_iter != fixdSpecies_.end(); ++spec_iter) {
962 for ( TwoDMap::const_iterator twodim_iter = twodimPDFs_.begin(); twodim_iter != twodimPDFs_.end(); ++twodim_iter ) {
984 for (NameSet::const_iterator var_iter = variableNames_.begin(); var_iter != variableNames_.end(); ++var_iter) {
997 for (NumbMap::const_iterator spec_iter = freeSpecies_.begin(); spec_iter != freeSpecies_.end(); ++spec_iter) {
1011 for ( TwoDMap::const_iterator twodim_iter = twodimPDFs_.begin(); twodim_iter != twodimPDFs_.end(); ++twodim_iter ) {
1033 for (NameSet::const_iterator var_iter = variableNames_.begin(); var_iter != variableNames_.end(); ++var_iter) {
1052 for ( TwoDMap::const_iterator twodim_iter = twodimPDFs_.begin(); twodim_iter != twodimPDFs_.end(); ++twodim_iter ) {
1074 for (NameSet::const_iterator var_iter = variableNames_.begin(); var_iter != variableNames_.end(); ++var_iter) {
1093 for ( TwoDMap::const_iterator twodim_iter = twodimPDFs_.begin(); twodim_iter != twodimPDFs_.end(); ++twodim_iter ) {
1115 for (NameSet::const_iterator var_iter = variableNames_.begin(); var_iter != variableNames_.end(); ++var_iter) {
1145 for (NumbMap::const_iterator iter_n = freeSpecies_.begin(); iter_n != freeSpecies_.end(); ++iter_n) {
1150 for (NumbMap::const_iterator iter_j = freeSpecies_.begin(); iter_j != freeSpecies_.end(); ++iter_j) {
1172 for (NumbMap::const_iterator free_iter = freeSpecies_.begin(); free_iter != freeSpecies_.end(); ++free_iter) {
1175 for (NumbMap::const_iterator fixd_iter = fixdSpecies_.begin(); fixd_iter != fixdSpecies_.end(); ++fixd_iter) {
1179 for (NumbMap::const_iterator iter_n = freeSpecies_.begin(); iter_n != freeSpecies_.end(); ++iter_n) {
1182 for (NumbMap::const_iterator iter_j = freeSpecies_.begin(); iter_j != freeSpecies_.end(); ++iter_j) {
1210 cerr<<"ERROR in LauSPlot::fillSWeightBranches : Tree not created, cannot fill branches."<<endl;
1213 cerr<<"ERROR in LauSPlot::fillSWeightBranches : No sWeights calculated, can't fill branches."<<endl;
1228 for (std::map<TString,NumbMap>::const_iterator excl_iter = sWeights_[iEvent].begin(); excl_iter != sWeights_[iEvent].end(); ++excl_iter) {
1231 for (NumbMap::const_iterator spec_iter = species.begin(); spec_iter != species.end(); ++spec_iter) {
1280 for (std::vector<LauSPlot::NumbMap>::const_iterator evt_iter = pdfTot.begin(); evt_iter != pdfTot.end(); ++evt_iter) { // loop over events
1285 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:369 Bool_t fixed() const Check whether the parameter is fixed or floated. Definition: LauParameter.hh:228 std::vector< NumbMap > pdfTot_ The per-event values of the total PDF for each species. Definition: LauSPlot.hh:355 void initialiseFitter(const TString &opt) Initialise Minuit, set the verbosity. Definition: LauSPlot.cc:749 void setFitParameters() const Add the species yields as fit parameters and fix them as appropriate. Definition: LauSPlot.cc:775 void runCalculations(const TString &option="q") Method to calculate the sWeights and cN coeffs. Definition: LauSPlot.cc:640 ClassImp(LauAbsCoeffSet) void calcTotPDFValues(const TString &exclName) Calculate the total likelihood for each species by multiply together all the PDFs for that species... Definition: LauSPlot.cc:942 void readInputInfo() Read the leaf structure from the tree and check the status of the read (calls LauSPlot::readInputLeav... Definition: LauSPlot.cc:144 std::vector< std::map< TString, NumbMap > > discPdf_ The per-event values of the PDFs for each species for each disc variable. Definition: LauSPlot.hh:357 TEventList * eventList_ Pointer to an event list, that is used to loop through the experiments. Definition: LauSPlot.hh:307 void printSumOfWeights(const TString &exclName) const Print the sum of sWeights for all species. Definition: LauSPlot.cc:873 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:82 void Yields(Int_t &, Double_t *, Double_t &f, Double_t *x, Int_t iflag) Definition: LauSPlot.cc:1269 void createCNTree() Create (if not already done) the tree for storing the cN coeffs. Definition: LauSPlot.cc:372 TString inputTreeName_ The name of the input tree (containing the per-event llhds) Definition: LauSPlot.hh:292 void readExpt() Reads the values of each PDF likelihood for every event in the experiment. Definition: LauSPlot.cc:508 TwoDMap twodimPDFs_ The names of the species that have 2D PDFs and the names of the variables involved. Definition: LauSPlot.hh:323 std::vector< Double_t > scfFrac_ The per-event values of the SCF fraction. Definition: LauSPlot.hh:359 TString cnTreeName_ The name of the cn tree (containing the cN coefficients) Definition: LauSPlot.hh:294 Bool_t signalSplit() const Check whether the signal is split into Truth Matched and Self Cross Feed. Definition: LauSPlot.hh:145 void writeOutResults() Save the sWeight results as a friend tree to the input tree (in the same file) Definition: LauSPlot.cc:1238 void calcSWeights(const TString &exclName, Double_t *covmat=0) Computes the sWeights from the PDFs and covariance matrix. Definition: LauSPlot.cc:1162 NumbMap origFreeSpecies_ The names and estimated yields of the free species - need to keep the original values. Definition: LauSPlot.hh:319 LeafMap leaves_ Collection to hold pointers to the leaves of the input tree. Definition: LauSPlot.hh:310 TTree * cnTree_ Pointer to the output tree containing the cN coefficients. Definition: LauSPlot.hh:302 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:1226 void openInputFileAndTree() Method to open the file in "update" mode and grab the input tree for reading. Definition: LauSPlot.cc:121 void setExperiment(Int_t iExpt) Set the event list to contain only events from the given experiment. Definition: LauSPlot.cc:473 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:76 File containing declaration of LauSPlot class. TString sweightTreeName_ The name of the sweight tree (containing the sWeights) Definition: LauSPlot.hh:296 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:828 void createSWeightTree() Create (if not already done) the tree for storing the sWeights. Definition: LauSPlot.cc:386 Bool_t readInput() const Check whether the input tree has been successfully read. Definition: LauSPlot.hh:133 void calcCNCoeffs(const TString &exclName, const Double_t *covmat=0) Computes the cN for the extended sPlots from the covariance matrix. Definition: LauSPlot.cc:1136 const std::vector< LauSPlot::NumbMap > & totalPdf() const Access the per-event total PDF values for each species. Definition: LauSPlot.hh:126 std::map< TString, NumbMap > sWeightsCurrent_ The current-event values of the computed sWeights. Definition: LauSPlot.hh:367 Bool_t readInputLeaves() Read the leaf structure from the tree and setup the leaf map. Definition: LauSPlot.cc:160 NumbMap fixdSpecies_ The names and estimated yields of the fixed species. Definition: LauSPlot.hh:317 void retrieveFittedParameters(const TString &opt) Update the yields with the newly fitted values and print them (unless print option is "Q")... Definition: LauSPlot.cc:851 void addFriendTree() Add the sWeightTree as a friend tree of the input tree. Definition: LauSPlot.cc:1260 Bool_t definedSWeightBranches() const Check whether the sWeights branches have been already created. Definition: LauSPlot.hh:169 Bool_t definedCNBranches() const Check whether the cN branches have been already created. Definition: LauSPlot.hh:157 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:365 Bool_t checkLeaves() const Check whether the leaf structure makes sense given the PDFs we are expecting. Definition: LauSPlot.cc:203 std::set< TString > NameSet Type to store names, e.g. of the discriminating/control variables. Definition: LauSPlot.hh:73 Bool_t scfDPSmear() const Check whether the Self Cross Feed is smeared in the DP. Definition: LauSPlot.hh:151 NumbMap origFixdSpecies_ The names and estimated yields of the fixed species - need to keep the original values. Definition: LauSPlot.hh:321 Generated by ![]() |