CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
L1GTDoubleObjectCond Class Reference
Inheritance diagram for L1GTDoubleObjectCond:
edm::global::EDFilter<> edm::global::EDFilterBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 L1GTDoubleObjectCond (const edm::ParameterSet &)
 
 ~L1GTDoubleObjectCond () override=default
 
- Public Member Functions inherited from edm::global::EDFilter<>
 EDFilter ()=default
 
 EDFilter (const EDFilter &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDFilteroperator= (const EDFilter &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDFilterBase
 EDFilterBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilterBase () 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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from edm::global::EDFilterBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

bool filter (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 

Private Attributes

const L1GTSingleCollectionCut collection1Cuts_
 
const L1GTSingleCollectionCut collection2Cuts_
 
const L1GTDeltaCut deltaCuts_
 
const bool enable_sanity_checks_
 
const bool inv_mass_checks_
 
const L1GTScales scales_
 
const edm::EDGetTokenT< P2GTCandidateCollectiontoken1_
 
const edm::EDGetTokenT< P2GTCandidateCollectiontoken2_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDFilterBase
typedef EDFilterBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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 Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 31 of file L1GTDoubleObjectCond.cc.

Constructor & Destructor Documentation

◆ L1GTDoubleObjectCond()

L1GTDoubleObjectCond::L1GTDoubleObjectCond ( const edm::ParameterSet config)
explicit

Definition at line 55 of file L1GTDoubleObjectCond.cc.

References collection1Cuts_, collection2Cuts_, edm::InputTag::instance(), inv_mass_checks_, and l1t::L1GTSingleCollectionCut::tag().

56  : scales_(config.getParameter<edm::ParameterSet>("scales")),
57  collection1Cuts_(config.getParameterSet("collection1"), config, scales_),
58  collection2Cuts_(config.getParameterSet("collection2"), config, scales_),
59  enable_sanity_checks_(config.getUntrackedParameter<bool>("sanity_checks")),
60  inv_mass_checks_(config.getUntrackedParameter<bool>("inv_mass_checks")),
62  token1_(consumes<P2GTCandidateCollection>(collection1Cuts_.tag())),
64  ? token1_
65  : consumes<P2GTCandidateCollection>(collection2Cuts_.tag())) {
66  produces<P2GTCandidateVectorRef>(collection1Cuts_.tag().instance());
67 
68  if (!(collection1Cuts_.tag() == collection2Cuts_.tag())) {
69  produces<P2GTCandidateVectorRef>(collection2Cuts_.tag().instance());
70  }
71 
72  if (inv_mass_checks_) {
73  produces<InvariantMassErrorCollection>();
74  }
75 }
const edm::EDGetTokenT< P2GTCandidateCollection > token1_
std::string const & instance() const
Definition: InputTag.h:37
const edm::InputTag & tag() const
Definition: config.py:1
const edm::EDGetTokenT< P2GTCandidateCollection > token2_
const L1GTSingleCollectionCut collection2Cuts_
const L1GTDeltaCut deltaCuts_
dictionary config
Read in AllInOne config in JSON format.
Definition: DiMuonV_cfg.py:29
const L1GTSingleCollectionCut collection1Cuts_

◆ ~L1GTDoubleObjectCond()

L1GTDoubleObjectCond::~L1GTDoubleObjectCond ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

void L1GTDoubleObjectCond::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 77 of file L1GTDoubleObjectCond.cc.

References edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, and reco::modules::fillPSetDescription().

77  {
79 
80  edm::ParameterSetDescription collection1Desc;
82  desc.add<edm::ParameterSetDescription>("collection1", collection1Desc);
83 
84  edm::ParameterSetDescription collection2Desc;
86  desc.add<edm::ParameterSetDescription>("collection2", collection2Desc);
87 
88  desc.addUntracked<bool>("sanity_checks", false);
89  desc.addUntracked<bool>("inv_mass_checks", false);
90 
92  L1GTDeltaCut::fillLUTDescriptions(desc);
93 
96  desc.add<edm::ParameterSetDescription>("scales", scalesDesc);
97 
98  descriptions.addWithDefaultLabel(desc);
99 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
void fillPSetDescription(edm::ParameterSetDescription &desc)

◆ filter()

bool L1GTDoubleObjectCond::filter ( edm::StreamID  ,
edm::Event event,
const edm::EventSetup setup 
) const
overrideprivatevirtual

Implements edm::global::EDFilterBase.

Definition at line 101 of file L1GTDoubleObjectCond.cc.

References l1t::L1GTSingleCollectionCut::checkObject(), l1t::L1GTDeltaCut::checkObjects(), collection1Cuts_, collection2Cuts_, deltaCuts_, heavyIonCSV_trainingSettings::idx, edm::InputTag::instance(), inv_mass_checks_, eostools::move(), edm::Handle< T >::product(), l1t::L1GTSingleCollectionCut::tag(), token1_, and token2_.

101  {
102  edm::Handle<P2GTCandidateCollection> col1 = event.getHandle(token1_);
103  edm::Handle<P2GTCandidateCollection> col2 = event.getHandle(token2_);
104 
105  bool condition_result = false;
106 
107  std::set<std::size_t> triggeredIdcs1;
108  std::set<std::size_t> triggeredIdcs2;
109 
110  InvariantMassErrorCollection massErrors;
111 
112  for (std::size_t idx1 = 0; idx1 < col1->size(); ++idx1) {
113  for (std::size_t idx2 = 0; idx2 < col2->size(); ++idx2) {
114  // If we're looking at the same collection then we shouldn't use the same object in one comparison.
115  if (col1.product() == col2.product() && idx1 == idx2) {
116  continue;
117  }
118 
119  bool pass = true;
120  pass &= collection1Cuts_.checkObject(col1->at(idx1));
121  pass &= collection2Cuts_.checkObject(col2->at(idx2));
122  pass &= deltaCuts_.checkObjects(col1->at(idx1), col2->at(idx2), massErrors);
123 
124  condition_result |= pass;
125 
126  if (pass) {
127  triggeredIdcs1.emplace(idx1);
128  if (col1.product() != col2.product()) {
129  triggeredIdcs2.emplace(idx2);
130  } else {
131  triggeredIdcs1.emplace(idx2);
132  }
133  }
134  }
135  }
136 
137  if (condition_result) {
138  std::unique_ptr<P2GTCandidateVectorRef> triggerCol1 = std::make_unique<P2GTCandidateVectorRef>();
139 
140  for (std::size_t idx : triggeredIdcs1) {
141  triggerCol1->push_back(P2GTCandidateRef(col1, idx));
142  }
143  event.put(std::move(triggerCol1), collection1Cuts_.tag().instance());
144 
145  if (col1.product() != col2.product()) {
146  std::unique_ptr<P2GTCandidateVectorRef> triggerCol2 = std::make_unique<P2GTCandidateVectorRef>();
147 
148  for (std::size_t idx : triggeredIdcs2) {
149  triggerCol2->push_back(P2GTCandidateRef(col2, idx));
150  }
151  event.put(std::move(triggerCol2), collection2Cuts_.tag().instance());
152  }
153  }
154 
155  if (inv_mass_checks_) {
156  event.put(std::make_unique<InvariantMassErrorCollection>(std::move(massErrors)), "");
157  }
158 
159  return condition_result;
160 }
const edm::EDGetTokenT< P2GTCandidateCollection > token1_
bool checkObject(const P2GTCandidate &obj) const
std::string const & instance() const
Definition: InputTag.h:37
T const * product() const
Definition: Handle.h:70
const edm::InputTag & tag() const
edm::Ref< P2GTCandidateCollection > P2GTCandidateRef
Definition: P2GTCandidate.h:18
std::vector< InvariantMassError > InvariantMassErrorCollection
const edm::EDGetTokenT< P2GTCandidateCollection > token2_
bool checkObjects(const P2GTCandidate &obj1, const P2GTCandidate &obj2, InvariantMassErrorCollection &massErrors) const
Definition: L1GTDeltaCut.h:67
const L1GTSingleCollectionCut collection2Cuts_
const L1GTDeltaCut deltaCuts_
const L1GTSingleCollectionCut collection1Cuts_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ collection1Cuts_

const L1GTSingleCollectionCut L1GTDoubleObjectCond::collection1Cuts_
private

Definition at line 43 of file L1GTDoubleObjectCond.cc.

Referenced by filter(), and L1GTDoubleObjectCond().

◆ collection2Cuts_

const L1GTSingleCollectionCut L1GTDoubleObjectCond::collection2Cuts_
private

Definition at line 44 of file L1GTDoubleObjectCond.cc.

Referenced by filter(), and L1GTDoubleObjectCond().

◆ deltaCuts_

const L1GTDeltaCut L1GTDoubleObjectCond::deltaCuts_
private

Definition at line 49 of file L1GTDoubleObjectCond.cc.

Referenced by filter().

◆ enable_sanity_checks_

const bool L1GTDoubleObjectCond::enable_sanity_checks_
private

Definition at line 46 of file L1GTDoubleObjectCond.cc.

◆ inv_mass_checks_

const bool L1GTDoubleObjectCond::inv_mass_checks_
private

Definition at line 47 of file L1GTDoubleObjectCond.cc.

Referenced by filter(), and L1GTDoubleObjectCond().

◆ scales_

const L1GTScales L1GTDoubleObjectCond::scales_
private

Definition at line 41 of file L1GTDoubleObjectCond.cc.

◆ token1_

const edm::EDGetTokenT<P2GTCandidateCollection> L1GTDoubleObjectCond::token1_
private

Definition at line 51 of file L1GTDoubleObjectCond.cc.

Referenced by filter().

◆ token2_

const edm::EDGetTokenT<P2GTCandidateCollection> L1GTDoubleObjectCond::token2_
private

Definition at line 52 of file L1GTDoubleObjectCond.cc.

Referenced by filter().