test
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::StableProvenance::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::processName(), FWJobMetadataManager::Data::processName_, FWJobMetadataManager::Data::productInstanceLabel_, edm::BranchDescription::productInstanceName(), vertexPlots::purpose, 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::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();
115  d.productInstanceLabel_ = desc.productInstanceName();
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 }
const edm::Event & event() const
static bool classAccessedAsCollection(const TClass *)
const std::vector< FWRepresentationInfo > & representationsForType(const std::string &iTypeName) const
assert(m_qm.get())
BranchDescription const & branchDescription() const
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
#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::StableProvenance::branchDescription(), edm::Event::getAllStableProvenance(), m_event, edm::BranchDescription::moduleLabel(), and pi.

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 }
BranchDescription const & branchDescription() const
const Double_t pi
std::string const & moduleLabel() const
const edm::Event * m_event
void getAllStableProvenance(std::vector< StableProvenance const * > &provenances) const
Definition: Event.cc:96

Member Data Documentation

const edm::Event* FWFFMetadataManager::m_event
private

Definition at line 21 of file FWFFMetadataManager.h.

Referenced by doUpdate(), and hasModuleLabel().