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 | |
bool | hasAbilityToProduceInLumis () const final |
bool | hasAbilityToProduceInRuns () const final |
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::EDGetTokenT< edm::SimTrackContainer > | simTrackToken |
edm::Handle< edm::DetSetVector< PixelDigiSimLink > > | thePixelDigiSimLinkHandle |
Data members. More... | |
edm::Handle< edm::SimTrackContainer > | theSimTrackHandle |
edm::ESHandle< TrackerGeometry > | theTrackerGeometry |
edm::ESHandle< TrackerTopology > | theTrackerTopology |
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<> | |
typedef CacheContexts< T... > | CacheTypes |
typedef CacheTypes::GlobalCache | GlobalCache |
typedef AbilityChecker< T... > | HasAbility |
typedef CacheTypes::LuminosityBlockCache | LuminosityBlockCache |
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache > | LuminosityBlockContext |
typedef CacheTypes::LuminosityBlockSummaryCache | LuminosityBlockSummaryCache |
typedef CacheTypes::RunCache | RunCache |
typedef RunContextT< RunCache, GlobalCache > | RunContext |
typedef CacheTypes::RunSummaryCache | 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 44 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 93 of file TTClusterAssociator.h.
References TTClusterAssociator< T >::digisimLinkToken, edm::ParameterSet::getParameter(), TTClusterAssociator< T >::simTrackToken, TTClusterAssociator< T >::tpToken, TTClusterAssociator< T >::TTClustersInputTags, and TTClusterAssociator< T >::TTClustersTokens.
|
override |
|
overrideprivate |
Mandatory methods.
Begin run.
Get the geometry
Print some information when loaded
Definition at line 116 of file TTClusterAssociator.h.
References edm::EventSetup::get(), TTClusterAssociator< T >::theTrackerGeometry, and TTClusterAssociator< T >::theTrackerTopology.
|
overrideprivate |
End run.
Definition at line 128 of file TTClusterAssociator.h.
References iEvent, and TTClusterAssociator< T >::produce().
|
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
Build 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 edmNew::DetSet< T >::begin(), fastPrimaryVertexProducer_cfi::clusters, edm::DetSet< T >::data, TrackerGeometry::dets(), edmNew::DetSet< T >::end(), TrackingParticle::eventId(), funct::false, TrackingParticle::g4Tracks(), edm::Event::getByToken(), mps_fire::i, edm::EventBase::isRealData(), edmNew::makeRefTo(), eostools::move(), edm::Event::put(), DetId::subdetId(), StripSubdetector::TID, StripSubdetector::TOB, and tier0::unique().
|
overrideprivate |
Referenced by TTClusterAssociator< T >::endRun().
|
private |
Implement the producer.
|
private |
Definition at line 63 of file TTClusterAssociator.h.
Referenced by TTClusterAssociator< T >::TTClusterAssociator().
|
private |
Definition at line 64 of file TTClusterAssociator.h.
Referenced by TTClusterAssociator< T >::TTClusterAssociator().
|
private |
Data members.
Definition at line 57 of file TTClusterAssociator.h.
|
private |
Definition at line 58 of file TTClusterAssociator.h.
|
private |
Definition at line 73 of file TTClusterAssociator.h.
Referenced by TTClusterAssociator< T >::beginRun().
|
private |
Definition at line 74 of file TTClusterAssociator.h.
Referenced by TTClusterAssociator< T >::beginRun().
|
private |
Definition at line 65 of file TTClusterAssociator.h.
Referenced by TTClusterAssociator< T >::TTClusterAssociator().
|
private |
Definition at line 59 of file TTClusterAssociator.h.
|
private |
Definition at line 61 of file TTClusterAssociator.h.
Referenced by TTClusterAssociator< T >::TTClusterAssociator().
|
private |
Definition at line 67 of file TTClusterAssociator.h.
Referenced by TTClusterAssociator< T >::TTClusterAssociator().