Plugin to create the MC truth for TTClusters. More...
#include <TTClusterAssociator.h>
Public Member Functions | |
TTClusterAssociator (const edm::ParameterSet &iConfig) | |
Constructors. More... | |
~TTClusterAssociator () override | |
Destructor. More... | |
Public Member Functions inherited from edm::stream::EDProducer<> | |
EDProducer ()=default | |
EDProducer (const EDProducer &)=delete | |
bool | hasAbilityToProduceInBeginLumis () const final |
bool | hasAbilityToProduceInBeginProcessBlocks () const final |
bool | hasAbilityToProduceInBeginRuns () const final |
bool | hasAbilityToProduceInEndLumis () const final |
bool | hasAbilityToProduceInEndProcessBlocks () const final |
bool | hasAbilityToProduceInEndRuns () const final |
const EDProducer & | operator= (const EDProducer &)=delete |
Private Member Functions | |
void | beginRun (const edm::Run &run, const edm::EventSetup &iSetup) override |
Mandatory methods. More... | |
void | endRun (const edm::Run &run, const edm::EventSetup &iSetup) override |
End run. More... | |
template<> | |
void | produce (edm::Event &iEvent, const edm::EventSetup &iSetup) |
void | produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override |
template<> | |
void | produce (edm::Event &iEvent, const edm::EventSetup &iSetup) |
Implement the producer. More... | |
Private Attributes | |
edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > | digisimLinkToken_ |
edm::Handle< edm::DetSetVector< PixelDigiSimLink > > | thePixelDigiSimLinkHandle_ |
Data members. More... | |
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > | theTrackerGeometryToken_ |
edm::EDGetTokenT< std::vector< TrackingParticle > > | tpToken_ |
edm::Handle< std::vector< TrackingParticle > > | trackingParticleHandle_ |
std::vector< edm::InputTag > | ttClustersInputTags_ |
std::vector< edm::EDGetTokenT< edmNew::DetSetVector< TTCluster< T > > > > | ttClustersTokens_ |
Additional Inherited Members | |
Public Types inherited from edm::stream::EDProducer<> | |
using | CacheTypes = CacheContexts< T... > |
using | GlobalCache = typename CacheTypes::GlobalCache |
using | HasAbility = AbilityChecker< T... > |
using | InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache |
using | LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache |
using | LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache > |
using | LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache |
using | RunCache = typename CacheTypes::RunCache |
using | RunContext = RunContextT< RunCache, GlobalCache > |
using | RunSummaryCache = typename CacheTypes::RunSummaryCache |
Plugin to create the MC truth for TTClusters.
After moving from SimDataFormats to DataFormats, the template structure of the class was maintained in order to accomodate any types other than PixelDigis in case there is such a need in the future.
Definition at line 43 of file TTClusterAssociator.h.
|
explicit |
Constructors.
Close class.
NOTE since pattern hit correlation must be performed within a stacked module, one must store Clusters in a proper way, providing easy access to them in a detector/member-wise way
Implementation of methods
Here, in the header file, the methods which do not depend on the specific type <T> that can fit the template. Other methods, with type-specific features, are implemented in the source file.Constructors
Definition at line 82 of file TTClusterAssociator.h.
References deDxTools::esConsumes(), and edm::ParameterSet::getParameter().
|
override |
|
overrideprivate |
Mandatory methods.
Begin run.
Print some information when loaded
Definition at line 104 of file TTClusterAssociator.h.
|
overrideprivate |
|
private |
Here, in the source file, the methods which do depend on the specific type <T> that can fit the template.
Exit if real data
Get the PixelDigiSimLink
Get the TrackingParticles
Preliminary task: map SimTracks by TrackingParticle Prepare the map
Loop over TrackingParticles
Make the pointer to the TrackingParticle
Get the EncodedEventId
Loop over SimTracks inside TrackingParticle
Use the unique SimTrack Id (which is SimTrack ID + EncodedEventId)
End of loop over TrackingParticles
Loop over InputTags to handle multiple collections
Prepare output
Get the Clusters already stored away
Prepare the necessary maps
Loop over the input Clusters
Get the DetSets of the Clusters
Make the reference to be put in the map
Prepare the maps wrt TTCluster
Get the PixelDigiSimLink Safety check added after new digitizer (Oct 2014)
Sensor is not found in DigiSimLink. Set MC truth to NULL for all hits in this sensor. Period.
Get the Digis and loop over them
No SimLink is found by definition Then store NULL MC truth for all the digis
Go to the next sensor
Get the Digis and loop over them
Loop over PixelDigiSimLink
Find the link and, if there's not, skip
Get SimTrack Id and type
Prepare the SimTrack Unique ID
Get the corresponding TrackingParticle
Store the TrackingParticle
Prepare the maps wrt TrackingParticle
Fill the auxiliary map
In case no TrackingParticle is found, store a NULL pointer
End of loop over PixelDigiSimLink
End of loop over all the hits composing the Cluster
Check that the cluster has a non-NULL TP pointer
In case no TrackingParticle is found at all, drop the map element
Use "erase by key"
End of loop over all the TTClusters of the event
Clean the maps that need cleaning Prepare the output map wrt TrackingParticle
Get the vector of references to TTCluster
Sort and remove duplicates
Put the maps in the association object
Put output in the event
End of loop over input tags
Definition at line 14 of file TTClusterAssociator.cc.
References bsc_activity_cfg::clusters, edm::DetSet< T >::data, TrackerGeometry::dets(), TrackingParticle::eventId(), TrackingParticle::g4Tracks(), edm::EventSetup::getData(), mps_fire::i, iEvent, edmNew::makeRefTo(), eostools::move(), AlCaHLTBitMon_ParallelJobs::p, cscDigiValidation_cfi::simTrack, jetUpdater_cfi::sort, DetId::subdetId(), StripSubdetector::TID, StripSubdetector::TOB, and tier0::unique().
|
overrideprivate |
|
private |
Implement the producer.
|
private |
Definition at line 60 of file TTClusterAssociator.h.
|
private |
Data members.
Definition at line 55 of file TTClusterAssociator.h.
|
private |
Definition at line 64 of file TTClusterAssociator.h.
|
private |
Definition at line 61 of file TTClusterAssociator.h.
|
private |
Definition at line 56 of file TTClusterAssociator.h.
|
private |
Definition at line 58 of file TTClusterAssociator.h.
|
private |
Definition at line 62 of file TTClusterAssociator.h.