CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
BTVHLTOfflineSource Class Reference

#include <BTVHLTOfflineSource.h>

Inheritance diagram for BTVHLTOfflineSource:
DQMEDAnalyzer edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

class  PathInfo
 
class  PathInfoCollection
 

Public Member Functions

 BTVHLTOfflineSource (const edm::ParameterSet &)
 
 ~BTVHLTOfflineSource () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
 DQMEDAnalyzer ()
 
 DQMEDAnalyzer (DQMEDAnalyzer const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer &&)=delete
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDAnalyzer () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &run, edm::EventSetup const &c) override
 
void dqmBeginRun (edm::Run const &run, edm::EventSetup const &c) override
 

Private Attributes

edm::Handle< std::vector< reco::TemplatedSecondaryVertexTagInfo< reco::IPTagInfo< edm::RefVector< std::vector< reco::Track >, reco::Track, edm::refhelper::FindUsingAdvance< std::vector< reco::Track >, reco::Track > >, reco::JTATagInfo >, reco::Vertex > > > caloTagInfos
 
edm::Handle< reco::JetTagCollectioncaloTags
 
edm::EDGetTokenT< reco::JetTagCollectioncaloTagsToken_
 
std::vector< std::pair< std::string, std::string > > custompathnamepairs_
 
std::string dirname_
 
std::string filtername_
 
edm::EDGetTokenT< std::vector< reco::Vertex > > hltCaloPVToken_
 
HLTConfigProvider hltConfig_
 
edm::EDGetTokenT< std::vector< reco::Vertex > > hltFastPVToken_
 
PathInfoCollection hltPathsAll_
 
edm::EDGetTokenT< std::vector< reco::Vertex > > hltPFPVToken_
 
edm::EDGetTokenT< reco::JetTagCollectionofflineDiscrTokenb_
 
edm::EDGetTokenT< reco::JetTagCollectionofflineDiscrTokenbb_
 
edm::EDGetTokenT< std::vector< reco::Vertex > > offlinePVToken_
 
std::string pathname_
 
edm::Handle< std::vector< reco::TemplatedSecondaryVertexTagInfo< reco::IPTagInfo< edm::RefVector< std::vector< reco::Track >, reco::Track, edm::refhelper::FindUsingAdvance< std::vector< reco::Track >, reco::Track > >, reco::JTATagInfo >, reco::Vertex > > > pfTagInfos
 
edm::Handle< reco::JetTagCollectionpfTags
 
edm::EDGetTokenT< reco::JetTagCollectionpfTagsToken_
 
std::string processname_
 
edm::Handle< std::vector< reco::ShallowTagInfo > > shallowTagInfosCalo
 
edm::Handle< std::vector< reco::ShallowTagInfo > > shallowTagInfosPf
 
edm::EDGetTokenT< std::vector< reco::ShallowTagInfo > > shallowTagInfosTokenCalo_
 
edm::EDGetTokenT< std::vector< reco::ShallowTagInfo > > shallowTagInfosTokenPf_
 
edm::TriggerNames triggerNames_
 
edm::Handle< trigger::TriggerEventtriggerObj_
 
edm::Handle< edm::TriggerResultstriggerResults_
 
edm::EDGetTokenT< edm::TriggerResultstriggerResultsFUToken
 
edm::InputTag triggerResultsLabel_
 
edm::EDGetTokenT< edm::TriggerResultstriggerResultsToken
 
edm::EDGetTokenT< trigger::TriggerEventtriggerSummaryFUToken
 
edm::InputTag triggerSummaryLabel_
 
edm::EDGetTokenT< trigger::TriggerEventtriggerSummaryToken
 
float turnon_threshold_loose_
 
float turnon_threshold_medium_
 
float turnon_threshold_tight_
 
bool verbose_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 44 of file BTVHLTOfflineSource.h.

Constructor & Destructor Documentation

BTVHLTOfflineSource::BTVHLTOfflineSource ( const edm::ParameterSet iConfig)
explicit

Definition at line 39 of file BTVHLTOfflineSource.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), edm::InputTag::instance(), edm::InputTag::label(), LogDebug, callgraph::path, AlCaHLTBitMon_QueryRunRegistry::string, and ~BTVHLTOfflineSource().

