CMS 3D CMS Logo

Classes | Typedefs | Functions
edm::detail Namespace Reference

Classes

struct  doIsProductEqual
 
struct  doIsProductEqual< T, false >
 
struct  doIsProductEqual< T, true >
 
struct  doMergeProduct
 
struct  doMergeProduct< T, false >
 
struct  doMergeProduct< T, true >
 
struct  doSwapOrAssign
 
struct  doSwapOrAssign< T, false >
 
struct  doSwapOrAssign< T, true >
 
struct  getHasIsProductEqual
 
struct  getHasIsProductEqual< T, false >
 
struct  getHasIsProductEqual< T, true >
 
struct  getHasMergeFunction
 
struct  getHasMergeFunction< T, false >
 
struct  getHasMergeFunction< T, true >
 
struct  getMemberType
 
struct  getMemberType< std::vector< edm::Ptr< T > >, true >
 
struct  getMemberType< T, false >
 
struct  getMemberType< T, true >
 
struct  GetProduct
 
struct  GetProduct< RefVector< C, T, F > >
 
struct  getValueType
 
struct  getValueType< T, false >
 
struct  getValueType< T, true >
 
struct  has_isProductEqual_function
 
struct  has_mergeProduct_function
 
struct  has_postinsert
 
struct  has_swap_function
 
struct  has_typedef_member_type
 
struct  has_typedef_member_type< std::vector< edm::Ptr< T > > >
 
struct  has_typedef_value_type
 
struct  isProductEqual_function
 
struct  mergeProduct_function
 
class  NamedEventSelector
 
struct  postinsert_function
 
struct  swap_function
 
class  ThreadSafeRegistry
 
class  TriggerResultsBasedEventSelector
 

Typedefs

typedef edm::Handle< edm::TriggerResultshandle_t
 
using no_tag = std::false_type
 
using yes_tag = std::true_type
 

Functions

void _throw_range (det_id_type i)
 
bool configureEventSelector (edm::ParameterSet const &iPSet, std::string const &iProcessName, std::vector< std::string > const &iAllTriggerNames, edm::detail::TriggerResultsBasedEventSelector &oSelector, ConsumesCollector &&iC)
 
void doTheOffset (int bunchSpace, int bcr, std::vector< SimTrack > &simtracks, unsigned int evtNr, int vertexOffset, bool wrap)
 
void doTheOffset (int bunchSpace, int bcr, std::vector< SimVertex > &simvertices, unsigned int evtNr, int vertexOffset, bool wrap)
 
void doTheOffset (int bunchSpace, int bcr, std::vector< PSimHit > &simhits, unsigned int evtNr, int vertexOffset, bool wrap)
 
void doTheOffset (int bunchSpace, int bcr, std::vector< PCaloHit > &calohits, unsigned int evtNr, int vertexOffset, bool wrap)
 
void doTheOffset (int bunchSpace, int bcr, TrackingRecHitCollection &trackingrechits, unsigned int evtNr, int vertexOffset, bool wrap)
 
template<typename T >
static yes_tag has_isProductEqual (isProductEqual_function< T,&T::isProductEqual > *dummy)
 
template<typename T >
static no_tag has_isProductEqual (...)
 
template<typename T >
static yes_tag has_member_type (typename T::member_type *)
 
template<typename T >
static no_tag has_member_type (...)
 
template<typename T >
static yes_tag has_mergeProduct (mergeProduct_function< T,&T::mergeProduct > *dummy)
 
template<typename T >
static no_tag has_mergeProduct (...)
 
template<typename T >
no_tag has_postinsert_helper (...)
 
template<typename T >
yes_tag has_postinsert_helper (postinsert_function< T,&T::post_insert > *p)
 
template<typename T >
static yes_tag has_swap (swap_function< T,&T::swap > *dummy)
 
template<typename T >
static no_tag has_swap (...)
 
template<typename T >
static yes_tag has_value_type (typename T::value_type *)
 
template<typename T >
static no_tag has_value_type (...)
 
std::string const & InvalidHash ()
 
bool isnan (float x)
 
bool isnan (double x)
 
bool isnan (long double x)
 
template<typename KEY , typename T , typename E >
std::ostream & operator<< (std::ostream &os, ThreadSafeRegistry< KEY, T > const &reg)
 
template<typename COLLECTION >
void reallyfillPtrVector (COLLECTION const &coll, std::type_info const &iToType, std::vector< unsigned long > const &iIndicies, std::vector< void const * > &oPtr)
 
