CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
 L1Validator (const edm::ParameterSet &)
 
 ~L1Validator ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual 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
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (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)
 

Protected Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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
< l1extra::L1JetParticleCollection
_L1ExtraCenJetSource
 
edm::EDGetTokenT
< l1extra::L1JetParticleCollection
_L1ExtraForJetSource
 
edm::EDGetTokenT
< l1extra::L1EmParticleCollection
_L1ExtraIsoEGSource
 
edm::EDGetTokenT
< l1extra::L1MuonParticleCollection
_L1ExtraMuonSource
 
edm::EDGetTokenT
< l1extra::L1EmParticleCollection
_L1ExtraNonIsoEGSource
 
edm::EDGetTokenT
< l1extra::L1JetParticleCollection
_L1ExtraTauJetSource
 

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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 

Detailed Description

Definition at line 60 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, _L1ExtraCenJetSource, _L1ExtraForJetSource, _L1ExtraIsoEGSource, _L1ExtraMuonSource, _L1ExtraNonIsoEGSource, _L1ExtraTauJetSource, 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  _L1ExtraIsoEGSource = consumes<l1extra::L1EmParticleCollection> (iConfig.getParameter<edm::InputTag>("L1ExtraIsoEGSource"));
59  _L1ExtraNonIsoEGSource = consumes<l1extra::L1EmParticleCollection> (iConfig.getParameter<edm::InputTag>("L1ExtraNonIsoEGSource"));
60  _L1ExtraCenJetSource = consumes<l1extra::L1JetParticleCollection> (iConfig.getParameter<edm::InputTag>("L1ExtraCenJetSource"));
61  _L1ExtraForJetSource = consumes<l1extra::L1JetParticleCollection> (iConfig.getParameter<edm::InputTag>("L1ExtraForJetSource"));
62  _L1ExtraTauJetSource = consumes<l1extra::L1JetParticleCollection> (iConfig.getParameter<edm::InputTag>("L1ExtraTauJetSource"));
63  _L1ExtraMuonSource = consumes<l1extra::L1MuonParticleCollection> (iConfig.getParameter<edm::InputTag>("L1ExtraMuonSource"));
64  //_L1ExtraMETSource = consumes<l1extra::L1EtMissParticleCollection> (iConfig.getParameter<edm::InputTag>("L1ExtraMETSource"));
65 
66  //_fileName = iConfig.getParameter<std::string>("fileName");
67 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::GenParticleCollection > _GenSource
Definition: L1Validator.h:76
edm::EDGetTokenT< l1extra::L1JetParticleCollection > _L1ExtraForJetSource
Definition: L1Validator.h:80
std::string _dirName
Definition: L1Validator.h:73
edm::EDGetTokenT< l1extra::L1JetParticleCollection > _L1ExtraTauJetSource
Definition: L1Validator.h:81
edm::EDGetTokenT< l1extra::L1MuonParticleCollection > _L1ExtraMuonSource
Definition: L1Validator.h:82
edm::EDGetTokenT< l1extra::L1EmParticleCollection > _L1ExtraIsoEGSource
Definition: L1Validator.h:77
edm::EDGetTokenT< l1extra::L1EmParticleCollection > _L1ExtraNonIsoEGSource
Definition: L1Validator.h:78
edm::EDGetTokenT< l1extra::L1JetParticleCollection > _L1ExtraCenJetSource
Definition: L1Validator.h:79
L1Validator::~L1Validator ( )

Definition at line 70 of file L1Validator.cc.

70  {
71 }

Member Function Documentation

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

Implements edm::stream::EDAnalyzerBase.

Definition at line 78 of file L1Validator.cc.

References _GenSource, _Hists, _L1ExtraCenJetSource, _L1ExtraForJetSource, _L1ExtraIsoEGSource, _L1ExtraMuonSource, _L1ExtraNonIsoEGSource, _L1ExtraTauJetSource, funct::abs(), CenJet, L1ValidatorHists::Fill(), L1ValidatorHists::FillNumber(), FINDRECOPART, ForJet, edm::Event::getByToken(), i, IsoEG, configurableAnalysis::Muon, L1ValidatorHists::NEvents, NULL, reco::LeafCandidate::pdgId(), dt_dqm_sourceclient_common_cff::reco, reco::LeafCandidate::status(), ntuplemaker::status, and TauJet.