40 {
41  LogDebug("BTVHLTOfflineSource") << "constructor....";
42 
43  dirname_ = iConfig.getUntrackedParameter("dirname",std::string("HLT/BTV/"));
44  processname_ = iConfig.getParameter<std::string>("processname");
45  verbose_ = iConfig.getUntrackedParameter< bool >("verbose", false);
46  triggerSummaryLabel_ = iConfig.getParameter<edm::InputTag>("triggerSummaryLabel");
47  triggerResultsLabel_ = iConfig.getParameter<edm::InputTag>("triggerResultsLabel");
48  turnon_threshold_loose_ = iConfig.getParameter<double>("turnon_threshold_loose");
49  turnon_threshold_medium_ = iConfig.getParameter<double>("turnon_threshold_medium");
50  turnon_threshold_tight_ = iConfig.getParameter<double>("turnon_threshold_tight");
51  triggerSummaryToken = consumes <trigger::TriggerEvent> (triggerSummaryLabel_);
52  triggerResultsToken = consumes <edm::TriggerResults> (triggerResultsLabel_);
53  triggerSummaryFUToken = consumes <trigger::TriggerEvent> (edm::InputTag(triggerSummaryLabel_.label(),triggerSummaryLabel_.instance(),std::string("FU")));
54  triggerResultsFUToken = consumes <edm::TriggerResults> (edm::InputTag(triggerResultsLabel_.label(),triggerResultsLabel_.instance(),std::string("FU")));
55  shallowTagInfosTokenCalo_ = consumes<vector<reco::ShallowTagInfo> > (edm::InputTag("hltDeepCombinedSecondaryVertexBJetTagsInfosCalo"));
56  shallowTagInfosTokenPf_ = consumes<vector<reco::ShallowTagInfo> > (edm::InputTag("hltDeepCombinedSecondaryVertexBJetTagsInfos"));
57  // caloTagInfosToken_ = consumes<vector<reco::TemplatedSecondaryVertexTagInfo<reco::IPTagInfo<edm::RefVector<vector<reco::Track>,reco::Track,edm::refhelper::FindUsingAdvance<vector<reco::Track>,reco::Track> >,reco::JTATagInfo>,reco::Vertex> > > (
58  // edm::InputTag("hltCombinedSecondaryVertexBJetTagsCalo"));
59  // pfTagInfosToken_ = consumes<vector<reco::TemplatedSecondaryVertexTagInfo<reco::IPTagInfo<edm::RefVector<vector<reco::Track>,reco::Track,edm::refhelper::FindUsingAdvance<vector<reco::Track>,reco::Track> >,reco::JTATagInfo>,reco::Vertex> > > (
60  // edm::InputTag("hltCombinedSecondaryVertexBJetTagsPF"));
61  pfTagsToken_ = consumes<reco::JetTagCollection> (iConfig.getParameter<edm::InputTag>("onlineDiscrLabelPF"));
62  caloTagsToken_ = consumes<reco::JetTagCollection> (iConfig.getParameter<edm::InputTag>("onlineDiscrLabelCalo"));
63  offlineDiscrTokenb_ = consumes<reco::JetTagCollection> (iConfig.getParameter<edm::InputTag>("offlineDiscrLabelb"));
64  offlineDiscrTokenbb_ = consumes<reco::JetTagCollection> (iConfig.getParameter<edm::InputTag>("offlineDiscrLabelbb"));
65  hltFastPVToken_ = consumes<std::vector<reco::Vertex> > (iConfig.getParameter<edm::InputTag>("hltFastPVLabel"));
66  hltPFPVToken_ = consumes<std::vector<reco::Vertex> > (iConfig.getParameter<edm::InputTag>("hltPFPVLabel"));
67  hltCaloPVToken_ = consumes<std::vector<reco::Vertex> > (iConfig.getParameter<edm::InputTag>("hltCaloPVLabel"));
68  offlinePVToken_ = consumes<std::vector<reco::Vertex> > (iConfig.getParameter<edm::InputTag>("offlinePVLabel"));
69 
70  std::vector<edm::ParameterSet> paths = iConfig.getParameter<std::vector<edm::ParameterSet> >("pathPairs");
71  for(auto & path : paths) {
72  custompathnamepairs_.push_back(make_pair(
73  path.getParameter<std::string>("pathname"),
74  path.getParameter<std::string>("pathtype")
75  ));}
76 }
#define LogDebug(id)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< std::vector< reco::ShallowTagInfo > > shallowTagInfosTokenCalo_
edm::EDGetTokenT< reco::JetTagCollection > pfTagsToken_
edm::EDGetTokenT< reco::JetTagCollection > offlineDiscrTokenb_
edm::EDGetTokenT< std::vector< reco::Vertex > > hltCaloPVToken_
edm::EDGetTokenT< std::vector< reco::Vertex > > offlinePVToken_
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryFUToken
edm::InputTag triggerResultsLabel_
edm::InputTag triggerSummaryLabel_
edm::EDGetTokenT< reco::JetTagCollection > offlineDiscrTokenbb_
edm::EDGetTokenT< std::vector< reco::Vertex > > hltFastPVToken_
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken
edm::EDGetTokenT< std::vector< reco::Vertex > > hltPFPVToken_
std::string const & label() const
Definition: InputTag.h:36
std::vector< std::pair< std::string, std::string > > custompathnamepairs_
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryToken
edm::EDGetTokenT< std::vector< reco::ShallowTagInfo > > shallowTagInfosTokenPf_
edm::EDGetTokenT< reco::JetTagCollection > caloTagsToken_
std::string const & instance() const
Definition: InputTag.h:37
edm::EDGetTokenT< edm::TriggerResults > triggerResultsFUToken
BTVHLTOfflineSource::~BTVHLTOfflineSource ( )
overridedefault

