Plugin to load the Stub finding algorithm and produce the collection of Stubs that goes in the event content. More...
#include <TTStubBuilder.h>
Public Types | |
enum | FEreject { CBCFailOffset = 500, CICFailOffset = 1000 } |
Public Types inherited from edm::one::EDProducerBase | |
typedef EDProducerBase | 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 |
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<typename TT > | |
void | fill (edmNew::DetSetVector< TT > &outputEP, const DetId &detId, const std::vector< TT > &inputVec) const |
Fill output cluster & stub collections. More... | |
void | produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override |
template<> | |
void | produce (edm::Event &iEvent, const edm::EventSetup &iSetup) |
template<> | |
void | produce (edm::Event &iEvent, const edm::EventSetup &iSetup) |
template<> | |
void | updateStubs (const edm::OrphanHandle< edmNew::DetSetVector< TTCluster< Ref_Phase2TrackerDigi_ >>> &clusterHandle, const edmNew::DetSetVector< TTStub< Ref_Phase2TrackerDigi_ >> &inputEDstubs, edmNew::DetSetVector< TTStub< Ref_Phase2TrackerDigi_ >> &outputEDstubs) const |
void | updateStubs (const edm::OrphanHandle< edmNew::DetSetVector< TTCluster< Ref_Phase2TrackerDigi_ >>> &clusterHandle, const edmNew::DetSetVector< TTStub< Ref_Phase2TrackerDigi_ >> &inputEDstubs, edmNew::DetSetVector< TTStub< Ref_Phase2TrackerDigi_ >> &outputEDstubs) const |
Update output stubs with Refs to cluster collection that is associated to stubs. More... | |
Static Private Member Functions | |
static bool | SortStubBendPairs (const std::pair< unsigned int, double > &left, const std::pair< unsigned int, double > &right) |
Sort routine for stub ordering. More... | |
static bool | SortStubsBend (const TTStub< T > &left, const TTStub< T > &right) |
Analogous sorting routine directly from stubs. More... | |
Private Attributes | |
bool | applyFE |
FE truncation. More... | |
edm::EDGetTokenT < edmNew::DetSetVector < TTCluster< T > > > | clustersToken |
bool | ForbidMultipleStubs |
unsigned int | high_rate_max_layer |
unsigned int | high_rate_max_ring [5] |
int | ievt |
Temporary storage for stubs over several events for truncation use. More... | |
unsigned int | maxStubs_2S |
unsigned int | maxStubs_2S_CIC_5 |
unsigned int | maxStubs_PS |
unsigned int | maxStubs_PS_CIC_10 |
unsigned int | maxStubs_PS_CIC_5 |
std::unordered_map< int, int > | moduleStubs_CBC |
std::unordered_map< int, std::vector< TTStub < Ref_Phase2TrackerDigi_ > > > | moduleStubs_CIC |
std::unordered_map< int, int > | moduleStubs_MPA |
edm::ESGetToken < TrackerGeometry, TrackerDigiGeometryRecord > | tGeomToken |
edm::ESHandle< TTStubAlgorithm < T > > | theStubFindingAlgoHandle |
Data members. More... | |
edm::ESGetToken < TrackerTopology, TrackerTopologyRcd > | tTopoToken |
edm::ESGetToken < TTStubAlgorithm< T > , TTStubAlgorithmRecord > | ttStubToken |
Additional Inherited Members | |
Static Public Member Functions inherited from edm::one::EDProducerBase | |
static const std::string & | baseType () |
static void | fillDescriptions (ConfigurationDescriptions &descriptions) |
static void | prevalidate (ConfigurationDescriptions &descriptions) |
Protected Member Functions inherited from edm::ProducerBase | |
ProducesCollector | producesCollector () |
Protected Member Functions inherited from edm::EDConsumerBase | |
template<typename ProductType , BranchType B = InEvent> | |
EDGetTokenT< ProductType > | consumes (edm::InputTag const &tag) |
template<BranchType B = InEvent> | |
EDConsumerBaseAdaptor< B > | consumes (edm::InputTag tag) noexcept |
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event> | |
auto | esConsumes () |
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event> | |
auto | esConsumes (ESInputTag const &tag) |
template<Transition Tr = Transition::Event> | |
constexpr auto | esConsumes () |
template<Transition Tr = Transition::Event> | |
auto | esConsumes (ESInputTag tag) |
template<Transition Tr = Transition::Event> | |
ESGetTokenGeneric | esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey) |
Used with EventSetupRecord::doGet. More... | |
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) |
void | resetItemsToGetFrom (BranchType iType) |
Plugin to load the Stub finding algorithm and produce the collection of Stubs that goes in the event content.
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 45 of file TTStubBuilder.h.
enum TTStubBuilder::FEreject |
Enumerator | |
---|---|
CBCFailOffset | |
CICFailOffset |
Definition at line 54 of file TTStubBuilder.h.
|
explicit |
Constructor.
Close class.
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 125 of file TTStubBuilder.h.
References edm::BeginRun, and edm::ParameterSet::getParameter().
|
override |
|
overrideprivate |
Mandatory methods.
Begin run.
Get the stub finding algorithm
Definition at line 159 of file TTStubBuilder.h.
References edm::EventSetup::getHandle().
|
overrideprivate |
|
inlineprivate |
Fill output cluster & stub collections.
Create the FastFiller
Definition at line 78 of file TTStubBuilder.h.
References edmNew::DetSetVector< T >::FastFiller::begin(), filterCSVwithJSON::copy, and edmNew::DetSetVector< T >::FastFiller::resize().
|
overrideprivatevirtual |
Implements edm::one::EDProducerBase.
|
privatevirtual |
– Prepare output TTClusters associated to TTStubs
TTStubs with Refs to clusters pointing to collection of clusters in entire tracker.
TTStubs with Refs to clusters pointing to collection of clusters associated to stubs.
Read the Clusters from the entire tracker.
Go on only if both detectors have Clusters
Get the DetSets of the Clusters
If there are Clusters in both sensors, you can try and make a Stub This is ~redundant
Create the vectors of objects to be passed to the FastFillers
Get chip size information FIX ME: Should take this from TrackerTopology, but it was buggy in 2017 (SV)
Loop over pairs of Clusters
Temporary storage to allow only one stub per inner cluster, if requested in cfi
Build a temporary Stub
Check for compatibility of cluster pair
If the Stub is above threshold
Stub accepted
End of loop over upper clusters
Here tempOutput stores all the stubs from this lower cluster Check if there is need to store only one or two (2S/PS modules cases) (if only one already, skip this step)
If so, sort the stubs by bend and keep only the first one (2S case) or the first pair (PS case) (smallest |bend|)
Get to the second element (the switch above ensures there are min 2)
tempIter points now to the second or third element (2S/PS)
Delete all-but-the first one from tempOutput
Here, tempOutput is either of size 1 (if ForbidMultupleStubs = true), or of size N with all the valid combinations ...
Now loop over the accepted stubs (1 or N) for this lower cluster
Put in the output
This means that ALL stubs go into the output
This means that only some stubs go to the output
Find out which MPA/CBC ASIC
Find out which CIC ASIC
TO FIX: The maxStub stubs with lowest |bend| are retained. This algo considers all stubs since the last multiple of 8 events, (i.e. in 1-8 events), whereas true CIC chip considers all stubs in current block of 8 events (i.e. always in 8 events). So may be optimistic.
Sort stubs by |bend|.
End of check on max number of stubs per module
End of nested loop
End of loop over pairs of Clusters
Fill output collections
End of loop over detector elements
The TTStubs created above contain Refs to the ClusterInclusive collection (all clusters in Tracker). Replace them with new TTStubs with Refs to ClusterAccepted collection (only clusters in Stubs), so big ClusterInclusive collection can be dropped.
Put output in the event (2)
Implements edm::one::EDProducerBase.
Definition at line 90 of file TTStubBuilder.cc.
References TTStub< T >::addClusterRef(), edmNew::DetSet< T >::begin(), TrackerGeometry::dets(), edmNew::DetSet< T >::empty(), edmNew::DetSet< T >::end(), PVValHelper::fill(), first, edm::Event::getByToken(), TrackerGeometry::getDetectorType(), edm::EventSetup::getHandle(), mps_fire::i, TrackerTopology::isLower(), TrackerTopology::layer(), edmNew::makeRefTo(), eostools::move(), TrackerTopology::partnerDetId(), TrackerGeometry::Ph2PSP, edm::ESHandle< class >::product(), edm::Event::put(), TTStub< T >::setBendBE(), TTStub< T >::setBendOffset(), TTStub< T >::setModuleTypePS(), TTStub< T >::setRawBend(), findQualityFiles::size, TrackerTopology::stack(), DetId::subdetId(), StripSubdetector::TID, TrackerTopology::tidRing(), TrackerTopology::tidWheel(), StripSubdetector::TOB, and PV2DBase< T, PVType, FrameType >::y().
|
privatevirtual |
Implements edm::one::EDProducerBase.
|
staticprivate |
Sort routine for stub ordering.
Sorting method for stubs NOTE: this must be static!
Definition at line 174 of file TTStubBuilder.h.
References funct::abs().
|
staticprivate |
Analogous sorting routine directly from stubs.
Definition at line 181 of file TTStubBuilder.h.
References funct::abs(), and TTStub< T >::bendFE().
|
private |
Here, in the source file, the methods which do depend on the specific type <T> that can fit the template.
Loop over tracker modules
Get the DetId and prepare the FastFiller
detid of the two components. This should be done via a TrackerTopology method that is not yet available.
Get the DetSets of the clusters
Get the DetSet of the stubs
Prepare the new DetSet to replace the current one Loop over the stubs in this module
Create a temporary stub
Compare the clusters stored in the stub with the ones of this module
If no compatible clusters were found, skip to the next one
getters for RawBend & BendOffset are in FULL-strip units, setters are in HALF-strip units
End of loop over stubs of this module
End of loop over stub DetSetVector
Definition at line 18 of file TTStubBuilder.cc.
References edmNew::DetSet< T >::begin(), edmNew::DetSet< T >::end(), edmNew::makeRefTo(), callgraph::module, and edmNew::DetSetVector< T >::push_back().
|
private |
Update output stubs with Refs to cluster collection that is associated to stubs.
|
private |
FE truncation.
Definition at line 92 of file TTStubBuilder.h.
|
private |
Definition at line 59 of file TTStubBuilder.h.
|
private |
Definition at line 63 of file TTStubBuilder.h.
|
private |
Definition at line 106 of file TTStubBuilder.h.
|
private |
Definition at line 105 of file TTStubBuilder.h.
|
private |
Temporary storage for stubs over several events for truncation use.
Definition at line 109 of file TTStubBuilder.h.
|
private |
Definition at line 95 of file TTStubBuilder.h.
|
private |
Definition at line 97 of file TTStubBuilder.h.
|
private |
Definition at line 96 of file TTStubBuilder.h.
|
private |
Definition at line 99 of file TTStubBuilder.h.
|
private |
Definition at line 98 of file TTStubBuilder.h.
|
private |
Definition at line 112 of file TTStubBuilder.h.
|
private |
Definition at line 110 of file TTStubBuilder.h.
|
private |
Definition at line 111 of file TTStubBuilder.h.
|
private |
Definition at line 61 of file TTStubBuilder.h.
|
private |
Data members.
Definition at line 58 of file TTStubBuilder.h.
|
private |
Definition at line 60 of file TTStubBuilder.h.
|
private |
Definition at line 62 of file TTStubBuilder.h.