CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
L1TTauOffline Class Reference

#include <L1TTauOffline.h>

Inheritance diagram for L1TTauOffline:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 L1TTauOffline (const edm::ParameterSet &ps)
 
 ~L1TTauOffline () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void beginRun (edm::Run const &, edm::EventSetup const &) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDAnalyzerBase () 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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &eSetup) override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &eSetup) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (const edm::Run &run, const edm::EventSetup &iSetup) override
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &eSetup) override
 
void endRun (edm::Run const &run, edm::EventSetup const &eSetup) override
 
const reco::Vertex getPrimaryVertex (edm::Handle< reco::VertexCollection > const &vertex, edm::Handle< reco::BeamSpot > const &beamSpot)
 
void getProbeTaus (const edm::Event &e, edm::Handle< reco::PFTauCollection > const &taus, edm::Handle< reco::MuonCollection > const &muons, const reco::Vertex &vertex)
 
void getTauL1tPairs (edm::Handle< l1t::TauBxCollection > const &l1tCands)
 
void getTightMuons (edm::Handle< reco::MuonCollection > const &muons, edm::Handle< reco::PFMETCollection > const &mets, const reco::Vertex &vertex, edm::Handle< trigger::TriggerEvent > const &trigEvent)
 
bool matchHlt (edm::Handle< trigger::TriggerEvent > const &triggerEvent, const reco::Muon *muon)
 
- 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)
 

Private Member Functions

void bookTauHistos (DQMStore::IBooker &)
 
double calcDeltaPhi (double phi1, double phi2)
 
double Distance (const reco::Candidate &c1, const reco::Candidate &c2)
 
double DistancePhi (const reco::Candidate &c1, const reco::Candidate &c2)
 

Private Attributes

edm::EDGetTokenT< reco::PFTauDiscriminatorAntiEleInputTag_
 
edm::EDGetTokenT< reco::PFTauDiscriminatorAntiMuInputTag_
 
edm::EDGetTokenT< reco::BeamSpotBsInputTag_
 
edm::EDGetTokenT< reco::PFTauDiscriminatorcomb3TInputTag_
 
edm::EDGetTokenT< reco::PFTauDiscriminatorDecayModeFindingInputTag_
 
std::string efficiencyFolder_
 
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_EE_pass_
 
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_EE_total_
 
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_pass_
 
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_total_
 
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EE_pass_
 
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EE_total_
 
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_EE_pass_
 
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_EE_total_
 
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_pass_
 
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_total_
 
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EE_pass_
 
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EE_total_
 
MonitorElementh_L1TauEtavsTauEta_
 
MonitorElementh_L1TauETvsTauET_EB_
 
MonitorElementh_L1TauETvsTauET_EB_EE_
 
MonitorElementh_L1TauETvsTauET_EE_
 
MonitorElementh_L1TauPhivsTauPhi_EB_
 
MonitorElementh_L1TauPhivsTauPhi_EB_EE_
 
MonitorElementh_L1TauPhivsTauPhi_EE_
 
MonitorElementh_nVertex_
 
MonitorElementh_resolutionTauET_EB_
 
MonitorElementh_resolutionTauET_EB_EE_
 
MonitorElementh_resolutionTauET_EE_
 
MonitorElementh_resolutionTauEta_
 
MonitorElementh_resolutionTauPhi_EB_
 
MonitorElementh_resolutionTauPhi_EB_EE_
 
MonitorElementh_resolutionTauPhi_EE_
 
MonitorElementh_tagAndProbeMass_
 
std::string histFolder_
 
edm::ESHandle< MagneticFieldm_BField
 
HLTConfigProvider m_hltConfig
 
BXVector< l1t::Taum_L1tL1tTaus
 
std::vector< int > m_L1tPtCuts
 
std::vector< l1t::TauBxCollectionm_L1tTaus
 
float m_MaxHltTauDR
 
float m_MaxL1tTauDR
 
float m_MaxTauEta
 
std::vector< const reco::PFTau * > m_ProbeTaus
 
edm::ESHandle< Propagatorm_propagatorAlong
 
edm::ESHandle< Propagatorm_propagatorOpposite
 
std::vector< reco::PFTaum_RecoRecoTaus
 
std::vector< reco::PFTauCollectionm_RecoTaus
 
std::vector< TauL1TPairm_TauL1tPairs
 
std::vector< const reco::Muon * > m_TightMuons
 
std::vector< int > m_trigIndices
 
edm::EDGetTokenT< reco::PFMETCollectionMetInputTag_
 
edm::EDGetTokenT< reco::MuonCollectionMuonInputTag_
 
math::XYZPoint PVPoint_
 
edm::EDGetTokenT< l1t::TauBxCollectionstage2CaloLayer2TauToken_
 
std::vector< double > tauEfficiencyBins_
 
std::vector< int > tauEfficiencyThresholds_
 
edm::EDGetTokenT< reco::PFTauCollectiontheTauCollection_
 
edm::EDGetTokenT< trigger::TriggerEventtriggerEvent_
 
std::vector< std::string > triggerPath_
 
edm::EDGetTokenT< edm::TriggerResultstriggerResults_
 
std::string trigProcess_
 
edm::EDGetTokenT< reco::VertexCollectionVtxInputTag_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 80 of file L1TTauOffline.h.

Constructor & Destructor Documentation

L1TTauOffline::L1TTauOffline ( const edm::ParameterSet ps)

Definition at line 48 of file L1TTauOffline.cc.

