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 noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
bool wantsStreamLuminosityBlocks () const noexcept final
 
bool wantsStreamRuns () const noexcept 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 L1GT3BodyCut correl123Cuts_
 
const L1GTCorrelationalCut correl12Cuts_
 
const L1GTCorrelationalCut correl13Cuts_
 
const L1GTCorrelationalCut correl23Cuts_
 
const bool enable_sanity_checks_
 
const bool inv_mass_checks_
 
const edm::EDGetTokenT< P2GTCandidateCollectionprimVertToken_
 
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 26 of file L1GTTripleObjectCond.cc.

Constructor & Destructor Documentation

◆ L1GTTripleObjectCond()

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

Definition at line 57 of file L1GTTripleObjectCond.cc.

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

58  : scales_(config.getParameter<edm::ParameterSet>("scales")),
59  collection1Cuts_(config.getParameter<edm::ParameterSet>("collection1"), config, scales_),
60  collection2Cuts_(config.getParameter<edm::ParameterSet>("collection2"), config, scales_),
61  collection3Cuts_(config.getParameter<edm::ParameterSet>("collection3"), config, scales_),
62  enable_sanity_checks_(config.getUntrackedParameter<bool>("sanity_checks")),
63  inv_mass_checks_(config.getUntrackedParameter<bool>("inv_mass_checks")),
71  token1_(consumes<P2GTCandidateCollection>(collection1Cuts_.tag())),
73  ? token1_
74  : consumes<P2GTCandidateCollection>(collection2Cuts_.tag())),
76  ? token1_
78  ? token2_
79  : consumes<P2GTCandidateCollection>(collection3Cuts_.tag()))),
80  primVertToken_(consumes<P2GTCandidateCollection>(config.getParameter<edm::InputTag>("primVertTag"))) {
81  produces<P2GTCandidateVectorRef>(collection1Cuts_.tag().instance());
82 
83  if (!(collection1Cuts_.tag() == collection2Cuts_.tag())) {
84  produces<P2GTCandidateVectorRef>(collection2Cuts_.tag().instance());
85  }
86 
88  produces<P2GTCandidateVectorRef>(collection3Cuts_.tag().instance());
89  }
90 
91  if (inv_mass_checks_) {
92  produces<InvariantMassErrorCollection>();
93  }
94 }
const L1GTCorrelationalCut correl23Cuts_
const edm::EDGetTokenT< P2GTCandidateCollection > primVertToken_
const L1GTSingleCollectionCut collection2Cuts_
std::string const & instance() const
Definition: InputTag.h:37
const edm::InputTag & tag() const
Definition: config.py:1
const edm::EDGetTokenT< P2GTCandidateCollection > token2_
const L1GTCorrelationalCut correl12Cuts_
const L1GTCorrelationalCut correl13Cuts_
const L1GTSingleCollectionCut collection1Cuts_
const edm::EDGetTokenT< P2GTCandidateCollection > token3_
const L1GT3BodyCut correl123Cuts_
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 96 of file L1GTTripleObjectCond.cc.

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

96  {
98 
99  edm::ParameterSetDescription collection1Desc;
101  desc.add<edm::ParameterSetDescription>("collection1", collection1Desc);
102 
103  edm::ParameterSetDescription collection2Desc;
105  desc.add<edm::ParameterSetDescription>("collection2", collection2Desc);
106 
107  edm::ParameterSetDescription collection3Desc;
109  desc.add<edm::ParameterSetDescription>("collection3", collection3Desc);
110 
111  edm::ParameterSetDescription scalesDesc;
113  desc.add<edm::ParameterSetDescription>("scales", scalesDesc);
114 
115  desc.add<edm::InputTag>("primVertTag");
116 
117  desc.addUntracked<bool>("sanity_checks", false);
118  desc.addUntracked<bool>("inv_mass_checks", false);
119 
120  edm::ParameterSetDescription correl12Desc;
122  desc.add<edm::ParameterSetDescription>("correl12", correl12Desc);
123 
124  edm::ParameterSetDescription correl13Desc;
126  desc.add<edm::ParameterSetDescription>("correl13", correl13Desc);
127 
128  edm::ParameterSetDescription correl23Desc;
130  desc.add<edm::ParameterSetDescription>("correl23", correl23Desc);
131 
133 
134  L1GTCorrelationalCut::fillLUTDescriptions(desc);
135 
136  descriptions.addWithDefaultLabel(desc);
137 }
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 139 of file L1GTTripleObjectCond.cc.

