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 | hasAbilityToProduceInBeginLumis () const final |
bool | hasAbilityToProduceInBeginRuns () const final |
bool | hasAbilityToProduceInEndLumis () const final |
bool | hasAbilityToProduceInEndRuns () 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) |
More... | |
template<> | |
void | produce (edm::Event &iEvent, const edm::EventSetup &iSetup) |
Implement the producer. More... | |
void | produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override |
Private Attributes | |
edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > | digisimLinkToken |
edm::Handle< edm::DetSetVector< PixelDigiSimLink > > | thePixelDigiSimLinkHandle |
Data members. More... | |
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 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 87 of file TTClusterAssociator.h.
References edm::ParameterSet::getParameter().
|
override |
|
overrideprivate |
Mandatory methods.
Begin run.
Get the geometry
Print some information when loaded
Definition at line 107 of file TTClusterAssociator.h.
References edm::EventSetup::get(), and get.
|
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
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 bsc_activity_cfg::clusters, edm::DetSet< T >::data, TrackerGeometry::dets(), TrackingParticle::eventId(), TrackingParticle::g4Tracks(), mps_fire::i, iEvent, edmNew::makeRefTo(), eostools::move(), DetId::subdetId(), StripSubdetector::TID, StripSubdetector::TOB, and tier0::unique().
|
private |
Implement the producer.
|
overrideprivate |
|
private |
Definition at line 60 of file TTClusterAssociator.h.
|
private |
Data members.
Definition at line 55 of file TTClusterAssociator.h.
|
private |
Definition at line 68 of file TTClusterAssociator.h.
|
private |
Definition at line 69 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 63 of file TTClusterAssociator.h.