CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/RecoJets/FFTJetProducers/interface/FFTJetInterface.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:    FFTJetProducers
00004 // Class:      FFTJetInterface
00005 // 
00011 //
00012 // Original Author:  Igor Volobouev
00013 //         Created:  June 29 2010
00014 // $Id: FFTJetInterface.h,v 1.3 2012/08/06 21:36:54 igv Exp $
00015 //
00016 //
00017 
00018 #ifndef RecoJets_FFTJetProducers_FFTJetInterface_h
00019 #define RecoJets_FFTJetProducers_FFTJetInterface_h
00020 
00021 #include <memory>
00022 #include <vector>
00023 #include <cassert>
00024 
00025 // FFTJet headers
00026 #include "fftjet/Grid2d.hh"
00027 
00028 // framework include files
00029 #include "FWCore/ParameterSet/interface/ParameterSetfwd.h"
00030 #include "FWCore/Framework/interface/Event.h"
00031 #include "FWCore/Utilities/interface/Exception.h"
00032 
00033 #include "DataFormats/Candidate/interface/Particle.h"
00034 
00035 #include "RecoJets/JetProducers/interface/AnomalousTower.h"
00036 
00037 #include "DataFormats/Candidate/interface/Candidate.h"
00038 #include "DataFormats/Candidate/interface/CandidateFwd.h"
00039 #include "DataFormats/Common/interface/Handle.h"
00040 
00041 // local FFTJet-related definitions
00042 #include "RecoJets/FFTJetAlgorithms/interface/fftjetTypedefs.h"
00043 #include "RecoJets/FFTJetProducers/interface/JetType.h"
00044 
00045 //
00046 // class declaration
00047 //
00048 namespace fftjetcms {
00049   class FFTJetInterface
00050   {
00051   public:
00052     virtual ~FFTJetInterface() {}
00053 
00054   protected:
00055     explicit FFTJetInterface(const edm::ParameterSet&);
00056 
00057     template<class Ptr>
00058     void checkConfig(const Ptr& ptr, const char* message)
00059     {
00060       if (ptr.get() == NULL)
00061         throw cms::Exception("FFTJetBadConfig") << message << std::endl;
00062     }
00063 
00064     void loadInputCollection(const edm::Event&);
00065     void discretizeEnergyFlow();
00066     double getEventScale() const;
00067     bool storeInSinglePrecision() const;
00068 
00069     const reco::Particle::Point& vertexUsed() const {return vertex_;}
00070 
00071     // Label for the input collection
00072     const edm::InputTag inputLabel;
00073 
00074     // Label for the output objects
00075     const std::string outputLabel;
00076 
00077     // Jet type to produce
00078     const JetType jetType;
00079 
00080     // Vertex correction-related stuff
00081     const bool doPVCorrection;
00082 
00083     // Label for the vertices
00084     const edm::InputTag srcPVs;
00085 
00086     // Try to equalize magnitudes in the energy flow grid?
00087     const std::vector<double> etaDependentMagnutideFactors;
00088 
00089     // Functor for finding anomalous towers
00090     const AnomalousTower anomalous;
00091 
00092     // Event data 4-vectors
00093     std::vector<fftjetcms::VectorLike> eventData;
00094 
00095     // Candidate number which corresponds to the item in the "eventData"
00096     std::vector<unsigned> candidateIndex;
00097 
00098     // The energy discretization grid
00099     std::auto_ptr<fftjet::Grid2d<fftjetcms::Real> > energyFlow;
00100 
00101     // The input handle for the collection of candidates
00102     edm::Handle<reco::CandidateView> inputCollection;
00103 
00104   private:
00105     // Explicitly disable other ways to construct this object
00106     FFTJetInterface();
00107     FFTJetInterface(const FFTJetInterface&);
00108     FFTJetInterface& operator=(const FFTJetInterface&);
00109 
00110     const bool insertCompleteEvent;
00111     const double completeEventScale;
00112     reco::Particle::Point vertex_;
00113   };
00114 }
00115 
00116 #endif // RecoJets_FFTJetProducers_FFTJetInterface_h