本文整理汇总了C++中Jet::set_px方法的典型用法代码示例。如果您正苦于以下问题:C++ Jet::set_px方法的具体用法?C++ Jet::set_px怎么用?C++ Jet::set_px使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Jet
的用法示例。
在下文中一共展示了Jet::set_px方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
//.........这里部分代码省略.........
geom = findNode::getClass<RawTowerGeomContainer>(topNode,"TOWERGEOM_HCALIN");
if (!towers||!geom) {
return std::vector<Jet*>();
}
} else if (_input == Jet::HCALOUT_TOWER) {
towers = findNode::getClass<RawTowerContainer>(topNode,"TOWER_CALIB_HCALOUT");
geom = findNode::getClass<RawTowerGeomContainer>(topNode,"TOWERGEOM_HCALOUT");
if (!towers||!geom) {
return std::vector<Jet*>();
}
} else if (_input == Jet::FEMC_TOWER) {
towers = findNode::getClass<RawTowerContainer>(topNode,"TOWER_CALIB_FEMC");
geom = findNode::getClass<RawTowerGeomContainer>(topNode,"TOWERGEOM_FEMC");
if (!towers||!geom) {
return std::vector<Jet*>();
}
} else if (_input == Jet::FHCAL_TOWER) {
towers = findNode::getClass<RawTowerContainer>(topNode,"TOWER_CALIB_FHCAL");
geom = findNode::getClass<RawTowerGeomContainer>(topNode,"TOWERGEOM_FHCAL");
if (!towers||!geom) {
return std::vector<Jet*>();
}
} else if (_input == Jet::CEMC_TOWER_SUB1) {
towers = findNode::getClass<RawTowerContainer>(topNode,"TOWER_CALIB_CEMC_RETOWER_SUB1");
geom = findNode::getClass<RawTowerGeomContainer>(topNode,"TOWERGEOM_HCALIN");
if (!towers||!geom) {
return std::vector<Jet*>();
}
} else if (_input == Jet::HCALIN_TOWER_SUB1) {
towers = findNode::getClass<RawTowerContainer>(topNode,"TOWER_CALIB_HCALIN_SUB1");
geom = findNode::getClass<RawTowerGeomContainer>(topNode,"TOWERGEOM_HCALIN");
if (!towers||!geom) {
return std::vector<Jet*>();
}
} else if (_input == Jet::HCALOUT_TOWER_SUB1) {
towers = findNode::getClass<RawTowerContainer>(topNode,"TOWER_CALIB_HCALOUT_SUB1");
geom = findNode::getClass<RawTowerGeomContainer>(topNode,"TOWERGEOM_HCALOUT");
if (!towers||!geom) {
return std::vector<Jet*>();
}
} else {
return std::vector<Jet*>();
}
// first grab the event vertex or bail
GlobalVertex* vtx = vertexmap->begin()->second;
float vtxz = NAN;
if (vtx) vtxz = vtx->get_z();
else return std::vector<Jet*>();
if (isnan(vtxz))
{
static bool once = true;
if (once)
{
once = false;
cout <<"TowerJetInput::get_input - WARNING - vertex is NAN. Drop all tower inputs (further NAN-vertex warning will be suppressed)."<<endl;
}
return std::vector<Jet*>();
}
std::vector<Jet*> pseudojets;
RawTowerContainer::ConstRange begin_end = towers->getTowers();
RawTowerContainer::ConstIterator rtiter;
for (rtiter = begin_end.first; rtiter != begin_end.second; ++rtiter) {
RawTower *tower = rtiter->second;
RawTowerGeom * tower_geom =
geom->get_tower_geometry(tower -> get_key());
assert(tower_geom);
double r = tower_geom->get_center_radius();
double phi = atan2(tower_geom->get_center_y(), tower_geom->get_center_x());
double z0 = tower_geom->get_center_z();
double z = z0 - vtxz;
double eta = asinh(z/r); // eta after shift from vertex
double pt = tower->get_energy() / cosh(eta);
double px = pt * cos(phi);
double py = pt * sin(phi);
double pz = pt * sinh(eta);
Jet *jet = new JetV1();
jet->set_px(px);
jet->set_py(py);
jet->set_pz(pz);
jet->set_e(tower->get_energy());
jet->insert_comp(_input,tower->get_id());
pseudojets.push_back(jet);
}
if (_verbosity > 0) cout << "TowerJetInput::process_event -- exited" << endl;
return pseudojets;
}
示例2: if
std::vector<Jet*> ClusterJetInput::get_input(PHCompositeNode *topNode) {
if (_verbosity > 0) cout << "ClusterJetInput::process_event -- entered" << endl;
GlobalVertexMap* vertexmap = findNode::getClass<GlobalVertexMap>(topNode,"GlobalVertexMap");
if (!vertexmap) {
return std::vector<Jet*>();
}
RawClusterContainer *clusters = NULL;
RawTowerGeom *geom = NULL;
if (_input == Jet::CEMC_CLUSTER) {
clusters = findNode::getClass<RawClusterContainer>(topNode,"CLUSTER_CEMC");
geom = findNode::getClass<RawTowerGeom>(topNode,"TOWERGEOM_CEMC");
if (!clusters||!geom) {
return std::vector<Jet*>();
}
} else if (_input == Jet::HCALIN_CLUSTER) {
clusters = findNode::getClass<RawClusterContainer>(topNode,"CLUSTER_HCALIN");
geom = findNode::getClass<RawTowerGeom>(topNode,"TOWERGEOM_HCALIN");
if (!clusters||!geom) {
return std::vector<Jet*>();
}
} else if (_input == Jet::HCALOUT_CLUSTER) {
clusters = findNode::getClass<RawClusterContainer>(topNode,"CLUSTER_HCALOUT");
geom = findNode::getClass<RawTowerGeom>(topNode,"TOWERGEOM_HCALOUT");
if (!clusters||!geom) {
return std::vector<Jet*>();
}
} else {
return std::vector<Jet*>();
}
// first grab the event vertex or bail
GlobalVertex* vtx = vertexmap->begin()->second;
float vtxz = NAN;
if (vtx) vtxz = vtx->get_z();
else return std::vector<Jet*>();
std::vector<Jet*> pseudojets;
RawClusterContainer::ConstRange begin_end = clusters->getClusters();
RawClusterContainer::ConstIterator rtiter;
for (rtiter = begin_end.first; rtiter != begin_end.second; ++rtiter) {
RawCluster *cluster = rtiter->second;
double r = geom->get_radius();
double eta0 = cluster->get_eta();
double phi = cluster->get_phi();
double z0 = r * sinh(eta0);
double z = z0 - vtxz;
double eta = asinh(z/r); // eta after shift from vertex
double pt = cluster->get_energy() / cosh(eta);
double px = pt * cos(phi);
double py = pt * sin(phi);
double pz = pt * sinh(eta);
Jet *jet = new JetV1();
jet->set_px(px);
jet->set_py(py);
jet->set_pz(pz);
jet->set_e(cluster->get_energy());
jet->insert_comp(_input,cluster->get_id());
pseudojets.push_back(jet);
}
if (_verbosity > 0) cout << "ClusterJetInput::process_event -- exited" << endl;
return pseudojets;
}