template<class COLLECTION >
void reallyFillView (COLLECTION const &coll, ProductID const &id, std::vector< void const * > &ptrs, FillViewHelperVector &helpers)
 
template<typename COLLECTION >
void reallySetPtr (COLLECTION const &coll, std::type_info const &iToType, unsigned long iIndex, void const *&oPtr)
 
ParameterSetID registerProperSelectionInfo (edm::ParameterSet const &iInitial, std::string const &iLabel, std::map< std::string, std::vector< std::pair< std::string, int > > > const &outputModulePathPositions, bool anyProductProduced)
 

Typedef Documentation

Definition at line 28 of file TriggerResultsBasedEventSelector.h.

typedef std::false_type edm::detail::no_tag

Definition at line 19 of file WrapperDetail.h.

typedef std::true_type edm::detail::yes_tag

Definition at line 20 of file WrapperDetail.h.

Function Documentation

void edm::detail::_throw_range ( det_id_type  i)
inline

Definition at line 69 of file DetSetVector.h.

References edm::errors::InvalidReference, and edm::Exception::throwThis().

Referenced by edm::DetSetVector< T >::operator[]().

69  {
70  Exception::throwThis(errors::InvalidReference,
71  "DetSetVector::operator[] called with index not in collection;\nindex value: ", i);
72  }
bool edm::detail::configureEventSelector ( edm::ParameterSet const &  iPSet,
std::string const &  iProcessName,
std::vector< std::string > const &  iAllTriggerNames,
edm::detail::TriggerResultsBasedEventSelector oSelector,
edm::ConsumesCollector &&  iC 
)

Handles the final initialization of the TriggerResutsBasedEventSelector

Returns
true if all events will be selected

Definition at line 84 of file TriggerResultsBasedEventSelector.cc.

References edm::ParameterSet::empty(), edm::ParameterSet::getParameter(), mps_fire::i, eostools::move(), edm::detail::TriggerResultsBasedEventSelector::setup(), and edm::detail::TriggerResultsBasedEventSelector::setupDefault().

Referenced by edm::OutputModule::doPreallocate(), edm::global::OutputModuleBase::doPreallocate(), edm::limited::OutputModuleBase::doPreallocate(), edm::one::OutputModuleBase::doPreallocate(), edm::OutputModule::OutputModule(), edm::global::OutputModuleBase::OutputModuleBase(), edm::limited::OutputModuleBase::OutputModuleBase(), edm::one::OutputModuleBase::OutputModuleBase(), and edm::SubProcess::SubProcess().

88  {
89  // If selectevents is an emtpy ParameterSet, then we are to write
90  // all events, or one which contains a vstrig 'SelectEvents' that
91  // is empty, we are to write all events. We have no need for any
92  // EventSelectors.
93  if(iPSet.empty()) {
94  oSelector.setupDefault();
95  return true;
96  }
97 
98  std::vector<std::string> path_specs =
99  iPSet.getParameter<std::vector<std::string> >("SelectEvents");
100 
101  if(path_specs.empty()) {
102  oSelector.setupDefault();
103  return true;
104  }
105 
106  // If we get here, we have the possibility of having to deal with
107  // path_specs that look at more than one process.
108  std::vector<parsed_path_spec_t> parsed_paths(path_specs.size());
109  for(size_t i = 0; i < path_specs.size(); ++i) {
110  parse_path_spec(path_specs[i], parsed_paths[i]);
111  }
112  oSelector.setup(parsed_paths, iAllTriggerNames, iProcessName, std::move(iC));
113 
114  return false;
115  }
void setup(std::vector< parsed_path_spec_t > const &path_specs, std::vector< std::string > const &triggernames, std::string const &process_name, ConsumesCollector &&iC)
def move(src, dest)
Definition: eostools.py:510
void edm::detail::doTheOffset ( int  bunchSpace,
int  bcr,
std::vector< SimTrack > &  simtracks,
unsigned int  evtNr,
int  vertexOffset,
bool  wrap 
)

Definition at line 7 of file Adjuster.cc.

References triggerObjects_cff::id.

Referenced by edm::Adjuster< T >::doOffset().

7  {
8 
9  EncodedEventId id(bcr,evtNr);
10  for (auto& item : simtracks) {
11  item.setEventId(id);
12  if (!item.noVertex()) {
13  item.setVertexIndex(item.vertIndex() + vertexOffset);
14  }
15  }
16 }
void edm::detail::doTheOffset ( int  bunchSpace,
int  bcr,
std::vector< SimVertex > &  simvertices,
unsigned int  evtNr,
int  vertexOffset,
bool  wrap 
)

