• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ rl函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中rl函数的典型用法代码示例。如果您正苦于以下问题:C++ rl函数的具体用法?C++ rl怎么用?C++ rl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: rfile

bool CTransferRules::initFromTxtFile(vfs::tReadableFile* pFile)
{
	if(pFile && pFile->openRead())
	{
		vfs::COpenReadFile rfile(pFile);
		std::string sBuffer;
		vfs::UInt32 line_counter = 0;
		vfs::CReadLine rl(*pFile);
		while(rl.getLine(sBuffer))
		{
			line_counter++;
			// very simple parsing : key = value
			if(!sBuffer.empty())
			{
				// remove leading white spaces
				::size_t iStart = sBuffer.find_first_not_of(" \t",0);
				char first = sBuffer.at(iStart);
				switch(first)
				{
				case '!':
				case ';':
				case '#':
					// comment -> do nothing
					break;
				default:
					::size_t iEnd = sBuffer.find_first_of(" \t", iStart);
					if(iEnd != std::string::npos)
					{
						SRule rule;
						std::string action = sBuffer.substr(iStart, iEnd - iStart);
						if( vfs::StrCmp::Equal(action, "deny") )
						{
							rule.action = CTransferRules::DENY;
						}
						else if( vfs::StrCmp::Equal(action, "accept") )
						{
							rule.action = CTransferRules::ACCEPT;
						}
						else
						{
							std::wstring trybuffer = L"Invalid UTF-8 character in string";
							VFS_IGNOREEXCEPTION( trybuffer = vfs::String(sBuffer).c_wcs(), "" ); /* just make sure we don't break off when string conversion fails */
							std::wstringstream wss;
							wss << L"Unknown action in file \"" << pFile->getPath().c_wcs()
								<< L", line " << line_counter << " : " << vfs::String(sBuffer).c_wcs();
							SGP_THROW(wss.str().c_str());
						}
						try
						{
							rule.pattern = vfs::Path(vfs::trimString(sBuffer, iEnd, sBuffer.length()));
						}
						catch(vfs::Exception& ex)
						{
							std::wstringstream wss;
							wss << L"Could not convert string, invalid utf8 encoding in file \"" << pFile->getPath().c_wcs()
								<< L"\", line "  << line_counter;
							SGP_RETHROW(wss.str().c_str(), ex);
						}
						m_listRules.push_back(rule);
					}
					break;
				}; // end switch
			} // end if (empty)
		} // end while(!eof)
		return true;
	}
	return false;
}
开发者ID:RadekSimkanic,项目名称:JA2-1.13,代码行数:68,代码来源:transfer_rules.cpp


示例2: rl

map<BinaryData, shared_ptr<BtcWallet> > WalletGroup::getWalletMap(void) const
{
   ReadWriteLock::ReadLock rl(lock_);
   return wallets_;
}
开发者ID:R0B3RDV,项目名称:BitcoinArmory,代码行数:5,代码来源:BlockDataViewer.cpp


示例3: selectEleHZZRun1LegacyPaperIsoGivenIDWithZeeGammaPerFile