48  :
49  theTauCollection_(consumes < reco::PFTauCollection > (ps.getUntrackedParameter < edm::InputTag > ("tauInputTag"))),
50  AntiMuInputTag_(consumes<reco::PFTauDiscriminator>(ps.getUntrackedParameter<edm::InputTag>("antiMuInputTag"))),
51  AntiEleInputTag_(consumes<reco::PFTauDiscriminator>(ps.getUntrackedParameter<edm::InputTag>("antiEleInputTag"))),
52  DecayModeFindingInputTag_(consumes<reco::PFTauDiscriminator>(ps.getUntrackedParameter<edm::InputTag>("decayModeFindingInputTag"))),
53  comb3TInputTag_(consumes<reco::PFTauDiscriminator>(ps.getUntrackedParameter<edm::InputTag>("comb3TInputTag"))),
54  MuonInputTag_(consumes<reco::MuonCollection>(ps.getUntrackedParameter<edm::InputTag>("muonInputTag"))),
55  MetInputTag_(consumes<reco::PFMETCollection>(ps.getUntrackedParameter<edm::InputTag>("metInputTag"))),
56  VtxInputTag_(consumes<reco::VertexCollection>(ps.getUntrackedParameter<edm::InputTag>("vtxInputTag"))),
57  BsInputTag_(consumes<reco::BeamSpot>(ps.getUntrackedParameter<edm::InputTag>("bsInputTag"))),
58  triggerEvent_(consumes < trigger::TriggerEvent > (ps.getUntrackedParameter < edm::InputTag > ("trigInputTag"))),
59  trigProcess_(ps.getUntrackedParameter<string>("trigProcess")),
60  triggerResults_(consumes < edm::TriggerResults > (ps.getUntrackedParameter < edm::InputTag > ("trigProcess_token"))),
61  triggerPath_(ps.getUntrackedParameter < vector<std::string> > ("triggerNames")),
62  histFolder_(ps.getParameter < std::string > ("histFolder")),
63  efficiencyFolder_(histFolder_ + "/efficiency_raw"),
64  stage2CaloLayer2TauToken_(consumes < l1t::TauBxCollection > (ps.getUntrackedParameter < edm::InputTag > ("l1tInputTag"))),
65  tauEfficiencyThresholds_(ps.getParameter < std::vector<int> > ("tauEfficiencyThresholds")),
66  tauEfficiencyBins_(ps.getParameter < std::vector<double> > ("tauEfficiencyBins"))
67 {
68  edm::LogInfo("L1TTauOffline") << "Constructor " << "L1TTauOffline::L1TTauOffline " << std::endl;
69 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::VertexCollection > VtxInputTag_
T getUntrackedParameter(std::string const &, T const &) const
std::vector< std::string > triggerPath_
edm::EDGetTokenT< reco::PFTauDiscriminator > comb3TInputTag_
std::vector< double > tauEfficiencyBins_
std::string efficiencyFolder_
std::string histFolder_
std::vector< int > tauEfficiencyThresholds_
edm::EDGetTokenT< l1t::TauBxCollection > stage2CaloLayer2TauToken_
edm::EDGetTokenT< reco::PFTauDiscriminator > AntiMuInputTag_
edm::EDGetTokenT< reco::BeamSpot > BsInputTag_
edm::EDGetTokenT< reco::PFMETCollection > MetInputTag_
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
edm::EDGetTokenT< reco::MuonCollection > MuonInputTag_
std::string trigProcess_
edm::EDGetTokenT< reco::PFTauDiscriminator > DecayModeFindingInputTag_
edm::EDGetTokenT< trigger::TriggerEvent > triggerEvent_
edm::EDGetTokenT< reco::PFTauDiscriminator > AntiEleInputTag_
edm::EDGetTokenT< reco::PFTauCollection > theTauCollection_
L1TTauOffline::~L1TTauOffline ( )
override

Definition at line 74 of file L1TTauOffline.cc.

75 {
76  edm::LogInfo("L1TTauOffline") << "Destructor L1TTauOffline::~L1TTauOffline " << std::endl;
77 }

Member Function Documentation

void L1TTauOffline::analyze ( edm::Event const &  e,
edm::EventSetup const &  eSetup 
)
overrideprotectedvirtual

Implements edm::stream::EDAnalyzerBase.

Definition at line 134 of file L1TTauOffline.cc.

References ecalDrivenElectronSeedsParameters_cff::beamSpot, BXVector< T >::begin(), BsInputTag_, counter, BXVector< T >::end(), PVValHelper::eta, MonitorElement::Fill(), edm::EventSetup::get(), edm::Event::getByToken(), getPrimaryVertex(), getProbeTaus(), getTauL1tPairs(), getTightMuons(), h_efficiencyIsoTauET_EB_EE_pass_, h_efficiencyIsoTauET_EB_EE_total_, h_efficiencyIsoTauET_EB_pass_, h_efficiencyIsoTauET_EB_total_, h_efficiencyIsoTauET_EE_pass_, h_efficiencyIsoTauET_EE_total_, h_efficiencyNonIsoTauET_EB_EE_pass_, h_efficiencyNonIsoTauET_EB_EE_total_, h_efficiencyNonIsoTauET_EB_pass_, h_efficiencyNonIsoTauET_EB_total_, h_efficiencyNonIsoTauET_EE_pass_, h_efficiencyNonIsoTauET_EE_total_, h_L1TauEtavsTauEta_, h_L1TauETvsTauET_EB_, h_L1TauETvsTauET_EB_EE_, h_L1TauETvsTauET_EE_, h_L1TauPhivsTauPhi_EB_, h_L1TauPhivsTauPhi_EB_EE_, h_L1TauPhivsTauPhi_EE_, h_resolutionTauET_EB_, h_resolutionTauET_EB_EE_, h_resolutionTauET_EE_, h_resolutionTauEta_, h_resolutionTauPhi_EB_, h_resolutionTauPhi_EB_EE_, h_resolutionTauPhi_EE_, edm::HandleBase::isValid(), m_BField, m_MaxHltTauDR, m_MaxL1tTauDR, m_MaxTauEta, m_TauL1tPairs, MetInputTag_, TtSemiLepSignalSelMVAComputer_cfi::mets, MuonInputTag_, extraflags_cff::muons, phi, impactParameterTagInfos_cfi::primaryVertex, EnergyCorrector::pt, BXVector< T >::size(), stage2CaloLayer2TauToken_, AlCaHLTBitMon_QueryRunRegistry::string, metsig::tau, tauEfficiencyThresholds_, nano_cff::taus, theTauCollection_, electronIdCutBased_cfi::threshold, triggerEvent_, triggerResults_, and VtxInputTag_.

135 {
136 
137  m_MaxTauEta = 2.1;
138  m_MaxL1tTauDR = 0.5;
139  m_MaxHltTauDR = 0.5;
140 
142  e.getByToken(theTauCollection_, taus);
143 
144  if(!taus.isValid())
145  {
146  //edm::LogError("L1TTauOffline") << "invalid collection: reco::PFTauCollection " << std::endl;
147  return;
148  }
149 
151  e.getByToken(MuonInputTag_, muons);
152 
153  if(!muons.isValid())
154  {
155  //edm::LogError("L1TTauOffline") << "invalid collection: reco::MuonCollection " << std::endl;
156  return;
157  }
158 
160  e.getByToken(BsInputTag_, beamSpot);
161 
162  if(!beamSpot.isValid())
163  {
164  //edm::LogError("L1TTauOffline") << "invalid collection: reco::BeamSpot " << std::endl;
165  return;
166  }
167 
169  e.getByToken(VtxInputTag_, vertex);
170 
171  if(!vertex.isValid())
172  {
173  //edm::LogError("L1TTauOffline") << "invalid collection: reco::VertexCollection " << std::endl;
174  return;
175  }
176 
178  e.getByToken(stage2CaloLayer2TauToken_,l1tCands);
179 
180  if(!l1tCands.isValid())
181  {
182  //edm::LogError("L1TTauOffline") << "invalid collection: l1t::TauBxCollection " << std::endl;
183  return;
184  }
185 
187  e.getByToken(triggerResults_,trigResults);
188 
189  if(!trigResults.isValid())
190  {
191  //edm::LogError("L1TTauOffline") << "invalid collection: edm::TriggerResults " << std::endl;
192  return;
193  }
194 
196  e.getByToken(triggerEvent_,trigEvent);
197 
198  if(!trigEvent.isValid())
199  {
200  //edm::LogError("L1TTauOffline") << "invalid collection: trigger::TriggerEvent " << std::endl;
201  return;
202  }
203 
205  e.getByToken(MetInputTag_, mets);
206 
207  if(!mets.isValid()) {
208  //edm::LogError("L1TTauOffline") << "invalid collection: reco::PFMETCollection " << std::endl;
209  return;
210  }
211 
212  eSetup.get<IdealMagneticFieldRecord>().get(m_BField);
213  const reco::Vertex primaryVertex = getPrimaryVertex(vertex,beamSpot);
214 
215  getTightMuons(muons,mets,primaryVertex,trigEvent);
216  getProbeTaus(e,taus,muons,primaryVertex);
217  getTauL1tPairs(l1tCands);
218 
219  vector<l1t::Tau> l1tContainer;
220  l1tContainer.reserve(l1tCands->size()+1);
221 
222  for (auto tau = l1tCands->begin(0); tau != l1tCands->end(0); ++tau) {
223  l1tContainer.push_back(*tau);
224  }
225 
226  for(auto tauL1tPairsIt=m_TauL1tPairs.begin(); tauL1tPairsIt!=m_TauL1tPairs.end(); ++tauL1tPairsIt) {
227 
228  float eta = tauL1tPairsIt->eta();
229  float phi = tauL1tPairsIt->phi();
230  float pt = tauL1tPairsIt->pt();
231 
232  // unmatched gmt cands have l1tPt = -1.
233  float l1tPt = tauL1tPairsIt->l1tPt();
234 
235  int counter = 0;
236 
237  for (auto threshold : tauEfficiencyThresholds_) {
238  std::string str_threshold = std::to_string(threshold);
239 
240  int l1tPtCut = threshold;
241  bool l1tAboveCut = (l1tPt >= l1tPtCut);
242 
243  stringstream ptCutToTag; ptCutToTag << l1tPtCut;
244  string ptTag = ptCutToTag.str();
245 
246  if (fabs(eta) < m_MaxTauEta) {
247  if(counter==0) {
248  if(fabs(eta)<1.5) {
249  h_L1TauETvsTauET_EB_->Fill(pt,l1tPt);
250  h_L1TauPhivsTauPhi_EB_->Fill(phi,tauL1tPairsIt->l1tPhi());
251  h_resolutionTauET_EB_->Fill((l1tPt-pt)/pt);
252  h_resolutionTauPhi_EB_->Fill(tauL1tPairsIt->l1tPhi()-phi);
253  } else {
254  h_L1TauETvsTauET_EE_->Fill(pt,l1tPt);
255  h_L1TauPhivsTauPhi_EE_->Fill(phi,tauL1tPairsIt->l1tPhi());
256  h_resolutionTauET_EE_->Fill((l1tPt-pt)/pt);
257  h_resolutionTauPhi_EE_->Fill(tauL1tPairsIt->l1tPhi()-phi);
258  }
259  h_L1TauETvsTauET_EB_EE_->Fill(pt,l1tPt);
260  h_L1TauPhivsTauPhi_EB_EE_->Fill(phi,tauL1tPairsIt->l1tPhi());
261  h_L1TauEtavsTauEta_->Fill(eta,tauL1tPairsIt->l1tEta());
262  h_resolutionTauET_EB_EE_->Fill((l1tPt-pt)/pt);
263  h_resolutionTauPhi_EB_EE_->Fill(tauL1tPairsIt->l1tPhi()-phi);
264  h_resolutionTauEta_->Fill(tauL1tPairsIt->l1tEta()-eta);
265 
266  ++counter;
267  }
268 
269  if(fabs(eta)<1.5) {
272  } else {
275  }
278 
279  if(l1tAboveCut) {
280  if(fabs(eta)<1.5) h_efficiencyNonIsoTauET_EB_pass_[threshold]->Fill(pt);
283 
284  if(tauL1tPairsIt->l1tIso()>0.5) {
285  if(fabs(eta)<1.5) h_efficiencyIsoTauET_EB_pass_[threshold]->Fill(pt);
288  }
289  }
290  }
291  }
292  }//loop over tau-L1 pairs
293 }
const_iterator end(int bx) const
edm::EDGetTokenT< reco::VertexCollection > VtxInputTag_
unsigned size(int bx) const
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_pass_
std::vector< TauL1TPair > m_TauL1tPairs
MonitorElement * h_L1TauPhivsTauPhi_EB_
edm::ESHandle< MagneticField > m_BField
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_EE_pass_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EE_pass_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_total_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_pass_
void getProbeTaus(const edm::Event &e, edm::Handle< reco::PFTauCollection > const &taus, edm::Handle< reco::MuonCollection > const &muons, const reco::Vertex &vertex)
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_EE_total_
MonitorElement * h_resolutionTauPhi_EB_
void Fill(long long x)
MonitorElement * h_L1TauPhivsTauPhi_EE_
std::vector< int > tauEfficiencyThresholds_
MonitorElement * h_resolutionTauPhi_EB_EE_
const reco::Vertex getPrimaryVertex(edm::Handle< reco::VertexCollection > const &vertex, edm::Handle< reco::BeamSpot > const &beamSpot)
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_total_
MonitorElement * h_resolutionTauPhi_EE_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_EE_pass_
MonitorElement * h_L1TauEtavsTauEta_
edm::EDGetTokenT< l1t::TauBxCollection > stage2CaloLayer2TauToken_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_EE_total_
bool isValid() const
Definition: HandleBase.h:74
MonitorElement * h_resolutionTauEta_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EE_total_
edm::EDGetTokenT< reco::BeamSpot > BsInputTag_
edm::EDGetTokenT< reco::PFMETCollection > MetInputTag_
MonitorElement * h_resolutionTauET_EB_EE_
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
MonitorElement * h_resolutionTauET_EE_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EE_total_
edm::EDGetTokenT< reco::MuonCollection > MuonInputTag_
void getTauL1tPairs(edm::Handle< l1t::TauBxCollection > const &l1tCands)
edm::EDGetTokenT< trigger::TriggerEvent > triggerEvent_
static std::atomic< unsigned int > counter
edm::EDGetTokenT< reco::PFTauCollection > theTauCollection_
MonitorElement * h_L1TauETvsTauET_EB_EE_
MonitorElement * h_L1TauETvsTauET_EE_
MonitorElement * h_L1TauPhivsTauPhi_EB_EE_
void getTightMuons(edm::Handle< reco::MuonCollection > const &muons, edm::Handle< reco::PFMETCollection > const &mets, const reco::Vertex &vertex, edm::Handle< trigger::TriggerEvent > const &trigEvent)
const_iterator begin(int bx) const
MonitorElement * h_resolutionTauET_EB_
MonitorElement * h_L1TauETvsTauET_EB_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EE_pass_
void L1TTauOffline::beginLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  eSetup 
)
overrideprotectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 126 of file L1TTauOffline.cc.

