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();
142 if (!triggerEventHandle.
isValid()) {
145 triggerEvent = *(triggerEventHandle.
product());
151 if (triggerResults.
isValid()) {
152 h_nHLT->Fill(triggerResults->size());
153 h_nHLTvsRN->Fill(RunNo, triggerResults->size());
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;
178 int hlt = triggerResults->accept(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)
236 h_HLTAccept->GetXaxis()->SetBinLabel(
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);
static const std::string kSharedResource
Log< level::Info, true > LogVerbatim
EventNumber_t event() const
const edm::InputTag theTriggerResultsLabel_
edm::EDGetTokenT< trigger::TriggerEvent > tok_trigEvt
The single EDProduct to be saved for each event (AOD case)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
TrackQuality
track quality
#define DEFINE_FWK_MODULE(type)
int bunchCrossing() const
std::vector< TH1I * > h_HLTAccepts
edm::LuminosityBlockNumber_t luminosityBlock() const
T * make(const Args &...args) const
make new ROOT object
Strings const & triggerNames() const
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
const edm::InputTag labelGenTrack_
void beginRun(edm::Run const &, edm::EventSetup const &) override
edm::EDGetTokenT< reco::MuonCollection > tok_Muon_
edm::Service< TFileService > fs_
float segmentCompatibility(const reco::Muon &muon, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
reco::TrackBase::TrackQuality trackQuality_
static std::string const triggerResults
ParameterDescriptionBase * add(U const &iLabel, T const &value)
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
std::string truncate_str(const std::string &)
const std::vector< std::string > trigNames_
const edm::InputTag labelMuon_
static TrackQuality qualityByName(const std::string &name)
const edm::InputTag triggerEvent_
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
T const * product() const
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
~StudyTriggerHLT() override
const std::vector< std::string > newNames_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< bool > mediumMuon_
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
StudyTriggerHLT(const edm::ParameterSet &)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void endRun(edm::Run const &, edm::EventSetup const &) override
void analyze(edm::Event const &, edm::EventSetup const &) override
Log< level::Warning, false > LogWarning
HLTConfigProvider hltConfig_
const std::string theTrackQuality_
std::vector< std::string > HLTNames_
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)