Definition at line 18 of file Adjuster.cc.

References triggerObjects_cff::id.

18  {
19 
20  int timeOffset = bcr * bunchSpace;
21  EncodedEventId id(bcr,evtNr);
22  for (auto& item : simvertices) {
23  item.setEventId(id);
24  item.setTof(item.position().t() + timeOffset);
25  }
26 }
void edm::detail::doTheOffset ( int  bunchSpace,
int  bcr,
std::vector< PSimHit > &  simhits,
unsigned int  evtNr,
int  vertexOffset,
bool  wrap 
)

Definition at line 28 of file Adjuster.cc.

References triggerObjects_cff::id, and createfilelist::int.

28  {
29 
30  int timeOffset = bcr * bunchSpace;
31  EncodedEventId id(bcr,evtNr);
32  if(wrap) { // wrap time for long-lived hits into one beam crossing
33  for (auto& item : simhits) {
34  item.setEventId(id);
35 
36  float Tfloor = floor(item.timeOfFlight());
37  float digits = item.timeOfFlight() - Tfloor;
38  int remainder = int(Tfloor) % bunchSpace;
39  item.setTof(float(remainder) + digits + timeOffset);
40  }
41  }
42  else {
43  for (auto& item : simhits) {
44  item.setEventId(id);
45  item.setTof(item.timeOfFlight() + timeOffset);
46  }
47  }
48 }
auto wrap(F iFunc) -> decltype(iFunc())
void edm::detail::doTheOffset ( int  bunchSpace,
int  bcr,
std::vector< PCaloHit > &  calohits,
unsigned int  evtNr,
int  vertexOffset,
bool  wrap 
)

Definition at line 50 of file Adjuster.cc.

References triggerObjects_cff::id.

50  {
51 
52  int timeOffset = bcr * bunchSpace;
53  EncodedEventId id(bcr,evtNr);
54  for (auto& item : calohits) {
55  item.setEventId(id);
56  item.setTime(item.time() + timeOffset);
57  }
58 }
void edm::detail::doTheOffset ( int  bunchSpace,
int  bcr,
TrackingRecHitCollection trackingrechits,
unsigned int  evtNr,
int  vertexOffset,
bool  wrap 
)

Definition at line 60 of file Adjuster.cc.

References edm::OwnVector< T, P >::begin(), edm::OwnVector< T, P >::end(), triggerObjects_cff::id, trackerHitRTTI::isFast(), and FastTrackerRecHit::setEventId().

60  {
61 
62  EncodedEventId id(bcr,evtNr);
63  for (auto it = trackingrechits.begin();it!=trackingrechits.end();++it) {
64  if(trackerHitRTTI::isFast(*it)){
65  FastTrackerRecHit * rechit = static_cast<FastTrackerRecHit*>(&(*it));
66  rechit->setEventId(id.rawId());
67  }
68  }
69 }
virtual void setEventId(int32_t eventId)
iterator begin()
Definition: OwnVector.h:244
bool isFast(TrackingRecHit const &hit)
iterator end()
Definition: OwnVector.h:249
template<typename T >
static yes_tag edm::detail::has_isProductEqual ( isProductEqual_function< T,&T::isProductEqual > *  dummy)
static
template<typename T >
static no_tag edm::detail::has_isProductEqual (   ...)
static
template<typename T >
static yes_tag edm::detail::has_member_type ( typename T::member_type *  )
static
template<typename T >
static no_tag edm::detail::has_member_type (   ...)
static
template<typename T >
static yes_tag edm::detail::has_mergeProduct ( mergeProduct_function< T,&T::mergeProduct > *  dummy)
static
template<typename T >
static no_tag edm::detail::has_mergeProduct (   ...)
static
template<typename T >
no_tag edm::detail::has_postinsert_helper (   ...)
template<typename T >
yes_tag edm::detail::has_postinsert_helper ( postinsert_function< T,&T::post_insert > *  p)
template<typename T >
static yes_tag edm::detail::has_swap ( swap_function< T,&T::swap > *  dummy)
static
template<typename T >
static no_tag edm::detail::has_swap (   ...)
static
template<typename T >
static yes_tag edm::detail::has_value_type ( typename T::value_type *  )
static
template<typename T >
static no_tag edm::detail::has_value_type (   ...)
static
std::string const & edm::detail::InvalidHash ( )
bool edm::detail::isnan ( float  x)
inline
bool edm::detail::isnan ( double  x)
inline

