Plugin to create the MC truth for TTTracks. More...
#include <TTTrackAssociator.h>
Public Member Functions | |
TTTrackAssociator (const edm::ParameterSet &iConfig) | |
Constructors. More... | |
~TTTrackAssociator () override | |
Destructor. More... | |
Public Member Functions inherited from edm::stream::EDProducer<> | |
EDProducer ()=default | |
EDProducer (const EDProducer &)=delete | |
bool | hasAbilityToProduceInBeginLumis () const final |
bool | hasAbilityToProduceInBeginProcessBlocks () const final |
bool | hasAbilityToProduceInBeginRuns () const final |
bool | hasAbilityToProduceInEndLumis () const final |
bool | hasAbilityToProduceInEndProcessBlocks () const final |
bool | hasAbilityToProduceInEndRuns () const final |
const EDProducer & | operator= (const EDProducer &)=delete |
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< TTClusterAssociationMap< T > > | ttClusterTruthToken_ |
edm::EDGetTokenT< TTStubAssociationMap< T > > | ttStubTruthToken_ |
bool | TTTrackAllowOneFalse2SStub |
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<> | |
using | CacheTypes = CacheContexts< T... > |
using | GlobalCache = typename CacheTypes::GlobalCache |
using | HasAbility = AbilityChecker< T... > |
using | InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache |
using | LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache |
using | LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache > |
using | LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache |
using | RunCache = typename CacheTypes::RunCache |
using | RunContext = RunContextT< RunCache, GlobalCache > |
using | RunSummaryCache = typename CacheTypes::RunSummaryCache |
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 41 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 77 of file TTTrackAssociator.h.
References edm::ParameterSet::getParameter(), TTTrackAssociation_cfi::TTTrackAllowOneFalse2SStub, and trackerHitRTTI::vector.
|
override |
|
overrideprivate |
Mandatory methods.
Begin run.
Print some information when loaded
Definition at line 101 of file TTTrackAssociator.h.
|
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 Stub and Cluster MC truth
Loop over InputTags to handle multiple collections
Prepare output
Get the Tracks already stored away
Prepare the necessary maps
Make the pointer to be put in the map
Get all the stubs of the TTTrack (theseStubs)
Auxiliary map to relate TP addresses and TP edm::Ptr
Fill the map associating each TP to a vector of L1 tracks. Do this using the association map of the clusters inside each stub, as stub associator misses stub –> all TP map (FIX).
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 are >= 2 unknown stubs, go to the next track as this track may be COMBINATORIC or UNKNOWN (One unknown is allowed, if in 2S module).
If we are here, all the stubs on track 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 (stored in auxMap), to check if any are present in all stubs on Track.
Get all associated stubs of this TrackingParticle
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 this TP does not appear in all stubs (allowing one wrong stub) then try next TP.
If we are here, it means that the TrackingParticle generates hits in all stubs (allowing one incorrect one) of the current track so put it into the vector
Count how many TrackingParticles were associated to all stubs on this track. FIX: Could avoid this by using std::set for tpInAllStubs?
If only one TP associated to all stubs (allowing one incorrect) on track: GENUINE or LOOSELY_GENUINE. If 0 or >= 2 TP: COMBINATORIC WARNING: This means if one TP matches all stubs, and another matches all STUBS except one, then the trackToTrackingParticleMap will not be filled. WARNING: This also means that trackToTrackingParticleMap will be filled if one TP matches all stubs, except for an incorrect one in either PS or 2S modules.
Here, the track may only be GENUINE/LOOSELY_GENUINE CHECK: Surely if one incorrect PS stub, it can also be COMBINATORIC? Fill the map associating track to its principle TP.
End of loop over Tracks
Remove duplicates from the only output map that needs it. (Map gets multiple entries per track if it has several stubs belonging to same TP).
Get the vector of edm::Ptr< TTTrack > (CHECK: Couldn't this be done by reference, to save CPU?)
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(), iEvent, eostools::move(), AlCaHLTBitMon_ParallelJobs::p, edm::second(), jetUpdater_cfi::sort, TTTrackAssociation_cfi::TTTrackAllowOneFalse2SStub, and tier0::unique().
|
overrideprivate |
|
private |
Implement the producer.
|
private |
Definition at line 57 of file TTTrackAssociator.h.
|
private |
Definition at line 56 of file TTTrackAssociator.h.
|
private |
Definition at line 59 of file TTTrackAssociator.h.
|
private |
Data members.
Definition at line 53 of file TTTrackAssociator.h.
|
private |
Definition at line 55 of file TTTrackAssociator.h.