Plugin to create the MC truth for TTClusters. More...
#include <TTClusterAssociator.h>
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 |
Public Types inherited from edm::stream::EDProducerBase | |
typedef EDProducerAdaptorBase | ModuleType |
Public Types inherited from edm::ProducerBase | |
using | ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >> |
typedef ProductRegistryHelper::TypeLabelList | TypeLabelList |
Public Types inherited from edm::EDConsumerBase | |
typedef ProductLabels | Labels |
Static Public Member Functions inherited from edm::stream::EDProducerBase | |
static const std::string & | baseType () |
static void | fillDescriptions (ConfigurationDescriptions &descriptions) |
static void | prevalidate (ConfigurationDescriptions &descriptions) |
Protected Member Functions inherited from edm::EDConsumerBase | |
template<typename ProductType , BranchType B = InEvent> | |
EDGetTokenT< ProductType > | consumes (edm::InputTag const &tag) |
EDGetToken | consumes (const TypeToGet &id, edm::InputTag const &tag) |
template<BranchType B> | |
EDGetToken | consumes (TypeToGet const &id, edm::InputTag const &tag) |
ConsumesCollector | consumesCollector () |
Use a ConsumesCollector to gather consumes information from helper functions. More... | |
template<typename ProductType , BranchType B = InEvent> | |
void | consumesMany () |
void | consumesMany (const TypeToGet &id) |
template<BranchType B> | |
void | consumesMany (const TypeToGet &id) |
template<typename ProductType , BranchType B = InEvent> | |
EDGetTokenT< ProductType > | mayConsume (edm::InputTag const &tag) |
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
template<BranchType B> | |
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
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 edm::EDConsumerBase::consumes(), 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().