CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
13 
20 
34 
35 #include "fastjet/SISConePlugin.hh"
36 #include "fastjet/CMSIterativeConePlugin.hh"
37 #include "fastjet/ATLASConePlugin.hh"
38 #include "fastjet/CDFMidPointPlugin.hh"
39 
40 #include <iostream>
41 #include <memory>
42 #include <algorithm>
43 #include <limits>
44 #include <cmath>
45 
46 
47 using namespace std;
48 
49 
50 namespace reco {
51  namespace helper {
53  bool operator()( const fastjet::PseudoJet & t1, const fastjet::PseudoJet & t2 ) const {
54  return t1.perp() > t2.perp();
55  }
56  };
57 
58  }
59 }
60 
61 //______________________________________________________________________________
62 const char *VirtualJetProducer::JetType::names[] = {
63  "BasicJet","GenJet","CaloJet","PFJet","TrackJet","PFClusterJet"
64 };
65 
66 
67 //______________________________________________________________________________
70 {
71  const char **pos = std::find(names, names + LastJetType, name);
72  if (pos == names + LastJetType) {
73  std::string errorMessage="Requested jetType not supported: "+name+"\n";
74  throw cms::Exception("Configuration",errorMessage);
75  }
76  return (Type)(pos-names);
77 }
78 
79 
80 void VirtualJetProducer::makeProduces( std::string alias, std::string tag )
81 {
82  if (makeCaloJet(jetTypeE)) {
83  produces<reco::CaloJetCollection>(tag).setBranchAlias(alias);
84  }
85  else if (makePFJet(jetTypeE)) {
86  produces<reco::PFJetCollection>(tag).setBranchAlias(alias);
87  }
88  else if (makeGenJet(jetTypeE)) {
89  produces<reco::GenJetCollection>(tag).setBranchAlias(alias);
90  }
91  else if (makeTrackJet(jetTypeE)) {
92  produces<reco::TrackJetCollection>(tag).setBranchAlias(alias);
93  }
94  else if (makePFClusterJet(jetTypeE)) {
95  produces<reco::PFClusterJetCollection>(tag).setBranchAlias(alias);
96  }
97  else if (makeBasicJet(jetTypeE)) {
98  produces<reco::BasicJetCollection>(tag).setBranchAlias(alias);
99  }
100 }
101 
103 // construction / destruction
105 
106 //______________________________________________________________________________
108  : moduleLabel_ (iConfig.getParameter<string> ("@module_label"))
109  , src_ (iConfig.getParameter<edm::InputTag>("src"))
110  , srcPVs_ (iConfig.getParameter<edm::InputTag>("srcPVs"))
111  , jetType_ (iConfig.getParameter<string> ("jetType"))
112  , jetAlgorithm_ (iConfig.getParameter<string> ("jetAlgorithm"))
113  , rParam_ (iConfig.getParameter<double> ("rParam"))
114  , inputEtMin_ (iConfig.getParameter<double> ("inputEtMin"))
115  , inputEMin_ (iConfig.getParameter<double> ("inputEMin"))
116  , jetPtMin_ (iConfig.getParameter<double> ("jetPtMin"))
117  , doPVCorrection_(iConfig.getParameter<bool> ("doPVCorrection"))
118  , restrictInputs_(false)
119  , maxInputs_(99999999)
120  , doAreaFastjet_ (iConfig.getParameter<bool> ("doAreaFastjet"))
121  , doAreaDiskApprox_ (false)
122  , doRhoFastjet_ (iConfig.getParameter<bool> ("doRhoFastjet"))
123  , voronoiRfact_ (-9)
124  , doPUOffsetCorr_(iConfig.getParameter<bool> ("doPUOffsetCorr"))
125  , puWidth_(0)
126  , nExclude_(0)
127  , jetCollInstanceName_ ("")
128 {
129  anomalousTowerDef_ = std::auto_ptr<AnomalousTower>(new AnomalousTower(iConfig));
130 
131  //
132  // additional parameters to think about:
133  // - overlap threshold (set to 0.75 for the time being)
134  // - p parameter for generalized kT (set to -2 for the time being)
135  // - fastjet PU subtraction parameters (not yet considered)
136  //
137  if (jetAlgorithm_=="SISCone") {
138  fjPlugin_ = PluginPtr( new fastjet::SISConePlugin(rParam_,0.75,0,0.0,false,
139  fastjet::SISConePlugin::SM_pttilde) );
140  fjJetDefinition_= JetDefPtr( new fastjet::JetDefinition(&*fjPlugin_) );
141  }
142  else if (jetAlgorithm_=="IterativeCone") {
143  fjPlugin_ = PluginPtr(new fastjet::CMSIterativeConePlugin(rParam_,1.0));
144  fjJetDefinition_= JetDefPtr(new fastjet::JetDefinition(&*fjPlugin_));
145  }
146  else if (jetAlgorithm_=="CDFMidPoint") {
147  fjPlugin_ = PluginPtr(new fastjet::CDFMidPointPlugin(rParam_,0.75));
148  fjJetDefinition_= JetDefPtr(new fastjet::JetDefinition(&*fjPlugin_));
149  }
150  else if (jetAlgorithm_=="ATLASCone") {
151  fjPlugin_ = PluginPtr(new fastjet::ATLASConePlugin(rParam_));
152  fjJetDefinition_= JetDefPtr(new fastjet::JetDefinition(&*fjPlugin_));
153  }
154  else if (jetAlgorithm_=="Kt")
155  fjJetDefinition_= JetDefPtr(new fastjet::JetDefinition(fastjet::kt_algorithm,rParam_));
156  else if (jetAlgorithm_=="CambridgeAachen")
157  fjJetDefinition_= JetDefPtr(new fastjet::JetDefinition(fastjet::cambridge_algorithm,
158  rParam_) );
159  else if (jetAlgorithm_=="AntiKt")
160  fjJetDefinition_= JetDefPtr( new fastjet::JetDefinition(fastjet::antikt_algorithm,rParam_) );
161  else if (jetAlgorithm_=="GeneralizedKt")
162  fjJetDefinition_= JetDefPtr( new fastjet::JetDefinition(fastjet::genkt_algorithm,
163  rParam_,-2) );
164  else
165  throw cms::Exception("Invalid jetAlgorithm")
166  <<"Jet algorithm for VirtualJetProducer is invalid, Abort!\n";
167 
169 
170  if ( iConfig.exists("jetCollInstanceName") ) {
171  jetCollInstanceName_ = iConfig.getParameter<string>("jetCollInstanceName");
172  }
173 
174  if ( doPUOffsetCorr_ ) {
175  if ( jetTypeE != JetType::CaloJet ) {
176  throw cms::Exception("InvalidInput") << "Can only offset correct jets of type CaloJet";
177  }
178 
179  if(iConfig.exists("subtractorName")) puSubtractorName_ = iConfig.getParameter<string> ("subtractorName");
180  else puSubtractorName_ = std::string();
181 
182  if(puSubtractorName_.empty()){
183  edm::LogWarning("VirtualJetProducer") << "Pile Up correction on; however, pile up type is not specified. Using default... \n";
184  subtractor_ = boost::shared_ptr<PileUpSubtractor>(new PileUpSubtractor(iConfig));
185  }else{
186  subtractor_ = boost::shared_ptr<PileUpSubtractor>(PileUpSubtractorFactory::get()->create( puSubtractorName_, iConfig));
187  }
188  }
189 
190  // do approximate disk-based area calculation => warn if conflicting request
191  if (iConfig.exists("doAreaDiskApprox")) {
192  doAreaDiskApprox_ = iConfig.getParameter<bool>("doAreaDiskApprox");
194  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";
195 
196  }
197  // turn off jet collection output for speed
198  // Voronoi-based area calculation allows for an empirical scale factor
199  if (iConfig.exists("voronoiRfact"))
200  voronoiRfact_ = iConfig.getParameter<double>("voronoiRfact");
201 
202 
203  // do fasjet area / rho calcluation? => accept corresponding parameters
204  if ( doAreaFastjet_ || doRhoFastjet_ ) {
205  // Eta range of jets to be considered for Rho calculation
206  // Should be at most (jet acceptance - jet radius)
207  double rhoEtaMax=iConfig.getParameter<double>("Rho_EtaMax");
208  // default Ghost_EtaMax should be 5
209  double ghostEtaMax = iConfig.getParameter<double>("Ghost_EtaMax");
210  // default Active_Area_Repeats 1
211  int activeAreaRepeats = iConfig.getParameter<int> ("Active_Area_Repeats");
212  // default GhostArea 0.01
213  double ghostArea = iConfig.getParameter<double> ("GhostArea");
214  if (voronoiRfact_ <= 0)
215  fjActiveArea_ = ActiveAreaSpecPtr(new fastjet::ActiveAreaSpec(ghostEtaMax,activeAreaRepeats,ghostArea));
216  fjRangeDef_ = RangeDefPtr( new fastjet::RangeDefinition(rhoEtaMax) );
217  }
218 
219  // restrict inputs to first "maxInputs" towers?
220  if ( iConfig.exists("restrictInputs") ) {
221  restrictInputs_ = iConfig.getParameter<bool>("restrictInputs");
222  maxInputs_ = iConfig.getParameter<unsigned int>("maxInputs");
223  }
224 
225 
226  string alias=iConfig.getUntrackedParameter<string>("alias",moduleLabel_);
227 
228  // make the "produces" statements
230 
231  doFastJetNonUniform_ = false;
232  if(iConfig.exists("doFastJetNonUniform")) doFastJetNonUniform_ = iConfig.getParameter<bool> ("doFastJetNonUniform");
234  puCenters_ = iConfig.getParameter<std::vector<double> >("puCenters");
235  puWidth_ = iConfig.getParameter<double>("puWidth");
236  nExclude_ = iConfig.getParameter<unsigned int>("nExclude");
237  }
238 
239  useDeterministicSeed_ = false;
240  minSeed_ = 0;
241  if ( iConfig.exists("useDeterministicSeed") ) {
242  useDeterministicSeed_ = iConfig.getParameter<bool>("useDeterministicSeed");
243  minSeed_ = iConfig.getParameter<unsigned int>("minSeed");
244  }
245 
246  produces<std::vector<double> >("rhos");
247  produces<std::vector<double> >("sigmas");
248  produces<double>("rho");
249  produces<double>("sigma");
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  seeds[0] = std::max(iEvent.id().run(),minSeed_ + 3) + 3 * iEvent.id().event();
276  seeds[1] = std::max(iEvent.id().run(),minSeed_ + 5) + 5 * iEvent.id().event();
277  gas.set_random_status(seeds);
278  }
279 
280  LogDebug("VirtualJetProducer") << "Entered produce\n";
281  //determine signal vertex
282  vertex_=reco::Jet::Point(0,0,0);
284  LogDebug("VirtualJetProducer") << "Adding PV info\n";
286  iEvent.getByLabel(srcPVs_,pvCollection);
287  if (pvCollection->size()>0) vertex_=pvCollection->begin()->position();
288  }
289 
290  // For Pileup subtraction using offset correction:
291  // set up geometry map
292  if ( doPUOffsetCorr_ ) {
293  subtractor_->setupGeometryMap(iEvent, iSetup);
294  }
295 
296  // clear data
297  LogDebug("VirtualJetProducer") << "Clear data\n";
298  fjInputs_.clear();
299  fjJets_.clear();
300  inputs_.clear();
301 
302  // get inputs and convert them to the fastjet format (fastjet::PeudoJet)
304  iEvent.getByLabel(src_,inputsHandle);
305  for (size_t i = 0; i < inputsHandle->size(); ++i) {
306  inputs_.push_back(inputsHandle->ptrAt(i));
307  }
308  LogDebug("VirtualJetProducer") << "Got inputs\n";
309 
310  // Convert candidates to fastjet::PseudoJets.
311  // Also correct to Primary Vertex. Will modify fjInputs_
312  // and use inputs_
313  fjInputs_.reserve(inputs_.size());
314  inputTowers();
315  LogDebug("VirtualJetProducer") << "Inputted towers\n";
316 
317  // For Pileup subtraction using offset correction:
318  // Subtract pedestal.
319  if ( doPUOffsetCorr_ ) {
321  subtractor_->calculatePedestal(fjInputs_);
322  subtractor_->subtractPedestal(fjInputs_);
323  LogDebug("VirtualJetProducer") << "Subtracted pedestal\n";
324  }
325 
326  // Run algorithm. Will modify fjJets_ and allocate fjClusterSeq_.
327  // This will use fjInputs_
328  runAlgorithm( iEvent, iSetup );
329  if ( doPUOffsetCorr_ ) {
330  subtractor_->setAlgorithm(fjClusterSeq_);
331  }
332 
333  LogDebug("VirtualJetProducer") << "Ran algorithm\n";
334 
335  // For Pileup subtraction using offset correction:
336  // Now we find jets and need to recalculate their energy,
337  // mark towers participated in jet,
338  // remove occupied towers from the list and recalculate mean and sigma
339  // put the initial towers collection to the jet,
340  // and subtract from initial towers in jet recalculated mean and sigma of towers
341  if ( doPUOffsetCorr_ ) {
342  LogDebug("VirtualJetProducer") << "Do PUOffsetCorr\n";
343  vector<fastjet::PseudoJet> orphanInput;
344  subtractor_->calculateOrphanInput(orphanInput);
345  subtractor_->calculatePedestal(orphanInput);
346  subtractor_->offsetCorrectJets();
347  }
348 
349  // Write the output jets.
350  // This will (by default) call the member function template
351  // "writeJets", but can be overridden.
352  // this will use inputs_
353  output( iEvent, iSetup );
354  LogDebug("VirtualJetProducer") << "Wrote jets\n";
355 
356  return;
357 }
358 
359 //______________________________________________________________________________
360 
362 {
363  std::vector<edm::Ptr<reco::Candidate> >::const_iterator inBegin = inputs_.begin(),
364  inEnd = inputs_.end(), i = inBegin;
365  for (; i != inEnd; ++i ) {
367  if (std::isnan(input->pt())) continue;
368  if (input->et() <inputEtMin_) continue;
369  if (input->energy()<inputEMin_) continue;
370  if (isAnomalousTower(input)) continue;
371  if (input->pt() == 0) {
372  edm::LogError("NullTransverseMomentum") << "dropping input candidate with pt=0";
373  continue;
374  }
376  const CaloTower* tower=dynamic_cast<const CaloTower*>(input.get());
378  fjInputs_.push_back(fastjet::PseudoJet(ct.px(),ct.py(),ct.pz(),ct.energy()));
379  }
380  else {
381  fjInputs_.push_back(fastjet::PseudoJet(input->px(),input->py(),input->pz(),
382  input->energy()));
383  }
384  fjInputs_.back().set_user_index(i - inBegin);
385  }
386 
387  if ( restrictInputs_ && fjInputs_.size() > maxInputs_ ) {
389  std::sort(fjInputs_.begin(), fjInputs_.end(), pTComparator);
390  fjInputs_.resize(maxInputs_);
391  edm::LogWarning("JetRecoTooManyEntries") << "Too many inputs in the event, limiting to first " << maxInputs_ << ". Output is suspect.";
392  }
393 }
394 
395 //______________________________________________________________________________
397 {
398  if (!makeCaloJet(jetTypeE))
399  return false;
400  else
401  return (*anomalousTowerDef_)(*input);
402 }
403 
404 //------------------------------------------------------------------------------
405 // This is pure virtual.
406 //______________________________________________________________________________
407 // void VirtualJetProducer::runAlgorithm( edm::Event & iEvent, edm::EventSetup const& iSetup,
408 // std::vector<edm::Ptr<reco::Candidate> > const & inputs_);
409 
410 //______________________________________________________________________________
411 void VirtualJetProducer::copyConstituents(const vector<fastjet::PseudoJet>& fjConstituents,
412  reco::Jet* jet)
413 {
414  for (unsigned int i=0;i<fjConstituents.size();++i)
415  jet->addDaughter(inputs_[fjConstituents[i].user_index()]);
416 }
417 
418 
419 //______________________________________________________________________________
420 vector<reco::CandidatePtr>
421 VirtualJetProducer::getConstituents(const vector<fastjet::PseudoJet>&fjConstituents)
422 {
423  vector<reco::CandidatePtr> result;
424  for (unsigned int i=0;i<fjConstituents.size();i++) {
425  int index = fjConstituents[i].user_index();
426  reco::CandidatePtr candidate = inputs_[index];
427  result.push_back(candidate);
428  }
429  return result;
430 }
431 
432 
433 //_____________________________________________________________________________
434 
436 {
437  // Write jets and constitutents. Will use fjJets_, inputs_
438  // and fjClusterSeq_
439  switch( jetTypeE ) {
440  case JetType::CaloJet :
441  writeJets<reco::CaloJet>( iEvent, iSetup);
442  break;
443  case JetType::PFJet :
444  writeJets<reco::PFJet>( iEvent, iSetup);
445  break;
446  case JetType::GenJet :
447  writeJets<reco::GenJet>( iEvent, iSetup);
448  break;
449  case JetType::TrackJet :
450  writeJets<reco::TrackJet>( iEvent, iSetup);
451  break;
452  case JetType::PFClusterJet :
453  writeJets<reco::PFClusterJet>( iEvent, iSetup);
454  break;
455  case JetType::BasicJet :
456  writeJets<reco::BasicJet>( iEvent, iSetup);
457  break;
458  default:
459  throw cms::Exception("InvalidInput") << "invalid jet type in VirtualJetProducer\n";
460  break;
461  };
462 
463 }
464 
465 template< typename T >
467 {
468  if (doRhoFastjet_) {
469  // declare jet collection without the two jets,
470  // for unbiased background estimation.
471  std::vector<fastjet::PseudoJet> fjexcluded_jets;
472  fjexcluded_jets=fjJets_;
473 
474  if(fjexcluded_jets.size()>2) fjexcluded_jets.resize(nExclude_);
475 
477  std::auto_ptr<std::vector<double> > rhos(new std::vector<double>);
478  std::auto_ptr<std::vector<double> > sigmas(new std::vector<double>);
479  int nEta = puCenters_.size();
480  rhos->reserve(nEta);
481  sigmas->reserve(nEta);
482  fastjet::ClusterSequenceAreaBase const* clusterSequenceWithArea =
483  dynamic_cast<fastjet::ClusterSequenceAreaBase const *> ( &*fjClusterSeq_ );
484 
485 
486  for(int ie = 0; ie < nEta; ++ie){
487  double eta = puCenters_[ie];
488  double etamin=eta-puWidth_;
489  double etamax=eta+puWidth_;
490  fastjet::RangeDefinition range_rho(etamin,etamax);
491  fastjet::BackgroundEstimator bkgestim(*clusterSequenceWithArea,range_rho);
492  bkgestim.set_excluded_jets(fjexcluded_jets);
493  rhos->push_back(bkgestim.rho());
494  sigmas->push_back(bkgestim.sigma());
495  }
496  iEvent.put(rhos,"rhos");
497  iEvent.put(sigmas,"sigmas");
498  }else{
499  std::auto_ptr<double> rho(new double(0.0));
500  std::auto_ptr<double> sigma(new double(0.0));
501  double mean_area = 0;
502 
503  fastjet::ClusterSequenceAreaBase const* clusterSequenceWithArea =
504  dynamic_cast<fastjet::ClusterSequenceAreaBase const *> ( &*fjClusterSeq_ );
505  clusterSequenceWithArea->get_median_rho_and_sigma(*fjRangeDef_,false,*rho,*sigma,mean_area);
506  iEvent.put(rho,"rho");
507  iEvent.put(sigma,"sigma");
508  }
509  } // doRhoFastjet_
510 
511  // produce output jet collection
512 
513  using namespace reco;
514 
515  std::auto_ptr<std::vector<T> > jets(new std::vector<T>() );
516  jets->reserve(fjJets_.size());
517 
518 
519  // Distance between jet centers -- for disk-based area calculation
520  std::vector<std::vector<double> > rij(fjJets_.size());
521 
522  for (unsigned int ijet=0;ijet<fjJets_.size();++ijet) {
523  // allocate this jet
524  T jet;
525  // get the fastjet jet
526  const fastjet::PseudoJet& fjJet = fjJets_[ijet];
527  // get the constituents from fastjet
528  std::vector<fastjet::PseudoJet> fjConstituents =
529  sorted_by_pt(fjClusterSeq_->constituents(fjJet));
530  // convert them to CandidatePtr vector
531  std::vector<CandidatePtr> constituents =
532  getConstituents(fjConstituents);
533 
534  // calcuate the jet area
535  double jetArea=0.0;
536  if ( doAreaFastjet_ ) {
537  fastjet::ClusterSequenceAreaBase const * clusterSequenceWithArea =
538  dynamic_cast<fastjet::ClusterSequenceAreaBase const *>(&*fjClusterSeq_);
539  jetArea = clusterSequenceWithArea->area(fjJet);
540  }
541  else if ( doAreaDiskApprox_ ) {
542  // Here it is assumed that fjJets_ is in decreasing order of pT,
543  // which should happen in FastjetJetProducer::runAlgorithm()
544  jetArea = M_PI;
545  if (ijet) {
546  std::vector<double>& distance = rij[ijet];
547  distance.resize(ijet);
548  for (unsigned jJet = 0; jJet < ijet; ++jJet) {
549  distance[jJet] = reco::deltaR(fjJets_[ijet],fjJets_[jJet]) / rParam_;
550  jetArea -= reco::helper::VirtualJetProducerHelper::intersection(distance[jJet]);
551  for (unsigned kJet = 0; kJet < jJet; ++kJet) {
552  jetArea += reco::helper::VirtualJetProducerHelper::intersection(distance[jJet], distance[kJet], rij[jJet][kJet]);
553  } // end loop over harder jets
554  } // end loop over harder jets
555  }
556  jetArea *= rParam_;
557  jetArea *= rParam_;
558  }
559 
560  // write the specifics to the jet (simultaneously sets 4-vector, vertex).
561  // These are overridden functions that will call the appropriate
562  // specific allocator.
563  writeSpecific(jet,
564  Particle::LorentzVector(fjJet.px(),
565  fjJet.py(),
566  fjJet.pz(),
567  fjJet.E()),
568  vertex_,
569  constituents, iSetup);
570 
571  jet.setJetArea (jetArea);
572 
573  if(doPUOffsetCorr_){
574  jet.setPileup(subtractor_->getPileUpEnergy(ijet));
575  }else{
576  jet.setPileup (0.0);
577  }
578 
579  // add to the list
580  jets->push_back(jet);
581  }
582 
583  // put the jets in the collection
584  iEvent.put(jets);
585 
586 
587 }
588 
589 
590 
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:42
void writeJets(edm::Event &iEvent, edm::EventSetup const &iSetup)
JetType::Type jetTypeE
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:44
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
reco::Particle::Point vertex_
math::PtEtaPhiMLorentzVector p4(double vtxZ) const
Definition: CaloTower.cc:114
virtual std::vector< reco::CandidatePtr > getConstituents(const std::vector< fastjet::PseudoJet > &fjConstituents)
std::vector< fastjet::PseudoJet > fjJets_
virtual void inputTowers()
Base class for all types of Jets.
Definition: Jet.h:21
boost::shared_ptr< fastjet::JetDefinition::Plugin > PluginPtr
Definition: DDAxes.h:10
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::string puSubtractorName_
std::vector< double > puCenters_
T eta() const
virtual void copyConstituents(const std::vector< fastjet::PseudoJet > &fjConstituents, reco::Jet *jet)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
virtual void runAlgorithm(edm::Event &iEvent, const edm::EventSetup &iSetup)=0
double deltaR(double eta1, double phi1, double eta2, double phi2)
Definition: deltaR.h:19
bool operator()(const fastjet::PseudoJet &t1, const fastjet::PseudoJet &t2) const
boost::shared_ptr< fastjet::RangeDefinition > RangeDefPtr
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:26
virtual bool isAnomalousTower(reco::CandidatePtr input)
static const char * names[]
std::vector< fastjet::PseudoJet > fjInputs_
int iEvent
Definition: GenABIO.cc:243
std::string jetCollInstanceName_
boost::shared_ptr< PileUpSubtractor > subtractor_
std::vector< edm::Ptr< reco::Candidate > > inputs_
T const * get() const
Returns C++ pointer to the item.
Definition: Ptr.h:148
const T & max(const T &a, const T &b)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
bool isnan(float x)
Definition: math.h:13
ClusterSequencePtr fjClusterSeq_
virtual void makeProduces(std::string s, std::string tag="")
tuple result
Definition: query.py:137
void set_excluded_jets(const std::vector< PseudoJet > &excluded_jets)
boost::shared_ptr< fastjet::JetDefinition > JetDefPtr
std::auto_ptr< AnomalousTower > anomalousTowerDef_
ActiveAreaSpecPtr fjActiveArea_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
tuple input
Definition: collect_tpl.py:10
#define M_PI
Definition: BFit3D.cc:3
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup)
double rho()
synonym for median rho [[do we have this? Both?]]
double sigma()
get the sigma
edm::EventID id() const
Definition: EventBase.h:56
VirtualJetProducer(const edm::ParameterSet &iConfig)
void addDaughter(const CandidatePtr &)
add a daughter via a reference
virtual void output(edm::Event &iEvent, edm::EventSetup const &iSetup)
boost::shared_ptr< fastjet::ActiveAreaSpec > ActiveAreaSpecPtr
long double T
static const HistoName names[]
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:26
bool makeCaloJet(const JetType::Type &fTag)
static Type byName(const std::string &name)
T get(const Candidate &c)
Definition: component.h:56
math::XYZPoint Point
point in the space
Definition: LeafCandidate.h:29
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