Plugin to create the MC truth for TTStubs. More...
#include <TTStubAssociator.h>
Public Member Functions | |
TTStubAssociator (const edm::ParameterSet &iConfig) | |
Constructors. More... | |
~TTStubAssociator () 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) |
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::ESHandle< TrackerGeometry > | theTrackerGeometry |
edm::ESHandle< TrackerTopology > | theTrackerTopology |
std::vector< edm::InputTag > | TTClusterTruthInputTags |
std::vector< edm::EDGetTokenT< TTClusterAssociationMap< T > > > | TTClusterTruthTokens |
std::vector< edm::InputTag > | TTStubsInputTags |
Data members. More... | |
std::vector< edm::EDGetTokenT< edmNew::DetSetVector< TTStub< T > > > > | TTStubsTokens |
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 TTStubs.
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 TTStubAssociator.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 81 of file TTStubAssociator.h.
References edm::ParameterSet::getParameter(), TTStubAssociator< T >::TTClusterTruthInputTags, TTStubAssociator< T >::TTClusterTruthTokens, TTStubAssociator< T >::TTStubsInputTags, and TTStubAssociator< T >::TTStubsTokens.
|
override |
|
overrideprivate |
Mandatory methods.
Begin run.
Print some information when loaded
Definition at line 102 of file TTStubAssociator.h.
References edm::EventSetup::get(), TTStubAssociator< T >::theTrackerGeometry, and TTStubAssociator< T >::theTrackerTopology.
|
overrideprivate |
End run.
Definition at line 112 of file TTStubAssociator.h.
References iEvent, and TTStubAssociator< 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
Exit if the vectors are uncorrectly dimensioned
Loop over the InputTags to handle multiple collections
Prepare output
Get the Stubs already stored away
Get the Cluster MC truth
Prepare the necessary maps
Loop over the input Stubs
Get the DetSets of the Clusters
Make the reference to be put in the map
Get the two clusters
Fill the inclusive map which is careless of the stub classification
Prepare the maps wrt TrackingParticle
Fill the auxiliary map
GENUINE for clusters means not combinatoric and not unknown: same MC truth content MUST be found in both clusters composing the stub
If at least one cluster is unknown, it means either unknown, either combinatoric Do nothing, and go to the next Stub
Here both are clusters are genuine/combinatoric If both clusters have some known SimTrack content they must be compared to each other
If both clusters are genuine, they must be associated to the same TrackingParticle in order to return a genuine stub. Period. Note we can perform safely this comparison because, if both clusters are genuine, their TrackingParticle shall NEVER be NULL
Two genuine clusters with same SimTrack content mean genuine
Fill the map: by construction, this will always be the first time the stub is inserted into the map: no need for "find"
At this point, go to the next Stub
It means combinatoric
End of two genuine clusters
Here, at least one cluster is combinatoric
Skip NULL pointers
Skip NULL pointers
Same SimTrack is present in both clusters
If two different SimTracks are found in both clusters, then the stub is for sure combinatoric
End of double loop over SimTracks of both clusters
If two different SimTracks are found in both clusters, go to the next stub
No SimTracks were found to be in both clusters
Only one SimTrack was found to be present in both clusters even if one of the clusters (or both) are combinatoric: this means there is only one track that participates in both clusters, hence the stub is genuine
Fill the map: by construction, this will always be the first time the stub is inserted into the map: no need for "find"
At this point, go to the next Stub
End of one single SimTrack in both clusters
End of "at least one cluster is combinatoric"
End of "both clusters are known, somehow..."
End of loop over Stubs
Clean the only map that needs cleaning Prepare the output map wrt TrackingParticle
Get the vector of references to TTStub
Sort and remove duplicates
Put the vector in the output map
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 TTStubAssociator.cc.
References edmNew::DetSet< T >::begin(), TrackerGeometry::dets(), edmNew::DetSet< T >::end(), edm::Event::getByToken(), mps_fire::i, TrackerTopology::isLower(), edm::Ptr< T >::isNull(), edm::EventBase::isRealData(), dqmdumpme::k, edmNew::makeRefTo(), eostools::move(), edm::Event::put(), TrackerTopology::stack(), DetId::subdetId(), StripSubdetector::TID, StripSubdetector::TOB, and tier0::unique().
|
overrideprivate |
Referenced by TTStubAssociator< T >::endRun().
|
private |
Implement the producer.
|
private |
Definition at line 62 of file TTStubAssociator.h.
Referenced by TTStubAssociator< T >::beginRun().
|
private |
Definition at line 63 of file TTStubAssociator.h.
Referenced by TTStubAssociator< T >::beginRun().
|
private |
Definition at line 57 of file TTStubAssociator.h.
Referenced by TTStubAssociator< T >::TTStubAssociator().
|
private |
Definition at line 60 of file TTStubAssociator.h.
Referenced by TTStubAssociator< T >::TTStubAssociator().
|
private |
Data members.
Definition at line 56 of file TTStubAssociator.h.
Referenced by TTStubAssociator< T >::TTStubAssociator().
|
private |
Definition at line 59 of file TTStubAssociator.h.
Referenced by TTStubAssociator< T >::TTStubAssociator().