48 using namespace HepMC;
55 outputFile_(iConfig.getParameter<
string>(
"outputFile")),
57 h_vtx_x_(new TH1D(
"h_vtx_x",
";vtx_x (mm)", 100, 0., 0.)),
58 h_vtx_y_(new TH1D(
"h_vtx_y",
";vtx_y (mm)", 100, 0., 0.)),
59 h_vtx_z_(new TH1D(
"h_vtx_z",
";vtx_z (mm)", 100, 0., 0.)),
60 h_vtx_t_(new TH1D(
"h_vtx_t",
";vtx_t (mm)", 100, 0., 0.)),
62 h_xi_(new TH1D(
"h_xi",
";#xi", 100, 0., 0.30)),
63 h_th_x_(new TH1D(
"h_th_x",
";#theta^{*}_{x}", 100, -300E-6, +300E-6)),
64 h_th_y_(new TH1D(
"h_th_y",
";#theta^{*}_{y}", 100, -300E-6, +300E-6)) {}
79 const auto pos = (*vit)->position();
87 for (
auto it = hepMCEvent->particles_begin(); it != hepMCEvent->particles_end(); ++it) {
88 const auto &
part = *it;
91 if (
part->pdg_id() != 2212)
94 if (
part->status() != 1)
100 const auto &mom =
part->momentum();
101 const double p_nom = lhcInfo.energy();
103 if (mom.rho() / p_nom < 0.7)
106 const double xi_simu = (p_nom - mom.e()) / p_nom;
107 const double th_x_simu = mom.x() / mom.rho();
108 const double th_y_simu = mom.y() / mom.rho();
110 h_xi_->Fill(xi_simu);
119 auto f_out = std::make_unique<TFile>(
outputFile_.c_str(),
"recreate");
std::unique_ptr< TH1D > h_vtx_t_
edm::EDGetTokenT< edm::HepMCProduct > tokenHepMC_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
std::unique_ptr< TH1D > h_vtx_x_
edm::ESGetToken< LHCInfo, LHCInfoRcd > lhcInfoESToken_
CTPPSHepMCDistributionPlotter(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
std::unique_ptr< TH1D > h_th_x_
const HepMC::GenEvent * GetEvent() const
std::unique_ptr< TH1D > h_xi_
std::unique_ptr< TH1D > h_vtx_y_
std::unique_ptr< TH1D > h_th_y_
void analyze(const edm::Event &, const edm::EventSetup &) override
std::unique_ptr< TH1D > h_vtx_z_
VertexRefVector::iterator vertex_iterator
iterator over a vector of references to Vertex objects in the same collection