|
|
Go to the documentation of this file.
97 : verbosity_(iConfig.getParameter<
int>(
"verbosity")),
98 triggerEvent_(
edm::
InputTag(
"hltTriggerSummaryAOD",
"",
"HLT")),
99 theTriggerResultsLabel_(
edm::
InputTag(
"TriggerResults",
"",
"HLT")),
100 labelMuon_(iConfig.getParameter<
edm::
InputTag>(
"labelMuon")),
101 labelGenTrack_(iConfig.getParameter<
edm::
InputTag>(
"labelTrack")),
102 theTrackQuality_(iConfig.getParameter<
std::
string>(
"trackQuality")),
123 desc.add<
int>(
"verbosity", 0);
127 descriptions.
add(
"studyTriggerHLT",
desc);
131 int RunNo =
iEvent.id().run();
132 int EvtNo =
iEvent.id().event();
135 edm::LogVerbatim(
"StudyHLT") <<
"RunNo " << RunNo <<
" EvtNo " << EvtNo <<
" Lumi " <<
iEvent.luminosityBlock()
136 <<
" Bunch " <<
iEvent.bunchCrossing();
142 if (!triggerEventHandle.
isValid()) {
156 const std::vector<std::string>& triggerNames_ =
triggerNames.triggerNames();
157 for (
unsigned int iHLT = 0; iHLT <
triggerResults->size(); iHLT++) {
169 if (ipos <= h_HLTAccept->GetNbinsX())
170 h_HLTAccept->GetXaxis()->SetBinLabel(ipos, newtriggerName.c_str());
173 edm::LogVerbatim(
"StudyHLT") <<
"Wrong trigger " << RunNo <<
" Event " << EvtNo <<
" Hlt " << iHLT;
188 double globalMin = 1000;
195 for (reco::TrackCollection::const_iterator track1 = trackEventHandle->begin(); track1 != trackEventHandle->end();
197 double localMin = 1000;
198 if (muonEventHandle.
isValid()) {
199 for (reco::MuonCollection::const_iterator recMuon = muonEventHandle->begin(); recMuon != muonEventHandle->end();
201 if (((recMuon->isPFMuon()) && (recMuon->isGlobalMuon() || recMuon->isTrackerMuon())) &&
202 (recMuon->innerTrack()->validFraction() > 0.49)) {
203 double chiGlobal = ((recMuon->globalTrack().isNonnull()) ? recMuon->globalTrack()->normalizedChi2() : 999);
205 (recMuon->isGlobalMuon() && chiGlobal < 3 && recMuon->combinedQuality().chi2LocalPosition < 12 &&
206 recMuon->combinedQuality().trkKink < 20);
208 double dr =
reco::deltaR(track1->eta(), track1->phi(), recMuon->eta(), recMuon->phi());
211 if (localMin < globalMin)
212 globalMin = localMin;
218 h_pt->Fill(track1->pt());
219 h_eta->Fill(track1->eta());
220 h_phi->Fill(track1->phi());
221 h_dr1->Fill(localMin);
223 h_dr3->Fill(localMin);
224 edm::LogVerbatim(
"StudyHLT") <<
"Track pT " << track1->pt() <<
" eta " << track1->eta() <<
" phi " << track1->phi()
225 <<
" minimum distance " << localMin;
228 h_dr2->Fill(globalMin);
233 h_nHLT =
fs_->
make<TH1I>(
"h_nHLT",
"size of trigger Names", 1000, 0, 1000);
234 h_HLTAccept =
fs_->
make<TH1I>(
"h_HLTAccept",
"HLT Accepts for all runs", 500, 0, 500);
235 for (
int i = 1;
i <= 500; ++
i)
237 h_nHLTvsRN =
fs_->
make<TH2I>(
"h_nHLTvsRN",
"size of trigger Names vs RunNo", 300, 319200, 319500, 100, 400, 500);
238 h_pt =
fs_->
make<TH1D>(
"h_pt",
"p_{t}", 50, 0, 20);
244 h_dr1 =
fs_->
make<TH1D>(
"dR1",
"#Delta R (Track)", 1000, 0, 0.1);
246 h_dr2 =
fs_->
make<TH1D>(
"dR2",
"#Delta R (Global)", 3000, 0, 0.000003);
248 h_dr3 =
fs_->
make<TH1D>(
"dR3",
"#Delta R (Good Track)", 1000, 0, 0.1);
254 char hname[100], htit[400];
257 sprintf(hname,
"h_HLTAccepts_%i", iRun.
run());
258 sprintf(htit,
"HLT Accepts for Run No %i", iRun.
run());
259 TH1I* hnew =
fs_->
make<TH1I>(hname, htit, 500, 0, 500);
260 for (
int i = 1;
i <= 500; ++
i)
261 hnew->GetXaxis()->SetBinLabel(
i,
" ");
276 int length =
str.length();
277 for (
int i = 0;
i < length - 2;
i++) {
278 if (
str[
i] ==
'_' &&
str[
i + 1] ==
'v' && isdigit(
str.at(
i + 2))) {
280 truncated_str =
str.substr(0,
z);
283 return (truncated_str);
edm::EDGetTokenT< reco::MuonCollection > tok_Muon_
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
std::vector< bool > mediumMuon_
T const * product() const
float segmentCompatibility(const reco::Muon &muon, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
std::vector< TH1I * > h_HLTAccepts
const edm::InputTag triggerEvent_
HLTConfigProvider hltConfig_
static const std::string triggerResults
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
const std::vector< std::string > newNames_
TrackQuality
track quality
const std::string theTrackQuality_
StudyTriggerHLT(const edm::ParameterSet &)
void endRun(edm::Run const &, edm::EventSetup const &) override
Log< level::Warning, false > LogWarning
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const edm::InputTag labelGenTrack_
reco::TrackBase::TrackQuality trackQuality_
void analyze(edm::Event const &, edm::EventSetup const &) override
#define DEFINE_FWK_MODULE(type)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const std::vector< std::string > trigNames_
edm::EDGetTokenT< trigger::TriggerEvent > tok_trigEvt
edm::Service< TFileService > fs_
std::vector< std::string > HLTNames_
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes
~StudyTriggerHLT() override
The single EDProduct to be saved for each event (AOD case)
static TrackQuality qualityByName(const std::string &name)
const edm::InputTag labelMuon_
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
Log< level::Info, true > LogVerbatim
static const std::string kSharedResource
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
std::string truncate_str(const std::string &)
void beginRun(edm::Run const &, edm::EventSetup const &) override
T * make(const Args &... args) const
make new ROOT object
const edm::InputTag theTriggerResultsLabel_