CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Functions | Variables
helper Namespace Reference

Classes

struct  BFieldIsolationAlgorithmSetup
 
class  CandDecayStoreManager
 
class  ClusterStorer
 
struct  CollectionFilter
 
struct  CollectionFilter< C, S, MinNumberSelector >
 
struct  CollectionFilterTrait
 
struct  CollectionFilterTrait< C, AnySelector, N >
 
struct  CollectionSizeFilter
 
struct  CollectionStoreManager
 
struct  GsfElectronCollectionStoreManager
 
struct  GsfElectronCollectionStoreManagerTrait
 
class  GsfElectronSelectorBase
 
struct  IsolationAlgorithmSetup
 
struct  IsolationAlgorithmSetup< CalIsolationAlgo< T1, C2 > >
 
struct  IteratorToObjectConverter
 
struct  IteratorToObjectConverter< edm::OwnVector< T > >
 
struct  IteratorToObjectConverter< edm::PtrVector< T > >
 
struct  IteratorToObjectConverter< edm::RefToBaseVector< T > >
 
struct  IteratorToObjectConverter< edm::RefVector< C > >
 
struct  MasterCollection
 
struct  MasterCollection< edm::View< T > >
 
struct  MuonCollectionStoreManager
 
class  MuonSelectorBase
 
struct  NullIsolationAlgorithmSetup
 
struct  NullPostProcessor
 
struct  ObjectSelectorBase
 
class  Parser
 
class  ScannerBase
 
struct  SelectCode
 
struct  SelectedOutputCollectionTrait
 
struct  SelectedOutputCollectionTrait< edm::AssociationVector< edm::RefProd< K >, C > >
 
struct  SelectedOutputCollectionTrait< edm::AssociationVector< edm::RefToBaseProd< T >, C > >
 
struct  SelectedOutputCollectionTrait< edm::RefToBaseVector< T > >
 
struct  SelectedOutputCollectionTrait< edm::RefVector< C > >
 
struct  SelectedOutputCollectionTrait< edm::View< T > >
 
struct  SelectionAdderTrait
 
struct  SelectionAdderTrait< edm::AssociationVector< edm::RefProd< K >, C >, edm::RefVector< K > >
 
struct  SelectionAdderTrait< edm::AssociationVector< edm::RefProd< K >, C >, std::vector< const T * > >
 
struct  SelectionAdderTrait< edm::AssociationVector< edm::RefToBaseProd< T >, C >, edm::RefToBaseVector< T > >
 
struct  SelectionAdderTrait< edm::AssociationVector< edm::RefToBaseProd< T >, C >, std::vector< const T * > >
 
struct  SelectionAdderTrait< edm::RefToBaseVector< T >, edm::RefToBaseVector< T > >
 
struct  SelectionAdderTrait< edm::RefToBaseVector< T >, std::vector< const T * > >
 
struct  SelectionAdderTrait< edm::RefVector< C >, edm::RefVector< C > >
 
struct  SelectionAdderTrait< edm::RefVector< C >, std::vector< const T * > >
 
struct  SelectionAdderTrait< edm::View< T >, edm::PtrVector< T > >
 
struct  SelectionAdderTrait< edm::View< T >, edm::RefToBaseVector< T > >
 
struct  SelectionAdderTrait< InputCollection, edm::RefVector< C > >
 
struct  SelectionAdderTrait< InputCollection, std::vector< const T * > >
 
struct  SelectionCopyAdder
 
struct  SelectionFirstPointerAdder
 
struct  SelectionFirstRefAdder
 
struct  SelectionPointerAdder
 
struct  SelectionPointerDerefAdder
 
struct  SelectionPtrViewAdder
 
struct  SelectionRefAdder
 
struct  SelectionRefViewAdder
 
class  SimpleJetTrackAssociator
 
struct  StoreContainerTrait
 
struct  StoreContainerTrait< edm::AssociationVector< R, C > >
 
struct  StoreContainerTrait< edm::PtrVector< T > >
 
struct  StoreContainerTrait< edm::RefToBaseVector< T > >
 
struct  StoreContainerTrait< edm::RefVector< C > >
 
struct  StoreManagerTrait
 
struct  StoreManagerTrait< reco::CandidateCollection, EdmFilter >
 
struct  StoreManagerTrait< reco::MuonCollection, edm::stream::EDFilter<> >
 
