CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
CaloTruthAccumulator Class Reference

#include <CaloTruthAccumulator.h>

Inheritance diagram for CaloTruthAccumulator:
DigiAccumulatorMixMod

Classes

struct  calo_particles
 
struct  OutputCollections
 When counting hits, allows hits in different detectors to have a different process type. More...
 

Public Member Functions

 CaloTruthAccumulator (const edm::ParameterSet &config, edm::stream::EDProducerBase &mixMod, edm::ConsumesCollector &iC)
 
- Public Member Functions inherited from DigiAccumulatorMixMod
virtual void accumulate (edm::Event const &event, edm::EventSetup const &setup)=0
 
virtual void accumulate (PileUpEventPrincipal const &event, edm::EventSetup const &setup, edm::StreamID const &)=0
 
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 void finalizeEvent (edm::Event &event, edm::EventSetup const &setup)=0
 
virtual PileupMixingContentgetEventPileupInfo ()
 
virtual void initializeBunchCrossing (edm::Event const &event, edm::EventSetup const &setup, int bunchCrossing)
 
virtual void initializeEvent (edm::Event const &event, edm::EventSetup const &setup)=0
 
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

virtual void accumulate (const edm::Event &event, const edm::EventSetup &setup) override
 
virtual 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...
 
std::unique_ptr< SimHitInfoPerSimTrack_tallAttachedSimHitInfo (Barcode_t st, const std::vector< std::pair< DetId, const PCaloHit * > > &hits, bool markUsed=false)
 
std::unique_ptr< SimHitInfoPerSimTrack_tattachedSimHitInfo (Barcode_t st, const std::vector< std::pair< DetId, const PCaloHit * > > &hits, bool includeOwn=true, bool includeOther=false, bool markUsed=false)
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
 
bool consideredBarcode (Barcode_t barcode)
 
std::unique_ptr< SimHitInfoPerSimTrack_tdescendantOnlySimHitInfo (Barcode_t st, const std::vector< std::pair< DetId, const PCaloHit * > > &hits, bool markUsed=false)
 
SimClusterCollection descendantSimClusters (Barcode_t barcode, const std::vector< std::pair< DetId, const PCaloHit * > > &hits)
 
std::vector< Barcode_tdescendantTrackBarcodes (Barcode_t barcode)
 
template<class T >
void fillSimHits (std::vector< std::pair< DetId, const PCaloHit * > > &returnValue, const T &event, const edm::EventSetup &setup)
 Fills the supplied vector with pointers to the SimHits, checking for bad modules if required. More...
 
virtual void finalizeEvent (edm::Event &event, const edm::EventSetup &setup) override
 
virtual void initializeEvent (const edm::Event &event, const edm::EventSetup &setup) override
 
void setConsideredBarcode (Barcode_t barcode)
 

Private Attributes

bool barcodeLogicWarningAlready_
 
double caloStartZ
 
bool chargedOnly_
 Uses the same config as selector_, but can be used to drop out early since selector_ requires the TrackingParticle to be created first. More...
 
std::vector< edm::InputTagcollectionTags_
 
edm::InputTag genParticleLabel_
 
const HcalDDDRecConstantshcddd_
 
edm::InputTag hepMCproductLabel_
 Needed to add HepMC::GenVertex to SimVertex. More...
 
const HGCalDDDConstantshgddd_ [2]
 
const HGCalTopologyhgtopo_ [2]
 
edm::Handle< std::vector< SimTrack > > hSimTracks
 
edm::Handle< std::vector< SimVertex > > hSimVertices
 
calo_particles m_caloParticles
 
std::unordered_multimap< Index_t, Index_tm_detIdToCluster
 
std::unordered_map< Index_t, float > m_detIdToTotalSimEnergy
 
std::unordered_map< Barcode_t, Index_tm_genBarcodeToSimTrackIndex
 
std::unordered_map< Barcode_t, Index_tm_genParticleBarcodeToIndex
 
std::unordered_multimap< Barcode_t, Index_tm_simHitBarcodeToIndex
 
std::unordered_map< Barcode_t, Index_tm_simTrackBarcodeToIndex
 
std::unordered_map< Barcode_t, Barcode_tm_simTrackBarcodeToSimVertexParentBarcode
 
std::set< Barcode_tm_simTracksConsideredForSimClusters
 
std::unordered_multimap< Barcode_t, Index_tm_simTrackToSimVertex
 
std::vector< Barcode_tm_simVertexBarcodes
 
std::unordered_map< Barcode_t, Index_tm_simVertexBarcodeToIndex
 
std::unordered_multimap< Barcode_t, Barcode_tm_simVertexBarcodeToSimTrackBarcode
 
std::unordered_multimap< Barcode_t, Index_tm_simVertexToSimTrackParent
 
const unsigned int maximumPreviousBunchCrossing_
 maximum distance for HepMC::GenVertex to be added to SimVertex More...
 
const unsigned int maximumSubsequentBunchCrossing_
 
const double maxPseudoRapidity_
 
const std::string messageCategory_
 The message category used to send messages to MessageLogger. More...
 
const double minEnergy_
 
OutputCollections output_
 
bool selectorFlag_
 
bool signalOnly_
 Uses the same config as selector_, but can be used to drop out early since selector_ requires the TrackingParticle to be created first. More...
 
const edm::InputTag simTrackLabel_
 If bremsstrahlung merging, whether to also add the unmerged collection to the event or not. More...
 
const edm::InputTag simVertexLabel_
 

Detailed Description

Definition at line 44 of file CaloTruthAccumulator.h.

Constructor & Destructor Documentation

CaloTruthAccumulator::CaloTruthAccumulator ( const edm::ParameterSet config,
edm::stream::EDProducerBase mixMod,
edm::ConsumesCollector iC 
)
explicit

Definition at line 39 of file CaloTruthAccumulator.cc.

References barcodeLogicWarningAlready_, collectionTags_, edm::ConsumesCollector::consumes(), genParticleLabel_, edm::ParameterSet::getParameterNames(), edm::ParameterSet::getParameterSet(), hepMCproductLabel_, simTrackLabel_, and simVertexLabel_.

