CMS 3D CMS Logo

edm::Group Class Reference

#include <FWCore/Framework/interface/Group.h>

List of all members.

Public Member Functions

boost::shared_ptr< EventEntryInfoentryInfoPtr () const
 Group (ConstBranchDescription const &bd, boost::shared_ptr< EventEntryInfo > entryInfo)
 Group (std::auto_ptr< EDProduct > edp, ConstBranchDescription const &bd, boost::shared_ptr< EventEntryInfo > entryInfo)
 Group (ConstBranchDescription const &bd, std::auto_ptr< EventEntryInfo > entryInfo)
 Group (std::auto_ptr< EDProduct > edp, ConstBranchDescription const &bd, std::auto_ptr< EventEntryInfo > entryInfo)
 Group (ConstBranchDescription const &bd)
 Group (ConstBranchDescription const &bd, bool demand)
 Group ()
bool isMatchingSequence (ROOT::Reflex::Type const &wanted) const
void mergeGroup (Group *newGroup)
std::string const & moduleLabel () const
bool onDemand () const
std::string const & processName () const
EDProduct const * product () const
ConstBranchDescription const & productDescription () const
std::string const & productInstanceName () const
ROOT::Reflex::Type productType () const
bool productUnavailable () const
Provenance const * provenance () const
bool provenanceAvailable () const
void replace (Group &g)
void setProduct (std::auto_ptr< EDProduct > prod) const
void setProvenance (boost::shared_ptr< EventEntryInfo > entryInfo) const
ProductStatus status () const
void swap (Group &other)
void write (std::ostream &os) const
 ~Group ()

Private Member Functions

 Group (const Group &)
void operator= (const Group &)

Private Attributes

boost::shared_ptr
< ConstBranchDescription
branchDescription_
bool dropped_
boost::shared_ptr< EventEntryInfoentryInfo_
bool onDemand_
boost::shared_ptr< EDProductproduct_
boost::shared_ptr< Provenanceprov_


Detailed Description

Definition at line 23 of file Group.h.


Constructor & Destructor Documentation

edm::Group::Group (  ) 

Definition at line 14 of file Group.cc.

00014                :
00015     product_(),
00016     branchDescription_(),
00017     entryInfo_(),
00018     prov_(),
00019     dropped_(false),
00020     onDemand_(false) {}

edm::Group::Group ( ConstBranchDescription const &  bd,
bool  demand 
)

Definition at line 58 of file Group.cc.

00058                                                             :
00059     product_(),
00060     branchDescription_(new ConstBranchDescription(bd)),
00061     entryInfo_(),
00062     prov_(),
00063     dropped_(!branchDescription_->present()),
00064     onDemand_(demand) {
00065   }

edm::Group::Group ( ConstBranchDescription const &  bd  )  [explicit]

Definition at line 67 of file Group.cc.

00067                                                :
00068     product_(),
00069     branchDescription_(new ConstBranchDescription(bd)),
00070     entryInfo_(),
00071     prov_(),
00072     dropped_(!branchDescription_->present()),
00073     onDemand_(false) {
00074   }

edm::Group::Group ( std::auto_ptr< EDProduct edp,
ConstBranchDescription const &  bd,
std::auto_ptr< EventEntryInfo entryInfo 
)

Definition at line 22 of file Group.cc.

00022                                                                                                                   :
00023     product_(edp.release()),
00024     branchDescription_(new ConstBranchDescription(bd)),
00025     entryInfo_(entryInfo.release()),
00026     prov_(new Provenance(*branchDescription_, entryInfo_)),
00027     dropped_(!branchDescription_->present()),
00028     onDemand_(false) {
00029   }

edm::Group::Group ( ConstBranchDescription const &  bd,
std::auto_ptr< EventEntryInfo entryInfo 
)

Definition at line 31 of file Group.cc.

00031                                                                                       :
00032     product_(),
00033     branchDescription_(new ConstBranchDescription(bd)),
00034     entryInfo_(entryInfo.release()),
00035     prov_(new Provenance(*branchDescription_, entryInfo_)),
00036     dropped_(!branchDescription_->present()),
00037     onDemand_(false) {
00038   }

