本文整理汇总了C++中AnalysisEnvironmentLoader::LoadWeight方法的典型用法代码示例。如果您正苦于以下问题:C++ AnalysisEnvironmentLoader::LoadWeight方法的具体用法?C++ AnalysisEnvironmentLoader::LoadWeight怎么用?C++ AnalysisEnvironmentLoader::LoadWeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnalysisEnvironmentLoader
的用法示例。
在下文中一共展示了AnalysisEnvironmentLoader::LoadWeight方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
float Luminosity = 0;
// 0: MC - 1: Data - 2 Data & MC
int DataType = 0;
int verbosity = -1;
// Analysis variables
int step;
//4-vectors
vector < TLorentzVector > nu1;
vector < TLorentzVector > nu2;
// TLorentzVector lvTop1_aux;
//TLorentzVector lvTop2_aux;
//////////////////////
//////////////////////
// Initialisation
//////////////////////
AnalysisEnvironmentLoader anaEL (xmlFileName);
anaEL.LoadSamples (datasets); // now the list of datasets written in the xml file is known
anaEL.LoadDiLeptonSelection (sel); // now the parameters for the selection are given to the selection
anaEL.LoadGeneralInfo(DataType, Luminosity, verbosity );
float weight_MC;
int nEvents;
int firstEvent;
int initialEvents;
anaEL.LoadAnalysisInfo("Run", "firstEvent", firstEvent);
anaEL.LoadAnalysisInfo("Run", "nEvents", nEvents);
anaEL.LoadAnalysisInfo("Run", "initialEvents", initialEvents);
string channelName;
anaEL.LoadAnalysisInfo("MassAnalysis", "ChannelName", channelName);
anaEL.LoadWeight (sel); // now the parameters for SFBweight are initialized (for b-tag!)
//******************************************
//Load Scale Factors for lepton efficiencies
//******************************************
sel.LoadElScaleFactors();
sel.LoadMuScaleFactors();
sel.InitJESUnc();
bool nonskimmed = false;
TopTree::NTEvent * event = 0;
TFile * TupleFile = new TFile("TupleFileSkimmed_TTbarSemileptonicPowheg.root","RECREATE");
float mttbar_rec, mttbar_gen;
float diffysquare_rec, diffysquare_gen;
float diffabseta_rec, diffabseta_gen;
float weight;
float pt_ttbar, pt_ttbar_gen;
float pz_ttbar, pz_ttbar_gen;
float eta_ttbar_rec, eta_ttbar_gen;
float y_ttbar_rec, y_ttbar_gen;
float diffabsy_rec, diffabsy_gen;
TTree *tree = new TTree("Tuple","Tuple");
tree->Branch("mttbar_rec",&mttbar_rec,"mttbar_rec/F");
tree->Branch("mttbar_gen",&mttbar_gen,"mttbar_gen/F");
tree->Branch("diffysquare_rec",&diffysquare_rec,"diffysquare_rec/F");
tree->Branch("diffysquare_gen",&diffysquare_gen,"diffysquare_gen/F");
tree->Branch("diffabseta_rec",&diffabseta_rec,"diffabseta_rec/F");
tree->Branch("diffabseta_gen",&diffabseta_gen,"diffabseta_gen/F");
tree->Branch("weight",&weight,"weight/F");
tree->Branch("pt_ttbar",&pt_ttbar,"pt_ttbar/F");
示例2: main
int main ()
{
cout<<"#########################"<<endl;
cout<<"Beginning of the program"<<endl;
cout<<"#########################"<<endl;
//////////////////////
//Global variables
//////////////////////
vector < Dataset > datasets;
DiLeptonSelection sel;
float Luminosity = 0;
// 0: MC - 1: Data - 2 Data & MC
int DataType = 0;
int verbosity = -1;
//////////////////////
//////////////////////
// Initialisation
//////////////////////
string xmlFileName = string ("../../config/MyVar.xml");
AnalysisEnvironmentLoader anaEL (xmlFileName);
anaEL.LoadSamples (datasets); // now the list of datasets written in the xml file is known
anaEL.LoadDiLeptonSelection (sel); // now the parameters for the selection are given to the selection
anaEL.LoadGeneralInfo(DataType, Luminosity, verbosity );
anaEL.LoadWeight (sel); // now the parameters for SFBweight are initialized (for b-tag!)
TopTree::NTEvent * event = 0;
//dataset weights
double Dweight[101];
for(int k0=0; k0<5; ++k0) {
for(int k1=0; k1<101; ++k1) {
Dweight[k1] = 0.;
}
}
vector<string> CutName;
vector<string> VecChannelName;
// Here define the studied channel (ee/mumu/emu)
string ChannelName = "mumu"; // "mumu", "ee", "emu"
int ITypeMC = -1;
int ICut = -1;
int IChannel = -1;
if ( ChannelName == "mumu" ) IChannel = 0;
if ( ChannelName == "ee" ) IChannel = 1;
if ( ChannelName == "emu" ) IChannel = 2;
int nbins = 200;
float minx = 0.;
float maxx = 350;
cout<<"The verbosity mode is "<<verbosity <<endl;
cout<<"The luminosity is equal to "<< Luminosity<<endl;
cout<<"The DataType is ";
switch(DataType){
case 0:
cout<<"MC"<<endl;
break;
case 1:
cout<<"Data"<<endl;
break;
case 2:
cout<<"Data & MC"<<endl;
break;
default:
cout<<" unknown"<<endl;
break;
}
//////////////////////
HistoManager MyhistoManager;
MyhistoManager.LoadDatasets(datasets);
// std::vector<TH1F> PATElecPt;
// std::vector<TH1F> PATElecRelIso;
// std::vector<TH1F> PATMuonPt;
// std::vector<TH1F> PATMuonRelIso;
std::vector<TH1F> PFElecPt;
std::vector<TH1F> PFElecNeutralHadIso;
std::vector<TH1F> PFElecChargedHadIso;
std::vector<TH1F> PFElecPhotonIso;
std::vector<TH1F> PFElecTrackIso;
std::vector<TH1F> PFElecRelIso;
std::vector<TH1F> PFElecEcalDriven;
std::vector<TH1F> PFElecGsfEl;
std::vector<TH1F> PFElecD0;
std::vector<TH1F> PFElecId90;
std::vector<TH1F> PFElecConv;
std::vector<TH1F> PFElecRelIsoRhoCorrected;
std::vector<TH1F> PFElecRelIsoNeutralRhoCorrected;
//.........这里部分代码省略.........