00001 #ifndef HLTTauDQMSource_H
00002 #define HLTTauDQMSource_H
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include <memory>
00012 #include <unistd.h>
00013 #include <FWCore/Framework/interface/EDAnalyzer.h>
00014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00015 #include "DQMServices/Core/interface/MonitorElement.h"
00016 #include "DQMServices/Core/interface/DQMStore.h"
00017 #include "DataFormats/Common/interface/Handle.h"
00018 #include "FWCore/Framework/interface/Event.h"
00019 #include "FWCore/Framework/interface/EventSetup.h"
00020 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00021 #include "FWCore/ServiceRegistry/interface/Service.h"
00022 #include "DataFormats/HLTReco/interface/TriggerEventWithRefs.h"
00023 #include "DataFormats/HLTReco/interface/TriggerRefsCollections.h"
00024 #include "DataFormats/Math/interface/LorentzVector.h"
00025 #include "DataFormats/L1Trigger/interface/L1JetParticle.h"
00026 #include "DataFormats/L1Trigger/interface/L1JetParticleFwd.h"
00027 #include "Math/GenVector/VectorUtil.h"
00028 #include "DataFormats/HLTReco/interface/TriggerEvent.h"
00029
00030
00031 #include "DataFormats/METReco/interface/CaloMETCollection.h"
00032 #include "DataFormats/METReco/interface/CaloMET.h"
00033
00034
00035 #include "DataFormats/EgammaCandidates/interface/Electron.h"
00036 #include "DataFormats/EgammaCandidates/interface/ElectronFwd.h"
00037
00038
00039 #include "DataFormats/RecoCandidate/interface/RecoChargedCandidateFwd.h"
00040 #include "DataFormats/RecoCandidate/interface/RecoChargedCandidate.h"
00041
00042
00043 #include "DataFormats/RecoCandidate/interface/RecoEcalCandidateFwd.h"
00044 #include "DataFormats/RecoCandidate/interface/RecoEcalCandidate.h"
00045
00046
00047 #include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidateFwd.h"
00048 #include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidate.h"
00049
00050
00051
00052 #include "DataFormats/TauReco/interface/L2TauInfoAssociation.h"
00053
00054
00055 #include "DataFormats/BTauReco/interface/IsolatedTauTagInfo.h"
00056 #include "DataFormats/TrackReco/interface/Track.h"
00057
00058
00059
00060
00061
00062
00063
00064 typedef math::XYZTLorentzVectorD LV;
00065 typedef std::vector<LV> LVColl;
00066
00067 class HLTTauDQMSource : public edm::EDAnalyzer {
00068 public:
00069 HLTTauDQMSource( const edm::ParameterSet& );
00070 ~HLTTauDQMSource();
00071
00072 protected:
00073
00075 void beginJob(const edm::EventSetup& c);
00076
00078 void beginRun(const edm::Run& r, const edm::EventSetup& c);
00079
00081 void analyze(const edm::Event& e, const edm::EventSetup& c) ;
00082
00084 void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
00085 const edm::EventSetup& context) ;
00087 void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
00088 const edm::EventSetup& c);
00090 void endRun(const edm::Run& r, const edm::EventSetup& c);
00091
00093 void endJob();
00094
00095
00096
00097 private:
00098 DQMStore* dbe_;
00099
00100
00101
00102
00103 std::string mainFolder_;
00104 std::string monitorName_;
00105 std::string outputFile_;
00106
00107 int counterEvt_;
00108 int prescaleEvt_;
00109 bool disable_;
00110
00111
00112 bool verbose_;
00113 unsigned nTriggeredTaus_;
00114 double EtMin_;
00115 double EtMax_;
00116 int NEtBins_;
00117 int NEtaBins_;
00118 bool doBackup_;
00119
00120
00121 edm::InputTag triggerEvent_;
00122 edm::InputTag l1Filter_;
00123 edm::InputTag l2Reco_;
00124 edm::InputTag l2Filter_;
00125 edm::InputTag l25Filter_;
00126 edm::InputTag l3Filter_;
00127 edm::InputTag mainPath_;
00128 edm::InputTag l1BackupPath_;
00129 edm::InputTag l2BackupPath_;
00130 edm::InputTag l25BackupPath_;
00131 edm::InputTag l3BackupPath_;
00132
00133
00134
00135 std::vector<edm::InputTag> refFilters_;
00136 std::vector<int> refIDs_;
00137
00138
00139 std::vector<double> PtCut_;
00140 std::vector<std::string> refFilterDesc_;
00141 double corrDeltaR_;
00142
00143
00144 std::vector<double> METCut_;
00145 edm::InputTag MET_;
00146
00147
00148
00149 bool doL2Monitoring_;
00150 edm::InputTag l2AssocMap_;
00151
00152
00153
00154 bool doL25Monitoring_;
00155 edm::InputTag l25IsolInfo_;
00156
00157
00158
00159 bool doL3Monitoring_;
00160 edm::InputTag l3IsolInfo_;
00161
00162
00163
00164 int NEventsPassedL1;
00165 int NEventsPassedL2Reco;
00166 int NEventsPassedL2;
00167 int NEventsPassedL25;
00168 int NEventsPassedL3;
00169
00170
00171 int L1EffNum;
00172 int L1EffDenom;
00173 int L2EffNum;
00174 int L2EffDenom;
00175 int L25EffNum;
00176 int L25EffDenom;
00177 int L3EffNum;
00178 int L3EffDenom;
00179
00180
00181
00182 std::vector<int> NEventsPassedRefL1;
00183 std::vector<int> NEventsPassedRefL2Reco;
00184 std::vector<int> NEventsPassedRefL2;
00185 std::vector<int> NEventsPassedRefL25;
00186 std::vector<int> NEventsPassedRefL3;
00187
00188
00189
00190 std::vector<int> L1EffNumRef;
00191 std::vector<int> L2RecoEffNumRef;
00192 std::vector<int> L2EffNumRef;
00193 std::vector<int> L25EffNumRef;
00194 std::vector<int> L3EffNumRef;
00195
00196 std::vector<int> DenomRef;
00197
00198
00199
00200
00201
00202
00203
00204
00205 MonitorElement *triggerBitInfo_;
00206 MonitorElement *triggerEfficiencyBackup_;
00207
00208
00209
00210 std::vector<MonitorElement*> triggerBitInfoRef_;
00211 std::vector<MonitorElement*> triggerEfficiencyRef_;
00212
00213
00214
00215 MonitorElement* L2JetEt_;
00216 MonitorElement* L2JetEta_;
00217 MonitorElement* L2EcalIsolEt_;
00218 MonitorElement* L2TowerIsolEt_;
00219 MonitorElement* L2SeedTowerEt_;
00220 MonitorElement* L2NClusters_;
00221 MonitorElement* L2ClusterEtaRMS_;
00222 MonitorElement* L2ClusterPhiRMS_;
00223 MonitorElement* L2ClusterDeltaRRMS_;
00224
00225
00226 std::vector<MonitorElement*> L2JetEtRef_;
00227 std::vector<MonitorElement*> L2JetEtaRef_;
00228 std::vector<MonitorElement*> L2EcalIsolEtRef_;
00229 std::vector<MonitorElement*> L2TowerIsolEtRef_;
00230 std::vector<MonitorElement*> L2SeedTowerEtRef_;
00231 std::vector<MonitorElement*> L2NClustersRef_;
00232 std::vector<MonitorElement*> L2ClusterEtaRMSRef_;
00233 std::vector<MonitorElement*> L2ClusterPhiRMSRef_;
00234 std::vector<MonitorElement*> L2ClusterDeltaRRMSRef_;
00235
00236
00237
00238 MonitorElement* L25JetEt_;
00239 MonitorElement* L25JetEta_;
00240 MonitorElement* L25NPixelTracks_;
00241 MonitorElement* L25NQPixelTracks_;
00242 MonitorElement* L25HasLeadingTrack_;
00243 MonitorElement* L25LeadTrackPt_;
00244 MonitorElement* L25SumTrackPt_;
00245
00246
00247 std::vector<MonitorElement*> L25JetEtRef_;
00248 std::vector<MonitorElement*> L25JetEtaRef_;
00249 std::vector<MonitorElement*> L25NPixelTracksRef_;
00250 std::vector<MonitorElement*> L25NQPixelTracksRef_;
00251 std::vector<MonitorElement*> L25HasLeadingTrackRef_;
00252 std::vector<MonitorElement*> L25LeadTrackPtRef_;
00253 std::vector<MonitorElement*> L25SumTrackPtRef_;
00254
00255
00256 MonitorElement* L3JetEt_;
00257 MonitorElement* L3JetEta_;
00258 MonitorElement* L3NPixelTracks_;
00259 MonitorElement* L3NQPixelTracks_;
00260 MonitorElement* L3HasLeadingTrack_;
00261 MonitorElement* L3LeadTrackPt_;
00262 MonitorElement* L3SumTrackPt_;
00263
00264
00265 std::vector<MonitorElement*> L3JetEtRef_;
00266 std::vector<MonitorElement*> L3JetEtaRef_;
00267 std::vector<MonitorElement*> L3NPixelTracksRef_;
00268 std::vector<MonitorElement*> L3NQPixelTracksRef_;
00269 std::vector<MonitorElement*> L3HasLeadingTrackRef_;
00270 std::vector<MonitorElement*> L3LeadTrackPtRef_;
00271 std::vector<MonitorElement*> L3SumTrackPtRef_;
00272
00273
00274
00275 void doSummary(const edm::Event& e, const edm::EventSetup& c);
00276 void doL2(const edm::Event& e, const edm::EventSetup& c);
00277 void doL25(const edm::Event& e, const edm::EventSetup& c);
00278 void doL3(const edm::Event& e, const edm::EventSetup& c);
00279
00280 bool match(const LV&,const LVColl& ,double,double);
00281 std::vector<double> calcEfficiency(int,int);
00282 LVColl importObjectColl(edm::InputTag&,int,const edm::Event&);
00283 LVColl importFilterColl(edm::InputTag&,int,const edm::Event&);
00284
00285
00286 };
00287
00288 #endif
00289