00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef CAFUTIL_MUONSELECTOR_HPP__
00020 #define CAFUTIL_MUONSELECTOR_HPP__
00021
00022 #include "cafe/Stat.hpp"
00023 #include "caf_util/TRefFinder.hpp"
00024 #include "cafe/Event.hpp"
00025 #include "cafe/SelectUserObjects.hpp"
00026 #include "tmb_tree/TMBMuon.hpp"
00027
00028 namespace caf_util {
00029
00107 class MuonSelector : public cafe::SelectUserObjects<TMBMuon>
00108 {
00109 public:
00110 MuonSelector(const char *name);
00111 ~MuonSelector() {}
00112 bool processEvent(cafe::Event &event);
00113 bool selectObject(const TMBMuon &muon);
00114 private:
00115 void before(cafe::Collection<TMBMuon>& from) ;
00116 void after(cafe::Collection<TMBMuon>& accepted, cafe::Collection<TMBMuon>& rejected);
00117 private:
00118 enum Quality {Loose, Medium, Tight} ;
00119
00120 cafe::StatPointer _stat ;
00121
00122 int _nmuons ;
00123 int _nmuonsmax ;
00124 int _nselected ;
00125
00126 Quality _qual ;
00127 int _nseg ;
00128 float _pTcut ;
00129 float _eta ;
00130 float _chisq ;
00131 float _dcaSignif ;
00132 float _dcaSMT;
00133 float _dcaNoSMT;
00134 int _nSMT;
00135 float _etHalo ;
00136 float _etHaloMin ;
00137 float _etHaloScaled ;
00138 float _etHaloScaledMin ;
00139 float _etTrkCone ;
00140 float _etTrkConeMin ;
00141 float _etTrkConeScaled ;
00142 float _etTrkConeScaledMin ;
00143 bool _useCentralMatched ;
00144 bool _cosmicVeto ;
00145 bool _sort;
00146 bool _use_beam_spot;
00147 bool _reject_no_beam_spot;
00148 bool _corr_pT_SMT;
00149 bool _corr_pT_noSMT;
00150 bool _mc;
00151 bool _excludeHole;
00152
00153
00154 cafe::Collection<TMBJet> _jets;
00155 float _MinDeltaR;
00156 float _MaxDeltaR;
00157 std::string _JetBranch;
00158
00159 cafe::Event* _event ;
00160 cafe::Variables _jetvars ;
00161 TRefFinder _finder ;
00162
00163
00164
00165
00166
00167 bool _use_muid;
00168 bool _cuts_set;
00169 std::string _muqual_file;
00170 std::string _muqual_name;
00171 int _muqual_version;
00172 std::string _trkqual_file;
00173 std::string _trkqual_name;
00174 int _trkqual_version;
00175 std::string _isoqual_file;
00176 std::string _isoqual_name;
00177 int _isoqual_version;
00178 std::string _path;
00179
00180
00181 FILE *_beamspot_file;
00182 std::string _beam;
00183 bool _open_beam;
00184 float _bx, _by, _bsx, _bsy;
00185 int _lastrun;
00186 cafe::Variables _runvar;
00187 bool GetBeamSpot(FILE *fp, int run, float &bx, float &by, float &bsx, float &bsy);
00188 cafe::Variables _chunkvar;
00189 double DCAfromBeamSpot(const TMBTrack* muon_trk);
00190
00191
00192 double GetCorrectedPt(const TMBMuon& muon, double dca);
00193
00194
00195 bool SetStdCuts(std::string path, std::string mu_file_name, std::string mu_name, int mu_ver, std::string trk_file_name, std::string trk_name, int trk_ver, std::string iso_file_name, std::string iso_name, int iso_ver);
00196
00197
00198 void DisplayMuonQualityCuts();
00199 void DisplayMuonTrackQualityCuts();
00200 void DisplayMuonIsolationQualityCuts();
00201
00202
00203 int _debuglevel;
00204
00205 ClassDef(MuonSelector, 0) ;
00206 };
00207
00208 }
00209 #endif // CAFUTIL_MUONSELECTOR_HPP__