CMS 3D CMS Logo

GoodSeedProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: PFTracking
4 // Class: GoodSeedProducer
5 //
6 // Original Author: Michele Pioppi
7 // March 2010. F. Beaudette. Produce PreId information
8 
12 
30 
32 
33 #include <fstream>
34 #include <string>
35 #include "TMath.h"
36 #include "Math/VectorUtil.h"
37 
38 using namespace edm;
39 using namespace std;
40 using namespace reco;
41 
43  pfTransformer_(nullptr),
44  conf_(iConfig),
45  resMapEtaECAL_(nullptr),
46  resMapPhiECAL_(nullptr)
47 {
48  LogInfo("GoodSeedProducer")<<"Electron PreIdentification started ";
49 
50  //now do what ever initialization is needed
51  std::vector<edm::InputTag> tags = iConfig.getParameter< vector < InputTag > >("TkColList");
52  for(unsigned int i=0;i<tags.size();++i) {
53  trajContainers_.push_back(consumes<vector<Trajectory> >(tags[i]));
54  tracksContainers_.push_back(consumes<reco::TrackCollection>(tags[i]));
55  }
56 
57  minPt_=iConfig.getParameter<double>("MinPt");
58  maxPt_=iConfig.getParameter<double>("MaxPt");
59  maxEta_=iConfig.getParameter<double>("MaxEta");
60 
61  HcalIsolWindow_ =iConfig.getParameter<double>("HcalWindow");
62  EcalStripSumE_minClusEnergy_ = iConfig.getParameter<double>("EcalStripSumE_minClusEnergy");
63  EcalStripSumE_deltaEta_ = iConfig.getParameter<double>("EcalStripSumE_deltaEta");
64  EcalStripSumE_deltaPhiOverQ_minValue_ = iConfig.getParameter<double>("EcalStripSumE_deltaPhiOverQ_minValue");
65  EcalStripSumE_deltaPhiOverQ_maxValue_ = iConfig.getParameter<double>("EcalStripSumE_deltaPhiOverQ_maxValue");
66  minEoverP_= iConfig.getParameter<double>("EOverPLead_minValue");
67  maxHoverP_= iConfig.getParameter<double>("HOverPLead_maxValue");
68 
69  pfCLusTagECLabel_=consumes<reco::PFClusterCollection>(iConfig.getParameter<InputTag>("PFEcalClusterLabel"));
70 
71  pfCLusTagHCLabel_=consumes<reco::PFClusterCollection>(iConfig.getParameter<InputTag>("PFHcalClusterLabel"));
72 
73  pfCLusTagPSLabel_=consumes<reco::PFClusterCollection>(iConfig.getParameter<InputTag>("PFPSClusterLabel"));
74 
75  preidgsf_ = iConfig.getParameter<string>("PreGsfLabel");
76  preidckf_ = iConfig.getParameter<string>("PreCkfLabel");
77  preidname_= iConfig.getParameter<string>("PreIdLabel");
78 
79 
80  fitterName_ = iConfig.getParameter<string>("Fitter");
81  smootherName_ = iConfig.getParameter<string>("Smoother");
82 
83 
84  nHitsInSeed_=iConfig.getParameter<int>("NHitsInSeed");
85 
86  clusThreshold_=iConfig.getParameter<double>("ClusterThreshold");
87 
88  minEp_=iConfig.getParameter<double>("MinEOverP");
89  maxEp_=iConfig.getParameter<double>("MaxEOverP");
90 
91  //collection to produce
92  produceCkfseed_ = iConfig.getUntrackedParameter<bool>("ProduceCkfSeed",false);
93 
94  // to disable the electron part (for HI collisions for examples)
95  disablePreId_ = iConfig.getUntrackedParameter<bool>("DisablePreId",false);
96 
97  producePreId_ = iConfig.getUntrackedParameter<bool>("ProducePreId",true);
98  // if no electron, cannot produce the preid
99  if(disablePreId_)
100  producePreId_=false;
101  PtThresholdSavePredId_ = iConfig.getUntrackedParameter<double>("PtThresholdSavePreId",1.);
102 
103  LogDebug("GoodSeedProducer")<<"Seeds for GSF will be produced ";
104 
105  // no disablePreId_ switch here. The collection will be empty if it is true
106  produces<ElectronSeedCollection>(preidgsf_);
107 
108  if(produceCkfseed_){
109  LogDebug("GoodSeedProducer")<<"Seeds for CKF will be produced ";
110  produces<TrajectorySeedCollection>(preidckf_);
111  }
112 
113  if(producePreId_){
114  LogDebug("GoodSeedProducer")<<"PreId debugging information will be produced ";
115 
116  produces<PreIdCollection>(preidname_);
117  if(tracksContainers_.size()==1) // do not make a value map if more than one input track collection
118  produces<edm::ValueMap<reco::PreIdRef> >(preidname_);
119  }
120 
121  useQuality_ = iConfig.getParameter<bool>("UseQuality");
122  trackQuality_=TrackBase::qualityByName(iConfig.getParameter<std::string>("TrackQuality"));
123 
124  useTmva_= iConfig.getUntrackedParameter<bool>("UseTMVA",false);
125 
126  Min_dr_ = iConfig.getParameter<double>("Min_dr");
127 
128  trackerRecHitBuilderName_ = iConfig.getParameter<std::string>("TTRHBuilder");
129 
130 }
131 
132 
133 //
134 // member functions
135 //
136 
137 // ------------ method called to produce the data ------------
138 void
140 {
141 
142  LogDebug("GoodSeedProducer")<<"START event: "<<iEvent.id().event()
143  <<" in run "<<iEvent.id().run();
144  //Create empty output collections
145  auto output_preid = std::make_unique<ElectronSeedCollection>();
146  auto output_nopre = std::make_unique<TrajectorySeedCollection>();
147  auto output_preidinfo = std::make_unique<PreIdCollection>();
148  auto preIdMap_p = std::make_unique<edm::ValueMap<reco::PreIdRef>>();
149  edm::ValueMap<reco::PreIdRef>::Filler mapFiller(*preIdMap_p);
150 
151  //Tracking Tools
152  if(!disablePreId_)
153  {
156  iSetup.get<TrajectoryFitter::Record>().get(fitterName_, aFitter);
157  iSetup.get<TrajectoryFitter::Record>().get(smootherName_, aSmoother);
158  smoother_.reset(aSmoother->clone());
159  fitter_ = aFitter->clone();
160  edm::ESHandle<TransientTrackingRecHitBuilder> theTrackerRecHitBuilder;
161  iSetup.get<TransientRecHitRecord>().get(trackerRecHitBuilderName_,theTrackerRecHitBuilder);
162  hitCloner = static_cast<TkTransientTrackingRecHitBuilder const *>(theTrackerRecHitBuilder.product())->cloner();
163  fitter_->setHitCloner(&hitCloner);
164  smoother_->setHitCloner(&hitCloner);
165  }
166 
167  // clear temporary maps
168  refMap_.clear();
169 
170  //Magnetic Field
172  iSetup.get<IdealMagneticFieldRecord>().get(magneticField);
173 
174  //Handle input collections
175  //ECAL clusters
176  Handle<PFClusterCollection> theECPfClustCollection;
177  iEvent.getByToken(pfCLusTagECLabel_,theECPfClustCollection);
178 
179 
180  vector<PFCluster const *> basClus;
181  for ( auto const & klus : *theECPfClustCollection.product() ) {
182  if(klus.correctedEnergy()>clusThreshold_) basClus.push_back(&klus);
183  }
184 
185  //HCAL clusters
186  Handle<PFClusterCollection> theHCPfClustCollection;
187  iEvent.getByToken(pfCLusTagHCLabel_,theHCPfClustCollection);
188 
189  //PS clusters
190  Handle<PFClusterCollection> thePSPfClustCollection;
191  iEvent.getByToken(pfCLusTagPSLabel_,thePSPfClustCollection);
192 
193  //Vector of track collections
194  for (unsigned int istr=0; istr<tracksContainers_.size();++istr){
195 
196  //Track collection
197  Handle<TrackCollection> tkRefCollection;
198  iEvent.getByToken(tracksContainers_[istr], tkRefCollection);
199  const TrackCollection& Tk=*(tkRefCollection.product());
200 
201  LogDebug("GoodSeedProducer")<<"Number of tracks in collection "
202  <<"tracksContainers_[" << istr << "] to be analyzed "
203  <<Tk.size();
204 
205  //loop over the track collection
206  for(unsigned int i=0;i<Tk.size();++i){
207  if (useQuality_ &&
208  (!(Tk[i].quality(trackQuality_)))) continue;
209 
210  reco::PreId myPreId;
211  bool GoodPreId=false;
212 
213  TrackRef trackRef(tkRefCollection, i);
214  math::XYZVectorF tkmom(Tk[i].momentum());
215  auto tketa= tkmom.eta();
216  auto tkpt = std::sqrt(tkmom.perp2());
217  auto const & Seed=(*trackRef->seedRef());
218  if(!disablePreId_)
219  {
220  int ipteta=getBin(Tk[i].eta(),Tk[i].pt());
221  int ibin=ipteta*9;
222 
223  float oPTOB=1.f/std::sqrt(Tk[i].innerMomentum().mag2()); // FIXME the original code was buggy should be outerMomentum...
224  // float chikfred=Tk[i].normalizedChi2();
225  float nchi=Tk[i].normalizedChi2();
226 
227  int nhitpi=Tk[i].found();
228  float EP=0;
229 
230  // set track info
231  myPreId.setTrack(trackRef);
232  //CLUSTERS - TRACK matching
233 
234  auto pfmass= 0.0005;
235  auto pfoutenergy=sqrt((pfmass*pfmass)+Tk[i].outerMomentum().Mag2());
236 
237  XYZTLorentzVector mom =XYZTLorentzVector(Tk[i].outerMomentum().x(),
238  Tk[i].outerMomentum().y(),
239  Tk[i].outerMomentum().z(),
240  pfoutenergy);
241  XYZTLorentzVector pos = XYZTLorentzVector(Tk[i].outerPosition().x(),
242  Tk[i].outerPosition().y(),
243  Tk[i].outerPosition().z(),
244  0.);
245 
246  BaseParticlePropagator theOutParticle( RawParticle(mom,pos, Tk[i].charge()),
247  0,0,B_.z());
248 
249  theOutParticle.propagateToEcalEntrance(false);
250 
251 
252 
253  float toteta=1000.f;
254  float totphi=1000.f;
255  float dr=1000.f;
256  float EE=0.f;
257  float feta=0.f;
258  GlobalPoint ElecTrkEcalPos(0,0,0);
259 
260  PFClusterRef clusterRef;
261  math::XYZPoint meanShowerSaved;
262  if(theOutParticle.getSuccess()!=0){
263  ElecTrkEcalPos=GlobalPoint(theOutParticle.particle().vertex().x(),
264  theOutParticle.particle().vertex().y(),
265  theOutParticle.particle().vertex().z()
266  );
267 
268  constexpr float psLim = 2.50746495928f; // std::sinh(1.65f);
269  bool isBelowPS= (ElecTrkEcalPos.z()*ElecTrkEcalPos.z()) > (psLim*psLim)*ElecTrkEcalPos.perp2();
270  // bool isBelowPS=(std::abs(ElecTrkEcalPos.eta())>1.65f);
271 
272  unsigned clusCounter=0;
273  float max_ee = 0;
274  for(auto aClus : basClus) {
275 
276  float tmp_ep=float(aClus->correctedEnergy())*oPTOB;
277  if ((tmp_ep<minEp_)|(tmp_ep>maxEp_)) { ++clusCounter; continue;}
278 
279  double ecalShowerDepth
280  = PFCluster::getDepthCorrection(aClus->correctedEnergy(),
281  isBelowPS,
282  false);
283  auto mom = theOutParticle.particle().momentum().Vect();
284  auto meanShower = ElecTrkEcalPos +
285  GlobalVector(mom.x(),mom.y(),mom.z()).unit()*ecalShowerDepth;
286 
287  float etarec=meanShower.eta();
288  float phirec=meanShower.phi();
289 
290 
291  float tmp_phi=std::abs(aClus->positionREP().phi()-phirec);
292  if (tmp_phi>float(TMath::Pi())) tmp_phi-= float(TMath::TwoPi());
293 
294  float tmp_dr=std::sqrt(std::pow(tmp_phi,2.f)+
295  std::pow(aClus->positionREP().eta()-etarec,2.f));
296 
297  if (tmp_dr<dr){
298  dr=tmp_dr;
299  if(dr < Min_dr_){ // find the most closest and energetic ECAL cluster
300  if(aClus->correctedEnergy() > max_ee){
301 
302  toteta=aClus->positionREP().eta()-etarec;
303  totphi=tmp_phi;
304  EP=tmp_ep;
305  EE=aClus->correctedEnergy();
306  feta= aClus->positionREP().eta();
307  clusterRef = PFClusterRef(theECPfClustCollection,clusCounter);
308  meanShowerSaved = meanShower;
309 
310  }
311  }
312  }
313  ++clusCounter;
314  }
315  }
316  float trk_ecalDeta_ = fabs(toteta);
317  float trk_ecalDphi_ = fabs(totphi);
318 
319  //Resolution maps
320  auto ecaletares
321  = resMapEtaECAL_->GetBinContent(resMapEtaECAL_->FindBin(feta,EE));
322  auto ecalphires
323  = resMapPhiECAL_->GetBinContent(resMapPhiECAL_->FindBin(feta,EE));
324 
325  //geomatrical compatibility
326  float chieta=(toteta!=1000.f)? toteta/ecaletares : toteta;
327  float chiphi=(totphi!=1000.f)? totphi/ecalphires : totphi;
328  float chichi= sqrt(chieta*chieta + chiphi*chiphi);
329 
330  //Matching criteria
331  float eta_cut = thr[ibin+0];
332  float phi_cut = thr[ibin+1];
333  float ep_cutmin=thr[ibin+2];
334  bool GoodMatching= ((trk_ecalDeta_<eta_cut) && (trk_ecalDphi_<phi_cut) && (EP>ep_cutmin) && (nhitpi>10));
335 
336  bool EcalMatching=GoodMatching;
337 
338  if (tkpt>maxPt_) GoodMatching=true;
339  if (tkpt<minPt_) GoodMatching=false;
340 
341 
342 
343  math::XYZPoint myPoint(ElecTrkEcalPos.x(),ElecTrkEcalPos.y(),ElecTrkEcalPos.z());
344  myPreId.setECALMatchingProperties(clusterRef,myPoint,meanShowerSaved,std::abs(toteta),std::abs(totphi),chieta,
345  chiphi,chichi,EP);
346  myPreId.setECALMatching(EcalMatching);
347 
348 
349  bool GoodRange= ((std::abs(tketa)<maxEta_) &
350  (tkpt>minPt_));
351  //KF FILTERING FOR UNMATCHED EVENTS
352  int hit1max=int(thr[ibin+3]);
353  float chiredmin=thr[ibin+4];
354  bool GoodKFFiltering =
355  ((nchi>chiredmin) | (nhitpi<hit1max));
356 
357 
358  myPreId.setTrackFiltering(GoodKFFiltering);
359 
360  bool GoodTkId= false;
361 
362  if((!GoodMatching) &&(GoodKFFiltering) &&(GoodRange)){
363  chired=1000;
364  chiRatio=1000;
365  dpt=0;
366  nhit=nhitpi;
367  chikfred = nchi;
368  trk_ecalDeta = trk_ecalDeta_;
369  trk_ecalDphi = trk_ecalDphi_;
370 
372  for(auto const& hit : Tk[i].recHits()) tmp.push_back(hit->cloneSH());
373  auto const & theTrack = Tk[i];
374  GlobalVector gv(theTrack.innerMomentum().x(),theTrack.innerMomentum().y(),theTrack.innerMomentum().z());
375  GlobalPoint gp(theTrack.innerPosition().x(),theTrack.innerPosition().y(),theTrack.innerPosition().z());
376  GlobalTrajectoryParameters gtps(gp,gv,theTrack.charge(),&*magneticField);
377  TrajectoryStateOnSurface tsos(gtps,theTrack.innerStateCovariance(),*tmp[0]->surface());
378  Trajectory && FitTjs= fitter_->fitOne(Seed,tmp,tsos);
379 
380  if(FitTjs.isValid()){
381  Trajectory && SmooTjs= smoother_->trajectory(FitTjs);
382  if(SmooTjs.isValid()){
383 
384  //Track refitted with electron hypothesis
385 
386  float pt_out=SmooTjs.firstMeasurement().
387  updatedState().globalMomentum().perp();
388  float pt_in=SmooTjs.lastMeasurement().
389  updatedState().globalMomentum().perp();
390  dpt=(pt_in>0) ? fabs(pt_out-pt_in)/pt_in : 0.;
391  // the following is simply the number of degrees of freedom
392  chiRatio=SmooTjs.chiSquared()/Tk[i].chi2();
394 
395  }
396  }
397 
398 
399  //TMVA Analysis
400  if(useTmva_){
401 
402  eta=tketa;
403  pt=tkpt;
404  eP=EP;
406 
407  float Ytmva = globalCache()->gbr[ipteta]->GetClassifier( vars );
408 
409  float BDTcut=thr[ibin+5];
410  if ( Ytmva>BDTcut) GoodTkId=true;
411  myPreId.setMVA(GoodTkId,Ytmva);
413  }else{
414 
415  float chiratiocut=thr[ibin+6];
416  float gschicut=thr[ibin+7];
417  float gsptmin=thr[ibin+8];
418 
419  GoodTkId=((dpt>gsptmin)&(chired<gschicut)&(chiRatio<chiratiocut));
420 
421  }
422  }
423 
424  GoodPreId= GoodTkId | GoodMatching;
425 
426  myPreId.setFinalDecision(GoodPreId);
427 
428 #ifdef EDM_ML_DEBUG
429  if(GoodPreId)
430  LogDebug("GoodSeedProducer")<<"Track (pt= "<<Tk[i].pt()<<
431  "GeV/c, eta= "<<Tk[i].eta() <<
432  ") preidentified for agreement between track and ECAL cluster";
433  if(GoodPreId &&(!GoodMatching))
434  LogDebug("GoodSeedProducer")<<"Track (pt= "<<Tk[i].pt()<<
435  "GeV/c, eta= "<<Tk[i].eta() <<
436  ") preidentified only for track properties";
437 #endif
438 
439  } // end of !disablePreId_
440 
441 
442  if (GoodPreId){
443  //NEW SEED with n hits
444  ElectronSeed NewSeed(Seed);
445  NewSeed.setCtfTrack(trackRef);
446  output_preid->push_back(NewSeed);
447  }else{
448  if (produceCkfseed_){
449  output_nopre->push_back(Seed);
450  }
451  }
452  if(producePreId_ && myPreId.pt()>PtThresholdSavePredId_)
453  {
454  // save the index of the PreId object as to be able to create a Ref later
455  refMap_[trackRef] = output_preidinfo->size();
456  output_preidinfo->push_back(myPreId);
457  }
458  } //end loop on track collection
459  } //end loop on the vector of track collections
460 
461  // no disablePreId_ switch, it is simpler to have an empty collection rather than no collection
462  iEvent.put(std::move(output_preid),preidgsf_);
463  if (produceCkfseed_)
464  iEvent.put(std::move(output_nopre),preidckf_);
465  if(producePreId_)
466  {
467  const edm::OrphanHandle<reco::PreIdCollection> preIdRefProd = iEvent.put(std::move(output_preidinfo),preidname_);
468  // now make the Value Map, but only if one input collection
469  if(tracksContainers_.size()==1)
470  {
471  Handle<TrackCollection> tkRefCollection ;
472  iEvent.getByToken(tracksContainers_[0],tkRefCollection);
473  fillPreIdRefValueMap(tkRefCollection,preIdRefProd,mapFiller);
474  mapFiller.fill();
475  iEvent.put(std::move(preIdMap_p),preidname_);
476  }
477  }
478  // clear temporary maps
479  refMap_.clear();
480 }
481 
482 // intialize the cross-thread cache to hold gbr trees and resolution maps
483 namespace goodseedhelpers {
484  HeavyObjectCache::HeavyObjectCache( const edm::ParameterSet& conf) {
485  // mvas
486  const bool useTmva = conf.getUntrackedParameter<bool>("UseTMVA",false);
487 
488  if( useTmva ) {
489  std::array<edm::FileInPath,kMaxWeights> weights = {{ edm::FileInPath(conf.getParameter<string>("Weights1")),
490  edm::FileInPath(conf.getParameter<string>("Weights2")),
491  edm::FileInPath(conf.getParameter<string>("Weights3")),
492  edm::FileInPath(conf.getParameter<string>("Weights4")),
493  edm::FileInPath(conf.getParameter<string>("Weights5")),
494  edm::FileInPath(conf.getParameter<string>("Weights6")),
495  edm::FileInPath(conf.getParameter<string>("Weights7")),
496  edm::FileInPath(conf.getParameter<string>("Weights8")),
497  edm::FileInPath(conf.getParameter<string>("Weights9")) }};
498 
499  for(UInt_t j = 0; j < gbr.size(); ++j){
500  gbr[j] = createGBRForest( weights[j] );
501  }
502  }
503  }
504 }
505 
506 // ------------ method called once each job just before starting event loop ------------
507 void
509  const EventSetup& es)
510 {
511  //Magnetic Field
513  es.get<IdealMagneticFieldRecord>().get(magneticField);
514  B_=magneticField->inTesla(GlobalPoint(0,0,0));
515 
516  pfTransformer_.reset( new PFTrackTransformer(B_) );
517  pfTransformer_->OnlyProp();
518 
519  //Resolution maps
520  FileInPath ecalEtaMap(conf_.getParameter<string>("EtaMap"));
521  FileInPath ecalPhiMap(conf_.getParameter<string>("PhiMap"));
522  resMapEtaECAL_.reset( new PFResolutionMap("ECAL_eta",ecalEtaMap.fullPath().c_str()) );
523  resMapPhiECAL_.reset( new PFResolutionMap("ECAL_phi",ecalPhiMap.fullPath().c_str()) );
524 
525  //read threshold
526  FileInPath parFile(conf_.getParameter<string>("ThresholdFile"));
527  ifstream ifs(parFile.fullPath().c_str());
528  for (int iy=0;iy<81;++iy) ifs >> thr[iy];
529 }
530 
531 int
533  int ie=0;
534  int ip=0;
535  if (fabs(eta)<0.8) ie=0;
536  else{ if (fabs(eta)<1.479) ie=1;
537  else ie=2;
538  }
539  if (pt<6) ip=0;
540  else { if (pt<12) ip=1;
541  else ip=2;
542  }
543  int iep= ie*3+ip;
544  LogDebug("GoodSeedProducer")<<"Track pt ="<<pt<<" eta="<<eta<<" bin="<<iep;
545  return iep;
546 }
547 
549  const edm::OrphanHandle<reco::PreIdCollection>& preidhandle,
551 {
552  std::vector<reco::PreIdRef> values;
553 
554  unsigned ntracks=tracks->size();
555  for(unsigned itrack=0;itrack<ntracks;++itrack)
556  {
557  reco::TrackRef theTrackRef(tracks,itrack);
558  std::map<reco::TrackRef,unsigned>::const_iterator itcheck=refMap_.find(theTrackRef);
559  if(itcheck==refMap_.end())
560  {
561  // the track has been early discarded
562  values.push_back(reco::PreIdRef());
563  }
564  else
565  {
566  edm::Ref<reco::PreIdCollection> preIdRef(preidhandle,itcheck->second);
567  values.push_back(preIdRef);
568  // std::cout << " Checking Refs " << (theTrackRef==preIdRef->trackRef()) << std::endl;
569  }
570  }
571  filler.insert(tracks,values.begin(),values.end());
572 }
573 
#define LogDebug(id)
int nHitsInSeed_
Number of hits in the seed;.
RunNumber_t run() const
Definition: EventID.h:39
const double TwoPi
const double Pi
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:41
T getUntrackedParameter(std::string const &, T const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
void setECALMatchingProperties(PFClusterRef clusterRef, const math::XYZPoint &ecalpos, const math::XYZPoint &meanShower, float deta, float dphi, float chieta, float chiphi, float chi2, float eop)
Definition: PreId.h:38
std::string preidckf_
Name of the Seed(Ckf) Collection.
edm::EDGetTokenT< reco::PFClusterCollection > pfCLusTagPSLabel_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
float eP
VARIABLES NEEDED FOR TMVA.
std::unique_ptr< TrajectorySmoother > smoother_
Smoother.
#define nullptr
void insert(const H &h, I begin, I end)
Definition: ValueMap.h:53
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
std::unique_ptr< PFResolutionMap > resMapEtaECAL_
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:15
T y() const
Definition: PV3DBase.h:63
double EcalStripSumE_minClusEnergy_
float thr[150]
vector of thresholds for different bins of eta and pt
T perp2() const
Definition: PV3DBase.h:71
GoodSeedProducer(const edm::ParameterSet &, const goodseedhelpers::HeavyObjectCache *)
TkClonerImpl hitCloner
void setCtfTrack(const CtfTrackRef &)
Set additional info.
Definition: ElectronSeed.cc:35
virtual TrajectorySmoother * clone() const =0
void setTrack(reco::TrackRef trackref)
Definition: PreId.h:34
virtual std::unique_ptr< TrajectoryFitter > clone() const =0
int getBin(float, float)
Find the bin in pt and eta.
int iEvent
Definition: GenABIO.cc:224
std::unique_ptr< TrajectoryFitter > fitter_
Fitter.
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ParameterSet conf_
void setMVA(bool accepted, float mva, unsigned n=0)
Definition: PreId.h:72
double EcalStripSumE_deltaEta_
double EcalStripSumE_deltaPhiOverQ_minValue_
double EcalStripSumE_deltaPhiOverQ_maxValue_
void setTrackFiltering(bool accepted, unsigned n=0)
Definition: PreId.h:68
void produce(edm::Event &, const edm::EventSetup &) override
T sqrt(T t)
Definition: SSEVec.h:18
edm::Ref< PFClusterCollection > PFClusterRef
persistent reference to PFCluster objects
Definition: PFClusterFwd.h:15
math::XYZVector B_
B field.
std::string preidname_
Name of the preid Collection (FB)
TrajectoryMeasurement const & lastMeasurement() const
Definition: Trajectory.h:174
T z() const
Definition: PV3DBase.h:64
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool useQuality_
TRACK QUALITY.
void fillPreIdRefValueMap(edm::Handle< reco::TrackCollection > tkhandle, const edm::OrphanHandle< reco::PreIdCollection > &, edm::ValueMap< reco::PreIdRef >::Filler &filler)
double f[11][100]
double minPt_
Minimum transverse momentum and maximum pseudorapidity.
std::string fitterName_
bool disablePreId_
switch to disable the pre-id
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float > > XYZVectorF
spatial vector with cartesian internal representation
Definition: Vector3D.h:17
void beginRun(const edm::Run &run, const edm::EventSetup &) override
reco::TrackBase::TrackQuality trackQuality_
double clusThreshold_
Cut on the energy of the clusters.
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
bool propagateToEcalEntrance(bool first=true)
bool produceCkfseed_
Produce the Seed for Ckf tracks?
bool isValid() const
Definition: Trajectory.h:279
TrajectoryMeasurement const & firstMeasurement() const
Definition: Trajectory.h:187
float pt() const
Definition: PreId.h:92
T const * product() const
Definition: Handle.h:74
bool useTmva_
USE OF TMVA.
std::unique_ptr< PFResolutionMap > resMapPhiECAL_
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
float chiSquared() const
Definition: Trajectory.h:262
TrackingRecHit::ConstRecHitContainer ConstRecHitContainer
Definition: Trajectory.h:45
std::vector< edm::EDGetTokenT< reco::TrackCollection > > tracksContainers_
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
void setTrackProperties(float newchi2, float chi2ratio, float dpt)
Definition: PreId.h:50
edm::EventID id() const
Definition: EventBase.h:59
fixed size matrix
HLT enums.
void setECALMatching(bool accepted, unsigned n=0)
Definition: PreId.h:60
std::map< reco::TrackRef, unsigned > refMap_
Map used to create the TrackRef, PreIdRef value map.
T get() const
Definition: EventSetup.h:71
bool producePreId_
Produce the pre-id debugging collection.
std::unique_ptr< PFTrackTransformer > pfTransformer_
PFTrackTransformer.
std::string fullPath() const
Definition: FileInPath.cc:163
std::string trackerRecHitBuilderName_
std::string smootherName_
edm::EDGetTokenT< reco::PFClusterCollection > pfCLusTagHCLabel_
vars
Definition: DeepTauId.cc:77
Resolution Map (resolution as a function of eta and E)
T x() const
Definition: PV3DBase.h:62
std::string preidgsf_
Name of the Seed(Gsf) Collection.
T const * product() const
Definition: ESHandle.h:86
edm::EDGetTokenT< reco::PFClusterCollection > pfCLusTagECLabel_
double minEp_
Min and MAx allowed values forEoverP.
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
def move(src, dest)
Definition: eostools.py:511
std::vector< edm::EDGetTokenT< std::vector< Trajectory > > > trajContainers_
#define constexpr
std::unique_ptr< const GBRForest > createGBRForest(const std::string &weightsFile)
Definition: Run.h:45
double PtThresholdSavePredId_
Threshold to save Pre Idinfo.
Global3DVector GlobalVector
Definition: GlobalVector.h:10
void setFinalDecision(bool accepted, unsigned n=0)
Definition: PreId.h:56
math::XYZTLorentzVector XYZTLorentzVector
Definition: RawParticle.h:27