-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 123263 b: refs/heads/vhbbHeppy74X c: 9859778 h: refs/heads/vhbbHeppy74X i: 123261: 4b54808 123259: 10b59f6 123255: 403da25 123247: a5cab6d 123231: 890c14e 123199: df44fce 123135: ce8e64f
- Loading branch information
Mike Hildreth
committed
Apr 30, 2013
1 parent
7302bc5
commit df2829a
Showing
7 changed files
with
237 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/vhbbHeppy74X: 763c6875d74733f316c0c1dc27a12f89704442e8 | ||
refs/heads/vhbbHeppy74X: 985977830e8a10ce5697523e40274fd284cd3e85 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 108 additions & 0 deletions
108
trunk/SimGeneral/DataMixingModule/plugins/DataMixingPileupCopy.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
// File: DataMixingPileupCopy.cc | ||
// Description: see DataMixingPileupCopy.h | ||
// Author: Mike Hildreth, University of Notre Dame | ||
// | ||
//-------------------------------------------- | ||
|
||
#include <map> | ||
#include "FWCore/MessageLogger/interface/MessageLogger.h" | ||
#include "FWCore/Utilities/interface/EDMException.h" | ||
#include "FWCore/Framework/interface/ConstProductRegistry.h" | ||
#include "FWCore/ServiceRegistry/interface/Service.h" | ||
#include "DataFormats/Common/interface/Handle.h" | ||
#include "DataFormats/Provenance/interface/Provenance.h" | ||
#include "DataFormats/Provenance/interface/BranchDescription.h" | ||
// | ||
// | ||
#include "DataMixingPileupCopy.h" | ||
|
||
|
||
using namespace std; | ||
|
||
namespace edm | ||
{ | ||
|
||
// Virtual constructor | ||
|
||
DataMixingPileupCopy::DataMixingPileupCopy() { } | ||
|
||
// Constructor | ||
DataMixingPileupCopy::DataMixingPileupCopy(const edm::ParameterSet& ps) : | ||
label_(ps.getParameter<std::string>("Label")) | ||
|
||
{ | ||
|
||
// Pileup/Playback information | ||
|
||
PileupInfoInputTag_ = ps.getParameter<edm::InputTag>("PileupInfoInputTag"); | ||
CFPlaybackInputTag_ = ps.getParameter<edm::InputTag>("CFPlaybackInputTag"); | ||
|
||
} | ||
|
||
// Virtual destructor needed. | ||
DataMixingPileupCopy::~DataMixingPileupCopy() { | ||
} | ||
|
||
|
||
void DataMixingPileupCopy::addPileupInfo(const EventPrincipal *ep, unsigned int eventNr) { | ||
|
||
LogDebug("DataMixingPileupCopy") <<"\n===============> adding pileup Info from event "<<ep->id(); | ||
|
||
// find PileupSummaryInfo, CFPlayback information, if it's there | ||
|
||
// Pileup info first | ||
|
||
boost::shared_ptr<Wrapper< std::vector<PileupSummaryInfo> > const> PileupInfoPTR = | ||
getProductByTag<std::vector<PileupSummaryInfo>>(*ep,PileupInfoInputTag_ ); | ||
|
||
if(PileupInfoPTR ) { | ||
|
||
PileupSummaryStorage_ = *(PileupInfoPTR->product()) ; | ||
|
||
LogDebug("DataMixingEMWorker") << "PileupInfo Size: " << PileupSummaryStorage_.size(); | ||
|
||
} | ||
|
||
// Playback | ||
|
||
boost::shared_ptr<Wrapper<CrossingFramePlaybackInfoExtended> const> PlaybackPTR = | ||
getProductByTag<CrossingFramePlaybackInfoExtended>(*ep,CFPlaybackInputTag_ ); | ||
|
||
if(PlaybackPTR ) { | ||
|
||
CrossingFramePlaybackStorage_ = *(PlaybackPTR->product()) ; | ||
|
||
} | ||
|
||
} | ||
|
||
void DataMixingPileupCopy::putPileupInfo(edm::Event &e) { | ||
|
||
std::auto_ptr<std::vector<PileupSummaryInfo> > PSIVector(new std::vector<PileupSummaryInfo>); | ||
|
||
std::vector<PileupSummaryInfo>::const_iterator PSiter; | ||
|
||
for(PSiter = PileupSummaryStorage_.begin(); PSiter != PileupSummaryStorage_.end(); PSiter++){ | ||
|
||
PSIVector->push_back(*PSiter); | ||
|
||
} | ||
|
||
std::vector<std::vector<edm::EventID> > IdVect; | ||
|
||
CrossingFramePlaybackStorage_.getEventStartInfo(IdVect, 0); | ||
|
||
std::auto_ptr< CrossingFramePlaybackInfoExtended > CFPlaybackInfo( new CrossingFramePlaybackInfoExtended(0, IdVect.size(), 1 )); | ||
|
||
CFPlaybackInfo->setEventStartInfo(IdVect, 0); | ||
|
||
|
||
e.put(PSIVector); | ||
e.put(CFPlaybackInfo); | ||
|
||
// clear local storage after this event | ||
PileupSummaryStorage_.clear(); | ||
|
||
} | ||
|
||
} //edm |
71 changes: 71 additions & 0 deletions
71
trunk/SimGeneral/DataMixingModule/plugins/DataMixingPileupCopy.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#ifndef DataMixingPileupCopy_h | ||
#define SimDataMixingPileupCopy_h | ||
|
||
/** \class DataMixingPileupCopy | ||
* | ||
* DataMixingModule is the EDProducer subclass | ||
* that overlays rawdata events on top of MC, | ||
* using real data for pileup simulation | ||
* This class takes care of existing pileup information in the case of pre-mixing | ||
* | ||
* \author Mike Hildreth, University of Notre Dame | ||
* | ||
* \version 1st Version October 2007 | ||
* | ||
************************************************************/ | ||
|
||
#include "FWCore/Framework/interface/Event.h" | ||
#include "FWCore/Framework/interface/EventPrincipal.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
|
||
#include "DataFormats/Provenance/interface/ProductID.h" | ||
#include "DataFormats/Common/interface/Handle.h" | ||
|
||
#include "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h" | ||
#include "SimDataFormats/CrossingFrame/interface/CrossingFramePlaybackInfoExtended.h" | ||
|
||
#include <map> | ||
#include <vector> | ||
#include <string> | ||
|
||
|
||
namespace edm | ||
{ | ||
class DataMixingPileupCopy | ||
{ | ||
public: | ||
|
||
DataMixingPileupCopy(); | ||
|
||
/** standard constructor*/ | ||
explicit DataMixingPileupCopy(const edm::ParameterSet& ps); | ||
|
||
/**Default destructor*/ | ||
virtual ~DataMixingPileupCopy(); | ||
|
||
void putPileupInfo(edm::Event &e) ; | ||
void addPileupInfo(const edm::EventPrincipal*,unsigned int EventId); | ||
|
||
|
||
private: | ||
|
||
// data specifiers | ||
|
||
|
||
edm::InputTag PileupInfoInputTag_ ; // InputTag for PileupSummaryInfo | ||
edm::InputTag CFPlaybackInputTag_ ; // InputTag for CrossingFrame Playback information | ||
|
||
|
||
CrossingFramePlaybackInfoExtended CrossingFramePlaybackStorage_; | ||
|
||
std::vector<PileupSummaryInfo> PileupSummaryStorage_; | ||
|
||
|
||
// unsigned int eventId_; //=0 for signal, from 1-n for pileup events | ||
|
||
std::string label_; | ||
|
||
}; | ||
}//edm | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters