本文整理汇总了C++中rl函数的典型用法代码示例。如果您正苦于以下问题:C++ rl函数的具体用法?C++ rl怎么用?C++ rl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rl函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: rl
map<BinaryData, shared_ptr<BtcWallet> > WalletGroup::getWalletMap(void) const
{
ReadWriteLock::ReadLock rl(lock_);
return wallets_;
}
示例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
//.........这里部分代码省略.........
示例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;
示例5: mpt_get_state
int
mpt_get_state(mpt_adap_t *adap)
{
return rl(DOORBELL) & MPI_IOC_STATE_MASK;
}
示例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;
示例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.;
示例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;
//.........这里部分代码省略.........
示例9: rl
qint64 QUsbHid::bytesToWrite() const
{
QReadLocker rl(bytesToWriteLock);
return _bytesToWrite;
}
示例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));
示例11: rl
void WalletGroup::reset()
{
ReadWriteLock::ReadLock rl(lock_);
for (const auto& wlt : values(wallets_))
wlt->reset();
}
示例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");
//.........这里部分代码省略.........
示例13: mpt_get_doorbell
int
mpt_get_doorbell(mpt_adap_t *adap)
{
return rl(DOORBELL);
}
示例14: rl
QString AMSettings::publicDataFolder() const
{
QReadLocker rl(&mutex_);
return publicDataFolder_;
}
示例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)
//.........这里部分代码省略.........