CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
fftjetcms::FFTJetInterface Class Reference

#include <FFTJetInterface.h>

Inheritance diagram for fftjetcms::FFTJetInterface:
FFTJetEFlowSmoother FFTJetPatRecoProducer FFTJetPileupProcessor FFTJetProducer

Public Member Functions

virtual ~FFTJetInterface ()
 

Protected Member Functions

template<class Ptr >
void checkConfig (const Ptr &ptr, const char *message)
 
void discretizeEnergyFlow ()
 
 FFTJetInterface (const edm::ParameterSet &)
 
double getEventScale () const
 
void loadInputCollection (const edm::Event &)
 
bool storeInSinglePrecision () const
 
const reco::Particle::PointvertexUsed () const
 

Protected Attributes

const AnomalousTower anomalous
 
std::vector< unsigned > candidateIndex
 
const bool doPVCorrection
 
std::auto_ptr< fftjet::Grid2d
< fftjetcms::Real > > 
energyFlow
 
const std::vector< double > etaDependentMagnutideFactors
 
std::vector
< fftjetcms::VectorLike
eventData
 
edm::Handle< reco::CandidateViewinputCollection
 
const edm::InputTag inputLabel
 
const JetType jetType
 
const std::string outputLabel
 
const edm::InputTag srcPVs
 

Private Member Functions

 FFTJetInterface ()
 
 FFTJetInterface (const FFTJetInterface &)
 
FFTJetInterfaceoperator= (const FFTJetInterface &)
 

Private Attributes

const double completeEventScale
 
const bool insertCompleteEvent
 
reco::Particle::Point vertex_
 

Detailed Description

Definition at line 49 of file FFTJetInterface.h.

Constructor & Destructor Documentation

virtual fftjetcms::FFTJetInterface::~FFTJetInterface ( )
inlinevirtual

Definition at line 52 of file FFTJetInterface.h.

52 {}
FFTJetInterface::FFTJetInterface ( const edm::ParameterSet ps)
explicitprotected

Definition at line 23 of file FFTJetInterface.cc.

References completeEventScale, edm::hlt::Exception, and insertCompleteEvent.

30  ps.getParameter<std::vector<double> >(
31  "etaDependentMagnutideFactors")),
35  vertex_(0.0, 0.0, 0.0)
36 {
38  throw cms::Exception("FFTJetBadConfig")
39  << "Bad scale for the complete event : must be positive"
40  << std::endl;
41 }
T getParameter(std::string const &) const
const edm::InputTag inputLabel
const edm::InputTag srcPVs
reco::Particle::Point vertex_
const std::vector< double > etaDependentMagnutideFactors
const AnomalousTower anomalous
JetType parseJetType(const std::string &name)
Definition: JetType.cc:5
#define init_param(type, varname)
const std::string outputLabel
fftjetcms::FFTJetInterface::FFTJetInterface ( )
private
fftjetcms::FFTJetInterface::FFTJetInterface ( const FFTJetInterface )
private

Member Function Documentation

template<class Ptr >
void fftjetcms::FFTJetInterface::checkConfig ( const Ptr &  ptr,
const char *  message 
)
inlineprotected

Definition at line 58 of file FFTJetInterface.h.

References NULL.

Referenced by FFTJetProducer::beginJob(), FFTJetEFlowSmoother::FFTJetEFlowSmoother(), FFTJetPatRecoProducer::FFTJetPatRecoProducer(), FFTJetPileupProcessor::FFTJetPileupProcessor(), and FFTJetProducer::FFTJetProducer().

59  {
60  if (ptr.get() == NULL)
61  throw cms::Exception("FFTJetBadConfig") << message << std::endl;
62  }
#define NULL
Definition: scimark2.h:8
void FFTJetInterface::discretizeEnergyFlow ( )
protected

Definition at line 96 of file FFTJetInterface.cc.

References energyFlow, etaDependentMagnutideFactors, eventData, g, and i.

Referenced by FFTJetEFlowSmoother::produce(), FFTJetPileupProcessor::produce(), FFTJetPatRecoProducer::produce(), and FFTJetProducer::produce().

