57 produces<ConvBremSeedCollection>();
72 LogDebug(
"ConvBremSeedProducerProducer")<<
"START event: "<<iEvent.
id().
event()
73 <<
" in run "<<iEvent.
id().
run();
99 thePfRecTrackCollection);
108 vector<pair< TrajectorySeed , pair<GlobalVector,float> > > unclean;
110 vector< vector< long int > > tripl;
118 for(
unsigned int ipft=0;ipft<PfRTkColl.size();ipft++){
120 LogDebug(
"ConvBremSeedProducerProducer")<<
"NEW GsfPFRecTRACK ";
126 float pfoutenergy=
sqrt((pfmass*pfmass)+pft->gsfTrackRef()->outerMomentum().Mag2());
128 pft->gsfTrackRef()->outerMomentum().y(),
129 pft->gsfTrackRef()->outerMomentum().z(),
132 pft->gsfTrackRef()->outerPosition().y(),
133 pft->gsfTrackRef()->outerPosition().z(),
137 theOutParticle.
setCharge(pft->gsfTrackRef()->charge());
143 vector<PFBrem> brem =(*pft).PFRecBrem();
144 vector<PFBrem>::iterator
ib=brem.begin();
145 vector<PFBrem>::iterator ib_end=brem.end();
146 LogDebug(
"ConvBremSeedProducerProducer")<<
"NUMBER OF BREMS "<<brem.size();
149 for (;ib!=ib_end;++
ib){
154 pft->trajectoryPoint(ib->indTrajPoint()).
position().x(),
155 pft->trajectoryPoint(ib->indTrajPoint()).
position().y(),
156 pft->trajectoryPoint(ib->indTrajPoint()).
position().z(),
160 if (pos.Rho()>80)
continue;
161 if ((pos.Rho()>5)&&(fabs(ib->SigmaDeltaP()/ib->DeltaP())>3))
continue;
162 if (fabs(ib->DeltaP())<3)
continue;
164 vector< vector< long int > >Idd;
180 if (!(cyliter->sensitive()))
continue;
190 if (&(*tkLayer)==0)
continue;
193 std::vector<DetWithState> compat
195 vector <long int>
temp;
196 if (compat.size()==0)
continue;
198 for (std::vector<DetWithState>::const_iterator
i=compat.begin();
i!=compat.end();
i++) {
200 long int detid=
i->first->geographicalId().rawId();
210 long int DetID=(DetMatch != rphirecHits->end())? detid:0;
212 if ((MDetMatch != matchedrecHits->end()) && !MDetMatch->empty()) {
213 long int pii = MDetMatch->begin()->monoId();
215 DetID=(CDetMatch != rphirecHits->end())? pii:0;
219 temp.push_back(DetID);
224 long int DetID=(DetMatch != pixelHits->end())? detid:0;
225 temp.push_back(DetID);
234 if(Idd.size()<2)
continue;
237 for (
unsigned int i=0;
i<Idd.size()-2;
i++){
238 for (
unsigned int i1=0;i1<Idd[
i].size();i1++){
239 for (
unsigned int i2=0;i2<Idd[
i+1].size();i2++){
240 for (
unsigned int i3=0;i3<Idd[
i+2].size();i3++){
241 if ((Idd[
i][i1]!=0) &&(Idd[
i+1][i2]!=0) &&(Idd[
i+2][i3]!=0) ){
242 vector<long int >
tmp;
243 tmp.push_back(Idd[
i][i1]); tmp.push_back(Idd[
i+1][i2]); tmp.push_back(Idd[
i+2][i3]);
246 for (
unsigned int iv=0;iv<tripl.size();iv++){
247 if((tripl[iv][0]==tmp[0])&&(tripl[iv][1]==tmp[1])&&(tripl[iv][2]==tmp[2])) newTrip=
false;
252 tripl.push_back(tmp);
261 float sineta_brem =sinh(eta_br);
267 float nomField = bfield->nominalValue();
272 for (
unsigned int i=0;
i<tripl.size();
i++){
276 if ((DetMatch1 == rphirecHits->end()) ||
277 (DetMatch2 == rphirecHits->end()) ||
278 (DetMatch3 == rphirecHits->end()) )
continue;
285 toGlobal(it1->localPosition());
291 toGlobal(it2->localPosition());
297 toGlobal(it3->localPosition());
301 FastHelix helix(gp3, gp2, gp1,nomField,&*bfield);
304 float ene=
sqrt(gv_corr.mag2()+(pfmass*pfmass));
318 if (gv.
perp()<0.5)
continue;
320 if (tak1+tak2+tak3>2)
continue;
322 if (bgc==-1)
continue;
324 for (
unsigned int igcc=0; igcc<gc.size(); igcc++){
326 if (bgc==gc[igcc]) clTak=
true;
336 glob_hits.clear(); loc_hits.
clear();
347 for (
int ih=0;ih<3;ih++){
359 updatedState =
kfUpdator_->update(state, *glob_hits[ih]);
366 make_pair(gv_corr,ch)));
376 for (
unsigned int iu=0; iu<unclean.size();iu++){
384 LogDebug(
"ConvBremSeedProducerProducer")<<
"END";
448 std::vector< BarrelDetLayer*> barrelLayers =
450 LogDebug(
"FastTracker") <<
"Barrel DetLayer dump: ";
451 for (std::vector< BarrelDetLayer*>::const_iterator bl=barrelLayers.begin();
452 bl != barrelLayers.end(); ++bl) {
453 LogDebug(
"FastTracker")<<
"radius " << (**bl).specificSurface().radius();
456 std::vector< ForwardDetLayer*> posForwardLayers =
458 LogDebug(
"FastTracker") <<
"Positive Forward DetLayer dump: ";
459 for (std::vector< ForwardDetLayer*>::const_iterator fl=posForwardLayers.begin();
460 fl != posForwardLayers.end(); ++fl) {
462 << (**fl).surface().position().z()
464 << (**fl).specificSurface().innerRadius()
466 << (**fl).specificSurface().outerRadius();
469 const float rTolerance = 1.5;
470 const float zTolerance = 3.;
472 LogDebug(
"FastTracker")<<
"Dump of TrackerInteractionGeometry cylinders:";
478 LogDebug(
"FastTracker") <<
"Famos Layer no " <<
i->layerNumber()
479 <<
" is sensitive? " <<
i->sensitive()
480 <<
" pos " <<
i->surface().position();
481 if (!
i->sensitive())
continue;
485 LogDebug(
"FastTracker") <<
" cylinder radius " << cyl->radius();
488 for (std::vector< BarrelDetLayer*>::const_iterator
489 bl=barrelLayers.begin(); bl != barrelLayers.end(); ++bl) {
491 if (fabs( cyl->radius() - (**bl).specificSurface().radius()) < rTolerance) {
495 LogDebug(
"FastTracker")<<
"Corresponding DetLayer found with radius "
496 << (**bl).specificSurface().radius();
502 LogError(
"FastTracker") <<
"FAILED to find a corresponding DetLayer!";
506 LogDebug(
"FastTracker") <<
" disk radii " << disk->innerRadius()
507 <<
", " << disk->outerRadius();
511 for (std::vector< ForwardDetLayer*>::const_iterator fl=posForwardLayers.begin();
512 fl != posForwardLayers.end(); ++fl) {
513 if (fabs( disk->position().z() - (**fl).surface().position().z()) < zTolerance) {
516 LogDebug(
"FastTracker") <<
"Corresponding DetLayer found with Z pos "
517 << (**fl).surface().position().z()
519 << (**fl).specificSurface().innerRadius()
521 << (**fl).specificSurface().outerRadius();
526 LogError(
"FastTracker") <<
"FAILED to find a corresponding DetLayer!";
558 if (istaken)
continue;
559 if (!((*ib)->isValid()))
continue;
566 pair<GlobalVector,float> > >& unclean){
568 vector<bool> goodseed;
570 if (unclean.size()<2){
571 for (
unsigned int i=0;
i<unclean.size();
i++)
572 goodseed.push_back(
true);
575 for (
unsigned int i=0;
i<unclean.size();
i++)
576 goodseed.push_back(
true);
578 for (
unsigned int iu=0; iu<unclean.size()-1;iu++){
579 if (!goodseed[iu])
continue;
580 for (
unsigned int iu2=iu+1; iu2<unclean.size();iu2++){
581 if (!goodseed[iu])
continue;
582 if (!goodseed[iu2])
continue;
588 unsigned int shar =0;
589 for (;sh!=sh_end;++sh){
593 for (;sh2!=sh2_end;++sh2){
602 if (unclean[iu].
second.first.perp()<unclean[iu2].second.first.perp()) goodseed[iu]=
false;
603 else goodseed[iu2]=
false;
626 for (
unsigned int i =0;
i<pfc.size();
i++ ){
627 float tmp_ep=pfc[
i].energy()/bpg.
momentum().e();
631 float tmp_dr=
sqrt(
pow(tmp_phi,2)+
pow(tmp_eta,2));
632 bool isBet=(tmp_dr<dr);
633 if (sec) isBet=(tmp_phi<df);
634 if ((isBet)&&(tmp_ep>minep)&&(tmp_ep<10)){
642 if (sec) isBad= ((df>0.25) || (de>0.5));
const MagneticField * magfield_
void setCharge(float q)
set the MEASURED charge
T getParameter(std::string const &) const
EventNumber_t event() const
const GeometricSearchTracker * geomSearchTracker_
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
const TransientTrackingRecHitBuilder * hitBuilder_
ConvBremSeedProducer(const edm::ParameterSet &)
SiStripMatchedRecHit2DCollection::const_iterator MatDetMatch
unsigned int layerNumber() const
Returns the layer number.
bool forward() const
Is the layer forward ?
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
ROOT::Math::SMatrixIdentity AlgebraicMatrixID
Global3DPoint GlobalPoint
const PropagatorWithMaterial * propagator_
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
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
const_iterator end() const
Termination of iteration.
std::vector< ConvBremSeed > ConvBremSeedCollection
collectin of ConvBremSeed objects
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
static int position[TOTALCHAMBERS][3]
const_iterator begin() const
Initialize an iterator over the RefVector.
SiPixelRecHitCollection::const_iterator PiDetMatch
const KFUpdator * kfUpdator_
const TrackerInteractionGeometry * geometry_
const MagneticFieldMap * fieldMap_
U second(std::pair< T, U > const &p)
std::vector< BarrelDetLayer * > const & barrelLayers() const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
const XYZTLorentzVector & momentum() const
the momentum fourvector
math::XYZVector B_
B field.
std::vector< GsfPFRecTrack > GsfPFRecTrackCollection
collection of GsfPFRecTrack objects
virtual void produce(edm::Event &, const edm::EventSetup &) override
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool isGsfTrack(const TrackingRecHitRefVector &, const TrackingRecHit *)
recHitContainer::const_iterator const_iterator
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
GlobalVector momentum() const
double Y() const
y of vertex
double Z() const
z of vertex
void setPropagationConditions(const TrackerLayer &, bool firstLoop=true)
double charge() const
get the MEASURED charge
virtual const GeomDet * idToDet(DetId) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
bool propagateToEcalEntrance(bool first=true)
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 > > > &)
virtual ReferenceCountingPointer< TangentPlane > tangentPlane(const GlobalPoint &) const =0
std::vector< ForwardDetLayer * > const & posForwardLayers() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
const DetLayer * detLayer(const TrackerLayer &layer, float zpos) const
T const * product() const
std::list< TrackerLayer >::const_iterator cylinderBegin() const
Returns the first pointer in the cylinder list.
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
virtual void beginRun(const edm::Run &, const edm::EventSetup &) override
T const * product() const
double X() const
x of vertex
virtual void endRun(const edm::Run &, const edm::EventSetup &) override
double getMagneticField() const
Get the magnetic field.
std::vector< std::vector< double > > tmp
SiStripRecHit2DCollection::const_iterator StDetMatch
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()
Power< A, B >::type pow(const A &a, const B &b)
tuple AnalyticalPropagator
math::XYZTLorentzVector XYZTLorentzVector