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
 
std::string doc
 
int id
 
StringCutObjectSelector< pat::TriggerObjectStandAlonel1cut
 
StringCutObjectSelector< pat::TriggerObjectStandAlonel1cut_2
 
float l1DR2
 
float l1DR2_2
 
StringCutObjectSelector< pat::TriggerObjectStandAlonel2cut
 
float l2DR2
 
StringObjectFunction< pat::TriggerObjectStandAlonequalityBits
 
std::string qualityBitsDoc
 
bool skipObjectsNotPassingQualityBits
 

Detailed Description

Definition at line 74 of file TriggerObjectTableProducer.cc.

Constructor & Destructor Documentation

◆ SelectedObject()

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

Definition at line 84 of file TriggerObjectTableProducer.cc.

References cms::cuda::assert(), triggerObjects_cff::bit, gpuClustering::pixelStatus::bits, doc, 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().

85  : doc(pset.getParameter<std::string>("doc")),
86  id(pset.getParameter<int>("id")),
87  cut(pset.getParameter<std::string>("sel")),
88  l1cut(""),
89  l1cut_2(""),
90  l2cut(""),
91  l1DR2(-1),
92  l1DR2_2(-1),
93  l2DR2(-1),
94  skipObjectsNotPassingQualityBits(pset.getParameter<bool>("skipObjectsNotPassingQualityBits")),
95  qualityBits("0"), //will be overwritten from configuration
96  qualityBitsDoc("") //will be created from configuration
97  {
98  if (!doc.empty()) {
99  doc = "(" + doc + ")";
100  }
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  if (pset.existsAs<std::string>("l1seed")) {
127  l1DR2 = std::pow(pset.getParameter<double>("l1deltaR"), 2);
128  }
129  if (pset.existsAs<std::string>("l1seed_2")) {
131  l1DR2_2 = std::pow(pset.getParameter<double>("l1deltaR_2"), 2);
132  }
133  if (pset.existsAs<std::string>("l2seed")) {
135  l2DR2 = std::pow(pset.getParameter<double>("l2deltaR"), 2);
136  }
137  }
constexpr uint32_t bits
Definition: gpuClustering.h:25
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 139 of file TriggerObjectTableProducer.cc.

References cut, and getGTfromDQMFile::obj.

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

Member Data Documentation

◆ cut

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

Definition at line 77 of file TriggerObjectTableProducer.cc.

Referenced by match().

◆ doc

std::string TriggerObjectTableProducer::SelectedObject::doc

Definition at line 75 of file TriggerObjectTableProducer.cc.

Referenced by SelectedObject().

◆ id

int TriggerObjectTableProducer::SelectedObject::id

Definition at line 76 of file TriggerObjectTableProducer.cc.

◆ l1cut

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

Definition at line 78 of file TriggerObjectTableProducer.cc.

Referenced by SelectedObject().

◆ l1cut_2

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

Definition at line 78 of file TriggerObjectTableProducer.cc.

Referenced by SelectedObject().

◆ l1DR2

float TriggerObjectTableProducer::SelectedObject::l1DR2

Definition at line 79 of file TriggerObjectTableProducer.cc.

Referenced by SelectedObject().

◆ l1DR2_2

float TriggerObjectTableProducer::SelectedObject::l1DR2_2

Definition at line 79 of file TriggerObjectTableProducer.cc.

Referenced by SelectedObject().

◆ l2cut

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

Definition at line 78 of file TriggerObjectTableProducer.cc.

Referenced by SelectedObject().

◆ l2DR2

float TriggerObjectTableProducer::SelectedObject::l2DR2

Definition at line 79 of file TriggerObjectTableProducer.cc.

Referenced by SelectedObject().

◆ qualityBits

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

Definition at line 81 of file TriggerObjectTableProducer.cc.

Referenced by SelectedObject().

◆ qualityBitsDoc

std::string TriggerObjectTableProducer::SelectedObject::qualityBitsDoc

Definition at line 82 of file TriggerObjectTableProducer.cc.

Referenced by SelectedObject().

◆ skipObjectsNotPassingQualityBits

bool TriggerObjectTableProducer::SelectedObject::skipObjectsNotPassingQualityBits

Definition at line 80 of file TriggerObjectTableProducer.cc.