edm::Group::Group ( std::auto_ptr< EDProduct edp,
ConstBranchDescription const &  bd,
boost::shared_ptr< EventEntryInfo entryInfo 
)

Definition at line 40 of file Group.cc.

00040                                                                                                                       :
00041     product_(edp.release()),
00042     branchDescription_(new ConstBranchDescription(bd)),
00043     entryInfo_(entryInfo),
00044     prov_(new Provenance(*branchDescription_, entryInfo_)),
00045     dropped_(!branchDescription_->present()),
00046     onDemand_(false) {
00047   }

edm::Group::Group ( ConstBranchDescription const &  bd,
boost::shared_ptr< EventEntryInfo entryInfo 
)

Definition at line 49 of file Group.cc.

00049                                                                                           :
00050     product_(),
00051     branchDescription_(new ConstBranchDescription(bd)),
00052     entryInfo_(entryInfo),
00053     prov_(new Provenance(*branchDescription_, entryInfo_)),
00054     dropped_(!branchDescription_->present()),
00055     onDemand_(false) {
00056   }

edm::Group::~Group (  ) 

Definition at line 76 of file Group.cc.

00076                 {
00077   }

edm::Group::Group ( const Group  )  [private]


Member Function Documentation

boost::shared_ptr<EventEntryInfo> edm::Group::entryInfoPtr (  )  const [inline]

Definition at line 60 of file Group.h.

References entryInfo_.

Referenced by edm::RunPrincipal::resolveProvenance(), edm::LuminosityBlockPrincipal::resolveProvenance(), and edm::EventPrincipal::resolveProvenance().

00060 {return entryInfo_;}

bool edm::Group::isMatchingSequence ( ROOT::Reflex::Type const &  wanted  )  const

void edm::Group::mergeGroup ( Group newGroup  ) 

Definition at line 188 of file Group.cc.

References branchDescription_, entryInfo_, moduleLabel(), processName(), product_, productInstanceName(), productUnavailable(), status(), and edm::errors::Unknown.

Referenced by edm::LuminosityBlockPrincipal::addOrReplaceGroup(), and edm::RunPrincipal::addOrReplaceGroup().

00188                                     {
00189 
00190     if (status() != newGroup->status()) {
00191       throw edm::Exception(edm::errors::Unknown, "Merging")
00192         << "Group::mergeGroup(), Trying to merge two run products or two lumi products.\n"
00193         << "The products have different creation status's.\n"
00194         << "For example \"present\" and \"notCreated\"\n"
00195         << "The Framework does not currently support this and probably\n"
00196         << "should not support this case.\n"
00197         << "Likely a problem exists in the producer that created these\n"
00198         << "products.  If this problem cannot be reasonably resolved by\n"
00199         << "fixing the producer module, then contact the Framework development\n"
00200         << "group with details so we can discuss whether and how to support this\n"
00201         << "use case.\n"
00202         << "className = " << branchDescription_->className() << "\n"
00203         << "moduleLabel = " << moduleLabel() << "\n"
00204         << "instance = " << productInstanceName() << "\n"
00205         << "process = " << processName() << "\n";
00206     }
00207 
00208     if (!entryInfo_) {
00209       return;
00210     }
00211 
00212     // Don't support specifying multple modules.  So just null the description
00213     // if they are different.    
00214 
00215     if (entryInfo_->moduleDescriptionID() != newGroup->entryInfo_->moduleDescriptionID()) {
00216       entryInfo_->setModuleDescriptionID(ModuleDescriptionID());
00217     }
00218 
00219     if (!productUnavailable() && !newGroup->productUnavailable()) {
00220 
00221       if (product_->isMergeable()) {
00222         product_->mergeProduct(newGroup->product_.get());
00223       }
00224       else if (product_->hasIsProductEqual()) {
00225 
00226         if (!product_->isProductEqual(newGroup->product_.get())) {
00227           edm::LogWarning  ("RunLumiMerging") 
00228             << "Group::mergeGroup\n" 
00229             << "Two run/lumi products for the same run/lumi which should be equal are not\n"
00230             << "Using the first, ignoring the second\n"
00231             << "className = " << branchDescription_->className() << "\n"
00232             << "moduleLabel = " << moduleLabel() << "\n"
00233             << "instance = " << productInstanceName() << "\n"
00234             << "process = " << processName() << "\n";
00235         }
00236       }
00237       else {
00238         edm::LogWarning  ("RunLumiMerging") 
00239           << "Group::mergeGroup\n" 
00240           << "Run/lumi product has neither a mergeProduct nor isProductEqual function\n"
00241           << "Using the first, ignoring the second in merge\n"
00242           << "className = " << branchDescription_->className() << "\n"
00243           << "moduleLabel = " << moduleLabel() << "\n"
00244           << "instance = " << productInstanceName() << "\n"
00245           << "process = " << processName() << "\n";
00246       }
00247     }
00248   }

