43 if ( !tracks.isValid() ) {
44 edm::LogWarning(
"SiPixelPhase1TrackClusters") <<
"track collection is not valid";
52 edm::LogWarning(
"SiPixelPhase1TrackClusters") <<
"pixel cluster collection is not valid";
60 std::vector<bool> ontrack (clusterColl->data().size(),
false);
61 std::vector<float> corr_charge(clusterColl->data().size(), -1.0f);
63 for (
auto const &
track : *tracks) {
65 bool isBpixtrack =
false, isFpixtrack =
false, crossesPixVol=
false;
71 auto const & trajParams =
track.extra()->trajParams();
72 assert(trajParams.size()==
track.recHitsSize());
74 for(
unsigned int h=0;
h<
track.recHitsSize();
h++){
76 if (!
hit->isValid())
continue;
80 uint32_t subdetid = (
id.subdetId());
85 if (!pixhit)
continue;
89 if (clust.isNull())
continue;
90 ontrack[clust.key()] =
true;
94 auto const & ltp = trajParams[
h];
97 float clust_alpha = atan2(localDir.
z(), localDir.
x());
98 float clust_beta = atan2(localDir.
z(), localDir.
y());
99 double corrCharge = clust->charge() *
sqrt( 1.0 / ( 1.0/
pow(
tan(clust_alpha), 2 ) +
100 1.0/
pow(
tan(clust_beta ), 2 ) +
102 corr_charge[clust.key()] = (
float) corrCharge;
107 if (isBpixtrack || isFpixtrack)
115 if (isBpixtrack || isFpixtrack)
123 for (it = clusterColl->begin(); it != clusterColl->end(); ++it) {
124 auto id =
DetId(it->detId());
127 const PixelTopology& topol = geomdetunit->specificTopology();
129 for(
auto subit = it->
begin(); subit != it->
end(); ++subit) {
132 bool is_ontrack = ontrack[
key];
133 float corrected_charge = corr_charge[
key];
137 GlobalPoint clustgp = geomdetunit->surface().toGlobal(clustlp);
T getParameter(std::string const &) const
edm::Ref< typename HandleT::element_type, typename HandleT::element_type::value_type::value_type > makeRefTo(const HandleT &iHandle, typename HandleT::element_type::value_type::const_iterator itIter)
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator end(bool update=false) const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
edm::EDGetTokenT< reco::TrackCollection > tracksToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
Geom::Phi< T > phi() const
SiPixelPhase1TrackClusters(const edm::ParameterSet &conf)
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
void analyze(const edm::Event &, const edm::EventSetup &)
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
ClusterRef cluster() const
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
std::vector< HistogramManager > histo
Pixel cluster – collection of neighboring pixels above threshold.
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > clustersToken_
Power< A, B >::type pow(const A &a, const B &b)
const_iterator begin(bool update=false) const
const TrackerGeomDet * idToDet(DetId) const