Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

74 x mixing additions merge 7893 7828 #7906

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion FastSimulation/PileUpProducer/plugins/PileUpProducer.cc
Expand Up @@ -266,8 +266,10 @@ void PileUpProducer::produce(edm::Event & iEvent, const edm::EventSetup & es)

std::vector<float> trueInteractionList;
trueInteractionList.push_back(truePUevts);

std::vector<edm::EventID> eventInfoList;

PileupMixing_ = std::auto_ptr< PileupMixingContent >(new PileupMixingContent(bunchCrossingList,numInteractionList,trueInteractionList,450)); // it shouldn't matter what the assumed bunchspacing is if there is no OOT PU. Add argument for compatibility.
PileupMixing_ = std::auto_ptr< PileupMixingContent >(new PileupMixingContent(bunchCrossingList,numInteractionList,trueInteractionList,eventInfoList,450)); // it shouldn't matter what the assumed bunchspacing is if there is no OOT PU. Add argument for compatibility.
iEvent.put(PileupMixing_);

// Get N events from random files
Expand Down
3 changes: 3 additions & 0 deletions SimDataFormats/PileupSummaryInfo/BuildFile.xml
@@ -1,5 +1,8 @@
<use name="DataFormats/Math"/>
<use name="DataFormats/Common"/>
<use name="DataFormats/Provenance"/>
<use name="SimDataFormats/GeneratorProducts"/>
<use name="clhep"/>
<use name="rootrflx"/>
<export>
<lib name="1"/>
Expand Down
Expand Up @@ -19,6 +19,7 @@ Usage: purely descriptive
#include <vector>
#include <string>
#include <iostream>
#include "DataFormats/Provenance/interface/EventID.h"

