Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
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
Show file tree
Hide file tree
Showing 7 changed files with 237 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/vhbbHeppy74X: 763c6875d74733f316c0c1dc27a12f89704442e8
refs/heads/vhbbHeppy74X: 985977830e8a10ce5697523e40274fd284cd3e85
2 changes: 2 additions & 0 deletions trunk/SimGeneral/DataMixingModule/plugins/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
<use name="SimCalorimetry/CaloSimAlgos"/>
<use name="SimCalorimetry/HcalSimAlgos"/>
<use name="SimCalorimetry/HcalSimProducers"/>
<use name="SimDataFormats/PileupSummaryInfo"/>
<use name="SimDataFormats/CrossingFrame"/>
<library file="*.cc" name="SimGeneralDataMixingModulePlugins">
<flags EDM_PLUGIN="1"/>
</library>
31 changes: 31 additions & 0 deletions trunk/SimGeneral/DataMixingModule/plugins/DataMixingModule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,17 @@ namespace edm

}

// Pileup Information: if doing pre-mixing, we have to save the pileup information from the Secondary stream

MergePileup_ = ps.getParameter<bool>("MergePileupInfo");

if(MergePileup_) {
produces< std::vector<PileupSummaryInfo> >();
produces<CrossingFramePlaybackInfoExtended>();

PUWorker_ = new DataMixingPileupCopy(ps);
}

}

void DataMixingModule::getSubdetectorNames() {
Expand Down Expand Up @@ -274,6 +285,7 @@ namespace edm
delete SiStripWorker_;
delete SiPixelWorker_;
}
if(MergePileup_) { delete PUWorker_;}
}

void DataMixingModule::addSignals(const edm::Event &e, const edm::EventSetup& ES) {
Expand Down Expand Up @@ -309,6 +321,8 @@ namespace edm
// SiPixels
SiPixelWorker_->addSiPixelSignals(e);
}
AddedPileup_ = false;

} // end of addSignals


Expand Down Expand Up @@ -349,6 +363,18 @@ namespace edm
// SiPixels
SiPixelWorker_->addSiPixelPileups(bcr, &ep, eventNr);
}

// check and see if we need to copy the pileup information from
// secondary stream to the output stream
// We only have the pileup event here, so pick the first time and store the info

if(MergePileup_ && !AddedPileup_){

PUWorker_->addPileupInfo(&ep, eventNr);

AddedPileup_ = true;
}

}


Expand Down Expand Up @@ -386,6 +412,7 @@ namespace edm
);
}
}

}


Expand Down Expand Up @@ -421,6 +448,10 @@ namespace edm
// SiPixels
SiPixelWorker_->putSiPixel(e);
}

if(MergePileup_) { PUWorker_->putPileupInfo(e);}


}


Expand Down
9 changes: 9 additions & 0 deletions trunk/SimGeneral/DataMixingModule/plugins/DataMixingModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
#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 "SimGeneral/DataMixingModule/plugins/DataMixingEMWorker.h"
#include "SimGeneral/DataMixingModule/plugins/DataMixingHcalWorker.h"
#include "SimGeneral/DataMixingModule/plugins/DataMixingEMDigiWorker.h"
Expand All @@ -31,6 +34,7 @@
#include "SimGeneral/DataMixingModule/plugins/DataMixingSiStripRawWorker.h"
#include "SimGeneral/DataMixingModule/plugins/DataMixingSiPixelWorker.h"
#include "SimGeneral/DataMixingModule/plugins/DataMixingGeneralTrackWorker.h"
#include "SimGeneral/DataMixingModule/plugins/DataMixingPileupCopy.h"

#include <map>
#include <vector>
Expand Down Expand Up @@ -110,6 +114,8 @@ namespace edm

// Submodules to handle the individual detectors

DataMixingPileupCopy *PUWorker_;

DataMixingEMWorker *EMWorker_ ;
DataMixingEMDigiWorker *EMDigiWorker_ ;
bool MergeEMDigis_;
Expand All @@ -123,6 +129,9 @@ namespace edm
bool MergeHcalDigis_;
bool MergeHcalDigisProd_;

