59 produces<ConvBremSeedCollection>();
74 LogDebug(
"ConvBremSeedProducerProducer")<<
"START event: "<<iEvent.
id().
event()
75 <<
" in run "<<iEvent.
id().
run();
101 thePfRecTrackCollection);
106 auto output = std::make_unique<ConvBremSeedCollection>();
110 vector<pair< TrajectorySeed , pair<GlobalVector,float> > > unclean;
112 vector< vector< long int > > tripl;
120 for(
unsigned int ipft=0;ipft<PfRTkColl.size();ipft++){
122 LogDebug(
"ConvBremSeedProducerProducer")<<
"NEW GsfPFRecTRACK ";
127 auto const & gsfRecHits = *pft->gsfTrackRef();
128 float pfoutenergy=
sqrt((pfmass*pfmass)+pft->gsfTrackRef()->outerMomentum().Mag2());
130 pft->gsfTrackRef()->outerMomentum().y(),
131 pft->gsfTrackRef()->outerMomentum().z(),
134 pft->gsfTrackRef()->outerPosition().y(),
135 pft->gsfTrackRef()->outerPosition().z(),
144 vector<PFBrem> brem =(*pft).PFRecBrem();
145 vector<PFBrem>::iterator
ib=brem.begin();
146 vector<PFBrem>::iterator ib_end=brem.end();
147 LogDebug(
"ConvBremSeedProducerProducer")<<
"NUMBER OF BREMS "<<brem.size();
150 for (;ib!=ib_end;++
ib){
155 pft->trajectoryPoint(ib->indTrajPoint()).
position().x(),
156 pft->trajectoryPoint(ib->indTrajPoint()).
position().y(),
157 pft->trajectoryPoint(ib->indTrajPoint()).
position().z(),
161 if (pos.Rho()>80)
continue;
162 if ((pos.Rho()>5)&&(fabs(ib->SigmaDeltaP()/ib->DeltaP())>3))
continue;
163 if (fabs(ib->DeltaP())<3)
continue;
165 vector< vector< long int > >Idd;
180 if (!(cyliter->sensitive()))
continue;
190 if (&(*tkLayer)==
nullptr)
continue;
193 std::vector<DetWithState> compat
195 vector <long int>
temp;
196 if (compat.empty())
continue;
198 for (std::vector<DetWithState>::const_iterator
i=compat.begin();
i!=compat.end();
i++) {
200 long int detid=
i->first->geographicalId().rawId();
209 long int DetID=(DetMatch != rphirecHits->
end())? detid:0;
211 if ((MDetMatch != matchedrecHits->
end()) && !MDetMatch->empty()) {
212 long int pii = MDetMatch->begin()->monoId();
214 DetID=(CDetMatch != rphirecHits->
end())? pii:0;
218 temp.push_back(DetID);
223 long int DetID=(DetMatch != pixelHits->
end())? detid:0;
224 temp.push_back(DetID);
233 if(Idd.size()<2)
continue;
236 for (
unsigned int i=0;
i<Idd.size()-2;
i++){
237 for (
unsigned int i1=0;i1<Idd[
i].size();i1++){
238 for (
unsigned int i2=0;i2<Idd[
i+1].size();i2++){
239 for (
unsigned int i3=0;i3<Idd[
i+2].size();i3++){
240 if ((Idd[
i][i1]!=0) &&(Idd[
i+1][i2]!=0) &&(Idd[
i+2][i3]!=0) ){
241 vector<long int >
tmp;
242 tmp.push_back(Idd[
i][i1]); tmp.push_back(Idd[
i+1][i2]); tmp.push_back(Idd[
i+2][i3]);
245 for (
unsigned int iv=0;iv<tripl.size();iv++){
246 if((tripl[iv][0]==tmp[0])&&(tripl[iv][1]==tmp[1])&&(tripl[iv][2]==tmp[2])) newTrip=
false;
251 tripl.push_back(tmp);
260 float sineta_brem =sinh(eta_br);
271 for (
unsigned int i=0;
i<tripl.size();
i++){
275 if ((DetMatch1 == rphirecHits->
end()) ||
276 (DetMatch2 == rphirecHits->
end()) ||
277 (DetMatch3 == rphirecHits->
end()) )
continue;
284 toGlobal(it1->localPosition());
290 toGlobal(it2->localPosition());
296 toGlobal(it3->localPosition());
300 FastHelix helix(gp3, gp2, gp1,nomField,&*bfield);
303 float ene=
sqrt(gv_corr.mag2()+(pfmass*pfmass));
316 if (gv.
perp()<0.5)
continue;
318 if (tak1+tak2+tak3>2)
continue;
320 if (bgc==-1)
continue;
322 for (
unsigned int igcc=0; igcc<gc.size(); igcc++){
324 if (bgc==gc[igcc]) clTak=
true;
334 glob_hits.clear(); loc_hits.
clear();
345 for (
int ih=0;ih<3;ih++){
364 make_pair(gv_corr,ch)));
374 for (
unsigned int iu=0; iu<unclean.size();iu++){
382 LogDebug(
"ConvBremSeedProducerProducer")<<
"END";
446 const std::vector< const BarrelDetLayer*>& barrelLayers =
448 LogDebug(
"FastTracker") <<
"Barrel DetLayer dump: ";
449 for (
auto bl=barrelLayers.begin();
450 bl != barrelLayers.end(); ++bl) {
451 LogDebug(
"FastTracker")<<
"radius " << (**bl).specificSurface().radius();
454 const std::vector< const ForwardDetLayer*>& posForwardLayers =
456 LogDebug(
"FastTracker") <<
"Positive Forward DetLayer dump: ";
457 for (
auto fl=posForwardLayers.begin();
458 fl != posForwardLayers.end(); ++fl) {
460 << (**fl).surface().position().z()
462 << (**fl).specificSurface().innerRadius()
464 << (**fl).specificSurface().outerRadius();
467 const float rTolerance = 1.5;
468 const float zTolerance = 3.;
470 LogDebug(
"FastTracker")<<
"Dump of TrackerInteractionGeometry cylinders:";
476 LogDebug(
"FastTracker") <<
"Famos Layer no " <<
i->layerNumber()
477 <<
" is sensitive? " <<
i->sensitive()
478 <<
" pos " <<
i->surface().position();
479 if (!
i->sensitive())
continue;
481 if (cyl !=
nullptr) {
483 LogDebug(
"FastTracker") <<
" cylinder radius " << cyl->radius();
487 bl=barrelLayers.begin(); bl != barrelLayers.end(); ++bl) {
489 if (fabs( cyl->radius() - (**bl).specificSurface().radius()) < rTolerance) {
493 LogDebug(
"FastTracker")<<
"Corresponding DetLayer found with radius " 494 << (**bl).specificSurface().radius();
500 LogError(
"FastTracker") <<
"FAILED to find a corresponding DetLayer!";
504 LogDebug(
"FastTracker") <<
" disk radii " << disk->innerRadius()
505 <<
", " << disk->outerRadius();
509 for (
auto fl=posForwardLayers.begin();
510 fl != posForwardLayers.end(); ++fl) {
511 if (fabs( disk->position().z() - (**fl).surface().position().z()) < zTolerance) {
514 LogDebug(
"FastTracker") <<
"Corresponding DetLayer found with Z pos " 515 << (**fl).surface().position().z()
517 << (**fl).specificSurface().innerRadius()
519 << (**fl).specificSurface().outerRadius();
524 LogError(
"FastTracker") <<
"FAILED to find a corresponding DetLayer!";
553 if (istaken || !
hit->isValid())
continue;
559 pair<GlobalVector,float> > >& unclean){
561 vector<bool> goodseed;
563 if (unclean.size()<2){
564 for (
unsigned int i=0;
i<unclean.size();
i++)
565 goodseed.push_back(
true);
568 for (
unsigned int i=0;
i<unclean.size();
i++)
569 goodseed.push_back(
true);
571 for (
unsigned int iu=0; iu<unclean.size()-1;iu++){
572 if (!goodseed[iu])
continue;
573 for (
unsigned int iu2=iu+1; iu2<unclean.size();iu2++){
574 if (!goodseed[iu])
continue;
575 if (!goodseed[iu2])
continue;
581 unsigned int shar =0;
582 for (;sh!=sh_end;++sh){
586 for (;sh2!=sh2_end;++sh2){
595 if (unclean[iu].
second.first.perp()<unclean[iu2].second.first.perp()) goodseed[iu]=
false;
596 else goodseed[iu2]=
false;
619 for (
unsigned int i =0;
i<pfc.size();
i++ ){
624 float tmp_dr=
sqrt(
pow(tmp_phi,2)+
pow(tmp_eta,2));
625 bool isBet=(tmp_dr<
dr);
626 if (sec) isBet=(tmp_phi<df);
627 if ((isBet)&&(tmp_ep>minep)&&(tmp_ep<10)){
635 if (sec) isBad= ((df>0.25) || (de>0.5));
const MagneticField * magfield_
T getParameter(std::string const &) const
EventNumber_t event() const
const GeometricSearchTracker * geomSearchTracker_
const TransientTrackingRecHitBuilder * hitBuilder_
~ConvBremSeedProducer() override
ConvBremSeedProducer(const edm::ParameterSet &)
const_iterator end(bool update=false) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
virtual ConstReferenceCountingPointer< TangentPlane > tangentPlane(const GlobalPoint &) const =0
SiStripMatchedRecHit2DCollection::const_iterator MatDetMatch
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::vector< ForwardDetLayer const * > const & posForwardLayers() const
unsigned int layerNumber() const
Returns the layer number.
int nominalValue() const
The nominal field value for this map in kGauss.
bool forward() const
Is the layer forward ?
ROOT::Math::SMatrixIdentity AlgebraicMatrixID
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
Global3DPoint GlobalPoint
const PropagatorWithMaterial * propagator_
std::list< TrackerLayer >::const_iterator cylinderEnd() const
Returns the last pointer in the cylinder list.
int getSuccess() const
Has propagation been performed and was barrel or endcap reached ?
TrajectoryStateOnSurface makeTrajectoryState(const DetLayer *layer, const ParticlePropagator &pp, const MagneticField *field) const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
data_type const * const_iterator
RawParticle const & particle() const
The particle being propagated.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const Plane & surface() const
The nominal surface of the GeomDet.
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
SiPixelRecHitCollection::const_iterator PiDetMatch
const KFUpdator * kfUpdator_
const TrackerInteractionGeometry * geometry_
const MagneticFieldMap * fieldMap_
U second(std::pair< T, U > const &p)
bool isGsfTrack(const reco::Track &, const TrackingRecHit *)
TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const override
const XYZTLorentzVector & momentum() const
the momentum fourvector
math::XYZVector B_
B field.
std::vector< GsfPFRecTrack > GsfPFRecTrackCollection
collection of GsfPFRecTrack objects
void produce(edm::Event &, const edm::EventSetup &) override
recHitContainer::const_iterator const_iterator
GlobalVector momentum() const
double Y() const
y of vertex
double Py() const
y of the momentum
double Z() const
z of vertex
auto recHits() const
Access to reconstructed hits on the track.
void setPropagationConditions(const TrackerLayer &, bool firstLoop=true)
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
double Pz() const
z of the momentum
double charge() const
get the MEASURED charge
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
bool propagateToEcalEntrance(bool first=true)
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
std::vector< const DetLayer * > layerMap_
GlobalPoint position() const
std::vector< ConstRecHitPointer > ConstRecHitContainer
const XYZTLorentzVector & vertex() const
the vertex fourvector
std::vector< bool > sharedHits(const std::vector< std::pair< TrajectorySeed, std::pair< GlobalVector, float > > > &)
T const * product() const
const DetLayer * detLayer(const TrackerLayer &layer, float zpos) const
std::list< TrackerLayer >::const_iterator cylinderBegin() const
Returns the first pointer in the cylinder list.
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
void beginRun(const edm::Run &, const edm::EventSetup &) override
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
double X() const
x of vertex
void endRun(const edm::Run &, const edm::EventSetup &) override
double getMagneticField() const
Get the magnetic field.
std::vector< std::vector< double > > tmp
static int position[264][3]
double Px() const
x of the momentum
SiStripRecHit2DCollection::const_iterator StDetMatch
const TrackerGeomDet * idToDet(DetId) const override
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
GlobalTrajectoryParameters stateAtVertex() const
int GoodCluster(const BaseParticlePropagator &bpg, const reco::PFClusterCollection &pfc, float minep, bool sec=false)
const TrackerGeometry * tracker_
TrackCharge charge() const
void initializeLayerMap()
T const * product() const
Power< A, B >::type pow(const A &a, const B &b)
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)
math::XYZTLorentzVector XYZTLorentzVector
std::vector< BarrelDetLayer const * > const & barrelLayers() const