CMS 3D CMS Logo

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

Public Member Functions

 L1GTTripleObjectCond (const edm::ParameterSet &)
 
 ~L1GTTripleObjectCond () 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 &, edm::EventSetup const &) const override
 

Private Attributes

const L1GTSingleCollectionCut collection1Cuts_
 
const L1GTSingleCollectionCut collection2Cuts_
 
const L1GTSingleCollectionCut collection3Cuts_
 
const L1GTDeltaCut delta12Cuts_
 
const L1GTDeltaCut delta13Cuts_
 
const L1GTDeltaCut delta23Cuts_
 
const bool enable_sanity_checks_
 
const bool inv_mass_checks_
 
const L1GTScales scales_
 
const edm::EDGetTokenT< P2GTCandidateCollectiontoken1_
 
const edm::EDGetTokenT< P2GTCandidateCollectiontoken2_
 
const edm::EDGetTokenT< P2GTCandidateCollectiontoken3_
 

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 25 of file L1GTTripleObjectCond.cc.

Constructor & Destructor Documentation

◆ L1GTTripleObjectCond()

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

Definition at line 53 of file L1GTTripleObjectCond.cc.

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

54  : scales_(config.getParameter<edm::ParameterSet>("scales")),
55  collection1Cuts_(config.getParameter<edm::ParameterSet>("collection1"), config, scales_),
56  collection2Cuts_(config.getParameter<edm::ParameterSet>("collection2"), config, scales_),
57  collection3Cuts_(config.getParameter<edm::ParameterSet>("collection3"), config, scales_),
58  enable_sanity_checks_(config.getUntrackedParameter<bool>("sanity_checks")),
59  inv_mass_checks_(config.getUntrackedParameter<bool>("inv_mass_checks")),
66  token1_(consumes<P2GTCandidateCollection>(collection1Cuts_.tag())),
68  ? token1_
69  : consumes<P2GTCandidateCollection>(collection2Cuts_.tag())),
71  ? token1_
73  ? token2_
74  : consumes<P2GTCandidateCollection>(collection3Cuts_.tag()))) {
75  produces<P2GTCandidateVectorRef>(collection1Cuts_.tag().instance());
76 
77  if (!(collection1Cuts_.tag() == collection2Cuts_.tag())) {
78  produces<P2GTCandidateVectorRef>(collection2Cuts_.tag().instance());
79  }
80 
82  produces<P2GTCandidateVectorRef>(collection3Cuts_.tag().instance());
83  }
84 
85  if (inv_mass_checks_) {
86  produces<InvariantMassErrorCollection>();
87  }
88 }
const L1GTSingleCollectionCut collection2Cuts_
std::string const & instance() const
Definition: InputTag.h:37
const L1GTDeltaCut delta13Cuts_
const edm::InputTag & tag() const
Definition: config.py:1
const edm::EDGetTokenT< P2GTCandidateCollection > token2_
const L1GTDeltaCut delta23Cuts_
const L1GTSingleCollectionCut collection1Cuts_
const edm::EDGetTokenT< P2GTCandidateCollection > token3_
const L1GTDeltaCut delta12Cuts_
const L1GTSingleCollectionCut collection3Cuts_
const edm::EDGetTokenT< P2GTCandidateCollection > token1_

◆ ~L1GTTripleObjectCond()

L1GTTripleObjectCond::~L1GTTripleObjectCond ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 90 of file L1GTTripleObjectCond.cc.

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