127 {
128  edm::LogInfo("L1TTauOffline") << "L1TTauOffline::beginLuminosityBlock" << std::endl;
129 }
void L1TTauOffline::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 94 of file L1TTauOffline.cc.

References bookTauHistos(), runEdmFileComparison::found, createfilelist::int, m_hltConfig, m_trigIndices, HLTConfigProvider::size(), AlCaHLTBitMon_QueryRunRegistry::string, HLTConfigProvider::triggerName(), and triggerPath_.

95 {
96  edm::LogInfo("L1TTauOffline") << "L1TTauOffline::bookHistograms" << std::endl;
97 
98  //book at beginRun
99  bookTauHistos(ibooker);
100 
101  for ( auto trigNamesIt = triggerPath_.begin() ; trigNamesIt!=triggerPath_.end() ; trigNamesIt++){
102 
103  std::string tNameTmp = (*trigNamesIt);
104  std::string tNamePattern = "";
105  std::size_t found0 = tNameTmp.find("*");
106  if(found0!=std::string::npos) tNamePattern = tNameTmp.substr(0,tNameTmp.size()-1);
107  else tNamePattern = tNameTmp;
108 
109  int tIndex = -1;
110 
111  for (unsigned ipath = 0; ipath < m_hltConfig.size(); ++ipath) {
112 
113  std::string tmpName = m_hltConfig.triggerName(ipath);
114 
115  std::size_t found=tmpName.find(tNamePattern);
116  if (found!=std::string::npos){
117  tIndex = int(ipath);
118  m_trigIndices.push_back(tIndex);
119  }
120  }
121  }
122 }
unsigned int size() const
number of trigger paths in trigger table
std::vector< std::string > triggerPath_
const std::string & triggerName(unsigned int triggerIndex) const
std::vector< int > m_trigIndices
void bookTauHistos(DQMStore::IBooker &)
HLTConfigProvider m_hltConfig
void L1TTauOffline::bookTauHistos ( DQMStore::IBooker ibooker)
private

