CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch1/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.2 2010/12/07 00:18:18 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 
00044 //
00045 // class declaration
00046 //
00047 namespace fftjetcms {
00048   class FFTJetInterface
00049   {
00050   public:
00051     enum JetType
00052       {
00053         BASICJET = 0,
00054         GENJET,
00055         CALOJET,
00056         PFJET,
00057         TRACKJET,
00058         JPTJET
00059       };
00060 
00061     virtual ~FFTJetInterface() {}
00062 
00063     static JetType parse_jet_type(const std::string& name);
00064 
00065   protected:
00066     explicit FFTJetInterface(const edm::ParameterSet&);
00067 
00068     template<class Ptr>
00069     void checkConfig(const Ptr& ptr, const char* message)
00070     {
00071       if (ptr.get() == NULL)
00072         throw cms::Exception("FFTJetBadConfig") << message << std::endl;
00073     }
00074 
00075     void loadInputCollection(const edm::Event&);
00076     void discretizeEnergyFlow();
00077     double getEventScale() const;
00078     bool storeInSinglePrecision() const;
00079 
00080     const reco::Particle::Point& vertexUsed() const {return vertex_;}
00081 
00082     // Label for the input collection
00083     const edm::InputTag inputLabel;
00084 
00085     // Label for the output objects
00086     const std::string outputLabel;
00087 
00088     // Jet type to produce
00089     const JetType jetType;
00090 
00091     // Vertex correction-related stuff
00092     const bool doPVCorrection;
00093 
00094     // Label for the vertices
00095     const edm::InputTag srcPVs;
00096 
00097     // Try to equalize magnitudes in the energy flow grid?
00098     const std::vector<double> etaDependentMagnutideFactors;
00099 
00100     // Functor for finding anomalous towers
00101     const AnomalousTower anomalous;
00102 
00103     // Event data 4-vectors
00104     std::vector<fftjetcms::VectorLike> eventData;
00105 
00106     // Candidate number which corresponds to the item in the "eventData"
00107     std::vector<unsigned> candidateIndex;
00108 
00109     // The energy discretization grid
00110     std::auto_ptr<fftjet::Grid2d<fftjetcms::Real> > energyFlow;
00111 
00112     // The input handle for the collection of candidates
00113     edm::Handle<reco::CandidateView> inputCollection;
00114 
00115   private:
00116     // Explicitly disable other ways to construct this object
00117     FFTJetInterface();
00118     FFTJetInterface(const FFTJetInterface&);
00119     FFTJetInterface& operator=(const FFTJetInterface&);
00120 
00121     const bool insertCompleteEvent;
00122     const double completeEventScale;
00123     reco::Particle::Point vertex_;
00124   };
00125 }
00126 
00127 #endif // RecoJets_FFTJetProducers_FFTJetInterface_h