39  :
40  messageCategory_("CaloTruthAccumulator"),
41  maximumPreviousBunchCrossing_( config.getParameter<unsigned int>("maximumPreviousBunchCrossing") ),
42  maximumSubsequentBunchCrossing_( config.getParameter<unsigned int>("maximumSubsequentBunchCrossing") ),
43  simTrackLabel_( config.getParameter<edm::InputTag>("simTrackCollection") ),
44  simVertexLabel_( config.getParameter<edm::InputTag>("simVertexCollection") ),
45  collectionTags_( ),
46  genParticleLabel_( config.getParameter<edm::InputTag>("genParticleCollection") ),
47  hepMCproductLabel_( config.getParameter<edm::InputTag>("HepMCProductLabel") ),
48  minEnergy_( config.getParameter<double>("MinEnergy") ),
49  maxPseudoRapidity_( config.getParameter<double>("MaxPseudoRapidity") )
50 {
52 
53  mixMod.produces<SimClusterCollection>("MergedCaloTruth");
54  mixMod.produces<CaloParticleCollection>("MergedCaloTruth");
55 
56  iC.consumes<std::vector<SimTrack> >(simTrackLabel_);
57  iC.consumes<std::vector<SimVertex> >(simVertexLabel_);
58  iC.consumes<std::vector<reco::GenParticle> >(genParticleLabel_);
59  iC.consumes<std::vector<int> >(genParticleLabel_);
60  iC.consumes<std::vector<int> >(hepMCproductLabel_);
61 
62  // Fill the collection tags
63  const edm::ParameterSet& simHitCollectionConfig=config.getParameterSet("simHitCollections");
64  std::vector<std::string> parameterNames=simHitCollectionConfig.getParameterNames();
65 
66  for( const auto& parameterName : parameterNames )
67  {
68  std::vector<edm::InputTag> tags=simHitCollectionConfig.getParameter<std::vector<edm::InputTag> >(parameterName);
69  collectionTags_.insert(collectionTags_.end(), tags.begin(), tags.end());
70  }
71 
72  for( const auto& collectionTag : collectionTags_ ) {
73  iC.consumes<std::vector<PCaloHit> >(collectionTag);
74  }
75 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
const unsigned int maximumSubsequentBunchCrossing_
std::vector< edm::InputTag > collectionTags_
edm::InputTag hepMCproductLabel_
Needed to add HepMC::GenVertex to SimVertex.
const std::string messageCategory_
The message category used to send messages to MessageLogger.
const edm::InputTag simVertexLabel_
std::vector< std::string > getParameterNames() const
const edm::InputTag simTrackLabel_
If bremsstrahlung merging, whether to also add the unmerged collection to the event or not...
ParameterSet const & getParameterSet(std::string const &) const
std::vector< CaloParticle > CaloParticleCollection
std::vector< SimCluster > SimClusterCollection
Definition: SimClusterFwd.h:8
const unsigned int maximumPreviousBunchCrossing_
maximum distance for HepMC::GenVertex to be added to SimVertex

Member Function Documentation

virtual void CaloTruthAccumulator::accumulate ( const edm::Event event,
const edm::EventSetup setup 
)
overrideprivatevirtual

Referenced by initializeEvent().

virtual void CaloTruthAccumulator::accumulate ( const PileUpEventPrincipal event,
const edm::EventSetup setup,
edm::StreamID const &   
)
overrideprivatevirtual
template<class T >
void CaloTruthAccumulator::accumulateEvent ( const T event,
const edm::EventSetup setup,
const edm::Handle< edm::HepMCProduct > &  hepMCproduct 
)
private

Both forms of accumulate() delegate to this templated method.

Definition at line 188 of file CaloTruthAccumulator.cc.

References funct::abs(), descendantSimClusters(), reco::tau::disc::Eta(), fillSimHits(), genParticleLabel_, hSimTracks, hSimVertices, mps_fire::i, edm::HandleBase::isValid(), m_caloParticles, m_genBarcodeToSimTrackIndex, m_genParticleBarcodeToIndex, m_simHitBarcodeToIndex, m_simTrackBarcodeToIndex, m_simTrackBarcodeToSimVertexParentBarcode, m_simTracksConsideredForSimClusters, m_simTrackToSimVertex, m_simVertexBarcodes, m_simVertexBarcodeToIndex, m_simVertexBarcodeToSimTrackBarcode, m_simVertexToSimTrackParent, maxPseudoRapidity_, minEnergy_, output_, CaloTruthAccumulator::OutputCollections::pCaloParticles, CaloTruthAccumulator::OutputCollections::pSimClusters, CaloTruthAccumulator::calo_particles::sc_start_, CaloTruthAccumulator::calo_particles::sc_stop_, edm::second(), simTrackLabel_, tkConvValidator_cfi::simTracks, simVertexLabel_, and groupFilesInBlocks::temp.

Referenced by initializeEvent().

190  {
191  //
192  // Get the collections
193  //
194 
196  edm::Handle< std::vector<int> > hGenParticleIndices;
197 
198  event.getByLabel( simTrackLabel_, hSimTracks );
199  event.getByLabel( simVertexLabel_, hSimVertices );
200 
201  event.getByLabel( genParticleLabel_, hGenParticles );
202  event.getByLabel( genParticleLabel_, hGenParticleIndices );
203 
204  std::vector<std::pair<DetId,const PCaloHit*> > simHitPointers;
205  fillSimHits( simHitPointers, event, setup );
206 
207  // Clear maps from previous event fill them for this one
208  m_simHitBarcodeToIndex.clear();
210  for (unsigned int i = 0 ; i < simHitPointers.size(); ++i) {
211  m_simHitBarcodeToIndex.emplace(simHitPointers[i].second->geantTrackId(),i);
212  }
214  if( hGenParticles.isValid() && hGenParticleIndices.isValid() ) {
215  for (unsigned int i = 0 ; i < hGenParticles->size() ; ++i) {
216  m_genParticleBarcodeToIndex.emplace(hGenParticleIndices->at(i),i);
217  }
218  }
222  m_simTrackBarcodeToIndex.clear();
223  for (unsigned int i = 0 ; i < hSimTracks->size() ; i++) {
224  if( !hSimTracks->at(i).noGenpart() ) {
225  m_genBarcodeToSimTrackIndex.emplace(hSimTracks->at(i).genpartIndex(), i);
226  }
227  if( !hSimTracks->at(i).noVertex() ) {
228  m_simVertexBarcodeToSimTrackBarcode.emplace(hSimTracks->at(i).vertIndex(), hSimTracks->at(i).trackId());
229  m_simTrackBarcodeToSimVertexParentBarcode.emplace(hSimTracks->at(i).trackId(), hSimTracks->at(i).vertIndex());
230  }
231  m_simTrackBarcodeToIndex.emplace(hSimTracks->at(i).trackId(), i);
232  }
233  m_simVertexBarcodes.clear();
235  m_simTrackToSimVertex.clear();
237  for (unsigned int i = 0 ; i < hSimVertices->size() ; i++) {
238  m_simVertexBarcodes.push_back(i);
239  m_simVertexBarcodeToIndex.emplace(hSimVertices->at(i).vertexId(), i);
240  if (!hSimVertices->at(i).noParent()) {
241  m_simTrackToSimVertex.emplace(hSimVertices->at(i).parentIndex(), i);
242  m_simVertexToSimTrackParent.emplace( hSimVertices->at(i).vertexId(), hSimVertices->at(i).parentIndex() );
243  }
244  }
245 
246  std::vector<Index_t> tracksToBecomeClustersInitial;
247  std::vector<Barcode_t> descendantTracks;
248  SimClusterCollection simClustersForGenParts;
249  std::vector<std::unique_ptr<SimHitInfoPerSimTrack_t> > hitInfoList;
250  std::vector<std::vector<uint32_t> > simClusterPrimitives;
251  std::unordered_multimap<Index_t,Index_t> genPartsToSimClusters;
252  const auto& simTracks = *hSimTracks;
253  // loop over
254  for (unsigned int i = 0 ; i < simTracks.size() ; ++i) {
255  if ( simTracks[i].momentum().E() < minEnergy_ || std::abs(simTracks[i].momentum().Eta()) >= maxPseudoRapidity_ ) continue;
256  if ( simTracks[i].noGenpart() ) continue;
257  auto temp = CaloTruthAccumulator::descendantSimClusters( simTracks[i].trackId(),simHitPointers );
258  if( temp.size() ) {
259  output_.pCaloParticles->emplace_back(simTracks[i]);
260  m_caloParticles.sc_start_.push_back(output_.pSimClusters->size());
261  auto mbegin = std::make_move_iterator(temp.begin());
262  auto mend = std::make_move_iterator(temp.end());
263  output_.pSimClusters->insert(output_.pSimClusters->end(), mbegin, mend);
264  m_caloParticles.sc_stop_.push_back(output_.pSimClusters->size());
265  }
266  }
267 }
calo_particles m_caloParticles
edm::Handle< std::vector< SimVertex > > hSimVertices
std::unordered_multimap< Barcode_t, Index_t > m_simTrackToSimVertex
std::unordered_multimap< Barcode_t, Index_t > m_simHitBarcodeToIndex
std::unordered_map< Barcode_t, Index_t > m_genParticleBarcodeToIndex
std::unordered_map< Barcode_t, Index_t > m_genBarcodeToSimTrackIndex
OutputCollections output_
U second(std::pair< T, U > const &p)
void fillSimHits(std::vector< std::pair< DetId, const PCaloHit * > > &returnValue, const T &event, const edm::EventSetup &setup)
Fills the supplied vector with pointers to the SimHits, checking for bad modules if required...
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const edm::InputTag simVertexLabel_
bool isValid() const
Definition: HandleBase.h:74
std::unordered_map< Barcode_t, Barcode_t > m_simTrackBarcodeToSimVertexParentBarcode
std::vector< Barcode_t > m_simVertexBarcodes
const edm::InputTag simTrackLabel_
If bremsstrahlung merging, whether to also add the unmerged collection to the event or not...
std::unordered_map< Barcode_t, Index_t > m_simTrackBarcodeToIndex
edm::Handle< std::vector< SimTrack > > hSimTracks
std::unordered_map< Barcode_t, Index_t > m_simVertexBarcodeToIndex
std::unique_ptr< CaloParticleCollection > pCaloParticles
std::set< Barcode_t > m_simTracksConsideredForSimClusters
SimClusterCollection descendantSimClusters(Barcode_t barcode, const std::vector< std::pair< DetId, const PCaloHit * > > &hits)
std::unique_ptr< SimClusterCollection > pSimClusters
std::unordered_multimap< Barcode_t, Index_t > m_simVertexToSimTrackParent
std::vector< SimCluster > SimClusterCollection
Definition: SimClusterFwd.h:8
std::unordered_multimap< Barcode_t, Barcode_t > m_simVertexBarcodeToSimTrackBarcode
Definition: event.py:1
std::unique_ptr< SimHitInfoPerSimTrack_t > CaloTruthAccumulator::allAttachedSimHitInfo ( Barcode_t  st,
const std::vector< std::pair< DetId, const PCaloHit * > > &  hits,
bool  markUsed = false 
)
private

Definition at line 413 of file CaloTruthAccumulator.cc.

References attachedSimHitInfo(), and hfClusterShapes_cfi::hits.

Referenced by attachedSimHitInfo(), and descendantSimClusters().

415  {
416  return CaloTruthAccumulator::attachedSimHitInfo(barcode,hits,true,true,markUsed);
417 }
std::unique_ptr< SimHitInfoPerSimTrack_t > attachedSimHitInfo(Barcode_t st, const std::vector< std::pair< DetId, const PCaloHit * > > &hits, bool includeOwn=true, bool includeOther=false, bool markUsed=false)
std::unique_ptr< SimHitInfoPerSimTrack_t > CaloTruthAccumulator::attachedSimHitInfo ( Barcode_t  st,
const std::vector< std::pair< DetId, const PCaloHit * > > &  hits,
bool  includeOwn = true,
bool  includeOther = false,
bool  markUsed = false 
)
private

Definition at line 350 of file CaloTruthAccumulator.cc.

References funct::abs(), allAttachedSimHitInfo(), barcodeLogicWarningAlready_, caloStartZ, consideredBarcode(), hfClusterShapes_cfi::hits, hSimTracks, m_simHitBarcodeToIndex, m_simTrackBarcodeToIndex, m_simTrackToSimVertex, m_simVertexBarcodes, m_simVertexBarcodeToSimTrackBarcode, messageCategory_, eostools::move(), gen::n, mps_fire::result, setConsideredBarcode(), simTrackMatching_cfi::simTrack, and tkConvValidator_cfi::simTracks.

Referenced by allAttachedSimHitInfo(), descendantOnlySimHitInfo(), and descendantSimClusters().

351  {
352  const auto& simTracks = *hSimTracks;
353  std::unique_ptr<SimHitInfoPerSimTrack_t> result(new SimHitInfoPerSimTrack_t);
354 
355  const auto& simTrack = simTracks[m_simTrackBarcodeToIndex[barcode]];
356 
357  if ( markUsed ) {
358  if ( CaloTruthAccumulator::consideredBarcode( barcode ) ) {
359  return result;
360  }
362  }
363  if (includeOwn) {
364  auto range = m_simHitBarcodeToIndex.equal_range( barcode );
365  unsigned n = 0;
366  for ( auto iter = range.first ; iter != range.second ; iter++ ) {
367  const auto& the_hit = hits[iter->second];
368  result->emplace_back(the_hit.first,the_hit.second->energy());
369  ++n;
370  }
371  }
372 
373  // need to sim to the next sim track if we explicitly ask or
374  // if we are in the calorimeter next (no interaction)
375  // or if this is a continuation of the same particle
376  if (m_simTrackToSimVertex.count(barcode)) {
377  auto vertex_range = m_simTrackToSimVertex.equal_range(barcode);
378  for ( auto vertex_iter = vertex_range.first ; vertex_iter != vertex_range.second ; vertex_iter++ ) {
379  Index_t decayVertexIndex = vertex_iter->second;
380  const auto& nextVtx = (*hSimVertices)[decayVertexIndex];
381  const bool nextInCalo = (std::abs(nextVtx.position().z()) > caloStartZ*0.1 - 20.0); // add a buffer region in front of the calo face
382 
383  Barcode_t decayVertexBarcode = m_simVertexBarcodes[decayVertexIndex];
384  auto track_range = m_simVertexBarcodeToSimTrackBarcode.equal_range( decayVertexBarcode );
385  for ( auto track_iter = track_range.first ; track_iter != track_range.second ; track_iter++ ) {
386  if( !barcodeLogicWarningAlready_ && track_iter->second < barcode ) {
388  edm::LogWarning(messageCategory_) << " Daughter particle has a lower barcode than parent. This may screw up the logic!" << std::endl;
389  }
390  const auto& daughter = simTracks[m_simTrackBarcodeToIndex[track_iter->second]];
391 
392  if( includeOther || nextInCalo ) {
393  std::unique_ptr<SimHitInfoPerSimTrack_t> daughter_result = std::move(CaloTruthAccumulator::allAttachedSimHitInfo(track_iter->second,hits,markUsed));
394  result->insert(result->end(),daughter_result->begin(),daughter_result->end());
395  } else if ( daughter.type() == simTrack.type() ) {
396  std::unique_ptr<SimHitInfoPerSimTrack_t> daughter_result = std::move(CaloTruthAccumulator::attachedSimHitInfo(track_iter->second,hits,includeOwn, includeOther, markUsed));
397  result->insert(result->end(),daughter_result->begin(),daughter_result->end());
398  }
399  }
400  }
401  }
402  return result;
403 }
void setConsideredBarcode(Barcode_t barcode)
std::unordered_multimap< Barcode_t, Index_t > m_simTrackToSimVertex
std::unordered_multimap< Barcode_t, Index_t > m_simHitBarcodeToIndex
std::unique_ptr< SimHitInfoPerSimTrack_t > attachedSimHitInfo(Barcode_t st, const std::vector< std::pair< DetId, const PCaloHit * > > &hits, bool includeOwn=true, bool includeOther=false, bool markUsed=false)
const std::string messageCategory_
The message category used to send messages to MessageLogger.
std::unique_ptr< SimHitInfoPerSimTrack_t > allAttachedSimHitInfo(Barcode_t st, const std::vector< std::pair< DetId, const PCaloHit * > > &hits, bool markUsed=false)
simTrack
per collection params
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool consideredBarcode(Barcode_t barcode)
std::vector< Barcode_t > m_simVertexBarcodes
std::unordered_map< Barcode_t, Index_t > m_simTrackBarcodeToIndex
edm::Handle< std::vector< SimTrack > > hSimTracks
unsigned Index_t
std::vector< SimHitInfoPerRecoDetId_t > SimHitInfoPerSimTrack_t
int Barcode_t
std::unordered_multimap< Barcode_t, Barcode_t > m_simVertexBarcodeToSimTrackBarcode
def move(src, dest)
Definition: eostools.py:510
void CaloTruthAccumulator::beginLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  setup 
)
overrideprivatevirtual

