CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
FWFFMetadataManager Class Reference

#include <FWFFMetadataManager.h>

Inheritance diagram for FWFFMetadataManager:
FWJobMetadataManager

Public Member Functions

 FWFFMetadataManager ()
 
virtual bool hasModuleLabel (std::string &moduleLabel)
 
- Public Member Functions inherited from FWJobMetadataManager
 FWJobMetadataManager ()
 
void initReps (const FWTypeToRepresentations &iTypeAndReps)
 
std::vector< std::string > & processNamesInJob ()
 
void update (FWJobMetadataUpdateRequest *request)
 
std::vector< Data > & usableData ()
 
virtual ~FWJobMetadataManager ()
 

Protected Member Functions

virtual bool doUpdate (FWJobMetadataUpdateRequest *)
 

Private Attributes

const edm::Eventm_event
 

Additional Inherited Members

- Public Attributes inherited from FWJobMetadataManager
sigc::signal< void > metadataChanged_
 
- Protected Attributes inherited from FWJobMetadataManager
std::vector< Datam_metadata
 
std::vector< std::string > m_processNamesInJob
 
FWTypeToRepresentationsm_typeAndReps
 

Detailed Description

Definition at line 11 of file FWFFMetadataManager.h.

Constructor & Destructor Documentation

FWFFMetadataManager::FWFFMetadataManager ( )

Definition at line 10 of file FWFFMetadataManager.cc.

10  :
11  m_event(0)
12 {
13 }
const edm::Event * m_event

Member Function Documentation

bool FWFFMetadataManager::doUpdate ( FWJobMetadataUpdateRequest )
protectedvirtual

This is the bit that needs to be implemented by a derived class to update the various metadata structures.

Returns
true if any update actually took place.

Implements FWJobMetadataManager.

Definition at line 33 of file FWFFMetadataManager.cc.

References assert(), edm::Provenance::branchDescription(), FWItemAccessorFactory::classAccessedAsCollection(), ztail::d, FWFFMetadataUpdateRequest::event(), event(), edm::BranchDescription::fullClassName(), fwLog, cuy::ii, benchmark_cfg::infos, fwlog::kDebug, m_event, FWJobMetadataManager::m_typeAndReps, edm::BranchDescription::moduleLabel(), FWJobMetadataManager::Data::moduleLabel_, pi, edm::BranchDescription::present(), edm::BranchDescription::processName(), FWJobMetadataManager::Data::processName_, FWJobMetadataManager::Data::productInstanceLabel_, edm::BranchDescription::productInstanceName(), FWJobMetadataManager::Data::purpose_, FWTypeToRepresentations::representationsForType(), FWJobMetadataManager::Data::type_, and FWJobMetadataManager::usableData().

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();
118  d.productInstanceLabel_ = desc.productInstanceName();
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 }
const edm::Event & event() const
static bool classAccessedAsCollection(const TClass *)
const std::vector< FWRepresentationInfo > & representationsForType(const std::string &iTypeName) const
assert(m_qm.get())
std::string const & processName() const
int ii
Definition: cuy.py:588
const Double_t pi
tuple d
Definition: ztail.py:151
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
bool FWFFMetadataManager::hasModuleLabel ( std::string &  moduleLabel)
virtual

Implements FWJobMetadataManager.

Definition at line 16 of file FWFFMetadataManager.cc.

References edm::Provenance::branchDescription(), edm::Event::getAllProvenance(), m_event, edm::BranchDescription::moduleLabel(), and pi.

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 }
void getAllProvenance(std::vector< Provenance const * > &provenances) const
Definition: Event.cc:83
const Double_t pi
std::string const & moduleLabel() const
BranchDescription const & branchDescription() const
Definition: Provenance.h:44
const edm::Event * m_event

Member Data Documentation

const edm::Event* FWFFMetadataManager::m_event
private

Definition at line 21 of file FWFFMetadataManager.h.

Referenced by doUpdate(), and hasModuleLabel().