CMS 3D CMS Logo

VirtualJetProducer.cc
Go to the documentation of this file.
1 //
3 // VirtualJetProducer
4 // ------------------
5 //
6 // 04/21/2009 Philipp Schieferdecker <philipp.schieferdecker@cern.ch>
8 
14 
18 
27 
42 
43 #include "fastjet/SISConePlugin.hh"
44 #include "fastjet/CMSIterativeConePlugin.hh"
45 #include "fastjet/ATLASConePlugin.hh"
46 #include "fastjet/CDFMidPointPlugin.hh"
47 
48 #include <iostream>
49 #include <memory>
50 #include <algorithm>
51 #include <limits>
52 #include <cmath>
53 #include <vdt/vdtMath.h>
54 
55 using namespace std;
56 using namespace edm;
57 
58 
59 namespace reco {
60  namespace helper {
62  bool operator()( const fastjet::PseudoJet & t1, const fastjet::PseudoJet & t2 ) const {
63  return t1.perp2() > t2.perp2();
64  }
65  };
66 
67  }
68 }
69 
70 //______________________________________________________________________________
71 const char *const VirtualJetProducer::JetType::names[] = {
72  "BasicJet","GenJet","CaloJet","PFJet","TrackJet","PFClusterJet"
73 };
74 
75 
76 //______________________________________________________________________________
79 {
80  const char *const *pos = std::find(names, names + LastJetType, name);
81  if (pos == names + LastJetType) {
82  std::string errorMessage="Requested jetType not supported: "+name+"\n";
83  throw cms::Exception("Configuration",errorMessage);
84  }
85  return (Type)(pos-names);
86 }
87 
88 
90 {
91 
92 
93  if ( writeCompound_ ) {
94  produces<reco::BasicJetCollection>();
95  }
96 
97  if ( writeJetsWithConst_ ) {
98  produces<reco::PFCandidateCollection>(tag).setBranchAlias(alias);
99  produces<reco::PFJetCollection>();
100  } else {
101  if (makeCaloJet(jetTypeE)) {
102  produces<reco::CaloJetCollection>(tag).setBranchAlias(alias);
103  }
104  else if (makePFJet(jetTypeE)) {
105  produces<reco::PFJetCollection>(tag).setBranchAlias(alias);
106  }
107  else if (makeGenJet(jetTypeE)) {
108  produces<reco::GenJetCollection>(tag).setBranchAlias(alias);
109  }
110  else if (makeTrackJet(jetTypeE)) {
111  produces<reco::TrackJetCollection>(tag).setBranchAlias(alias);
112  }
113  else if (makePFClusterJet(jetTypeE)) {
114  produces<reco::PFClusterJetCollection>(tag).setBranchAlias(alias);
115  }
116  else if (makeBasicJet(jetTypeE)) {
117  produces<reco::BasicJetCollection>(tag).setBranchAlias(alias);
118  }
119  }
120 }
121 
123 // construction / destruction
125 
126 //______________________________________________________________________________
128 
129  moduleLabel_ = iConfig.getParameter<string> ("@module_label");
130  src_ = iConfig.getParameter<edm::InputTag>("src");
131  srcPVs_ = iConfig.getParameter<edm::InputTag>("srcPVs");
132  jetType_ = iConfig.getParameter<string> ("jetType");
133  jetAlgorithm_ = iConfig.getParameter<string> ("jetAlgorithm");
134  rParam_ = iConfig.getParameter<double> ("rParam");
135  inputEtMin_ = iConfig.getParameter<double> ("inputEtMin");
136  inputEMin_ = iConfig.getParameter<double> ("inputEMin");
137  jetPtMin_ = iConfig.getParameter<double> ("jetPtMin");
138  doPVCorrection_ = iConfig.getParameter<bool> ("doPVCorrection");
139  doAreaFastjet_ = iConfig.getParameter<bool> ("doAreaFastjet");
140  doRhoFastjet_ = iConfig.getParameter<bool> ("doRhoFastjet");
141  jetCollInstanceName_ = iConfig.getParameter<string> ("jetCollInstanceName");
142  doPUOffsetCorr_ = iConfig.getParameter<bool> ("doPUOffsetCorr");
143  puSubtractorName_ = iConfig.getParameter<string> ("subtractorName");
144  useExplicitGhosts_ = iConfig.getParameter<bool> ("useExplicitGhosts"); // use explicit ghosts in the fastjet clustering sequence?
145  doAreaDiskApprox_ = iConfig.getParameter<bool> ("doAreaDiskApprox");
146  voronoiRfact_ = iConfig.getParameter<double> ("voronoiRfact"); // Voronoi-based area calculation allows for an empirical scale factor
147  rhoEtaMax_ = iConfig.getParameter<double> ("Rho_EtaMax"); // do fasjet area / rho calcluation? => accept corresponding parameters
148  ghostEtaMax_ = iConfig.getParameter<double> ("Ghost_EtaMax");
149  activeAreaRepeats_ = iConfig.getParameter<int> ("Active_Area_Repeats");
150  ghostArea_ = iConfig.getParameter<double> ("GhostArea");
151  restrictInputs_ = iConfig.getParameter<bool> ("restrictInputs"); // restrict inputs to first "maxInputs" towers?
152  maxInputs_ = iConfig.getParameter<unsigned int>("maxInputs");
153  writeCompound_ = iConfig.getParameter<bool> ("writeCompound"); // Check to see if we are writing compound jets for substructure and jet grooming
154  writeJetsWithConst_ = iConfig.getParameter<bool>("writeJetsWithConst"); //write subtracted jet constituents
155  doFastJetNonUniform_ = iConfig.getParameter<bool> ("doFastJetNonUniform");
156  puCenters_ = iConfig.getParameter<vector<double> >("puCenters");
157  puWidth_ = iConfig.getParameter<double> ("puWidth");
158  nExclude_ = iConfig.getParameter<unsigned int>("nExclude");
159  useDeterministicSeed_ = iConfig.getParameter<bool> ("useDeterministicSeed");
160  minSeed_ = iConfig.getParameter<unsigned int>("minSeed");
161  verbosity_ = iConfig.getParameter<int> ("verbosity");
162 
163  anomalousTowerDef_ = auto_ptr<AnomalousTower>(new AnomalousTower(iConfig));
164 
165  input_vertex_token_ = consumes<reco::VertexCollection>(srcPVs_);
166  input_candidateview_token_ = consumes<reco::CandidateView>(src_);
167  input_candidatefwdptr_token_ = consumes<vector<edm::FwdPtr<reco::PFCandidate> > >(iConfig.getParameter<edm::InputTag>("src"));
168  input_packedcandidatefwdptr_token_ = consumes<vector<edm::FwdPtr<pat::PackedCandidate> > >(iConfig.getParameter<edm::InputTag>("src"));
169  //
170  // additional parameters to think about:
171  // - overlap threshold (set to 0.75 for the time being)
172  // - p parameter for generalized kT (set to -2 for the time being)
173  // - fastjet PU subtraction parameters (not yet considered)
174  //
175  if (jetAlgorithm_=="Kt")
176  fjJetDefinition_= JetDefPtr(new fastjet::JetDefinition(fastjet::kt_algorithm,rParam_));
177 
178  else if (jetAlgorithm_=="CambridgeAachen")
179  fjJetDefinition_= JetDefPtr(new fastjet::JetDefinition(fastjet::cambridge_algorithm,rParam_) );
180 
181  else if (jetAlgorithm_=="AntiKt")
182  fjJetDefinition_= JetDefPtr( new fastjet::JetDefinition(fastjet::antikt_algorithm,rParam_) );
183 
184  else if (jetAlgorithm_=="GeneralizedKt")
185  fjJetDefinition_= JetDefPtr( new fastjet::JetDefinition(fastjet::genkt_algorithm,rParam_,-2) );
186 
187  else if (jetAlgorithm_=="SISCone") {
188 
189  fjPlugin_ = PluginPtr( new fastjet::SISConePlugin(rParam_,0.75,0,0.0,false,fastjet::SISConePlugin::SM_pttilde) );
190  fjJetDefinition_= JetDefPtr( new fastjet::JetDefinition(&*fjPlugin_) );
191 
192  } else if (jetAlgorithm_=="IterativeCone") {
193 
194  fjPlugin_ = PluginPtr(new fastjet::CMSIterativeConePlugin(rParam_,1.0));
195  fjJetDefinition_= JetDefPtr(new fastjet::JetDefinition(&*fjPlugin_));
196 
197  } else if (jetAlgorithm_=="CDFMidPoint") {
198 
199  fjPlugin_ = PluginPtr(new fastjet::CDFMidPointPlugin(rParam_,0.75));
200  fjJetDefinition_= JetDefPtr(new fastjet::JetDefinition(&*fjPlugin_));
201 
202  } else if (jetAlgorithm_=="ATLASCone") {
203 
204  fjPlugin_ = PluginPtr(new fastjet::ATLASConePlugin(rParam_));
205  fjJetDefinition_= JetDefPtr(new fastjet::JetDefinition(&*fjPlugin_));
206 
207  } else {
208  throw cms::Exception("Invalid jetAlgorithm") <<"Jet algorithm for VirtualJetProducer is invalid, Abort!\n";
209  }
210 
211  jetTypeE=JetType::byName(jetType_);
212 
213  if ( doPUOffsetCorr_ ) {
214  if(puSubtractorName_.empty()){
215  LogWarning("VirtualJetProducer") << "Pile Up correction on; however, pile up type is not specified. Using default... \n";
216  subtractor_ = boost::shared_ptr<PileUpSubtractor>(new PileUpSubtractor(iConfig, consumesCollector()));
217  } else subtractor_ = boost::shared_ptr<PileUpSubtractor>(
218  PileUpSubtractorFactory::get()->create( puSubtractorName_, iConfig, consumesCollector()));
219  }
220 
221  // do approximate disk-based area calculation => warn if conflicting request
222  if (doAreaDiskApprox_ && doAreaFastjet_)
223  throw cms::Exception("Conflicting area calculations") << "Both the calculation of jet area via fastjet and via an analytical disk approximation have been requested. Please decide on one.\n";
224 
225  if ( doAreaFastjet_ || doRhoFastjet_ ) {
226 
227  if (voronoiRfact_ <= 0) {
228  fjActiveArea_ = ActiveAreaSpecPtr(new fastjet::GhostedAreaSpec(ghostEtaMax_,activeAreaRepeats_,ghostArea_));
229  fjActiveArea_->set_fj2_placement(true);
230 
231  if ( !useExplicitGhosts_ ) {
232  fjAreaDefinition_ = AreaDefinitionPtr( new fastjet::AreaDefinition(fastjet::active_area, *fjActiveArea_ ) );
233  } else {
234  fjAreaDefinition_ = AreaDefinitionPtr( new fastjet::AreaDefinition(fastjet::active_area_explicit_ghosts, *fjActiveArea_ ) );
235  }
236  }
237  fjRangeDef_ = RangeDefPtr( new fastjet::RangeDefinition(rhoEtaMax_) );
238  }
239 
240  if( ( doFastJetNonUniform_ ) && ( puCenters_.size() == 0 ) )
241  throw cms::Exception("doFastJetNonUniform") << "Parameter puCenters for doFastJetNonUniform is not defined." << std::endl;
242 
243  // make the "produces" statements
244  makeProduces( moduleLabel_, jetCollInstanceName_ );
245  produces<vector<double> >("rhos");
246  produces<vector<double> >("sigmas");
247  produces<double>("rho");
248  produces<double>("sigma");
249 
250 
251 }
252 
253 //______________________________________________________________________________
255 {
256 }
257 
258 
260 // implementation of member functions
262 
263 //______________________________________________________________________________
265 {
266 
267  // If requested, set the fastjet random seed to a deterministic function
268  // of the run/lumi/event.
269  // NOTE!!! The fastjet random number sequence is a global singleton.
270  // Thus, we have to create an object and get access to the global singleton
271  // in order to change it.
272  if ( useDeterministicSeed_ ) {
273  fastjet::GhostedAreaSpec gas;
274  std::vector<int> seeds(2);
275  unsigned int runNum_uint = static_cast <unsigned int> (iEvent.id().run());
276  unsigned int evNum_uint = static_cast <unsigned int> (iEvent.id().event());
277  seeds[0] = std::max(runNum_uint,minSeed_ + 3) + 3 * evNum_uint;
278  seeds[1] = std::max(runNum_uint,minSeed_ + 5) + 5 * evNum_uint;
279  gas.set_random_status(seeds);
280  }
281 
282  LogDebug("VirtualJetProducer") << "Entered produce\n";
283  //determine signal vertex2
284  vertex_=reco::Jet::Point(0,0,0);
285  if ( (makeCaloJet(jetTypeE) || makePFJet(jetTypeE)) &&doPVCorrection_) {
286  LogDebug("VirtualJetProducer") << "Adding PV info\n";
288  iEvent.getByToken(input_vertex_token_ , pvCollection);
289  if (pvCollection->size()>0) vertex_=pvCollection->begin()->position();
290  }
291 
292  // For Pileup subtraction using offset correction:
293  // set up geometry map
294  if ( doPUOffsetCorr_ ) {
295  subtractor_->setupGeometryMap(iEvent, iSetup);
296  }
297 
298  // clear data
299  LogDebug("VirtualJetProducer") << "Clear data\n";
300  fjInputs_.clear();
301  fjJets_.clear();
302  inputs_.clear();
303 
304  // get inputs and convert them to the fastjet format (fastjet::PeudoJet)
306 
308  edm::Handle< std::vector<edm::FwdPtr<pat::PackedCandidate> > > packedinputsHandleAsFwdPtr;
309 
310  bool isView = iEvent.getByToken(input_candidateview_token_, inputsHandle);
311  if ( isView ) {
312  if ( inputsHandle->size() == 0) {
313  output( iEvent, iSetup );
314  return;
315  }
316  for (size_t i = 0; i < inputsHandle->size(); ++i) {
317  inputs_.push_back(inputsHandle->ptrAt(i));
318  }
319  } else {
320  bool isPF = iEvent.getByToken(input_candidatefwdptr_token_, pfinputsHandleAsFwdPtr);
321  if ( isPF ) {
322  if ( pfinputsHandleAsFwdPtr->size() == 0) {
323  output( iEvent, iSetup );
324  return;
325  }
326  for (size_t i = 0; i < pfinputsHandleAsFwdPtr->size(); ++i) {
327  if ( (*pfinputsHandleAsFwdPtr)[i].ptr().isAvailable() ) {
328  inputs_.push_back( (*pfinputsHandleAsFwdPtr)[i].ptr() );
329  }
330  else if ( (*pfinputsHandleAsFwdPtr)[i].backPtr().isAvailable() ) {
331  inputs_.push_back( (*pfinputsHandleAsFwdPtr)[i].backPtr() );
332  }
333  }
334  } else {
335  iEvent.getByToken(input_packedcandidatefwdptr_token_, packedinputsHandleAsFwdPtr);
336  if ( packedinputsHandleAsFwdPtr->size() == 0) {
337  output( iEvent, iSetup );
338  return;
339  }
340  for (size_t i = 0; i < packedinputsHandleAsFwdPtr->size(); ++i) {
341  if ( (*packedinputsHandleAsFwdPtr)[i].ptr().isAvailable() ) {
342  inputs_.push_back( (*packedinputsHandleAsFwdPtr)[i].ptr() );
343  }
344  else if ( (*packedinputsHandleAsFwdPtr)[i].backPtr().isAvailable() ) {
345  inputs_.push_back( (*packedinputsHandleAsFwdPtr)[i].backPtr() );
346  }
347  }
348  }
349  }
350  LogDebug("VirtualJetProducer") << "Got inputs\n";
351 
352  // Convert candidates to fastjet::PseudoJets.
353  // Also correct to Primary Vertex. Will modify fjInputs_
354  // and use inputs_
355  fjInputs_.reserve(inputs_.size());
356  inputTowers();
357  LogDebug("VirtualJetProducer") << "Inputted towers\n";
358 
359  // For Pileup subtraction using offset correction:
360  // Subtract pedestal.
361  if ( doPUOffsetCorr_ ) {
362  subtractor_->setDefinition(fjJetDefinition_);
363  subtractor_->reset(inputs_,fjInputs_,fjJets_);
364  subtractor_->calculatePedestal(fjInputs_);
365  subtractor_->subtractPedestal(fjInputs_);
366  LogDebug("VirtualJetProducer") << "Subtracted pedestal\n";
367  }
368  // Run algorithm. Will modify fjJets_ and allocate fjClusterSeq_.
369  // This will use fjInputs_
370  runAlgorithm( iEvent, iSetup );
371 
372  // if ( doPUOffsetCorr_ ) {
373  // subtractor_->setAlgorithm(fjClusterSeq_);
374  // }
375 
376  LogDebug("VirtualJetProducer") << "Ran algorithm\n";
377  // For Pileup subtraction using offset correction:
378  // Now we find jets and need to recalculate their energy,
379  // mark towers participated in jet,
380  // remove occupied towers from the list and recalculate mean and sigma
381  // put the initial towers collection to the jet,
382  // and subtract from initial towers in jet recalculated mean and sigma of towers
383  if ( doPUOffsetCorr_ ) {
384  LogDebug("VirtualJetProducer") << "Do PUOffsetCorr\n";
385  vector<fastjet::PseudoJet> orphanInput;
386  subtractor_->calculateOrphanInput(orphanInput);
387  subtractor_->calculatePedestal(orphanInput);
388  subtractor_->offsetCorrectJets();
389  }
390  // Write the output jets.
391  // This will (by default) call the member function template
392  // "writeJets", but can be overridden.
393  // this will use inputs_
394  output( iEvent, iSetup );
395  LogDebug("VirtualJetProducer") << "Wrote jets\n";
396 
397  // Clear the work vectors so that memory is free for other modules.
398  // Use the trick of swapping with an empty vector so that the memory
399  // is actually given back rather than silently kept.
400  decltype(fjInputs_)().swap(fjInputs_);
401  decltype(fjJets_)().swap(fjJets_);
402  decltype(inputs_)().swap(inputs_);
403 
404  return;
405 }
406 
407 //______________________________________________________________________________
408 
410 {
411  auto inBegin = inputs_.begin(),
412  inEnd = inputs_.end(), i = inBegin;
413  for (; i != inEnd; ++i ) {
414  auto const & input = **i;
415  // std::cout << "CaloTowerVI jets " << input->pt() << " " << input->et() << ' '<< input->energy() << ' ' << (isAnomalousTower(input) ? " bad" : " ok") << std::endl;
416  if (edm::isNotFinite(input.pt())) continue;
417  if (input.et() <inputEtMin_) continue;
418  if (input.energy()<inputEMin_) continue;
419  if (isAnomalousTower(*i)) continue;
420  // Change by SRR : this is no longer an error nor warning, this can happen with PU mitigation algos.
421  // Also switch to something more numerically safe. (VI: 10^-42GeV????)
422  if (input.pt() < 100 * std::numeric_limits<double>::epsilon() ) {
423  continue;
424  }
425  if (makeCaloJet(jetTypeE)&&doPVCorrection_) {
426  const CaloTower & tower = dynamic_cast<const CaloTower &>(input);
427  auto const & ct = tower.p4(vertex_); // very expensive as computed in eta/phi
428  fjInputs_.emplace_back(ct.px(),ct.py(),ct.pz(),ct.energy());
429  //std::cout << "tower:" << *tower << '\n';
430  }
431  else {
432  /*
433  if(makePFJet(jetTypeE)) {
434  reco::PFCandidate& pfc = (reco::PFCandidate&)input;
435  std::cout << "PF cand:" << pfc << '\n';
436  }
437  */
438  fjInputs_.emplace_back(input.px(),input.py(),input.pz(),
439  input.energy());
440  }
441  fjInputs_.back().set_user_index(i - inBegin);
442  }
443 
444  if ( restrictInputs_ && fjInputs_.size() > maxInputs_ ) {
446  std::sort(fjInputs_.begin(), fjInputs_.end(), pTComparator);
447  fjInputs_.resize(maxInputs_);
448  edm::LogWarning("JetRecoTooManyEntries") << "Too many inputs in the event, limiting to first " << maxInputs_ << ". Output is suspect.";
449  }
450 }
451 
452 //______________________________________________________________________________
454 {
455  if (!makeCaloJet(jetTypeE))
456  return false;
457  else
458  return (*anomalousTowerDef_)(*input);
459 }
460 
461 //------------------------------------------------------------------------------
462 // This is pure virtual.
463 //______________________________________________________________________________
464 // void VirtualJetProducer::runAlgorithm( edm::Event & iEvent, edm::EventSetup const& iSetup,
465 // std::vector<edm::Ptr<reco::Candidate> > const & inputs_);
466 
467 //______________________________________________________________________________
468 void VirtualJetProducer::copyConstituents(const vector<fastjet::PseudoJet>& fjConstituents,
469  reco::Jet* jet)
470 {
471  for (unsigned int i=0;i<fjConstituents.size();++i) {
472  int index = fjConstituents[i].user_index();
473  if ( index >= 0 && static_cast<unsigned int>(index) < inputs_.size() )
474  jet->addDaughter(inputs_[index]);
475  }
476 }
477 
478 
479 //______________________________________________________________________________
480 vector<reco::CandidatePtr>
481 VirtualJetProducer::getConstituents(const vector<fastjet::PseudoJet>&fjConstituents)
482 {
483  vector<reco::CandidatePtr> result; result.reserve(fjConstituents.size()/2);
484  for (unsigned int i=0;i<fjConstituents.size();i++) {
485  auto index = fjConstituents[i].user_index();
486  if ( index >= 0 && static_cast<unsigned int>(index) < inputs_.size() ) {
487  result.emplace_back(inputs_[index]);
488  }
489  }
490  return result;
491 }
492 
493 
494 //_____________________________________________________________________________
495 
497 {
498  // Write jets and constitutents. Will use fjJets_, inputs_
499  // and fjClusterSeq_
500 
501  if ( writeCompound_ ) {
502  // Write jets and subjets
503  switch( jetTypeE ) {
504  case JetType::CaloJet :
505  writeCompoundJets<reco::CaloJet>( iEvent, iSetup );
506  break;
507  case JetType::PFJet :
508  writeCompoundJets<reco::PFJet>( iEvent, iSetup );
509  break;
510  case JetType::GenJet :
511  writeCompoundJets<reco::GenJet>( iEvent, iSetup );
512  break;
513  case JetType::BasicJet :
514  writeCompoundJets<reco::BasicJet>( iEvent, iSetup );
515  break;
516  default:
517  throw cms::Exception("InvalidInput") << "invalid jet type in CompoundJetProducer\n";
518  break;
519  };
520  } else if ( writeJetsWithConst_ ) {
521  // Write jets and new constituents.
522  writeJetsWithConstituents<reco::PFJet>( iEvent, iSetup );
523  } else {
524  switch( jetTypeE ) {
525  case JetType::CaloJet :
526  writeJets<reco::CaloJet>( iEvent, iSetup);
527  break;
528  case JetType::PFJet :
529  writeJets<reco::PFJet>( iEvent, iSetup);
530  break;
531  case JetType::GenJet :
532  writeJets<reco::GenJet>( iEvent, iSetup);
533  break;
534  case JetType::TrackJet :
535  writeJets<reco::TrackJet>( iEvent, iSetup);
536  break;
537  case JetType::PFClusterJet :
538  writeJets<reco::PFClusterJet>( iEvent, iSetup);
539  break;
540  case JetType::BasicJet :
541  writeJets<reco::BasicJet>( iEvent, iSetup);
542  break;
543  default:
544  throw cms::Exception("InvalidInput") << "invalid jet type in VirtualJetProducer\n";
545  break;
546  };
547  }
548 
549 }
550 
551 namespace {
552 template< typename T >
553 struct Area { static float get(T const &) {return 0;}};
554 
555 template<>
556 struct Area<reco::CaloJet>{ static float get(reco::CaloJet const & jet) {
557  return jet.getSpecific().mTowersArea;
558 }
559 };
560 }
561 
562 template< typename T >
564 {
565  // std::cout << "writeJets " << typeid(T).name()
566  // << (doRhoFastjet_ ? " doRhoFastjet " : "")
567  // << (doAreaFastjet_ ? " doAreaFastjet " : "")
568  // << (doAreaDiskApprox_ ? " doAreaDiskApprox " : "")
569  // << std::endl;
570 
571  if (doRhoFastjet_) {
572  // declare jet collection without the two jets,
573  // for unbiased background estimation.
574  std::vector<fastjet::PseudoJet> fjexcluded_jets;
575  fjexcluded_jets=fjJets_;
576 
577  if(fjexcluded_jets.size()>2) fjexcluded_jets.resize(nExclude_);
578 
579  if(doFastJetNonUniform_){
580  auto rhos = std::make_unique<std::vector<double>>();
581  auto sigmas = std::make_unique<std::vector<double>>();
582  int nEta = puCenters_.size();
583  rhos->reserve(nEta);
584  sigmas->reserve(nEta);
585  fastjet::ClusterSequenceAreaBase const* clusterSequenceWithArea =
586  dynamic_cast<fastjet::ClusterSequenceAreaBase const *> ( &*fjClusterSeq_ );
587 
588  if (clusterSequenceWithArea ==nullptr ){
589  if (fjJets_.size() > 0) {
590  throw cms::Exception("LogicError")<<"fjClusterSeq is not initialized while inputs are present\n ";
591  }
592  } else {
593  for(int ie = 0; ie < nEta; ++ie){
594  double eta = puCenters_[ie];
595  double etamin=eta-puWidth_;
596  double etamax=eta+puWidth_;
597  fastjet::RangeDefinition range_rho(etamin,etamax);
598  fastjet::BackgroundEstimator bkgestim(*clusterSequenceWithArea,range_rho);
599  bkgestim.set_excluded_jets(fjexcluded_jets);
600  rhos->push_back(bkgestim.rho());
601  sigmas->push_back(bkgestim.sigma());
602  }
603  }
604  iEvent.put(std::move(rhos),"rhos");
605  iEvent.put(std::move(sigmas),"sigmas");
606  }else{
607  auto rho = std::make_unique<double>(0.0);
608  auto sigma = std::make_unique<double>(0.0);
609  double mean_area = 0;
610 
611  fastjet::ClusterSequenceAreaBase const* clusterSequenceWithArea =
612  dynamic_cast<fastjet::ClusterSequenceAreaBase const *> ( &*fjClusterSeq_ );
613  /*
614  const double nemptyjets = clusterSequenceWithArea->n_empty_jets(*fjRangeDef_);
615  if(( nemptyjets < -15 ) || ( nemptyjets > fjRangeDef_->area()+ 15)) {
616  edm::LogWarning("StrangeNEmtpyJets") << "n_empty_jets is : " << clusterSequenceWithArea->n_empty_jets(*fjRangeDef_) << " with range " << fjRangeDef_->description() << ".";
617  }
618  */
619  if (clusterSequenceWithArea ==nullptr ){
620  if (fjJets_.size() > 0) {
621  throw cms::Exception("LogicError")<<"fjClusterSeq is not initialized while inputs are present\n ";
622  }
623  } else {
624  clusterSequenceWithArea->get_median_rho_and_sigma(*fjRangeDef_,false,*rho,*sigma,mean_area);
625  if((*rho < 0)|| (edm::isNotFinite(*rho))) {
626  edm::LogError("BadRho") << "rho value is " << *rho << " area:" << mean_area << " and n_empty_jets: " << clusterSequenceWithArea->n_empty_jets(*fjRangeDef_) << " with range " << fjRangeDef_->description()
627  <<". Setting rho to rezo.";
628  *rho = 0;
629  }
630  }
631  iEvent.put(std::move(rho),"rho");
632  iEvent.put(std::move(sigma),"sigma");
633  }
634  } // doRhoFastjet_
635 
636  // produce output jet collection
637 
638  using namespace reco;
639 
640  // allocate fjJets_.size() Ts in vector
641  auto jets = std::make_unique<std::vector<T>>(fjJets_.size());
642 
643  // Distance between jet centers and overlap area -- for disk-based area calculation
644  using RIJ = std::pair<double,double>;
645  std::vector<RIJ> rijStorage(fjJets_.size()*(fjJets_.size()/2));
646  RIJ * rij[fjJets_.size()];
647  unsigned int k=0;
648  for (unsigned int ijet=0;ijet<fjJets_.size();++ijet) {
649  rij[ijet] = &rijStorage[k]; k+=ijet;
650  }
651 
652  float etaJ[fjJets_.size()], phiJ[fjJets_.size()];
653 
654  auto orParam_ = 1./rParam_;
655  // fill jets
656  for (unsigned int ijet=0;ijet<fjJets_.size();++ijet) {
657  auto & jet = (*jets)[ijet];
658  // get the fastjet jet
659  const fastjet::PseudoJet& fjJet = fjJets_[ijet];
660  // get the constituents from fastjet
661  std::vector<fastjet::PseudoJet> const & fjConstituents = fastjet::sorted_by_pt(fjJet.constituents());
662  // convert them to CandidatePtr vector
663  std::vector<CandidatePtr> const & constituents = getConstituents(fjConstituents);
664 
665  // write the specifics to the jet (simultaneously sets 4-vector, vertex).
666  // These are overridden functions that will call the appropriate
667  // specific allocator.
669  Particle::LorentzVector(fjJet.px(),
670  fjJet.py(),
671  fjJet.pz(),
672  fjJet.E()),
673  vertex_,
674  constituents, iSetup);
675  phiJ[ijet] = jet.phi();
676  etaJ[ijet] = jet.eta();
677  }
678 
679  // calcuate the jet area
680  for (unsigned int ijet=0;ijet<fjJets_.size();++ijet) {
681  // calcuate the jet area
682  double jetArea=0.0;
683  // get the fastjet jet
684  const auto & fjJet = fjJets_[ijet];
685  if ( doAreaFastjet_ && fjJet.has_area() ) {
686  jetArea = fjJet.area();
687  }
688  else if ( doAreaDiskApprox_ ) {
689  // Here it is assumed that fjJets_ is in decreasing order of pT,
690  // which should happen in FastjetJetProducer::runAlgorithm()
691  jetArea = M_PI;
692  RIJ * distance = rij[ijet];
693  for (unsigned jJet = 0; jJet < ijet; ++jJet) {
694  distance[jJet].first = std::sqrt(reco::deltaR2(etaJ[ijet],phiJ[ijet], etaJ[jJet],phiJ[jJet]))*orParam_;
695  distance[jJet].second = reco::helper::VirtualJetProducerHelper::intersection(distance[jJet].first);
696  jetArea -=distance[jJet].second;
697  for (unsigned kJet = 0; kJet < jJet; ++kJet) {
698  jetArea += reco::helper::VirtualJetProducerHelper::intersection(distance[jJet].first, distance[kJet].first, rij[jJet][kJet].first,
699  distance[jJet].second, distance[kJet].second, rij[jJet][kJet].second);
700  } // end loop over harder jets
701  } // end loop over harder jets
702  jetArea *= (rParam_*rParam_);
703  }
704  auto & jet = (*jets)[ijet];
705  jet.setJetArea (jetArea);
706 
707  if(doPUOffsetCorr_){
708  jet.setPileup(subtractor_->getPileUpEnergy(ijet));
709  }else{
710  jet.setPileup (0.0);
711  }
712 
713  // std::cout << "area " << ijet << " " << jetArea << " " << Area<T>::get(jet) << std::endl;
714  // std::cout << "JetVI " << ijet << ' '<< jet.pt() << " " << jet.et() << ' '<< jet.energy() << ' '<< jet.mass() << std::endl;
715 
716  }
717  // put the jets in the collection
718  iEvent.put(std::move(jets),jetCollInstanceName_);
719 }
720 
722 template< class T>
724 {
725  if ( verbosity_ >= 1 ) {
726  std::cout << "<VirtualJetProducer::writeCompoundJets (moduleLabel = " << moduleLabel_ << ")>:" << std::endl;
727  }
728 
729  // get a list of output jets
730  auto jetCollection = std::make_unique<reco::BasicJetCollection>();
731  // get a list of output subjets
732  auto subjetCollection = std::make_unique<std::vector<T>>();
733 
734  // This will store the handle for the subjets after we write them
735  edm::OrphanHandle< std::vector<T> > subjetHandleAfterPut;
736  // this is the mapping of subjet to hard jet
737  std::vector< std::vector<int> > indices;
738  // this is the list of hardjet 4-momenta
739  std::vector<math::XYZTLorentzVector> p4_hardJets;
740  // this is the hardjet areas
741  std::vector<double> area_hardJets;
742 
743  // Loop over the hard jets
744  std::vector<fastjet::PseudoJet>::const_iterator it = fjJets_.begin(),
745  iEnd = fjJets_.end(),
746  iBegin = fjJets_.begin();
747  indices.resize( fjJets_.size() );
748  for ( ; it != iEnd; ++it ) {
749  fastjet::PseudoJet const & localJet = *it;
750  unsigned int jetIndex = it - iBegin;
751  // Get the 4-vector for the hard jet
752  p4_hardJets.push_back( math::XYZTLorentzVector(localJet.px(), localJet.py(), localJet.pz(), localJet.e() ));
753  double localJetArea = 0.0;
754  if ( doAreaFastjet_ && localJet.has_area() ) {
755  localJetArea = localJet.area();
756  }
757  area_hardJets.push_back( localJetArea );
758 
759  // create the subjet list
760  std::vector<fastjet::PseudoJet> constituents;
761  if ( it->has_pieces() ) {
762  constituents = it->pieces();
763  } else if ( it->has_constituents() ) {
764  constituents = it->constituents();
765  }
766 
767  std::vector<fastjet::PseudoJet>::const_iterator itSubJetBegin = constituents.begin(),
768  itSubJet = itSubJetBegin, itSubJetEnd = constituents.end();
769  for (; itSubJet != itSubJetEnd; ++itSubJet ){
770 
771  fastjet::PseudoJet const & subjet = *itSubJet;
772  if ( verbosity_ >= 1 ) {
773  std::cout << "subjet #" << (itSubJet - itSubJetBegin) << ": Pt = " << subjet.pt() << ", eta = " << subjet.eta() << ", phi = " << subjet.phi() << ", mass = " << subjet.m()
774  << " (#constituents = " << subjet.constituents().size() << ")" << std::endl;
775  std::vector<fastjet::PseudoJet> subjet_constituents = subjet.constituents();
776  int idx_constituent = 0;
777  for ( std::vector<fastjet::PseudoJet>::const_iterator constituent = subjet_constituents.begin();
778  constituent != subjet_constituents.end(); ++constituent ) {
779  if ( constituent->pt() < 1.e-3 ) continue; // CV: skip ghosts
780  std::cout << " constituent #" << idx_constituent << ": Pt = " << constituent->pt() << ", eta = " << constituent->eta() << ", phi = " << constituent->phi() << ","
781  << " mass = " << constituent->m() << std::endl;
782  ++idx_constituent;
783  }
784  }
785 
786  if ( verbosity_ >= 1 ) {
787  std::cout << "subjet #" << (itSubJet - itSubJetBegin) << ": Pt = " << subjet.pt() << ", eta = " << subjet.eta() << ", phi = " << subjet.phi() << ", mass = " << subjet.m()
788  << " (#constituents = " << subjet.constituents().size() << ")" << std::endl;
789  std::vector<fastjet::PseudoJet> subjet_constituents = subjet.constituents();
790  int idx_constituent = 0;
791  for ( std::vector<fastjet::PseudoJet>::const_iterator constituent = subjet_constituents.begin();
792  constituent != subjet_constituents.end(); ++constituent ) {
793  if ( constituent->pt() < 1.e-3 ) continue; // CV: skip ghosts
794  std::cout << " constituent #" << idx_constituent << ": Pt = " << constituent->pt() << ", eta = " << constituent->eta() << ", phi = " << constituent->phi() << ","
795  << " mass = " << constituent->m() << std::endl;
796  ++idx_constituent;
797  }
798  }
799 
800  math::XYZTLorentzVector p4Subjet(subjet.px(), subjet.py(), subjet.pz(), subjet.e() );
802 
803  // This will hold ptr's to the subjets
804  std::vector<reco::CandidatePtr> subjetConstituents;
805 
806  // Get the transient subjet constituents from fastjet
807  std::vector<fastjet::PseudoJet> subjetFastjetConstituents = subjet.constituents();
808  std::vector<reco::CandidatePtr> constituents =
809  getConstituents(subjetFastjetConstituents );
810 
811  indices[jetIndex].push_back( subjetCollection->size() );
812 
813  // Add the concrete subjet type to the subjet list to write to event record
814  T jet;
815  reco::writeSpecific( jet, p4Subjet, point, constituents, iSetup);
816  double subjetArea = 0.0;
817  if ( doAreaFastjet_ && itSubJet->has_area() ){
818  subjetArea = itSubJet->area();
819  }
820  jet.setJetArea( subjetArea );
821  subjetCollection->push_back( jet );
822  }
823  }
824 
825  // put subjets into event record
826  subjetHandleAfterPut = iEvent.put(std::move(subjetCollection), jetCollInstanceName_);
827 
828  // Now create the hard jets with ptr's to the subjets as constituents
829  std::vector<math::XYZTLorentzVector>::const_iterator ip4 = p4_hardJets.begin(),
830  ip4Begin = p4_hardJets.begin(),
831  ip4End = p4_hardJets.end();
832 
833  for ( ; ip4 != ip4End; ++ip4 ) {
834  int p4_index = ip4 - ip4Begin;
835  std::vector<int> & ind = indices[p4_index];
836  std::vector<reco::CandidatePtr> i_hardJetConstituents;
837  // Add the subjets to the hard jet
838  for( std::vector<int>::const_iterator isub = ind.begin();
839  isub != ind.end(); ++isub ) {
840  reco::CandidatePtr candPtr( subjetHandleAfterPut, *isub, false );
841  i_hardJetConstituents.push_back( candPtr );
842  }
844  reco::BasicJet toput( *ip4, point, i_hardJetConstituents);
845  toput.setJetArea( area_hardJets[ip4 - ip4Begin] );
846  jetCollection->push_back( toput );
847  }
848 
849  // put hard jets into event record
850  // Store the Orphan handle for adding HTT information
851  edm::OrphanHandle<reco::BasicJetCollection> oh = iEvent.put(std::move(jetCollection));
852 
853  if (fromHTTTopJetProducer_){
854  addHTTTopJetTagInfoCollection( iEvent, iSetup, oh);
855  }
856 
857 }
858 
860 template< class T>
862 {
863  if ( verbosity_ >= 1 ) {
864  std::cout << "<VirtualJetProducer::writeJetsWithConstituents (moduleLabel = " << moduleLabel_ << ")>:" << std::endl;
865  }
866 
867  // get a list of output jets MV: make this compatible with template
868  auto jetCollection = std::make_unique<reco::PFJetCollection>();
869 
870  // this is the mapping of jet to constituents
871  std::vector< std::vector<int> > indices;
872  // this is the list of jet 4-momenta
873  std::vector<math::XYZTLorentzVector> p4_Jets;
874  // this is the jet areas
875  std::vector<double> area_Jets;
876 
877  // get a list of output constituents
878  auto constituentCollection = std::make_unique<reco::PFCandidateCollection>();
879 
880  // This will store the handle for the constituents after we write them
881  edm::OrphanHandle<reco::PFCandidateCollection> constituentHandleAfterPut;
882 
883  // Loop over the jets and extract constituents
884  std::vector<fastjet::PseudoJet> constituentsSub;
885  std::vector<fastjet::PseudoJet>::const_iterator it = fjJets_.begin(),
886  iEnd = fjJets_.end(),
887  iBegin = fjJets_.begin();
888  indices.resize( fjJets_.size() );
889 
890  for ( ; it != iEnd; ++it ) {
891  fastjet::PseudoJet const & localJet = *it;
892  unsigned int jetIndex = it - iBegin;
893  // Get the 4-vector for the hard jet
894  p4_Jets.push_back( math::XYZTLorentzVector(localJet.px(), localJet.py(), localJet.pz(), localJet.e() ));
895  double localJetArea = 0.0;
896  if ( doAreaFastjet_ && localJet.has_area() ) {
897  localJetArea = localJet.area();
898  }
899  area_Jets.push_back( localJetArea );
900 
901  // create the constituent list
902  std::vector<fastjet::PseudoJet> constituents,ghosts;
903  if ( it->has_pieces() )
904  constituents = it->pieces();
905  else if ( it->has_constituents() )
906  fastjet::SelectorIsPureGhost().sift(it->constituents(), ghosts, constituents); //filter out ghosts
907 
908  //loop over constituents of jet (can be subjets or normal constituents)
909  indices[jetIndex].reserve(constituents.size());
910  constituentsSub.reserve(constituentsSub.size()+constituents.size());
911  for (fastjet::PseudoJet const& constit : constituents) {
912  indices[jetIndex].push_back( constituentsSub.size() );
913  constituentsSub.push_back(constit);
914  }
915  }
916 
917  //Loop over constituents and store in the event
918  static const reco::PFCandidate dummySinceTranslateIsNotStatic;
919  for (fastjet::PseudoJet const& constit : constituentsSub) {
920  auto orig = inputs_[constit.user_index()];
921  auto id = dummySinceTranslateIsNotStatic.translatePdgIdToType(orig->pdgId());
922  reco::PFCandidate pCand( reco::PFCandidate(orig->charge(), orig->p4(), id) );
924  pVec.SetPxPyPzE(constit.px(),constit.py(),constit.pz(),constit.e());
925  pCand.setP4(pVec);
926  pCand.setSourceCandidatePtr( orig->sourceCandidatePtr(0) );
927  constituentCollection->push_back(pCand);
928  }
929  // put constituents into event record
930  constituentHandleAfterPut = iEvent.put(std::move(constituentCollection), jetCollInstanceName_ );
931 
932  // Now create the jets with ptr's to the constituents
933  std::vector<math::XYZTLorentzVector>::const_iterator ip4 = p4_Jets.begin(),
934  ip4Begin = p4_Jets.begin(),
935  ip4End = p4_Jets.end();
936 
937  for ( ; ip4 != ip4End; ++ip4 ) {
938  int p4_index = ip4 - ip4Begin;
939  std::vector<int> & ind = indices[p4_index];
940  std::vector<reco::CandidatePtr> i_jetConstituents;
941  // Add the constituents to the jet
942  for( std::vector<int>::const_iterator iconst = ind.begin(); iconst != ind.end(); ++iconst ) {
943  reco::CandidatePtr candPtr( constituentHandleAfterPut, *iconst, false );
944  i_jetConstituents.push_back( candPtr );
945  }
946  if(i_jetConstituents.size()>0) { //only keep jets which have constituents after subtraction
949  reco::writeSpecific(jet,*ip4,point,i_jetConstituents,iSetup);
950  jet.setJetArea( area_Jets[ip4 - ip4Begin] );
951  jetCollection->emplace_back( jet );
952  }
953  }
954 
955  // put jets into event record
956  iEvent.put(std::move(jetCollection));
957 }
958 
959 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
961 
963  fillDescriptionsFromVirtualJetProducer(desc);
964  desc.add<string>("jetCollInstanceName", "" );
965 
966  // addDefault must be used here instead of add unless
967  // all the classes that inherit from this class redefine
968  // the fillDescriptions function. Otherwise, the autogenerated
969  // cfi filenames are the same and conflict.
970  descriptions.addDefault(desc);
971 }
972 
974 {
975  desc.add<edm::InputTag>("src", edm::InputTag("particleFlow") );
976  desc.add<edm::InputTag>("srcPVs", edm::InputTag("") );
977  desc.add<string>("jetType", "PFJet" );
978  desc.add<string>("jetAlgorithm", "AntiKt" );
979  desc.add<double>("rParam", 0.4 );
980  desc.add<double>("inputEtMin", 0.0 );
981  desc.add<double>("inputEMin", 0.0 );
982  desc.add<double>("jetPtMin", 5. );
983  desc.add<bool> ("doPVCorrection", false );
984  desc.add<bool> ("doAreaFastjet", false );
985  desc.add<bool> ("doRhoFastjet", false );
986  desc.add<bool> ("doPUOffsetCorr", false );
987  desc.add<double>("puPtMin", 10.);
988  desc.add<double>("nSigmaPU", 1.0 );
989  desc.add<double>("radiusPU", 0.5 );
990  desc.add<string>("subtractorName", "" );
991  desc.add<bool> ("useExplicitGhosts", false );
992  desc.add<bool> ("doAreaDiskApprox", false );
993  desc.add<double>("voronoiRfact", -0.9 );
994  desc.add<double>("Rho_EtaMax", 4.4 );
995  desc.add<double>("Ghost_EtaMax", 5. );
996  desc.add<int> ("Active_Area_Repeats", 1 );
997  desc.add<double>("GhostArea", 0.01 );
998  desc.add<bool> ("restrictInputs", false );
999  desc.add<unsigned int> ("maxInputs", 1 );
1000  desc.add<bool> ("writeCompound", false );
1001  desc.add<bool> ("writeJetsWithConst", false );
1002  desc.add<bool> ("doFastJetNonUniform", false );
1003  desc.add<bool> ("useDeterministicSeed",false );
1004  desc.add<unsigned int> ("minSeed", 14327 );
1005  desc.add<int> ("verbosity", 0 );
1006  desc.add<double>("puWidth", 0. );
1007  desc.add<unsigned int>("nExclude", 0 );
1008  desc.add<unsigned int>("maxBadEcalCells", 9999999 );
1009  desc.add<unsigned int>("maxBadHcalCells", 9999999 );
1010  desc.add<unsigned int>("maxProblematicEcalCells", 9999999 );
1011  desc.add<unsigned int>("maxProblematicHcalCells", 9999999 );
1012  desc.add<unsigned int>("maxRecoveredEcalCells", 9999999 );
1013  desc.add<unsigned int>("maxRecoveredHcalCells", 9999999 );
1014  vector<double> puCentersDefault;
1015  desc.add<vector<double>>("puCenters", puCentersDefault);
1016 }
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:39
boost::shared_ptr< fastjet::AreaDefinition > AreaDefinitionPtr
void writeJets(edm::Event &iEvent, edm::EventSetup const &iSetup)
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:41
boost::shared_ptr< fastjet::JetDefinition > JetDefPtr
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
Definition: helper.py:1
Jets made from CaloTowers.
Definition: CaloJet.h:29
static const HistoName names[]
math::PtEtaPhiMLorentzVector p4(double vtxZ) const
Definition: CaloTower.cc:129
virtual std::vector< reco::CandidatePtr > getConstituents(const std::vector< fastjet::PseudoJet > &fjConstituents)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
Ptr< value_type > ptrAt(size_type i) const
virtual void inputTowers()
Base class for all types of Jets.
Definition: Jet.h:20
boost::shared_ptr< fastjet::JetDefinition::Plugin > PluginPtr
size_type size() const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void setSourceCandidatePtr(const PFCandidatePtr &ptr)
Definition: PFCandidate.h:125
virtual void copyConstituents(const std::vector< fastjet::PseudoJet > &fjConstituents, reco::Jet *jet)
Jets made from CaloTowers.
Definition: BasicJet.h:20
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
void writeJetsWithConstituents(edm::Event &iEvent, edm::EventSetup const &iSetup)
function template to write out the outputs
Jets made from PFObjects.
Definition: PFJet.h:21
static std::string const input
Definition: EdmProvDump.cc:44
void writeCompoundJets(edm::Event &iEvent, edm::EventSetup const &iSetup)
function template to write out the outputs
bool operator()(const fastjet::PseudoJet &t1, const fastjet::PseudoJet &t2) const
boost::shared_ptr< fastjet::RangeDefinition > RangeDefPtr
U second(std::pair< T, U > const &p)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
virtual bool isAnomalousTower(reco::CandidatePtr input)
virtual void setJetArea(float fArea)
set jet area
Definition: Jet.h:103
int iEvent
Definition: GenABIO.cc:230
void addDefault(ParameterSetDescription const &psetDescription)
bool isNotFinite(T x)
Definition: isFinite.h:10
auto const T2 &decltype(t1.eta()) t2
Definition: deltaR.h:16
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
virtual void makeProduces(std::string s, std::string tag="")
T sqrt(T t)
Definition: SSEVec.h:18
vector< PseudoJet > jets
math::XYZPoint Point
point in the space
Definition: Particle.h:25
void set_excluded_jets(const std::vector< PseudoJet > &excluded_jets)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
#define M_PI
int k[5][pyjets_maxn]
virtual void setP4(const LorentzVector &p4) final
set 4-momentum
double rho()
synonym for median rho [[do we have this? Both?]]
ParticleType translatePdgIdToType(int pdgid) const
Definition: PFCandidate.cc:229
static const char *const names[]
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
Definition: deltaR.h:36
double sigma()
get the sigma
edm::EventID id() const
Definition: EventBase.h:60
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:39
fixed size matrix
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
HLT enums.
VirtualJetProducer(const edm::ParameterSet &iConfig)
boost::shared_ptr< fastjet::GhostedAreaSpec > ActiveAreaSpecPtr
void addDaughter(const CandidatePtr &)
add a daughter via a reference
static void fillDescriptionsFromVirtualJetProducer(edm::ParameterSetDescription &desc)
virtual void output(edm::Event &iEvent, edm::EventSetup const &iSetup)
long double T
static Type byName(const std::string &name)
def move(src, dest)
Definition: eostools.py:510
T get(const Candidate &c)
Definition: component.h:55
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
math::PtEtaPhiELorentzVectorF LorentzVector
math::XYZPoint Point
point in the space
Definition: LeafCandidate.h:27
void writeSpecific(reco::CaloJet &jet, reco::Particle::LorentzVector const &p4, reco::Particle::Point const &point, std::vector< reco::CandidatePtr > const &constituents, edm::EventSetup const &c)
Definition: JetSpecific.cc:41