void selectEleHZZRun1LegacyPaperIsoGivenIDWithZeeGammaPerFile(const string inputfile,          // input file
                                                const string outputfile,         // output directory
                                                const Bool_t  matchGen = kFALSE, // match to generator muons
                                                Int_t dataType = 0,              // del = 0, sel = 1, mc sig = -1, mc bkg = -2
                                                Int_t DataEraInput = 2
  ) {

  //--------------------------------------------------------------------------------------------------------------
  // Settings 
  //============================================================================================================== 
  UInt_t DataEra = kDataEra_NONE;
  if (DataEraInput == 1) DataEra = kDataEra_2011_MC;
  if (DataEraInput == 2) DataEra = kDataEra_2012_MC;
  if (DataEraInput == 11) DataEra = kDataEra_2011_Data;
  if (DataEraInput == 12) DataEra = kDataEra_2012_Data;

  //*****************************************************************************************
  //Setup MVA
  //*****************************************************************************************
  EGammaMvaEleEstimator *eleIDMVA = new EGammaMvaEleEstimator();
  vector<string> weightFiles;

  weightFiles.push_back((string(getenv("CMSSW_BASE"))+string("/src/HiggsAna/HZZ4l/data/ElectronIDMVAWeights/Electrons_BDTG_NonTrigV0_Cat1.weights.xml")).c_str());
  weightFiles.push_back((string(getenv("CMSSW_BASE"))+string("/src/HiggsAna/HZZ4l/data/ElectronIDMVAWeights/Electrons_BDTG_NonTrigV0_Cat2.weights.xml")).c_str());
  weightFiles.push_back((string(getenv("CMSSW_BASE"))+string("/src/HiggsAna/HZZ4l/data/ElectronIDMVAWeights/Electrons_BDTG_NonTrigV0_Cat3.weights.xml")).c_str());
  weightFiles.push_back((string(getenv("CMSSW_BASE"))+string("/src/HiggsAna/HZZ4l/data/ElectronIDMVAWeights/Electrons_BDTG_NonTrigV0_Cat4.weights.xml")).c_str());
  weightFiles.push_back((string(getenv("CMSSW_BASE"))+string("/src/HiggsAna/HZZ4l/data/ElectronIDMVAWeights/Electrons_BDTG_NonTrigV0_Cat5.weights.xml")).c_str());
  weightFiles.push_back((string(getenv("CMSSW_BASE"))+string("/src/HiggsAna/HZZ4l/data/ElectronIDMVAWeights/Electrons_BDTG_NonTrigV0_Cat6.weights.xml")).c_str());
  eleIDMVA->initialize( "BDT", EGammaMvaEleEstimator::kNonTrig,  kTRUE, weightFiles);
  

  // mass region
  Double_t massLo = 40;
  Double_t massHi = 200;

  
  //--------------------------------------------------------------------------------------------------------------
  // Main analysis code 
  //==============================================================================================================  
  
  Double_t nProbes = 0;
  
  //
  // Set up output ntuple
  //
  TFile *outFile = new TFile(outputfile.c_str(),"RECREATE"); 
  TTree *outTree = new TTree("Events","Events");
  EffData data;
  outTree->Branch("Events",&data.mass,"mass/F:pt:eta:phi:weight:q/I:npv/i:npu:pass:runNum:lumiSec:evtNum:rho/F");

  TFile *infile=0;
  TTree *eventTree=0;
  
  // Data structures to store info from TTrees
  higgsana::TEventInfo *info  = new higgsana::TEventInfo();
  TClonesArray *genparticleArr = new TClonesArray("higgsana::TGenParticle");
  TClonesArray *electronArr = new TClonesArray("higgsana::TElectron");
  TClonesArray *photonArr = new TClonesArray("higgsana::TPhoton");
  TClonesArray *pfcandidateArr = new TClonesArray("higgsana::TPFCandidate");
  TClonesArray *muonArr = new TClonesArray("higgsana::TMuon");

  // Read input file and get the TTrees
  cout << "Processing " << inputfile << "..." << endl;
  infile = TFile::Open(inputfile.c_str(),"read");
  assert(infile);



  //********************************************************
  // Good RunLumi Selection
  //********************************************************
  Bool_t hasJSON = kFALSE;
  mithep::RunLumiRangeMap rlrm;
  if (!matchGen) {
    hasJSON = kTRUE;
    rlrm.AddJSONFile("/afs/cern.ch/work/s/sixie/public/HZZ4l/auxiliar/2012/Cert_Full2012_53X_JSON.txt"); 
  }
    
  eventTree = (TTree*)infile->Get("Events"); assert(eventTree);  
  eventTree->SetBranchAddress("Info",     &info);        TBranch *infoBr     = eventTree->GetBranch("Info");
  eventTree->SetBranchAddress("Electron", &electronArr); TBranch *electronBr = eventTree->GetBranch("Electron");
  eventTree->SetBranchAddress("Photon", &photonArr); TBranch *photonBr = eventTree->GetBranch("Photon");
  eventTree->SetBranchAddress("Muon", &muonArr);         TBranch *muonBr = eventTree->GetBranch("Muon");
  eventTree->SetBranchAddress("PFCandidate", &pfcandidateArr);  TBranch *pfcandidateBr = eventTree->GetBranch("PFCandidate");
  cout << "NEvents = " << eventTree->GetEntries() << endl;

  TBranch *genparticleBr;
  if(matchGen) {
    eventTree->SetBranchAddress("GenParticle", &genparticleArr);
    genparticleBr = eventTree->GetBranch("GenParticle");
  }
    
  Double_t weight = 1;

  // loop over events
  for(UInt_t ientry=0; ientry<eventTree->GetEntries(); ientry++) {
    if (ientry % 100000 == 0) cout << "Processed Event " << ientry << endl;
    infoBr->GetEntry(ientry);
    
    // check for certified runs
//.........这里部分代码省略.........
开发者ID:sixie,项目名称:HiggsAna,代码行数:101,代码来源:selectEleHZZRun1LegacyPaperIsoGivenIDWithZeeGammaPerFile.C


示例4: selectWe


//.........这里部分代码省略.........
        outTree->Branch("emIso",      &emIso,      "emIso/F");       // ECAL isolation of tag lepton
        outTree->Branch("hadIso",     &hadIso,     "hadIso/F");      // HCAL isolation of tag lepton
        outTree->Branch("pfChIso",    &pfChIso,    "pfChIso/F");     // PF charged hadron isolation of lepton
        outTree->Branch("pfGamIso",   &pfGamIso,   "pfGamIso/F");    // PF photon isolation of lepton
        outTree->Branch("pfNeuIso",   &pfNeuIso,   "pfNeuIso/F");    // PF neutral hadron isolation of lepton
        outTree->Branch("pfCombIso",  &pfCombIso,  "pfCombIso/F");   // PF combined isolation of electron
        outTree->Branch("sigieie",    &sigieie,    "sigieie/F");     // sigma-ieta-ieta of electron
        outTree->Branch("hovere",     &hovere,     "hovere/F");      // H/E of electron
        outTree->Branch("eoverp",     &eoverp,     "eoverp/F");      // E/p of electron
        outTree->Branch("fbrem",      &fbrem,      "fbrem/F");       // brem fraction of electron
        outTree->Branch("dphi",       &dphi,       "dphi/F");        // GSF track - ECAL dphi of electron
        outTree->Branch("deta",       &deta,       "deta/F");        // GSF track - ECAL deta of electron
        outTree->Branch("ecalE",      &ecalE,      "ecalE/F");       // ECAL energy of electron
        outTree->Branch("d0",         &d0,         "d0/F");          // transverse impact parameter of electron
        outTree->Branch("dz",         &dz,         "dz/F");          // longitudinal impact parameter of electron
        outTree->Branch("isConv",     &isConv,     "isConv/i");      // conversion filter flag of electron
        outTree->Branch("nexphits",   &nexphits,   "nexphits/i");    // number of missing expected inner hits of electron
        outTree->Branch("typeBits",   &typeBits,   "typeBits/i");    // electron type of electron
        outTree->Branch("sc",        "TLorentzVector", &sc);         // supercluster 4-vector

        //
        // loop through files
        //
        const UInt_t nfiles = samp->fnamev.size();
        for(UInt_t ifile=0; ifile<nfiles; ifile++) {

            // Read input file and get the TTrees
            cout << "Processing " << samp->fnamev[ifile] << " [xsec = " << samp->xsecv[ifile] << " pb] ... ";
            cout.flush();
            infile = TFile::Open(samp->fnamev[ifile]);
            assert(infile);

            Bool_t hasJSON = kFALSE;
            baconhep::RunLumiRangeMap rlrm;
            if(samp->jsonv[ifile].CompareTo("NONE")!=0) {
                hasJSON = kTRUE;
                rlrm.addJSONFile(samp->jsonv[ifile].Data());
            }

            eventTree = (TTree*)infile->Get("Events");
            assert(eventTree);
            eventTree->SetBranchAddress("Info",     &info);
            TBranch *infoBr     = eventTree->GetBranch("Info");
            eventTree->SetBranchAddress("Electron", &electronArr);
            TBranch *electronBr = eventTree->GetBranch("Electron");
            eventTree->SetBranchAddress("PV",   &vertexArr);
            TBranch *vertexBr = eventTree->GetBranch("PV");

            Bool_t hasGen = eventTree->GetBranchStatus("GenEvtInfo");
            TBranch *genBr=0, *genPartBr=0;
            if(hasGen) {
                eventTree->SetBranchAddress("GenEvtInfo", &gen);
                genBr = eventTree->GetBranch("GenEvtInfo");
                eventTree->SetBranchAddress("GenParticle",&genPartArr);
                genPartBr = eventTree->GetBranch("GenParticle");
            }

            // Compute MC event weight per 1/fb
            const Double_t xsec = samp->xsecv[ifile];
            Double_t totalWeight=0;

            if (hasGen) {
                TH1D *hall = new TH1D("hall", "", 1,0,1);
                eventTree->Draw("0.5>>hall", "GenEvtInfo->weight");
                totalWeight=hall->Integral();
                delete hall;
开发者ID:kfiekas,项目名称:MitEwk13TeV,代码行数:67,代码来源:selectWe.C


示例5: mpt_get_state

int
mpt_get_state(mpt_adap_t *adap)
{
	return rl(DOORBELL) & MPI_IOC_STATE_MASK;
}
开发者ID:ryanSie,项目名称:Advantech,代码行数:5,代码来源:mpt.c


示例6: HwwDYBkgEstimate


//.........这里部分代码省略.........
  Double_t NEventsIn_BeforeMetCut_ee = 0;
  Double_t NEventsIn_BeforeMetCut_em = 0;
  Double_t NEventsIn_BeforeMetCut_mm = 0;
  Double_t NEventsOut_BeforeMetCut_ee = 0;
  Double_t NEventsOut_BeforeMetCut_em = 0;
  Double_t NEventsOut_BeforeMetCut_mm = 0;
  Double_t NEventsIn_AfterMetCut_ee = 0;
  Double_t NEventsIn_AfterMetCut_em = 0;
  Double_t NEventsIn_AfterMetCut_mm = 0;
  Double_t NEventsOut_AfterMetCut_ee = 0;
  Double_t NEventsOut_AfterMetCut_em = 0;
  Double_t NEventsOut_AfterMetCut_mm = 0;


  //--------------------------------------------------------------------------------------------------------------
  // Main analysis code 
  //==============================================================================================================  
  
  //
  // Access samples and fill histograms
  TFile *inputFile=0;
  TTree *eventTree=0;  
   
  // Data structures to store info from TTrees
  mithep::TEventInfo *info    = new mithep::TEventInfo();
  TClonesArray *electronArr = new TClonesArray("mithep::TElectron");
  TClonesArray *muonArr = new TClonesArray("mithep::TMuon");
  TClonesArray *jetArr = new TClonesArray("mithep::TJet");
  
  //********************************************************
  // Good RunLumi Selection
  //********************************************************
  Bool_t hasJSON = kTRUE;
  mithep::RunLumiRangeMap rlrm;
//   rlrm.AddJSONFile("Cert_TopOct22_Merged_135821-148058_allPVT.txt"); 
   rlrm.AddJSONFile("Cert_136033-149442_7TeV_Dec22ReReco_Collisions10_JSON_v3.txt"); 
   hasJSON = kFALSE;

  //********************************************************
  // Get Tree
  //********************************************************
  eventTree = getTreeFromFile(inputFilename.c_str(),"Events"); 
  TBranch *infoBr;
  TBranch *electronBr;
  TBranch *muonBr;
  TBranch *jetBr;


  //*****************************************************************************************
  //Loop over muon Data Tree
  //*****************************************************************************************
  // Set branch address to structures that will store the info  
  eventTree->SetBranchAddress("Info",       &info);      infoBr       = eventTree->GetBranch("Info");
  eventTree->SetBranchAddress("Electron", &electronArr); electronBr = eventTree->GetBranch("Electron");
  eventTree->SetBranchAddress("Muon", &muonArr);         muonBr = eventTree->GetBranch("Muon");
  eventTree->SetBranchAddress("PFJet", &jetArr);         jetBr = eventTree->GetBranch("PFJet");
  
  for(UInt_t ientry=0; ientry<eventTree->GetEntries(); ientry++) {       	
    infoBr->GetEntry(ientry);
    if (ientry % 100000 == 0) cout << "Event " << ientry << endl;
		
    mithep::RunLumiRangeMap::RunLumiPairType rl(info->runNum, info->lumiSec);      
    if(hasJSON && !rlrm.HasRunLumi(rl)) continue;  // not certified run? Skip to next event...
     
    //for the skimmed input, I already required the HLT bits.
    //    if (!passHLT(info->triggerBits, info->runNum, kTRUE)) continue;
开发者ID:sixie,项目名称:EWKAna,代码行数:67,代码来源:HwwDYBkgEstimate.C


示例7: selectZmm


//.........这里部分代码省略.........
    outTree->Branch("muNchi21",    &muNchi21,    "muNchi21/F");      // muon fit normalized chi^2 of tag lepton
    outTree->Branch("muNchi22",    &muNchi22,    "muNchi22/F");      // muon fit normalized chi^2 of probe lepton
    outTree->Branch("nPixHits1",   &nPixHits1,	 "nPixHits1/i");     // number of pixel hits of tag muon
    outTree->Branch("nPixHits2",   &nPixHits2,	 "nPixHits2/i");     // number of pixel hits of probe muon
    outTree->Branch("nTkLayers1",  &nTkLayers1,  "nTkLayers1/i");    // number of tracker layers of tag muon
    outTree->Branch("nTkLayers2",  &nTkLayers2,  "nTkLayers2/i");    // number of tracker layers of probe muon
    outTree->Branch("nMatch1",     &nMatch1,	 "nMatch1/i");       // number of matched segments of tag muon
    outTree->Branch("nMatch2",     &nMatch2,	 "nMatch2/i");       // number of matched segments of probe muon 
    outTree->Branch("nValidHits1", &nValidHits1, "nValidHits1/i");   // number of valid muon hits of tag muon
    outTree->Branch("nValidHits2", &nValidHits2, "nValidHits2/i");   // number of valid muon hits of probe muon
    outTree->Branch("typeBits1",   &typeBits1,   "typeBits1/i");     // muon type of tag muon
    outTree->Branch("typeBits2",   &typeBits2,   "typeBits2/i");     // muon type of probe muon
    outTree->Branch("sta1",        "TLorentzVector", &sta1);         // tag standalone muon 4-vector
    outTree->Branch("sta2",        "TLorentzVector", &sta2);         // probe standalone muon 4-vector
    
    //
    // loop through files
    //
    const UInt_t nfiles = samp->fnamev.size();
    for(UInt_t ifile=0; ifile<nfiles; ifile++) {  
      
      // Read input file and get the TTrees
      cout << "Processing " << samp->fnamev[ifile] << " [xsec = " << samp->xsecv[ifile] << " pb] ... "; cout.flush();
      infile = TFile::Open(samp->fnamev[ifile]); 
      assert(infile);
      if (samp->fnamev[ifile] == "/dev/null") 
	      {
	     	cout <<"-> Ignoring null input "<<endl; 
		continue;
	      }


      Bool_t hasJSON = kFALSE;
      baconhep::RunLumiRangeMap rlrm;
      if(samp->jsonv[ifile].CompareTo("NONE")!=0) { 
        hasJSON = kTRUE;
	rlrm.addJSONFile(samp->jsonv[ifile].Data()); 
      }
  
      eventTree = (TTree*)infile->Get("Events"); assert(eventTree);  
      eventTree->SetBranchAddress("Info", &info);      TBranch *infoBr = eventTree->GetBranch("Info");
      eventTree->SetBranchAddress("Muon", &muonArr);   TBranch *muonBr = eventTree->GetBranch("Muon");
      eventTree->SetBranchAddress("PV",   &vertexArr); TBranch *vertexBr = eventTree->GetBranch("PV");
      Bool_t hasGen = eventTree->GetBranchStatus("GenEvtInfo");
      TBranch *genBr=0, *genPartBr=0;
      if(hasGen) {
        eventTree->SetBranchAddress("GenEvtInfo", &gen); genBr = eventTree->GetBranch("GenEvtInfo");
	eventTree->SetBranchAddress("GenParticle",&genPartArr); genPartBr = eventTree->GetBranch("GenParticle");
      }

      // Compute MC event weight per 1/fb
      const Double_t xsec = samp->xsecv[ifile];
      Double_t totalWeight=0;
      Double_t totalWeightUp=0;
      Double_t totalWeightDown=0;
      Double_t puWeight=0;
      Double_t puWeightUp=0;
      Double_t puWeightDown=0;

      if (hasGen) {
	for(UInt_t ientry=0; ientry<eventTree->GetEntries(); ientry++) {
	  infoBr->GetEntry(ientry);
	  genBr->GetEntry(ientry);
	  puWeight = doPU ? h_rw->GetBinContent(h_rw->FindBin(info->nPUmean)) : 1.;
	  puWeightUp = doPU ? h_rw_up->GetBinContent(h_rw_up->FindBin(info->nPUmean)) : 1.;
	  puWeightDown = doPU ? h_rw_down->GetBinContent(h_rw_down->FindBin(info->nPUmean)) : 1.;
开发者ID:MiT-HEP,项目名称:MitEwk13TeV,代码行数:67,代码来源:selectZmm.C


示例8: MakeZmumuGammaEventNtuples

void MakeZmumuGammaEventNtuples(const string inputfile,    // input file
		const string outputfile,   // output file
		const Bool_t  matchGen = kFALSE, // match to generator
		const string PUReweightFile = "",
		Int_t PDType = 0,
		Int_t DataEraInput = 2
		) {

  //--------------------------------------------------------------------------------------------------------------
  // Settings 
  //============================================================================================================== 
  UInt_t DataEra = kDataEra_NONE;
  if (DataEraInput == 1) DataEra = kDataEra_2011_MC;
  if (DataEraInput == 2) DataEra = kDataEra_2012_MC;
  if (DataEraInput == 11) DataEra = kDataEra_2011_Data;
  if (DataEraInput == 12) DataEra = kDataEra_2012_Data;


  double eventWeight = 1;
//53X MC
//   if (PDType == -1) eventWeight = 10000 * 1177.6*3 / 30391580.0; //mll50
//   if (PDType == -2) eventWeight = 10000 * 3969.61*3.0*0.0498327*1.45 / 1700850.0 ; //mll1050
//52X MC
  if (PDType == -1) eventWeight = 10000 * 1177.6*3 / 26821030.0; //mll50
  if (PDType == -2) eventWeight = 10000 * 3969.61*3.0*0.0498327*1.45 / 6046518.0 ; //mll1050

  //********************************************************
  // Pileup Reweighting
  //********************************************************
  TFile *fPUFile = 0;
  if (PUReweightFile != "") {
    fPUFile = TFile::Open(PUReweightFile.c_str());
  }
  TH1D *fhDPU = 0;
  if (fPUFile) fhDPU = (TH1D*)(fPUFile->Get("puWeights"));
  if(fhDPU) fhDPU->SetDirectory(0);
  if (fPUFile) delete fPUFile;


  //********************************************************
  // Good RunLumi Selection
  //********************************************************
  Bool_t applyGoodLumi = kTRUE;
  if (matchGen) applyGoodLumi = kFALSE;
  mithep::RunLumiRangeMap rlrm;
  rlrm.AddJSONFile("/afs/cern.ch/work/s/sixie/public/HZGamma/auxiliar/Cert_190456-196531_8TeV_29Jun2012ReReco_Collisions12_JSON.txt"); 
  rlrm.AddJSONFile("/afs/cern.ch/work/s/sixie/public/HZGamma/auxiliar/Cert_190782-190949_8TeV_29Jun2012ReReco-recover_Collisions12_JSON.txt");
  rlrm.AddJSONFile("/afs/cern.ch/work/s/sixie/public/HZGamma/auxiliar/Cert_Full2012_53X_JSON.txt");


  //********************************************************
  // mass region
  //********************************************************
//   Double_t massLo = 40;
//   Double_t massHi = 200;

  //--------------------------------------------------------------------------------------------------------------
  // Main analysis code 
  //==============================================================================================================  

  Double_t nEvents = 0;

  //*****************************************************************************************
  // Set up output ntuple
  //*****************************************************************************************
  TFile *outFile = new TFile(outputfile.c_str(),"RECREATE"); 

  citana::ZmumuGammaEventTree *zmumuGammaEventTree = new citana::ZmumuGammaEventTree;
  zmumuGammaEventTree->CreateTree();
  //   zeeEventTree->tree_->SetAutoFlush(0);


  //*****************************************************************************************
  // Read Input File
  //*****************************************************************************************
  TFile *infile=0;
  TTree *eventTree=0;

  // Data structures to store info from TTrees
  higgsana::TEventInfo *info  = new higgsana::TEventInfo();
  higgsana::TGenInfo *gen     = new higgsana::TGenInfo();
  TClonesArray *electronArr = new TClonesArray("higgsana::TElectron");
  TClonesArray *pfcandidateArr = new TClonesArray("higgsana::TPFCandidate");
  TClonesArray *genparticleArr = new TClonesArray("higgsana::TGenParticle");
  TClonesArray *muonArr = new TClonesArray("higgsana::TMuon");
  TClonesArray *photonArr = new TClonesArray("higgsana::TPhoton");

  // Read input file and get the TTrees
  cout << "Processing " << inputfile << "..." << endl;
  infile = TFile::Open(inputfile.c_str(),"read");
  assert(infile);

  eventTree = (TTree*)infile->Get("Events"); assert(eventTree);  
  eventTree->SetBranchAddress("Info",     &info);        TBranch *infoBr     = eventTree->GetBranch("Info");
  eventTree->SetBranchAddress("Electron", &electronArr); TBranch *electronBr = eventTree->GetBranch("Electron");
  eventTree->SetBranchAddress("Muon", &muonArr);         TBranch *muonBr = eventTree->GetBranch("Muon");
  eventTree->SetBranchAddress("Photon", &photonArr);     TBranch *photonBr = eventTree->GetBranch("Photon");
  eventTree->SetBranchAddress("PFCandidate", &pfcandidateArr);  TBranch *pfcandidateBr = eventTree->GetBranch("PFCandidate");
  cout << "NEvents = " << eventTree->GetEntries() << endl;

//.........这里部分代码省略.........
开发者ID:sixie,项目名称:HiggsAna,代码行数:101,代码来源:MakeZmumuGammaEventNtuples.C


示例9: rl

qint64 QUsbHid::bytesToWrite() const
{
    QReadLocker rl(bytesToWriteLock);
    return _bytesToWrite;
}
开发者ID:motion55,项目名称:etootle-flight,代码行数:5,代码来源:qusbhid_unix.cpp


示例10: selectZee


//.........这里部分代码省略.........
    outTree->Branch("fbrem1",     &fbrem1,     "fbrem1/F");      // brem fraction of tag
    outTree->Branch("fbrem2",     &fbrem2,     "fbrem2/F");      // brem fraction of probe
    outTree->Branch("dphi1",      &dphi1,      "dphi1/F");       // GSF track - ECAL dphi of tag
    outTree->Branch("dphi2",      &dphi2,      "dphi2/F");       // GSF track - ECAL dphi of probe 	
    outTree->Branch("deta1",      &deta1,      "deta1/F");       // GSF track - ECAL deta of tag
    outTree->Branch("deta2",      &deta2,      "deta2/F");       // GSF track - ECAL deta of probe
    outTree->Branch("ecalE1",     &ecalE1,     "ecalE1/F");      // ECAL energy of tag
    outTree->Branch("ecalE2",     &ecalE2,     "ecalE2/F");      // ECAL energy of probe
    outTree->Branch("d01",        &d01,        "d01/F");	 // transverse impact parameter of tag
    outTree->Branch("d02",        &d02,        "d02/F");	 // transverse impact parameter of probe	  
    outTree->Branch("dz1",        &dz1,        "dz1/F");	 // longitudinal impact parameter of tag
    outTree->Branch("dz2",        &dz2,        "dz2/F");	 // longitudinal impact parameter of probe
    outTree->Branch("isConv1",    &isConv1,    "isConv1/i");     // conversion filter flag of tag lepton
    outTree->Branch("isConv2",    &isConv2,    "isConv2/i");     // conversion filter flag of probe lepton
    outTree->Branch("nexphits1",  &nexphits1,  "nexphits1/i");   // number of missing expected inner hits of tag lepton
    outTree->Branch("nexphits2",  &nexphits2,  "nexphits2/i");   // number of missing expected inner hits of probe lepton
    outTree->Branch("typeBits1",  &typeBits1,  "typeBits1/i");   // electron type of tag lepton
    outTree->Branch("typeBits2",  &typeBits2,  "typeBits2/i");   // electron type of probe lepton
    outTree->Branch("sc1",       "TLorentzVector",  &sc1);       // tag supercluster 4-vector
    outTree->Branch("sc2",       "TLorentzVector",  &sc2);       // probe supercluster 4-vector

    //
    // loop through files
    //
    const UInt_t nfiles = samp->fnamev.size();
    for(UInt_t ifile=0; ifile<nfiles; ifile++) {  

      // Read input file and get the TTrees
      cout << "Processing " << samp->fnamev[ifile] << " [xsec = " << samp->xsecv[ifile] << " pb] ... " << endl; cout.flush();
      infile = TFile::Open(samp->fnamev[ifile]); 
      assert(infile);

      Bool_t hasJSON = kFALSE;
      baconhep::RunLumiRangeMap rlrm;
      if(samp->jsonv[ifile].CompareTo("NONE")!=0) { 
	hasJSON = kTRUE;
	rlrm.addJSONFile(samp->jsonv[ifile].Data()); 
      }
  
      eventTree = (TTree*)infile->Get("Events");
      assert(eventTree);  
      eventTree->SetBranchAddress("Info",     &info);        TBranch *infoBr     = eventTree->GetBranch("Info");
      eventTree->SetBranchAddress("Electron", &electronArr); TBranch *electronBr = eventTree->GetBranch("Electron");
      eventTree->SetBranchAddress("Photon",   &scArr);       TBranch *scBr       = eventTree->GetBranch("Photon");
      eventTree->SetBranchAddress("PV",   &vertexArr);       TBranch *vertexBr = eventTree->GetBranch("PV");
      Bool_t hasGen = eventTree->GetBranchStatus("GenEvtInfo");
      TBranch *genBr=0, *genPartBr=0;
      if(hasGen) {
        eventTree->SetBranchAddress("GenEvtInfo", &gen); genBr = eventTree->GetBranch("GenEvtInfo");
	eventTree->SetBranchAddress("GenParticle",&genPartArr); genPartBr = eventTree->GetBranch("GenParticle");
      }

      // Compute MC event weight per 1/fb
      const Double_t xsec = samp->xsecv[ifile];
      Double_t totalWeight=0;
      Double_t totalWeightUp=0;
      Double_t totalWeightDown=0;
      Double_t puWeight=0;
      Double_t puWeightUp=0;
      Double_t puWeightDown=0;

      if (hasGen) {
	for(UInt_t ientry=0; ientry<eventTree->GetEntries(); ientry++) {
	  infoBr->GetEntry(ientry);
	  genBr->GetEntry(ientry);
	  puWeight = h_rw->GetBinContent(h_rw->FindBin(info->nPUmean));
开发者ID:xmniu,项目名称:MitEwk13TeV,代码行数:67,代码来源:selectZee.C


示例11: rl

void WalletGroup::reset()
{
   ReadWriteLock::ReadLock rl(lock_);
   for (const auto& wlt : values(wallets_))
      wlt->reset();
}
开发者ID:achow101,项目名称:BitcoinArmory,代码行数:6,代码来源:BlockDataViewer.cpp


示例12: mpt_directdownload

int
mpt_directdownload(mpt_adap_t *adap)
{
	U16						 deviceId = adap->device_id;
	U32						 mask = adap->diagmem_size - 1;
	MpiFwHeader_t			*fwHeader;
	U32						*image;
	U32						 addr;
	U32						 size;
	U32						 data;
	int						 t;

	wl(WRITE_SEQUENCE, MPI_WRSEQ_KEY_VALUE_MASK);
	wl(WRITE_SEQUENCE, MPI_WRSEQ_1ST_KEY_VALUE);
	wl(WRITE_SEQUENCE, MPI_WRSEQ_2ND_KEY_VALUE);
	wl(WRITE_SEQUENCE, MPI_WRSEQ_3RD_KEY_VALUE);
	wl(WRITE_SEQUENCE, MPI_WRSEQ_4TH_KEY_VALUE);
	wl(WRITE_SEQUENCE, MPI_WRSEQ_5TH_KEY_VALUE);

	wl(DIAGNOSTIC, MPI_DIAG_DISABLE_ARM);
	DELAY(100);

	/*  If FlashBadSig is set, the download doesn't seem to work if we reset
	 *  the chip here.
	 *
	 *  If FlashBadSig isn't set, the download doesn't seem to work if we
	 *  don't reset the chip here.
	 */
	data = rl(DIAGNOSTIC);
	if (!(data & MPI_DIAG_FLASH_BAD_SIG))
	{
		wl(DIAGNOSTIC, MPI_DIAG_DISABLE_ARM | MPI_DIAG_RESET_ADAPTER);
		DELAY(100);

		wl(WRITE_SEQUENCE, MPI_WRSEQ_KEY_VALUE_MASK);
		wl(WRITE_SEQUENCE, MPI_WRSEQ_1ST_KEY_VALUE);
		wl(WRITE_SEQUENCE, MPI_WRSEQ_2ND_KEY_VALUE);
		wl(WRITE_SEQUENCE, MPI_WRSEQ_3RD_KEY_VALUE);
		wl(WRITE_SEQUENCE, MPI_WRSEQ_4TH_KEY_VALUE);
		wl(WRITE_SEQUENCE, MPI_WRSEQ_5TH_KEY_VALUE);
	}

	wl(DIAGNOSTIC, MPI_DIAG_DISABLE_ARM | MPI_DIAG_MEM_ENABLE);

	addr = 0x50004;
	rldiag(addr, data);
	data &= ~0x80000000;
	wldiag(addr, data);

	if (deviceId == MPI_MANUFACTPAGE_DEVICEID_FC929)
	{
		addr = 0x51004;
		rldiag(addr, data);
		data &= ~0x80000000;
		wldiag(addr, data);
	}

	if (rl(DIAGNOSTIC) & MPI_DIAG_FLASH_BAD_SIG)
	{
		addr = 0x40000;
		rldiag(addr, data);
		data |= 0x40000000;
		wldiag(addr, data);
	}

	fwHeader = (MpiFwHeader_t *)adap->fw_image;

	image = (U32 *)fwHeader;

	addr = fwHeader->LoadStartAddress;
	size = fwHeader->ImageSize;

	while (size)
	{
		data = *image++;

		wldiag(addr, data);

		addr += 4;
		size -= 4;
	}

	addr = fwHeader->IopResetRegAddr;
	data = fwHeader->IopResetVectorValue;

	wldiag(addr, data);

	addr = 0x40000;
	rldiag(addr, data);
	data |= 0x40000000;
	wldiag(addr, data);

	wl(DIAGNOSTIC, 0);
	DELAY(100);

	t = mpt_wait_for_ready(adap);

	if (wFlag)
		fprintf(logFile, "%s:  Firmware Direct Download:  %s\n",
				adap->name, t ? "PASS" : "FAIL");
//.........这里部分代码省略.........
开发者ID:ryanSie,项目名称:Advantech,代码行数:101,代码来源:mpt.c


示例13: mpt_get_doorbell

int
mpt_get_doorbell(mpt_adap_t *adap)
{
	return rl(DOORBELL);
}
开发者ID:ryanSie,项目名称:Advantech,代码行数:5,代码来源:mpt.c


示例14: rl

QString AMSettings::publicDataFolder() const
{
	QReadLocker rl(&mutex_);
	return publicDataFolder_;
}
开发者ID:anukat2015,项目名称:acquaman,代码行数:5,代码来源:AMSettings.cpp


示例15: mpt_stop

/*
 * mpt_stop - stop the IOC (reset it).
 */
int
mpt_stop(mpt_adap_t *adap, int wait)
{
	time_t	 limit = time(NULL) + 10;

//	printf("mpt_stop called\n");

#if EFI
	if (adap->disconnected == FALSE && wait == TRUE)
	{
		EFI_PCI_IO_PROTOCOL		*pci_io;

		if (adap->loaddevice == TRUE)
		{
			printf("This chip controls the device that this utility was loaded from.\n");
			printf("After this command, the load device cannot be accessed again\n");
			printf("to open files, until this utility has been exited and restarted.\n\n");
		}

		if (!EFI_ERROR(BS->DisconnectController(adap->handle, NULL, NULL)))
		{
			adap->disconnected = TRUE;
			pci_io = adap->pci_io;
			pci_io->Attributes(pci_io, EfiPciIoAttributeOperationEnable,
							   EFI_PCI_IO_ATTRIBUTE_IO |
							   EFI_PCI_IO_ATTRIBUTE_MEMORY |
							   EFI_PCI_IO_ATTRIBUTE_BUS_MASTER |
							   EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE, NULL);
		}

		if (adap->partner_adap)
		{
			if (!EFI_ERROR(BS->DisconnectController(adap->partner_adap->handle, NULL, NULL)))
			{
				adap->partner_adap->disconnected = TRUE;
				pci_io = adap->partner_adap->pci_io;
				pci_io->Attributes(pci_io, EfiPciIoAttributeOperationEnable,
								   EFI_PCI_IO_ATTRIBUTE_IO |
								   EFI_PCI_IO_ATTRIBUTE_MEMORY |
								   EFI_PCI_IO_ATTRIBUTE_BUS_MASTER |
								   EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE, NULL);
			}
		}
	}
#endif

	adap->interrupt_mask = MPI_HIM_RIM | MPI_HIM_DIM;
	wl(HOST_INTERRUPT_MASK, adap->interrupt_mask);

	/*
	 * Reset the chip.
	 */
	if (adap->device_id == MPI_MANUFACTPAGE_DEVICEID_FC909)
	{
		rl(FC909_BUG);    /* work around FC909 bug */
	}

	if (!(rl(DIAGNOSTIC) & MPI_DIAG_DRWE))
	{
		wl(WRITE_SEQUENCE, MPI_WRSEQ_KEY_VALUE_MASK);
		wl(WRITE_SEQUENCE, MPI_WRSEQ_1ST_KEY_VALUE);
		wl(WRITE_SEQUENCE, MPI_WRSEQ_2ND_KEY_VALUE);
		wl(WRITE_SEQUENCE, MPI_WRSEQ_3RD_KEY_VALUE);
		wl(WRITE_SEQUENCE, MPI_WRSEQ_4TH_KEY_VALUE);
		wl(WRITE_SEQUENCE, MPI_WRSEQ_5TH_KEY_VALUE);
	}

	if (!(rl(DIAGNOSTIC) & MPI_DIAG_RESET_HISTORY) ||
		((rl(DOORBELL) & MPI_IOC_STATE_MASK) != MPI_IOC_STATE_RESET &&
		 (rl(DOORBELL) & MPI_IOC_STATE_MASK) != MPI_IOC_STATE_READY))
	{
		if (adap->device_id == MPI_MANUFACTPAGE_DEVID_SAS1078)
		{
			wl(SAS1078_RESET, 0x7);
		}
		else
		{
			wl(DIAGNOSTIC, MPI_DIAG_RESET_ADAPTER);
		}
		DELAY(1000);
		wl(WRITE_SEQUENCE, MPI_WRSEQ_KEY_VALUE_MASK);
		wl(WRITE_SEQUENCE, MPI_WRSEQ_1ST_KEY_VALUE);
		wl(WRITE_SEQUENCE, MPI_WRSEQ_2ND_KEY_VALUE);
		wl(WRITE_SEQUENCE, MPI_WRSEQ_3RD_KEY_VALUE);
		wl(WRITE_SEQUENCE, MPI_WRSEQ_4TH_KEY_VALUE);
		wl(WRITE_SEQUENCE, MPI_WRSEQ_5TH_KEY_VALUE);
	}

	wl(DIAGNOSTIC, 0);

	if (wait == FALSE)
	{
		while (time(NULL) < limit)
		{
			if (rl(DOORBELL) & MPI_IOC_STATE_MASK)
				break;
			if (rl(DIAGNOSTIC) & MPI_DIAG_DISABLE_ARM)
//.........这里部分代码省略.........
开发者ID:ryanSie,项目名称:Advantech,代码行数:101,代码来源:mpt.c


示例16: run


//.........这里部分代码省略.........
                            
                            if ( mr.limit && num >= mr.limit )
                                break;
                        }
                    }
                    pm.finished();
                    
                    killCurrentOp.checkForInterrupt();

                    countsBuilder.appendNumber( "input" , num );
                    countsBuilder.appendNumber( "emit" , mrtl->numEmits );
                    if ( mrtl->numEmits )
                        shouldHaveData = true;
                    
                    timingBuilder.append( "mapTime" , mapTime / 1000 );
                    timingBuilder.append( "emitLoop" , t.millis() );
                    
                    // final reduce
                    op->setMessage( "m/r: (2/3) final reduce in memory" );
                    mrtl->reduceInMemory();
                    mrtl->dump();
                    
                    BSONObj sortKey = BSON( "0" << 1 );
                    db.ensureIndex( mr.incLong , sortKey );
                    
                    {
                        writelock lock( mr.tempLong.c_str() );
                        Client::Context ctx( mr.tempLong.c_str() );
                        assert( userCreateNS( mr.tempLong.c_str() , BSONObj() , errmsg , mr.replicate ) );
                    }


                    {
                        readlock rl(mr.incLong.c_str());
                        Client::Context ctx( mr.incLong );
                        
                        BSONObj prev;
                        BSONList all;
                        
                        pm = op->setMessage( "m/r: (3/3) final reduce to collection" , db.count( mr.incLong ) );

                        auto_ptr<Cursor> temp = QueryPlanSet(mr.incLong.c_str() , BSONObj() , sortKey ).getBestGuess()->newCursor();
                        auto_ptr<ClientCursor> cursor( new ClientCursor( QueryOption_NoCursorTimeout , temp , mr.incLong.c_str() ) );
                        
                        while ( cursor->ok() ){
                            BSONObj o = cursor->current().getOwned();
                            cursor->advance();
                            
                            pm.hit();
                            
                            if ( o.woSortOrder( prev , sortKey ) == 0 ){
                                all.push_back( o );
                                if ( pm.hits() % 1000 == 0 ){
                                    if ( ! cursor->yield() ){
                                        cursor.release();
                                        break;
                                    } 
                                    killCurrentOp.checkForInterrupt();
                                }
                                continue;
                            }
                        
                            ClientCursor::YieldLock yield = cursor->yieldHold();
                                
                            state.finalReduce( all );
                            
开发者ID:jayridge,项目名称:mongo,代码行数:66,代码来源:mr.cpp


示例17: selectEleHZZHCP2012IsoGivenIDWithTightTagPerFile

void selectEleHZZHCP2012IsoGivenIDWithTightTagPerFile(const string inputfile,          // input file
                              const string outputfile,         // output directory
                              const Bool_t  matchGen = kFALSE, // match to generator muons
                              Int_t dataType = 0,              // del = 0, sel = 1, mc = -1
                              Int_t DataEraInput = 2
  ) {
  gBenchmark->Start("selectEleMVAIsoTightGivenID");

  //--------------------------------------------------------------------------------------------------------------
  // Settings 
  //============================================================================================================== 
  UInt_t DataEra = kDataEra_NONE;
  if (DataEraInput == 1) DataEra = kDataEra_2011_MC;
  if (DataEraInput == 2) DataEra = kDataEra_2012_MC;
  if (DataEraInput == 11) DataEra = kDataEra_2011_Data;
  if (DataEraInput == 12) DataEra = kDataEra_2012_Data;

  //*****************************************************************************************
  //Setup MVA
  //*****************************************************************************************
  EGammaMvaEleEstimator *eleIDMVA = new EGammaMvaEleEstimator();
  vector<string> wei 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ rl_callback_handler_install函数代码示例发布时间:2022-05-30
下一篇:
C++ rk_UNCONST函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap