111 using namespace reco;
114 : conf_(iConfig), fieldMap_(nullptr), layerMap_(56, static_cast<
const DetLayer*>(nullptr)), negLayerOffset_(27) {
115 produces<ConvBremSeedCollection>();
119 LogDebug(
"ConvBremSeedProducerProducer") <<
"START event: " <<
iEvent.id().event() <<
" in run " <<
iEvent.id().run();
121 constexpr
float pfmass = 0.0005;
146 auto output = std::make_unique<ConvBremSeedCollection>();
149 vector<pair<TrajectorySeed, pair<GlobalVector, float> > > unclean;
151 vector<vector<long int> > tripl;
157 for (
unsigned int ipft = 0; ipft < PfRTkColl.size(); ipft++) {
159 LogDebug(
"ConvBremSeedProducerProducer") <<
"NEW GsfPFRecTRACK ";
164 auto const& gsfRecHits = *pft->gsfTrackRef();
165 float pfoutenergy =
sqrt((pfmass * pfmass) + pft->gsfTrackRef()->outerMomentum().Mag2());
167 pft->gsfTrackRef()->outerMomentum().y(),
168 pft->gsfTrackRef()->outerMomentum().z(),
171 pft->gsfTrackRef()->outerPosition().y(),
172 pft->gsfTrackRef()->outerPosition().z(),
178 gc.push_back(
GoodCluster(theOutParticle, PPP, 0.5));
180 vector<PFBrem> brem = (*pft).PFRecBrem();
181 vector<PFBrem>::iterator
ib = brem.begin();
182 vector<PFBrem>::iterator ib_end = brem.end();
183 LogDebug(
"ConvBremSeedProducerProducer") <<
"NUMBER OF BREMS " << brem.size();
186 for (;
ib != ib_end; ++
ib) {
189 pft->trajectoryPoint(
ib->indTrajPoint()).
position().y(),
190 pft->trajectoryPoint(
ib->indTrajPoint()).
position().z(),
196 if ((
pos.Rho() > 5) && (fabs(
ib->SigmaDeltaP() /
ib->DeltaP()) > 3))
198 if (fabs(
ib->DeltaP()) < 3)
201 vector<vector<long int> > Idd;
212 if (!(cyliter->sensitive()))
224 if (&(*tkLayer) ==
nullptr)
229 vector<long int>
temp;
233 for (
auto i = compat.begin();
i != compat.end();
i++) {
234 long int detid =
i->first->geographicalId().rawId();
240 long int DetID = (DetMatch !=
rphirecHits->end()) ? detid : 0;
242 if ((MDetMatch !=
matchedrecHits->end()) && !MDetMatch->empty()) {
243 long int pii = MDetMatch->begin()->monoId();
245 DetID = (CDetMatch !=
rphirecHits->end()) ? pii : 0;
248 temp.push_back(DetID);
251 auto DetMatch = (pixelHits.
product())->
find((detid));
252 long int DetID = (DetMatch != pixelHits->
end()) ? detid : 0;
253 temp.push_back(DetID);
264 for (
unsigned int i = 0;
i < Idd.size() - 2;
i++) {
265 for (
unsigned int i1 = 0;
i1 < Idd[
i].size();
i1++) {
266 for (
unsigned int i2 = 0;
i2 < Idd[
i + 1].size();
i2++) {
267 for (
unsigned int i3 = 0;
i3 < Idd[
i + 2].size();
i3++) {
268 if ((Idd[
i][
i1] != 0) && (Idd[
i + 1][
i2] != 0) && (Idd[
i + 2][
i3] != 0)) {
269 vector<long int>
tmp;
270 tmp.push_back(Idd[
i][
i1]);
271 tmp.push_back(Idd[
i + 1][
i2]);
272 tmp.push_back(Idd[
i + 2][
i3]);
275 for (
unsigned int iv = 0;
iv < tripl.size();
iv++) {
276 if ((tripl[
iv][0] ==
tmp[0]) && (tripl[
iv][1] ==
tmp[1]) && (tripl[
iv][2] ==
tmp[2]))
280 tripl.push_back(
tmp);
289 float sineta_brem = sinh(eta_br);
298 for (
unsigned int i = 0;
i < tripl.size();
i++) {
304 auto DetSet1 = *DetMatch1;
305 auto DetSet2 = *DetMatch2;
306 auto DetSet3 = *DetMatch3;
308 for (
auto it1 = DetSet1.begin(); it1 != DetSet1.end(); ++it1) {
313 for (
auto it2 = DetSet2.begin(); it2 != DetSet2.end(); ++it2) {
317 for (
auto it3 = DetSet3.begin(); it3 != DetSet3.end(); ++it3) {
322 FastHelix helix(gp3, gp2, gp1, nomField, &*bfield);
325 float ene =
sqrt(gv_corr.mag2() + (pfmass * pfmass));
333 int bgc =
GoodCluster(theOutParticle, PPP, 0.3,
true);
338 if (tak1 + tak2 + tak3 > 2)
344 for (
unsigned int igcc = 0; igcc < gc.size(); igcc++) {
365 for (
int ih = 0; ih < 3; ih++) {
370 if (!
state.isValid()) {
390 for (
unsigned int iu = 0; iu < unclean.size(); iu++) {
396 LogDebug(
"ConvBremSeedProducerProducer") <<
"END";
448 LogDebug(
"FastTracker") <<
"Barrel DetLayer dump: ";
449 for (
auto bl = barrelLayers.begin(); bl != barrelLayers.end(); ++bl) {
450 LogDebug(
"FastTracker") <<
"radius " << (**bl).specificSurface().radius();
454 LogDebug(
"FastTracker") <<
"Positive Forward DetLayer dump: ";
455 for (
auto fl = posForwardLayers.begin(); fl != posForwardLayers.end(); ++fl) {
456 LogDebug(
"FastTracker") <<
"Z pos " << (**fl).surface().position().z() <<
" radii "
457 << (**fl).specificSurface().innerRadius() <<
", " << (**fl).specificSurface().outerRadius();
460 const float rTolerance = 1.5;
461 const float zTolerance = 3.;
463 LogDebug(
"FastTracker") <<
"Dump of TrackerInteractionGeometry cylinders:";
468 LogDebug(
"FastTracker") <<
"Famos Layer no " <<
i->layerNumber() <<
" is sensitive? " <<
i->sensitive() <<
" pos "
469 <<
i->surface().position();
473 if (cyl !=
nullptr) {
474 LogDebug(
"FastTracker") <<
" cylinder radius " << cyl->radius();
477 for (
auto bl = barrelLayers.begin(); bl != barrelLayers.end(); ++bl) {
478 if (fabs(cyl->radius() - (**bl).specificSurface().radius()) < rTolerance) {
481 LogDebug(
"FastTracker") <<
"Corresponding DetLayer found with radius " << (**bl).specificSurface().radius();
487 LogError(
"FastTracker") <<
"FAILED to find a corresponding DetLayer!";
490 LogDebug(
"FastTracker") <<
" disk radii " << disk->innerRadius() <<
", " << disk->outerRadius();
494 for (
auto fl = posForwardLayers.begin(); fl != posForwardLayers.end(); ++fl) {
495 if (fabs(disk->position().z() - (**fl).surface().position().z()) < zTolerance) {
498 LogDebug(
"FastTracker") <<
"Corresponding DetLayer found with Z pos " << (**fl).surface().position().z()
499 <<
" and radii " << (**fl).specificSurface().innerRadius() <<
", "
500 << (**fl).specificSurface().outerRadius();
505 LogError(
"FastTracker") <<
"FAILED to find a corresponding DetLayer!";
511 if (zpos > 0 || !
layer.forward())
523 auto plane =
layer->surface().tangentPlane(
pos);
529 bool istaken =
false;
531 if (istaken || !
hit->isValid())
538 vector<bool> goodseed;
540 if (unclean.size() < 2) {
541 for (
unsigned int i = 0;
i < unclean.size();
i++)
542 goodseed.push_back(
true);
544 for (
unsigned int i = 0;
i < unclean.size();
i++)
545 goodseed.push_back(
true);
547 for (
unsigned int iu = 0; iu < unclean.size() - 1; iu++) {
550 for (
unsigned int iu2 = iu + 1; iu2 < unclean.size(); iu2++) {
557 unsigned int shar = 0;
558 for (
auto const& sh : unclean[iu].
first.recHits()) {
559 for (
auto const& sh2 : unclean[iu2].
first.recHits()) {
566 if (unclean[iu].
second.first.perp() < unclean[iu2].second.first.perp())
567 goodseed[iu] =
false;
569 goodseed[iu2] =
false;
589 for (
unsigned int i = 0;
i < pfc.size();
i++) {
595 float tmp_dr =
sqrt(
pow(tmp_phi, 2) +
pow(tmp_eta, 2));
596 bool isBet = (tmp_dr <
dr);
598 isBet = (tmp_phi <
df);
599 if ((isBet) && (tmp_ep > minep) && (tmp_ep < 10)) {
606 bool isBad = (
dr > 0.1);
608 isBad = ((
df > 0.25) || (de > 0.5));