21 trackerHitAssociatorConfig_( iConfig, consumesCollector() ),
33 for (it = input->
begin(); it != input->
end(); ++it) {
34 auto id =
DetId(it->detId());
39 std::vector<PSimHit> associateSimHit;
41 std::vector<PSimHit>::const_iterator closestIt = associateSimHit.begin();
44 float rechit_x = lp.
x();
45 float rechit_y = lp.
y();
48 float lerr_x =
sqrt(lerr.
xx());
49 float lerr_y =
sqrt(lerr.
yy());
52 if ( !associateSimHit.empty() ) {
53 float closestSimHit = 9999.9;
55 for (std::vector<PSimHit>::const_iterator
m = associateSimHit.begin();
m < associateSimHit.end();
m++) {
56 float sim_x1 ( (*m).entryPoint().x() ), sim_x2 ( (*m).exitPoint().x() ), sim_xpos ( 0.5*(sim_x1+sim_x2) );
57 float sim_y1 ( (*m).entryPoint().y() ), sim_y2 ( (*m).exitPoint().y() ), sim_ypos ( 0.5*(sim_y1+sim_y2) );
59 float xres (
std::abs(sim_xpos - rechit_x) ), yres (
std::abs(sim_ypos - rechit_y) );
60 float dist =
std::sqrt( xres*xres + yres*yres );
62 if ( dist < closestSimHit ) {
71 if ( !associateSimHit.empty() ) {
78 float sim_x1 ( simHit.
entryPoint().
x() ), sim_x2 ( simHit.
exitPoint().
x() ), sim_xpos ( 0.5*(sim_x1 + sim_x2) );
79 float sim_y1 ( simHit.
entryPoint().
y() ), sim_y2 ( simHit.
exitPoint().
y() ), sim_ypos ( 0.5*(sim_y1 + sim_y2) );
81 float res_x = (rechit_x - sim_xpos) * 10000.0;
82 float res_y = (rechit_y - sim_ypos) * 10000.0;
84 float pull_x = ( rechit_x - sim_xpos ) / lerr_x;
85 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
#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_
void analyze(const edm::Event &, const edm::EventSetup &)
std::vector< HistogramManager > histo
std::vector< PSimHit > associateHit(const TrackingRecHit &thit) const
Local3DPoint entryPoint() const
Entry point in the local Det frame.
const_iterator begin(bool update=false) const