47 produces<l1t::ObjectRefBxCollection<T>>(
"collection1ExcessObjects");
48 produces<l1t::ObjectRefBxCollection<T>>(
"collection2ExcessObjects");
51 produces<l1t::ObjectRefPairBxCollection<T>>(
"objectMatches");
52 produces<l1t::ObjectRefPairBxCollection<T>>(
"objectMismatches");
62 desc.
add<
bool>(
"checkBxRange",
true)->setComment(
"Check if BX ranges match");
63 desc.
add<
bool>(
"checkCollSizePerBx",
true)->setComment(
"Check if collection sizes within one BX match");
64 desc.
add<
bool>(
"checkObject",
true)->setComment(
"Check if objects match");
71 auto excessObjRefsColl1 = std::make_unique<l1t::ObjectRefBxCollection<T>>();
72 auto excessObjRefsColl2 = std::make_unique<l1t::ObjectRefBxCollection<T>>();
73 auto matchRefPairs = std::make_unique<l1t::ObjectRefPairBxCollection<T>>();
74 auto mismatchRefPairs = std::make_unique<l1t::ObjectRefPairBxCollection<T>>();
82 excessObjRefsColl1->setBXRange(bxColl1->getFirstBX(), bxColl1->getLastBX());
83 excessObjRefsColl2->setBXRange(bxColl2->getFirstBX(), bxColl2->getLastBX());
85 matchRefPairs->setBXRange(
std::max(bxColl1->getFirstBX(), bxColl2->getFirstBX()),
std::min(bxColl1->getLastBX(), bxColl2->getLastBX()));
86 mismatchRefPairs->setBXRange(
std::max(bxColl1->getFirstBX(), bxColl2->getFirstBX()),
std::min(bxColl1->getLastBX(), bxColl2->getLastBX()));
92 for (
auto iBx = bxColl1->getFirstBX(); iBx < bxColl2->getFirstBX(); ++iBx) {
93 for (it = bxColl1->
begin(iBx); it != bxColl1->
end(iBx); ++it) {
95 excessObjRefsColl1->push_back(iBx, ref);
98 for (
auto iBx = bxColl1->getLastBX(); iBx > bxColl2->getLastBX(); --iBx) {
99 for (it = bxColl1->
begin(iBx); it != bxColl1->
end(iBx); ++it) {
101 excessObjRefsColl1->push_back(iBx, ref);
105 for (
auto iBx = bxColl2->getFirstBX(); iBx < bxColl1->getFirstBX(); ++iBx) {
106 for (it = bxColl2->begin(iBx); it != bxColl2->end(iBx); ++it) {
108 excessObjRefsColl2->push_back(iBx, ref);
111 for (
auto iBx = bxColl2->getLastBX(); iBx > bxColl1->getLastBX(); --iBx) {
112 for (it = bxColl2->begin(iBx); it != bxColl2->end(iBx); ++it) {
114 excessObjRefsColl2->push_back(iBx, ref);
120 for (
int iBx = matchRefPairs->getFirstBX(); iBx <= matchRefPairs->getLastBX(); ++iBx) {
121 auto it1 = bxColl1->begin(iBx);
122 auto it2 = bxColl2->begin(iBx);
123 while (it1 != bxColl1->end(iBx) && it2 != bxColl2->end(iBx)) {
129 matchRefPairs->push_back(iBx, std::make_pair(ref1, ref2));
131 mismatchRefPairs->push_back(iBx, std::make_pair(ref1, ref2));
139 while (it1 != bxColl1->end(iBx)) {
141 excessObjRefsColl1->push_back(iBx, ref);
144 while (it2 != bxColl2->end(iBx)) {
146 excessObjRefsColl2->push_back(iBx, ref);
154 e.
put(
std::move(excessObjRefsColl1),
"collection1ExcessObjects");
155 e.
put(
std::move(excessObjRefsColl2),
"collection2ExcessObjects");
const_iterator end(int bx) const
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
L1TStage2ObjectComparison< GlobalAlgBlk > L1TStage2GlobalAlgBlkComparison
edm::EDGetTokenT< BXVector< T > > token1_
key_type key() const
Accessor for product key.
const bool checkCollSizePerBx_
L1TStage2ObjectComparison(const edm::ParameterSet &ps)
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< BXVector< T > > token2_
void produce(edm::Event &, const edm::EventSetup &) override
L1TStage2ObjectComparison< l1t::Muon > L1TStage2MuonComparison
ParameterDescriptionBase * add(U const &iLabel, T const &value)
L1TStage2ObjectComparison< l1t::Tau > L1TStage2TauComparison
~L1TStage2ObjectComparison() override=default
L1TStage2ObjectComparison< l1t::EtSum > L1TStage2EtSumComparison
L1TStage2ObjectComparison< l1t::EGamma > L1TStage2EGammaComparison
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const_iterator begin(int bx) const
L1TStage2ObjectComparison< l1t::RegionalMuonCand > L1TStage2RegionalMuonCandComparison
L1TStage2ObjectComparison< l1t::Jet > L1TStage2JetComparison