CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
TriggerObjectTableProducer::SelectedObject Struct Reference

Public Member Functions

bool match (const pat::TriggerObjectStandAlone &obj) const
 
 SelectedObject (const edm::ParameterSet &pset)
 

Public Attributes

StringCutObjectSelector< pat::TriggerObjectStandAlonecut
 
int id
 
StringCutObjectSelector< pat::TriggerObjectStandAlonel1cut
 
StringCutObjectSelector< pat::TriggerObjectStandAlonel1cut_2
 
float l1DR2
 
float l1DR2_2
 
StringCutObjectSelector< pat::TriggerObjectStandAlonel2cut
 
float l2DR2
 
std::string name
 
StringObjectFunction< pat::TriggerObjectStandAlonequalityBits
 
std::string qualityBitsDoc
 
bool skipObjectsNotPassingQualityBits
 

Detailed Description

Definition at line 73 of file TriggerObjectTableProducer.cc.

Constructor & Destructor Documentation

◆ SelectedObject()

TriggerObjectTableProducer::SelectedObject::SelectedObject ( const edm::ParameterSet pset)
inline

Definition at line 83 of file TriggerObjectTableProducer.cc.

References cms::cuda::assert(), triggerObjects_cff::bit, gpuClustering::pixelStatus::bits, mps_fire::i, l1cut, l1cut_2, l1DR2, l1DR2_2, l2cut, l2DR2, funct::pow(), muonDTDigis_cfi::pset, qualityBits, qualityBitsDoc, AlCaHLTBitMon_QueryRunRegistry::string, and cond::impl::to_string().

84  : name(pset.getParameter<std::string>("name")),
85  id(pset.getParameter<int>("id")),
86  cut(pset.getParameter<std::string>("sel")),
87  l1cut(""),
88  l1cut_2(""),
89  l2cut(""),
90  l1DR2(-1),
91  l1DR2_2(-1),
92  l2DR2(-1),
93  skipObjectsNotPassingQualityBits(pset.getParameter<bool>("skipObjectsNotPassingQualityBits")),
94  qualityBits("0"), //will be overwritten from configuration
95  qualityBitsDoc("") //will be created from configuration
96  {
97  if (pset.existsAs<std::string>("qualityBits")) {
99  qualityBitsDoc = pset.getParameter<std::string>("qualityBitsDoc");
100  } else {
101  std::vector<edm::ParameterSet> qualityBitsConfig =
102  pset.getParameter<std::vector<edm::ParameterSet>>("qualityBits");
103  std::stringstream qualityBitsFunc;
104  std::vector<bool> bits(qualityBitsConfig.size(), false);
105  for (size_t i = 0; i != qualityBitsConfig.size(); ++i) {
106  if (i != 0) {
107  qualityBitsFunc << " + ";
108  qualityBitsDoc += ", ";
109  }
110  unsigned int bit = i;
111  if (qualityBitsConfig[i].existsAs<unsigned int>("bit"))
112  bit = qualityBitsConfig[i].getParameter<unsigned int>("bit");
113  assert(!bits[bit] && "a quality bit was inserted twice"); // the bit should not have been set already
114  assert(bit < 31 && "quality bits are store on 32 bit");
115  bits[bit] = true;
116  qualityBitsFunc << std::to_string(int(pow(2, bit))) << "*("
117  << qualityBitsConfig[i].getParameter<std::string>("selection") << ")";
118  qualityBitsDoc += std::to_string(bit) + " => " + qualityBitsConfig[i].getParameter<std::string>("doc");
119  }
120  if (!qualityBitsFunc.str().empty()) {
121  //std::cout << "The quality bit string is :" << qualityBitsFunc.str() << std::endl;
122  //std::cout << "The quality bit documentation is :" << qualityBitsDoc << std::endl;
124  }
125  }
126  if (pset.existsAs<std::string>("l1seed")) {
128  l1DR2 = std::pow(pset.getParameter<double>("l1deltaR"), 2);
129  }
130  if (pset.existsAs<std::string>("l1seed_2")) {
132  l1DR2_2 = std::pow(pset.getParameter<double>("l1deltaR_2"), 2);
133  }
134  if (pset.existsAs<std::string>("l2seed")) {
136  l2DR2 = std::pow(pset.getParameter<double>("l2deltaR"), 2);
137  }
138  }
constexpr uint32_t bits
Definition: gpuClustering.h:23
std::string to_string(const V &value)
Definition: OMSAccess.h:71
assert(be >=bs)
StringCutObjectSelector< pat::TriggerObjectStandAlone > l1cut
StringObjectFunction< pat::TriggerObjectStandAlone > qualityBits
StringCutObjectSelector< pat::TriggerObjectStandAlone > l1cut_2
StringCutObjectSelector< pat::TriggerObjectStandAlone > cut
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
StringCutObjectSelector< pat::TriggerObjectStandAlone > l2cut

