CMS 3D CMS Logo

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

#include <L1Validator.h>

Inheritance diagram for L1Validator:
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

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
 L1Validator (const edm::ParameterSet &)
 
 ~L1Validator () 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
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 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 () 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)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- 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

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
- 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

const reco::LeafCandidateFindBest (const reco::GenParticle *, const std::vector< l1extra::L1EmParticle > *, const std::vector< l1extra::L1EmParticle > *)
 
const reco::LeafCandidateFindBest (const reco::GenParticle *, const std::vector< l1extra::L1JetParticle > *, const std::vector< l1extra::L1JetParticle > *)
 
const reco::LeafCandidateFindBest (const reco::GenParticle *, const std::vector< l1extra::L1MuonParticle > *)
 

Private Attributes

std::string _dirName
 
std::string _fileName
 
edm::EDGetTokenT< reco::GenParticleCollection_GenSource
 
L1ValidatorHists _Hists
 
edm::EDGetTokenT< l1t::EGammaBxCollection_L1EGammaBXSource
 
edm::EDGetTokenT< reco::GenJetCollection_L1GenJetSource
 
edm::EDGetTokenT< l1t::JetBxCollection_L1JetBXSource
 
edm::EDGetTokenT< l1t::MuonBxCollection_L1MuonBXSource
 
edm::EDGetTokenT< l1t::TauBxCollection_L1TauBXSource
 
edm::EDGetTokenT< GenEventInfoProduct_srcToken
 

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
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 68 of file L1Validator.h.

Constructor & Destructor Documentation

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

Definition at line 54 of file L1Validator.cc.

References _dirName, _GenSource, _L1EGammaBXSource, _L1GenJetSource, _L1JetBXSource, _L1MuonBXSource, _L1TauBXSource, _srcToken, edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