97 {
98  // It is a bug to call this function before defining the energy flow grid
99  assert(energyFlow.get());
100 
101  fftjet::Grid2d<Real>& g(*energyFlow);
102  g.reset();
103 
104  const unsigned nInputs = eventData.size();
105  const VectorLike* inp = nInputs ? &eventData[0] : 0;
106  for (unsigned i=0; i<nInputs; ++i)
107  {
108  const VectorLike& item(inp[i]);
109  g.fill(item.Eta(), item.Phi(), item.Et());
110  }
111 
112  if (!etaDependentMagnutideFactors.empty())
113  {
114  if (etaDependentMagnutideFactors.size() != g.nEta())
115  throw cms::Exception("FFTJetBadConfig")
116  << "ERROR in FFTJetInterface::discretizeEnergyFlow() :"
117  " number of elements in the \"etaDependentMagnutideFactors\""
118  " vector is inconsistent with the grid binning"
119  << std::endl;
120  g.scaleData(&etaDependentMagnutideFactors[0],
122  }
123 }
int i
Definition: DBlmapReader.cc:9
std::auto_ptr< fftjet::Grid2d< fftjetcms::Real > > energyFlow
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
math::XYZTLorentzVector VectorLike
const std::vector< double > etaDependentMagnutideFactors
std::vector< fftjetcms::VectorLike > eventData
double FFTJetInterface::getEventScale ( ) const
protected
void FFTJetInterface::loadInputCollection ( const edm::Event iEvent)
protected

Definition at line 50 of file FFTJetInterface.cc.

References anomalous, fftjetcms::CALOJET, candidateIndex, doPVCorrection, end, eventData, edm::Event::getByLabel(), getHLTprescales::index, inputCollection, inputLabel, edm::isNotFinite(), jetType, reco::Candidate::p4(), CaloTower::p4(), reco::Candidate::pt(), srcPVs, and vertex_.

Referenced by FFTJetEFlowSmoother::produce(), FFTJetPileupProcessor::produce(), FFTJetPatRecoProducer::produce(), and FFTJetProducer::produce().

51 {
52  // Figure out if we are going to perform the vertex adjustment
53  const bool adjustForVertex = doPVCorrection && jetType == CALOJET;
54 
55  // Figure out the vertex
56  if (adjustForVertex)
57  {
59  iEvent.getByLabel(srcPVs, pvCollection);
60  if (pvCollection->empty())
61  vertex_ = reco::Particle::Point(0.0, 0.0, 0.0);
62  else
63  vertex_ = pvCollection->begin()->position();
64  }
65 
66  // Get the input collection
68 
69  // Create the set of 4-vectors needed by the algorithm
70  eventData.clear();
71  candidateIndex.clear();
72  unsigned index = 0;
75  it != end; ++it, ++index)
76  {
77  const reco::Candidate& item(*it);
78  if (anomalous(item))
79  continue;
80  if (edm::isNotFinite(item.pt()))
81  continue;
82 
83  if (adjustForVertex)
84  {
85  const CaloTower& tower(dynamic_cast<const CaloTower&>(item));
86  eventData.push_back(VectorLike(tower.p4(vertex_)));
87  }
88  else
89  eventData.push_back(item.p4());
90  candidateIndex.push_back(index);
91  }
92  assert(eventData.size() == candidateIndex.size());
93 }
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
const edm::InputTag inputLabel
edm::Handle< reco::CandidateView > inputCollection
const edm::InputTag srcPVs
std::vector< unsigned > candidateIndex
bool isNotFinite(T x)
Definition: isFinite.h:10
reco::Particle::Point vertex_
math::XYZTLorentzVector VectorLike
math::XYZPoint Point
point in the space
Definition: Particle.h:29
#define end
Definition: vmac.h:38
const AnomalousTower anomalous
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
std::vector< fftjetcms::VectorLike > eventData
FFTJetInterface& fftjetcms::FFTJetInterface::operator= ( const FFTJetInterface )
private
bool FFTJetInterface::storeInSinglePrecision ( ) const
protected
const reco::Particle::Point& fftjetcms::FFTJetInterface::vertexUsed ( ) const
inlineprotected

Definition at line 69 of file FFTJetInterface.h.

References vertex_.

Referenced by FFTJetProducer::writeJets().

69 {return vertex_;}
reco::Particle::Point vertex_

Member Data Documentation

const AnomalousTower fftjetcms::FFTJetInterface::anomalous
protected

Definition at line 90 of file FFTJetInterface.h.

Referenced by loadInputCollection().

std::vector<unsigned> fftjetcms::FFTJetInterface::candidateIndex
protected
const double fftjetcms::FFTJetInterface::completeEventScale
private

Definition at line 111 of file FFTJetInterface.h.

Referenced by FFTJetInterface(), and getEventScale().

const bool fftjetcms::FFTJetInterface::doPVCorrection
protected

Definition at line 81 of file FFTJetInterface.h.

Referenced by loadInputCollection().

std::auto_ptr<fftjet::Grid2d<fftjetcms::Real> > fftjetcms::FFTJetInterface::energyFlow
protected
const std::vector<double> fftjetcms::FFTJetInterface::etaDependentMagnutideFactors
protected

Definition at line 87 of file FFTJetInterface.h.

Referenced by discretizeEnergyFlow().

std::vector<fftjetcms::VectorLike> fftjetcms::FFTJetInterface::eventData
protected
edm::Handle<reco::CandidateView> fftjetcms::FFTJetInterface::inputCollection
protected
const edm::InputTag fftjetcms::FFTJetInterface::inputLabel
protected

Definition at line 72 of file FFTJetInterface.h.

Referenced by loadInputCollection().

const bool fftjetcms::FFTJetInterface::insertCompleteEvent
private

Definition at line 110 of file FFTJetInterface.h.

Referenced by FFTJetInterface(), and getEventScale().

const JetType fftjetcms::FFTJetInterface::jetType
protected

Definition at line 78 of file FFTJetInterface.h.

Referenced by loadInputCollection().

const std::string fftjetcms::FFTJetInterface::outputLabel
protected
const edm::InputTag fftjetcms::FFTJetInterface::srcPVs
protected

Definition at line 84 of file FFTJetInterface.h.

Referenced by loadInputCollection().

reco::Particle::Point fftjetcms::FFTJetInterface::vertex_
private

Definition at line 112 of file FFTJetInterface.h.

Referenced by loadInputCollection(), and vertexUsed().