CMS 3D CMS Logo

FWFFMetadataManager.cc
Go to the documentation of this file.
8 
9 #include "TClass.h"
11  m_event(nullptr)
12 {
13 }
14 
15 bool
17 {
18  if (m_event) {
19  std::vector<edm::StableProvenance const *> provenances;
20  m_event->getAllStableProvenance(provenances);
21 
22  for (size_t pi = 0, pe = provenances.size(); pi != pe; ++pi)
23  {
24  edm::StableProvenance const *provenance = provenances[pi];
25  if (provenance && (provenance->branchDescription().moduleLabel() == iModuleLabel))
26  return true;
27  }
28  }
29  return false;
30 }
31 
32 bool
34 {
35  // Clean up previous data.
36  usableData().clear();
37 
38  assert(m_typeAndReps);
39  FWFFMetadataUpdateRequest *fullRequest = dynamic_cast<FWFFMetadataUpdateRequest*>(request);
40  if (!fullRequest)
41  return false;
42  const edm::Event &event = fullRequest->event();
43  m_event = &event;
44 
45  typedef std::set<std::string> Purposes;
46  Purposes purposes;
47  std::vector<edm::StableProvenance const *> provenances;
48 
49  event.getAllStableProvenance(provenances);
50 
51  for (size_t pi = 0, pe = provenances.size(); pi != pe; ++pi)
52  {
53  edm::StableProvenance const *provenance = provenances[pi];
54  if (!provenance)
55  continue;
56  Data d;
57  const edm::BranchDescription &desc = provenance->branchDescription();
58 
59  const std::vector<FWRepresentationInfo>& infos
61 
62  /*
63  //std::cout <<"try to find match "<<itBranch->fullClassName()<<std::endl;
64  //For each view we need to find the non-sub-part builder whose proximity is smallest and
65  // then register only that purpose
66  //NOTE: for now, we will ignore the view and only look for the closest proximity
67  unsigned int minProx = ~(0U);
68  for (size_t ii = 0, ei = infos.size(); ii != ei; ++ii) {
69  if (!infos[ii].representsSubPart() && minProx > infos[ii].proximity()) {
70  minProx = infos[ii].proximity();
71  }
72  }
73  */
74 
75  //the infos list can contain multiple items with the same purpose so we will just find
76  // the unique ones
77  purposes.clear();
78  for (size_t ii = 0, ei = infos.size(); ii != ei; ++ii) {
79  /* if(!infos[ii].representsSubPart() && minProx != infos[ii].proximity()) {
80  continue;
81  } */
82  purposes.insert(infos[ii].purpose());
83  }
84 
85  if (purposes.empty())
86  purposes.insert("Table");
87 
88  for (Purposes::const_iterator itPurpose = purposes.begin(),
89  itEnd = purposes.end();
90  itPurpose != itEnd;
91  ++itPurpose)
92  {
93  // Determine whether or not the class can be iterated
94  // either by using a TVirtualCollectionProxy (of the class
95  // itself or on one of its members), or by using a
96  // FWItemAccessor plugin.
97  TClass* theClass = TClass::GetClass(desc.fullClassName().c_str());
98 
99  if (!theClass)
100  continue;
101 
102  if (!theClass->GetTypeInfo())
103  continue;
104 
105  // This is pretty much the same thing that happens
107  {
108  fwLog(fwlog::kDebug) << theClass->GetName()
109  << " will not be displayed in table." << std::endl;
110  continue;
111  }
112  d.type_ = desc.fullClassName();
113  d.purpose_ = *itPurpose;
114  d.moduleLabel_ = desc.moduleLabel();
116  d.processName_ = desc.processName();
117  usableData().push_back(d);
118  fwLog(fwlog::kDebug) << "Add collection will display " << d.type_
119  << " " << d.moduleLabel_
120  << " " << d.productInstanceLabel_
121  << " " << d.processName_ << std::endl;
122  }
123  }
124  return true;
125 }
126 
const edm::Event & event() const
static bool classAccessedAsCollection(const TClass *)
bool doUpdate(FWJobMetadataUpdateRequest *) override
const std::vector< FWRepresentationInfo > & representationsForType(const std::string &iTypeName) const
bool hasModuleLabel(std::string &moduleLabel) override
BranchDescription const & branchDescription() const
std::string const & processName() const
#define nullptr
const Double_t pi
std::string const & moduleLabel() const
std::string const & productInstanceName() const
std::vector< Data > & usableData()
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
std::string const & fullClassName() const
ii
Definition: cuy.py:590
#define fwLog(_level_)
Definition: fwLog.h:50
const edm::Event * m_event
FWTypeToRepresentations * m_typeAndReps
void getAllStableProvenance(std::vector< StableProvenance const * > &provenances) const
Definition: Event.cc:144