CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EventPrincipal.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_EventPrincipal_h
2 #define FWCore_Framework_EventPrincipal_h
3 
4 /*----------------------------------------------------------------------
5 
6 EventPrincipal: This is the class responsible for management of
7 per event EDProducts. It is not seen by reconstruction code;
8 such code sees the Event class, which is a proxy for EventPrincipal.
9 
10 The major internal component of the EventPrincipal
11 is the DataBlock.
12 
13 ----------------------------------------------------------------------*/
14 
15 #include "boost/scoped_ptr.hpp"
16 #include "boost/shared_ptr.hpp"
17 #include <map>
18 #include <memory>
19 #include <string>
20 #include <vector>
21 
28 
29 
30 namespace edm {
31  class EventID;
32  class LuminosityBlockPrincipal;
33  class RunPrincipal;
34  class UnscheduledHandler;
35 
36  class EventPrincipal : public Principal {
37  public:
39  typedef Principal Base;
40 
45  boost::shared_ptr<ProductRegistry const> reg,
46  ProcessConfiguration const& pc);
48 
49  void fillEventPrincipal(std::auto_ptr<EventAuxiliary> aux,
50  boost::shared_ptr<LuminosityBlockPrincipal> lbp,
51  boost::shared_ptr<EventSelectionIDVector> eventSelectionIDs = boost::shared_ptr<EventSelectionIDVector>(new EventSelectionIDVector),
52  boost::shared_ptr<BranchListIndexes> branchListIndexes = boost::shared_ptr<BranchListIndexes>(new BranchListIndexes),
53  boost::shared_ptr<BranchMapper> mapper = boost::shared_ptr<BranchMapper>(new BranchMapper),
54  boost::shared_ptr<DelayedReader> rtrv = boost::shared_ptr<DelayedReader>(new NoDelayedReader));
55 
56  void clearEventPrincipal();
57 
60  }
61 
64  }
65 
66  EventID const& id() const {
67  return aux().id();
68  }
69 
70  Timestamp const& time() const {
71  return aux().time();
72  }
73 
74  bool const isReal() const {
75  return aux().isRealData();
76  }
77 
79  return aux().experimentType();
80  }
81 
82  int const bunchCrossing() const {
83  return aux().bunchCrossing();
84  }
85 
86  int const storeNumber() const {
87  return aux().storeNumber();
88  }
89 
90  EventAuxiliary const& aux() const {
91  return *aux_;
92  }
93 
95  return id().luminosityBlock();
96  }
97 
98  RunNumber_t run() const {
99  return id().run();
100  }
101 
102  RunPrincipal const& runPrincipal() const;
103 
105 
106  void setUnscheduledHandler(boost::shared_ptr<UnscheduledHandler> iHandler);
107  boost::shared_ptr<UnscheduledHandler> unscheduledHandler() const;
108 
110 
111  BranchListIndexes const& branchListIndexes() const;
112 
113  Provenance
114  getProvenance(ProductID const& pid) const;
115 
117  getByProductID(ProductID const& oid) const;
118 
119  void put(
120  ConstBranchDescription const& bd,
121  std::auto_ptr<EDProduct> edp,
122  std::auto_ptr<ProductProvenance> productProvenance);
123 
124  void putOnRead(
125  ConstBranchDescription const& bd,
126  std::auto_ptr<EDProduct> edp,
127  std::auto_ptr<ProductProvenance> productProvenance);
128 
129  virtual EDProduct const* getIt(ProductID const& pid) const;
130 
131  ProductID branchIDToProductID(BranchID const& bid) const;
132 
133  using Base::getProvenance;
134 
135  private:
136 
137  BranchID pidToBid(ProductID const& pid) const;
138 
139  virtual ProductID oldToNewProductID_(ProductID const& oldProductID) const;
140 
141  virtual bool unscheduledFill(std::string const& moduleLabel) const;
142 
143  virtual void resolveProduct_(Group const& g, bool fillOnDemand) const;
144 
145  private:
146 
147  boost::scoped_ptr<EventAuxiliary> aux_;
148 
149  boost::shared_ptr<LuminosityBlockPrincipal> luminosityBlockPrincipal_;
150 
151  // Handler for unscheduled modules
152  boost::shared_ptr<UnscheduledHandler> unscheduledHandler_;
153 
154  mutable std::vector<std::string> moduleLabelsRunning_;
155 
156  boost::shared_ptr<EventSelectionIDVector> eventSelectionIDs_;
157 
158  boost::shared_ptr<BranchListIndexes> branchListIndexes_;
159 
160  std::map<BranchListIndex, ProcessIndex> branchListIndexToProcessIndex_;
161 
162  };
163 
164  inline
165  bool
167  return isSameEvent(a.aux(), b.aux());
168  }
169 }
170 #endif
171 
RunNumber_t run() const
Definition: EventID.h:42
bool isRealData() const
bool isSameEvent(EventAuxiliary const &a, EventAuxiliary const &b)
EventSelectionIDVector const & eventSelectionIDs() const
boost::shared_ptr< LuminosityBlockPrincipal > luminosityBlockPrincipal_
void putOnRead(ConstBranchDescription const &bd, std::auto_ptr< EDProduct > edp, std::auto_ptr< ProductProvenance > productProvenance)
RunNumber_t run() const
EventAuxiliary::ExperimentType ExperimentType() const
BasicHandle getByProductID(ProductID const &oid) const
BranchID pidToBid(ProductID const &pid) const
static int const invalidBunchXing
EventID const & id() const
Timestamp const & time() const
std::map< BranchListIndex, ProcessIndex > branchListIndexToProcessIndex_
LuminosityBlockNumber_t luminosityBlock() const
LuminosityBlockPrincipal & luminosityBlockPrincipal()
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:43
BranchListIndexes const & branchListIndexes() const
unsigned int LuminosityBlockNumber_t
Definition: EventID.h:31
int bunchCrossing() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
ProductID branchIDToProductID(BranchID const &bid) const
Base::SharedConstGroupPtr SharedConstGroupPtr
RunPrincipal const & runPrincipal() const
std::vector< EventSelectionID > EventSelectionIDVector
ExperimentType experimentType() const
Timestamp const & time() const
std::vector< BranchListIndex > BranchListIndexes
static int const invalidBunchXing
virtual void resolveProduct_(Group const &g, bool fillOnDemand) const
int storeNumber() const
boost::shared_ptr< UnscheduledHandler > unscheduledHandler() const
EventPrincipal(boost::shared_ptr< ProductRegistry const > reg, ProcessConfiguration const &pc)
boost::scoped_ptr< EventAuxiliary > aux_
int const storeNumber() const
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const
EventAuxiliary Auxiliary
boost::shared_ptr< UnscheduledHandler > unscheduledHandler_
boost::shared_ptr< EventSelectionIDVector > eventSelectionIDs_
void put(ConstBranchDescription const &bd, std::auto_ptr< EDProduct > edp, std::auto_ptr< ProductProvenance > productProvenance)
void fillEventPrincipal(std::auto_ptr< EventAuxiliary > aux, boost::shared_ptr< LuminosityBlockPrincipal > lbp, boost::shared_ptr< EventSelectionIDVector > eventSelectionIDs=boost::shared_ptr< EventSelectionIDVector >(new EventSelectionIDVector), boost::shared_ptr< BranchListIndexes > branchListIndexes=boost::shared_ptr< BranchListIndexes >(new BranchListIndexes), boost::shared_ptr< BranchMapper > mapper=boost::shared_ptr< BranchMapper >(new BranchMapper), boost::shared_ptr< DelayedReader > rtrv=boost::shared_ptr< DelayedReader >(new NoDelayedReader))
Provenance getProvenance(ProductID const &pid) const
static int const invalidStoreNumber
boost::shared_ptr< BranchListIndexes > branchListIndexes_
double b
Definition: hdecay.h:120
virtual bool unscheduledFill(std::string const &moduleLabel) const
bool const isReal() const
int const bunchCrossing() const
EventID const & id() const
static int const invalidStoreNumber
double a
Definition: hdecay.h:121
virtual EDProduct const * getIt(ProductID const &pid) const
void setUnscheduledHandler(boost::shared_ptr< UnscheduledHandler > iHandler)
unsigned int RunNumber_t
Definition: EventRange.h:32
EventAuxiliary const & aux() const
Provenance getProvenance(BranchID const &bid) const
Definition: Principal.cc:538
boost::shared_ptr< Group const > SharedConstGroupPtr
Definition: Principal.h:50
virtual ProductID oldToNewProductID_(ProductID const &oldProductID) const
std::vector< std::string > moduleLabelsRunning_
const std::string * moduleLabel() const
Definition: HLTadd.h:40