CMS 3D CMS Logo

List of all members | Static Public Member Functions
IsoDepositVetoFactory Class Reference

#include <IsoDepositVetoFactory.h>

Static Public Member Functions

static reco::isodeposit::AbsVetomake (const char *string, edm::ConsumesCollector &iC)
 
static reco::isodeposit::AbsVetomake (const char *string, reco::isodeposit::EventDependentAbsVeto *&evdep, edm::ConsumesCollector &iC)
 

Detailed Description

Definition at line 8 of file IsoDepositVetoFactory.h.

Member Function Documentation

◆ make() [1/2]

reco::isodeposit::AbsVeto * IsoDepositVetoFactory::make ( const char *  string,
edm::ConsumesCollector iC 
)
static

Returns a pointer to an AbsVeto defined by the string. The calling code owns the pointer, and must delete it at the end. An exception will be thrown if the resulting AbsVeto depends on the edm::Event

Definition at line 72 of file IsoDepositVetoFactory.cc.

72  {
74  std::unique_ptr<reco::isodeposit::AbsVeto> ret(make(string, evdep, iC));
75  if (evdep != nullptr) {
76  throw cms::Exception("Configuration") << "The resulting AbsVeto depends on the edm::Event.\n"
77  << "Please use the two-arguments IsoDepositVetoFactory::make.\n";
78  }
79  return ret.release();
80 }

References Exception, and runTheMatrix::ret.

Referenced by pat::helper::IsoDepositIsolator::IsoDepositIsolator(), make(), PFCandIsolatorFromDeposits::SingleDeposit::SingleDeposit(), and CandIsolatorFromDeposits::SingleDeposit::SingleDeposit().

◆ make() [2/2]

reco::isodeposit::AbsVeto * IsoDepositVetoFactory::make ( const char *  string,
reco::isodeposit::EventDependentAbsVeto *&  evdep,
edm::ConsumesCollector iC 
)
static

As above, but will allow also AbsVetos which depend from the edm::Event If the resulting veto is dependent on the edm::Event, the value of the second pointer will be set to non-zero Note that both pointers will point to the same object, so you have to delete it only once.

Definition at line 82 of file IsoDepositVetoFactory.cc.

84  {
85  using namespace reco::isodeposit;
86  static const std::regex ecalSwitch("^Ecal(Barrel|Endcaps):(.*)"), threshold("Threshold\\((\\d+\\.\\d+)\\)"),
87  thresholdtransverse("ThresholdFromTransverse\\((\\d+\\.\\d+)\\)"),
88  absthreshold("AbsThreshold\\((\\d+\\.\\d+)\\)"),
89  absthresholdtransverse("AbsThresholdFromTransverse\\((\\d+\\.\\d+)\\)"), cone("ConeVeto\\((\\d+\\.\\d+)\\)"),
90  angleCone("AngleCone\\((\\d+\\.\\d+)\\)"), angleVeto("AngleVeto\\((\\d+\\.\\d+)\\)"),
91  rectangularEtaPhiVeto(
92  "RectangularEtaPhiVeto\\(([+-]?\\d+\\.\\d+),([+-]?\\d+\\.\\d+),([+-]?\\d+\\.\\d+),([+-]?\\d+\\.\\d+)\\)"),
93  numCrystal("NumCrystalVeto\\((\\d+\\.\\d+)\\)"),
94  numCrystalEtaPhi("NumCrystalEtaPhiVeto\\((\\d+\\.\\d+),(\\d+\\.\\d+)\\)"),
95  otherCandidatesDR("OtherCandidatesByDR\\((\\w+:?\\w*:?\\w*),\\s*(\\d+\\.?|\\d*\\.\\d*)\\)"),
96  otherJetConstituentsDR(
97  "OtherJetConstituentsDeltaRVeto\\((\\w+:?\\w*:?\\w*),\\s*(\\d+\\.?|\\d*\\.\\d*),\\s*(\\w+:?\\w*:?\\w*),\\s*("
98  "\\d+\\.?|\\d*\\.\\d*)\\)"),
99  otherCand("^(.*?):(.*)"), number("^(\\d+\\.?|\\d*\\.\\d*)$");
100  std::cmatch match;
101 
102  evdep = nullptr; // by default it does not depend on this
103  if (regex_match(string, match, ecalSwitch)) {
104  return new SwitchingEcalVeto(make(match[2].first, iC), (match[1] == "Barrel"));
105  } else if (regex_match(string, match, threshold)) {
106  return new ThresholdVeto(atof(match[1].first));
107  } else if (regex_match(string, match, thresholdtransverse)) {
108  return new ThresholdVetoFromTransverse(atof(((std::string)match[1]).c_str()));
109  } else if (regex_match(string, match, absthreshold)) {
110  return new AbsThresholdVeto(atof(match[1].first));
111  } else if (regex_match(string, match, absthresholdtransverse)) {
112  return new AbsThresholdVetoFromTransverse(atof(((std::string)match[1]).c_str()));
113  } else if (regex_match(string, match, cone)) {
114  return new ConeVeto(Direction(), atof(match[1].first));
115  } else if (regex_match(string, match, number)) {
116  return new ConeVeto(Direction(), atof(match[1].first));
117  } else if (regex_match(string, match, angleCone)) {
118  return new AngleCone(Direction(), atof(match[1].first));
119  } else if (regex_match(string, match, angleVeto)) {
120  return new AngleConeVeto(Direction(), atof(match[1].first));
121  } else if (regex_match(string, match, rectangularEtaPhiVeto)) {
122  return new RectangularEtaPhiVeto(
123  Direction(), atof(match[1].first), atof(match[2].first), atof(match[3].first), atof(match[4].first));
124  } else if (regex_match(string, match, numCrystal)) {
125  return new NumCrystalVeto(Direction(), atof(match[1].first));
126  } else if (regex_match(string, match, numCrystalEtaPhi)) {
127  return new NumCrystalEtaPhiVeto(Direction(), atof(match[1].first), atof(match[2].first));
128  } else if (regex_match(string, match, otherCandidatesDR)) {
130  evdep = ret;
131  return ret;
132  } else if (regex_match(string, match, otherJetConstituentsDR)) {
134  Direction(), edm::InputTag(match[1]), atof(match[2].first), edm::InputTag(match[3]), atof(match[4].first), iC);
135  evdep = ret;
136  return ret;
137  } else if (regex_match(string, match, otherCand)) {
139  evdep = ret;
140  return ret;
141  } else {
142  throw cms::Exception("Not Implemented") << "Veto " << string << " not implemented yet...";
143  }
144 }