90  {
92 
93  edm::ParameterSetDescription collection1Desc;
95  desc.add<edm::ParameterSetDescription>("collection1", collection1Desc);
96 
97  edm::ParameterSetDescription collection2Desc;
99  desc.add<edm::ParameterSetDescription>("collection2", collection2Desc);
100 
101  edm::ParameterSetDescription collection3Desc;
103  desc.add<edm::ParameterSetDescription>("collection3", collection3Desc);
104 
105  edm::ParameterSetDescription scalesDesc;
107  desc.add<edm::ParameterSetDescription>("scales", scalesDesc);
108 
109  desc.addUntracked<bool>("sanity_checks", false);
110  desc.addUntracked<bool>("inv_mass_checks", false);
111 
112  edm::ParameterSetDescription delta12Desc;
114  desc.add<edm::ParameterSetDescription>("delta12", delta12Desc);
115 
116  edm::ParameterSetDescription delta13Desc;
118  desc.add<edm::ParameterSetDescription>("delta13", delta13Desc);
119 
120  edm::ParameterSetDescription delta23Desc;
122  desc.add<edm::ParameterSetDescription>("delta23", delta23Desc);
123 
124  L1GTDeltaCut::fillLUTDescriptions(desc);
125 
126  descriptions.addWithDefaultLabel(desc);
127 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
void fillPSetDescription(edm::ParameterSetDescription &desc)

◆ filter()

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

Implements edm::global::EDFilterBase.

Definition at line 129 of file L1GTTripleObjectCond.cc.

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

129  {
130  edm::Handle<P2GTCandidateCollection> col1 = event.getHandle(token1_);
131  edm::Handle<P2GTCandidateCollection> col2 = event.getHandle(token2_);
132  edm::Handle<P2GTCandidateCollection> col3 = event.getHandle(token3_);
133 
134  bool condition_result = false;
135 
136  std::set<std::size_t> triggeredIdcs1;
137  std::set<std::size_t> triggeredIdcs2;
138  std::set<std::size_t> triggeredIdcs3;
139 
140  InvariantMassErrorCollection massErrors;
141 
142  for (std::size_t idx1 = 0; idx1 < col1->size(); ++idx1) {
143  for (std::size_t idx2 = 0; idx2 < col2->size(); ++idx2) {
144  for (std::size_t idx3 = 0; idx3 < col3->size(); ++idx3) {
145  // If we're looking at the same collection then we shouldn't use the same object in one comparison.
146  if (col1.product() == col2.product() && idx1 == idx2) {
147  continue;
148  }
149 
150  if (col1.product() == col3.product() && idx1 == idx3) {
151  continue;
152  }
153 
154  if (col2.product() == col3.product() && idx2 == idx3) {
155  continue;
156  }
157 
158  bool pass = true;
159  pass &= collection1Cuts_.checkObject(col1->at(idx1));
160  pass &= collection2Cuts_.checkObject(col2->at(idx2));
161  pass &= collection3Cuts_.checkObject(col3->at(idx3));
162  pass &= delta12Cuts_.checkObjects(col1->at(idx1), col2->at(idx2), massErrors);
163  pass &= delta13Cuts_.checkObjects(col1->at(idx1), col3->at(idx3), massErrors);
164  pass &= delta23Cuts_.checkObjects(col2->at(idx2), col3->at(idx3), massErrors);
165 
166  condition_result |= pass;
167 
168  if (pass) {
169  triggeredIdcs1.emplace(idx1);
170 
171  if (col1.product() != col2.product()) {
172  triggeredIdcs2.emplace(idx2);
173  } else {
174  triggeredIdcs1.emplace(idx2);
175  }
176 
177  if (col1.product() != col3.product() && col2.product() != col3.product()) {
178  triggeredIdcs3.emplace(idx3);
179  } else if (col1.product() == col3.product()) {
180  triggeredIdcs1.emplace(idx3);
181  } else {
182  triggeredIdcs2.emplace(idx3);
183  }
184  }
185  }
186  }
187  }
188 
189  if (condition_result) {
190  std::unique_ptr<P2GTCandidateVectorRef> triggerCol1 = std::make_unique<P2GTCandidateVectorRef>();
191 
192  for (std::size_t idx : triggeredIdcs1) {
193  triggerCol1->push_back(P2GTCandidateRef(col1, idx));
194  }
195  event.put(std::move(triggerCol1), collection1Cuts_.tag().instance());
196 
197  if (col1.product() != col2.product()) {
198  std::unique_ptr<P2GTCandidateVectorRef> triggerCol2 = std::make_unique<P2GTCandidateVectorRef>();
199 
200  for (std::size_t idx : triggeredIdcs2) {
201  triggerCol2->push_back(P2GTCandidateRef(col2, idx));
202  }
203  event.put(std::move(triggerCol2), collection2Cuts_.tag().instance());
204  }
205 
206  if (col1.product() != col3.product() && col2.product() != col3.product()) {
207  std::unique_ptr<P2GTCandidateVectorRef> triggerCol3 = std::make_unique<P2GTCandidateVectorRef>();
208 
209  for (std::size_t idx : triggeredIdcs3) {
210  triggerCol3->push_back(P2GTCandidateRef(col3, idx));
211  }
212  event.put(std::move(triggerCol3), collection3Cuts_.tag().instance());
213  }
214  }
215 
216  if (inv_mass_checks_) {
217  event.put(std::make_unique<InvariantMassErrorCollection>(std::move(massErrors)), "");
218  }
219 
220  return condition_result;
221 }
bool checkObject(const P2GTCandidate &obj) const
const L1GTSingleCollectionCut collection2Cuts_
std::string const & instance() const
Definition: InputTag.h:37
const L1GTDeltaCut delta13Cuts_
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_
const L1GTDeltaCut delta23Cuts_
bool checkObjects(const P2GTCandidate &obj1, const P2GTCandidate &obj2, InvariantMassErrorCollection &massErrors) const
Definition: L1GTDeltaCut.h:67
const L1GTSingleCollectionCut collection1Cuts_
const edm::EDGetTokenT< P2GTCandidateCollection > token3_
const L1GTDeltaCut delta12Cuts_
const L1GTSingleCollectionCut collection3Cuts_
const edm::EDGetTokenT< P2GTCandidateCollection > token1_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ collection1Cuts_

const L1GTSingleCollectionCut L1GTTripleObjectCond::collection1Cuts_
private

Definition at line 37 of file L1GTTripleObjectCond.cc.

Referenced by filter(), and L1GTTripleObjectCond().

◆ collection2Cuts_

const L1GTSingleCollectionCut L1GTTripleObjectCond::collection2Cuts_
private

Definition at line 38 of file L1GTTripleObjectCond.cc.

Referenced by filter(), and L1GTTripleObjectCond().

◆ collection3Cuts_

const L1GTSingleCollectionCut L1GTTripleObjectCond::collection3Cuts_
private

Definition at line 39 of file L1GTTripleObjectCond.cc.

Referenced by filter(), and L1GTTripleObjectCond().

◆ delta12Cuts_

const L1GTDeltaCut L1GTTripleObjectCond::delta12Cuts_
private

Definition at line 44 of file L1GTTripleObjectCond.cc.

Referenced by filter().

◆ delta13Cuts_

const L1GTDeltaCut L1GTTripleObjectCond::delta13Cuts_
private

Definition at line 45 of file L1GTTripleObjectCond.cc.

Referenced by filter().

◆ delta23Cuts_

const L1GTDeltaCut L1GTTripleObjectCond::delta23Cuts_
private

Definition at line 46 of file L1GTTripleObjectCond.cc.

Referenced by filter().

◆ enable_sanity_checks_

const bool L1GTTripleObjectCond::enable_sanity_checks_
private

Definition at line 41 of file L1GTTripleObjectCond.cc.

◆ inv_mass_checks_

const bool L1GTTripleObjectCond::inv_mass_checks_
private

Definition at line 42 of file L1GTTripleObjectCond.cc.

Referenced by filter(), and L1GTTripleObjectCond().

◆ scales_

const L1GTScales L1GTTripleObjectCond::scales_
private

Definition at line 35 of file L1GTTripleObjectCond.cc.

◆ token1_

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

Definition at line 48 of file L1GTTripleObjectCond.cc.

Referenced by filter().

◆ token2_

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

Definition at line 49 of file L1GTTripleObjectCond.cc.

Referenced by filter().

◆ token3_

const edm::EDGetTokenT<P2GTCandidateCollection> L1GTTripleObjectCond::token3_
private

Definition at line 50 of file L1GTTripleObjectCond.cc.

Referenced by filter().