Definition at line 314 of file L1TTauOffline.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::cd(), efficiencyFolder_, h_efficiencyIsoTauET_EB_EE_pass_, h_efficiencyIsoTauET_EB_EE_total_, h_efficiencyIsoTauET_EB_pass_, h_efficiencyIsoTauET_EB_total_, h_efficiencyIsoTauET_EE_pass_, h_efficiencyIsoTauET_EE_total_, h_efficiencyNonIsoTauET_EB_EE_pass_, h_efficiencyNonIsoTauET_EB_EE_total_, h_efficiencyNonIsoTauET_EB_pass_, h_efficiencyNonIsoTauET_EB_total_, h_efficiencyNonIsoTauET_EE_pass_, h_efficiencyNonIsoTauET_EE_total_, h_L1TauEtavsTauEta_, h_L1TauETvsTauET_EB_, h_L1TauETvsTauET_EB_EE_, h_L1TauETvsTauET_EE_, h_L1TauPhivsTauPhi_EB_, h_L1TauPhivsTauPhi_EB_EE_, h_L1TauPhivsTauPhi_EE_, h_nVertex_, h_resolutionTauET_EB_, h_resolutionTauET_EB_EE_, h_resolutionTauET_EE_, h_resolutionTauEta_, h_resolutionTauPhi_EB_, h_resolutionTauPhi_EB_EE_, h_resolutionTauPhi_EE_, h_tagAndProbeMass_, histFolder_, DQMStore::IBooker::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, tauEfficiencyBins_, tauEfficiencyThresholds_, and electronIdCutBased_cfi::threshold.

Referenced by bookHistograms().