Referenced by BTVHLTOfflineSource().

Member Function Documentation

void BTVHLTOfflineSource::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 107 of file BTVHLTOfflineSource.cc.

References gather_cfg::cout, reco::deltaR(), edm::EventID::event(), edm::Event::getByToken(), edm::EventBase::id(), edm::HandleBase::isValid(), reco::btau::jetNSecondaryVertices, reco::btau::jetNSelectedTracks, edm::EventBase::luminosityBlock(), edm::EventID::run(), reco::btau::trackSip3dSig, reco::btau::trackSip3dVal, edm::Event::triggerNames(), findQualityFiles::v, heppy_batch::val, reco::btau::vertexMass, and reco::btau::vertexNTracks.

108 {
110  if(!triggerResults_.isValid()) {
112  if(!triggerResults_.isValid()) {
113  edm::LogInfo("BTVHLTOfflineSource") << "TriggerResults not found, "
114  "skipping event";
115  return;
116  }
117  }
118 
120 
122  if(!triggerObj_.isValid()) {
124  if(!triggerObj_.isValid()) {
125  edm::LogInfo("BTVHLTOfflineSource") << "TriggerEvent not found, "
126  "skipping event";
127  return;
128  }
129  }
130 
132  iEvent.getByToken(pfTagsToken_, pfTags);
133 
134  Handle<reco::VertexCollection> VertexHandler;
135 
136  Handle<reco::JetTagCollection> offlineJetTagHandlerb;
137  iEvent.getByToken(offlineDiscrTokenb_, offlineJetTagHandlerb);
138 
139  Handle<reco::JetTagCollection> offlineJetTagHandlerbb;
140  iEvent.getByToken(offlineDiscrTokenbb_, offlineJetTagHandlerbb);
141 
142  Handle<reco::VertexCollection> offlineVertexHandler;
143  iEvent.getByToken(offlinePVToken_, offlineVertexHandler);
144 
145  if(verbose_ && iEvent.id().event()%10000==0)
146  cout<<"Run = "<<iEvent.id().run()<<", LS = "<<iEvent.luminosityBlock()<<", Event = "<<iEvent.id().event()<<endl;
147 
148  if(!triggerResults_.isValid()) return;
149 
150  for(auto & v : hltPathsAll_) {
151  unsigned index = triggerNames_.triggerIndex(v.getPath());
152  if (!(index < triggerNames_.size())) {
153  continue;
154  }
155 
156  // PF and Calo btagging
157  if ( (v.getTriggerType() == "PF" && pfTags.isValid())
158  || (v.getTriggerType() == "Calo" && caloTags.isValid() && !caloTags->empty()) )
159  {
160  const auto & iter = (v.getTriggerType() == "PF") ? pfTags->begin() : caloTags->begin();
161 
162  float Discr_online = iter->second;
163  if (Discr_online<0) Discr_online = -0.05;
164 
165  v.Discr->Fill(Discr_online);
166  v.Pt->Fill(iter->first->pt());
167  v.Eta->Fill(iter->first->eta());
168 
169  if(offlineJetTagHandlerb.isValid()){
170  for (auto const & iterOffb : *offlineJetTagHandlerb){
171  float DR = reco::deltaR(iterOffb.first->eta(),iterOffb.first->phi(),iter->first->eta(),iter->first->phi());
172  if (DR<0.3) {
173  float Discr_offline = iterOffb.second;
174 
175  // offline probb and probbb must be added (if probbb isn't specified, it'll just use probb)
176  if(offlineJetTagHandlerbb.isValid()){
177  for (auto const & iterOffbb : *offlineJetTagHandlerbb){
178  DR = reco::deltaR(iterOffbb.first->eta(),iterOffbb.first->phi(),iter->first->eta(),iter->first->phi());
179  if (DR<0.3) {
180  Discr_offline += iterOffbb.second;
181  break;
182  }
183  }
184  }
185 
186  if (Discr_offline<0) Discr_offline = -0.05;
187  v.Discr_HLTvsRECO->Fill(Discr_online, Discr_offline);
188  v.Discr_HLTMinusRECO->Fill(Discr_online - Discr_offline);
189 
190  v.Discr_turnon_loose .denominator->Fill(Discr_offline);
191  v.Discr_turnon_medium.denominator->Fill(Discr_offline);
192  v.Discr_turnon_tight .denominator->Fill(Discr_offline);
193 
194  if (Discr_online > turnon_threshold_loose_) v.Discr_turnon_loose .numerator->Fill(Discr_offline);
195  if (Discr_online > turnon_threshold_medium_)v.Discr_turnon_medium.numerator->Fill(Discr_offline);
196  if (Discr_online > turnon_threshold_tight_) v.Discr_turnon_tight .numerator->Fill(Discr_offline);
197 
198  break;
199  }
200  }
201  }
202 
203  if (v.getTriggerType() == "PF") {
204  iEvent.getByToken(hltPFPVToken_, VertexHandler);
205  } else {
206  iEvent.getByToken(hltFastPVToken_, VertexHandler);
207  }
208  if (VertexHandler.isValid()) {
209  v.PVz->Fill(VertexHandler->begin()->z());
210  if (offlineVertexHandler.isValid()) {
211  v.PVz_HLTMinusRECO->Fill(VertexHandler->begin()->z()-offlineVertexHandler->begin()->z());
212  }
213  }
214  }
215 
216  // specific to Calo b-tagging
217  if (caloTags.isValid() && v.getTriggerType() == "Calo" && !caloTags->empty()) {
218  iEvent.getByToken(hltCaloPVToken_, VertexHandler);
219  if (VertexHandler.isValid()) {
220  v.fastPVz->Fill(VertexHandler->begin()->z());
221  if (offlineVertexHandler.isValid()) {
222  v.fastPVz_HLTMinusRECO->Fill(VertexHandler->begin()->z()-offlineVertexHandler->begin()->z());
223  }
224  }
225  }
226 
227 
228  // additional plots from tag info collections
230 
233  // iEvent.getByToken(pfTagInfosToken_, pfTagInfos);
234  // iEvent.getByToken(caloTagInfosToken_, caloTagInfos);
235 
236  // first try to get info from shallowTagInfos ...
237  if ( (v.getTriggerType() == "PF" && shallowTagInfosPf.isValid())
238  || (v.getTriggerType() == "Calo" && shallowTagInfosCalo.isValid()) )
239  {
240  const auto & shallowTagInfoCollection = (v.getTriggerType() == "PF") ? shallowTagInfosPf : shallowTagInfosCalo;
241  for (const auto & shallowTagInfo : *shallowTagInfoCollection) {
242  const auto & tagVars = shallowTagInfo.taggingVariables();
243 
244  // n secondary vertices and n selected tracks
245  for (const auto & tagVar : tagVars.getList(reco::btau::jetNSecondaryVertices, false)) {
246  v.n_vtx->Fill(tagVar);
247  }
248  for (const auto & tagVar : tagVars.getList(reco::btau::jetNSelectedTracks, false)) {
249  v.n_sel_tracks->Fill(tagVar);}
250 
251  // impact parameter
252  const auto & trackSip3dVal = tagVars.getList(reco::btau::trackSip3dVal, false);
253  const auto & trackSip3dSig = tagVars.getList(reco::btau::trackSip3dSig, false);
254  for (unsigned i_trk=0; i_trk < trackSip3dVal.size(); i_trk++) {
255  float val = trackSip3dVal[i_trk];
256  float sig = trackSip3dSig[i_trk];
257  v.h_3d_ip_distance->Fill(val);
258  v.h_3d_ip_error->Fill(val/sig);
259  v.h_3d_ip_sig->Fill(sig);
260  }
261 
262  // vertex mass and tracks per vertex
263  for (const auto & tagVar : tagVars.getList(reco::btau::vertexMass, false)) {
264  v.vtx_mass->Fill(tagVar);}
265  for (const auto & tagVar : tagVars.getList(reco::btau::vertexNTracks, false)) {
266  v.n_vtx_trks->Fill(tagVar);}
267 
268  // // track N total/pixel hits
269  // for (const auto & tagVar : tagVars.getList(reco::btau::trackNPixelHits, false)) {
270  // v.n_pixel_hits->Fill(tagVar);}
271  // for (const auto & tagVar : tagVars.getList(reco::btau::trackNTotalHits, false)) {
272  // v.n_total_hits->Fill(tagVar);}
273  }
274  }
275 
276  // ... otherwise from usual tag infos.
277  // else
278  // if ( (v.getTriggerType() == "PF" && pfTagInfos.isValid())
279  // || (v.getTriggerType() == "Calo" && caloTagInfos.isValid()) )
280  // {
281  // const auto & DiscrTagInfoCollection = (v.getTriggerType() == "PF") ? pfTagInfos : caloTagInfos;
282 
283  // // loop over secondary vertex tag infos
284  // for (const auto & DiscrTagInfo : *DiscrTagInfoCollection) {
285  // v.n_vtx->Fill(DiscrTagInfo.nVertexCandidates());
286  // v.n_sel_tracks->Fill(DiscrTagInfo.nSelectedTracks());
287 
288  // // loop over selected tracks in each tag info
289  // for (unsigned i_trk=0; i_trk < DiscrTagInfo.nSelectedTracks(); i_trk++) {
290  // const auto & ip3d = DiscrTagInfo.trackIPData(i_trk).ip3d;
291  // v.h_3d_ip_distance->Fill(ip3d.value());
292  // v.h_3d_ip_error->Fill(ip3d.error());
293  // v.h_3d_ip_sig->Fill(ip3d.significance());
294  // }
295 
296  // // loop over vertex candidates in each tag info
297  // for (unsigned i_sv=0; i_sv < DiscrTagInfo.nVertexCandidates(); i_sv++) {
298  // const auto & sv = DiscrTagInfo.secondaryVertex(i_sv);
299  // v.vtx_mass->Fill(sv.p4().mass());
300  // v.n_vtx_trks->Fill(sv.nTracks());
301 
302  // // loop over tracks for number of pixel and total hits
303  // const auto & trkIPTagInfo = DiscrTagInfo.trackIPTagInfoRef().get();
304  // for (const auto & trk : trkIPTagInfo->selectedTracks()) {
305  // v.n_pixel_hits->Fill(trk.get()->hitPattern().numberOfValidPixelHits());
306  // v.n_total_hits->Fill(trk.get()->hitPattern().numberOfValidHits());
307  // }
308  // }
309  // }
310  // }
311  }
312 }
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
edm::EDGetTokenT< std::vector< reco::ShallowTagInfo > > shallowTagInfosTokenCalo_
edm::Handle< trigger::TriggerEvent > triggerObj_
edm::EDGetTokenT< reco::JetTagCollection > pfTagsToken_
edm::EDGetTokenT< reco::JetTagCollection > offlineDiscrTokenb_
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:63
edm::EDGetTokenT< std::vector< reco::Vertex > > hltCaloPVToken_
Strings::size_type size() const
Definition: TriggerNames.cc:39
edm::Handle< std::vector< reco::ShallowTagInfo > > shallowTagInfosPf
edm::EDGetTokenT< std::vector< reco::Vertex > > offlinePVToken_
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryFUToken
edm::Handle< edm::TriggerResults > triggerResults_
unsigned int triggerIndex(std::string const &name) const
Definition: TriggerNames.cc:32
edm::Handle< reco::JetTagCollection > pfTags
PathInfoCollection hltPathsAll_
bool isValid() const
Definition: HandleBase.h:74
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:28
edm::EDGetTokenT< reco::JetTagCollection > offlineDiscrTokenbb_
edm::EDGetTokenT< std::vector< reco::Vertex > > hltFastPVToken_
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken
edm::EDGetTokenT< std::vector< reco::Vertex > > hltPFPVToken_
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryToken
edm::EventID id() const
Definition: EventBase.h:60
edm::EDGetTokenT< std::vector< reco::ShallowTagInfo > > shallowTagInfosTokenPf_
edm::Handle< reco::JetTagCollection > caloTags
const_iterator begin() const
edm::EDGetTokenT< reco::JetTagCollection > caloTagsToken_
edm::TriggerNames triggerNames_
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:301
edm::EDGetTokenT< edm::TriggerResults > triggerResultsFUToken
edm::Handle< std::vector< reco::ShallowTagInfo > > shallowTagInfosCalo
void BTVHLTOfflineSource::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  run,
edm::EventSetup const &  c 
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 315 of file BTVHLTOfflineSource.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DEFINE_FWK_MODULE, HLTConfigProvider::removeVersion(), DQMStore::IBooker::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, fftjetcommon_cfi::title, and findQualityFiles::v.