struct  StoreManagerTrait< reco::TrackCollection, edm::stream::EDFilter<> >
 
struct  TrackCollectionStoreManager
 Class to manage copying of RecHits and Clusters from Tracks. More...
 
class  TrackSelectorBase
 

Functions

def add_filter
 
def checked_out_MPS
 
template<typename RecHitType >
void ClusterStorer::ClusterHitRecord< SiStripRecHit2D::ClusterRef >rekey (const SiStripRecHit2D::ClusterRef &newRef) const
 
def ConfigSectionMap
 
def findEDAnalyzers
 
def findEDFilters
 
def findEDProducers
 
def findModules
 
def set_pede_option
 

Variables

tuple Config = cp.ConfigParser()
 

Detailed Description

Helper functions to extract the dictionary with
 - all EDFilters
 - all EDProducers
 - all EDAnalyzers
 - all modules
either from a dictionary (either a cms.Process.__dict__ or from the locals() inside a _cff.py fragment)

Function Documentation

def helper.add_filter (   process,
  ed_filter 
)
Adds EDFilter to the supplied cms.Process object and returns complete filter
sequence.

Arguments:
- `process`: cms.Process object
- `ed_filter`: EDFilter

Definition at line 48 of file helper.py.

Referenced by MilleSetup.setup().

48 
49 def add_filter(process, ed_filter):
50  """
51  Adds EDFilter to the supplied cms.Process object and returns complete filter
52  sequence.
53 
54  Arguments:
55  - `process`: cms.Process object
56  - `ed_filter`: EDFilter
57  """
58 
59  if not hasattr(process, "mps_filters"): process.mps_filters = cms.Sequence()
60  process.mps_filters += ed_filter
61  return process.mps_filters
def add_filter
Definition: helper.py:48
def helper.checked_out_MPS ( )
Checks if MPS is checked out locally or taken from the release.

Definition at line 5 of file helper.py.

Referenced by mps_alisetup.SetupAlignment._construct_paths(), and mps_setup_new_align.main().

5 
6 def checked_out_MPS():
7  """Checks if MPS is checked out locally or taken from the release."""
8 
9  checked_out_packages = os.path.join(os.environ["CMSSW_BASE"], "src", ".git",
10  "info", "sparse-checkout")
11  checked_out = False
12  git_initialized = False
13  try:
14  with open(checked_out_packages, "r") as f:
15  packages = ("/Alignment/", "/Alignment/MillePedeAlignmentAlgorithm/","/*/")
16  for line in f:
17  if line.strip() in packages:
18  checked_out = True
19  break
20  git_initialized = True # since the sparse checkout file is there
21  except IOError as e:
22  if e.args != (2, 'No such file or directory'): raise
23 
24  return checked_out, git_initialized
25 
def checked_out_MPS
Definition: helper.py:5
template<typename RecHitType >
void helper::ClusterStorer::ClusterHitRecord< SiStripRecHit2D::ClusterRef >rekey ( const SiStripRecHit2D::ClusterRef newRef) const

Definition at line 156 of file ClusterStorer.cc.

References cms::cuda::assert(), OmniClusterRef::key(), SiStripMatchedRecHit2D::monoClusterRef(), TrackerSingleRecHit::omniCluster(), SiStripDetId::stereo(), and SiStripMatchedRecHit2D::stereoClusterRef().

156  {
157  TrackingRecHit &genericHit = (*hits_)[index_];
158  const std::type_info &hit_type = typeid(genericHit);
159 
160  OmniClusterRef *cluRef = nullptr;
161  if (typeid(SiStripRecHit1D) == hit_type) {
162  cluRef = &static_cast<SiStripRecHit1D &>(genericHit).omniCluster();
163  } else if (typeid(SiStripRecHit2D) == hit_type) {
164  cluRef = &static_cast<SiStripRecHit2D &>(genericHit).omniCluster();
165  } else if (typeid(SiStripMatchedRecHit2D) == hit_type) {
166  SiStripMatchedRecHit2D &mhit = static_cast<SiStripMatchedRecHit2D &>(genericHit);
167  cluRef = (SiStripDetId(detid_).stereo() ? &mhit.stereoClusterRef() : &mhit.monoClusterRef());
168  } else if (typeid(ProjectedSiStripRecHit2D) == hit_type) {
169  cluRef = &static_cast<ProjectedSiStripRecHit2D &>(genericHit).originalHit().omniCluster();
170  }
171 
172  assert(cluRef != nullptr); // to catch missing RecHit types
173  assert(cluRef->key() == ref_.key()); // otherwise something went wrong
174  (*cluRef) = OmniClusterRef(newRef);
175  }
uint32_t stereo() const
Definition: SiStripDetId.h:168
OmniClusterRef const & stereoClusterRef() const
assert(be >=bs)
OmniClusterRef const & omniCluster() const
OmniClusterRef const & monoClusterRef() const
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18
unsigned int key() const
def helper.ConfigSectionMap (   section)

