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 857 of file hltDiff.cc.

Constructor & Destructor Documentation

◆ TriggerSummary()

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

Definition at line 862 of file hltDiff.cc.

863  : GenericSummary(_id, _json, _json.vars.trigger),
864  accepted_o(_json.vars.trigger_passed_count.at(id).first),
865  accepted_n(_json.vars.trigger_passed_count.at(id).second) {}

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 867 of file hltDiff.cc.

869  {
870  int moduleLabelId = GenericSummary::addEntry(_event, _triggerIndex);
871  // Updating number of events affected by the particular module
872  if (m_modules.count(moduleLabelId) == 0)
873  m_modules.emplace(moduleLabelId, GenericSummary(moduleLabelId, json, _moduleNames));
874  m_modules.at(moduleLabelId).addEntry(_event, _triggerIndex);
875  }

◆ changed()

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

Definition at line 903 of file hltDiff.cc.

903  {
905  if (type == 0)
906  return changed;
907  double all(json.configuration.events - accepted_o);
908  Pair fraction = Pair(changed.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  }

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

◆ gained()

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

Definition at line 877 of file hltDiff.cc.

877  {
879  if (type == 0)
880  return gained; // Absolute number of affected events
881  double all(accepted_n);
882  Pair fraction = Pair(gained.v / (all + 1e-10), sqrt(all) / (all + 1e-10));
883  if (type == 1)
884  return fraction; // Relative number of affected events with respect to all accepted
885  if (type == 2)
886  return Pair(std::max(0.0, fraction.v - fraction.e), 0.0); // Smallest value given the uncertainty
887  return Pair(fraction.v / (fraction.e + 1e-10), 0.0); // Significance of the effect as N std. deviations
888  }

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

◆ lost()

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

Definition at line 890 of file hltDiff.cc.

890  {
891  Pair lost(GenericSummary::lost());
892  if (type == 0)
893  return lost;
894  double all(accepted_o);
895  Pair fraction = Pair(lost.v / (all + 1e-10), sqrt(all) / (all + 1e-10));
896  if (type == 1)
897  return fraction;
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);
901  }

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

Member Data Documentation

◆ accepted_n

int SummaryOutputProducer::TriggerSummary::accepted_n

Definition at line 859 of file hltDiff.cc.

◆ accepted_o

int SummaryOutputProducer::TriggerSummary::accepted_o

Definition at line 858 of file hltDiff.cc.

◆ m_modules

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

Definition at line 860 of file hltDiff.cc.

JsonOutputProducer::JsonVars::trigger
std::vector< std::string > trigger
Definition: hltDiff.cc:568
SummaryOutputProducer::GenericSummary::gained
Pair gained() const
Definition: hltDiff.cc:846
JsonOutputProducer::vars
JsonVars vars
Definition: hltDiff.cc:597
SummaryOutputProducer::GenericSummary::lost
Pair lost() const
Definition: hltDiff.cc:848
SummaryOutputProducer::GenericSummary::addEntry
int addEntry(const JsonOutputProducer::JsonEvent &_event, const int _triggerIndex)
Definition: hltDiff.cc:830
python.cmstools.all
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:26
SummaryOutputProducer::Pair::v
double v
Definition: hltDiff.cc:801
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
SummaryOutputProducer::GenericSummary::GenericSummary
GenericSummary(int _id, const JsonOutputProducer &_json, const std::vector< std::string > &_names)
Definition: hltDiff.cc:825
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
SummaryOutputProducer::TriggerSummary::m_modules
std::map< int, GenericSummary > m_modules
Definition: hltDiff.cc:860
SummaryOutputProducer::TriggerSummary::accepted_o
int accepted_o
Definition: hltDiff.cc:858
type
type
Definition: HCALResponse.h:21
JsonOutputProducer::JsonVars::trigger_passed_count
std::vector< std::pair< int, int > > trigger_passed_count
Definition: hltDiff.cc:569
SummaryOutputProducer::GenericSummary::changed
Pair changed() const
Definition: hltDiff.cc:850
json
nlohmann::json json
Definition: FastTimerService.cc:19
HLT_2018_cff.fraction
fraction
Definition: HLT_2018_cff.py:51317
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
SummaryOutputProducer::TriggerSummary::accepted_n
int accepted_n
Definition: hltDiff.cc:859