316 {
317  iBooker.setCurrentFolder(dirname_);
318  for(auto & v : hltPathsAll_){
319  //
320  std::string trgPathName = HLTConfigProvider::removeVersion(v.getPath());
321  std::string subdirName = dirname_ +"/"+ trgPathName + v.getTriggerType();
322  std::string trigPath = "("+trgPathName+")";
323  iBooker.setCurrentFolder(subdirName);
324 
325  std::string labelname("HLT");
326  std::string histoname(labelname+"");
327  std::string title(labelname+"");
328 
329  histoname = labelname+"_Discr";
330  title = labelname+"_Discr "+trigPath;
331  v.Discr = iBooker.book1D(histoname.c_str(),title.c_str(),110,-0.1,1);
332 
333  histoname = labelname+"_Pt";
334  title = labelname+"_Pt "+trigPath;
335  v.Pt = iBooker.book1D(histoname.c_str(),title.c_str(),100,0,400);
336 
337  histoname = labelname+"_Eta";
338  title = labelname+"_Eta "+trigPath;
339  v.Eta = iBooker.book1D(histoname.c_str(),title.c_str(),60,-3.0,3.0);
340 
341  histoname = "HLTvsRECO_Discr";
342  title = "online discr vs offline discr "+trigPath;
343  v.Discr_HLTvsRECO = iBooker.book2D(histoname.c_str(),title.c_str(),110,-0.1,1,110,-0.1,1);
344 
345  histoname = "HLTMinusRECO_Discr";
346  title = "online discr minus offline discr "+trigPath;
347  v.Discr_HLTMinusRECO = iBooker.book1D(histoname.c_str(),title.c_str(),100,-1,1);
348 
349  histoname = "Turnon_loose_Discr";
350  title = "turn-on with loose threshold "+trigPath;
351  v.bookME(iBooker, v.Discr_turnon_loose, histoname, title, 22, -0.1, 1.);
352 
353  histoname = "Turnon_medium_Discr";
354  title = "turn-on with medium threshold "+trigPath;
355  v.bookME(iBooker, v.Discr_turnon_medium, histoname, title, 22, -0.1, 1.);
356 
357  histoname = "Turnon_tight_Discr";
358  title = "turn-on with tight threshold "+trigPath;
359  v.bookME(iBooker, v.Discr_turnon_tight, histoname, title, 22, -0.1, 1.);
360 
361  histoname = labelname+"_PVz";
362  title = "online z(PV) "+trigPath;
363  v.PVz = iBooker.book1D(histoname.c_str(),title.c_str(),80,-20,20);
364 
365  histoname = labelname+"_fastPVz";
366  title = "online z(fastPV) "+trigPath;
367  v.fastPVz = iBooker.book1D(histoname.c_str(),title.c_str(),80,-20,20);
368 
369  histoname = "HLTMinusRECO_PVz";
370  title = "online z(PV) - offline z(PV) "+trigPath;
371  v.PVz_HLTMinusRECO = iBooker.book1D(histoname.c_str(),title.c_str(),200,-0.5,0.5);
372 
373  histoname = "HLTMinusRECO_fastPVz";
374  title = "online z(fastPV) - offline z(PV) "+trigPath;
375  v.fastPVz_HLTMinusRECO = iBooker.book1D(histoname.c_str(),title.c_str(),100,-2,2);
376 
377  histoname = "n_vtx";
378  title = "N vertex candidates "+trigPath;
379  v.n_vtx = iBooker.book1D(histoname.c_str(),title.c_str(), 10, -0.5, 9.5);
380 
381  histoname = "vtx_mass";
382  title = "secondary vertex mass (GeV)"+trigPath;
383  v.vtx_mass = iBooker.book1D(histoname.c_str(), title.c_str(), 20, 0, 10);
384 
385  histoname = "n_vtx_trks";
386  title = "N tracks associated to secondary vertex"+trigPath;
387  v.n_vtx_trks = iBooker.book1D(histoname.c_str(), title.c_str(), 20, -0.5, 19.5);
388 
389  histoname = "n_sel_tracks";
390  title = "N selected tracks"+trigPath;
391  v.n_sel_tracks = iBooker.book1D(histoname.c_str(), title.c_str(), 25, -0.5, 24.5);
392 
393  histoname = "3d_ip_distance";
394  title = "3D IP distance of tracks (cm)"+trigPath;
395  v.h_3d_ip_distance = iBooker.book1D(histoname.c_str(), title.c_str(), 40, -0.1, 0.1);
396 
397  histoname = "3d_ip_error";
398  title = "3D IP error of tracks (cm)"+trigPath;
399  v.h_3d_ip_error = iBooker.book1D(histoname.c_str(), title.c_str(), 40, 0., 0.1);
400 
401  histoname = "3d_ip_sig";
402  title = "3D IP significance of tracks (cm)"+trigPath;
403  v.h_3d_ip_sig = iBooker.book1D(histoname.c_str(), title.c_str(), 40, -40, 40);
404 
405  // histoname = "n_pixel_hits";
406  // title = "N pixel hits"+trigPath;
407  // v.n_pixel_hits = iBooker.book1D(histoname.c_str(), title.c_str(), 16, -0.5, 15.5);
408 
409  // histoname = "n_total_hits";
410  // title = "N hits"+trigPath;
411  // v.n_total_hits = iBooker.book1D(histoname.c_str(), title.c_str(), 40, -0.5, 39.5);
412  }
413 }
static const std::string removeVersion(const std::string &trigger)
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
PathInfoCollection hltPathsAll_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
void BTVHLTOfflineSource::dqmBeginRun ( edm::Run const &  run,
edm::EventSetup const &  c 
)
overrideprivatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 81 of file BTVHLTOfflineSource.cc.

