CMS 3D CMS Logo

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

#include <DataMixingPileupCopy.h>

Public Member Functions

void addPileupInfo (const edm::EventPrincipal *, unsigned int EventId, ModuleCallingContext const *mcc)
 
 DataMixingPileupCopy ()
 
 DataMixingPileupCopy (const edm::ParameterSet &ps)
 
void putPileupInfo (edm::Event &e)
 
virtual ~DataMixingPileupCopy ()
 

Private Attributes

edm::InputTag CFPlaybackInputTag_
 
CrossingFramePlaybackInfoExtended CrossingFramePlaybackStorage_
 
std::string label_
 
edm::InputTag PileupInfoInputTag_
 
std::vector< PileupSummaryInfoPileupSummaryStorage_
 

Detailed Description

Definition at line 36 of file DataMixingPileupCopy.h.

Constructor & Destructor Documentation

DataMixingPileupCopy::DataMixingPileupCopy ( )

Definition at line 27 of file DataMixingPileupCopy.cc.

27 { }
DataMixingPileupCopy::DataMixingPileupCopy ( const edm::ParameterSet ps)
explicit

standard constructor

Definition at line 30 of file DataMixingPileupCopy.cc.

References CFPlaybackInputTag_, edm::ParameterSet::getParameter(), and PileupInfoInputTag_.

30  :
31  label_(ps.getParameter<std::string>("Label"))
32 
33  {
34 
35  // Pileup/Playback information
36 
37  PileupInfoInputTag_ = ps.getParameter<edm::InputTag>("PileupInfoInputTag");
38  CFPlaybackInputTag_ = ps.getParameter<edm::InputTag>("CFPlaybackInputTag");
39 
40  }
T getParameter(std::string const &) const
DataMixingPileupCopy::~DataMixingPileupCopy ( )
virtual

Default destructor

Definition at line 43 of file DataMixingPileupCopy.cc.

43  {
44  }

Member Function Documentation

void DataMixingPileupCopy::addPileupInfo ( const edm::EventPrincipal ep,
unsigned int  EventId,
ModuleCallingContext const *  mcc 
)

Definition at line 47 of file DataMixingPileupCopy.cc.

References CFPlaybackInputTag_, CrossingFramePlaybackStorage_, edm::EventPrincipal::id(), LogDebug, PileupInfoInputTag_, and PileupSummaryStorage_.

Referenced by edm::DataMixingModule::pileWorker().

48  {
49 
50  LogDebug("DataMixingPileupCopy") <<"\n===============> adding pileup Info from event "<<ep->id();
51 
52  // find PileupSummaryInfo, CFPlayback information, if it's there
53 
54  // Pileup info first
55 
56  boost::shared_ptr<Wrapper< std::vector<PileupSummaryInfo> > const> PileupInfoPTR =
57  getProductByTag<std::vector<PileupSummaryInfo>>(*ep,PileupInfoInputTag_, mcc);
58 
59  if(PileupInfoPTR ) {
60 
61  PileupSummaryStorage_ = *(PileupInfoPTR->product()) ;
62 
63  LogDebug("DataMixingEMWorker") << "PileupInfo Size: " << PileupSummaryStorage_.size();
64 
65  }
66 
67  // Playback
68 
69  boost::shared_ptr<Wrapper<CrossingFramePlaybackInfoExtended> const> PlaybackPTR =
70  getProductByTag<CrossingFramePlaybackInfoExtended>(*ep,CFPlaybackInputTag_, mcc);
71 
72  if(PlaybackPTR ) {
73 
74  CrossingFramePlaybackStorage_ = *(PlaybackPTR->product()) ;
75 
76  }
77 
78  }
#define LogDebug(id)
EventID const & id() const
std::vector< PileupSummaryInfo > PileupSummaryStorage_
CrossingFramePlaybackInfoExtended CrossingFramePlaybackStorage_
void DataMixingPileupCopy::putPileupInfo ( edm::Event e)

Definition at line 80 of file DataMixingPileupCopy.cc.

References CrossingFramePlaybackStorage_, CrossingFramePlaybackInfoExtended::getEventStartInfo(), PileupSummaryStorage_, and edm::Event::put().

Referenced by edm::DataMixingModule::put().

80  {
81 
82  std::auto_ptr<std::vector<PileupSummaryInfo> > PSIVector(new std::vector<PileupSummaryInfo>);
83 
84  std::vector<PileupSummaryInfo>::const_iterator PSiter;
85 
86  for(PSiter = PileupSummaryStorage_.begin(); PSiter != PileupSummaryStorage_.end(); PSiter++){
87 
88  PSIVector->push_back(*PSiter);
89 
90  }
91 
92  std::vector<std::vector<edm::EventID> > IdVect;
93 
95 
96  std::auto_ptr< CrossingFramePlaybackInfoExtended > CFPlaybackInfo( new CrossingFramePlaybackInfoExtended(0, IdVect.size(), 1 ));
97 
98  CFPlaybackInfo->setEventStartInfo(IdVect, 0);
99 
100 
101  e.put(PSIVector);
102  e.put(CFPlaybackInfo);
103 
104  // clear local storage after this event
105  PileupSummaryStorage_.clear();
106 
107  }
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
std::vector< PileupSummaryInfo > PileupSummaryStorage_
void getEventStartInfo(std::vector< std::vector< edm::EventID > > &ids, const unsigned int s) const
CrossingFramePlaybackInfoExtended CrossingFramePlaybackStorage_

Member Data Documentation

edm::InputTag edm::DataMixingPileupCopy::CFPlaybackInputTag_
private

Definition at line 59 of file DataMixingPileupCopy.h.

Referenced by addPileupInfo(), and DataMixingPileupCopy().

CrossingFramePlaybackInfoExtended edm::DataMixingPileupCopy::CrossingFramePlaybackStorage_
private

Definition at line 62 of file DataMixingPileupCopy.h.

Referenced by addPileupInfo(), and putPileupInfo().

std::string edm::DataMixingPileupCopy::label_
private
edm::InputTag edm::DataMixingPileupCopy::PileupInfoInputTag_
private

Definition at line 58 of file DataMixingPileupCopy.h.

Referenced by addPileupInfo(), and DataMixingPileupCopy().

std::vector<PileupSummaryInfo> edm::DataMixingPileupCopy::PileupSummaryStorage_
private

Definition at line 64 of file DataMixingPileupCopy.h.

Referenced by addPileupInfo(), and putPileupInfo().