CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
29 
31 
32 #include <fstream>
33 #include <string>
34 #include "TMath.h"
35 #include "Math/VectorUtil.h"
36 #include "TMVA/MethodBDT.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
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_ptr<ElectronSeedCollection> output_preid(new ElectronSeedCollection);
146  auto_ptr<TrajectorySeedCollection> output_nopre(new TrajectorySeedCollection);
147  auto_ptr<PreIdCollection> output_preidinfo(new PreIdCollection);
148  auto_ptr<edm::ValueMap<reco::PreIdRef> > preIdMap_p(new 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  //Handle input collections
171  //ECAL clusters
172  Handle<PFClusterCollection> theECPfClustCollection;
173  iEvent.getByToken(pfCLusTagECLabel_,theECPfClustCollection);
174 
175 
176  vector<PFCluster const *> basClus;
177  for ( auto const & klus : *theECPfClustCollection.product() ) {
178  if(klus.correctedEnergy()>clusThreshold_) basClus.push_back(&klus);
179  }
180 
181  //HCAL clusters
182  Handle<PFClusterCollection> theHCPfClustCollection;
183  iEvent.getByToken(pfCLusTagHCLabel_,theHCPfClustCollection);
184 
185  //PS clusters
186  Handle<PFClusterCollection> thePSPfClustCollection;
187  iEvent.getByToken(pfCLusTagPSLabel_,thePSPfClustCollection);
188 
189  //Vector of track collections
190  for (unsigned int istr=0; istr<tracksContainers_.size();++istr){
191 
192  //Track collection
193  Handle<TrackCollection> tkRefCollection;
194  iEvent.getByToken(tracksContainers_[istr], tkRefCollection);
195  const TrackCollection& Tk=*(tkRefCollection.product());
196 
197  //Trajectory collection
198  Handle<vector<Trajectory> > tjCollection;
199  iEvent.getByToken(trajContainers_[istr], tjCollection);
200  auto const & Tj=*(tjCollection.product());
201 
202  LogDebug("GoodSeedProducer")<<"Number of tracks in collection "
203  <<tracksContainers_[istr] <<" to be analyzed "
204  <<Tj.size();
205 
206  //loop over the track collection
207  for(unsigned int i=0;i<Tk.size();++i){
208  if (useQuality_ &&
209  (!(Tk[i].quality(trackQuality_)))) continue;
210 
211  reco::PreId myPreId;
212  bool GoodPreId=false;
213 
214  TrackRef trackRef(tkRefCollection, i);
215  // TrajectorySeed Seed=Tj[i].seed();
216  math::XYZVectorF tkmom(Tk[i].momentum());
217  auto tketa= tkmom.eta();
218  auto tkpt = std::sqrt(tkmom.perp2());
219  auto const & Seed=(*trackRef->seedRef());
220  if(!disablePreId_)
221  {
222  int ipteta=getBin(Tk[i].eta(),Tk[i].pt());
223  int ibin=ipteta*9;
224 
225  float oPTOB=1.f/Tj[i].lastMeasurement().updatedState().globalMomentum().mag();
226  // float chikfred=Tk[i].normalizedChi2();
227  float nchi=Tk[i].normalizedChi2();
228 
229  int nhitpi=Tj[i].foundHits();
230  float EP=0;
231 
232  // set track info
233  myPreId.setTrack(trackRef);
234  //CLUSTERS - TRACK matching
235 
236  auto pfmass= 0.0005;
237  auto pfoutenergy=sqrt((pfmass*pfmass)+Tk[i].outerMomentum().Mag2());
238 
239  XYZTLorentzVector mom =XYZTLorentzVector(Tk[i].outerMomentum().x(),
240  Tk[i].outerMomentum().y(),
241  Tk[i].outerMomentum().z(),
242  pfoutenergy);
243  XYZTLorentzVector pos = XYZTLorentzVector(Tk[i].outerPosition().x(),
244  Tk[i].outerPosition().y(),
245  Tk[i].outerPosition().z(),
246  0.);
247 
248  BaseParticlePropagator theOutParticle( RawParticle(mom,pos),
249  0,0,B_.z());
250  theOutParticle.setCharge(Tk[i].charge());
251 
252  theOutParticle.propagateToEcalEntrance(false);
253 
254 
255 
256  float toteta=1000.f;
257  float totphi=1000.f;
258  float dr=1000.f;
259  float EE=0.f;
260  float feta=0.f;
261  GlobalPoint ElecTrkEcalPos(0,0,0);
262 
263  PFClusterRef clusterRef;
264  math::XYZPoint meanShowerSaved;
265  if(theOutParticle.getSuccess()!=0){
266  ElecTrkEcalPos=GlobalPoint(theOutParticle.vertex().x(),
267  theOutParticle.vertex().y(),
268  theOutParticle.vertex().z()
269  );
270 
271  constexpr float psLim = 2.50746495928f; // std::sinh(1.65f);
272  bool isBelowPS= (ElecTrkEcalPos.z()*ElecTrkEcalPos.z()) > (psLim*psLim)*ElecTrkEcalPos.perp2();
273  // bool isBelowPS=(std::abs(ElecTrkEcalPos.eta())>1.65f);
274 
275  unsigned clusCounter=0;
276  float max_ee = 0;
277  for(auto aClus : basClus) {
278 
279  float tmp_ep=float(aClus->correctedEnergy())*oPTOB;
280  if ((tmp_ep<minEp_)|(tmp_ep>maxEp_)) { ++clusCounter; continue;}
281 
282  double ecalShowerDepth
283  = PFCluster::getDepthCorrection(aClus->correctedEnergy(),
284  isBelowPS,
285  false);
286  auto mom = theOutParticle.momentum().Vect();
287  auto meanShower = ElecTrkEcalPos +
288  GlobalVector(mom.x(),mom.y(),mom.z()).unit()*ecalShowerDepth;
289 
290  float etarec=meanShower.eta();
291  float phirec=meanShower.phi();
292 
293 
294  float tmp_phi=std::abs(aClus->positionREP().phi()-phirec);
295  if (tmp_phi>float(TMath::Pi())) tmp_phi-= float(TMath::TwoPi());
296 
297  float tmp_dr=std::sqrt(std::pow(tmp_phi,2.f)+
298  std::pow(aClus->positionREP().eta()-etarec,2.f));
299 
300  if (tmp_dr<dr){
301  dr=tmp_dr;
302  if(dr < Min_dr_){ // find the most closest and energetic ECAL cluster
303  if(aClus->correctedEnergy() > max_ee){
304 
305  toteta=aClus->positionREP().eta()-etarec;
306  totphi=tmp_phi;
307  EP=tmp_ep;
308  EE=aClus->correctedEnergy();
309  feta= aClus->positionREP().eta();
310  clusterRef = PFClusterRef(theECPfClustCollection,clusCounter);
311  meanShowerSaved = meanShower;
312 
313  }
314  }
315  }
316  ++clusCounter;
317  }
318  }
319  float trk_ecalDeta_ = fabs(toteta);
320  float trk_ecalDphi_ = fabs(totphi);
321 
322  //Resolution maps
323  auto ecaletares
324  = resMapEtaECAL_->GetBinContent(resMapEtaECAL_->FindBin(feta,EE));
325  auto ecalphires
326  = resMapPhiECAL_->GetBinContent(resMapPhiECAL_->FindBin(feta,EE));
327 
328  //geomatrical compatibility
329  float chieta=(toteta!=1000.f)? toteta/ecaletares : toteta;
330  float chiphi=(totphi!=1000.f)? totphi/ecalphires : totphi;
331  float chichi= sqrt(chieta*chieta + chiphi*chiphi);
332 
333  //Matching criteria
334  float eta_cut = thr[ibin+0];
335  float phi_cut = thr[ibin+1];
336  float ep_cutmin=thr[ibin+2];
337  bool GoodMatching= ((trk_ecalDeta_<eta_cut) && (trk_ecalDphi_<phi_cut) && (EP>ep_cutmin) && (nhitpi>10));
338 
339  bool EcalMatching=GoodMatching;
340 
341  if (tkpt>maxPt_) GoodMatching=true;
342  if (tkpt<minPt_) GoodMatching=false;
343 
344 
345 
346  math::XYZPoint myPoint(ElecTrkEcalPos.x(),ElecTrkEcalPos.y(),ElecTrkEcalPos.z());
347  myPreId.setECALMatchingProperties(clusterRef,myPoint,meanShowerSaved,std::abs(toteta),std::abs(totphi),chieta,
348  chiphi,chichi,EP);
349  myPreId.setECALMatching(EcalMatching);
350 
351 
352  bool GoodRange= ((std::abs(tketa)<maxEta_) &
353  (tkpt>minPt_));
354  //KF FILTERING FOR UNMATCHED EVENTS
355  int hit1max=int(thr[ibin+3]);
356  float chiredmin=thr[ibin+4];
357  bool GoodKFFiltering =
358  ((nchi>chiredmin) | (nhitpi<hit1max));
359 
360 
361  myPreId.setTrackFiltering(GoodKFFiltering);
362 
363  bool GoodTkId= false;
364 
365  if((!GoodMatching) &&(GoodKFFiltering) &&(GoodRange)){
366  chired=1000;
367  chiRatio=1000;
368  dpt=0;
369  nhit=nhitpi;
370  chikfred = nchi;
371  trk_ecalDeta = trk_ecalDeta_;
372  trk_ecalDphi = trk_ecalDphi_;
373 
375  Trajectory::ConstRecHitContainer && hits=Tj[i].recHits();
376  for (int ih=hits.size()-1; ih>=0; ih--) tmp.push_back(hits[ih]);
377  Trajectory && FitTjs= fitter_->fitOne(Seed,tmp,Tj[i].lastMeasurement().updatedState());
378 
379  if(FitTjs.isValid()){
380  Trajectory && SmooTjs= smoother_->trajectory(FitTjs);
381  if(SmooTjs.isValid()){
382 
383  //Track refitted with electron hypothesis
384 
385  float pt_out=SmooTjs.firstMeasurement().
386  updatedState().globalMomentum().perp();
387  float pt_in=SmooTjs.lastMeasurement().
388  updatedState().globalMomentum().perp();
389  dpt=(pt_in>0) ? fabs(pt_out-pt_in)/pt_in : 0.;
390  // the following is simply the number of degrees of freedom
391  chiRatio=SmooTjs.chiSquared()/Tj[i].chiSquared();
393 
394  }
395  }
396 
397 
398  //TMVA Analysis
399  if(useTmva_){
400 
401  eta=tketa;
402  pt=tkpt;
403  eP=EP;
404  float vars[10] = { nhit, chikfred, dpt, eP, chiRatio, chired, trk_ecalDeta, trk_ecalDphi, pt, eta};
405 
406  float Ytmva = globalCache()->gbr[ipteta]->GetClassifier( vars );
407 
408  float BDTcut=thr[ibin+5];
409  if ( Ytmva>BDTcut) GoodTkId=true;
410  myPreId.setMVA(GoodTkId,Ytmva);
412  }else{
413 
414  float chiratiocut=thr[ibin+6];
415  float gschicut=thr[ibin+7];
416  float gsptmin=thr[ibin+8];
417 
418  GoodTkId=((dpt>gsptmin)&(chired<gschicut)&(chiRatio<chiratiocut));
419 
420  }
421  }
422 
423  GoodPreId= GoodTkId | GoodMatching;
424 
425  myPreId.setFinalDecision(GoodPreId);
426 
427  if(GoodPreId)
428  LogDebug("GoodSeedProducer")<<"Track (pt= "<<Tk[i].pt()<<
429  "GeV/c, eta= "<<Tk[i].eta() <<
430  ") preidentified for agreement between track and ECAL cluster";
431  if(GoodPreId &&(!GoodMatching))
432  LogDebug("GoodSeedProducer")<<"Track (pt= "<<Tk[i].pt()<<
433  "GeV/c, eta= "<<Tk[i].eta() <<
434  ") preidentified only for track properties";
435 
436  } // end of !disablePreId_
437 
438  if (GoodPreId){
439  //NEW SEED with n hits
440  ElectronSeed NewSeed(Seed);
441  NewSeed.setCtfTrack(trackRef);
442  output_preid->push_back(NewSeed);
443  }else{
444  if (produceCkfseed_){
445  output_nopre->push_back(Seed);
446  }
447  }
448  if(producePreId_ && myPreId.pt()>PtThresholdSavePredId_)
449  {
450  // save the index of the PreId object as to be able to create a Ref later
451  refMap_[trackRef] = output_preidinfo->size();
452  output_preidinfo->push_back(myPreId);
453  }
454  } //end loop on track collection
455  } //end loop on the vector of track collections
456 
457  // no disablePreId_ switch, it is simpler to have an empty collection rather than no collection
458  iEvent.put(output_preid,preidgsf_);
459  if (produceCkfseed_)
460  iEvent.put(output_nopre,preidckf_);
461  if(producePreId_)
462  {
463  const edm::OrphanHandle<reco::PreIdCollection> preIdRefProd = iEvent.put(output_preidinfo,preidname_);
464  // now make the Value Map, but only if one input collection
465  if(tracksContainers_.size()==1)
466  {
467  Handle<TrackCollection> tkRefCollection ;
468  iEvent.getByToken(tracksContainers_[0],tkRefCollection);
469  fillPreIdRefValueMap(tkRefCollection,preIdRefProd,mapFiller);
470  mapFiller.fill();
471  iEvent.put(preIdMap_p,preidname_);
472  }
473  }
474  // clear temporary maps
475  refMap_.clear();
476 }
477 
478 // intialize the cross-thread cache to hold gbr trees and resolution maps
479 namespace goodseedhelpers {
481  // mvas
482  const bool useTmva = conf.getUntrackedParameter<bool>("UseTMVA",false);
483 
484  if( useTmva ) {
485  const std::string method_ = conf.getParameter<string>("TMVAMethod");
486  std::array<edm::FileInPath,kMaxWeights> weights = {{ edm::FileInPath(conf.getParameter<string>("Weights1")),
487  edm::FileInPath(conf.getParameter<string>("Weights2")),
488  edm::FileInPath(conf.getParameter<string>("Weights3")),
489  edm::FileInPath(conf.getParameter<string>("Weights4")),
490  edm::FileInPath(conf.getParameter<string>("Weights5")),
491  edm::FileInPath(conf.getParameter<string>("Weights6")),
492  edm::FileInPath(conf.getParameter<string>("Weights7")),
493  edm::FileInPath(conf.getParameter<string>("Weights8")),
494  edm::FileInPath(conf.getParameter<string>("Weights9")) }};
495 
496  for(UInt_t j = 0; j < gbr.size(); ++j){
497  TMVA::Reader reader("!Color:Silent");
498 
499  reader.AddVariable("NHits", &nhit);
500  reader.AddVariable("NormChi", &chikfred);
501  reader.AddVariable("dPtGSF", &dpt);
502  reader.AddVariable("EoP", &eP);
503  reader.AddVariable("ChiRatio", &chiRatio);
504  reader.AddVariable("RedChi", &chired);
505  reader.AddVariable("EcalDEta", &trk_ecalDeta);
506  reader.AddVariable("EcalDPhi", &trk_ecalDphi);
507  reader.AddVariable("pt", &pt);
508  reader.AddVariable("eta", &eta);
509 
510  std::unique_ptr<TMVA::IMethod> temp( reader.BookMVA(method_, weights[j].fullPath().c_str()) );
511 
512  gbr[j].reset( new GBRForest( dynamic_cast<TMVA::MethodBDT*>( reader.FindMVA(method_) ) ) );
513  }
514  }
515  }
516 }
517 
518 // ------------ method called once each job just before starting event loop ------------
519 void
521  const EventSetup& es)
522 {
523  //Magnetic Field
525  es.get<IdealMagneticFieldRecord>().get(magneticField);
526  B_=magneticField->inTesla(GlobalPoint(0,0,0));
527 
528  pfTransformer_.reset( new PFTrackTransformer(B_) );
529  pfTransformer_->OnlyProp();
530 
531  //Resolution maps
532  FileInPath ecalEtaMap(conf_.getParameter<string>("EtaMap"));
533  FileInPath ecalPhiMap(conf_.getParameter<string>("PhiMap"));
534  resMapEtaECAL_.reset( new PFResolutionMap("ECAL_eta",ecalEtaMap.fullPath().c_str()) );
535  resMapPhiECAL_.reset( new PFResolutionMap("ECAL_phi",ecalPhiMap.fullPath().c_str()) );
536 
537  //read threshold
538  FileInPath parFile(conf_.getParameter<string>("ThresholdFile"));
539  ifstream ifs(parFile.fullPath().c_str());
540  for (int iy=0;iy<81;++iy) ifs >> thr[iy];
541 }
542 
543 int
545  int ie=0;
546  int ip=0;
547  if (fabs(eta)<0.8) ie=0;
548  else{ if (fabs(eta)<1.479) ie=1;
549  else ie=2;
550  }
551  if (pt<6) ip=0;
552  else { if (pt<12) ip=1;
553  else ip=2;
554  }
555  int iep= ie*3+ip;
556  LogDebug("GoodSeedProducer")<<"Track pt ="<<pt<<" eta="<<eta<<" bin="<<iep;
557  return iep;
558 }
559 
561  const edm::OrphanHandle<reco::PreIdCollection>& preidhandle,
563 {
564  std::vector<reco::PreIdRef> values;
565 
566  unsigned ntracks=tracks->size();
567  for(unsigned itrack=0;itrack<ntracks;++itrack)
568  {
569  reco::TrackRef theTrackRef(tracks,itrack);
570  std::map<reco::TrackRef,unsigned>::const_iterator itcheck=refMap_.find(theTrackRef);
571  if(itcheck==refMap_.end())
572  {
573  // the track has been early discarded
574  values.push_back(reco::PreIdRef());
575  }
576  else
577  {
578  edm::Ref<reco::PreIdCollection> preIdRef(preidhandle,itcheck->second);
579  values.push_back(preIdRef);
580  // std::cout << " Checking Refs " << (theTrackRef==preIdRef->trackRef()) << std::endl;
581  }
582  }
583  filler.insert(tracks,values.begin(),values.end());
584 }
585 
#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
void setCharge(float q)
set the MEASURED charge
Definition: RawParticle.cc:139
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:41
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
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::vector< reco::PreId > PreIdCollection
Definition: PreIdFwd.h:6
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:462
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
float eP
VARIABLES NEEDED FOR TMVA.
std::unique_ptr< TrajectorySmoother > smoother_
Smoother.
void insert(const H &h, I begin, I end)
Definition: ValueMap.h:52
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
std::unique_ptr< PFResolutionMap > resMapEtaECAL_
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
T y() const
Definition: PV3DBase.h:63
tuple magneticField
double EcalStripSumE_minClusEnergy_
float thr[150]
vector of thresholds for different bins of eta and pt
T perp2() const
Definition: PV3DBase.h:71
#define nullptr
GoodSeedProducer(const edm::ParameterSet &, const goodseedhelpers::HeavyObjectCache *)
#define constexpr
TkClonerImpl hitCloner
void setCtfTrack(const CtfTrackRef &)
Set additional info.
Definition: ElectronSeed.cc:64
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
void setTrack(reco::TrackRef trackref)
Definition: PreId.h:34
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
int getBin(float, float)
Find the bin in pt and eta.
int iEvent
Definition: GenABIO.cc:230
std::unique_ptr< TrajectoryFitter > fitter_
Fitter.
edm::ParameterSet conf_
void setMVA(bool accepted, float mva, unsigned n=0)
Definition: PreId.h:72
HeavyObjectCache(const edm::ParameterSet &conf)
double EcalStripSumE_deltaEta_
double EcalStripSumE_deltaPhiOverQ_minValue_
std::vector< TrajectorySeed > TrajectorySeedCollection
double EcalStripSumE_deltaPhiOverQ_maxValue_
void setTrackFiltering(bool accepted, unsigned n=0)
Definition: PreId.h:68
virtual void produce(edm::Event &, const edm::EventSetup &) override
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
string unit
Definition: csvLumiCalc.py:46
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:228
T z() const
Definition: PV3DBase.h:64
std::array< std::unique_ptr< const GBRForest >, kMaxWeights > gbr
TypeLabelItem const & produces()
declare what type of product will make and with which optional label
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int j
Definition: DBlmapReader.cc:9
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_
std::vector< ElectronSeed > ElectronSeedCollection
collection of ElectronSeed objects
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
virtual void beginRun(const edm::Run &run, const edm::EventSetup &) override
reco::TrackBase::TrackQuality trackQuality_
double clusThreshold_
Cut on the energy of the clusters.
tuple tags
Definition: o2o.py:248
bool produceCkfseed_
Produce the Seed for Ckf tracks?
bool isValid() const
Definition: Trajectory.h:324
TrajectoryMeasurement const & firstMeasurement() const
Definition: Trajectory.h:241
float pt() const
Definition: PreId.h:92
T const * product() const
Definition: Handle.h:81
bool useTmva_
USE OF TMVA.
tuple tracks
Definition: testEve_cfg.py:39
std::unique_ptr< PFResolutionMap > resMapPhiECAL_
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
float chiSquared() const
Definition: Trajectory.h:307
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
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.
bool producePreId_
Produce the pre-id debugging collection.
std::unique_ptr< PFTrackTransformer > pfTransformer_
PFTrackTransformer.
std::string trackerRecHitBuilderName_
std::string smootherName_
edm::EDGetTokenT< reco::PFClusterCollection > pfCLusTagHCLabel_
std::string fullPath() const
Definition: FileInPath.cc:184
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.
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
std::vector< edm::EDGetTokenT< std::vector< Trajectory > > > trajContainers_
Definition: Run.h:43
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:15