315 {
316  ibooker.cd();
317  ibooker.setCurrentFolder(histFolder_);
318  h_nVertex_ = ibooker.book1D("nVertex", "Number of event vertices in collection", 40, -0.5, 39.5);
319  h_tagAndProbeMass_ = ibooker.book1D("tagAndProbeMass", "Invariant mass of tag & probe pair", 100, 40, 140);
320 
321  h_L1TauETvsTauET_EB_ = ibooker.book2D("L1TauETvsTauET_EB",
322  "L1 Tau E_{T} vs PFTau E_{T} (EB); PFTau E_{T} (GeV); L1 Tau E_{T} (GeV)", 300, 0, 300, 300,
323  0, 300);
324  h_L1TauETvsTauET_EE_ = ibooker.book2D("L1TauETvsTauET_EE",
325  "L1 Tau E_{T} vs PFTau E_{T} (EE); PFTau E_{T} (GeV); L1 Tau E_{T} (GeV)", 300, 0, 300, 300,
326  0, 300);
327  h_L1TauETvsTauET_EB_EE_ = ibooker.book2D("L1TauETvsTauET_EB_EE",
328  "L1 Tau E_{T} vs PFTau E_{T} (EB+EE); PFTau E_{T} (GeV); L1 Tau E_{T} (GeV)", 300, 0, 300,
329  300, 0, 300);
330 
331  h_L1TauPhivsTauPhi_EB_ = ibooker.book2D("L1TauPhivsTauPhi_EB",
332  "#phi_{tau}^{L1} vs #phi_{tau}^{offline} (EB); #phi_{tau}^{offline}; #phi_{tau}^{L1}", 100,
333  -4, 4, 100, -4, 4);
334  h_L1TauPhivsTauPhi_EE_ = ibooker.book2D("L1TauPhivsTauPhi_EE",
335  "#phi_{tau}^{L1} vs #phi_{tau}^{offline} (EE); #phi_{tau}^{offline}; #phi_{tau}^{L1}", 100,
336  -4, 4, 100, -4, 4);
337  h_L1TauPhivsTauPhi_EB_EE_ = ibooker.book2D("L1TauPhivsTauPhi_EB_EE",
338  "#phi_{tau}^{L1} vs #phi_{tau}^{offline} (EB+EE); #phi_{tau}^{offline}; #phi_{tau}^{L1}", 100,
339  -4, 4, 100, -4, 4);
340 
341  h_L1TauEtavsTauEta_ = ibooker.book2D("L1TauEtavsTauEta",
342  "L1 Tau #eta vs PFTau #eta; PFTau #eta; L1 Tau #eta", 100, -3, 3, 100, -3, 3);
343 
344  // tau resolutions
345  h_resolutionTauET_EB_ = ibooker.book1D("resolutionTauET_EB",
346  "tau ET resolution (EB); (L1 Tau E_{T} - PFTau E_{T})/PFTau E_{T}; events", 50, -1, 1.5);
347  h_resolutionTauET_EE_ = ibooker.book1D("resolutionTauET_EE",
348  "tau ET resolution (EE); (L1 Tau E_{T} - PFTau E_{T})/PFTau E_{T}; events", 50, -1, 1.5);
349  h_resolutionTauET_EB_EE_ = ibooker.book1D("resolutionTauET_EB_EE",
350  "tau ET resolution (EB+EE); (L1 Tau E_{T} - PFTau E_{T})/PFTau E_{T}; events", 50, -1, 1.5);
351 
353  ibooker.book1D("resolutionTauPhi_EB",
354  "#phi_{tau} resolution (EB); #phi_{tau}^{L1} - #phi_{tau}^{offline}; events",
355  120, -0.3, 0.3);
357  ibooker.book1D("resolutionTauPhi_EE",
358  "tau #phi resolution (EE); #phi_{tau}^{L1} - #phi_{tau}^{offline}; events",
359  120, -0.3, 0.3);
361  ibooker.book1D("resolutionTauPhi_EB_EE",
362  "tau #phi resolution (EB+EE); #phi_{tau}^{L1} - #phi_{tau}^{offline}; events",
363  120, -0.3, 0.3);
364 
365  h_resolutionTauEta_ = ibooker.book1D("resolutionTauEta",
366  "tau #eta resolution (EB); L1 Tau #eta - PFTau #eta; events", 120, -0.3, 0.3);
367 
368  // tau turn-ons
370  std::vector<float> tauBins(tauEfficiencyBins_.begin(), tauEfficiencyBins_.end());
371  int nBins = tauBins.size() - 1;
372  float* tauBinArray = &(tauBins[0]);
373 
374  for (auto threshold : tauEfficiencyThresholds_) {
375  std::string str_threshold = std::to_string(int(threshold));
377  "efficiencyIsoTauET_EB_threshold_" + str_threshold + "_Num",
378  "iso tau efficiency (EB); PFTau E_{T} (GeV); events", nBins, tauBinArray);
380  "efficiencyIsoTauET_EE_threshold_" + str_threshold + "_Num",
381  "iso tau efficiency (EE); PFTau E_{T} (GeV); events", nBins, tauBinArray);
383  "efficiencyIsoTauET_EB_EE_threshold_" + str_threshold + "_Num",
384  "iso tau efficiency (EB+EE); PFTau E_{T} (GeV); events", nBins, tauBinArray);
385 
387  "efficiencyIsoTauET_EB_threshold_" + str_threshold + "_Den",
388  "iso tau efficiency (EB); PFTau E_{T} (GeV); events", nBins, tauBinArray);
390  "efficiencyIsoTauET_EE_threshold_" + str_threshold + "_Den",
391  "iso tau efficiency (EE); PFTau E_{T} (GeV); events", nBins, tauBinArray);
393  "efficiencyIsoTauET_EB_EE_threshold_" + str_threshold + "_Den",
394  "iso tau efficiency (EB+EE); PFTau E_{T} (GeV); events", nBins, tauBinArray);
395 
396 
397  //non iso
399  "efficiencyNonIsoTauET_EB_threshold_" + str_threshold + "_Num",
400  "inclusive tau efficiency (EB); PFTau E_{T} (GeV); events", nBins, tauBinArray);
402  "efficiencyNonIsoTauET_EE_threshold_" + str_threshold + "_Num",
403  "inclusive tau efficiency (EE); PFTau E_{T} (GeV); events", nBins, tauBinArray);
405  "efficiencyNonIsoTauET_EB_EE_threshold_" + str_threshold + "_Num",
406  "inclusive tau efficiency (EB+EE); PFTau E_{T} (GeV); events", nBins, tauBinArray);
407 
409  "efficiencyNonIsoTauET_EB_threshold_" + str_threshold + "_Den",
410  "inclusive tau efficiency (EB); PFTau E_{T} (GeV); events", nBins, tauBinArray);
412  "efficiencyNonIsoTauET_EE_threshold_" + str_threshold + "_Den",
413  "inclusive tau efficiency (EE); PFTau E_{T} (GeV); events", nBins, tauBinArray);
415  "efficiencyNonIsoTauET_EB_EE_threshold_" + str_threshold + "_Den",
416  "inclusive tau efficiency (EB+EE); PFTau E_{T} (GeV); events", nBins, tauBinArray);
417 
418  }
419 
420  ibooker.cd();
421 
422  return;
423 
424 }
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_pass_
void cd(void)
Definition: DQMStore.cc:269
MonitorElement * h_L1TauPhivsTauPhi_EB_
std::vector< double > tauEfficiencyBins_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_EE_pass_
MonitorElement * h_nVertex_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EE_pass_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_total_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_pass_
std::string efficiencyFolder_
std::string histFolder_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_EE_total_
MonitorElement * h_resolutionTauPhi_EB_
MonitorElement * h_L1TauPhivsTauPhi_EE_
std::vector< int > tauEfficiencyThresholds_
MonitorElement * h_resolutionTauPhi_EB_EE_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_total_
MonitorElement * h_resolutionTauPhi_EE_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_EE_pass_
MonitorElement * h_L1TauEtavsTauEta_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_EE_total_
MonitorElement * h_resolutionTauEta_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EE_total_
MonitorElement * h_resolutionTauET_EB_EE_
MonitorElement * h_resolutionTauET_EE_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EE_total_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * h_tagAndProbeMass_
MonitorElement * h_L1TauETvsTauET_EB_EE_
MonitorElement * h_L1TauETvsTauET_EE_
MonitorElement * h_L1TauPhivsTauPhi_EB_EE_
MonitorElement * h_resolutionTauET_EB_
MonitorElement * h_L1TauETvsTauET_EB_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EE_pass_
double L1TTauOffline::calcDeltaPhi ( double  phi1,
double  phi2 
)
private
double L1TTauOffline::Distance ( const reco::Candidate c1,
const reco::Candidate c2 
)
private
double L1TTauOffline::DistancePhi ( const reco::Candidate c1,
const reco::Candidate c2 
)
private
void L1TTauOffline::dqmBeginRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
overrideprotected

Definition at line 82 of file L1TTauOffline.cc.

References HLTConfigProvider::init(), m_hltConfig, and trigProcess_.

84 {
85  bool changed = true;
86  m_hltConfig.init(run,iSetup,trigProcess_,changed);
87 
88  edm::LogInfo("L1TTauOffline") << "L1TTauOffline::beginRun" << std::endl;
89 }
HLTConfigProvider m_hltConfig
std::string trigProcess_
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
void L1TTauOffline::endLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  eSetup 
)
overrideprotectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 298 of file L1TTauOffline.cc.

299 {
300  edm::LogInfo("L1TTauOffline") << "L1TTauOffline::endLuminosityBlock" << std::endl;
301 }
void L1TTauOffline::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overrideprotectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 306 of file L1TTauOffline.cc.

307 {
308  edm::LogInfo("L1TTauOffline") << "L1TTauOffline::endRun" << std::endl;
309 }
const reco::Vertex L1TTauOffline::getPrimaryVertex ( edm::Handle< reco::VertexCollection > const &  vertex,
edm::Handle< reco::BeamSpot > const &  beamSpot 
)
protected

Definition at line 426 of file L1TTauOffline.cc.

References reco::BeamSpot::BeamWidthX(), reco::BeamSpot::BeamWidthY(), edm::HandleBase::isValid(), reco::BeamSpot::position(), reco::Vertex::position(), impactParameterTagInfos_cfi::primaryVertex, and reco::BeamSpot::sigmaZ().

Referenced by analyze().