78  {
79  using namespace edm;
80  using namespace std;
81  using namespace l1extra;
82  using namespace reco;
83 
84  Handle<GenParticleCollection> GenParticles;
91  //Handle<L1EtMissParticleCollection> METs;
92 
93  bool GotEverything=true;
94 
95  if(!iEvent.getByToken(_GenSource, GenParticles)) GotEverything=false;
96  if(!iEvent.getByToken(_L1ExtraIsoEGSource, IsoEGs)) GotEverything=false;
97  if(!iEvent.getByToken(_L1ExtraNonIsoEGSource, NonIsoEGs)) GotEverything=false;
98  if(!iEvent.getByToken(_L1ExtraCenJetSource, CenJets)) GotEverything=false;
99  if(!iEvent.getByToken(_L1ExtraForJetSource, ForJets)) GotEverything=false;
100  if(!iEvent.getByToken(_L1ExtraTauJetSource, Taus)) GotEverything=false;
101  if(!iEvent.getByToken(_L1ExtraMuonSource, Muons)) GotEverything=false;
102 
103  if(!GotEverything) return;
104 
105 
106  _Hists.NEvents++;
107 
109  _Hists.FillNumber(L1ValidatorHists::Type::NonIsoEG, NonIsoEGs->size());
114 
115  for(uint i=0; i < GenParticles->size(); i++){
116  const GenParticle *GenPart = &GenParticles->at(i);
117 
118  int pdg = GenPart->pdgId(), status = GenPart->status();
119 
120  if(status==1 && (abs(pdg)==11 || pdg==22)){
121  FINDRECOPART(L1EmParticle, IsoEGs, NonIsoEGs)
122 
123  if(RecoPart==NULL){
124  _Hists.Fill(L1ValidatorHists::Type::IsoEG, GenPart, NULL);
125  _Hists.Fill(L1ValidatorHists::Type::NonIsoEG, GenPart, NULL);
126  }else if(RecoPart->type() == L1EmParticle::EmType::kIsolated){
127  _Hists.Fill(L1ValidatorHists::Type::IsoEG, GenPart, RecoPart);
128  _Hists.Fill(L1ValidatorHists::Type::NonIsoEG, GenPart, NULL);
129  }else if(RecoPart->type() == L1EmParticle::EmType::kNonIsolated){
130  _Hists.Fill(L1ValidatorHists::Type::IsoEG, GenPart, NULL);
131  _Hists.Fill(L1ValidatorHists::Type::NonIsoEG, GenPart, RecoPart);
132  }
133  }else if(status==1 && abs(pdg)==13){
134  FINDRECOPART(L1MuonParticle, Muons, Muons)
135 
136  _Hists.Fill(L1ValidatorHists::Type::Muon, GenPart, RecoPart);
137  }else if(status==3 && abs(pdg)==15){
138  FINDRECOPART(L1JetParticle, Taus, Taus)
139 
140  _Hists.Fill(L1ValidatorHists::Type::TauJet, GenPart, RecoPart);
141  }else if(status==3 && (abs(pdg)<=5 || pdg==21)){
142  FINDRECOPART(L1JetParticle, CenJets, ForJets)
143 
144  if(RecoPart==NULL){
147  }else if(RecoPart->type() == L1JetParticle::JetType::kCentral){
148  _Hists.Fill(L1ValidatorHists::Type::CenJet, GenPart, RecoPart);
150  }else if(RecoPart->type() == L1JetParticle::JetType::kForward){
152  _Hists.Fill(L1ValidatorHists::Type::ForJet, GenPart, RecoPart);
153  }
154  }else continue;
155 
156  //cout << GenPart->pt() << '\t' << GenPart->eta() << '\t' << GenPart->phi() << '\t' << GenPart->pdgId() << endl;
157  }
158 }
void Fill(int, const reco::LeafCandidate *, const reco::LeafCandidate *)
int i
Definition: DBlmapReader.cc:9
virtual int pdgId() const
PDG identifier.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
virtual int status() const
status word
edm::EDGetTokenT< reco::GenParticleCollection > _GenSource
Definition: L1Validator.h:76
#define NULL
Definition: scimark2.h:8
void FillNumber(int, int)
edm::EDGetTokenT< l1extra::L1JetParticleCollection > _L1ExtraForJetSource
Definition: L1Validator.h:80
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define FINDRECOPART(TYPE, COLLECTION1, COLLECTION2)
Definition: L1Validator.cc:32
edm::EDGetTokenT< l1extra::L1JetParticleCollection > _L1ExtraTauJetSource
Definition: L1Validator.h:81
edm::EDGetTokenT< l1extra::L1MuonParticleCollection > _L1ExtraMuonSource
Definition: L1Validator.h:82
L1ValidatorHists _Hists
Definition: L1Validator.h:85
edm::EDGetTokenT< l1extra::L1EmParticleCollection > _L1ExtraIsoEGSource
Definition: L1Validator.h:77
edm::EDGetTokenT< l1extra::L1EmParticleCollection > _L1ExtraNonIsoEGSource
Definition: L1Validator.h:78
edm::EDGetTokenT< l1extra::L1JetParticleCollection > _L1ExtraCenJetSource
Definition: L1Validator.h:79
tuple status
Definition: ntuplemaker.py:245
if(conf.exists("allCellsPositionCalc"))
void L1Validator::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 73 of file L1Validator.cc.