References l1t::L1GTSingleCollectionCut::checkObject(), l1t::L1GT3BodyCut::checkObjects(), l1t::L1GTCorrelationalCut::checkObjects(), l1t::L1GTSingleCollectionCut::checkPrimaryVertices(), collection1Cuts_, collection2Cuts_, collection3Cuts_, correl123Cuts_, correl12Cuts_, correl13Cuts_, correl23Cuts_, heavyIonCSV_trainingSettings::idx, edm::InputTag::instance(), inv_mass_checks_, eostools::move(), primVertToken_, edm::Handle< T >::product(), l1t::L1GTSingleCollectionCut::tag(), token1_, token2_, and token3_.

139  {
140  edm::Handle<P2GTCandidateCollection> col1 = event.getHandle(token1_);
141  edm::Handle<P2GTCandidateCollection> col2 = event.getHandle(token2_);
142  edm::Handle<P2GTCandidateCollection> col3 = event.getHandle(token3_);
143  edm::Handle<P2GTCandidateCollection> primVertCol = event.getHandle(primVertToken_);
144 
145  bool condition_result = false;
146 
147  std::set<std::size_t> triggeredIdcs1;
148  std::set<std::size_t> triggeredIdcs2;
149  std::set<std::size_t> triggeredIdcs3;
150 
151  InvariantMassErrorCollection massErrors;
152 
153  for (std::size_t idx1 = 0; idx1 < col1->size(); ++idx1) {
154  bool single1Pass = collection1Cuts_.checkObject(col1->at(idx1));
155  single1Pass &= collection1Cuts_.checkPrimaryVertices(col1->at(idx1), *primVertCol);
156 
157  for (std::size_t idx2 = 0; idx2 < col2->size(); ++idx2) {
158  bool single2Pass = collection2Cuts_.checkObject(col2->at(idx2));
159  single2Pass &= collection2Cuts_.checkPrimaryVertices(col2->at(idx2), *primVertCol);
160 
161  for (std::size_t idx3 = 0; idx3 < col3->size(); ++idx3) {
162  // If we're looking at the same collection then we shouldn't use the same object in one comparison.
163  if (col1.product() == col2.product() && idx1 == idx2) {
164  continue;
165  }
166 
167  if (col1.product() == col3.product() && idx1 == idx3) {
168  continue;
169  }
170 
171  if (col2.product() == col3.product() && idx2 == idx3) {
172  continue;
173  }
174 
175  bool pass = single1Pass & single2Pass;
176 
177  pass &= collection3Cuts_.checkObject(col3->at(idx3));
178  pass &= collection3Cuts_.checkPrimaryVertices(col3->at(idx3), *primVertCol);
179  pass &= correl12Cuts_.checkObjects(col1->at(idx1), col2->at(idx2), massErrors);
180  pass &= correl13Cuts_.checkObjects(col1->at(idx1), col3->at(idx3), massErrors);
181  pass &= correl23Cuts_.checkObjects(col2->at(idx2), col3->at(idx3), massErrors);
182  pass &= correl123Cuts_.checkObjects(col1->at(idx1), col2->at(idx2), col3->at(idx3), massErrors);
183 
184  condition_result |= pass;
185 
186  if (pass) {
187  triggeredIdcs1.emplace(idx1);
188 
189  if (col1.product() != col2.product()) {
190  triggeredIdcs2.emplace(idx2);
191  } else {
192  triggeredIdcs1.emplace(idx2);
193  }
194 
195  if (col1.product() != col3.product() && col2.product() != col3.product()) {
196  triggeredIdcs3.emplace(idx3);
197  } else if (col1.product() == col3.product()) {
198  triggeredIdcs1.emplace(idx3);
199  } else {
200  triggeredIdcs2.emplace(idx3);
201  }
202  }
203  }
204  }
205  }
206 
207  if (condition_result) {
208  std::unique_ptr<P2GTCandidateVectorRef> triggerCol1 = std::make_unique<P2GTCandidateVectorRef>();
209 
210  for (std::size_t idx : triggeredIdcs1) {
211  triggerCol1->push_back(P2GTCandidateRef(col1, idx));
212  }
213  event.put(std::move(triggerCol1), collection1Cuts_.tag().instance());
214 
215  if (col1.product() != col2.product()) {
216  std::unique_ptr<P2GTCandidateVectorRef> triggerCol2 = std::make_unique<P2GTCandidateVectorRef>();
217 
218  for (std::size_t idx : triggeredIdcs2) {
219  triggerCol2->push_back(P2GTCandidateRef(col2, idx));
220  }
221  event.put(std::move(triggerCol2), collection2Cuts_.tag().instance());
222  }
223 
224  if (col1.product() != col3.product() && col2.product() != col3.product()) {
225  std::unique_ptr<P2GTCandidateVectorRef> triggerCol3 = std::make_unique<P2GTCandidateVectorRef>();
226 
227  for (std::size_t idx : triggeredIdcs3) {
228  triggerCol3->push_back(P2GTCandidateRef(col3, idx));
229  }
230  event.put(std::move(triggerCol3), collection3Cuts_.tag().instance());
231  }
232  }
233 
234  if (inv_mass_checks_) {
235  event.put(std::make_unique<InvariantMassErrorCollection>(std::move(massErrors)), "");
236  }
237 
238  return condition_result;
239 }
const L1GTCorrelationalCut correl23Cuts_
bool checkObject(const P2GTCandidate &obj) const
const edm::EDGetTokenT< P2GTCandidateCollection > primVertToken_
const L1GTSingleCollectionCut collection2Cuts_
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
bool checkPrimaryVertices(const P2GTCandidate &obj, const P2GTCandidateCollection &primVertCol) const
std::vector< InvariantMassError > InvariantMassErrorCollection
const edm::EDGetTokenT< P2GTCandidateCollection > token2_
bool checkObjects(const P2GTCandidate &obj1, const P2GTCandidate &obj2, InvariantMassErrorCollection &massErrors) const
const L1GTCorrelationalCut correl12Cuts_
const L1GTCorrelationalCut correl13Cuts_
const L1GTSingleCollectionCut collection1Cuts_
const edm::EDGetTokenT< P2GTCandidateCollection > token3_
const L1GT3BodyCut correl123Cuts_
bool checkObjects(const P2GTCandidate &obj1, const P2GTCandidate &obj2, const P2GTCandidate &obj3, InvariantMassErrorCollection &massErrors) const
Definition: L1GT3BodyCut.h:79
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 38 of file L1GTTripleObjectCond.cc.

