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 | Private Member Functions | Private Attributes
L1Validator Class Reference

#include <L1Validator.h>

Inheritance diagram for L1Validator:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 L1Validator (const edm::ParameterSet &)
 
 ~L1Validator ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- 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 edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &) override
 
virtual void endJob () override
 
virtual void endRun (edm::Run const &, edm::EventSetup const &) override
 
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

DQMStore_dbe
 
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::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- 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)
 

Detailed Description

Definition at line 59 of file L1Validator.h.

Constructor & Destructor Documentation

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

Definition at line 54 of file L1Validator.cc.

References _dbe, _dirName, _GenSource, _Hists, _L1ExtraCenJetSource, _L1ExtraForJetSource, _L1ExtraIsoEGSource, _L1ExtraMuonSource, _L1ExtraNonIsoEGSource, _L1ExtraTauJetSource, edm::ParameterSet::getParameter(), cppFunctionSkipper::operator, and AlCaHLTBitMon_QueryRunRegistry::string.

54  {
56  _dirName = iConfig.getParameter<std::string>("dirName");
57  _GenSource = consumes<reco::GenParticleCollection> (iConfig.getParameter<edm::InputTag>("GenSource"));
58 
59  _L1ExtraIsoEGSource = consumes<l1extra::L1EmParticleCollection> (iConfig.getParameter<edm::InputTag>("L1ExtraIsoEGSource"));
60  _L1ExtraNonIsoEGSource = consumes<l1extra::L1EmParticleCollection> (iConfig.getParameter<edm::InputTag>("L1ExtraNonIsoEGSource"));
61  _L1ExtraCenJetSource = consumes<l1extra::L1JetParticleCollection> (iConfig.getParameter<edm::InputTag>("L1ExtraCenJetSource"));
62  _L1ExtraForJetSource = consumes<l1extra::L1JetParticleCollection> (iConfig.getParameter<edm::InputTag>("L1ExtraForJetSource"));
63  _L1ExtraTauJetSource = consumes<l1extra::L1JetParticleCollection> (iConfig.getParameter<edm::InputTag>("L1ExtraTauJetSource"));
64  _L1ExtraMuonSource = consumes<l1extra::L1MuonParticleCollection> (iConfig.getParameter<edm::InputTag>("L1ExtraMuonSource"));
65  //_L1ExtraMETSource = consumes<l1extra::L1EtMissParticleCollection> (iConfig.getParameter<edm::InputTag>("L1ExtraMETSource"));
66 
67  //_fileName = iConfig.getParameter<std::string>("fileName");
68 
70 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::GenParticleCollection > _GenSource
Definition: L1Validator.h:83
edm::EDGetTokenT< l1extra::L1JetParticleCollection > _L1ExtraForJetSource
Definition: L1Validator.h:87
L1ValidatorHists * _Hists
Definition: L1Validator.h:92
std::string _dirName
Definition: L1Validator.h:80
DQMStore * _dbe
Definition: L1Validator.h:79
edm::EDGetTokenT< l1extra::L1JetParticleCollection > _L1ExtraTauJetSource
Definition: L1Validator.h:88
edm::EDGetTokenT< l1extra::L1MuonParticleCollection > _L1ExtraMuonSource
Definition: L1Validator.h:89
edm::EDGetTokenT< l1extra::L1EmParticleCollection > _L1ExtraIsoEGSource
Definition: L1Validator.h:84
edm::EDGetTokenT< l1extra::L1EmParticleCollection > _L1ExtraNonIsoEGSource
Definition: L1Validator.h:85
edm::EDGetTokenT< l1extra::L1JetParticleCollection > _L1ExtraCenJetSource
Definition: L1Validator.h:86
L1Validator::~L1Validator ( )

Definition at line 73 of file L1Validator.cc.

73  {
74 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 76 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, L1ValidatorHists::NEvents, NULL, reco::LeafCandidate::pdgId(), dt_dqm_sourceclient_common_cff::reco, reco::LeafCandidate::status(), ntuplemaker::status, and TauJet.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 174 of file L1Validator.cc.

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

174  {
175  _dbe->setCurrentFolder(_dirName.c_str());
176  _Hists->Book();
177 }
L1ValidatorHists * _Hists
Definition: L1Validator.h:92
std::string _dirName
Definition: L1Validator.h:80
DQMStore * _dbe
Definition: L1Validator.h:79
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667
void L1Validator::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 166 of file L1Validator.cc.

166  {
167 
168  //TFile OutFile(_fileName.c_str(), "recreate");
169  //_Hists->Write();
170  //OutFile.Close();
171 }
void L1Validator::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 181 of file L1Validator.cc.

181  {
182  //_Hists->Normalize();
183 }
void L1Validator::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 274 of file L1Validator.cc.

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

274  {
275  //The following says we do not know what parameters are allowed so do no validation
276  // Please change this to state exactly what you do use, even if it is no parameters
278  desc.setUnknown();
279  descriptions.addDefault(desc);
280 }
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 202 of file L1Validator.cc.

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

202  {
203  const reco::LeafCandidate *BestPart=NULL;
204  double BestDR=999.;
205 
206  for(uint i=0; i < Collection1->size(); i++){
207  const reco::LeafCandidate *ThisPart = &Collection1->at(i);
208  double ThisDR = reco::deltaR(GenPart->eta(), GenPart->phi(), ThisPart->eta(), ThisPart->phi());
209  if(ThisDR < BestDR){
210  BestDR = ThisDR;
211  BestPart = ThisPart;
212  }
213  }
214 
215  if(Collection2==NULL) return BestPart;
216 
217  for(uint i=0; i < Collection2->size(); i++){
218  const reco::LeafCandidate *ThisPart = &Collection2->at(i);
219  double ThisDR = reco::deltaR(GenPart->eta(), GenPart->phi(), ThisPart->eta(), ThisPart->phi());
220  if(ThisDR < BestDR){
221  BestDR = ThisDR;
222  BestPart = ThisPart;
223  }
224  }
225 
226  return BestPart;
227 }
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 229 of file L1Validator.cc.

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

229  {
230  const reco::LeafCandidate *BestPart=NULL;
231  double BestDR=999.;
232 
233  for(uint i=0; i < Collection1->size(); i++){
234  const reco::LeafCandidate *ThisPart = &Collection1->at(i);
235  double ThisDR = reco::deltaR(GenPart->eta(), GenPart->phi(), ThisPart->eta(), ThisPart->phi());
236  if(ThisDR < BestDR){
237  BestDR = ThisDR;
238  BestPart = ThisPart;
239  }
240  }
241 
242  if(Collection2==NULL) return BestPart;
243 
244  for(uint i=0; i < Collection2->size(); i++){
245  const reco::LeafCandidate *ThisPart = &Collection2->at(i);
246  double ThisDR = reco::deltaR(GenPart->eta(), GenPart->phi(), ThisPart->eta(), ThisPart->phi());
247  if(ThisDR < BestDR){
248  BestDR = ThisDR;
249  BestPart = ThisPart;
250  }
251  }
252 
253  return BestPart;
254 }
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 256 of file L1Validator.cc.

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

256  {
257  const reco::LeafCandidate *BestPart=NULL;
258  double BestDR=999.;
259 
260  for(uint i=0; i < Collection1->size(); i++){
261  const reco::LeafCandidate *ThisPart = &Collection1->at(i);
262  double ThisDR = reco::deltaR(GenPart->eta(), GenPart->phi(), ThisPart->eta(), ThisPart->phi());
263  if(ThisDR < BestDR){
264  BestDR = ThisDR;
265  BestPart = ThisPart;
266  }
267  }
268 
269  return BestPart;
270 }
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

DQMStore* L1Validator::_dbe
private

Definition at line 79 of file L1Validator.h.

Referenced by beginRun(), and L1Validator().

std::string L1Validator::_dirName
private

Definition at line 80 of file L1Validator.h.

Referenced by beginRun(), and L1Validator().

std::string L1Validator::_fileName
private

Definition at line 81 of file L1Validator.h.

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

Definition at line 83 of file L1Validator.h.

Referenced by analyze(), and L1Validator().

L1ValidatorHists* L1Validator::_Hists
private

Definition at line 92 of file L1Validator.h.

Referenced by analyze(), beginRun(), and L1Validator().

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

Definition at line 86 of file L1Validator.h.

Referenced by analyze(), and L1Validator().

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

Definition at line 87 of file L1Validator.h.

Referenced by analyze(), and L1Validator().

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

Definition at line 84 of file L1Validator.h.

Referenced by analyze(), and L1Validator().

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

Definition at line 89 of file L1Validator.h.

Referenced by analyze(), and L1Validator().

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

Definition at line 85 of file L1Validator.h.

Referenced by analyze(), and L1Validator().

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

Definition at line 88 of file L1Validator.h.

Referenced by analyze(), and L1Validator().