References _dirName, _Hists, L1ValidatorHists::Book(), and DQMStore::IBooker::setCurrentFolder().

73  {
74  iBooker.setCurrentFolder(_dirName.c_str());
75  _Hists.Book(iBooker);
76 };
std::string _dirName
Definition: L1Validator.h:73
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
L1ValidatorHists _Hists
Definition: L1Validator.h:85
void Book(DQMStore::IBooker &)
void L1Validator::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 233 of file L1Validator.cc.

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

233  {
234  //The following says we do not know what parameters are allowed so do no validation
235  // Please change this to state exactly what you do use, even if it is no parameters
237  desc.setUnknown();
238  descriptions.addDefault(desc);
239 }
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 = NULL 
)
private

Definition at line 161 of file L1Validator.cc.

References reco::deltaR(), reco::LeafCandidate::eta(), i, NULL, and reco::LeafCandidate::phi().

161  {
162  const reco::LeafCandidate *BestPart=NULL;
163  double BestDR=999.;
164 
165  for(uint i=0; i < Collection1->size(); i++){
166  const reco::LeafCandidate *ThisPart = &Collection1->at(i);
167  double ThisDR = reco::deltaR(GenPart->eta(), GenPart->phi(), ThisPart->eta(), ThisPart->phi());
168  if(ThisDR < BestDR){
169  BestDR = ThisDR;
170  BestPart = ThisPart;
171  }
172  }
173 
174  if(Collection2==NULL) return BestPart;
175 
176  for(uint i=0; i < Collection2->size(); i++){
177  const reco::LeafCandidate *ThisPart = &Collection2->at(i);
178  double ThisDR = reco::deltaR(GenPart->eta(), GenPart->phi(), ThisPart->eta(), ThisPart->phi());
179  if(ThisDR < BestDR){
180  BestDR = ThisDR;
181  BestPart = ThisPart;
182  }
183  }
184 
185  return BestPart;
186 }
int i
Definition: DBlmapReader.cc:9
virtual float phi() const
momentum azimuthal angle
#define NULL
Definition: scimark2.h:8
double deltaR(const T1 &t1, const T2 &t2)
Definition: deltaR.h:48
virtual float eta() const
momentum pseudorapidity
const reco::LeafCandidate * L1Validator::FindBest ( const reco::GenParticle GenPart,
const std::vector< l1extra::L1JetParticle > *  Collection1,
const std::vector< l1extra::L1JetParticle > *  Collection2 = NULL 
)
private

Definition at line 188 of file L1Validator.cc.

References reco::deltaR(), reco::LeafCandidate::eta(), i, NULL, and reco::LeafCandidate::phi().

