CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWFFMetadataManager.cc
Go to the documentation of this file.
8 
9 #include "TClass.h"
11  m_event(0)
12 {
13 }
14 
15 bool
17 {
18  if (m_event) {
19  std::vector<edm::Provenance const *> provenances;
20  m_event->getAllProvenance(provenances);
21 
22  for (size_t pi = 0, pe = provenances.size(); pi != pe; ++pi)
23  {
24  edm::Provenance 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 
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::Provenance const *> provenances;
48 
49  event.getAllProvenance(provenances);
50 
51  for (size_t pi = 0, pe = provenances.size(); pi != pe; ++pi)
52  {
53  edm::Provenance const *provenance = provenances[pi];
54  if (!provenance)
55  continue;
56  Data d;
57  const edm::BranchDescription &desc = provenance->branchDescription();
58 
59  if (!desc.present())
60  continue;
61 
62  const std::vector<FWRepresentationInfo>& infos
64 
65  /*
66  //std::cout <<"try to find match "<<itBranch->fullClassName()<<std::endl;
67  //For each view we need to find the non-sub-part builder whose proximity is smallest and
68  // then register only that purpose
69  //NOTE: for now, we will ignore the view and only look for the closest proximity
70  unsigned int minProx = ~(0U);
71  for (size_t ii = 0, ei = infos.size(); ii != ei; ++ii) {
72  if (!infos[ii].representsSubPart() && minProx > infos[ii].proximity()) {
73  minProx = infos[ii].proximity();
74  }
75  }
76  */
77 
78  //the infos list can contain multiple items with the same purpose so we will just find
79  // the unique ones
80  purposes.clear();
81  for (size_t ii = 0, ei = infos.size(); ii != ei; ++ii) {
82  /* if(!infos[ii].representsSubPart() && minProx != infos[ii].proximity()) {
83  continue;
84  } */
85  purposes.insert(infos[ii].purpose());
86  }
87 
88  if (purposes.empty())
89  purposes.insert("Table");
90 
91  for (Purposes::const_iterator itPurpose = purposes.begin(),
92  itEnd = purposes.end();
93  itPurpose != itEnd;
94  ++itPurpose)
95  {
96  // Determine whether or not the class can be iterated
97  // either by using a TVirtualCollectionProxy (of the class
98  // itself or on one of its members), or by using a
99  // FWItemAccessor plugin.
100  TClass* theClass = TClass::GetClass(desc.fullClassName().c_str());
101 
102  if (!theClass)
103  continue;
104 
105  if (!theClass->GetTypeInfo())
106  continue;
107 
108  // This is pretty much the same thing that happens
110  {
111  fwLog(fwlog::kDebug) << theClass->GetName()
112  << " will not be displayed in table." << std::endl;
113  continue;
114  }
115  d.type_ = desc.fullClassName();
116  d.purpose_ = *itPurpose;
117  d.moduleLabel_ = desc.moduleLabel();
119  d.processName_ = desc.processName();
120  usableData().push_back(d);
121  fwLog(fwlog::kDebug) << "Add collection will display " << d.type_
122  << " " << d.moduleLabel_
123  << " " << d.productInstanceLabel_
124  << " " << d.processName_ << std::endl;
125  }
126  }
127  return true;
128 }
129 
const edm::Event & event() const
void getAllProvenance(std::vector< Provenance const * > &provenances) const
Definition: Event.cc:83
static bool classAccessedAsCollection(const TClass *)
const std::vector< FWRepresentationInfo > & representationsForType(const std::string &iTypeName) const
assert(m_qm.get())
virtual bool doUpdate(FWJobMetadataUpdateRequest *)
std::string const & processName() const
int ii
Definition: cuy.py:588
const Double_t pi
virtual bool hasModuleLabel(std::string &moduleLabel)
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
BranchDescription const & branchDescription() const
Definition: Provenance.h:44
#define fwLog(_level_)
Definition: fwLog.h:50
const edm::Event * m_event
FWTypeToRepresentations * m_typeAndReps