Plugin to create the MC truth for TTTracks. More...
#include <TTTrackAssociator.h>
Public Member Functions | |
TTTrackAssociator (const edm::ParameterSet &iConfig) | |
Constructors. More... | |
~TTTrackAssociator () | |
Destructor. More... | |
Public Member Functions inherited from edm::stream::EDProducer<> | |
EDProducer ()=default | |
Public Member Functions inherited from edm::stream::EDProducerBase | |
EDProducerBase () | |
ModuleDescription const & | moduleDescription () const |
virtual | ~EDProducerBase () |
Public Member Functions inherited from edm::ProducerBase | |
void | callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func) |
std::vector< edm::ProductResolverIndex > const & | indiciesForPutProducts (BranchType iBranchType) const |
ProducerBase () | |
void | registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &) |
std::function< void(BranchDescription const &)> | registrationCallback () const |
used by the fwk to register list of products More... | |
void | resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel) |
virtual | ~ProducerBase () noexcept(false) |
Public Member Functions inherited from edm::EDConsumerBase | |
std::vector< ConsumesInfo > | consumesInfo () const |
void | convertCurrentProcessAlias (std::string const &processName) |
Convert "@currentProcess" in InputTag process names to the actual current process name. More... | |
EDConsumerBase () | |
EDConsumerBase (EDConsumerBase const &)=delete | |
EDConsumerBase (EDConsumerBase &&)=default | |
ProductResolverIndexAndSkipBit | indexFrom (EDGetToken, BranchType, TypeID const &) const |
void | itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const |
void | itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const |
std::vector< ProductResolverIndexAndSkipBit > const & | itemsToGetFrom (BranchType iType) const |
void | labelsForToken (EDGetToken iToken, Labels &oLabels) const |
void | modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const |
EDConsumerBase const & | operator= (EDConsumerBase const &)=delete |
EDConsumerBase & | operator= (EDConsumerBase &&)=default |
bool | registeredToConsume (ProductResolverIndex, bool, BranchType) const |
bool | registeredToConsumeMany (TypeID const &, BranchType) const |
void | updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet) |
virtual | ~EDConsumerBase () noexcept(false) |
Private Member Functions | |
virtual void | beginRun (const edm::Run &run, const edm::EventSetup &iSetup) |
Mandatory methods. More... | |
virtual void | endRun (const edm::Run &run, const edm::EventSetup &iSetup) |
End run. More... | |
template<> | |
void | produce (edm::Event &iEvent, const edm::EventSetup &iSetup) |
virtual void | produce (edm::Event &iEvent, const edm::EventSetup &iSetup) |
template<> | |
void | produce (edm::Event &iEvent, const edm::EventSetup &iSetup) |
Implement the producer. More... | |
Private Attributes | |
edm::EDGetTokenT< TTClusterAssociationMap< T > > | TTClusterTruthToken |
edm::EDGetTokenT< TTStubAssociationMap< T > > | TTStubTruthToken |
std::vector< edm::InputTag > | TTTracksInputTags |
Data members. More... | |
std::vector< edm::EDGetTokenT< std::vector< TTTrack< T > > > > | TTTracksTokens |
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 | |
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 TTTracks.
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 40 of file TTTrackAssociator.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 80 of file TTTrackAssociator.h.
References edm::EDConsumerBase::consumes(), edm::ParameterSet::getParameter(), TTTrackAssociator< T >::TTClusterTruthToken, TTTrackAssociator< T >::TTStubTruthToken, TTTrackAssociator< T >::TTTracksInputTags, and TTTrackAssociator< T >::TTTracksTokens.
TTTrackAssociator< T >::~TTTrackAssociator | ( | ) |
|
privatevirtual |
Mandatory methods.
Begin run.
Print some information when loaded
Definition at line 100 of file TTTrackAssociator.h.
|
privatevirtual |
End run.
Definition at line 108 of file TTTrackAssociator.h.
References iEvent, and TTTrackAssociator< 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 Stub and Cluster MC truth
Loop over InputTags to handle multiple collections
Prepare output
Get the Tracks already stored away
Prepare the necessary maps
Counter needed to build the edm::Ptr to the TTTrack
Make the pointer to be put in the map
Get the stubs of the TTTrack (theseStubs)
Auxiliary map to store TP addresses and TP edm::Ptr
Fill the inclusive map which is careless of the stub classification
Prepare the maps wrt TrackingParticle
Fill the auxiliary map
Fill the other auxiliary map
End of loop over the clusters
Check if the stub is unknown
End of loop over the stubs
If there more than 2 unknown stubs, go to the next track as this track may be COMBINATORIC or UNKNOWN
If we are here, all the stubs are either combinatoric or genuine and there is no more than one fake stub in the track Loop over all the TrackingParticle which have been found in the track at some point (stored in auxMap)
Get all the stubs from this TrackingParticle
Loop over the stubs
We want that all the stubs of the track are included in the container of all the stubs produced by this particular TrackingParticle which we already know is one of the TrackingParticles that released hits in this track we are evaluating right now
If the TrackingParticle does not appear in all stubs but one then go to the next track
If we are here, it means that the TrackingParticle generates hits in all stubs but one of the current track so put it into the vector
Count how many TrackingParticles we do have
If only one TrackingParticle, GENUINE if different than one, COMBINATORIC
Here, the track may only be GENUINE Fill the map
End of loop over Tracks
Clean the only map that needs cleaning Prepare the output map wrt TrackingParticle
Get the vector of edm::Ptr< TTTrack >
Sort and remove duplicates
Also, create the pointer to the TTClusterAssociationMap
Put the maps in the association object
Put output in the event
End of loop over InputTags
Definition at line 14 of file TTTrackAssociator.cc.
References spr::find(), edm::Ptr< T >::get(), edm::Event::getByToken(), edm::Ptr< T >::isNull(), edm::EventBase::isRealData(), eostools::move(), edm::Event::put(), edm::second(), and tier0::unique().
|
privatevirtual |
Referenced by TTTrackAssociator< T >::endRun().
|
private |
Implement the producer.
|
private |
Definition at line 59 of file TTTrackAssociator.h.
Referenced by TTTrackAssociator< T >::TTTrackAssociator().
|
private |
Definition at line 58 of file TTTrackAssociator.h.
Referenced by TTTrackAssociator< T >::TTTrackAssociator().
|
private |
Data members.
Definition at line 53 of file TTTrackAssociator.h.
Referenced by TTTrackAssociator< T >::TTTrackAssociator().
|
private |
Definition at line 56 of file TTTrackAssociator.h.
Referenced by TTTrackAssociator< T >::TTTrackAssociator().