Referenced by filter(), and L1GTTripleObjectCond().

◆ collection2Cuts_

const L1GTSingleCollectionCut L1GTTripleObjectCond::collection2Cuts_
private

Definition at line 39 of file L1GTTripleObjectCond.cc.

Referenced by filter(), and L1GTTripleObjectCond().

◆ collection3Cuts_

const L1GTSingleCollectionCut L1GTTripleObjectCond::collection3Cuts_
private

Definition at line 40 of file L1GTTripleObjectCond.cc.

Referenced by filter(), and L1GTTripleObjectCond().

◆ correl123Cuts_

const L1GT3BodyCut L1GTTripleObjectCond::correl123Cuts_
private

Definition at line 49 of file L1GTTripleObjectCond.cc.

Referenced by filter().

◆ correl12Cuts_

const L1GTCorrelationalCut L1GTTripleObjectCond::correl12Cuts_
private

Definition at line 45 of file L1GTTripleObjectCond.cc.

Referenced by filter().

◆ correl13Cuts_

const L1GTCorrelationalCut L1GTTripleObjectCond::correl13Cuts_
private

Definition at line 46 of file L1GTTripleObjectCond.cc.

Referenced by filter().

◆ correl23Cuts_

const L1GTCorrelationalCut L1GTTripleObjectCond::correl23Cuts_
private

Definition at line 47 of file L1GTTripleObjectCond.cc.

Referenced by filter().

◆ enable_sanity_checks_

const bool L1GTTripleObjectCond::enable_sanity_checks_
private

Definition at line 42 of file L1GTTripleObjectCond.cc.

◆ inv_mass_checks_

const bool L1GTTripleObjectCond::inv_mass_checks_
private

Definition at line 43 of file L1GTTripleObjectCond.cc.

Referenced by filter(), and L1GTTripleObjectCond().

◆ primVertToken_

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

Definition at line 54 of file L1GTTripleObjectCond.cc.

Referenced by filter().

◆ scales_

const L1GTScales L1GTTripleObjectCond::scales_
private

Definition at line 36 of file L1GTTripleObjectCond.cc.

◆ token1_

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

Definition at line 51 of file L1GTTripleObjectCond.cc.

Referenced by filter().

◆ token2_

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

Definition at line 52 of file L1GTTripleObjectCond.cc.

Referenced by filter().

◆ token3_

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

Definition at line 53 of file L1GTTripleObjectCond.cc.

Referenced by filter().