References mps_fire::i, LogDebug, and AlCaHLTBitMon_QueryRunRegistry::string.

82 {
83  bool changed = true;
84  if (!hltConfig_.init(run, c, processname_, changed)) {
85  LogDebug("BTVHLTOfflineSource") << "HLTConfigProvider failed to initialize.";
86  }
87 
88  for (unsigned int i=0; i!=hltConfig_.size(); ++i) {
90  filtername_ = "dummy";
91  unsigned int usedPrescale = 1;
92  unsigned int objectType = 0;
93  std::string triggerType = "";
94 
95  for (auto & custompathnamepair : custompathnamepairs_) {
96  if(pathname_.find(custompathnamepair.first) != std::string::npos) {
97  triggerType = custompathnamepair.second;
98  hltPathsAll_.push_back(
99  PathInfo(usedPrescale, pathname_, "dummy", processname_, objectType, triggerType));
100  }
101  }
102  }
103 }
#define LogDebug(id)
unsigned int size() const
number of trigger paths in trigger table
const std::string & triggerName(unsigned int triggerIndex) const
PathInfoCollection hltPathsAll_
HLTConfigProvider hltConfig_
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
std::vector< std::pair< std::string, std::string > > custompathnamepairs_

Member Data Documentation

Definition at line 94 of file BTVHLTOfflineSource.h.