References Exception, first, make(), match(), contentValuesFiles::number, runTheMatrix::ret, AlCaHLTBitMon_QueryRunRegistry::string, and remoteMonitoring_LED_IterMethod_cfg::threshold.

runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:543
reco::isodeposit::AbsThresholdVetoFromTransverse
Definition: IsoDepositVetos.h:51
reco::isodeposit::AngleConeVeto
Definition: IsoDepositVetos.h:74
reco::isodeposit::NumCrystalVeto
Definition: IsoDepositVetoFactory.cc:25
reco::isodeposit::RectangularEtaPhiVeto
Definition: IsoDepositVetos.h:98
reco::isodeposit::AbsThresholdVeto
Definition: IsoDepositVetos.h:41
reco::isodeposit::ConeVeto
Definition: IsoDepositVetos.h:9
contentValuesFiles.number
number
Definition: contentValuesFiles.py:53
reco::isodeposit
Definition: IsoDeposit.h:31
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
reco::isodeposit::OtherJetConstituentsDeltaRVeto
Definition: EventDependentAbsVetos.h:64
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
reco::isodeposit::ThresholdVeto
Definition: IsoDepositVetos.h:21
reco::isodeposit::AngleCone
Definition: IsoDepositVetos.h:86
reco::isodeposit::NumCrystalEtaPhiVeto
Definition: IsoDepositVetoFactory.cc:42
reco::isodeposit::Direction
Definition: IsoDepositDirection.h:19
reco::isodeposit::SwitchingEcalVeto
Definition: IsoDepositVetoFactory.cc:11
Exception
Definition: hltDiff.cc:245
reco::isodeposit::ThresholdVetoFromTransverse
Definition: IsoDepositVetos.h:31
reco::isodeposit::OtherCandVeto
Definition: EventDependentAbsVetos.h:39
IsoDepositVetoFactory::make
static reco::isodeposit::AbsVeto * make(const char *string, edm::ConsumesCollector &iC)
Definition: IsoDepositVetoFactory.cc:72
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:430
reco::isodeposit::OtherCandidatesDeltaRVeto
Definition: EventDependentAbsVetos.h:14
reco::isodeposit::EventDependentAbsVeto
Definition: EventDependentAbsVeto.h:10
edm::InputTag
Definition: InputTag.h:15