CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
edm::HiMixingWorker< T > Class Template Reference
Inheritance diagram for edm::HiMixingWorker< T >:
edm::HiMixingWorkerBase

Public Member Functions

void addSignals (edm::Event &e)
 
template<>
void addSignals (edm::Event &e)
 
 HiMixingWorker (std::string &object, std::vector< InputTag > &tags, std::string &label)
 
 ~HiMixingWorker ()
 
- Public Member Functions inherited from edm::HiMixingWorkerBase
 HiMixingWorkerBase ()
 
 HiMixingWorkerBase (std::string &object, std::vector< InputTag > &tags, std::string &label)
 
virtual ~HiMixingWorkerBase ()
 

Additional Inherited Members

- Public Attributes inherited from edm::HiMixingWorkerBase
std::string label_
 
std::string object_
 
std::vector< InputTagtags_
 

Detailed Description

template<class T>
class edm::HiMixingWorker< T >

Definition at line 90 of file HiMixingModule.cc.

Constructor & Destructor Documentation

template<class T >
edm::HiMixingWorker< T >::HiMixingWorker ( std::string &  object,
std::vector< InputTag > &  tags,
std::string &  label 
)
inline

Definition at line 92 of file HiMixingModule.cc.

92 : HiMixingWorkerBase(object,tags, label) {;}
const std::string & label
Definition: MVAComputer.cc:186
tuple tags
Definition: o2o.py:248
template<class T >
edm::HiMixingWorker< T >::~HiMixingWorker ( )
inline

Definition at line 93 of file HiMixingModule.cc.

93 {;}

Member Function Documentation

template<class T >
void edm::HiMixingWorker< T >::addSignals ( edm::Event e)
inlinevirtual

Implements edm::HiMixingWorkerBase.

Definition at line 94 of file HiMixingModule.cc.

References gather_cfg::cout, edm::Event::getByLabel(), edm::EventBase::id(), and edm::Event::put().

94  {
95  std::vector<Handle<std::vector<T> > > handles;
96  bool get = true;
97  for(size_t itag = 0; itag < tags_.size(); ++itag){
98  std::cout<<"itag "<<itag<<std::endl;
99  std::cout<<"label "<<tags_[itag].label()<<std::endl;
100  std::cout<<"instance "<<tags_[itag].instance()<<std::endl;
101  Handle<std::vector<T> > hand;
102  handles.push_back(hand);
103  get = get && e.getByLabel(tags_[itag],handles[itag]);
104  if(!get) LogError("Product inconsistency")<<"One of the sub-events is missing the product with type "
105  <<object_
106  <<", instance "
107  <<tags_[itag].instance()
108  <<" whereas the other one is fine.";
109  }
110 
111  if(get){
112  std::auto_ptr<CrossingFrame<T> > crFrame(new CrossingFrame<T>() );
113  crFrame->addSignals(handles[0].product(),e.id());
114  for(size_t itag = 1; itag < tags_.size(); ++itag){
115  crFrame->addPileups(0,const_cast< std::vector<T> * >(handles[itag].product()),itag);
116  }
117  e.put(crFrame,label_);
118  }
119  }
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
std::vector< InputTag > tags_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
edm::EventID id() const
Definition: EventBase.h:56
tuple cout
Definition: gather_cfg.py:41
template<>
void edm::HiMixingWorker< HepMCProduct >::addSignals ( edm::Event e)
virtual

Implements edm::HiMixingWorkerBase.

Definition at line 123 of file HiMixingModule.cc.

References edm::Event::getByLabel(), edm::EventBase::id(), and edm::Event::put().

123  {
124 
125  std::vector<Handle<HepMCProduct> > handles;
126  bool get = true;
127  for(size_t itag = 0; itag< tags_.size(); ++itag){
129  handles.push_back(hand);
130  get = get && e.getByLabel(tags_[itag],handles[itag]);
131  if(!get) LogError("Product inconsistency")<<"One of the sub-events is missing the product with type "
132  <<object_
133  <<", instance "
134  <<tags_[itag].instance()
135  <<" whereas the other one is fine.";
136  }
137 
138  if(get){
139  std::auto_ptr<CrossingFrame<HepMCProduct> > crFrame(new CrossingFrame<HepMCProduct>() );
140  crFrame->addSignals(handles[0].product(),e.id());
141  for(size_t itag = 1; itag < tags_.size(); ++itag){
142  crFrame->addPileups(0, const_cast<HepMCProduct *>(handles[itag].product()),itag);
143  }
144  e.put(crFrame,label_);
145  }
146 }
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
std::vector< InputTag > tags_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
edm::EventID id() const
Definition: EventBase.h:56