CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Attributes
models.RegExp Class Reference
Inheritance diagram for models.RegExp:

Public Member Functions

def __init__ (self, regexp)
 
def apply (self)
 
def get_regexp (self)
 

Public Attributes

 database_type
 

Private Attributes

 _regexp
 

Detailed Description

Used to tell proxy methods that a regular expression should be used to query the column.

Definition at line 130 of file models.py.

Constructor & Destructor Documentation

◆ __init__()

def models.RegExp.__init__ (   self,
  regexp 
)

Definition at line 134 of file models.py.

134  def __init__(self, regexp):
135  self._regexp = regexp
136 
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)

Member Function Documentation

◆ apply()

def models.RegExp.apply (   self)

Definition at line 140 of file models.py.

References models.RegExp.database_type.

Referenced by heavyIonTools.ConfigureHeavyIons.__call__(), coreTools.RunOnData.__call__(), trackTools.MakeAODTrackCandidates.__call__(), runJetUncertainties.RunJetUncertainties.__call__(), metTools.AddMETCollection.__call__(), heavyIonTools.ProductionDefaults.__call__(), cmsswVersionTools.PickRelValInputFiles.__call__(), coreTools.RemoveMCMatching.__call__(), trackTools.MakePATTrackCandidates.__call__(), trigTools.SwitchOnTrigger.__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.__call__(), heavyIonTools.SelectionDefaults.__call__(), heavyIonTools.DisbaleMonteCarloDeps.__call__(), trigTools.SwitchOnTriggerStandAlone.__call__(), tauTools.AddTauCollection.__call__(), trackTools.MakeTrackCandidates.__call__(), trigTools.SwitchOnTriggerMatching.__call__(), trigTools.SwitchOnTriggerMatchingStandAlone.__call__(), trigTools.SwitchOnTriggerMatchEmbedding.__call__(), jetTools.AddJetCollection.__call__(), jetTools.SwitchJetCollection.__call__(), jetTools.UpdateJetCollection.__call__(), jetTools.AddJetID.__call__(), and jetTools.SetTagInfos.__call__().

140  def apply(self):
141  # uses code from conddb tool
142  if self.database_type in ["oracle", "frontier"]:
143  return sqlalchemy.func.regexp_like(field, regexp)
144  elif self.database_type == "sqlite":
145  # Relies on being a SingletonThreadPool
146  self.connection_object.engine.pool.connect().create_function('regexp', 2, lambda data, regexp: re.search(regexp, data) is not None)
147 
148  return sqlalchemy.func.regexp(field, regexp)
149  else:
150  raise NotImplemented("Can only apply regular expression search to Oracle, Frontier and SQLite.")
151 
Vec apply(Vec v, F f)
Definition: ExtVec.h:77

◆ get_regexp()

def models.RegExp.get_regexp (   self)

Definition at line 137 of file models.py.

References models.RegExp._regexp.

137  def get_regexp(self):
138  return self._regexp
139 

Member Data Documentation

◆ _regexp

models.RegExp._regexp
private

Definition at line 135 of file models.py.

Referenced by models.RegExp.get_regexp().

◆ database_type

models.RegExp.database_type

Definition at line 144 of file models.py.

Referenced by models.RegExp.apply().