Definition at line 22 of file math.h.

References EXTRACT_WORDS.

23  {
24  u_int32_t hx, lx;
25 
26  EXTRACT_WORDS (hx, lx, x);
27  lx |= hx & 0xfffff;
28  hx &= 0x7ff00000;
29  return (bool)(hx == 0x7ff00000) && (lx != 0);
30  }
#define EXTRACT_WORDS(ix0, ix1, d)
Definition: math_private.h:66
bool edm::detail::isnan ( long double  x)
inline

Definition at line 32 of file math.h.

References GET_LDOUBLE_WORDS.

33  {
34  u_int32_t ex, hx, lx;
35 
36  GET_LDOUBLE_WORDS (ex, hx, lx, x);
37  ex &= 0x7fff;
38  return (bool)((ex == 0x7fff) && ((hx & 0x7fffffff) | lx));
39  }
#define GET_LDOUBLE_WORDS(exp, ix0, ix1, d)
Definition: math_private.h:75
template<typename KEY , typename T , typename E >
std::ostream& edm::detail::operator<< ( std::ostream &  os,
ThreadSafeRegistry< KEY, T > const &  reg 
)
inline

Definition at line 100 of file ThreadSafeRegistry.h.

100  {
101  reg.print(os);
102  return os;
103  }
template<typename COLLECTION >
void edm::detail::reallyfillPtrVector ( COLLECTION const &  coll,
std::type_info const &  iToType,
std::vector< unsigned long > const &  iIndicies,
std::vector< void const * > &  oPtr 
)

Definition at line 38 of file fillPtrVector.h.

References edm::detail::GetProduct< COLLECTION >::address(), edm::errors::LogicError, dataset::name, edm::pointerToBase(), and edm::Exception::throwThis().

Referenced by edm::fillPtrVector(), edm::OwnArray< T, MAX_SIZE, P >::fillPtrVector(), edm::SortedCollection< T, SORT >::fillPtrVector(), and edm::OwnVector< T, P >::fillPtrVector().

42  {
43  typedef COLLECTION product_type;
44  typedef typename GetProduct<product_type>::element_type element_type;
45  typedef typename product_type::const_iterator iter;
46 
47  oPtr.reserve(iIndicies.size());
48  if(iToType == typeid(element_type)) {
49  for(std::vector<unsigned long>::const_iterator itIndex = iIndicies.begin(),
50  itEnd = iIndicies.end();
51  itIndex != itEnd;
52  ++itIndex) {
53  iter it = coll.begin();
54  std::advance(it, *itIndex);
55  element_type const* address = GetProduct<product_type>::address(it);
56  oPtr.push_back(address);
57  }
58  } else {
59  for(std::vector<unsigned long>::const_iterator itIndex = iIndicies.begin(),
60  itEnd = iIndicies.end();
61  itIndex != itEnd;
62  ++itIndex) {
63  iter it = coll.begin();
64  std::advance(it, *itIndex);
65  element_type const* address = GetProduct<product_type>::address(it);
66  void const* ptr = pointerToBase(iToType,address);
67  if(nullptr != ptr) {
68  oPtr.push_back(ptr);
69  } else {
70  Exception::throwThis(errors::LogicError,
71  "TypeConversionError "
72  "edm::PtrVector<> : unable to convert type ",
73  typeid(element_type).name(),
74  " to ",
75  iToType.name(),
76  "\n");
77  }
78  }
79  }
80  }
JetCorrectorParametersCollection coll
Definition: classes.h:10
void const * pointerToBase(std::type_info const &baseTypeInfo, T const *address)
Definition: OffsetToBase.h:50
template<class COLLECTION >
void edm::detail::reallyFillView ( COLLECTION const &  coll,
ProductID const &  id,
std::vector< void const * > &  ptrs,
FillViewHelperVector helpers 
)

Definition at line 27 of file FillView.h.

References edm::detail::GetProduct< COLLECTION >::address(), MillePedeFileConverter_cfg::e, mps_fire::i, and crabWrapper::key.