class PileupMixingContent {

Expand All @@ -29,7 +30,10 @@ class PileupMixingContent {
PileupMixingContent( std::vector<int>& bunchCrossing,
std::vector<int>& n_interactions,
std::vector<float>& True_interactions,
int bunchSpacing): bunchSpacing_(bunchSpacing)
std::vector<edm::EventID>& eventInfos,
int bunchSpacing):
eventInfos_(eventInfos),
bunchSpacing_(bunchSpacing)
{

bunchCrossing_.reserve(bunchCrossing.size());
Expand Down Expand Up @@ -63,12 +67,14 @@ class PileupMixingContent {
bunchCrossing_.clear();
n_interactions_.clear();
n_TrueInteractions_.clear();
eventInfos_.clear();
};

const std::vector<int>& getMix_Ninteractions() const { return n_interactions_; }
const std::vector<float>& getMix_TrueInteractions() const { return n_TrueInteractions_; }
const std::vector<int>& getMix_bunchCrossing() const { return bunchCrossing_; }
const int & getMix_bunchSpacing() const { return bunchSpacing_; }
const std::vector<edm::EventID> getMix_eventInfo() const {return eventInfos_;}

private:

Expand All @@ -78,6 +84,7 @@ class PileupMixingContent {
std::vector<int> bunchCrossing_;
std::vector<int> n_interactions_;
std::vector<float> n_TrueInteractions_;
std::vector<edm::EventID> eventInfos_;
int bunchSpacing_;

};
Expand Down
10 changes: 7 additions & 3 deletions SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h
Expand Up @@ -26,7 +26,7 @@ class PileupSummaryInfo {
public:

PileupSummaryInfo(){};

PileupSummaryInfo( const int num_PU_vertices,
std::vector<float>& zpositions,
std::vector<float>& sumpT_lowpT,
Expand All @@ -42,13 +42,14 @@ class PileupSummaryInfo {
std::vector<int>& ntrks_highpT,
int bunchCrossing);


PileupSummaryInfo( const int num_PU_vertices,
std::vector<float>& zpositions,
std::vector<float>& sumpT_lowpT,
std::vector<float>& sumpT_highpT,
std::vector<int>& ntrks_lowpT,
std::vector<int>& ntrks_highpT,
std::vector<edm::EventID>& eventInfo,
std::vector<float>& pT_hats,
int bunchCrossing,
float TrueNumInteractions,
int bunchSpacing);
Expand All @@ -68,6 +69,7 @@ class PileupSummaryInfo {
const std::vector<int>& getPU_ntrks_highpT() const { return ntrks_highpT_; }
const std::vector<float>& getPU_instLumi() const { return instLumi_; }
const std::vector<edm::EventID>& getPU_EventID() const { return eventInfo_; }
const std::vector<float>& getPU_pT_hats() const { return pT_hats_; }
const int getBunchCrossing() const { return bunchCrossing_;}
const int getBunchSpacing() const { return bunchSpacing_;}
const float getTrueNumInteractions() const { return TrueNumInteractions_;}
Expand All @@ -82,6 +84,8 @@ class PileupSummaryInfo {
std::vector<float> sumpT_highpT_;
std::vector<int> ntrks_lowpT_;
std::vector<int> ntrks_highpT_;
std::vector<edm::EventID> eventInfo_;
std::vector<float> pT_hats_;
int bunchCrossing_;
int bunchSpacing_;
float TrueNumInteractions_;
Expand All @@ -90,7 +94,7 @@ class PileupSummaryInfo {
// for DataMixer pileup, we only have raw information:

std::vector<float> instLumi_;
std::vector<edm::EventID> eventInfo_;


};

Expand Down
59 changes: 59 additions & 0 deletions SimDataFormats/PileupSummaryInfo/interface/PileupVertexContent.h
@@ -0,0 +1,59 @@
#ifndef PileupVertexContent_h
#define PileupVertexContent_h
// -*- C++ -*-
//
// Package: PileupVertexContent
// Class : PileupVertexContent
//
/**\class PileupVertexContent PileupVertexContent.h SimDataFormats/PileupVertexContent/interface/PileupVertexContent.h

Description: contains information related to the details of the pileup simulation for a given event, filled by Special "Digitizer" that has access to each pileup event
Usage: purely descriptive
*/
//
// Original Author: Mike Hildreth, Notre Dame
// Created: April 18, 2011
//
//

#include <vector>
#include <string>
#include <iostream>
#include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h"
#include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
#include "DataFormats/Math/interface/LorentzVector.h"

class PileupVertexContent {

public:

PileupVertexContent(){};

PileupVertexContent( std::vector<float>& pT_hat,
std::vector<float>& z_Vtx ):
pT_hats_(pT_hat),
z_Vtxs_(z_Vtx)
{ };




~PileupVertexContent(){
pT_hats_.clear();
z_Vtxs_.clear();
};

const std::vector<float>& getMix_pT_hats() const { return pT_hats_; }
const std::vector<float>& getMix_z_Vtxs() const { return z_Vtxs_; }

private:

// for "standard" pileup: we have MC Truth information for these


std::vector<float> pT_hats_;
std::vector<float> z_Vtxs_;

};

#endif
28 changes: 10 additions & 18 deletions SimDataFormats/PileupSummaryInfo/src/PileupSummaryInfo.cc
Expand Up @@ -12,7 +12,6 @@

#include "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h"


PileupSummaryInfo::PileupSummaryInfo( const int num_PU_vertices,
std::vector<float>& zpositions,
std::vector<float>& sumpT_lowpT,
Expand Down Expand Up @@ -80,33 +79,26 @@ PileupSummaryInfo::PileupSummaryInfo( const int num_PU_vertices,
std::vector<float>& sumpT_highpT,
std::vector<int>& ntrks_lowpT,
std::vector<int>& ntrks_highpT,
std::vector<edm::EventID>& eventInfo,
std::vector<float>& pThats,
int bunchCrossing,
float TrueNumInteractions,
int bunchSpacing)
int bunchSpacing):
zpositions_(zpositions),
sumpT_lowpT_(sumpT_lowpT),
sumpT_highpT_(sumpT_highpT),
ntrks_lowpT_(ntrks_lowpT),
ntrks_highpT_(ntrks_highpT),
eventInfo_(eventInfo),
pT_hats_(pThats)
{

num_PU_vertices_ = num_PU_vertices;
zpositions_.clear();
sumpT_lowpT_.clear();
sumpT_highpT_.clear();
ntrks_lowpT_.clear();
ntrks_highpT_.clear();
instLumi_.clear();
eventInfo_.clear();
bunchCrossing_ = bunchCrossing;
TrueNumInteractions_ = TrueNumInteractions;
bunchSpacing_ = bunchSpacing;

int NLoop = zpositions.size();

for( int ivtx = 0; ivtx<NLoop ; ++ivtx) {
zpositions_.push_back(zpositions[ivtx]);
sumpT_lowpT_.push_back(sumpT_lowpT[ivtx]);
sumpT_highpT_.push_back(sumpT_highpT[ivtx]);
ntrks_lowpT_.push_back(ntrks_lowpT[ivtx]);
ntrks_highpT_.push_back(ntrks_highpT[ivtx]);
}

}


Expand Down
5 changes: 5 additions & 0 deletions SimDataFormats/PileupSummaryInfo/src/classes.h
@@ -1,5 +1,6 @@
#include "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h"
#include "SimDataFormats/PileupSummaryInfo/interface/PileupMixingContent.h"
#include "SimDataFormats/PileupSummaryInfo/interface/PileupVertexContent.h"
#include "DataFormats/Common/interface/Wrapper.h"
#include <vector>

Expand All @@ -13,6 +14,10 @@ namespace SimDataFormats_PileupSummaryInfo {
std::vector<PileupMixingContent> dummy5;
edm::Wrapper<PileupMixingContent> dummy6;
edm::Wrapper<std::vector<PileupMixingContent> > dummy7;
PileupVertexContent dummy8;
std::vector<PileupVertexContent> dummy9;
edm::Wrapper<PileupVertexContent> dummy10;
edm::Wrapper<std::vector<PileupVertexContent> > dummy11;
};
}

Expand Down
12 changes: 10 additions & 2 deletions SimDataFormats/PileupSummaryInfo/src/classes_def.xml
@@ -1,14 +1,22 @@
<lcgdict>
<class name="PileupSummaryInfo" ClassVersion="11">
<class name="PileupSummaryInfo" ClassVersion="12">
<version ClassVersion="12" checksum="231481749"/>
<version ClassVersion="11" checksum="1526417022"/>
</class>
<class name="std::vector<PileupSummaryInfo>"/>
<class name="edm::Wrapper<PileupSummaryInfo>"/>
<class name="edm::Wrapper<std::vector<PileupSummaryInfo> >"/>
<class name="PileupMixingContent" ClassVersion="11">
<class name="PileupMixingContent" ClassVersion="12">
<version ClassVersion="11" checksum="468037571"/>
<version ClassVersion="12" checksum="624720677"/>
</class>
<class name="std::vector<PileupMixingContent>"/>
<class name="edm::Wrapper<PileupMixingContent>"/>
<class name="edm::Wrapper<std::vector<PileupMixingContent> >"/>
<class name="PileupVertexContent" ClassVersion="-1">
<version ClassVersion="-1" checksum="3263569137"/>
</class>
<class name="std::vector<PileupVertexContent>"/>
<class name="edm::Wrapper<PileupVertexContent>"/>
<class name="edm::Wrapper<std::vector<PileupVertexContent> >"/>
</lcgdict>
6 changes: 4 additions & 2 deletions SimGeneral/MixingModule/interface/DigiAccumulatorMixMod.h
Expand Up @@ -21,7 +21,7 @@
// system include files
#include <vector>
#include "SimDataFormats/PileupSummaryInfo/interface/PileupMixingContent.h"

#include "DataFormats/Provenance/interface/EventID.h"


// user include files
Expand Down Expand Up @@ -79,7 +79,9 @@ class DigiAccumulatorMixMod {

virtual void StorePileupInformation( std::vector<int> &numInteractionList,
std::vector<int> &bunchCrossingList,
std::vector<float> &TrueInteractionList, int bunchSpace){ }
std::vector<float> &TrueInteractionList,
std::vector<edm::EventID> &eventList,
int bunchSpace){ }

virtual PileupMixingContent* getEventPileupInfo() {
std::cout << " You must override the virtual functions in DigiAccumulatorMixMod in\n" << "order to access PileupInformation. Returning empty object." << std::endl;
Expand Down
10 changes: 9 additions & 1 deletion SimGeneral/MixingModule/plugins/MixingModule.cc
Expand Up @@ -361,6 +361,7 @@ namespace edm {
//}

int KeepTrackOfPileup = 0;
std::vector<edm::EventID> eventInfoList;

for (int bunchIdx = minBunch_; bunchIdx <= maxBunch_; ++bunchIdx) {
for (size_t setBcrIdx=0; setBcrIdx<workers_.size(); ++setBcrIdx) {
Expand Down Expand Up @@ -399,6 +400,10 @@ namespace edm {
_2, vertexOffset, std::ref(setup), e.streamID()), NumPU_Events, e.streamID()
);
playbackInfo_->setStartEventId(recordEventID, readSrcIdx, bunchIdx, KeepTrackOfPileup);
const std::vector<edm::EventID>& playEventID =
playbackInfo_->getStartEventId(readSrcIdx, bunchIdx);
for ( unsigned int pu=0; pu<playEventID.size(); pu++ ) { eventInfoList.push_back(playEventID[pu]); }

KeepTrackOfPileup+=NumPU_Events;
} else {
const std::vector<edm::EventID>& playEventID =
Expand All @@ -413,7 +418,8 @@ namespace edm {
_2, vertexOffset, std::ref(setup), e.streamID())
);
(*playbackInfo_)=(*playbackInfo_H);
}
for ( unsigned int pu=0; pu<playEventID.size(); pu++ ) eventInfoList.push_back(playEventID[pu]);
}
}
for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
(*accItr)->finalizeBunchCrossing(e, setup, bunchIdx);
Expand Down Expand Up @@ -445,13 +451,15 @@ namespace edm {
(*accItr)->StorePileupInformation( bunchCrossingList,
numInteractionList,
TrueInteractionList,
eventInfoList,
bunchSpace_);
}


PileupMixing_ = std::auto_ptr<PileupMixingContent>(new PileupMixingContent(bunchCrossingList,
numInteractionList,
TrueInteractionList,
eventInfoList,
bunchSpace_));

e.put(PileupMixing_);
Expand Down
7 changes: 7 additions & 0 deletions SimGeneral/MixingModule/python/digi_MixPreMix_cfi.py
Expand Up @@ -6,6 +6,7 @@
from SimGeneral.MixingModule.stripDigitizer_cfi import *
#from SimGeneral.MixingModule.ecalDigitizer_cfi import *
#from SimGeneral.MixingModule.hcalDigitizer_cfi import *
from SimGeneral.MixingModule.pileupVtxDigitizer_cfi import *
from SimGeneral.MixingModule.castorDigitizer_cfi import *
from SimGeneral.MixingModule.trackingTruthProducer_cfi import *

Expand All @@ -18,6 +19,9 @@
),
castor = cms.PSet(
castorDigitizer
),
puVtx = cms.PSet(
pileupVtxDigitizer
)
)

Expand All @@ -31,6 +35,9 @@
castor = cms.PSet(
castorDigitizer
),
puVtx = cms.PSet(
pileupVtxDigitizer
),
mergedtruth = cms.PSet(
trackingParticles
)
Expand Down
4 changes: 4 additions & 0 deletions SimGeneral/MixingModule/python/digi_noNoise_cfi.py
Expand Up @@ -7,6 +7,7 @@
from SimGeneral.MixingModule.ecalDigitizer_cfi import *
from SimGeneral.MixingModule.hcalDigitizer_cfi import *
from SimGeneral.MixingModule.castorDigitizer_cfi import *
from SimGeneral.MixingModule.pileupVtxDigitizer_cfi import *
from SimGeneral.MixingModule.trackingTruthProducer_cfi import *

theDigitizersNoNoise = cms.PSet(
Expand All @@ -24,6 +25,9 @@
),
castor = cms.PSet(
castorDigitizer
),
puVtx = cms.PSet(
pileupVtxDigitizer
)
)

Expand Down