当前位置: 首页>>代码示例>>C++>>正文


C++ Table::Get方法代码示例

本文整理汇总了C++中Table::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ Table::Get方法的具体用法?C++ Table::Get怎么用?C++ Table::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Table的用法示例。


在下文中一共展示了Table::Get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

int Table::operator == (Object &tblobj) 
{
	char *a;
	if (strcmp (a=tblobj.Type (), Type ()))						// Type check
		return 0;
	Table *tblptr = (Table *) &tblobj;
	if (tblptr->Nelem () == nelem)								// Count check
	{
	Object *b;
		for (int i = 0; i < nelem; i++)
			if (*(b=tblptr->Get (i)) != *(Get(i)))				// Elementwise check
				return 0;
	}
	else
		return 0;
	return 1;
}
开发者ID:5432935,项目名称:crossbridge,代码行数:17,代码来源:objects.cpp

示例2: main


//.........这里部分代码省略.........

    // ########################################
    // ##       Create histograms and        ##
    // ##  schedule type of plots to produce ##
    // ########################################

    // Schedule plots
    screwdriver.SchedulePlots("1DDataMCComparisonFigure");

    // Config plots

    screwdriver.SetGlobalStringOption("1DStackFigurePerProcess",  "includeSignal",                    "stack");
    screwdriver.SetGlobalFloatOption ("1DStackFigurePerProcess",  "factorSignal",                     1.0    );

    screwdriver.SetGlobalStringOption("Plot", "infoTopRight", "CMS Internal");
    screwdriver.SetGlobalStringOption("Plot", "infoTopLeft",  "#sqrt{s} = 8 TeV, L = 19.5 fb^{-1}");

    screwdriver.SetGlobalBoolOption("Plot", "exportPdf", true);
    screwdriver.SetGlobalBoolOption("Plot", "exportEps", false);
    screwdriver.SetGlobalBoolOption("Plot", "exportPng", false);

    // #########################
    // ##   Set the figures   ##
    // #########################

    // Loop on the signal regions and set the figure values...
    for (unsigned int i = 0 ; i < signalRegionsTagList.size() ; i++)
    {
        // Read input tables
        Table rawYields    = Table(string("./results/latest/prediction/rawYieldTables/")+signalRegionsTagList[i]+".tab");
        Table scaleFactors = Table(string("./results/latest/prediction/scaleFactors/")  +signalRegionsTagList[i]+".tab");
        Table tableMTtailCorrection = Table("./results/latest/MTtailCorrection/SF_MTtail.tab");

        Figure SF_pre           = scaleFactors.Get("value","SF_pre");
        Figure SF_post          = scaleFactors.Get("value","SF_post");
        Figure SF_0btag         = scaleFactors.Get("value","SF_0btag");
        Figure SF_vetopeak      = scaleFactors.Get("value","SF_vetopeak");

        string signalRegionTag_ = signalRegionsTagList[i];
        if (findSubstring(signalRegionTag_,"BDT"))
        {
            size_t pos;
            pos = signalRegionTag_.find("_low");
            if (pos != string::npos) signalRegionTag_ = signalRegionTag_.substr(0,pos);
            pos = signalRegionTag_.find("_medium");
            if (pos != string::npos) signalRegionTag_ = signalRegionTag_.substr(0,pos);
            pos = signalRegionTag_.find("_high");
            if (pos != string::npos) signalRegionTag_ = signalRegionTag_.substr(0,pos);
        }
        Figure SF_MTtail_Wjets = tableMTtailCorrection.Get("SFR_Wjets",signalRegionTag_);
        Figure SF_MTtail_1ltop = tableMTtailCorrection.Get("SFR_1ltop",signalRegionTag_);

        screwdriver.SetFigure("yield", "1ltop",    signalRegionsTagList[i], "signalRegion_MTpeak", rawYields.Get("signalRegion_MTpeak","1ltop"   ) * SF_post);
        screwdriver.SetFigure("yield", "ttbar_2l", signalRegionsTagList[i], "signalRegion_MTpeak", rawYields.Get("signalRegion_MTpeak","ttbar_2l") * SF_pre );
        screwdriver.SetFigure("yield", "W+jets",   signalRegionsTagList[i], "signalRegion_MTpeak", rawYields.Get("signalRegion_MTpeak","W+jets"  ) * SF_post);
        screwdriver.SetFigure("yield", "rare",     signalRegionsTagList[i], "signalRegion_MTpeak", rawYields.Get("signalRegion_MTpeak","rare"    ));
        screwdriver.SetFigure("yield", "data",     signalRegionsTagList[i], "signalRegion_MTpeak", rawYields.Get("signalRegion_MTpeak","data"    ));

        screwdriver.SetFigure("yield", "1ltop",    signalRegionsTagList[i], "signalRegion_MTtail", rawYields.Get("signalRegion_MTtail","1ltop"   ) * SF_post * SF_MTtail_1ltop);
        screwdriver.SetFigure("yield", "ttbar_2l", signalRegionsTagList[i], "signalRegion_MTtail", rawYields.Get("signalRegion_MTtail","ttbar_2l") * SF_pre                   );
        screwdriver.SetFigure("yield", "W+jets",   signalRegionsTagList[i], "signalRegion_MTtail", rawYields.Get("signalRegion_MTtail","W+jets"  ) * SF_post * SF_MTtail_Wjets);
        screwdriver.SetFigure("yield", "rare",     signalRegionsTagList[i], "signalRegion_MTtail", rawYields.Get("signalRegion_MTtail","rare"    ));
        screwdriver.SetFigure("yield", "data",     signalRegionsTagList[i], "signalRegion_MTtail", rawYields.Get("signalRegion_MTtail","data"    ));

        screwdriver.SetFigure("yield", "1ltop",    signalRegionsTagList[i], "0btag_MTpeak",        rawYields.Get("0btag_MTpeak","1ltop"   ) * SF_0btag);
        screwdriver.SetFigure("yield", "ttbar_2l", signalRegionsTagList[i], "0btag_MTpeak",        rawYields.Get("0btag_MTpeak","ttbar_2l"));
开发者ID:oneLeptonStopAt13TeV,项目名称:StopAF,代码行数:67,代码来源:yieldsSummaryProducer.C

示例3: main

int main (int argc, char *argv[])
{

  printBoxedMessage("Starting plot generation");

  // ####################
  // ##   Init tools   ##
  // ####################

     // Create a sonic Screwdriver
      SonicScrewdriver screwdriver;

     // ##########################
     // ##   Create Variables   ##
     // ##########################

     screwdriver.AddVariable("MT",             "M_{T}",                   "GeV",    40,0,400,       &(myEvent.MT),                    "logY");

     // #########################################################
     // ##   Create ProcessClasses (and associated datasets)   ##
     // #########################################################

        screwdriver.AddProcessClass("1ltop", "1l top",                             "background",kRed-7);
            #ifdef USING_TTBAR_POWHEG
                screwdriver.AddDataset("ttbar_powheg",                "1ltop",  0, 0);
            #endif
            #ifdef USING_TTBAR_MADGRAPH
                screwdriver.AddDataset("ttbar_madgraph_1l",             "1ltop",  0, 0);
            #endif
            //screwdriver.AddDataset("ttbar_madgraph_scaledown",    "1ltop",  0, 0);
            //screwdriver.AddDataset("ttbar_madgraph_scaleup",      "1ltop",  0, 0);
            //screwdriver.AddDataset("ttbar_madgraph_matchingdown", "1ltop",  0, 0);
            //screwdriver.AddDataset("ttbar_madgraph_matchingup",   "1ltop",  0, 0);
            //screwdriver.AddDataset("ttbar_madgraph_mass166-5",    "1ltop",  0, 0);
            //screwdriver.AddDataset("ttbar_madgraph_mass178-5",    "1ltop",  0, 0);

            screwdriver.AddDataset("singleTop_st",                  "1ltop",  0, 0);


     screwdriver.AddProcessClass("ttbar_2l", "t#bar{t} #rightarrow l^{+}l^{-}", "background",kCyan-3);
            #ifdef USING_TTBAR_MADGRAPH
                screwdriver.AddDataset("ttbar_madgraph_2l",   "ttbar_2l",  0, 0);
            #endif


     screwdriver.AddProcessClass("W+jets",   "W+jets",                          "background",kOrange-2);
             screwdriver.AddDataset("W+jets",    "W+jets", 0, 0);

     screwdriver.AddProcessClass("rare",   "rare",                              "background",kMagenta-5);
             screwdriver.AddDataset("rare",   "rare", 0, 0);

     screwdriver.AddProcessClass("data",   "data",                              "data",COLORPLOT_BLACK);
            screwdriver.AddDataset("SingleElec",   "data", 0, 0);
            screwdriver.AddDataset("SingleMuon",   "data", 0, 0);
            screwdriver.AddDataset("DoubleElec",   "data", 0, 0);
            screwdriver.AddDataset("DoubleMuon",   "data", 0, 0);
            screwdriver.AddDataset("MuEl",         "data", 0, 0);

     // ##########################
     // ##    Create Regions    ##
     // ##########################

     screwdriver.AddRegion("0btag_noMTCut",         "Preselection;0 b-tag Control Region, no M_{T} cut",    &goesIn0BtagControlRegion          );

     // ##########################
     // ##   Create Channels    ##
     // ##########################

     screwdriver.AddChannel("singleLepton", "e/#mu-channels",            &goesInSingleLeptonChannel);

  // ########################################
  // ##       Create histograms and        ##
  // ##  schedule type of plots to produce ##
  // ########################################

     // Create histograms
     screwdriver.Create1DHistos();

     // Schedule plots
     screwdriver.SchedulePlots("1DDataMCComparison");

     // Config plots

     screwdriver.SetGlobalStringOption("DataMCComparison",  "includeSignal",                    "stack");
     screwdriver.SetGlobalFloatOption ("DataMCComparison",  "factorSignal",                     1.0    );

     screwdriver.SetGlobalStringOption("Plot", "infoTopRight", "CMS Preliminary");
     screwdriver.SetGlobalStringOption("Plot", "infoTopLeft",  "#sqrt{s} = 8 TeV, L = 19.5 fb^{-1}");

     screwdriver.SetGlobalBoolOption("Plot", "exportPdf", true);
     screwdriver.SetGlobalBoolOption("Plot", "exportEps", false);
     screwdriver.SetGlobalBoolOption("Plot", "exportPng", false);

  // ########################################
  // ##       Run over the datasets        ##
  // ########################################

  vector<string> datasetsList;
  screwdriver.GetDatasetList(&datasetsList);

//.........这里部分代码省略.........
开发者ID:ttbarMET-at-IPHC,项目名称:combinedOneLeptonStopAnalysis,代码行数:101,代码来源:fullMTwithSFRinTail.C

示例4: Table

backgroundEstimation::backgroundEstimation(string signalRegionLabel_)
{
    signalRegionLabel = signalRegionLabel_;

    // ########################
    // #  Read raw MC yields  #
    // ########################

    rawYieldTable = Table("rawYieldTables/"+signalRegionLabel+".tab");
    secondLeptonInAcceptanceYieldTable = Table("secondLeptonInAcceptance/"+signalRegionLabel+".tab");

    // ###################################################################
    // #  Initialize the table containing the raw mc and the prediction  #
    // ###################################################################

    vector<string> predictionTableColumns = { "raw_mc", "prediction" };
    predictionTable = Table(predictionTableColumns, processesTagList);

    // Raw MC
    Figure N1ltop_mc  = rawYieldTable.Get("signalRegion_MTtail","1ltop"   );
    Figure N2ltop_mc  = rawYieldTable.Get("signalRegion_MTtail","ttbar_2l");
    Figure Nwjets_mc  = rawYieldTable.Get("signalRegion_MTtail","W+jets"  );
    Figure Nrare_mc   = rawYieldTable.Get("signalRegion_MTtail","rare"    );
    Figure NSumBkg_mc = N1ltop_mc+N2ltop_mc+Nwjets_mc+Nrare_mc;

    predictionTable.Set("raw_mc","1ltop",    N1ltop_mc );
    predictionTable.Set("raw_mc","ttbar_2l", N2ltop_mc );
    predictionTable.Set("raw_mc","W+jets",   Nwjets_mc );
    predictionTable.Set("raw_mc","rare",     Nrare_mc  );
    predictionTable.Set("raw_mc","totalSM",  NSumBkg_mc);

    // ######################################################
    // #  Initialize the table containing the scale factors #
    // ######################################################

    vector<string> dummy = { "value" };
    scaleFactorTable = Table(dummy,scaleFactorsTagList);


    // ####################################
    // #  Read results from other modules #
    // ####################################

    #ifdef USING_CR4_AND_CR5_CHECKS_FROM_LOOSENED_SIGNAL_REGIONS
    	// Read the uncertainty from CR4 CR5 modeling checks
        Table temporaryTable;

        if (findSubstring(signalRegionLabel,"BDT"))
    	    temporaryTable = Table("../checkCR4CR5modeling/results/uncertainties_BDT.tab");
        else
    	    temporaryTable = Table("../checkCR4CR5modeling/results/uncertainties_CnC.tab");

        ttll_CR4CR5ModelingUncertainty = temporaryTable.Get("value",signalRegionLabel).error();
    #else
    	ttll_CR4CR5ModelingUncertainty = PLACEHOLDER_CR4_CR5_MODELING_UNCERTAINTY;
    #endif

    ttll_nJetsModelingUncertainty = DILEPTON_TTBAR_JET_MULTIPLICITY_MODELING_UNCERTAINTY;

    // ##################################################################
    // #  Initialize the table containing the systematic uncertainties  #
    // ##################################################################

    vector<string> uncertainties = { "absolute", "relative" };
    systematicsUncertainties = Table(uncertainties, systematicsTagList);

    // Reset the systematics flags
    ResetSystematics();
}
开发者ID:oneLeptonStopAt13TeV,项目名称:StopAF,代码行数:69,代码来源:backgroundEstimation.C


注:本文中的Table::Get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。