CMS 3D CMS Logo

FWFFMetadataManager.cc
Go to the documentation of this file.
8 
9 #include "TClass.h"
11 
13  if (m_event) {
14  std::vector<edm::StableProvenance const *> provenances;
15  m_event->getAllStableProvenance(provenances);
16 
17  for (size_t pi = 0, pe = provenances.size(); pi != pe; ++pi) {
18  edm::StableProvenance const *provenance = provenances[pi];
19  if (provenance && (provenance->branchDescription().moduleLabel() == iModuleLabel))
20  return true;
21  }
22  }
23  return false;
24 }
25 
27  // Clean up previous data.
28  usableData().clear();
29 
30  assert(m_typeAndReps);
31  FWFFMetadataUpdateRequest *fullRequest = dynamic_cast<FWFFMetadataUpdateRequest *>(request);
32  if (!fullRequest)
33  return false;
34  const edm::Event &event = fullRequest->event();
35  m_event = &event;
36 
37  typedef std::set<std::string> Purposes;
38  Purposes purposes;
39  std::vector<edm::StableProvenance const *> provenances;
40 
41  event.getAllStableProvenance(provenances);
42 
43  for (size_t pi = 0, pe = provenances.size(); pi != pe; ++pi) {
44  edm::StableProvenance const *provenance = provenances[pi];
45  if (!provenance)
46  continue;
47  Data d;
48  const edm::BranchDescription &desc = provenance->branchDescription();
49 
50  const std::vector<FWRepresentationInfo> &infos = m_typeAndReps->representationsForType(desc.fullClassName());
51 
52  /*
53  //std::cout <<"try to find match "<<itBranch->fullClassName()<<std::endl;
54  //For each view we need to find the non-sub-part builder whose proximity is smallest and
55  // then register only that purpose
56  //NOTE: for now, we will ignore the view and only look for the closest proximity
57  unsigned int minProx = ~(0U);
58  for (size_t ii = 0, ei = infos.size(); ii != ei; ++ii) {
59  if (!infos[ii].representsSubPart() && minProx > infos[ii].proximity()) {
60  minProx = infos[ii].proximity();
61  }
62  }
63  */
64 
65  //the infos list can contain multiple items with the same purpose so we will just find
66  // the unique ones
67  purposes.clear();
68  for (size_t ii = 0, ei = infos.size(); ii != ei; ++ii) {
69  /* if(!infos[ii].representsSubPart() && minProx != infos[ii].proximity()) {
70  continue;
71  } */
72  purposes.insert(infos[ii].purpose());
73  }
74 
75  if (purposes.empty())
76  purposes.insert("Table");
77 
78  for (Purposes::const_iterator itPurpose = purposes.begin(), itEnd = purposes.end(); itPurpose != itEnd;
79  ++itPurpose) {
80  // Determine whether or not the class can be iterated
81  // either by using a TVirtualCollectionProxy (of the class
82  // itself or on one of its members), or by using a
83  // FWItemAccessor plugin.
84  TClass *theClass = TClass::GetClass(desc.fullClassName().c_str());
85 
86  if (!theClass)
87  continue;
88 
89  if (!theClass->GetTypeInfo())
90  continue;
91 
92  // This is pretty much the same thing that happens
94  fwLog(fwlog::kDebug) << theClass->GetName() << " will not be displayed in table." << std::endl;
95  continue;
96  }
97  d.type_ = desc.fullClassName();
98  d.purpose_ = *itPurpose;
99  d.moduleLabel_ = desc.moduleLabel();
101  d.processName_ = desc.processName();
102  usableData().push_back(d);
103  fwLog(fwlog::kDebug) << "Add collection will display " << d.type_ << " " << d.moduleLabel_ << " "
104  << d.productInstanceLabel_ << " " << d.processName_ << std::endl;
105  }
106  }
107  return true;
108 }
const edm::Event & event() const
static bool classAccessedAsCollection(const TClass *)
bool doUpdate(FWJobMetadataUpdateRequest *) override
const std::vector< FWRepresentationInfo > & representationsForType(const std::string &iTypeName) const
#define nullptr
bool hasModuleLabel(std::string &moduleLabel) override
BranchDescription const & branchDescription() const
std::string const & processName() const
std::map< l1t::HGCalMulticluster::EnergyInterpretation, double > ei
Definition: classes.h:67
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
d
Definition: ztail.py:151
std::string const & fullClassName() const
ii
Definition: cuy.py:590
#define fwLog(_level_)
Definition: fwLog.h:45
const edm::Event * m_event
FWTypeToRepresentations * m_typeAndReps
void getAllStableProvenance(std::vector< StableProvenance const * > &provenances) const
Definition: Event.cc:126