426  {
427 
428  reco::Vertex::Point posVtx;
429  reco::Vertex::Error errVtx;
430 
431  bool hasPrimaryVertex = false;
432 
433  if (vertex.isValid())
434  {
435  for (auto vertexIt=vertex->begin();vertexIt!=vertex->end();++vertexIt)
436  {
437  if (vertexIt->isValid() &&
438  !vertexIt->isFake())
439  {
440  posVtx = vertexIt->position();
441  errVtx = vertexIt->error();
442  hasPrimaryVertex = true;
443  break;
444  }
445  }
446  }
447 
448  if ( !hasPrimaryVertex ) {
449  posVtx = beamSpot->position();
450  errVtx(0,0) = beamSpot->BeamWidthX();
451  errVtx(1,1) = beamSpot->BeamWidthY();
452  errVtx(2,2) = beamSpot->sigmaZ();
453  }
454 
455  const reco::Vertex primaryVertex(posVtx,errVtx);
456 
457  return primaryVertex;
458 }
math::Error< dimension >::type Error
covariance error matrix (3x3)
Definition: Vertex.h:43
math::XYZPoint Point
point in the space
Definition: Vertex.h:39
double BeamWidthX() const
beam width X
Definition: BeamSpot.h:86
bool isValid() const
Definition: HandleBase.h:74
double sigmaZ() const
sigma z
Definition: BeamSpot.h:80
double BeamWidthY() const
beam width Y
Definition: BeamSpot.h:88
const Point & position() const
position
Definition: BeamSpot.h:62
void L1TTauOffline::getProbeTaus ( const edm::Event e,
edm::Handle< reco::PFTauCollection > const &  taus,
edm::Handle< reco::MuonCollection > const &  muons,
const reco::Vertex vertex 
)
protected

Definition at line 551 of file L1TTauOffline.cc.

References AntiEleInputTag_, AntiMuInputTag_, comb3TInputTag_, DecayModeFindingInputTag_, DEFINE_FWK_MODULE, PVValHelper::eta, edm::Event::getByToken(), edm::HandleBase::isValid(), m_ProbeTaus, m_TightMuons, phi, and EnergyCorrector::pt.

Referenced by analyze().

551  {
552 
553  m_ProbeTaus.clear();
554 
556  iEvent.getByToken(AntiMuInputTag_, antimu);
557  if(!antimu.isValid())
558  {
559  //edm::LogError("L1TTauOffline") << "invalid collection: reco::PFTauDiscriminator " << std::endl;
560  return;
561  }
562 
564  iEvent.getByToken(DecayModeFindingInputTag_, dmf);
565  if(!dmf.isValid())
566  {
567  //edm::LogError("L1TTauOffline") << "invalid collection: reco::PFTauDiscriminator " << std::endl;
568  return;
569  }
570 
572  iEvent.getByToken(AntiEleInputTag_, antiele);
573  if(!antiele.isValid())
574  {
575  //edm::LogError("L1TTauOffline") << "invalid collection: reco::PFTauDiscriminator " << std::endl;
576  return;
577  }
578 
580  iEvent.getByToken(comb3TInputTag_, comb3T);
581  if(!comb3T.isValid())
582  {
583  //edm::LogError("L1TTauOffline") << "invalid collection: reco::PFTauDiscriminator " << std::endl;
584  return;
585  }
586 
587  if (!m_TightMuons.empty()){
588  TLorentzVector mymu;
589  mymu.SetPtEtaPhiE(m_TightMuons[0]->pt(),m_TightMuons[0]->eta(),m_TightMuons[0]->phi(),m_TightMuons[0]->energy());
590  int iTau=0;
591  for(auto tauIt = taus->begin(); tauIt!=taus->end(); ++tauIt,++iTau) {
592  reco::PFTauRef tauCandidate(taus, iTau);
593  TLorentzVector mytau;
594  mytau.SetPtEtaPhiE(tauIt->pt(),tauIt->eta(),tauIt->phi(),tauIt->energy());
595 
596  if (fabs(tauIt->charge())==1 && fabs(tauIt->eta())< 2.1 && tauIt->pt()>20 && (*antimu)[tauCandidate] > 0.5 && (*antiele)[tauCandidate] > 0.5 && (*dmf)[tauCandidate] > 0.5 && (*comb3T)[tauCandidate] > 0.5) {
597  if (mymu.DeltaR(mytau)>0.5 && (mymu+mytau).M()>40 && (mymu+mytau).M()<80 && m_TightMuons[0]->charge()*tauIt->charge()<0){
598  m_ProbeTaus.push_back(&(*tauIt));
599  }
600  }
601  }
602  }
603 }
edm::EDGetTokenT< reco::PFTauDiscriminator > comb3TInputTag_
std::vector< const reco::PFTau * > m_ProbeTaus
int iEvent
Definition: GenABIO.cc:230
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetTokenT< reco::PFTauDiscriminator > AntiMuInputTag_
std::vector< const reco::Muon * > m_TightMuons
edm::EDGetTokenT< reco::PFTauDiscriminator > DecayModeFindingInputTag_
edm::EDGetTokenT< reco::PFTauDiscriminator > AntiEleInputTag_
void L1TTauOffline::getTauL1tPairs ( edm::Handle< l1t::TauBxCollection > const &  l1tCands)
protected

Definition at line 492 of file L1TTauOffline.cc.

References BXVector< T >::begin(), TauL1TPair::dR(), BXVector< T >::end(), TauL1TPair::l1tPt(), m_MaxL1tTauDR, m_ProbeTaus, m_TauL1tPairs, BXVector< T >::size(), and metsig::tau.

Referenced by analyze().

492  {
493 
494  m_TauL1tPairs.clear();
495 
496  vector<l1t::Tau> l1tContainer;
497  l1tContainer.reserve(l1tCands->size()+1);
498 
499  for (auto tau = l1tCands->begin(0); tau != l1tCands->end(0); ++tau) {
500  l1tContainer.push_back(*tau);
501  }
502 
503  for (auto probeTauIt = m_ProbeTaus.begin(); probeTauIt!=m_ProbeTaus.end(); ++probeTauIt) {
504 
505  TauL1TPair pairBestCand((*probeTauIt),nullptr);
506 
507  for(auto l1tIt = l1tContainer.begin() ; l1tIt!=l1tContainer.end(); ++l1tIt) {
508 
509  TauL1TPair pairTmpCand((*probeTauIt),&(*l1tIt));
510 
511  if (pairTmpCand.dR() < m_MaxL1tTauDR && pairTmpCand.l1tPt() > pairBestCand.l1tPt())
512  pairBestCand = pairTmpCand;
513 
514  }
515 
516  m_TauL1tPairs.push_back(pairBestCand);
517 
518  }
519 
520 }
const_iterator end(int bx) const
unsigned size(int bx) const
std::vector< TauL1TPair > m_TauL1tPairs
std::vector< const reco::PFTau * > m_ProbeTaus
const_iterator begin(int bx) const
void L1TTauOffline::getTightMuons ( edm::Handle< reco::MuonCollection > const &  muons,
edm::Handle< reco::PFMETCollection > const &  mets,
const reco::Vertex vertex,
edm::Handle< trigger::TriggerEvent > const &  trigEvent 
)
protected

Definition at line 522 of file L1TTauOffline.cc.

References muon::isLooseMuon(), m_TightMuons, matchHlt(), SiStripPI::max, TtSemiLepEvtBuilder_cfi::mt, funct::pow(), reco::LeafCandidate::pt(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), and mathSSE::sqrt().

Referenced by analyze().