std::string const& edm::Group::moduleLabel (  )  const [inline]

Definition at line 64 of file Group.h.

References branchDescription_.

Referenced by mergeGroup().

00064 {return branchDescription_->moduleLabel();}

bool edm::Group::onDemand (  )  const

Definition at line 94 of file Group.cc.

References onDemand_.

Referenced by edm::EventPrincipal::addOrReplaceGroup(), productUnavailable(), provenanceAvailable(), and edm::Principal::resolveProduct().

00094                         {
00095     return onDemand_;
00096   }

void edm::Group::operator= ( const Group  )  [private]

std::string const& edm::Group::processName (  )  const [inline]

Definition at line 68 of file Group.h.

References branchDescription_.

Referenced by mergeGroup().

00068 {return branchDescription_->processName();}

EDProduct const* edm::Group::product (  )  const [inline]

Definition at line 58 of file Group.h.

References product_.

Referenced by edm::LuminosityBlockPrincipal::addOrReplaceGroup(), edm::RunPrincipal::addOrReplaceGroup(), productType(), edm::Principal::resolveProduct(), and setProduct().

00058 { return product_.get(); }

ConstBranchDescription const& edm::Group::productDescription (  )  const [inline]

Definition at line 62 of file Group.h.

References branchDescription_.

Referenced by edm::EventPrincipal::addOrReplaceGroup(), edm::Principal::getExistingGroup(), edm::Principal::resolveProduct(), edm::RunPrincipal::resolveProvenance(), edm::LuminosityBlockPrincipal::resolveProvenance(), and edm::EventPrincipal::resolveProvenance().

00062 {return *branchDescription_;}

std::string const& edm::Group::productInstanceName (  )  const [inline]

Definition at line 66 of file Group.h.

References branchDescription_.

Referenced by mergeGroup().

00066 {return branchDescription_->productInstanceName();}

Type edm::Group::productType (  )  const

Definition at line 145 of file Group.cc.

References product().

00146   {
00147     return Type::ByTypeInfo(typeid(*product()));
00148   }

bool edm::Group::productUnavailable (  )  const

Definition at line 99 of file Group.cc.

References dropped_, onDemand(), edm::productstatus::present(), status(), and edm::productstatus::unknown().

Referenced by edm::LuminosityBlockPrincipal::addOrReplaceGroup(), edm::RunPrincipal::addOrReplaceGroup(), mergeGroup(), and edm::Principal::resolveProduct().

00099                                   { 
00100     if (onDemand()) return false;
00101     if (dropped_) return true;
00102     if (productstatus::unknown(status())) return false;
00103     return not productstatus::present(status());
00104 
00105   }

Provenance const * edm::Group::provenance (  )  const

Definition at line 171 of file Group.cc.

References branchDescription_, entryInfo_, and prov_.

Referenced by edm::Principal::resolveProduct().

00171                           {
00172     if (!prov_.get()) {
00173       prov_.reset(new Provenance(*branchDescription_, entryInfo_));
00174     }
00175     return prov_.get();
00176   }

bool edm::Group::provenanceAvailable (  )  const

Definition at line 108 of file Group.cc.

References onDemand().

00108                                    { 
00109     if (onDemand()) return false;
00110     return true;    
00111   }

void edm::Group::replace ( Group g  ) 

