CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
SummaryOutputProducer::TriggerSummary Struct Reference
Inheritance diagram for SummaryOutputProducer::TriggerSummary:
SummaryOutputProducer::GenericSummary

Public Member Functions

void addEntry (const JsonOutputProducer::JsonEvent &_event, const int _triggerIndex, const std::vector< std::string > &_moduleNames)
 
Pair changed (int type=0) const
 
Pair gained (int type=0) const
 
Pair lost (int type=0) const
 
 TriggerSummary (int _id, const JsonOutputProducer &_json)
 
- Public Member Functions inherited from SummaryOutputProducer::GenericSummary
int addEntry (const JsonOutputProducer::JsonEvent &_event, const int _triggerIndex)
 
Pair changed () const
 
Pair gained () const
 
 GenericSummary (int _id, const JsonOutputProducer &_json, const std::vector< std::string > &_names)
 
bool keepForC () const
 
bool keepForGL () const
 
Pair lost () const
 

Public Attributes

int accepted_n
 
int accepted_o
 
std::map< int, GenericSummarym_modules
 
- Public Attributes inherited from SummaryOutputProducer::GenericSummary
int id
 
const JsonOutputProducerjson
 
std::string name
 
std::set< Eventv_changed
 
std::set< Eventv_gained
 
std::set< Eventv_lost
 

Detailed Description

Definition at line 870 of file hltDiff.cc.

Constructor & Destructor Documentation

◆ TriggerSummary()

SummaryOutputProducer::TriggerSummary::TriggerSummary ( int  _id,
const JsonOutputProducer _json 
)
inline

Definition at line 875 of file hltDiff.cc.

876  : GenericSummary(_id, _json, _json.vars.trigger),
877  accepted_o(_json.vars.trigger_passed_count.at(id).first),
878  accepted_n(_json.vars.trigger_passed_count.at(id).second) {}
std::vector< std::pair< int, int > > trigger_passed_count
Definition: hltDiff.cc:568
GenericSummary(int _id, const JsonOutputProducer &_json, const std::vector< std::string > &_names)
Definition: hltDiff.cc:838
std::vector< std::string > trigger
Definition: hltDiff.cc:567

Member Function Documentation

◆ addEntry()

void SummaryOutputProducer::TriggerSummary::addEntry ( const JsonOutputProducer::JsonEvent _event,
const int  _triggerIndex,
const std::vector< std::string > &  _moduleNames 
)
inline

Definition at line 880 of file hltDiff.cc.

882  {
883  int moduleLabelId = GenericSummary::addEntry(_event, _triggerIndex);
884  // Updating number of events affected by the particular module
885  if (m_modules.count(moduleLabelId) == 0)
886  m_modules.emplace(moduleLabelId, GenericSummary(moduleLabelId, json, _moduleNames));
887  m_modules.at(moduleLabelId).addEntry(_event, _triggerIndex);
888  }
std::map< int, GenericSummary > m_modules
Definition: hltDiff.cc:873
nlohmann::json json
GenericSummary(int _id, const JsonOutputProducer &_json, const std::vector< std::string > &_names)
Definition: hltDiff.cc:838
int addEntry(const JsonOutputProducer::JsonEvent &_event, const int _triggerIndex)
Definition: hltDiff.cc:843

◆ changed()

Pair SummaryOutputProducer::TriggerSummary::changed ( int  type = 0) const
inline

Definition at line 916 of file hltDiff.cc.

References python.cmstools::all(), MillePedeFileConverter_cfg::e, HLT_2022v12_cff::fraction, SiStripPI::max, mathSSE::sqrt(), and SummaryOutputProducer::Pair::v.

916  {
918  if (type == 0)
919  return changed;
920  double all(json.configuration.events - accepted_o);
921  Pair fraction = Pair(changed.v / (all + 1e-10), sqrt(all) / (all + 1e-10));
922  if (type == 1)
923  return fraction;
924  if (type == 2)
925  return Pair(std::max(0.0, fraction.v - fraction.e), 0.0); // Smallest value given the uncertainty
926  return Pair(fraction.v / (fraction.e + 1e-10), 0.0);
927  }
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:25
nlohmann::json json
T sqrt(T t)
Definition: SSEVec.h:19

◆ gained()

Pair SummaryOutputProducer::TriggerSummary::gained ( int  type = 0) const
inline

Definition at line 890 of file hltDiff.cc.

References python.cmstools::all(), MillePedeFileConverter_cfg::e, HLT_2022v12_cff::fraction, SiStripPI::max, mathSSE::sqrt(), and SummaryOutputProducer::Pair::v.

890  {
892  if (type == 0)
893  return gained; // Absolute number of affected events
894  double all(accepted_n);
895  Pair fraction = Pair(gained.v / (all + 1e-10), sqrt(all) / (all + 1e-10));
896  if (type == 1)
897  return fraction; // Relative number of affected events with respect to all accepted
898  if (type == 2)
899  return Pair(std::max(0.0, fraction.v - fraction.e), 0.0); // Smallest value given the uncertainty
900  return Pair(fraction.v / (fraction.e + 1e-10), 0.0); // Significance of the effect as N std. deviations
901  }
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:25
T sqrt(T t)
Definition: SSEVec.h:19

◆ lost()

Pair SummaryOutputProducer::TriggerSummary::lost ( int  type = 0) const
inline

Definition at line 903 of file hltDiff.cc.

References python.cmstools::all(), MillePedeFileConverter_cfg::e, HLT_2022v12_cff::fraction, SiStripPI::max, mathSSE::sqrt(), and SummaryOutputProducer::Pair::v.

903  {
904  Pair lost(GenericSummary::lost());
905  if (type == 0)
906  return lost;
907  double all(accepted_o);
908  Pair fraction = Pair(lost.v / (all + 1e-10), sqrt(all) / (all + 1e-10));
909  if (type == 1)
910  return fraction;
911  if (type == 2)
912  return Pair(std::max(0.0, fraction.v - fraction.e), 0.0); // Smallest value given the uncertainty
913  return Pair(fraction.v / (fraction.e + 1e-10), 0.0);
914  }
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:25
T sqrt(T t)
Definition: SSEVec.h:19

Member Data Documentation

◆ accepted_n

int SummaryOutputProducer::TriggerSummary::accepted_n

Definition at line 872 of file hltDiff.cc.

◆ accepted_o

int SummaryOutputProducer::TriggerSummary::accepted_o

Definition at line 871 of file hltDiff.cc.

◆ m_modules

std::map<int, GenericSummary> SummaryOutputProducer::TriggerSummary::m_modules

Definition at line 873 of file hltDiff.cc.