edm::Handle<reco::JetTagCollection> BTVHLTOfflineSource::caloTags
private

Definition at line 100 of file BTVHLTOfflineSource.h.

edm::EDGetTokenT<reco::JetTagCollection> BTVHLTOfflineSource::caloTagsToken_
private

Definition at line 98 of file BTVHLTOfflineSource.h.

std::vector<std::pair<std::string, std::string> > BTVHLTOfflineSource::custompathnamepairs_
private

Definition at line 60 of file BTVHLTOfflineSource.h.

std::string BTVHLTOfflineSource::dirname_
private

Definition at line 55 of file BTVHLTOfflineSource.h.

std::string BTVHLTOfflineSource::filtername_
private

Definition at line 58 of file BTVHLTOfflineSource.h.

edm::EDGetTokenT<std::vector<reco::Vertex> > BTVHLTOfflineSource::hltCaloPVToken_
private

Definition at line 74 of file BTVHLTOfflineSource.h.

HLTConfigProvider BTVHLTOfflineSource::hltConfig_
private

Definition at line 103 of file BTVHLTOfflineSource.h.

edm::EDGetTokenT<std::vector<reco::Vertex> > BTVHLTOfflineSource::hltFastPVToken_
private

Definition at line 72 of file BTVHLTOfflineSource.h.

