55 offlinePrimaryVerticesToken_ = consumes<reco::VertexCollection>(
std::string(
"offlinePrimaryVertices"));
57 onlyValid_=iConfig.getParameter<
bool>(
"onlyValidHits");
59 applyVertexCut_=iConfig.getUntrackedParameter<
bool>(
"VertexCut",
true);
64 if( !checktrigger(iEvent,iSetup,DCS) )
return;
72 if (!tracks.isValid())
return;
75 iEvent.
getByToken(offlinePrimaryVerticesToken_, vertices);
77 if (applyVertexCut_ && (!vertices.
isValid() || vertices->empty()))
return;
80 for (
auto const &
track : *tracks) {
82 if (applyVertexCut_ && (
track.pt() < 0.75 ||
std::abs(
track.dxy(vertices->at(0).position()) ) > 5*
track.dxyError()))
continue;
84 bool isBpixtrack =
false, isFpixtrack =
false;
86 auto const & trajParams =
track.extra()->trajParams();
88 for(
unsigned int h=0;
h<
track.recHitsSize();
h++){
91 if(!
hit->isValid())
continue;
94 uint32_t subdetid = (
id.subdetId());
100 if (!isBpixtrack && !isFpixtrack)
continue;
103 for(
unsigned int h=0;
h<
track.recHitsSize();
h++){
104 auto rechit = *(
hb+
h);
106 if(!rechit->isValid())
continue;
109 DetId id = rechit->geographicalId();
110 uint32_t subdetid = (
id.subdetId());
116 if (onlyValid_ && !isHitValid)
continue;
124 sizeX = (*clust).sizeX();
125 sizeY = (*clust).sizeY();
134 int row = (
int) mp.
x();
137 float rechit_x = lp.
x();
138 float rechit_y = lp.
y();
140 LocalError lerr = rechit->localPositionError();
141 float lerr_x =
sqrt(lerr.
xx());
142 float lerr_y =
sqrt(lerr.
yy());
144 histo[NRECHITS].fill(
id, &iEvent, col, row);
147 histo[CLUST_X].fill(sizeX,
id, &iEvent, col, row);
148 histo[CLUST_Y].fill(
sizeY,
id, &iEvent, col, row);
151 histo[ERROR_X].fill(lerr_x,
id, &iEvent);
152 histo[ERROR_Y].fill(lerr_y,
id, &iEvent);
154 histo[POS].fill(rechit_x, rechit_y,
id, &iEvent);
158 if (clusterProbability > 0)
159 histo[CLUSTER_PROB].fill(log10(clusterProbability),
id, &iEvent);
164 histo[NRECHITS].executePerEventHarvesting(&iEvent);
T getParameter(std::string const &) const
float clusterProbability(unsigned int flags=0) const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
virtual example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
Abs< T >::type abs(const T &t)
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override=0
ClusterRef cluster() const
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
const TrackerGeomDet * idToDet(DetId) const override