本文整理汇总了C++中Tuple::write方法的典型用法代码示例。如果您正苦于以下问题:C++ Tuple::write方法的具体用法?C++ Tuple::write怎么用?C++ Tuple::write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tuple
的用法示例。
在下文中一共展示了Tuple::write方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
StatusCode TrackTune::execute()
{
// output tuple
Tuple myTuple = nTuple("Candidates");
const LHCb::Track::Range tracks = get<LHCb::Track::Range>(m_trackLocation);
const LHCb::Particle::Range particles = get<LHCb::Particle::Range>(m_particleLocation);
std::vector<const LHCb::Particle* > tVec;
if (select(tVec,particles) == false) return StatusCode::SUCCESS ;
for (std::vector<const LHCb::Particle* >::const_iterator iterP = tVec.begin(); iterP != tVec.end(); ++iterP ){
bool rec = isFound(tracks,**iterP);
myTuple << Tuples::Column("M", (*iterP)->measuredMass())
<< Tuples::Column("found",rec)
<< Tuples::Column("PT", (*iterP)->pt())
<< Tuples::Column("Candidates", particles.size());
myTuple->write();
}
return StatusCode::SUCCESS ;
//
} // the end of the Algorihtm
示例2: execute
//=============================================================================
// Main execution
//=============================================================================
StatusCode VertexCompare::execute() {
if(msgLevel(MSG::DEBUG)) debug() << "==> Execute" << endmsg;
std::vector<LHCb::RecVertex*> vecOfVertices1;
std::vector<LHCb::RecVertex*> vecOfVertices2;
bool vertices_ok = getInputVertices(vecOfVertices1, vecOfVertices2);
std::vector<LHCb::RecVertex> fullVrt1, fullVrt2;
if (!vertices_ok) {
return StatusCode::SUCCESS; // return SUCCESS anyway
}
if (debugLevel()) debug() <<
" Vtx Properities x y z chi2/ndof ntracks"
<< endmsg;
// Fill reconstructed PV info
std::vector<LHCb::RecVertex*>::iterator itRecV1;
for(itRecV1 = vecOfVertices1.begin(); vecOfVertices1.end() != itRecV1;
itRecV1++) {
LHCb::RecVertex* pv;
pv = *itRecV1;
fullVrt1.push_back(*pv);
// int nTracks = pv->tracks().size();
if (debugLevel()) debug() << m_inputVerticesName1 << endmsg;
if (debugLevel()) debug() << " " << pv->position().x() << " "
<< pv->position().y() << " " << pv->position().z()
<< " " << pv->chi2PerDoF() << " " << pv->tracks().size() << endmsg;
} // end of loop over vertices1
std::vector<LHCb::RecVertex*>::iterator itRecV2;
for(itRecV2 = vecOfVertices2.begin(); vecOfVertices2.end() != itRecV2;
itRecV2++) {
LHCb::RecVertex* pv;
pv = *itRecV2;
fullVrt2.push_back(*pv);
// int nTracks = pv->tracks().size();
if (debugLevel()) debug() << m_inputVerticesName2 << endmsg;
if (debugLevel()) debug() << " "
<< pv->position().x() << " "
<< pv->position().y() << " "
<< pv->position().z() << " "
<< pv->chi2PerDoF() << " "
<< pv->tracks().size() << endmsg;
} // end of loop over vertices2
if (debugLevel()) debug() << "fullVrt1 size " << fullVrt1.size() << endmsg;
if (debugLevel()) debug() << "fullVrt2 size " << fullVrt2.size() << endmsg;
int size_diff = fullVrt1.size() - fullVrt2.size();
if(m_produceHistogram) {
plot(double(size_diff), 1001, "size_diff", -5.5, 5.5, 11);
}
if(m_produceNtuple) {
Tuple myTuple_evt = nTuple(101, "PV_nTuple_evt", CLID_ColumnWiseTuple);
myTuple_evt->column("size_diff", double(size_diff));
myTuple_evt->column("size_1", double(fullVrt1.size()));
myTuple_evt->column("size_2", double(fullVrt2.size()));
myTuple_evt->write();
}
double dx = -99999.;
double dy = -99999.;
double dz = -99999.;
double errx = -99999.;
double erry = -99999.;
double errz = -99999.;
double covxx1 = -99999.;
double covyy1 = -99999.;
double covzz1 = -99999.;
double covxy1 = -99999.;
double covxz1 = -99999.;
double covyz1 = -99999.;
double covxx2 = -99999.;
double covyy2 = -99999.;
double covzz2 = -99999.;
double covxy2 = -99999.;
double covxz2 = -99999.;
double covyz2 = -99999.;
int ntracks_part = 0;
int ntracks_part2 = 0;
int dtracks = 0;
std::vector<LHCb::RecVertex>::iterator fullIter;
int oIt=0;
std::vector<int> link;
if (fullVrt1.size()!=0 && fullVrt2.size()!=0) matchByDistance(fullVrt1, fullVrt2, link);
else return StatusCode::SUCCESS;
for (fullIter=fullVrt1.begin(); fullIter!=fullVrt1.end(); fullIter++){
LHCb::RecVertex vrtf = *fullIter;
m_nVtx++;
if (link.at(oIt)==-1) continue;
Gaudi::SymMatrix3x3 covPV_part1 = vrtf.covMatrix();
double sigx_part1 = (covPV_part1(0,0));
double sigy_part1 = (covPV_part1(1,1));
double sigz_part1 = (covPV_part1(2,2));
covxx1 = sigx_part1;
covyy1 = sigy_part1;
//.........这里部分代码省略.........
示例3: debug
//.........这里部分代码省略.........
else debug() << "There are no MC particles in the default location" << endmsg;
debug() << "There are " << m_mcparts.size() << " MC particles" << endmsg;
if (m_mcparts.size()==0)
{
m_passEvent = 1; // Automatically run event if MC data is unavailable
m_runMC = 0; // No need to try looking at MC data any more if it is unavailable
}
else
{
//### Declare Tuple to store data ###//
Tuple mcTuple = nTuple("mcTuple");
//### Test ###//
int loop = 0; // Is this really needed anymore??
//### Loop over MCParticle vector ###//
for ( unsigned int k = 0; k<m_mcparts.size(); k++)
{
LHCb::MCParticle *part = m_mcparts[k];
int pid = part->particleID().pid();
verbose() << "MC Particle is a " << pid << endmsg;
if ( abs(pid) == 13 )
{
//### Identify the mother of the MCParticle ###//
const LHCb::MCParticle *mcMother = part->mother();
//### TEST ###//
//if ( abs(pid) == 513 || abs(pid) == 525 || abs(pid) == 515 || abs(pid) == 533 || abs(pid) == 535 || abs(pid) == 10531
// || abs(pid) == 10511 || abs(pid) == 10521 || abs(pid) == 20513 || abs(pid) == 20523 || abs(pid) == 20533 )
/*
if (abs(pid == 511) || abs(pid == 521) )
{
//info() << "Found mother B (" << pid << ")" << endmsg;
if (mcMother != NULL)
{
info() << "Found B (" << pid << ")" << endmsg;
info() << "B Mother:" << mcMother->particleID().pid() << endmsg;
const LHCb::MCParticle *gMother = mcMother->mother();
if ( gMother == NULL ) info() << "B has no GrandMother" << endmsg;
else info() << "B GrandMother: " << gMother->particleID().pid() << endmsg;
}
//else info() << "B has no mother." << endmsg;
loop++;
}
*/
/*
if (mcMother==NULL)
{
info() << "Found particle with NULL mother: " << pid << endmsg;
loop++;
}
*/
/* if (mcMother!=NULL)
{
if ( abs(pid) == 13 && (abs(mcMother->particleID().pid()) == 511 || abs(mcMother->particleID().pid()) == 521 ) )
{
loop++;
}
}*/
//### Filter particles into vector of mu+ and mu- ###//
if ( abs( mcMother->particleID().pid() ) == 511 || abs( mcMother->particleID().pid() ) == 521 )
{
//info() << "MCParticle reconstructible..." << m_recoTool->text(m_recoTool->reconstructible(part)) << endmsg;
sc = filterMC(part, mcMother, MuMinus, MuPlus);
if (!sc) return sc;
loop++;
}
}
}
//### There should be one of each particle from the correct mother per event ###//
if ( loop <= 1 || MuMinus.size() != 1 || MuPlus.size() != 1 )
{
debug() << "There are too many / few daughters in this event." << endmsg;
debug() << "There are " << MuMinus.size() << " MC muons" << endmsg;
debug() << "There are " << MuPlus.size() << " MC anti-muons" << endmsg;
counter("TooManyMCDaughters")++;
}
else
{
//### Accep Event ###//
m_passEvent = 1;
//### Find DiMuon Invariant Masses, plot along with other quantites ###//
const std::string& strMC = "mc";
MC* mc = new MC(strMC, m_local);
sc = mc->invMassMC(MuPlus, MuMinus, m_mcparts, mcTuple, "Mu");
if (!sc) return sc;
mcTuple->write();
delete mc;
}
}
return StatusCode::SUCCESS;
}