CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/GeneratorInterface/PartonShowerVeto/interface/JetMatchingMGFastJet.h

Go to the documentation of this file.
00001 #ifndef gen_JetMatchingMGFastJet_h
00002 #define gen_JetMatchingMGFastJet_h
00003 
00004 
00005 // 
00006 //  Julia V. Yarba, Feb.10, 2013
00007 //
00008 //  This code takes inspirations in the original implemetation 
00009 //  by Steve Mrenna of FNAL (example main32), but is structured
00010 //  somewhat differently, and is also using FastJet package 
00011 //  instead of Pythia8's native SlowJet
00012 //
00013 //  At this point, we inherit from JetMatchingMadgraph,
00014 //  mainly to use parameters input machinery
00015 //
00016 
00017 #include "GeneratorInterface/PartonShowerVeto/interface/JetMatchingMadgraph.h"
00018 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00019 
00020 #include "SimDataFormats/GeneratorProducts/interface/LHECommonBlocks.h"
00021 
00022 #include "GeneratorInterface/LHEInterface/interface/LHERunInfo.h"
00023 #include "GeneratorInterface/LHEInterface/interface/LHEEvent.h"
00024 
00025 //
00026 // FastJet package/tools
00027 // Also gives PseudoJet & JetDefinition
00028 //
00029 #include "fastjet/ClusterSequence.hh"  
00030 
00031 #include <iostream>
00032 #include <fstream>
00033 
00034 namespace gen
00035 {
00036 class JetMatchingMGFastJet : public JetMatchingMadgraph
00037 {
00038 
00039    public:
00040    
00041       JetMatchingMGFastJet(const edm::ParameterSet& params) : JetMatchingMadgraph(params), 
00042                                                               fJetFinder(0),  
00043                                                               fIsInit(false) 
00044                                                               { fDJROutFlag = params.getParameter<int>("outTree_flag"); }
00045       ~JetMatchingMGFastJet() { if (fJetFinder) delete fJetFinder; }
00046             
00047       const std::vector<int>* getPartonList() { return typeIdx; }
00048    
00049    protected:
00050       virtual void init( const lhef::LHERunInfo* runInfo ) { if (fIsInit) return; JetMatchingMadgraph::init(runInfo); 
00051                                                              initAfterBeams(); fIsInit=true; return; }
00052       bool initAfterBeams();
00053       void beforeHadronisation( const lhef::LHEEvent* );
00054       void beforeHadronisationExec() { return; }
00055       
00056       int match( const lhef::LHEEvent* partonLevel, const std::vector<fastjet::PseudoJet>* jetInput );
00057    
00058    private:
00059                
00060       enum vetoStatus { NONE, LESS_JETS, MORE_JETS, HARD_JET, UNMATCHED_PARTON };
00061       enum partonTypes { ID_TOP=6, ID_GLUON=21, ID_PHOTON=22 };
00062      
00063       double qCut, qCutSq;
00064       double clFact;
00065       int nQmatch;
00066       
00067       //
00068       // these 2 below are legacy but keep here for now
00069       //
00070       //int ktScheme;
00071       //int showerKt;
00072 
00073       // Master switch for merging
00074       bool   doMerge;
00075 
00076       // Maximum and current number of jets
00077       int    nJetMax, nJetMin; 
00078 
00079       // Jet algorithm parameters
00080       int    jetAlgoPower; //  similar to memain_.mektsc ?
00081       double coneRadius, etaJetMax ;
00082 
00083       // Merging procedure control flag(s)
00084       // (there're also inclusive, exclusive, and soup/auto in JetMatchingMadgraph)
00085       //
00086       bool fExcLocal; // this is similar to memaev_.iexc
00087 
00088       // Sort final-state of incoming process into light/heavy jets and 'other'
00089       std::vector < int > typeIdx[3];
00090             
00091       // 
00092       // FastJets tool(s)
00093       //
00094       fastjet::JetDefinition* fJetFinder;
00095       std::vector<fastjet::PseudoJet> fClusJets, fPtSortedJets;      
00096       
00097       // output for DJR analysis
00098       //
00099       std::ofstream            fDJROutput;   
00100       int                      fDJROutFlag;     
00101 
00102       bool fIsInit;
00103 
00104 };
00105 
00106 } // end namespace
00107 
00108 #endif