00001 #ifndef __JETCLEANINGTOOL__
00002 #define __JETCLEANINGTOOL__
00003
00012
00013 #include <string>
00014 #include <vector>
00015 #include <unordered_map>
00016
00017
00018 #include "AsgTools/AsgTool.h"
00019 #include "JetInterface/IJetSelector.h"
00020
00021
00022 #include "xAODJet/Jet.h"
00023
00024
00025 #include "PATCore/TAccept.h"
00026
00027 namespace JCT { class HotCell; }
00028
00029 class JetCleaningTool : public asg::AsgTool , virtual public IJetSelector
00030 {
00031
00032 ASG_TOOL_CLASS(JetCleaningTool,IJetSelector)
00033
00034 public:
00036 enum CleaningLevel{ LooseBad , LooseBadLLP, LooseBadTrigger, TightBad , UnknownCut };
00037
00039 JetCleaningTool(const std::string& name="JetCleaningTool");
00040
00042 JetCleaningTool(const CleaningLevel alevel, const bool doUgly=false);
00043
00045 JetCleaningTool(const std::string& name , const CleaningLevel alevel, const bool doUgly=false);
00046
00048 virtual ~JetCleaningTool();
00049
00051 virtual StatusCode initialize();
00052
00054 const Root::TAccept& accept( const double emf,
00055 const double hecf,
00056 const double larq,
00057 const double hecq,
00058
00059 const double sumpttrk,
00060 const double eta,
00061 const double pt,
00062 const double fmax,
00063 const double negE ,
00064 const double AverageLArQF,
00065 const int fMaxIndex ) const;
00066
00068 const Root::TAccept& accept( const xAOD::Jet& jet) const;
00069
00070 int keep(const xAOD::Jet& jet) const
00071 #if __cplusplus >= 201100
00072 final
00073 #endif // GCC XML, you make me so sad, with your lack of C++11 support making my code ugly
00074 { return accept(jet); }
00075
00077 bool containsHotCells( const xAOD::Jet& jet, const unsigned int runNumber) const;
00078
00080 CleaningLevel getCutLevel( const std::string ) const;
00081 std::string getCutName( const CleaningLevel ) const;
00082
00083 private:
00085 std::string m_cutName;
00086 CleaningLevel m_cutLevel;
00087 bool m_doUgly;
00088
00090 mutable Root::TAccept m_accept;
00091
00093 std::string m_hotCellsFile;
00094 std::unordered_map<unsigned int, std::vector<JCT::HotCell*>*>* m_hotCellsMap;
00095 StatusCode readHotCells();
00096
00097 };
00098
00099
00100
00101 #endif