54  {
55  _dirName = iConfig.getParameter<std::string>("dirName");
56  _GenSource = consumes<reco::GenParticleCollection> (iConfig.getParameter<edm::InputTag>("GenSource"));
57 
58  _L1MuonBXSource = consumes<l1t::MuonBxCollection> (iConfig.getParameter<edm::InputTag>("L1MuonBXSource"));
59  _L1EGammaBXSource = consumes<l1t::EGammaBxCollection> (iConfig.getParameter<edm::InputTag>("L1EGammaBXSource"));
60  _L1TauBXSource = consumes<l1t::TauBxCollection> (iConfig.getParameter<edm::InputTag>("L1TauBXSource"));
61  _L1JetBXSource = consumes<l1t::JetBxCollection> (iConfig.getParameter<edm::InputTag>("L1JetBXSource"));
62  _srcToken = mayConsume<GenEventInfoProduct>( iConfig.getParameter<edm::InputTag>("srcToken") );
63  _L1GenJetSource = consumes<reco::GenJetCollection>( iConfig.getParameter<edm::InputTag>("L1GenJetSource"));
64 
65  //_fileName = iConfig.getParameter<std::string>("fileName");
66 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::GenJetCollection > _L1GenJetSource
Definition: L1Validator.h:90
edm::EDGetTokenT< reco::GenParticleCollection > _GenSource
Definition: L1Validator.h:84
edm::EDGetTokenT< GenEventInfoProduct > _srcToken
Definition: L1Validator.h:89
edm::EDGetTokenT< l1t::TauBxCollection > _L1TauBXSource
Definition: L1Validator.h:87
edm::EDGetTokenT< l1t::JetBxCollection > _L1JetBXSource
Definition: L1Validator.h:88
std::string _dirName
Definition: L1Validator.h:81
edm::EDGetTokenT< l1t::MuonBxCollection > _L1MuonBXSource
Definition: L1Validator.h:85
edm::EDGetTokenT< l1t::EGammaBxCollection > _L1EGammaBXSource
Definition: L1Validator.h:86
L1Validator::~L1Validator ( )
override

Definition at line 69 of file L1Validator.cc.

69  {
70 }

Member Function Documentation

void L1Validator::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

select the final state (i.e status==1) muons (pdg==+/-13)

select the final state (i.e status==1) electrons (pdg==+/-11) and photons (pdg==22)

select the matrix element (i.e status==2) taus (pdg==+/-15) before decay

Definition at line 77 of file L1Validator.cc.

References _GenSource, _Hists, _L1EGammaBXSource, _L1GenJetSource, _L1JetBXSource, _L1MuonBXSource, _L1TauBXSource, _srcToken, funct::abs(), BXVector< T >::begin(), reco::deltaR(), BXVector< T >::end(), PVValHelper::eta, reco::LeafCandidate::eta(), L1ValidatorHists::Fill(), L1ValidatorHists::FillNumber(), nanoDQM_cfi::GenPart, TauGenJets_cfi::GenParticles, edm::Event::getByToken(), BXVector< T >::getFirstBX(), BXVector< T >::getLastBX(), mps_fire::i, metsig::jet, nanoDQM_cfi::Jet, electronTrackIsolations_cfi::minDR, RPCpg::mu, nanoDQM_cfi::Muon, L1ValidatorHists::NEvents, reco::LeafCandidate::pdgId(), phi, reco::LeafCandidate::phi(), EnergyCorrector::pt, reco::LeafCandidate::pt(), BXVector< T >::size(), mps_update::status, reco::LeafCandidate::status(), metsig::tau, and parallelization::uint().

77  {
78  using namespace edm;
79  using namespace std;
80  using namespace l1extra;
81  using namespace reco;
82 
88  Handle<GenEventInfoProduct> genEvtInfoProduct;
90 
91  bool GotEverything=true;
92 
93  if(!iEvent.getByToken(_GenSource, GenParticles)) GotEverything=false;
94  if(!iEvent.getByToken(_L1MuonBXSource, MuonsBX)) GotEverything=false;
95  if(!iEvent.getByToken(_L1EGammaBXSource, EGammasBX)) GotEverything=false;
96  if(!iEvent.getByToken(_L1TauBXSource, TausBX)) GotEverything=false;
97  if(!iEvent.getByToken(_L1JetBXSource, JetsBX)) GotEverything=false;
98  if(!iEvent.getByToken(_srcToken, genEvtInfoProduct)) GotEverything=false;
99  if(!iEvent.getByToken(_L1GenJetSource, GenJets)) GotEverything=false;
100 
101  if(!GotEverything) return;
102 
103  /*
104  std::string moduleName = "";
105  if( genEvtInfoProduct.isValid() ) {
106  const edm::Provenance& prov = iEvent.getProvenance(genEvtInfoProduct.id());
107  moduleName = edm::moduleName(prov);
108  //cout<<" generator name: "<<moduleName<<endl;
109  }
110  */
111 
112  _Hists.NEvents++;
113 
114  int nL1Muons = 0, nL1EGammas = 0, nL1Taus = 0, nL1Jets = 0;
115  if(MuonsBX->getFirstBX()>=0) nL1Muons = MuonsBX->size(0);
116  if(EGammasBX->getFirstBX()>=0) nL1EGammas = EGammasBX->size(0);
117  if(TausBX->getFirstBX()>=0) nL1Taus = TausBX->size(0);
118  if(JetsBX->getFirstBX()>=0) nL1Jets = JetsBX->size(0);
119 
121  _Hists.FillNumber(L1ValidatorHists::Type::Egamma, nL1EGammas);
124 
125  //For gen jet
126 
127  for(auto &Genjet : *GenJets ){
128 
129  // eta within calorimeter acceptance 4.7
130  if(fabs((&Genjet)->eta())>4.7) continue;
131 
132  // only consider the gen jet with pt greater than 10 GeV
133  if((&Genjet)->pt()<10.0) continue;
134 
135  double minDR = 999.0;
136 
137  // match L1T object
138  const l1t::Jet *L1Part=nullptr;
139  for(int iBx = JetsBX->getFirstBX(); iBx<=JetsBX->getLastBX(); ++iBx){
140  if(iBx>0) continue;
141  for(std::vector<l1t::Jet>::const_iterator jet = JetsBX->begin(iBx); jet != JetsBX->end(iBx); ++jet){
142  double idR = reco::deltaR((&Genjet)->eta(), (&Genjet)->phi(), jet->eta(), jet->phi());
143  if( idR < minDR ){
144  minDR = idR;
145  L1Part = &(*jet);
146  }
147  }
148  }
149  _Hists.Fill(L1ValidatorHists::Type::Jet, &Genjet, L1Part);
150  }
151 
152 
153  for(uint i=0; i < GenParticles->size(); i++){
154  const GenParticle *GenPart = &GenParticles->at(i);
155 
156  int pdg = GenPart->pdgId(), status = GenPart->status();
157 
158  double minDR = 999.0;
159 
160  // only consider the gen particle with pt greater than 10 GeV
161  if(GenPart->pt()<10.0) continue;
162 
164  if(status==1 && abs(pdg)==13){ //Muon
165 
166  // eta within tracker acceptance 2.4
167  if(fabs(GenPart->eta())>2.4) continue;
168 
169  // match L1T object
170  const l1t::Muon *L1Part=nullptr;
171  for(int iBx = MuonsBX->getFirstBX(); iBx<=MuonsBX->getLastBX(); ++iBx){
172  if(iBx>0) continue;
173  for(std::vector<l1t::Muon>::const_iterator mu = MuonsBX->begin(iBx); mu != MuonsBX->end(iBx); ++mu){
174  double idR = reco::deltaR(GenPart->eta(), GenPart->phi(), mu->eta(), mu->phi());
175  if(idR < minDR ){
176  minDR = idR;
177  L1Part = &(*mu);
178  }
179 
180  }
181  _Hists.Fill(L1ValidatorHists::Type::Muon, GenPart, L1Part);
182  }
183 
184 
186  } else if(status==1 && (abs(pdg)==11 || pdg==22)){ //Egamma
187 
188  // eta within EM calorimeter acceptance 2.5
189  if(fabs(GenPart->eta())>2.5) continue;
190 
191  // exclude the calorimeter barrel and endcap overlap region
192  if(fabs(GenPart->eta())>1.4442 && fabs(GenPart->eta())<1.5660) continue;
193 
194  // match L1T object
195  const l1t::EGamma *L1Part=nullptr;
196  for(int iBx = EGammasBX->getFirstBX(); iBx<=EGammasBX->getLastBX(); ++iBx){
197  if(iBx>0) continue;
198  for(std::vector<l1t::EGamma>::const_iterator eg = EGammasBX->begin(iBx); eg != EGammasBX->end(iBx); ++eg){
199  double idR = reco::deltaR(GenPart->eta(), GenPart->phi(), eg->eta(), eg->phi());
200  if(idR < minDR ){
201  minDR = idR;
202  L1Part = &(*eg);
203  }
204  }
205  }
206  _Hists.Fill(L1ValidatorHists::Type::Egamma, GenPart, L1Part);
207 
208 
210  } else if(status==2 && abs(pdg)==15){ //Tau
211 
212  // eta within tracker acceptance 2.4
213  if(fabs(GenPart->eta())>2.4) continue;
214 
215  // match L1T object
216  const l1t::Tau *L1Part=nullptr;
217  for(int iBx = TausBX->getFirstBX(); iBx<=TausBX->getLastBX(); ++iBx){
218  if(iBx>0) continue;
219  for(std::vector<l1t::Tau>::const_iterator tau = TausBX->begin(iBx); tau != TausBX->end(iBx); ++tau){
220  double idR = reco::deltaR(GenPart->eta(), GenPart->phi(), tau->eta(), tau->phi());
221  if(idR < minDR ){
222  minDR = idR;
223  L1Part = &(*tau);
224  }
225  }
226  }
227  _Hists.Fill(L1ValidatorHists::Type::Tau, GenPart, L1Part);
228 
229  }
230 
231  }
232 
233 }
void Fill(int, const reco::LeafCandidate *, const reco::LeafCandidate *)
const_iterator end(int bx) const
edm::EDGetTokenT< reco::GenJetCollection > _L1GenJetSource
Definition: L1Validator.h:90
int pdgId() const final
PDG identifier.
unsigned size(int bx) const
double eta() const final
momentum pseudorapidity
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
edm::EDGetTokenT< reco::GenParticleCollection > _GenSource
Definition: L1Validator.h:84
Definition: Tau.h:21
edm::EDGetTokenT< GenEventInfoProduct > _srcToken
Definition: L1Validator.h:89
double pt() const final
transverse momentum
void FillNumber(int, int)
Definition: Jet.h:21
edm::EDGetTokenT< l1t::TauBxCollection > _L1TauBXSource
Definition: L1Validator.h:87
edm::EDGetTokenT< l1t::JetBxCollection > _L1JetBXSource
Definition: L1Validator.h:88
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:28
const int mu
Definition: Constants.h:22
edm::EDGetTokenT< l1t::MuonBxCollection > _L1MuonBXSource
Definition: L1Validator.h:85
Definition: Muon.h:21
int getFirstBX() const
def uint(string)
L1ValidatorHists _Hists
Definition: L1Validator.h:92
fixed size matrix
HLT enums.
int getLastBX() const
int status() const final
status word
edm::EDGetTokenT< l1t::EGammaBxCollection > _L1EGammaBXSource
Definition: L1Validator.h:86
const_iterator begin(int bx) const
double phi() const final
momentum azimuthal angle
void L1Validator::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 72 of file L1Validator.cc.

References _dirName, _Hists, and L1ValidatorHists::Book().

72  {
73  //iBooker.setCurrentFolder(_dirName);
74  _Hists.Book(iBooker, _dirName);
75 };
void Book(DQMStore::IBooker &, std::string dirname)
std::string _dirName
Definition: L1Validator.h:81
L1ValidatorHists _Hists
Definition: L1Validator.h:92
void L1Validator::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 308 of file L1Validator.cc.

References edm::ConfigurationDescriptions::addDefault(), DEFINE_FWK_MODULE, and edm::ParameterSetDescription::setUnknown().

308  {
309  //The following says we do not know what parameters are allowed so do no validation
310  // Please change this to state exactly what you do use, even if it is no parameters
312  desc.setUnknown();
313  descriptions.addDefault(desc);
314 }
void addDefault(ParameterSetDescription const &psetDescription)
const reco::LeafCandidate * L1Validator::FindBest ( const reco::GenParticle GenPart,
const std::vector< l1extra::L1EmParticle > *  Collection1,
const std::vector< l1extra::L1EmParticle > *  Collection2 = 0 
)
private

Definition at line 236 of file L1Validator.cc.

References reco::deltaR(), reco::LeafCandidate::eta(), mps_fire::i, reco::LeafCandidate::phi(), and parallelization::uint().

236  {
237  const reco::LeafCandidate *BestPart=nullptr;
238  double BestDR=999.;
239 
240  for(uint i=0; i < Collection1->size(); i++){
241  const reco::LeafCandidate *ThisPart = &Collection1->at(i);
242  double ThisDR = reco::deltaR(GenPart->eta(), GenPart->phi(), ThisPart->eta(), ThisPart->phi());
243  if(ThisDR < BestDR){
244  BestDR = ThisDR;
245  BestPart = ThisPart;
246  }
247  }
248 
249  if(Collection2==nullptr) return BestPart;
250 
251  for(uint i=0; i < Collection2->size(); i++){
252  const reco::LeafCandidate *ThisPart = &Collection2->at(i);
253  double ThisDR = reco::deltaR(GenPart->eta(), GenPart->phi(), ThisPart->eta(), ThisPart->phi());
254  if(ThisDR < BestDR){
255  BestDR = ThisDR;
256  BestPart = ThisPart;
257  }
258  }
259 
260  return BestPart;
261 }
double eta() const final
momentum pseudorapidity
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:28
def uint(string)
double phi() const final
momentum azimuthal angle
const reco::LeafCandidate * L1Validator::FindBest ( const reco::GenParticle GenPart,
const std::vector< l1extra::L1JetParticle > *  Collection1,
const std::vector< l1extra::L1JetParticle > *  Collection2 = 0 
)
private

Definition at line 263 of file L1Validator.cc.

References reco::deltaR(), reco::LeafCandidate::eta(), mps_fire::i, reco::LeafCandidate::phi(), and parallelization::uint().

263  {
264  const reco::LeafCandidate *BestPart=nullptr;
265  double BestDR=999.;
266 
267  for(uint i=0; i < Collection1->size(); i++){
268  const reco::LeafCandidate *ThisPart = &Collection1->at(i);
269  double ThisDR = reco::deltaR(GenPart->eta(), GenPart->phi(), ThisPart->eta(), ThisPart->phi());
270  if(ThisDR < BestDR){
271  BestDR = ThisDR;
272  BestPart = ThisPart;
273  }
274  }
275 
276  if(Collection2==nullptr) return BestPart;
277 
278  for(uint i=0; i < Collection2->size(); i++){
279  const reco::LeafCandidate *ThisPart = &Collection2->at(i);
280  double ThisDR = reco::deltaR(GenPart->eta(), GenPart->phi(), ThisPart->eta(), ThisPart->phi());
281  if(ThisDR < BestDR){
282  BestDR = ThisDR;
283  BestPart = ThisPart;
284  }
285  }
286 
287  return BestPart;
288 }
double eta() const final
momentum pseudorapidity
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:28
def uint(string)
double phi() const final
momentum azimuthal angle
const reco::LeafCandidate * L1Validator::FindBest ( const reco::GenParticle GenPart,
const std::vector< l1extra::L1MuonParticle > *  Collection1 
)
private

Definition at line 290 of file L1Validator.cc.

References reco::deltaR(), reco::LeafCandidate::eta(), mps_fire::i, reco::LeafCandidate::phi(), and parallelization::uint().

290  {
291  const reco::LeafCandidate *BestPart=nullptr;
292  double BestDR=999.;
293 
294  for(uint i=0; i < Collection1->size(); i++){
295  const reco::LeafCandidate *ThisPart = &Collection1->at(i);
296  double ThisDR = reco::deltaR(GenPart->eta(), GenPart->phi(), ThisPart->eta(), ThisPart->phi());
297  if(ThisDR < BestDR){
298  BestDR = ThisDR;
299  BestPart = ThisPart;
300  }
301  }
302 
303  return BestPart;
304 }
double eta() const final
momentum pseudorapidity
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:28
def uint(string)
double phi() const final
momentum azimuthal angle

Member Data Documentation

std::string L1Validator::_dirName
private

Definition at line 81 of file L1Validator.h.

Referenced by bookHistograms(), and L1Validator().

std::string L1Validator::_fileName
private

Definition at line 82 of file L1Validator.h.

Referenced by trackingPlots.TrackingSeedingLayerTable::draw().

edm::EDGetTokenT<reco::GenParticleCollection> L1Validator::_GenSource
private

Definition at line 84 of file L1Validator.h.

Referenced by analyze(), and L1Validator().

L1ValidatorHists L1Validator::_Hists
private

Definition at line 92 of file L1Validator.h.

Referenced by analyze(), and bookHistograms().

edm::EDGetTokenT<l1t::EGammaBxCollection> L1Validator::_L1EGammaBXSource
private

Definition at line 86 of file L1Validator.h.

Referenced by analyze(), and L1Validator().

edm::EDGetTokenT<reco::GenJetCollection> L1Validator::_L1GenJetSource
private

Definition at line 90 of file L1Validator.h.

Referenced by analyze(), and L1Validator().

edm::EDGetTokenT<l1t::JetBxCollection> L1Validator::_L1JetBXSource
private

Definition at line 88 of file L1Validator.h.

Referenced by analyze(), and L1Validator().

edm::EDGetTokenT<l1t::MuonBxCollection> L1Validator::_L1MuonBXSource
private

Definition at line 85 of file L1Validator.h.

Referenced by analyze(), and L1Validator().

edm::EDGetTokenT<l1t::TauBxCollection> L1Validator::_L1TauBXSource
private

Definition at line 87 of file L1Validator.h.

Referenced by analyze(), and L1Validator().

edm::EDGetTokenT<GenEventInfoProduct> L1Validator::_srcToken
private

Definition at line 89 of file L1Validator.h.

Referenced by analyze(), and L1Validator().