Referenced by edm::fillView(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::fillView(), edm::SortedCollection< T, SORT >::fillView(), and edm::DetSetVector< T >::fillView().

31  {
32  typedef COLLECTION product_type;
33  typedef typename GetProduct<product_type>::element_type element_type;
34  typedef typename product_type::const_iterator iter;
35  typedef typename product_type::size_type size_type;
36 
37  ptrs.reserve(ptrs.size() + coll.size());
38  helpers.reserve(ptrs.size() + coll.size());
39  size_type key = 0;
40  for (iter i = coll.begin(), e = coll.end(); i!=e; ++i, ++key) {
41  element_type const* address = GetProduct<product_type>::address(i);
42  ptrs.push_back(address);
43  helpers.emplace_back(id,key);
44  }
45  }
uint16_t size_type
JetCorrectorParametersCollection coll
Definition: classes.h:10
template<typename COLLECTION >
void edm::detail::reallySetPtr ( COLLECTION const &  coll,
std::type_info const &  iToType,
unsigned long  iIndex,
void const *&  oPtr 
)

Definition at line 37 of file setPtr.h.

References edm::detail::GetProduct< COLLECTION >::address(), edm::errors::LogicError, dataset::name, edm::pointerToBase(), and edm::Exception::throwThis().

Referenced by edm::setPtr(), and edm::SortedCollection< T, SORT >::setPtr().

40  {
41  typedef COLLECTION product_type;
42  typedef typename GetProduct<product_type>::element_type element_type;
43  typedef typename product_type::const_iterator iter;
44 
45  if(iToType == typeid(element_type)) {
46  iter it = coll.begin();
47  std::advance(it,iIndex);
48  element_type const* address = GetProduct<product_type>::address(it);
49  oPtr = address;
50  } else {
51  iter it = coll.begin();
52  std::advance(it,iIndex);
53  element_type const* address = GetProduct<product_type>::address(it);
54 
55  oPtr = pointerToBase(iToType,address);
56 
57  if(nullptr == oPtr) {
58  Exception::throwThis(errors::LogicError,
59  "TypeConversionError"
60  "edm::Ptr<> : unable to convert type ",
61  typeid(element_type).name(),
62  " to ",
63  iToType.name(),
64  "\n");
65  }
66  }
67  }
JetCorrectorParametersCollection coll
Definition: classes.h:10
void const * pointerToBase(std::type_info const &baseTypeInfo, T const *address)
Definition: OffsetToBase.h:50
ParameterSetID edm::detail::registerProperSelectionInfo ( edm::ParameterSet const &  iInitial,
std::string const &  iLabel,
std::map< std::string, std::vector< std::pair< std::string, int > > > const &  outputModulePathPositions,
bool  anyProductProduced 
)

Takes the user specified SelectEvents PSet and creates a new one which conforms to the canonical format required for provenance

Definition at line 178 of file TriggerResultsBasedEventSelector.cc.

References edm::ParameterSet::addParameter(), edm::ParameterSet::copyForModify(), edm::ParameterSet::exists(), edm::ParameterSet::id(), and edm::ParameterSet::registerIt().

Referenced by edm::OutputModule::setEventSelectionInfo(), edm::one::OutputModuleBase::setEventSelectionInfo(), edm::global::OutputModuleBase::setEventSelectionInfo(), edm::limited::OutputModuleBase::setEventSelectionInfo(), and edm::SubProcess::SubProcess().

181  {
182  ParameterSet selectEventsInfo;
183  selectEventsInfo.copyForModify(iInitial);
184  selectEventsInfo.addParameter<bool>("InProcessHistory", anyProductProduced);
185  std::vector<std::string> endPaths;
186  std::vector<int> endPathPositions;
187 
188  // The label will be empty if and only if this is a SubProcess
189  // SubProcess's do not appear on any end path
190  if (!iLabel.empty()) {
191  std::map<std::string, std::vector<std::pair<std::string, int> > >::const_iterator iter = outputModulePathPositions.find(iLabel);
192  assert(iter != outputModulePathPositions.end());
193  for(auto const& item : iter->second) {
194  endPaths.push_back(item.first);
195  endPathPositions.push_back(item.second);
196  }
197  }
198  selectEventsInfo.addParameter<std::vector<std::string> >("EndPaths", endPaths);
199  selectEventsInfo.addParameter<std::vector<int> >("EndPathPositions", endPathPositions);
200  if (!selectEventsInfo.exists("SelectEvents")) {
201  selectEventsInfo.addParameter<std::vector<std::string> >("SelectEvents", std::vector<std::string>());
202  }
203  selectEventsInfo.registerIt();
204 
205  return selectEventsInfo.id();
206  }