188  {
189  const reco::LeafCandidate *BestPart=NULL;
190  double BestDR=999.;
191 
192  for(uint i=0; i < Collection1->size(); i++){
193  const reco::LeafCandidate *ThisPart = &Collection1->at(i);
194  double ThisDR = reco::deltaR(GenPart->eta(), GenPart->phi(), ThisPart->eta(), ThisPart->phi());
195  if(ThisDR < BestDR){
196  BestDR = ThisDR;
197  BestPart = ThisPart;
198  }
199  }
200 
201  if(Collection2==NULL) return BestPart;
202 
203  for(uint i=0; i < Collection2->size(); i++){
204  const reco::LeafCandidate *ThisPart = &Collection2->at(i);
205  double ThisDR = reco::deltaR(GenPart->eta(), GenPart->phi(), ThisPart->eta(), ThisPart->phi());
206  if(ThisDR < BestDR){
207  BestDR = ThisDR;
208  BestPart = ThisPart;
209  }
210  }
211 
212  return BestPart;
213 }
int i
Definition: DBlmapReader.cc:9
virtual float phi() const
momentum azimuthal angle
#define NULL
Definition: scimark2.h:8
double deltaR(const T1 &t1, const T2 &t2)
Definition: deltaR.h:48
virtual float eta() const
momentum pseudorapidity
const reco::LeafCandidate * L1Validator::FindBest ( const reco::GenParticle GenPart,
const std::vector< l1extra::L1MuonParticle > *  Collection1 
)
private

Definition at line 215 of file L1Validator.cc.

References reco::deltaR(), reco::LeafCandidate::eta(), i, NULL, and reco::LeafCandidate::phi().

215  {
216  const reco::LeafCandidate *BestPart=NULL;
217  double BestDR=999.;
218 
219  for(uint i=0; i < Collection1->size(); i++){
220  const reco::LeafCandidate *ThisPart = &Collection1->at(i);
221  double ThisDR = reco::deltaR(GenPart->eta(), GenPart->phi(), ThisPart->eta(), ThisPart->phi());
222  if(ThisDR < BestDR){
223  BestDR = ThisDR;
224  BestPart = ThisPart;
225  }
226  }
227 
228  return BestPart;
229 }
int i
Definition: DBlmapReader.cc:9
virtual float phi() const
momentum azimuthal angle
#define NULL
Definition: scimark2.h:8
double deltaR(const T1 &t1, const T2 &t2)
Definition: deltaR.h:48
virtual float eta() const
momentum pseudorapidity

Member Data Documentation

std::string L1Validator::_dirName
private

Definition at line 73 of file L1Validator.h.

Referenced by bookHistograms(), and L1Validator().

std::string L1Validator::_fileName
private

Definition at line 74 of file L1Validator.h.

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

Definition at line 76 of file L1Validator.h.

Referenced by analyze(), and L1Validator().

L1ValidatorHists L1Validator::_Hists
private

Definition at line 85 of file L1Validator.h.

Referenced by analyze(), and bookHistograms().

edm::EDGetTokenT<l1extra::L1JetParticleCollection> L1Validator::_L1ExtraCenJetSource
private

Definition at line 79 of file L1Validator.h.

Referenced by analyze(), and L1Validator().

edm::EDGetTokenT<l1extra::L1JetParticleCollection> L1Validator::_L1ExtraForJetSource
private

Definition at line 80 of file L1Validator.h.

Referenced by analyze(), and L1Validator().

edm::EDGetTokenT<l1extra::L1EmParticleCollection> L1Validator::_L1ExtraIsoEGSource
private

Definition at line 77 of file L1Validator.h.

Referenced by analyze(), and L1Validator().

edm::EDGetTokenT<l1extra::L1MuonParticleCollection> L1Validator::_L1ExtraMuonSource
private

Definition at line 82 of file L1Validator.h.

Referenced by analyze(), and L1Validator().

edm::EDGetTokenT<l1extra::L1EmParticleCollection> L1Validator::_L1ExtraNonIsoEGSource
private

Definition at line 78 of file L1Validator.h.

Referenced by analyze(), and L1Validator().

edm::EDGetTokenT<l1extra::L1JetParticleCollection> L1Validator::_L1ExtraTauJetSource
private

Definition at line 81 of file L1Validator.h.

Referenced by analyze(), and L1Validator().