PathInfoCollection BTVHLTOfflineSource::hltPathsAll_
private

Definition at line 182 of file BTVHLTOfflineSource.h.

edm::EDGetTokenT<std::vector<reco::Vertex> > BTVHLTOfflineSource::hltPFPVToken_
private

Definition at line 73 of file BTVHLTOfflineSource.h.

edm::EDGetTokenT<reco::JetTagCollection> BTVHLTOfflineSource::offlineDiscrTokenb_
private

Definition at line 69 of file BTVHLTOfflineSource.h.

edm::EDGetTokenT<reco::JetTagCollection> BTVHLTOfflineSource::offlineDiscrTokenbb_
private

Definition at line 70 of file BTVHLTOfflineSource.h.

edm::EDGetTokenT<std::vector<reco::Vertex> > BTVHLTOfflineSource::offlinePVToken_
private

Definition at line 75 of file BTVHLTOfflineSource.h.

std::string BTVHLTOfflineSource::pathname_
private

Definition at line 57 of file BTVHLTOfflineSource.h.

Definition at line 96 of file BTVHLTOfflineSource.h.

edm::Handle<reco::JetTagCollection> BTVHLTOfflineSource::pfTags
private

Definition at line 101 of file BTVHLTOfflineSource.h.

edm::EDGetTokenT<reco::JetTagCollection> BTVHLTOfflineSource::pfTagsToken_
private

