32 #define FINDRECOPART(TYPE, COLLECTION1, COLLECTION2) \
33 const TYPE *RecoPart = NULL; \
34 double BestDist = 999.; \
35 for (uint i = 0; i < COLLECTION1->size(); i++) { \
36 const TYPE *ThisPart = &COLLECTION1->at(i); \
37 double ThisDist = reco::deltaR(GenPart->eta(), GenPart->phi(), ThisPart->eta(), ThisPart->phi()); \
38 if (ThisDist < 1.0 && ThisDist < BestDist) { \
39 BestDist = ThisDist; \
40 RecoPart = ThisPart; \
43 if (COLLECTION1.product() != COLLECTION2.product()) { \
44 for (uint i = 0; i < COLLECTION2->size(); i++) { \
45 const TYPE *ThisPart = &COLLECTION2->at(i); \
46 double ThisDist = reco::deltaR(GenPart->eta(), GenPart->phi(), ThisPart->eta(), ThisPart->phi()); \
47 if (ThisDist < 1.0 && ThisDist < BestDist) { \
48 BestDist = ThisDist; \
49 RecoPart = ThisPart; \
78 using namespace l1extra;
89 bool GotEverything =
true;
92 GotEverything =
false;
94 GotEverything =
false;
96 GotEverything =
false;
98 GotEverything =
false;
100 GotEverything =
false;
102 GotEverything =
false;
104 GotEverything =
false;
121 int nL1Muons = 0, nL1EGammas = 0, nL1Taus = 0, nL1Jets = 0;
122 if (MuonsBX->getFirstBX() >= 0)
123 nL1Muons = MuonsBX->size(0);
124 if (EGammasBX->getFirstBX() >= 0)
125 nL1EGammas = EGammasBX->size(0);
126 if (TausBX->getFirstBX() >= 0)
127 nL1Taus = TausBX->size(0);
128 if (JetsBX->getFirstBX() >= 0)
129 nL1Jets = JetsBX->size(0);
138 for (
auto &Genjet : *
GenJets) {
140 if (fabs((&Genjet)->
eta()) > 4.7)
144 if ((&Genjet)->
pt() < 10.0)
147 double minDR = 999.0;
151 for (
int iBx = JetsBX->getFirstBX(); iBx <= JetsBX->getLastBX(); ++iBx) {
154 for (std::vector<l1t::Jet>::const_iterator
jet = JetsBX->begin(iBx);
jet != JetsBX->end(iBx); ++
jet) {
165 for (
uint i = 0;
i < GenParticles->size();
i++) {
170 double minDR = 999.0;
173 if (GenPart->
pt() < 10.0)
180 if (fabs(GenPart->
eta()) > 2.4)
185 for (
int iBx = MuonsBX->getFirstBX(); iBx <= MuonsBX->getLastBX(); ++iBx) {
188 for (std::vector<l1t::Muon>::const_iterator
mu = MuonsBX->begin(iBx);
mu != MuonsBX->end(iBx); ++
mu) {
200 }
else if (
status == 1 && (
abs(pdg) == 11 || pdg == 22)) {
203 if (fabs(GenPart->
eta()) > 2.5)
207 if (fabs(GenPart->
eta()) > 1.4442 && fabs(GenPart->
eta()) < 1.5660)
212 for (
int iBx = EGammasBX->getFirstBX(); iBx <= EGammasBX->getLastBX(); ++iBx) {
215 for (std::vector<l1t::EGamma>::const_iterator eg = EGammasBX->begin(iBx); eg != EGammasBX->end(iBx); ++eg) {
223 _Hists.
Fill(L1ValidatorHists::Type::Egamma, GenPart, L1Part);
227 }
else if (
status == 2 &&
abs(pdg) == 15) {
230 if (fabs(GenPart->
eta()) > 2.4)
235 for (
int iBx = TausBX->getFirstBX(); iBx <= TausBX->getLastBX(); ++iBx) {
238 for (std::vector<l1t::Tau>::const_iterator
tau = TausBX->begin(iBx);
tau != TausBX->end(iBx); ++
tau) {
254 const std::vector<l1extra::L1EmParticle> *Collection1,
255 const std::vector<l1extra::L1EmParticle> *Collection2 =
nullptr) {
257 double BestDR = 999.;
259 for (
uint i = 0;
i < Collection1->size();
i++) {
262 if (ThisDR < BestDR) {
268 if (Collection2 ==
nullptr)
271 for (
uint i = 0;
i < Collection2->size();
i++) {
274 if (ThisDR < BestDR) {
284 const std::vector<l1extra::L1JetParticle> *Collection1,
285 const std::vector<l1extra::L1JetParticle> *Collection2 =
nullptr) {
287 double BestDR = 999.;
289 for (
uint i = 0;
i < Collection1->size();
i++) {
292 if (ThisDR < BestDR) {
298 if (Collection2 ==
nullptr)
301 for (
uint i = 0;
i < Collection2->size();
i++) {
304 if (ThisDR < BestDR) {
314 const std::vector<l1extra::L1MuonParticle> *Collection1) {
316 double BestDR = 999.;
318 for (
uint i = 0;
i < Collection1->size();
i++) {
321 if (ThisDR < BestDR) {
void Fill(int, const reco::LeafCandidate *, const reco::LeafCandidate *)
edm::EDGetTokenT< reco::GenJetCollection > _L1GenJetSource
double pt() const final
transverse momentum
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< reco::GenParticleCollection > _GenSource
edm::EDGetTokenT< GenEventInfoProduct > _srcToken
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
int status() const final
status word
L1Validator(const edm::ParameterSet &)
int pdgId() const final
PDG identifier.
void FillNumber(int, int)
void Book(DQMStore::IBooker &, std::string dirname)
void addDefault(ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< l1t::TauBxCollection > _L1TauBXSource
edm::EDGetTokenT< l1t::JetBxCollection > _L1JetBXSource
Abs< T >::type abs(const T &t)
edm::EDGetTokenT< l1t::MuonBxCollection > _L1MuonBXSource
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
void analyze(const edm::Event &, const edm::EventSetup &) override
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
T getParameter(std::string const &) const
const reco::LeafCandidate * FindBest(const reco::GenParticle *, const std::vector< l1extra::L1EmParticle > *, const std::vector< l1extra::L1EmParticle > *)
edm::EDGetTokenT< l1t::EGammaBxCollection > _L1EGammaBXSource
double phi() const final
momentum azimuthal angle
double eta() const final
momentum pseudorapidity