522  {
523 
524  m_TightMuons.clear();
525 
526  const reco::PFMET *pfmet=nullptr;
527  pfmet=&(mets->front());
528 
529  int nb_mu=0;
530 
531  for(auto muonIt2 = muons->begin(); muonIt2!=muons->end(); ++muonIt2) {
532  if (fabs(muonIt2->eta())< 2.4 && muonIt2->pt()>10 && muon::isLooseMuon((*muonIt2)) && (muonIt2->pfIsolationR04().sumChargedHadronPt+max(muonIt2->pfIsolationR04().sumNeutralHadronEt+muonIt2->pfIsolationR04().sumPhotonEt-0.5*muonIt2->pfIsolationR04().sumPUPt,0.0))/muonIt2->pt()<0.3) {
533  ++nb_mu;
534  }
535  }
536  bool foundTightMu=false;
537  for(auto muonIt = muons->begin(); muonIt!=muons->end(); ++muonIt) {
538  if (!matchHlt(trigEvent,&(*muonIt))) continue;
539  float muiso=(muonIt->pfIsolationR04().sumChargedHadronPt+max(muonIt->pfIsolationR04().sumNeutralHadronEt+muonIt->pfIsolationR04().sumPhotonEt-0.5*muonIt->pfIsolationR04().sumPUPt,0.0))/muonIt->pt();
540 
541  if (muiso<0.1 && nb_mu<2 && !foundTightMu && fabs(muonIt->eta())< 2.1 && muonIt->pt()>24 && muon::isLooseMuon((*muonIt))) {
542  float mt=sqrt(pow(muonIt->pt() + pfmet->pt(), 2) - pow(muonIt->px() + pfmet->px(),2) - pow(muonIt->py() + pfmet->py(), 2));
543  if (mt<30){
544  m_TightMuons.push_back(&(*muonIt));
545  foundTightMu=true;
546  }
547  }
548  }
549 }
double px() const final
x coordinate of momentum vector
double pt() const final
transverse momentum
bool isLooseMuon(const reco::Muon &)
T sqrt(T t)
Definition: SSEVec.h:18
std::vector< const reco::Muon * > m_TightMuons
double py() const final
y coordinate of momentum vector
bool matchHlt(edm::Handle< trigger::TriggerEvent > const &triggerEvent, const reco::Muon *muon)
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
bool L1TTauOffline::matchHlt ( edm::Handle< trigger::TriggerEvent > const &  triggerEvent,
const reco::Muon muon 
)
protected

Definition at line 460 of file L1TTauOffline.cc.

References deltaR(), trigger::TriggerEvent::filterIds(), trigger::TriggerEvent::filterIndex(), trigger::TriggerEvent::filterKeys(), trigger::TriggerEvent::getObjects(), m_hltConfig, m_MaxHltTauDR, m_trigIndices, HLTConfigProvider::moduleLabels(), HLTConfigProvider::size(), TriggerAnalyzer::trigObjs, and trigProcess_.

Referenced by getTightMuons().

460  {
461 
462 
463  double matchDeltaR = 9999;
464 
466 
467  for(auto trigIndexIt = m_trigIndices.begin(); trigIndexIt!=m_trigIndices.end(); ++trigIndexIt) {
468 
469  const vector<string> moduleLabels(m_hltConfig.moduleLabels(*trigIndexIt));
470  const unsigned moduleIndex = m_hltConfig.size((*trigIndexIt))-2;
471 
472  const unsigned hltFilterIndex = triggerEvent->filterIndex(InputTag(moduleLabels[moduleIndex],"",trigProcess_));
473 
474  if (hltFilterIndex < triggerEvent->sizeFilters()) {
475  const Keys triggerKeys(triggerEvent->filterKeys(hltFilterIndex));
476  const Vids triggerVids(triggerEvent->filterIds(hltFilterIndex));
477 
478  const unsigned nTriggers = triggerVids.size();
479  for (size_t iTrig = 0; iTrig < nTriggers; ++iTrig) {
480  const TriggerObject trigObject = trigObjs[triggerKeys[iTrig]];
481 
482  double dRtmp = deltaR((*muon),trigObject);
483  if (dRtmp < matchDeltaR) matchDeltaR = dRtmp;
484  }
485  }
486  }
487 
488  return (matchDeltaR < m_MaxHltTauDR);
489 
490 }
unsigned int size() const
number of trigger paths in trigger table
std::vector< int > m_trigIndices
const Keys & filterKeys(trigger::size_type index) const
Definition: TriggerEvent.h:111
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
Definition: TriggerEvent.h:123
HLTConfigProvider m_hltConfig
const Vids & filterIds(trigger::size_type index) const
Definition: TriggerEvent.h:110
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:98
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:81
std::string trigProcess_
std::vector< size_type > Keys
std::vector< int > Vids

Member Data Documentation

edm::EDGetTokenT<reco::PFTauDiscriminator> L1TTauOffline::AntiEleInputTag_
private

Definition at line 124 of file L1TTauOffline.h.

Referenced by getProbeTaus().

edm::EDGetTokenT<reco::PFTauDiscriminator> L1TTauOffline::AntiMuInputTag_
private

Definition at line 123 of file L1TTauOffline.h.

Referenced by getProbeTaus().

edm::EDGetTokenT<reco::BeamSpot> L1TTauOffline::BsInputTag_
private

Definition at line 130 of file L1TTauOffline.h.

Referenced by analyze().

edm::EDGetTokenT<reco::PFTauDiscriminator> L1TTauOffline::comb3TInputTag_
private

Definition at line 126 of file L1TTauOffline.h.

Referenced by getProbeTaus().

edm::EDGetTokenT<reco::PFTauDiscriminator> L1TTauOffline::DecayModeFindingInputTag_
private

Definition at line 125 of file L1TTauOffline.h.

Referenced by getProbeTaus().

std::string L1TTauOffline::efficiencyFolder_
private

Definition at line 136 of file L1TTauOffline.h.

Referenced by bookTauHistos().

std::map<double, MonitorElement*> L1TTauOffline::h_efficiencyIsoTauET_EB_EE_pass_
private

Definition at line 189 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

std::map<double, MonitorElement*> L1TTauOffline::h_efficiencyIsoTauET_EB_EE_total_
private

Definition at line 199 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

std::map<double, MonitorElement*> L1TTauOffline::h_efficiencyIsoTauET_EB_pass_
private

Definition at line 187 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

std::map<double, MonitorElement*> L1TTauOffline::h_efficiencyIsoTauET_EB_total_
private

Definition at line 197 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

std::map<double, MonitorElement*> L1TTauOffline::h_efficiencyIsoTauET_EE_pass_
private

Definition at line 188 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

std::map<double, MonitorElement*> L1TTauOffline::h_efficiencyIsoTauET_EE_total_
private

Definition at line 198 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

std::map<double, MonitorElement*> L1TTauOffline::h_efficiencyNonIsoTauET_EB_EE_pass_
private

Definition at line 193 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

std::map<double, MonitorElement*> L1TTauOffline::h_efficiencyNonIsoTauET_EB_EE_total_
private

Definition at line 203 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

std::map<double, MonitorElement*> L1TTauOffline::h_efficiencyNonIsoTauET_EB_pass_
private

