49 using namespace HepMC;
58 h_vtx_x_(new TH1D(
"h_vtx_x",
";vtx_x (mm)", 100, 0., 0.)),
59 h_vtx_y_(new TH1D(
"h_vtx_y",
";vtx_y (mm)", 100, 0., 0.)),
60 h_vtx_z_(new TH1D(
"h_vtx_z",
";vtx_y (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))
83 const auto pos = (*vit)->position();
90 for (
auto it = hepMCEvent->particles_begin(); it != hepMCEvent->particles_end(); ++it)
92 const auto &
part = *it;
95 if (
part->pdg_id() != 2212)
98 if (
part->status() != 1)
104 const auto &mom =
part->momentum();
105 const double p_nom = hLHCInfo->
energy();
107 if (mom.rho() / p_nom < 0.7)
110 const double xi_simu = (p_nom - mom.e()) / p_nom;
111 const double th_x_simu = mom.x() / mom.rho();
112 const double th_y_simu = mom.y() / mom.rho();
114 h_xi_->Fill(xi_simu);
124 auto f_out = std::make_unique<TFile>(
outputFile_.c_str(),
"recreate");
edm::EDGetTokenT< edm::HepMCProduct > tokenHepMC_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::unique_ptr< TH1D > h_vtx_x_
CTPPSHepMCDistributionPlotter(const edm::ParameterSet &)
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::string lhcInfoLabel_
#define DEFINE_FWK_MODULE(type)
std::unique_ptr< TH1D > h_th_x_
std::unique_ptr< TH1D > h_xi_
std::unique_ptr< TH1D > h_vtx_y_
const HepMC::GenEvent * GetEvent() const
std::unique_ptr< TH1D > h_th_y_
void analyze(const edm::Event &, const edm::EventSetup &) override
float const energy() const
std::unique_ptr< TH1D > h_vtx_z_
VertexRefVector::iterator vertex_iterator
iterator over a vector of references to Vertex objects in the same collection