Plugin to create the MC truth for TTStubs. More...
#include <TTStubAssociator.h>
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::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 |
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 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 82 of file TTStubAssociator.h.
References edm::EDConsumerBase::consumes(), edm::ParameterSet::getParameter(), TTStubAssociator< T >::TTClusterTruthInputTags, TTStubAssociator< T >::TTClusterTruthTokens, TTStubAssociator< T >::TTStubsInputTags, and TTStubAssociator< T >::TTStubsTokens.
TTStubAssociator< T >::~TTStubAssociator | ( | ) |
|
privatevirtual |
Mandatory methods.
Begin run.
Print some information when loaded
Definition at line 107 of file TTStubAssociator.h.
References edm::EventSetup::get(), TTStubAssociator< T >::theTrackerGeometry, and TTStubAssociator< T >::theTrackerTopology.
|
privatevirtual |
End run.
Definition at line 118 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(), PhysicsTools::escape(), edm::Event::getByToken(), mps_fire::i, TrackerTopology::isLower(), edm::Ptr< T >::isNull(), edm::EventBase::isRealData(), gen::k, edmNew::makeRefTo(), eostools::move(), NULL, edm::Event::put(), TrackerTopology::stack(), DetId::subdetId(), StripSubdetector::TID, StripSubdetector::TOB, and tier0::unique().
|
privatevirtual |
Referenced by TTStubAssociator< T >::endRun().
|
private |
Implement the producer.
|
private |
Definition at line 63 of file TTStubAssociator.h.
Referenced by TTStubAssociator< T >::beginRun().
|
private |
Definition at line 64 of file TTStubAssociator.h.
Referenced by TTStubAssociator< T >::beginRun().
|
private |
Definition at line 58 of file TTStubAssociator.h.
Referenced by TTStubAssociator< T >::TTStubAssociator().
|
private |
Definition at line 61 of file TTStubAssociator.h.
Referenced by TTStubAssociator< T >::TTStubAssociator().
|
private |
Data members.
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().