Member Function Documentation

◆ match()

bool TriggerObjectTableProducer::SelectedObject::match ( const pat::TriggerObjectStandAlone obj) const
inline

Definition at line 140 of file TriggerObjectTableProducer.cc.

References cut, and getGTfromDQMFile::obj.

140 { return cut(obj); }
StringCutObjectSelector< pat::TriggerObjectStandAlone > cut

Member Data Documentation

◆ cut

StringCutObjectSelector<pat::TriggerObjectStandAlone> TriggerObjectTableProducer::SelectedObject::cut

Definition at line 76 of file TriggerObjectTableProducer.cc.

Referenced by match().

◆ id

int TriggerObjectTableProducer::SelectedObject::id

Definition at line 75 of file TriggerObjectTableProducer.cc.

◆ l1cut

StringCutObjectSelector<pat::TriggerObjectStandAlone> TriggerObjectTableProducer::SelectedObject::l1cut

Definition at line 77 of file TriggerObjectTableProducer.cc.

Referenced by SelectedObject().

◆ l1cut_2

StringCutObjectSelector<pat::TriggerObjectStandAlone> TriggerObjectTableProducer::SelectedObject::l1cut_2

Definition at line 77 of file TriggerObjectTableProducer.cc.

Referenced by SelectedObject().

◆ l1DR2

float TriggerObjectTableProducer::SelectedObject::l1DR2

Definition at line 78 of file TriggerObjectTableProducer.cc.

Referenced by SelectedObject().

◆ l1DR2_2

float TriggerObjectTableProducer::SelectedObject::l1DR2_2

Definition at line 78 of file TriggerObjectTableProducer.cc.

Referenced by SelectedObject().

◆ l2cut

StringCutObjectSelector<pat::TriggerObjectStandAlone> TriggerObjectTableProducer::SelectedObject::l2cut

Definition at line 77 of file TriggerObjectTableProducer.cc.

Referenced by SelectedObject().

◆ l2DR2

float TriggerObjectTableProducer::SelectedObject::l2DR2

Definition at line 78 of file TriggerObjectTableProducer.cc.

Referenced by SelectedObject().

◆ name

std::string TriggerObjectTableProducer::SelectedObject::name

◆ qualityBits

StringObjectFunction<pat::TriggerObjectStandAlone> TriggerObjectTableProducer::SelectedObject::qualityBits

Definition at line 80 of file TriggerObjectTableProducer.cc.

Referenced by SelectedObject().

◆ qualityBitsDoc

std::string TriggerObjectTableProducer::SelectedObject::qualityBitsDoc

Definition at line 81 of file TriggerObjectTableProducer.cc.

Referenced by SelectedObject().

◆ skipObjectsNotPassingQualityBits

bool TriggerObjectTableProducer::SelectedObject::skipObjectsNotPassingQualityBits

Definition at line 79 of file TriggerObjectTableProducer.cc.