Definition at line 140 of file Group.cc.

References swap().

00140                          {
00141     this->swap(g);
00142   }

void edm::Group::setProduct ( std::auto_ptr< EDProduct prod  )  const

Definition at line 114 of file Group.cc.

References product(), and product_.

Referenced by edm::Principal::resolveProduct().

00114                                                      {
00115     assert (product() == 0);
00116     product_.reset(prod.release());  // Group takes ownership
00117   }

void edm::Group::setProvenance ( boost::shared_ptr< EventEntryInfo entryInfo  )  const

Definition at line 120 of file Group.cc.

References branchDescription_, entryInfo_, and prov_.

Referenced by edm::RunPrincipal::resolveProvenance(), edm::LuminosityBlockPrincipal::resolveProvenance(), and edm::EventPrincipal::resolveProvenance().

00120                                                                       {
00121     entryInfo_ = entryInfo;  // Group takes ownership
00122     if (entryInfo_) {
00123       prov_.reset(new Provenance(*branchDescription_, entryInfo_));
00124     } else {
00125       prov_.reset(new Provenance(*branchDescription_));
00126     }
00127   }

ProductStatus edm::Group::status ( void   )  const

Definition at line 80 of file Group.cc.

References edm::productstatus::dropped(), dropped_, entryInfo_, edm::productstatus::neverCreated(), edm::productstatus::present(), product_, and edm::productstatus::unknown().

Referenced by mergeGroup(), and productUnavailable().

00080                       {
00081     if (dropped_) return productstatus::dropped();
00082     if (!entryInfo_) {
00083       if (product_) return product_->isPresent() ? productstatus::present() : productstatus::neverCreated();
00084       else return productstatus::unknown();
00085     }
00086     if (product_) {
00087       // for backward compatibility
00088       product_->isPresent() ? entryInfo_->setPresent() : entryInfo_->setNotPresent();
00089     }
00090     return entryInfo_->productStatus();
00091   }

void edm::Group::swap ( Group other  ) 

Definition at line 130 of file Group.cc.

References branchDescription_, dropped_, entryInfo_, onDemand_, product_, prov_, and std::swap().

Referenced by replace(), and edm::swap().

00130                           {
00131     std::swap(product_, other.product_);
00132     std::swap(branchDescription_, other.branchDescription_);
00133     std::swap(entryInfo_, other.entryInfo_);
00134     std::swap(prov_, other.prov_);
00135     std::swap(dropped_, other.dropped_);
00136     std::swap(onDemand_, other.onDemand_);
00137   }

void edm::Group::write ( std::ostream &  os  )  const

Definition at line 179 of file Group.cc.

References entryInfo_.

Referenced by edm::operator<<().

00180   {
00181     // This is grossly inadequate. It is also not critical for the
00182     // first pass.
00183     os << std::string("Group for product with ID: ")
00184        << entryInfo_->productID();
00185   }


Member Data Documentation

boost::shared_ptr<ConstBranchDescription> edm::Group::branchDescription_ [private]

Definition at line 109 of file Group.h.

Referenced by mergeGroup(), moduleLabel(), processName(), productDescription(), productInstanceName(), provenance(), setProvenance(), and swap().

bool edm::Group::dropped_ [private]

Definition at line 112 of file Group.h.

Referenced by productUnavailable(), status(), and swap().

boost::shared_ptr<EventEntryInfo> edm::Group::entryInfo_ [mutable, private]

Definition at line 110 of file Group.h.

Referenced by entryInfoPtr(), mergeGroup(), provenance(), setProvenance(), status(), swap(), and write().

bool edm::Group::onDemand_ [private]

Definition at line 113 of file Group.h.

Referenced by onDemand(), and swap().

boost::shared_ptr<EDProduct> edm::Group::product_ [mutable, private]

Definition at line 108 of file Group.h.

Referenced by mergeGroup(), product(), setProduct(), status(), and swap().

boost::shared_ptr<Provenance> edm::Group::prov_ [mutable, private]

Definition at line 111 of file Group.h.

Referenced by provenance(), setProvenance(), and swap().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:41:02 2009 for CMSSW by  doxygen 1.5.4