bool MergePileup_;
bool AddedPileup_;

// Muons

DataMixingMuonWorker *MuonWorker_ ;
Expand Down
108 changes: 108 additions & 0 deletions trunk/SimGeneral/DataMixingModule/plugins/DataMixingPileupCopy.cc
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 trunk/SimGeneral/DataMixingModule/plugins/DataMixingPileupCopy.h
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
24 changes: 15 additions & 9 deletions trunk/SimGeneral/DataMixingModule/python/mixOne_sim_on_sim_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,19 @@
mixProdStep1 = cms.bool(False),
mixProdStep2 = cms.bool(False),
IsThisFastSim = cms.string('NO'), # kludge for fast simulation flag...
# Merge Pileup Info?
MergePileupInfo = cms.bool(True),
# Use digis?
EcalMergeType = cms.string('Digis'), # set to "Digis" to merge digis
HcalMergeType = cms.string('Digis'),
HcalDigiMerge = cms.string('FullProd'), #use sim hits for signal
HcalDigiMerge = cms.string('NotProd'), #use sim hits for signal
#
# Input Specifications:
#

PileupInfoInputTag = cms.InputTag("addPileupInfo"),
CFPlaybackInputTag = cms.InputTag("mix"),
#
SistripLabelSig = cms.InputTag("simSiStripDigis","ZeroSuppressed"),
#
pixeldigiCollectionSig = cms.InputTag("simSiPixelDigis"),
Expand Down Expand Up @@ -66,7 +72,7 @@

EBdigiProducerSig = cms.InputTag("simEcalUnsuppressedDigis"),
EEdigiProducerSig = cms.InputTag("simEcalUnsuppressedDigis"),
ESdigiProducerSig = cms.InputTag("simEcalUnsuppressedDigis"),
ESdigiProducerSig = cms.InputTag("simEcalPreshowerDigis"),
HBHEdigiCollectionSig = cms.InputTag("simHcalUnsuppressedDigis"),
HOdigiCollectionSig = cms.InputTag("simHcalUnsuppressedDigis"),
HFdigiCollectionSig = cms.InputTag("simHcalUnsuppressedDigis"),
Expand All @@ -75,11 +81,11 @@
#
EBPileInputTag = cms.InputTag("simEcalUnsuppressedDigis",""),
EEPileInputTag = cms.InputTag("simEcalUnsuppressedDigis",""),
ESPileInputTag = cms.InputTag("simEcalUnsuppressedDigis",""),
HBHEPileInputTag = cms.InputTag("simHcalUnsuppressedDigis"),
HOPileInputTag = cms.InputTag("simHcalUnsuppressedDigis"),
HFPileInputTag = cms.InputTag("simHcalUnsuppressedDigis"),
ZDCPileInputTag = cms.InputTag("simHcalUnsuppressedDigis"),
ESPileInputTag = cms.InputTag("simEcalPreshowerDigis",""),
HBHEPileInputTag = cms.InputTag("simHcalDigis"),
HOPileInputTag = cms.InputTag("simHcalDigis"),
HFPileInputTag = cms.InputTag("simHcalDigis"),
ZDCPileInputTag = cms.InputTag(""),

# Signal
#
Expand All @@ -92,8 +98,8 @@
DTdigiCollectionSig = cms.InputTag("simMuonDTDigis"),
# Pileup
#
DTPileInputTag = cms.InputTag("simMuonDTDigis","MuonDTDigis"),
RPCPileInputTag = cms.InputTag("simMuonRPCDigis","MuonRPCDigis"),
DTPileInputTag = cms.InputTag("simMuonDTDigis",""),
RPCPileInputTag = cms.InputTag("simMuonRPCDigis",""),
CSCWirePileInputTag = cms.InputTag("simMuonCSCDigis","MuonCSCWireDigi"),
CSCStripPileInputTag = cms.InputTag("simMuonCSCDigis","MuonCSCStripDigi"),
CSCCompPileInputTag = cms.InputTag("simMuonCSCDigis","MuonCSCComparatorDigi"),
Expand Down

0 comments on commit df2829a

Please sign in to comment.