21 trackerHitAssociatorConfig_(iConfig, consumesCollector()),
37 std::vector<PSimHit> associateSimHit;
39 std::vector<PSimHit>::const_iterator closestIt = associateSimHit.begin();
42 float rechit_x = lp.
x();
43 float rechit_y = lp.
y();
46 float lerr_x =
sqrt(lerr.
xx());
47 float lerr_y =
sqrt(lerr.
yy());
50 if (!associateSimHit.empty()) {
51 float closestSimHit = 9999.9;
53 for (std::vector<PSimHit>::const_iterator
m = associateSimHit.begin();
m < associateSimHit.end();
m++) {
54 float sim_x1((*m).entryPoint().x()), sim_x2((*m).exitPoint().x()), sim_xpos(0.5 * (sim_x1 + sim_x2));
55 float sim_y1((*m).entryPoint().y()), sim_y2((*m).exitPoint().y()), sim_ypos(0.5 * (sim_y1 + sim_y2));
57 float xres(
std::abs(sim_xpos - rechit_x)), yres(
std::abs(sim_ypos - rechit_y));
58 float dist =
std::sqrt(xres * xres + yres * yres);
60 if (dist < closestSimHit) {
69 if (!associateSimHit.empty()) {
72 int bunch =
simHit.eventId().bunchCrossing();
73 int event =
simHit.eventId().event();
75 float sim_x1(
simHit.entryPoint().x()), sim_x2(
simHit.exitPoint().x()), sim_xpos(0.5 * (sim_x1 + sim_x2));
76 float sim_y1(
simHit.entryPoint().y()), sim_y2(
simHit.exitPoint().y()), sim_ypos(0.5 * (sim_y1 + sim_y2));
78 float res_x = (rechit_x - sim_xpos) * 10000.0;
79 float res_y = (rechit_y - sim_ypos) * 10000.0;
81 float pull_x = (rechit_x - sim_xpos) / lerr_x;
82 float pull_y = (rechit_y - sim_ypos) / lerr_y;
static std::string const input
std::vector< PSimHit > associateHit(const TrackingRecHit &thit) const
SiPixelPhase1RecHitsV(const edm::ParameterSet &conf)
Abs< T >::type abs(const T &t)
edm::EDGetTokenT< SiPixelRecHitCollection > srcToken_
#define DEFINE_FWK_MODULE(type)
TrackerHitAssociator::Config trackerHitAssociatorConfig_
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
void analyze(const edm::Event &, const edm::EventSetup &) override
std::vector< HistogramManager > histo