43 : h_de_th_x(new TH1D(
"",
";#Delta#theta_{x} (rad)", 100, 0., 0.)),
44 h_de_th_y(new TH1D(
"",
";#Delta#theta_{y} (rad)", 100, 0., 0.)),
45 h_de_p(new TH1D(
"",
";#Deltap (GeV)", 100, 0., 0.)) {}
48 h_de_th_x->Write(
"h_de_th_x");
49 h_de_th_y->Write(
"h_de_th_y");
50 h_de_p->Write(
"h_de_p");
61 using namespace HepMC;
69 h_de_vtx_x_(new TH1D(
"h_de_vtx_x",
";#Delta vtx_{x} (mm)", 100, 0., 0.)),
70 h_de_vtx_y_(new TH1D(
"h_de_vtx_y",
";#Delta vtx_{y} (mm)", 100, 0., 0.)),
71 h_de_vtx_z_(new TH1D(
"h_de_vtx_z",
";#Delta vtx_{z} (mm)", 100, 0., 0.)) {}
86 GenEvent::vertex_const_iterator vold, vnew;
87 for (vold = orig->vertices_begin(), vnew = smear->vertices_begin();
88 vold != orig->vertices_end() && vnew != smear->vertices_end();
90 const FourVector &vo = (*vold)->position();
91 const FourVector &vn = (*vnew)->position();
100 GenEvent::particle_const_iterator pold, pnew;
101 for (pold = orig->particles_begin(), pnew = smear->particles_begin();
102 pold != orig->particles_end() && pnew != smear->particles_end();
104 FourVector
o = (*pold)->momentum(),
n = (*pnew)->momentum();
108 const double thetaLim = 0.01;
109 double th = o.theta();
113 if (th > (
M_PI - thetaLim))
128 double othx = o.x() / o.rho(), othy = o.y() / o.rho();
129 double nthx =
n.x() /
n.rho(), nthy =
n.y() /
n.rho();
131 sp.h_de_p->Fill(
n.rho() - o.rho());
133 sp.h_de_th_x->Fill(nthx - othx);
134 sp.h_de_th_y->Fill(nthy - othy);
141 auto f_out = std::make_unique<TFile>(
outputFile_.c_str(),
"recreate");
147 gDirectory = f_out->mkdir(
"sector 45");
150 gDirectory = f_out->mkdir(
"sector 56");
void analyze(const edm::Event &, const edm::EventSetup &) override
~CTPPSBeamSmearingValidator() override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::unique_ptr< TH1D > h_de_vtx_z_
#define DEFINE_FWK_MODULE(type)
std::unique_ptr< TH1D > h_de_vtx_x_
edm::EDGetTokenT< edm::HepMCProduct > tokenAfterSmearing_
std::unique_ptr< TH1D > h_de_th_y
std::unique_ptr< TH1D > h_de_vtx_y_
const HepMC::GenEvent * GetEvent() const
std::unique_ptr< TH1D > h_de_p
std::unique_ptr< TH1D > h_de_th_x
edm::EDGetTokenT< edm::HepMCProduct > tokenBeforeSmearing_
std::map< unsigned int, SectorPlots > sectorPlots_
CTPPSBeamSmearingValidator(const edm::ParameterSet &)