CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/DQMOffline/Trigger/src/HLTTauDQMPlotter.cc

Go to the documentation of this file.
00001 #include "DQMOffline/Trigger/interface/HLTTauDQMPlotter.h"
00002 
00003 HLTTauDQMPlotter::HLTTauDQMPlotter() {
00004     //Declare DQM Store
00005     store_ = edm::Service<DQMStore>().operator->();
00006     validity_ = false;
00007 }
00008 
00009 HLTTauDQMPlotter::~HLTTauDQMPlotter() {
00010 }
00011 
00012 std::pair<bool,LV> HLTTauDQMPlotter::match( const LV& jet, const LVColl& McInfo, double dr ) {
00013     bool matched = false;
00014     LV out;
00015     for ( std::vector<LV>::const_iterator it = McInfo.begin(); it != McInfo.end(); ++it ) {
00016         double delta = ROOT::Math::VectorUtil::DeltaR(jet,*it);
00017         if ( delta < dr ) {
00018             matched = true;
00019             out = *it;
00020             break;
00021         }
00022     }
00023     return std::pair<bool,LV>(matched,out);
00024 }
00025 
00026 std::string HLTTauDQMPlotter::triggerTag() {
00027     if ( triggerTagAlias_ != "" ) {
00028         return dqmBaseFolder_+triggerTagAlias_;
00029     }
00030     return dqmBaseFolder_+triggerTag_;
00031 }
00032 
00033 
00034 
00035 HLTTauDQMPlotter::FilterObject::FilterObject( const edm::ParameterSet& ps ) {
00036     validity_ = false;
00037     try {
00038         FilterName_ = ps.getUntrackedParameter<edm::InputTag>("FilterName");
00039         MatchDeltaR_ = ps.getUntrackedParameter<double>("MatchDeltaR",0.5);
00040         NTriggeredTaus_ = ps.getUntrackedParameter<unsigned int>("NTriggeredTaus");
00041         TauType_ = ps.getUntrackedParameter<int>("TauType");
00042         NTriggeredLeptons_ = ps.getUntrackedParameter<unsigned int>("NTriggeredLeptons");
00043         LeptonType_ = ps.getUntrackedParameter<int>("LeptonType");
00044         Alias_ = ps.getUntrackedParameter<std::string>("Alias",FilterName_.label());
00045         validity_ = true;
00046     } catch ( cms::Exception &e ) {
00047         edm::LogInfo("HLTTauDQMPlotter::FilterObject") << e.what() << std::endl;
00048     }
00049 }
00050 
00051 HLTTauDQMPlotter::FilterObject::~FilterObject() {
00052 }
00053 
00054 int HLTTauDQMPlotter::FilterObject::leptonId() {
00055     if ( LeptonType_ == trigger::TriggerL1IsoEG || LeptonType_ == trigger::TriggerL1NoIsoEG || LeptonType_ == trigger::TriggerElectron || std::abs(LeptonType_) == 11 ) {
00056         return 11;
00057     } else if ( LeptonType_ == trigger::TriggerL1Mu || LeptonType_ == trigger::TriggerMuon || std::abs(LeptonType_) == 13 ) {
00058         return 13;
00059     } else if ( LeptonType_ == trigger::TriggerL1TauJet || LeptonType_ == trigger::TriggerL1CenJet || LeptonType_ == trigger::TriggerTau || std::abs(LeptonType_) == 15 ) {
00060         return 15;
00061     }
00062     return 0;
00063 }