33 for (it = input->
begin(); it != input->
end(); ++it) {
34 auto id =
DetId(it->detId());
37 std::vector<PSimHit> associateSimHit;
38 associateSimHit = associate.associateHit(rechit);
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() ) {
76 float sim_x1 ( simHit.
entryPoint().
x() ), sim_x2 ( simHit.
exitPoint().
x() ), sim_xpos ( 0.5*(sim_x1 + sim_x2) );
77 float sim_y1 ( simHit.
entryPoint().
y() ), sim_y2 ( simHit.
exitPoint().
y() ), sim_ypos ( 0.5*(sim_y1 + sim_y2) );
79 float res_x = (rechit_x - sim_xpos) * 10000.0;
80 float res_y = (rechit_y - sim_ypos) * 10000.0;
82 float pull_x = ( rechit_x - sim_xpos ) / lerr_x;
83 float pull_y = ( rechit_y - sim_ypos ) / lerr_y;
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator end(bool update=false) const
int event() const
get the contents of the subdetector field (should be protected?)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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
Abs< T >::type abs(const T &t)
edm::EDGetTokenT< SiPixelRecHitCollection > srcToken_
EncodedEventId eventId() const
TrackerHitAssociator::Config trackerHitAssociatorConfig_
std::vector< HistogramManager > histo
Local3DPoint entryPoint() const
Entry point in the local Det frame.
const_iterator begin(bool update=false) const