21 trackerHitAssociatorConfig_(iConfig, consumesCollector()),
33 for (it = input->begin(); it != input->end(); ++it) {
34 auto id =
DetId(it->detId());
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()) {
70 const PSimHit& simHit = *closestIt;
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;
int event() const
get the contents of the subdetector field (should be protected?)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
static std::string const input
Local3DPoint exitPoint() const
Exit point in the local Det frame.
int bunchCrossing() const
get the detector field from this detid
SiPixelPhase1RecHitsV(const edm::ParameterSet &conf)
Abs< T >::type abs(const T &t)
edm::EDGetTokenT< SiPixelRecHitCollection > srcToken_
EncodedEventId eventId() const
TrackerHitAssociator::Config trackerHitAssociatorConfig_
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
void analyze(const edm::Event &, const edm::EventSetup &) override
std::vector< HistogramManager > histo
std::vector< PSimHit > associateHit(const TrackingRecHit &thit) const
Local3DPoint entryPoint() const
Entry point in the local Det frame.