Classes | |
struct | calo_particles |
struct | OutputCollections |
Public Member Functions | |
CaloTruthAccumulator (const edm::ParameterSet &config, edm::ProducesCollector, edm::ConsumesCollector &iC) | |
Public Member Functions inherited from DigiAccumulatorMixMod | |
virtual void | beginRun (edm::Run const &run, edm::EventSetup const &setup) |
DigiAccumulatorMixMod () | |
virtual void | endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) |
virtual void | endRun (edm::Run const &run, edm::EventSetup const &setup) |
virtual void | finalizeBunchCrossing (edm::Event &event, edm::EventSetup const &setup, int bunchCrossing) |
virtual PileupMixingContent * | getEventPileupInfo () |
virtual void | initializeBunchCrossing (edm::Event const &event, edm::EventSetup const &setup, int bunchCrossing) |
virtual void | StorePileupInformation (std::vector< int > &numInteractionList, std::vector< int > &bunchCrossingList, std::vector< float > &TrueInteractionList, std::vector< edm::EventID > &eventList, int bunchSpace) |
virtual | ~DigiAccumulatorMixMod () |
Private Member Functions | |
void | accumulate (const edm::Event &event, const edm::EventSetup &setup) override |
void | accumulate (const PileUpEventPrincipal &event, const edm::EventSetup &setup, edm::StreamID const &) override |
template<class T > | |
void | accumulateEvent (const T &event, const edm::EventSetup &setup, const edm::Handle< edm::HepMCProduct > &hepMCproduct) |
Both forms of accumulate() delegate to this templated method. More... | |
void | beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override |
template<class T > | |
void | fillSimHits (std::vector< std::pair< DetId, const PCaloHit * >> &returnValue, std::unordered_map< int, std::map< int, float >> &simTrackDetIdEnergyMap, const T &event, const edm::EventSetup &setup) |
Fills the supplied vector with pointers to the SimHits, checking for bad modules if required. More... | |
void | finalizeEvent (edm::Event &event, const edm::EventSetup &setup) override |
void | initializeEvent (const edm::Event &event, const edm::EventSetup &setup) override |
Private Attributes | |
std::vector< edm::InputTag > | collectionTags_ |
bool | doHGCAL |
edm::InputTag | genParticleLabel_ |
int | geometryType_ |
const HcalDDDRecConstants * | hcddd_ = nullptr |
edm::InputTag | hepMCproductLabel_ |
Needed to add HepMC::GenVertex to SimVertex. More... | |
const HGCalDDDConstants * | hgddd_ [3] = {nullptr, nullptr, nullptr} |
const HGCalTopology * | hgtopo_ [3] = {nullptr, nullptr, nullptr} |
edm::Handle< std::vector< SimTrack > > | hSimTracks |
edm::Handle< std::vector< SimVertex > > | hSimVertices |
calo_particles | m_caloParticles |
std::unordered_map< Index_t, float > | m_detIdToTotalSimEnergy |
std::unordered_multimap< Barcode_t, Index_t > | m_simHitBarcodeToIndex |
const unsigned int | maximumPreviousBunchCrossing_ |
const unsigned int | maximumSubsequentBunchCrossing_ |
const double | maxPseudoRapidity_ |
const std::string | messageCategory_ |
const double | minEnergy_ |
OutputCollections | output_ |
const bool | premixStage1_ |
const edm::InputTag | simTrackLabel_ |
const edm::InputTag | simVertexLabel_ |
Definition at line 124 of file CaloTruthAccumulator.cc.
|
explicit |
Definition at line 358 of file CaloTruthAccumulator.cc.
References collectionTags_, edm::ConsumesCollector::consumes(), genParticleLabel_, hepMCproductLabel_, premixStage1_, edm::ProducesCollector::produces(), simTrackLabel_, simVertexLabel_, and triggerMatcherToHLTDebug_cfi::tags.
|
overrideprivatevirtual |
Create handle to edm::HepMCProduct here because event.getByLabel with edm::HepMCProduct only works for edm::Event but not for PileUpEventPrincipal; PileUpEventPrincipal::getByLabel tries to call T::value_type and T::iterator (where T is the type of the object one wants to get a handle to) which is only implemented for container-like objects like std::vector but not for edm::HepMCProduct!
Implements DigiAccumulatorMixMod.
Definition at line 453 of file CaloTruthAccumulator.cc.
References accumulateEvent(), hepMCproductLabel_, messageCategory_, and singleTopDQM_cfi::setup.
|
overrideprivatevirtual |
Implements DigiAccumulatorMixMod.
Definition at line 461 of file CaloTruthAccumulator.cc.
References accumulateEvent(), maximumPreviousBunchCrossing_, maximumSubsequentBunchCrossing_, messageCategory_, and singleTopDQM_cfi::setup.
|
private |
Both forms of accumulate() delegate to this templated method.
Build the main decay graph and assign the SimTrack to each edge. The graph built here will only contain the particles that have a decay vertex associated to them. In order to recover also the particles that will not decay, we need to keep track of the SimTrack used here and add, a-posteriori, the ones not used, associating a ghost vertex (starting from the highest simulated vertex number), in order to build the edge and identify them immediately as stable (i.e. not decayed).
To take into account the multi-bremsstrahlung effects in which a single particle is emitting photons in different vertices keeping the same track index, we also collapsed those vertices into 1 unique vertex. The other approach of fully representing the decay chain keeping the same track index would have the problem of over-counting the contributions of that track, especially in terms of hits.
The 2 auxiliary vectors are structured as follow:
Definition at line 531 of file CaloTruthAccumulator.cc.
References funct::abs(), gather_cfg::cout, EdgeProperty::cumulative_simHits, DEBUG, PA_ZEESkim_cff::decay, fillSimHits(), genParticleLabel_, get, hSimTracks, hSimVertices, mps_fire::i, charmTagsComputerCvsB_cfi::idx, IfLogDebug, m_caloParticles, m_simHitBarcodeToIndex, maxPseudoRapidity_, messageCategory_, minEnergy_, CoreSimTrack::momentum(), SimTrack::noGenpart(), hltrates_dqm_sourceclient-live_cfg::offset, output_, put(), edm::second(), singleTopDQM_cfi::setup, EdgeProperty::simTrack, simTrackLabel_, simVertexLabel_, findQualityFiles::size, OrderedSet::t, PDWG_EXOHSCP_cff::tracks, findQualityFiles::v, pwdgSkimBPark_cfi::vertices, and runTauDisplay::vis.
Referenced by accumulate().
|
overrideprivatevirtual |
Reimplemented from DigiAccumulatorMixMod.
Definition at line 400 of file CaloTruthAccumulator.cc.
References HGCalTopology::dddConstants(), HcalTopology::dddConstants(), doHGCAL, EcalMappingRecord_cfi::eegeom, DetId::Forward, ForwardEmpty, relativeConstraints::geom, geometryType_, edm::EventSetup::get(), get, DetId::Hcal, HcalEndcap, hcddd_, DetId::HGCalEE, DetId::HGCalHSc, DetId::HGCalHSi, HGCEE, HGCHEF, hgddd_, hgtopo_, mps_fire::i, and HcalGeometry::topology().
|
private |
Fills the supplied vector with pointers to the SimHits, checking for bad modules if required.
Definition at line 673 of file CaloTruthAccumulator.cc.
References collectionTags_, doHGCAL, geometryType_, HcalEndcap, hcddd_, hgddd_, hgtopo_, triggerObjects_cff::id, m_detIdToTotalSimEnergy, HcalHitRelabeller::relabel(), fileinputsource_cfi::sec, rpcPointValidation_cfi::simHit, HGCalDDDConstants::simToReco(), HcalDetId::subdet(), and HGCalTestNumbering::unpackHexagonIndex().
Referenced by accumulateEvent().
|
overrideprivatevirtual |
Implements DigiAccumulatorMixMod.
Definition at line 476 of file CaloTruthAccumulator.cc.
References filterCSVwithJSON::copy, CommonMethods::cp(), HLT_2018_cff::fraction, mps_fire::i, dqmiolumiharvest::j, m_caloParticles, m_detIdToTotalSimEnergy, m_simHitBarcodeToIndex, messageCategory_, eostools::move(), output_, CaloTruthAccumulator::OutputCollections::pCaloParticles, premixStage1_, CaloTruthAccumulator::OutputCollections::pSimClusters, CaloTruthAccumulator::calo_particles::sc_start_, CaloTruthAccumulator::calo_particles::sc_stop_, and CaloTruthAccumulator::calo_particles::swap().
|
overrideprivatevirtual |
Implements DigiAccumulatorMixMod.
Definition at line 439 of file CaloTruthAccumulator.cc.
References m_detIdToTotalSimEnergy, output_, CaloTruthAccumulator::OutputCollections::pCaloParticles, and CaloTruthAccumulator::OutputCollections::pSimClusters.
|
private |
Definition at line 172 of file CaloTruthAccumulator.cc.
Referenced by CaloTruthAccumulator(), and fillSimHits().
|
private |
Definition at line 209 of file CaloTruthAccumulator.cc.
Referenced by beginLuminosityBlock(), and fillSimHits().
|
private |
Definition at line 173 of file CaloTruthAccumulator.cc.
Referenced by accumulateEvent(), and CaloTruthAccumulator().
|
private |
Definition at line 208 of file CaloTruthAccumulator.cc.
Referenced by beginLuminosityBlock(), and fillSimHits().
|
private |
Definition at line 204 of file CaloTruthAccumulator.cc.
Referenced by beginLuminosityBlock(), and fillSimHits().
|
private |
Needed to add HepMC::GenVertex to SimVertex.
Definition at line 175 of file CaloTruthAccumulator.cc.
Referenced by accumulate(), and CaloTruthAccumulator().
|
private |
Definition at line 203 of file CaloTruthAccumulator.cc.
Referenced by beginLuminosityBlock(), and fillSimHits().
|
private |
Definition at line 202 of file CaloTruthAccumulator.cc.
Referenced by beginLuminosityBlock(), and fillSimHits().
|
private |
Definition at line 169 of file CaloTruthAccumulator.cc.
Referenced by accumulateEvent().
|
private |
Definition at line 170 of file CaloTruthAccumulator.cc.
Referenced by accumulateEvent().
|
private |
Definition at line 206 of file CaloTruthAccumulator.cc.
Referenced by accumulateEvent(), and finalizeEvent().
|
private |
Definition at line 151 of file CaloTruthAccumulator.cc.
Referenced by fillSimHits(), finalizeEvent(), and initializeEvent().
|
private |
Definition at line 152 of file CaloTruthAccumulator.cc.
Referenced by accumulateEvent(), and finalizeEvent().
|
private |
The maximum bunch crossing BEFORE the signal crossing to create TrackinParticles for. Use positive values. If set to zero no previous bunches are added and only in-time, signal and after bunches (defined by maximumSubsequentBunchCrossing_) are used.
Definition at line 159 of file CaloTruthAccumulator.cc.
Referenced by accumulate().
|
private |
The maximum bunch crossing AFTER the signal crossing to create TrackinParticles for. E.g. if set to zero only uses the signal and in time pileup (and previous bunches defined by the maximumPreviousBunchCrossing_ parameter).
Definition at line 165 of file CaloTruthAccumulator.cc.
Referenced by accumulate().
|
private |
Definition at line 177 of file CaloTruthAccumulator.cc.
Referenced by accumulateEvent().
|
private |
Definition at line 149 of file CaloTruthAccumulator.cc.
Referenced by accumulate(), accumulateEvent(), and finalizeEvent().
|
private |
Definition at line 177 of file CaloTruthAccumulator.cc.
Referenced by accumulateEvent().
|
private |
Definition at line 205 of file CaloTruthAccumulator.cc.
Referenced by accumulateEvent(), finalizeEvent(), and initializeEvent().
|
private |
Definition at line 178 of file CaloTruthAccumulator.cc.
Referenced by CaloTruthAccumulator(), and finalizeEvent().
|
private |
Definition at line 167 of file CaloTruthAccumulator.cc.
Referenced by accumulateEvent(), and CaloTruthAccumulator().
|
private |
Definition at line 168 of file CaloTruthAccumulator.cc.
Referenced by accumulateEvent(), and CaloTruthAccumulator().