Definition at line 99 of file BTVHLTOfflineSource.h.

std::string BTVHLTOfflineSource::processname_
private

Definition at line 56 of file BTVHLTOfflineSource.h.

edm::Handle<std::vector<reco::ShallowTagInfo> > BTVHLTOfflineSource::shallowTagInfosCalo
private

Definition at line 85 of file BTVHLTOfflineSource.h.

edm::Handle<std::vector<reco::ShallowTagInfo> > BTVHLTOfflineSource::shallowTagInfosPf
private

Definition at line 86 of file BTVHLTOfflineSource.h.

edm::EDGetTokenT<std::vector<reco::ShallowTagInfo> > BTVHLTOfflineSource::shallowTagInfosTokenCalo_
private

Definition at line 82 of file BTVHLTOfflineSource.h.

edm::EDGetTokenT<std::vector<reco::ShallowTagInfo> > BTVHLTOfflineSource::shallowTagInfosTokenPf_
private

Definition at line 83 of file BTVHLTOfflineSource.h.

edm::TriggerNames BTVHLTOfflineSource::triggerNames_
private

Definition at line 105 of file BTVHLTOfflineSource.h.

edm::Handle<trigger::TriggerEvent> BTVHLTOfflineSource::triggerObj_
private

Definition at line 106 of file BTVHLTOfflineSource.h.

edm::Handle<edm::TriggerResults> BTVHLTOfflineSource::triggerResults_
private

Definition at line 104 of file BTVHLTOfflineSource.h.

edm::EDGetTokenT<edm::TriggerResults> BTVHLTOfflineSource::triggerResultsFUToken
private

Definition at line 78 of file BTVHLTOfflineSource.h.

edm::InputTag BTVHLTOfflineSource::triggerResultsLabel_
private

Definition at line 63 of file BTVHLTOfflineSource.h.

edm::EDGetTokenT<edm::TriggerResults> BTVHLTOfflineSource::triggerResultsToken
private

Definition at line 77 of file BTVHLTOfflineSource.h.

edm::EDGetTokenT<trigger::TriggerEvent> BTVHLTOfflineSource::triggerSummaryFUToken
private

Definition at line 80 of file BTVHLTOfflineSource.h.

edm::InputTag BTVHLTOfflineSource::triggerSummaryLabel_
private

Definition at line 62 of file BTVHLTOfflineSource.h.

edm::EDGetTokenT<trigger::TriggerEvent> BTVHLTOfflineSource::triggerSummaryToken
private

Definition at line 79 of file BTVHLTOfflineSource.h.

float BTVHLTOfflineSource::turnon_threshold_loose_
private

Definition at line 65 of file BTVHLTOfflineSource.h.

float BTVHLTOfflineSource::turnon_threshold_medium_
private

Definition at line 66 of file BTVHLTOfflineSource.h.

float BTVHLTOfflineSource::turnon_threshold_tight_
private

Definition at line 67 of file BTVHLTOfflineSource.h.

bool BTVHLTOfflineSource::verbose_
private

Definition at line 54 of file BTVHLTOfflineSource.h.