Reimplemented from DigiAccumulatorMixMod.

Definition at line 77 of file CaloTruthAccumulator.cc.

References caloStartZ, HGCalTopology::dddConstants(), HcalTopology::dddConstants(), DetId::Forward, relativeConstraints::geom, edm::EventSetup::get(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalEndcap, hcddd_, HGCEE, HGCHEF, hgddd_, hgtopo_, mps_fire::i, HGCalGeometry::topology(), HcalGeometry::topology(), and HGCalDDDConstants::waferZ().

77  {
79  iSetup.get<CaloGeometryRecord>().get(geom);
80  const HGCalGeometry *eegeom, *fhgeom;
81  const HcalGeometry *bhgeom;
82 
83  eegeom = dynamic_cast<const HGCalGeometry*>(geom->getSubdetectorGeometry(DetId::Forward,HGCEE));
84  fhgeom = dynamic_cast<const HGCalGeometry*>(geom->getSubdetectorGeometry(DetId::Forward,HGCHEF));
85  bhgeom = dynamic_cast<const HcalGeometry*>(geom->getSubdetectorGeometry(DetId::Hcal,HcalEndcap));
86 
87  hgtopo_[0] = &(eegeom->topology());
88  hgtopo_[1] = &(fhgeom->topology());
89 
90  for( unsigned i = 0; i < 2; ++i ) {
91  hgddd_[i] = &(hgtopo_[i]->dddConstants());
92  }
93 
94  hcddd_ = bhgeom->topology().dddConstants();
95 
96  caloStartZ = hgddd_[0]->waferZ(1,false)*10.0; // get the location of the first plane of silicon, put in mm
97 }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:45
const HcalDDDRecConstants * dddConstants() const
Definition: HcalTopology.h:161
const HcalTopology & topology() const
Definition: HcalGeometry.h:117
const HGCalTopology & topology() const
Definition: HGCalGeometry.h:96
const HGCalDDDConstants * hgddd_[2]
double waferZ(int layer, bool reco) const
const HGCalDDDConstants & dddConstants() const
const HcalDDDRecConstants * hcddd_
const HGCalTopology * hgtopo_[2]
bool CaloTruthAccumulator::consideredBarcode ( Barcode_t  barcode)
inlineprivate

Definition at line 69 of file CaloTruthAccumulator.h.

Referenced by attachedSimHitInfo(), and descendantSimClusters().

69  {
70  // return (std::find(m_simTracksConsideredForSimClusters.begin(), m_simTracksConsideredForSimClusters.end(), barcode) != m_simTracksConsideredForSimClusters.end());
71  return m_simTracksConsideredForSimClusters.count( barcode );
72  }
std::set< Barcode_t > m_simTracksConsideredForSimClusters
std::unique_ptr< SimHitInfoPerSimTrack_t > CaloTruthAccumulator::descendantOnlySimHitInfo ( Barcode_t  st,
const std::vector< std::pair< DetId, const PCaloHit * > > &  hits,
bool  markUsed = false 
)
private

Definition at line 406 of file CaloTruthAccumulator.cc.

References attachedSimHitInfo(), and hfClusterShapes_cfi::hits.

408  {
409  return CaloTruthAccumulator::attachedSimHitInfo(barcode,hits,false,true,markUsed);
410 }
std::unique_ptr< SimHitInfoPerSimTrack_t > attachedSimHitInfo(Barcode_t st, const std::vector< std::pair< DetId, const PCaloHit * > > &hits, bool includeOwn=true, bool includeOther=false, bool markUsed=false)
SimClusterCollection CaloTruthAccumulator::descendantSimClusters ( Barcode_t  barcode,
const std::vector< std::pair< DetId, const PCaloHit * > > &  hits 
)
private

Definition at line 287 of file CaloTruthAccumulator.cc.

References funct::abs(), allAttachedSimHitInfo(), attachedSimHitInfo(), caloStartZ, consideredBarcode(), hfClusterShapes_cfi::hits, hSimTracks, hSimVertices, LogDebug, m_simTrackBarcodeToIndex, m_simTrackBarcodeToSimVertexParentBarcode, m_simTrackToSimVertex, m_simVertexBarcodes, m_simVertexBarcodeToIndex, m_simVertexBarcodeToSimTrackBarcode, eostools::move(), mps_fire::result, simTrackMatching_cfi::simTrack, tkConvValidator_cfi::simTracks, and badGlobalMuonTaggersAOD_cff::vtx.

Referenced by accumulateEvent().

287  {
289  const auto& simTracks = *hSimTracks;
290  if ( CaloTruthAccumulator::consideredBarcode( barcode ) ) {
291  LogDebug("CaloParticles") << "SCZ DEBUG Ignoring descendantSimClusters call because this particle is already marked used: " << barcode << std::endl;
292  //return result;
293  }
294 
295  std::unique_ptr<SimHitInfoPerSimTrack_t> hit_info = std::move(CaloTruthAccumulator::attachedSimHitInfo(barcode,hits, true, false, false));
296  //std::unique_ptr<SimHitInfoPerSimTrack_t> inclusive_hit_info = std::move(CaloTruthAccumulator::allAttachedSimHitInfo(barcode,hits, false) );
297 
298  const auto& simTrack = simTracks[m_simTrackBarcodeToIndex[barcode]];
300  const auto& vtx = hSimVertices->at(m_simVertexBarcodeToIndex[vtxBarcode]);
301  const bool isInCalo = (std::abs(vtx.position().z()) > caloStartZ - 30.0); // add a buffer region in front of the calo face
302 
303  if (hit_info->size() > 0) {
304  // define the sim cluster starting from the earliest particle that has hits in the calorimeter
305  // grab everything that descends from it
306  std::unique_ptr<SimHitInfoPerSimTrack_t> marked_hit_info;
307 
308 
309  if( isInCalo ) {
310  marked_hit_info = std::move( CaloTruthAccumulator::allAttachedSimHitInfo(barcode,hits,true) );
311  } else {
312  marked_hit_info = std::move( CaloTruthAccumulator::attachedSimHitInfo(barcode,hits,true,false,true) );
313  }
314 
315  if( marked_hit_info->size() != 0 ) {
316  result.emplace_back(simTrack);
317  auto& simcluster = result.back();
318 
319  std::unordered_map<uint32_t,float> acc_energy;
320 
321  for( const auto& hit_and_energy : *marked_hit_info ) {
322  const uint32_t id = hit_and_energy.first.rawId();
323  if( acc_energy.count(id) ) acc_energy[id] += hit_and_energy.second;
324  else acc_energy[id] = hit_and_energy.second;
325  }
326 
327  for( const auto& hit_and_energy : acc_energy ) {
328  simcluster.addRecHitAndFraction(hit_and_energy.first,hit_and_energy.second);
329  }
330  }
331  }
332 
333  if ( m_simTrackToSimVertex.count(barcode) ) {
334  auto vertex_range = m_simTrackToSimVertex.equal_range(barcode);
335  for ( auto vertex_iter = vertex_range.first ; vertex_iter != vertex_range.second ; vertex_iter++ ) {
336  Index_t decayVertexIndex = vertex_iter->second;
337  Barcode_t decayVertexBarcode = m_simVertexBarcodes[decayVertexIndex];
338  auto track_range = m_simVertexBarcodeToSimTrackBarcode.equal_range( decayVertexBarcode );
339  for ( auto track_iter = track_range.first ; track_iter != track_range.second ; track_iter++ ) {
340 
341  auto daughter_result = CaloTruthAccumulator::descendantSimClusters(track_iter->second,hits);
342  result.insert(result.end(),daughter_result.begin(),daughter_result.end());
343  }
344  }
345  }
346 
347  return result;
348 }
#define LogDebug(id)
edm::Handle< std::vector< SimVertex > > hSimVertices
std::unordered_multimap< Barcode_t, Index_t > m_simTrackToSimVertex
std::unique_ptr< SimHitInfoPerSimTrack_t > attachedSimHitInfo(Barcode_t st, const std::vector< std::pair< DetId, const PCaloHit * > > &hits, bool includeOwn=true, bool includeOther=false, bool markUsed=false)
std::unique_ptr< SimHitInfoPerSimTrack_t > allAttachedSimHitInfo(Barcode_t st, const std::vector< std::pair< DetId, const PCaloHit * > > &hits, bool markUsed=false)
simTrack
per collection params
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool consideredBarcode(Barcode_t barcode)
std::unordered_map< Barcode_t, Barcode_t > m_simTrackBarcodeToSimVertexParentBarcode
std::vector< Barcode_t > m_simVertexBarcodes
std::unordered_map< Barcode_t, Index_t > m_simTrackBarcodeToIndex
edm::Handle< std::vector< SimTrack > > hSimTracks
std::unordered_map< Barcode_t, Index_t > m_simVertexBarcodeToIndex
unsigned Index_t
int Barcode_t
SimClusterCollection descendantSimClusters(Barcode_t barcode, const std::vector< std::pair< DetId, const PCaloHit * > > &hits)
std::vector< SimCluster > SimClusterCollection
Definition: SimClusterFwd.h:8
std::unordered_multimap< Barcode_t, Barcode_t > m_simVertexBarcodeToSimTrackBarcode
def move(src, dest)
Definition: eostools.py:510
std::vector< Barcode_t > CaloTruthAccumulator::descendantTrackBarcodes ( Barcode_t  barcode)
private

Definition at line 269 of file CaloTruthAccumulator.cc.

References m_simTrackToSimVertex, m_simVertexBarcodes, m_simVertexBarcodeToSimTrackBarcode, and mps_fire::result.

269  {
270  std::vector<Barcode_t> result;
271  if (m_simTrackToSimVertex.count(barcode)) {
272  auto vertex_range = m_simTrackToSimVertex.equal_range(barcode);
273  for ( auto vertex_iter = vertex_range.first ; vertex_iter != vertex_range.second ; vertex_iter++ ) {
274  Index_t decayVertexIndex = vertex_iter->second;
275  Barcode_t decayVertexBarcode = m_simVertexBarcodes[decayVertexIndex];
276  auto track_range = m_simVertexBarcodeToSimTrackBarcode.equal_range( decayVertexBarcode );
277  for ( auto track_iter = track_range.first ; track_iter != track_range.second ; track_iter++ ) {
278  result.push_back( track_iter->second );
279  std::vector<Barcode_t> daughter_result = CaloTruthAccumulator::descendantTrackBarcodes( track_iter->second );
280  result.insert(result.end(),daughter_result.begin(),daughter_result.end());
281  }
282  }
283  }
284  return result;
285 }
std::unordered_multimap< Barcode_t, Index_t > m_simTrackToSimVertex
std::vector< Barcode_t > descendantTrackBarcodes(Barcode_t barcode)
std::vector< Barcode_t > m_simVertexBarcodes
unsigned Index_t
int Barcode_t
std::unordered_multimap< Barcode_t, Barcode_t > m_simVertexBarcodeToSimTrackBarcode
template<class T >
void CaloTruthAccumulator::fillSimHits ( std::vector< std::pair< DetId, const PCaloHit * > > &  returnValue,
const T event,
const edm::EventSetup setup 
)
private

Fills the supplied vector with pointers to the SimHits, checking for bad modules if required.

Definition at line 419 of file CaloTruthAccumulator.cc.

References collectionTags_, DEFINE_DIGI_ACCUMULATOR, HcalDDDRecConstants::HcalID::depth, HcalDDDRecConstants::HcalID::eta, HcalDDDRecConstants::getHCID(), HcalEndcap, hcddd_, hgddd_, hgtopo_, hcalTTPDigis_cfi::id, m_detIdToTotalSimEnergy, HcalDDDRecConstants::HcalID::phi, Validation_hcalonly_cfi::sign, rpcPointValidation_cfi::simHit, HGCalDDDConstants::simToReco(), HcalTestNumbering::unpackHcalIndex(), HGCalTestNumbering::unpackHexagonIndex(), and z.

Referenced by accumulateEvent().

419  {
420  // loop over the collections
421  for( const auto& collectionTag : collectionTags_ ) {
423  const bool isHcal = ( collectionTag.instance().find("HcalHits") != std::string::npos );
424  event.getByLabel( collectionTag, hSimHits );
425  for( const auto& simHit : *hSimHits ) {
426  DetId id(0);
427  const uint32_t simId = simHit.id();
428  if( isHcal ) {
429  int subdet, z, depth0, eta0, phi0, lay;
430  HcalTestNumbering::unpackHcalIndex(simId, subdet, z, depth0, eta0, phi0, lay);
431  int sign = (z==0) ? (-1):(1);
432  HcalDDDRecConstants::HcalID tempid = hcddd_->getHCID(subdet, sign*eta0, phi0, lay, depth0);
433  if (subdet==int(HcalEndcap)) {
434  id = HcalDetId(HcalEndcap,sign*tempid.eta,tempid.phi,tempid.depth);
435  }
436  } else {
437  int subdet, layer, cell, sec, subsec, zp;
438  HGCalTestNumbering::unpackHexagonIndex(simId, subdet, zp, layer, sec, subsec, cell);
439  const HGCalDDDConstants* ddd = hgddd_[subdet-3];
440  std::pair<int,int> recoLayerCell = ddd->simToReco(cell,layer,sec,
441  hgtopo_[subdet-3]->detectorType());
442  cell = recoLayerCell.first;
443  layer = recoLayerCell.second;
444  // skip simhits with bad barcodes or non-existant layers
445  if( layer == -1 || simHit.geantTrackId() == 0 ) continue;
446  id = HGCalDetId((ForwardSubdetector)subdet,zp,layer,subsec,sec,cell);
447  }
448 
449  if( DetId(0) == id ) continue;
450 
451  uint32_t detId = id.rawId();
452  returnValue.emplace_back(id, &simHit);
453 
454  if( m_detIdToTotalSimEnergy.count(detId) ) m_detIdToTotalSimEnergy[detId] += simHit.energy();
455  else m_detIdToTotalSimEnergy[detId] = simHit.energy();
456  }
457  } // end of loop over InputTags
458 }
std::vector< edm::InputTag > collectionTags_
ForwardSubdetector
std::pair< int, int > simToReco(int cell, int layer, int mod, bool half) const
HcalID getHCID(int subdet, int ieta, int iphi, int lay, int idepth) const
static void unpackHcalIndex(const uint32_t &idx, int &det, int &z, int &depth, int &eta, int &phi, int &lay)
const HGCalDDDConstants * hgddd_[2]
Definition: DetId.h:18
const HcalDDDRecConstants * hcddd_
const HGCalTopology * hgtopo_[2]
std::unordered_map< Index_t, float > m_detIdToTotalSimEnergy
static void unpackHexagonIndex(const uint32_t &idx, int &subdet, int &z, int &lay, int &wafer, int &celltyp, int &cell)
void CaloTruthAccumulator::finalizeEvent ( edm::Event event,
const edm::EventSetup setup 
)
overrideprivatevirtual

Definition at line 137 of file CaloTruthAccumulator.cc.

References SimCluster::addRecHitAndFraction(), CaloParticle::addSimCluster(), SimCluster::clearHitsAndFractions(), SimDataFormats::CaloAnalysis::cp, dedxEstimators_cff::fraction, SimCluster::hits_and_fractions(), mps_fire::i, m_caloParticles, m_detIdToCluster, m_detIdToTotalSimEnergy, m_genBarcodeToSimTrackIndex, m_genParticleBarcodeToIndex, m_simHitBarcodeToIndex, m_simTrackBarcodeToIndex, m_simTrackBarcodeToSimVertexParentBarcode, m_simTrackToSimVertex, m_simVertexBarcodes, m_simVertexBarcodeToIndex, m_simVertexBarcodeToSimTrackBarcode, m_simVertexToSimTrackParent, eostools::move(), output_, CaloTruthAccumulator::OutputCollections::pCaloParticles, CaloTruthAccumulator::OutputCollections::pSimClusters, SimDataFormats::CaloAnalysis::sc, CaloTruthAccumulator::calo_particles::sc_start_, CaloTruthAccumulator::calo_particles::sc_stop_, CaloTruthAccumulator::calo_particles::swap(), and edm::swap().

137  {
138  edm::LogInfo("CaloTruthAccumulator") << "Adding " << output_.pSimClusters->size()
139  << " SimParticles and " << output_.pCaloParticles->size()
140  << " CaloParticles to the event.";
141 
142  // now we need to normalize the hits and energies into hits and fractions
143  // (since we have looped over all pileup events)
144 
145  for( auto& sc : *(output_.pSimClusters) ) {
146  auto hitsAndEnergies = sc.hits_and_fractions();
148  for( auto& hAndE : hitsAndEnergies ) {
149  const float fraction = hAndE.second/m_detIdToTotalSimEnergy[hAndE.first];
150  sc.addRecHitAndFraction(hAndE.first,fraction);
151  }
152  }
153 
154  // save the SimCluster orphan handle so we can fill the calo particles
155  auto scHandle = event.put( std::move(output_.pSimClusters), "MergedCaloTruth" );
156 
157  // now fill the calo particles
158  for( unsigned i = 0; i < output_.pCaloParticles->size(); ++i ) {
159  auto& cp = (*output_.pCaloParticles)[i];
160  for( unsigned j = m_caloParticles.sc_start_[i]; j < m_caloParticles.sc_stop_[i]; ++j ) {
161  edm::Ref<SimClusterCollection> ref(scHandle,j);
162  cp.addSimCluster(ref);
163  }
164  }
165 
166  event.put( std::move(output_.pCaloParticles), "MergedCaloTruth" );
167 
168  calo_particles().swap(m_caloParticles);
169 
170  std::unordered_map<Index_t,float>().swap(m_detIdToTotalSimEnergy);
171 
172  std::unordered_map<Barcode_t,Index_t>().swap(m_genParticleBarcodeToIndex);
173  std::unordered_map<Barcode_t,Index_t>().swap(m_simTrackBarcodeToIndex);
174  std::unordered_map<Barcode_t,Index_t>().swap(m_genBarcodeToSimTrackIndex);
175  std::unordered_map<Barcode_t,Index_t>().swap(m_simVertexBarcodeToIndex);
176 
177  std::unordered_multimap<Index_t,Index_t>().swap(m_detIdToCluster);
178  std::unordered_multimap<Barcode_t,Index_t>().swap(m_simHitBarcodeToIndex);
179  std::unordered_multimap<Barcode_t,Barcode_t>().swap(m_simVertexBarcodeToSimTrackBarcode);
180  std::unordered_map<Barcode_t,Barcode_t>().swap(m_simTrackBarcodeToSimVertexParentBarcode);
181  std::unordered_multimap<Barcode_t,Index_t>().swap(m_simTrackToSimVertex);
182  std::unordered_multimap<Barcode_t,Index_t>().swap(m_simVertexToSimTrackParent);
183  std::vector<Barcode_t>().swap(m_simVertexBarcodes);
184  std::unordered_map<Index_t,float>().swap(m_detIdToTotalSimEnergy);
185 }
calo_particles m_caloParticles
std::unordered_multimap< Index_t, Index_t > m_detIdToCluster
std::unordered_multimap< Barcode_t, Index_t > m_simTrackToSimVertex
std::unordered_multimap< Barcode_t, Index_t > m_simHitBarcodeToIndex
std::vector< std::pair< uint32_t, float > > hits_and_fractions() const
Returns list of rechit IDs and fractions for this SimCluster.
Definition: SimCluster.h:210
std::unordered_map< Barcode_t, Index_t > m_genParticleBarcodeToIndex
std::unordered_map< Barcode_t, Index_t > m_genBarcodeToSimTrackIndex
OutputCollections output_
void addRecHitAndFraction(uint32_t hit, float fraction)
add rechit with fraction
Definition: SimCluster.h:204
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:116
void clearHitsAndFractions()
clear the hits and fractions list
Definition: SimCluster.h:219
void addSimCluster(const SimClusterRef &ref)
Definition: CaloParticle.h:62
std::unordered_map< Barcode_t, Barcode_t > m_simTrackBarcodeToSimVertexParentBarcode
std::vector< Barcode_t > m_simVertexBarcodes
std::unordered_map< Barcode_t, Index_t > m_simTrackBarcodeToIndex
std::unordered_map< Barcode_t, Index_t > m_simVertexBarcodeToIndex
std::unique_ptr< CaloParticleCollection > pCaloParticles
std::unique_ptr< SimClusterCollection > pSimClusters
std::unordered_multimap< Barcode_t, Index_t > m_simVertexToSimTrackParent
std::unordered_map< Index_t, float > m_detIdToTotalSimEnergy
std::unordered_multimap< Barcode_t, Barcode_t > m_simVertexBarcodeToSimTrackBarcode
def move(src, dest)
Definition: eostools.py:510
void CaloTruthAccumulator::initializeEvent ( const edm::Event event,
const edm::EventSetup setup 
)
overrideprivatevirtual

Definition at line 99 of file CaloTruthAccumulator.cc.

References accumulate(), accumulateEvent(), PileUpEventPrincipal::bunchCrossing(), hepMCproductLabel_, m_detIdToCluster, m_detIdToTotalSimEnergy, maximumPreviousBunchCrossing_, maximumSubsequentBunchCrossing_, messageCategory_, output_, CaloTruthAccumulator::OutputCollections::pCaloParticles, CaloTruthAccumulator::OutputCollections::pSimClusters, and GeneralSetup::setup().

100 {
103 
104  m_detIdToCluster.clear();
105  m_detIdToTotalSimEnergy.clear();
106 }
std::unordered_multimap< Index_t, Index_t > m_detIdToCluster
OutputCollections output_
std::unique_ptr< CaloParticleCollection > pCaloParticles
std::vector< CaloParticle > CaloParticleCollection
std::unique_ptr< SimClusterCollection > pSimClusters
std::vector< SimCluster > SimClusterCollection
Definition: SimClusterFwd.h:8
std::unordered_map< Index_t, float > m_detIdToTotalSimEnergy
void CaloTruthAccumulator::setConsideredBarcode ( Barcode_t  barcode)
inlineprivate

Definition at line 68 of file CaloTruthAccumulator.h.

Referenced by attachedSimHitInfo().

68 { m_simTracksConsideredForSimClusters.insert( barcode ); }
std::set< Barcode_t > m_simTracksConsideredForSimClusters

Member Data Documentation

bool CaloTruthAccumulator::barcodeLogicWarningAlready_
private

Definition at line 147 of file CaloTruthAccumulator.h.

Referenced by attachedSimHitInfo(), and CaloTruthAccumulator().

double CaloTruthAccumulator::caloStartZ
private
bool CaloTruthAccumulator::chargedOnly_
private

Uses the same config as selector_, but can be used to drop out early since selector_ requires the TrackingParticle to be created first.

Definition at line 143 of file CaloTruthAccumulator.h.

std::vector<edm::InputTag> CaloTruthAccumulator::collectionTags_
private

Definition at line 134 of file CaloTruthAccumulator.h.

Referenced by CaloTruthAccumulator(), and fillSimHits().

edm::InputTag CaloTruthAccumulator::genParticleLabel_
private

Definition at line 135 of file CaloTruthAccumulator.h.

Referenced by accumulateEvent(), and CaloTruthAccumulator().

const HcalDDDRecConstants* CaloTruthAccumulator::hcddd_
private

Definition at line 171 of file CaloTruthAccumulator.h.

Referenced by beginLuminosityBlock(), and fillSimHits().

edm::InputTag CaloTruthAccumulator::hepMCproductLabel_
private

Needed to add HepMC::GenVertex to SimVertex.

Definition at line 137 of file CaloTruthAccumulator.h.

Referenced by CaloTruthAccumulator(), and initializeEvent().

const HGCalDDDConstants* CaloTruthAccumulator::hgddd_[2]
private

Definition at line 170 of file CaloTruthAccumulator.h.

Referenced by beginLuminosityBlock(), and fillSimHits().

const HGCalTopology* CaloTruthAccumulator::hgtopo_[2]
private

Definition at line 169 of file CaloTruthAccumulator.h.

Referenced by beginLuminosityBlock(), and fillSimHits().

edm::Handle<std::vector<SimTrack> > CaloTruthAccumulator::hSimTracks
private
edm::Handle<std::vector<SimVertex> > CaloTruthAccumulator::hSimVertices
private

Definition at line 132 of file CaloTruthAccumulator.h.

Referenced by accumulateEvent(), and descendantSimClusters().

calo_particles CaloTruthAccumulator::m_caloParticles
private

Definition at line 91 of file CaloTruthAccumulator.h.

Referenced by accumulateEvent(), and finalizeEvent().

std::unordered_multimap<Index_t,Index_t> CaloTruthAccumulator::m_detIdToCluster
private

Definition at line 99 of file CaloTruthAccumulator.h.

Referenced by finalizeEvent(), and initializeEvent().

std::unordered_map<Index_t,float> CaloTruthAccumulator::m_detIdToTotalSimEnergy
private

Definition at line 94 of file CaloTruthAccumulator.h.

Referenced by fillSimHits(), finalizeEvent(), and initializeEvent().

std::unordered_map<Barcode_t,Index_t> CaloTruthAccumulator::m_genBarcodeToSimTrackIndex
private

Definition at line 97 of file CaloTruthAccumulator.h.

Referenced by accumulateEvent(), and finalizeEvent().

std::unordered_map<Barcode_t,Index_t> CaloTruthAccumulator::m_genParticleBarcodeToIndex
private

Definition at line 95 of file CaloTruthAccumulator.h.

Referenced by accumulateEvent(), and finalizeEvent().

std::unordered_multimap<Barcode_t,Index_t> CaloTruthAccumulator::m_simHitBarcodeToIndex
private

Definition at line 100 of file CaloTruthAccumulator.h.

Referenced by accumulateEvent(), attachedSimHitInfo(), and finalizeEvent().

std::unordered_map<Barcode_t,Index_t> CaloTruthAccumulator::m_simTrackBarcodeToIndex
private
std::unordered_map<Barcode_t,Barcode_t> CaloTruthAccumulator::m_simTrackBarcodeToSimVertexParentBarcode
private

Definition at line 102 of file CaloTruthAccumulator.h.

Referenced by accumulateEvent(), descendantSimClusters(), and finalizeEvent().

std::set<Barcode_t> CaloTruthAccumulator::m_simTracksConsideredForSimClusters
private

Definition at line 67 of file CaloTruthAccumulator.h.

Referenced by accumulateEvent().

std::unordered_multimap<Barcode_t,Index_t> CaloTruthAccumulator::m_simTrackToSimVertex
private
std::vector<Barcode_t> CaloTruthAccumulator::m_simVertexBarcodes
private
std::unordered_map<Barcode_t,Index_t> CaloTruthAccumulator::m_simVertexBarcodeToIndex
private

Definition at line 98 of file CaloTruthAccumulator.h.

Referenced by accumulateEvent(), descendantSimClusters(), and finalizeEvent().

std::unordered_multimap<Barcode_t,Barcode_t> CaloTruthAccumulator::m_simVertexBarcodeToSimTrackBarcode
private
std::unordered_multimap<Barcode_t,Index_t> CaloTruthAccumulator::m_simVertexToSimTrackParent
private

Definition at line 104 of file CaloTruthAccumulator.h.

Referenced by accumulateEvent(), and finalizeEvent().

const unsigned int CaloTruthAccumulator::maximumPreviousBunchCrossing_
private

maximum distance for HepMC::GenVertex to be added to SimVertex

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 117 of file CaloTruthAccumulator.h.

Referenced by initializeEvent().

const unsigned int CaloTruthAccumulator::maximumSubsequentBunchCrossing_
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 120 of file CaloTruthAccumulator.h.

Referenced by initializeEvent().

const double CaloTruthAccumulator::maxPseudoRapidity_
private

Definition at line 139 of file CaloTruthAccumulator.h.

Referenced by accumulateEvent().

const std::string CaloTruthAccumulator::messageCategory_
private

The message category used to send messages to MessageLogger.

Definition at line 74 of file CaloTruthAccumulator.h.

Referenced by attachedSimHitInfo(), and initializeEvent().

const double CaloTruthAccumulator::minEnergy_
private

Definition at line 139 of file CaloTruthAccumulator.h.

Referenced by accumulateEvent().

OutputCollections CaloTruthAccumulator::output_
private

Definition at line 172 of file CaloTruthAccumulator.h.

Referenced by accumulateEvent(), finalizeEvent(), and initializeEvent().

bool CaloTruthAccumulator::selectorFlag_
private

Definition at line 141 of file CaloTruthAccumulator.h.

bool CaloTruthAccumulator::signalOnly_
private

Uses the same config as selector_, but can be used to drop out early since selector_ requires the TrackingParticle to be created first.

Definition at line 145 of file CaloTruthAccumulator.h.

const edm::InputTag CaloTruthAccumulator::simTrackLabel_
private

If bremsstrahlung merging, whether to also add the unmerged collection to the event or not.

Whether or not to create a separate collection for just the initial interaction vertices Whether or not to add the full parentage of any TrackingParticle that is inserted in the collection.

Definition at line 129 of file CaloTruthAccumulator.h.

Referenced by accumulateEvent(), and CaloTruthAccumulator().

const edm::InputTag CaloTruthAccumulator::simVertexLabel_
private

Definition at line 130 of file CaloTruthAccumulator.h.

Referenced by accumulateEvent(), and CaloTruthAccumulator().