|
|
Go to the documentation of this file.
54 : conf_(iConfig), fieldMap_(nullptr), layerMap_(56, static_cast<
const DetLayer*>(nullptr)), negLayerOffset_(27) {
55 produces<ConvBremSeedCollection>();
61 LogDebug(
"ConvBremSeedProducerProducer") <<
"START event: " <<
iEvent.id().event() <<
" in run " <<
iEvent.id().run();
63 float pfmass = 0.0005;
90 auto output = std::make_unique<ConvBremSeedCollection>();
93 vector<pair<TrajectorySeed, pair<GlobalVector, float> > > unclean;
95 vector<vector<long int> > tripl;
101 for (
unsigned int ipft = 0; ipft < PfRTkColl.size(); ipft++) {
103 LogDebug(
"ConvBremSeedProducerProducer") <<
"NEW GsfPFRecTRACK ";
108 auto const& gsfRecHits = *pft->gsfTrackRef();
109 float pfoutenergy =
sqrt((pfmass * pfmass) + pft->gsfTrackRef()->outerMomentum().Mag2());
111 pft->gsfTrackRef()->outerMomentum().y(),
112 pft->gsfTrackRef()->outerMomentum().z(),
115 pft->gsfTrackRef()->outerPosition().y(),
116 pft->gsfTrackRef()->outerPosition().z(),
122 gc.push_back(
GoodCluster(theOutParticle, PPP, 0.5));
124 vector<PFBrem> brem = (*pft).PFRecBrem();
125 vector<PFBrem>::iterator
ib = brem.begin();
126 vector<PFBrem>::iterator ib_end = brem.end();
127 LogDebug(
"ConvBremSeedProducerProducer") <<
"NUMBER OF BREMS " << brem.size();
130 for (;
ib != ib_end; ++
ib) {
133 pft->trajectoryPoint(
ib->indTrajPoint()).
position().y(),
134 pft->trajectoryPoint(
ib->indTrajPoint()).
position().z(),
140 if ((
pos.Rho() > 5) && (fabs(
ib->SigmaDeltaP() /
ib->DeltaP()) > 3))
142 if (fabs(
ib->DeltaP()) < 3)
145 vector<vector<long int> > Idd;
156 if (!(cyliter->sensitive()))
168 if (&(*tkLayer) ==
nullptr)
172 std::vector<DetWithState> compat = tkLayer->
compatibleDets(trajState, alongProp, est);
173 vector<long int>
temp;
177 for (std::vector<DetWithState>::const_iterator
i = compat.begin();
i != compat.end();
i++) {
178 long int detid =
i->first->geographicalId().rawId();
184 long int DetID = (DetMatch !=
rphirecHits->end()) ? detid : 0;
186 if ((MDetMatch !=
matchedrecHits->end()) && !MDetMatch->empty()) {
187 long int pii = MDetMatch->begin()->monoId();
189 DetID = (CDetMatch !=
rphirecHits->end()) ? pii : 0;
192 temp.push_back(DetID);
196 long int DetID = (DetMatch != pixelHits->
end()) ? detid : 0;
197 temp.push_back(DetID);
208 for (
unsigned int i = 0;
i < Idd.size() - 2;
i++) {
209 for (
unsigned int i1 = 0;
i1 < Idd[
i].size();
i1++) {
210 for (
unsigned int i2 = 0;
i2 < Idd[
i + 1].size();
i2++) {
211 for (
unsigned int i3 = 0;
i3 < Idd[
i + 2].size();
i3++) {
212 if ((Idd[
i][
i1] != 0) && (Idd[
i + 1][
i2] != 0) && (Idd[
i + 2][
i3] != 0)) {
213 vector<long int>
tmp;
214 tmp.push_back(Idd[
i][
i1]);
215 tmp.push_back(Idd[
i + 1][
i2]);
216 tmp.push_back(Idd[
i + 2][
i3]);
219 for (
unsigned int iv = 0; iv < tripl.size(); iv++) {
220 if ((tripl[iv][0] ==
tmp[0]) && (tripl[iv][1] ==
tmp[1]) && (tripl[iv][2] ==
tmp[2]))
224 tripl.push_back(
tmp);
233 float sineta_brem = sinh(eta_br);
242 for (
unsigned int i = 0;
i < tripl.size();
i++) {
266 FastHelix helix(gp3, gp2, gp1, nomField, &*bfield);
269 float ene =
sqrt(gv_corr.mag2() + (pfmass * pfmass));
277 int bgc =
GoodCluster(theOutParticle, PPP, 0.3,
true);
282 if (tak1 + tak2 + tak3 > 2)
288 for (
unsigned int igcc = 0; igcc < gc.size(); igcc++) {
309 for (
int ih = 0; ih < 3; ih++) {
314 if (!
state.isValid()) {
334 for (
unsigned int iu = 0; iu < unclean.size(); iu++) {
340 LogDebug(
"ConvBremSeedProducerProducer") <<
"END";
392 LogDebug(
"FastTracker") <<
"Barrel DetLayer dump: ";
393 for (
auto bl = barrelLayers.begin(); bl != barrelLayers.end(); ++bl) {
394 LogDebug(
"FastTracker") <<
"radius " << (**bl).specificSurface().radius();
398 LogDebug(
"FastTracker") <<
"Positive Forward DetLayer dump: ";
399 for (
auto fl = posForwardLayers.begin(); fl != posForwardLayers.end(); ++fl) {
400 LogDebug(
"FastTracker") <<
"Z pos " << (**fl).surface().position().z() <<
" radii "
401 << (**fl).specificSurface().innerRadius() <<
", " << (**fl).specificSurface().outerRadius();
404 const float rTolerance = 1.5;
405 const float zTolerance = 3.;
407 LogDebug(
"FastTracker") <<
"Dump of TrackerInteractionGeometry cylinders:";
412 LogDebug(
"FastTracker") <<
"Famos Layer no " <<
i->layerNumber() <<
" is sensitive? " <<
i->sensitive() <<
" pos "
413 <<
i->surface().position();
417 if (cyl !=
nullptr) {
418 LogDebug(
"FastTracker") <<
" cylinder radius " << cyl->radius();
421 for (
auto bl = barrelLayers.begin(); bl != barrelLayers.end(); ++bl) {
422 if (fabs(cyl->radius() - (**bl).specificSurface().radius()) < rTolerance) {
425 LogDebug(
"FastTracker") <<
"Corresponding DetLayer found with radius " << (**bl).specificSurface().radius();
431 LogError(
"FastTracker") <<
"FAILED to find a corresponding DetLayer!";
434 LogDebug(
"FastTracker") <<
" disk radii " << disk->innerRadius() <<
", " << disk->outerRadius();
438 for (
auto fl = posForwardLayers.begin(); fl != posForwardLayers.end(); ++fl) {
439 if (fabs(disk->position().z() - (**fl).surface().position().z()) < zTolerance) {
442 LogDebug(
"FastTracker") <<
"Corresponding DetLayer found with Z pos " << (**fl).surface().position().z()
443 <<
" and radii " << (**fl).specificSurface().innerRadius() <<
", "
444 << (**fl).specificSurface().outerRadius();
449 LogError(
"FastTracker") <<
"FAILED to find a corresponding DetLayer!";
455 if (zpos > 0 || !layer.
forward())
473 bool istaken =
false;
475 if (istaken || !
hit->isValid())
482 vector<bool> goodseed;
484 if (unclean.size() < 2) {
485 for (
unsigned int i = 0;
i < unclean.size();
i++)
486 goodseed.push_back(
true);
488 for (
unsigned int i = 0;
i < unclean.size();
i++)
489 goodseed.push_back(
true);
491 for (
unsigned int iu = 0; iu < unclean.size() - 1; iu++) {
494 for (
unsigned int iu2 = iu + 1; iu2 < unclean.size(); iu2++) {
501 unsigned int shar = 0;
502 for (
auto const& sh : unclean[iu].
first.recHits()) {
503 for (
auto const& sh2 : unclean[iu2].
first.recHits()) {
510 if (unclean[iu].
second.first.perp() < unclean[iu2].second.first.perp())
511 goodseed[iu] =
false;
513 goodseed[iu2] =
false;
533 for (
unsigned int i = 0;
i < pfc.size();
i++) {
539 float tmp_dr =
sqrt(
pow(tmp_phi, 2) +
pow(tmp_eta, 2));
540 bool isBet = (tmp_dr <
dr);
542 isBet = (tmp_phi <
df);
543 if ((isBet) && (tmp_ep > minep) && (tmp_ep < 10)) {
550 bool isBad = (
dr > 0.1);
552 isBad = ((
df > 0.25) || (de > 0.5));
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
const TrackerGeomDet * idToDet(DetId) const override
T const * product() const
TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const override
TrajectoryStateOnSurface makeTrajectoryState(const DetLayer *layer, const ParticlePropagator &pp, const MagneticField *field) const
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
bool propagateToEcalEntrance(bool first=true)
RawParticle const & particle() const
The particle being propagated.
T const * product() const
std::vector< GsfPFRecTrack > GsfPFRecTrackCollection
collection of GsfPFRecTrack objects
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel,...
const MagneticField * magfield_
const XYZTLorentzVector & momentum() const
the momentum fourvector
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
GlobalPoint position() const
std::list< TrackerLayer >::const_iterator cylinderEnd() const
Returns the last pointer in the cylinder list.
const XYZTLorentzVector & vertex() const
the vertex fourvector
const TransientTrackingRecHitBuilder * hitBuilder_
SiStripRecHit2DCollection::const_iterator StDetMatch
TrackCharge charge() const
const GeometricSearchTracker * geomSearchTracker_
U second(std::pair< T, U > const &p)
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
int getSuccess() const
Has propagation been performed and was barrel or endcap reached ?
void initializeLayerMap()
math::XYZTLorentzVector XYZTLorentzVector
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void setPropagationConditions(const TrackerLayer &, bool firstLoop=true)
const MagneticFieldMap * fieldMap_
const TrackerInteractionGeometry * geometry_
double Z() const
z of vertex
ROOT::Math::SMatrixIdentity AlgebraicMatrixID
const Plane & surface() const
The nominal surface of the GeomDet.
GlobalTrajectoryParameters stateAtVertex() const
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
~ConvBremSeedProducer() override
double getMagneticField() const
Get the magnetic field.
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
int nominalValue() const
The nominal field value for this map in kGauss.
int GoodCluster(const BaseParticlePropagator &bpg, const reco::PFClusterCollection &pfc, float minep, bool sec=false)
std::vector< BarrelDetLayer const * > const & barrelLayers() const
auto recHits() const
Access to reconstructed hits on the track.
Global3DPoint GlobalPoint
const TrackerGeometry * tracker_
GlobalVector momentum() const
const DetLayer * detLayer(const TrackerLayer &layer, float zpos) const
const KFUpdator * kfUpdator_
void beginRun(const edm::Run &, const edm::EventSetup &) override
void endRun(const edm::Run &, const edm::EventSetup &) override
virtual ConstReferenceCountingPointer< TangentPlane > tangentPlane(const GlobalPoint &) const =0
void produce(edm::Event &, const edm::EventSetup &) override
std::vector< ConstRecHitPointer > ConstRecHitContainer
std::vector< bool > sharedHits(const std::vector< std::pair< TrajectorySeed, std::pair< GlobalVector, float > > > &)
static int position[264][3]
ConvBremSeedProducer(const edm::ParameterSet &)
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)
std::list< TrackerLayer >::const_iterator cylinderBegin() const
Returns the first pointer in the cylinder list.
unsigned int layerNumber() const
Returns the layer number.
math::XYZVector B_
B field.
Log< level::Error, false > LogError
bool forward() const
Is the layer forward ?
bool isGsfTrack(const reco::Track &, const TrackingRecHit *)
SiStripMatchedRecHit2DCollection::const_iterator MatDetMatch
const_iterator end(bool update=false) const
std::vector< ForwardDetLayer const * > const & posForwardLayers() const
std::vector< const DetLayer * > layerMap_
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
SiPixelRecHitCollection::const_iterator PiDetMatch
T getParameter(std::string const &) const
Power< A, B >::type pow(const A &a, const B &b)
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
const PropagatorWithMaterial * propagator_
const data_type * const_iterator