Definition at line 12 of file helper.py.

References Config.options, and print().

12 
13 def ConfigSectionMap(section):
14  dict1 = {}
15  options = Config.options(section)
16  for option in options:
17  try:
18  dict1[option] = Config.get(section, option)
19  if dict1[option] == -1:
20  DebugPrint("skip: %s" % option)
21  except:
22  print("exception on %s!" % option)
23  dict1[option] = None
24  return dict1
tuple options
Definition: Config.py:8
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def ConfigSectionMap
Definition: helper.py:12
def helper.findEDAnalyzers (   holder)

Definition at line 26 of file helper.py.

26 
27 def findEDAnalyzers(holder):
28  if isinstance(holder, cms.Process):
29  return process.analyzers_()
30  else:
31  return dict( (name, module) for name, module in holder.items() if isinstance(module, cms.EDAnalyzer) )
32 
def findEDAnalyzers
Definition: helper.py:26
def helper.findEDFilters (   holder)

Definition at line 12 of file helper.py.

12 
13 def findEDFilters(holder):
14  if isinstance(holder, cms.Process):
15  return process.filters_()
16  else:
17  return dict( (name, module) for name, module in holder.items() if isinstance(module, cms.EDFilter) )
18 
def findEDFilters
Definition: helper.py:12
def helper.findEDProducers (   holder)

Definition at line 19 of file helper.py.

19 
20 def findEDProducers(holder):
21  if isinstance(holder, cms.Process):
22  return process.producers_()
23  else:
24  return dict( (name, module) for name, module in holder.items() if isinstance(module, cms.EDProducer) )
25 
def findEDProducers
Definition: helper.py:19
def helper.findModules (   holder)

Definition at line 33 of file helper.py.

33 
34 def findModules(holder):
35  if isinstance(holder, cms.Process):
36  modules = dict()
37  modules.upate(process.analyzers_())
38  modules.upate(process.producers_())
39  modules.upate(process.filters_())
40  return modules
41  else:
42  return dict( (name, module) for name, module in holder.items() if isinstance(module, (cms.EDAnalyzer, _cms.EDProducer, _cms.EDFilter)) )
43 
44 
def findModules
Definition: helper.py:33
def helper.set_pede_option (   process,
  option,
  drop = False 
)
Utility function to set or override pede `option` defined in `process`.

Arguments:
- `process`: cms.Process object
- `option`: option string
- `drop`: if set to 'True' the `option` is dropped completely

Definition at line 26 of file helper.py.

References sistrip::SpyUtilities.range(), and submitPVValidationJobs.split().

26 
27 def set_pede_option(process, option, drop = False):
28  """Utility function to set or override pede `option` defined in `process`.
29 
30  Arguments:
31  - `process`: cms.Process object
32  - `option`: option string
33  - `drop`: if set to 'True' the `option` is dropped completely
34  """
35 
36  existing_options = process.AlignmentProducer.algoConfig.pedeSteerer.options
37 
38  exists = False
39  for i in range(len(existing_options)):
40  if existing_options[i].split()[0] == option.split()[0]:
41  existing_options[i] = option.strip()
42  exists = True
43  if drop: existing_options.pop(i)
44  break
45 
46  if not exists and not drop: existing_options.append(option.strip())
47 
const uint16_t range(const Frame &aFrame)
def set_pede_option
Definition: helper.py:26

Variable Documentation

tuple helper.Config = cp.ConfigParser()

Definition at line 10 of file helper.py.

Referenced by PhysicsTools::VarProcessor::ConfIterator.operator<<(), QueryAttrHandler.query(), and QuickTrackAssociatorByHitsProducer.QuickTrackAssociatorByHitsProducer().