Definition at line 191 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

std::map<double, MonitorElement*> L1TTauOffline::h_efficiencyNonIsoTauET_EB_total_
private

Definition at line 201 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

std::map<double, MonitorElement*> L1TTauOffline::h_efficiencyNonIsoTauET_EE_pass_
private

Definition at line 192 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

std::map<double, MonitorElement*> L1TTauOffline::h_efficiencyNonIsoTauET_EE_total_
private

Definition at line 202 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

MonitorElement* L1TTauOffline::h_L1TauEtavsTauEta_
private

Definition at line 173 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

MonitorElement* L1TTauOffline::h_L1TauETvsTauET_EB_
private

Definition at line 165 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

MonitorElement* L1TTauOffline::h_L1TauETvsTauET_EB_EE_
private

Definition at line 167 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

MonitorElement* L1TTauOffline::h_L1TauETvsTauET_EE_
private

Definition at line 166 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

MonitorElement* L1TTauOffline::h_L1TauPhivsTauPhi_EB_
private

Definition at line 169 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

MonitorElement* L1TTauOffline::h_L1TauPhivsTauPhi_EB_EE_
private

Definition at line 171 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

MonitorElement* L1TTauOffline::h_L1TauPhivsTauPhi_EE_
private

Definition at line 170 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

MonitorElement* L1TTauOffline::h_nVertex_
private

Definition at line 161 of file L1TTauOffline.h.

Referenced by bookTauHistos().

MonitorElement* L1TTauOffline::h_resolutionTauET_EB_
private

Definition at line 176 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

MonitorElement* L1TTauOffline::h_resolutionTauET_EB_EE_
private

Definition at line 178 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

MonitorElement* L1TTauOffline::h_resolutionTauET_EE_
private

Definition at line 177 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

MonitorElement* L1TTauOffline::h_resolutionTauEta_
private

Definition at line 184 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

MonitorElement* L1TTauOffline::h_resolutionTauPhi_EB_
private

Definition at line 180 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

MonitorElement* L1TTauOffline::h_resolutionTauPhi_EB_EE_
private

Definition at line 182 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

MonitorElement* L1TTauOffline::h_resolutionTauPhi_EE_
private

Definition at line 181 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

MonitorElement* L1TTauOffline::h_tagAndProbeMass_
private

Definition at line 162 of file L1TTauOffline.h.

Referenced by bookTauHistos().

std::string L1TTauOffline::histFolder_
private

Definition at line 135 of file L1TTauOffline.h.

Referenced by bookTauHistos().

edm::ESHandle<MagneticField> L1TTauOffline::m_BField
private

Definition at line 117 of file L1TTauOffline.h.

Referenced by analyze().

HLTConfigProvider L1TTauOffline::m_hltConfig
private

Definition at line 115 of file L1TTauOffline.h.

Referenced by bookHistograms(), dqmBeginRun(), and matchHlt().

BXVector<l1t::Tau> L1TTauOffline::m_L1tL1tTaus
private

Definition at line 149 of file L1TTauOffline.h.

std::vector<int> L1TTauOffline::m_L1tPtCuts
private

Definition at line 152 of file L1TTauOffline.h.

std::vector<l1t::TauBxCollection> L1TTauOffline::m_L1tTaus
private

Definition at line 147 of file L1TTauOffline.h.

float L1TTauOffline::m_MaxHltTauDR
private

Definition at line 156 of file L1TTauOffline.h.

Referenced by analyze(), and matchHlt().

float L1TTauOffline::m_MaxL1tTauDR
private

Definition at line 155 of file L1TTauOffline.h.

Referenced by analyze(), and getTauL1tPairs().

float L1TTauOffline::m_MaxTauEta
private

Definition at line 154 of file L1TTauOffline.h.

Referenced by analyze().

std::vector<const reco::PFTau*> L1TTauOffline::m_ProbeTaus
private

Definition at line 142 of file L1TTauOffline.h.

Referenced by getProbeTaus(), and getTauL1tPairs().

edm::ESHandle<Propagator> L1TTauOffline::m_propagatorAlong
private

Definition at line 118 of file L1TTauOffline.h.

edm::ESHandle<Propagator> L1TTauOffline::m_propagatorOpposite
private

Definition at line 119 of file L1TTauOffline.h.

std::vector<reco::PFTau> L1TTauOffline::m_RecoRecoTaus
private

Definition at line 148 of file L1TTauOffline.h.

std::vector<reco::PFTauCollection> L1TTauOffline::m_RecoTaus
private

Definition at line 146 of file L1TTauOffline.h.

std::vector<TauL1TPair> L1TTauOffline::m_TauL1tPairs
private

Definition at line 143 of file L1TTauOffline.h.

Referenced by analyze(), and getTauL1tPairs().

std::vector<const reco::Muon*> L1TTauOffline::m_TightMuons
private

Definition at line 141 of file L1TTauOffline.h.

Referenced by getProbeTaus(), and getTightMuons().

std::vector<int> L1TTauOffline::m_trigIndices
private

Definition at line 158 of file L1TTauOffline.h.

Referenced by bookHistograms(), and matchHlt().

edm::EDGetTokenT<reco::PFMETCollection> L1TTauOffline::MetInputTag_
private

Definition at line 128 of file L1TTauOffline.h.

Referenced by analyze().

edm::EDGetTokenT<reco::MuonCollection> L1TTauOffline::MuonInputTag_
private

Definition at line 127 of file L1TTauOffline.h.

Referenced by analyze().

math::XYZPoint L1TTauOffline::PVPoint_
private

Definition at line 113 of file L1TTauOffline.h.

edm::EDGetTokenT<l1t::TauBxCollection> L1TTauOffline::stage2CaloLayer2TauToken_
private

Definition at line 137 of file L1TTauOffline.h.

Referenced by analyze().

std::vector<double> L1TTauOffline::tauEfficiencyBins_
private

Definition at line 139 of file L1TTauOffline.h.

Referenced by bookTauHistos().

std::vector<int> L1TTauOffline::tauEfficiencyThresholds_
private

Definition at line 138 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

edm::EDGetTokenT<reco::PFTauCollection> L1TTauOffline::theTauCollection_
private

Definition at line 122 of file L1TTauOffline.h.

Referenced by analyze().

edm::EDGetTokenT<trigger::TriggerEvent> L1TTauOffline::triggerEvent_
private

Definition at line 131 of file L1TTauOffline.h.

Referenced by analyze().

std::vector<std::string> L1TTauOffline::triggerPath_
private

Definition at line 134 of file L1TTauOffline.h.

Referenced by bookHistograms().

edm::EDGetTokenT<edm::TriggerResults> L1TTauOffline::triggerResults_
private

Definition at line 133 of file L1TTauOffline.h.

Referenced by analyze().

std::string L1TTauOffline::trigProcess_
private

Definition at line 132 of file L1TTauOffline.h.

Referenced by dqmBeginRun(), and matchHlt().

edm::EDGetTokenT<reco::VertexCollection> L1TTauOffline::VtxInputTag_
private

Definition at line 129 of file L1TTauOffline.h.

Referenced by analyze().