CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
TTStubBuilder< T > Class Template Reference

Plugin to load the Stub finding algorithm and produce the collection of Stubs that goes in the event content. More...

#include <TTStubBuilder.h>

Inheritance diagram for TTStubBuilder< T >:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 TTStubBuilder (const edm::ParameterSet &iConfig)
 Constructor. More...
 
 ~TTStubBuilder () override
 Destructor;. More...
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- 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 ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
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, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () 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
 
EDConsumerBaseoperator= (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

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)
 Implementation of methods of TTClusterBuilder.h. More...
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
template<>
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup)
 Implement the producer. 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

edm::EDGetTokenT< edmNew::DetSetVector< TTCluster< T > > > clustersToken
 
bool ForbidMultipleStubs
 
edm::ESHandle< TTStubAlgorithm< T > > theStubFindingAlgoHandle
 Data members. More...
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer 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
 
- Static Public Member Functions inherited from edm::EDProducer
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)
 

Detailed Description

template<typename T>
class TTStubBuilder< T >

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.

Author
Andrew W. Rose
Nicola Pozzobon
Ivan Reid
Date
2013, Jul 18

Definition at line 43 of file TTStubBuilder.h.

Constructor & Destructor Documentation

template<typename T >
TTStubBuilder< T >::TTStubBuilder ( const edm::ParameterSet iConfig)
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 78 of file TTStubBuilder.h.

References TTStubBuilder< T >::clustersToken, TTStubBuilder< T >::ForbidMultipleStubs, and edm::ParameterSet::getParameter().

79 {
80  clustersToken = consumes< edmNew::DetSetVector< TTCluster< T > > >(iConfig.getParameter< edm::InputTag >( "TTClusters" ));
81  ForbidMultipleStubs = iConfig.getParameter< bool >( "OnlyOnePerInputCluster" );
82  produces< edmNew::DetSetVector< TTCluster< T > > >( "ClusterAccepted" );
83  produces< edmNew::DetSetVector< TTStub< T > > >( "StubAccepted" );
84  produces< edmNew::DetSetVector< TTStub< T > > >( "StubRejected" );
85 }
T getParameter(std::string const &) const
edm::EDGetTokenT< edmNew::DetSetVector< TTCluster< T > > > clustersToken
Definition: TTStubBuilder.h:55
bool ForbidMultipleStubs
Definition: TTStubBuilder.h:56
template<typename T >
TTStubBuilder< T >::~TTStubBuilder ( )
override

Destructor;.

Destructor.

Definition at line 89 of file TTStubBuilder.h.

89 {}

Member Function Documentation

template<typename T >
void TTStubBuilder< T >::beginRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
overrideprivate

Mandatory methods.

Begin run.

Get the stub finding algorithm

Definition at line 93 of file TTStubBuilder.h.

References edm::EventSetup::get(), and TTStubBuilder< T >::theStubFindingAlgoHandle.

94 {
97 }
Class to store the TTStubAlgorithm used in TTStubBuilder.
const T & get() const
Definition: EventSetup.h:55
edm::ESHandle< TTStubAlgorithm< T > > theStubFindingAlgoHandle
Data members.
Definition: TTStubBuilder.h:54
template<typename T >
void TTStubBuilder< T >::endRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
overrideprivate

End run.

Definition at line 101 of file TTStubBuilder.h.

101 {}
template<>
void TTStubBuilder< Ref_Phase2TrackerDigi_ >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
private

Implementation of methods of TTClusterBuilder.h.

Here, in the source file, the methods which do depend on the specific type <T> that can fit the template.

Author
Andrew W. Rose
Nicola Pozzobon
Ivan Reid
Date
2013, Jul 18Implement the producer

Prepare output

Get the Clusters already stored away

Get the maximum number of stubs per ROC (CBC3-style)

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

Need to find ASIC size in half-strip units

Temporary storage for stubs before max check

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

If the Stub is above threshold

Stub accepted

End of loop over outer clusters

Here tempOutput stores all the stubs from this inner cluster Check if there is need to store only one (if only one already, skip this step)

If so, sort the stubs by bend and keep only the first one (smallest bend)

Get to the second element (the switch above ensures there are min 2)

tempIter points now to the second element

Delete all-but-the first one from tempOutput

Here, tempOutput is either of size 1 (if entering the switch) either of size N with all the valid combinations ...

Now loop over the accepted stubs (1 or N) for this inner cluster

Get the stub

Put in the output

This means that ALL stubs go into the output

This means that only some of them do Put in the temporary output

Find out which ASIC

Already a stub for this ASIC?

No, so new entry

Already existing entry

End of check on max number of stubs per module

End of nested loop

End of loop over pairs of Clusters

If we are working with max no. stub/ROC, then clean the temporary output and store only the selected stubs

Loop over ROC's the ROC ID is not important

Put the stubs into the output

Sort them and pick up only the first N.

Put the highest momenta (lowest bend) stubs into the event

End of loop over temp output

End store only the selected stubs if max no. stub/ROC is set

Create the FastFillers

End of loop over detector elements

Put output in the event (1) Get also the OrphanHandle of the accepted clusters

Now, correctly reset the output

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

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

getter is in FULL-strip units, setter is in HALF-strip units

getter is in FULL-strip units, setter is in HALF-strip units

End of loop over stubs of this module

End of loop over stub DetSetVector

Put output in the event (2)

Definition at line 16 of file TTStubBuilder.cc.

References TTStub< T >::addClusterRef(), edmNew::DetSet< T >::begin(), edmNew::DetSetVector< T >::begin(), TrackerGeometry::dets(), edmNew::DetSet< T >::empty(), edmNew::DetSetVector< T >::empty(), edmNew::DetSet< T >::end(), edmNew::DetSetVector< T >::end(), funct::false, edm::EventSetup::get(), edm::Event::getByToken(), TTStub< T >::getClusterRef(), TTStub< T >::getTriggerPosition(), mps_fire::i, edmNew::DetSetVector< T >::id(), TrackerGeometry::idToDetUnit(), TrackerTopology::isLower(), funct::m, edmNew::makeRefTo(), eostools::move(), TrackerTopology::partnerDetId(), edm::ESHandle< T >::product(), edmNew::DetSetVector< T >::push_back(), edm::Event::put(), PixelTopology::rowsperroc(), TTStub< T >::setTriggerDisplacement(), TTStub< T >::setTriggerOffset(), PixelGeomDetUnit::specificTopology(), TrackerTopology::stack(), DetId::subdetId(), StripSubdetector::TID, and StripSubdetector::TOB.

17 {
18  //Retrieve tracker topology from geometry
20  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
21  const TrackerTopology* const tTopo = tTopoHandle.product();
23  iSetup.get< TrackerDigiGeometryRecord >().get( tGeomHandle );
24  const TrackerGeometry* const theTrackerGeom = tGeomHandle.product();
25 
27  auto ttClusterDSVForOutput = std::make_unique<edmNew::DetSetVector<TTCluster<Ref_Phase2TrackerDigi_>>>();
28  auto ttStubDSVForOutputTemp = std::make_unique<edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_>>>();
29  auto ttStubDSVForOutputAccepted = std::make_unique<edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_>>>();
30  auto ttStubDSVForOutputRejected = std::make_unique<edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_>>>();
31 
34  iEvent.getByToken( clustersToken, clusterHandle );
35 
38  // unsigned maxStubs = theStackedTracker->getCBC3MaxStubs();
39  unsigned maxStubs = 0; // 0 is default, cut is disabled
40 
41  for (auto gd=theTrackerGeom->dets().begin(); gd != theTrackerGeom->dets().end(); gd++) {
42  DetId detid = (*gd)->geographicalId();
43  if(detid.subdetId()!=StripSubdetector::TOB && detid.subdetId()!=StripSubdetector::TID ) continue; // only run on OT
44  if(!tTopo->isLower(detid) ) continue; // loop on the stacks: choose the lower arbitrarily
45  DetId lowerDetid = detid;
46  DetId upperDetid = tTopo->partnerDetId(detid);
47  DetId stackDetid = tTopo->stack(detid);
48 
50  if ( clusterHandle->find( lowerDetid ) == clusterHandle->end() ||
51  clusterHandle->find( upperDetid ) == clusterHandle->end() )
52  continue;
53 
55  edmNew::DetSet< TTCluster< Ref_Phase2TrackerDigi_ > > lowerClusters = (*clusterHandle)[ lowerDetid ];
56  edmNew::DetSet< TTCluster< Ref_Phase2TrackerDigi_ > > upperClusters = (*clusterHandle)[ upperDetid ];
57 
61  if ( lowerClusters.empty() || upperClusters.empty() )
62  continue;
63 
65  std::vector< TTCluster< Ref_Phase2TrackerDigi_ > > tempInner;
66  std::vector< TTCluster< Ref_Phase2TrackerDigi_ > > tempOuter;
67  std::vector< TTStub< Ref_Phase2TrackerDigi_ > > tempAccepted;
68  tempInner.clear();
69  tempOuter.clear();
70  tempAccepted.clear();
71 
73  const GeomDetUnit* det0 = theTrackerGeom->idToDetUnit( lowerDetid );
74  const PixelGeomDetUnit* pix0 = dynamic_cast< const PixelGeomDetUnit* >( det0 );
75  const PixelTopology* top0 = dynamic_cast< const PixelTopology* >( &(pix0->specificTopology()) );
76  const int chipSize = 2 * top0->rowsperroc();
77 
78  std::unordered_map< int, std::vector< TTStub< Ref_Phase2TrackerDigi_ > > > moduleStubs;
79 
81  for ( auto lowerClusterIter = lowerClusters.begin();
82  lowerClusterIter != lowerClusters.end();
83  ++lowerClusterIter ) {
84 
87  std::vector< TTStub< Ref_Phase2TrackerDigi_ > > tempOutput;
88  // tempOutput.clear();
89 
90  for ( auto upperClusterIter = upperClusters.begin();
91  upperClusterIter != upperClusters.end();
92  ++upperClusterIter ) {
93 
95  TTStub< Ref_Phase2TrackerDigi_ > tempTTStub( stackDetid );
96  tempTTStub.addClusterRef( edmNew::makeRefTo( clusterHandle, lowerClusterIter ) );
97  tempTTStub.addClusterRef( edmNew::makeRefTo( clusterHandle, upperClusterIter ) );
98 
100  bool thisConfirmation = false;
101  int thisDisplacement = 999999;
102  int thisOffset = 0;
103 
104  theStubFindingAlgoHandle->PatternHitCorrelation( thisConfirmation, thisDisplacement, thisOffset, tempTTStub );
105 
107  if ( thisConfirmation )
108  {
109  tempTTStub.setTriggerDisplacement( thisDisplacement );
110  tempTTStub.setTriggerOffset( thisOffset );
111  tempOutput.push_back( tempTTStub );
112  }
113  }
114 
117  if ( ForbidMultipleStubs && tempOutput.size() > 1 )
118  {
120  std::sort( tempOutput.begin(), tempOutput.end(), TTStubBuilder< Ref_Phase2TrackerDigi_ >::SortStubsBend );
121 
123  typename std::vector< TTStub< Ref_Phase2TrackerDigi_ > >::iterator tempIter = tempOutput.begin();
124  ++tempIter;
125 
127 
129  tempOutput.erase( tempIter, tempOutput.end() );
130  }
131 
134 
136  for ( unsigned int iTempStub = 0; iTempStub < tempOutput.size(); ++iTempStub )
137  {
139  const TTStub< Ref_Phase2TrackerDigi_ >& tempTTStub = tempOutput[iTempStub];
140 
142  if ( maxStubs == 0 )
143  {
145  tempInner.push_back( *(tempTTStub.getClusterRef(0)) );
146  tempOuter.push_back( *(tempTTStub.getClusterRef(1)) );
147  tempAccepted.push_back( tempTTStub );
148  }
149  else
150  {
153  int chip = tempTTStub.getTriggerPosition() / chipSize;
154  if ( moduleStubs.find( chip ) == moduleStubs.end() )
155  {
157  std::vector< TTStub< Ref_Phase2TrackerDigi_ > > tempStubs(1,tempTTStub);
158  //tempStubs.clear();
159  //tempStubs.push_back( tempTTStub );
160  moduleStubs.insert( std::pair< int, std::vector< TTStub< Ref_Phase2TrackerDigi_ > > >( chip, tempStubs ) );
161  }
162  else
163  {
165  moduleStubs[chip].push_back( tempTTStub );
166  }
167  }
168  }
169  }
170 
173  if ( moduleStubs.empty() == false )
174  {
177  for ( auto const & is : moduleStubs )
178  {
180  if ( is.second.size() <= maxStubs )
181  {
182  for ( auto const & ts: is.second )
183  {
184  tempInner.push_back( *(ts.getClusterRef(0)) );
185  tempOuter.push_back( *(ts.getClusterRef(1)) );
186  tempAccepted.push_back( ts );
187  }
188  }
189  else
190  {
192  std::vector< std::pair< unsigned int, double > > bendMap;
193  bendMap.reserve(is.second.size());
194  for ( unsigned int i = 0; i < is.second.size(); ++i )
195  {
196  bendMap.push_back( std::pair< unsigned int, double >( i, is.second[i].getTriggerBend() ) );
197  }
198  std::sort( bendMap.begin(), bendMap.end(), TTStubBuilder< Ref_Phase2TrackerDigi_ >::SortStubBendPairs );
199 
200  for ( unsigned int i = 0; i < maxStubs; ++i )
201  {
203  tempInner.push_back( *(is.second[bendMap[i].first].getClusterRef(0)) );
204  tempOuter.push_back( *(is.second[bendMap[i].first].getClusterRef(1)) );
205  tempAccepted.push_back( is.second[bendMap[i].first] );
206  }
207  }
208  }
209  }
210  if ( !tempInner.empty() )
212  {
213  typename edmNew::DetSetVector< TTCluster< Ref_Phase2TrackerDigi_ > >::FastFiller lowerOutputFiller( *ttClusterDSVForOutput, lowerDetid );
214  for ( unsigned int m = 0; m < tempInner.size(); m++ )
215  {
216  lowerOutputFiller.push_back( tempInner.at(m) );
217  }
218  if ( lowerOutputFiller.empty() )
219  lowerOutputFiller.abort();
220  }
221 
222  if ( !tempOuter.empty() )
223  {
224  typename edmNew::DetSetVector< TTCluster< Ref_Phase2TrackerDigi_ > >::FastFiller upperOutputFiller( *ttClusterDSVForOutput, upperDetid );
225  for ( unsigned int m = 0; m < tempOuter.size(); m++ )
226  {
227  upperOutputFiller.push_back( tempOuter.at(m) );
228  }
229  if ( upperOutputFiller.empty() )
230  upperOutputFiller.abort();
231  }
232 
233  if ( !tempAccepted.empty() )
234  {
235  typename edmNew::DetSetVector< TTStub< Ref_Phase2TrackerDigi_ > >::FastFiller tempAcceptedFiller( *ttStubDSVForOutputTemp, stackDetid);
236  for ( unsigned int m = 0; m < tempAccepted.size(); m++ )
237  {
238  tempAcceptedFiller.push_back( tempAccepted.at(m) );
239  }
240  if ( tempAcceptedFiller.empty() )
241  tempAcceptedFiller.abort();
242  }
243 
244  }
245 
248  edm::OrphanHandle< edmNew::DetSetVector< TTCluster< Ref_Phase2TrackerDigi_ > > > ttClusterAcceptedHandle = iEvent.put( std::move(ttClusterDSVForOutput), "ClusterAccepted" );
249 
251  typename edmNew::DetSetVector< TTStub< Ref_Phase2TrackerDigi_ > >::const_iterator stubDetIter;
252 
253  for ( stubDetIter = ttStubDSVForOutputTemp->begin();
254  stubDetIter != ttStubDSVForOutputTemp->end();
255  ++stubDetIter ) {
257  DetId thisStackedDetId = stubDetIter->id();
258  typename edmNew::DetSetVector< TTStub< Ref_Phase2TrackerDigi_ > >::FastFiller acceptedOutputFiller( *ttStubDSVForOutputAccepted, thisStackedDetId );
259 
262  DetId lowerDetid = thisStackedDetId+1;
263  DetId upperDetid = thisStackedDetId+2;
264 
266  edmNew::DetSet< TTCluster< Ref_Phase2TrackerDigi_ > > lowerClusters = (*ttClusterAcceptedHandle)[ lowerDetid ];
267  edmNew::DetSet< TTCluster< Ref_Phase2TrackerDigi_ > > upperClusters = (*ttClusterAcceptedHandle)[ upperDetid ];
268 
270  edmNew::DetSet< TTStub< Ref_Phase2TrackerDigi_ > > theseStubs = (*ttStubDSVForOutputTemp)[ thisStackedDetId ];
271 
274  typename edmNew::DetSet< TTCluster< Ref_Phase2TrackerDigi_ > >::iterator clusterIter;
275  typename edmNew::DetSet< TTStub< Ref_Phase2TrackerDigi_ > >::iterator stubIter;
276  for ( stubIter = theseStubs.begin();
277  stubIter != theseStubs.end();
278  ++stubIter ) {
280  TTStub< Ref_Phase2TrackerDigi_ > tempTTStub( stubIter->getDetId() );
281 
283  const edm::Ref< edmNew::DetSetVector< TTCluster< Ref_Phase2TrackerDigi_ > >, TTCluster< Ref_Phase2TrackerDigi_ > >& lowerClusterToBeReplaced = stubIter->getClusterRef(0);
284  const edm::Ref< edmNew::DetSetVector< TTCluster< Ref_Phase2TrackerDigi_ > >, TTCluster< Ref_Phase2TrackerDigi_ > >& upperClusterToBeReplaced = stubIter->getClusterRef(1);
285 
286  bool lowerOK = false;
287  bool upperOK = false;
288 
289  for ( clusterIter = lowerClusters.begin();
290  clusterIter != lowerClusters.end() && !lowerOK;
291  ++clusterIter ) {
292  if ( clusterIter->getHits() == lowerClusterToBeReplaced->getHits() ) {
293  tempTTStub.addClusterRef( edmNew::makeRefTo( ttClusterAcceptedHandle, clusterIter ) );
294  lowerOK = true;
295  }
296  }
297 
298  for ( clusterIter = upperClusters.begin();
299  clusterIter != upperClusters.end() && !upperOK;
300  ++clusterIter ) {
301  if ( clusterIter->getHits() == upperClusterToBeReplaced->getHits() ) {
302  tempTTStub.addClusterRef( edmNew::makeRefTo( ttClusterAcceptedHandle, clusterIter ) );
303  upperOK = true;
304  }
305  }
306 
308  if ( !lowerOK || !upperOK ) continue;
309 
310  tempTTStub.setTriggerDisplacement( 2.*stubIter->getTriggerDisplacement() );
311  tempTTStub.setTriggerOffset( 2.*stubIter->getTriggerOffset() );
312 
313  acceptedOutputFiller.push_back( tempTTStub );
314 
315  }
316 
317  if ( acceptedOutputFiller.empty() )
318  acceptedOutputFiller.abort();
319 
320  }
321 
323  iEvent.put( std::move(ttStubDSVForOutputAccepted), "StubAccepted" );
324  iEvent.put( std::move(ttStubDSVForOutputRejected), "StubRejected" );
325 }
edm::Ref< typename HandleT::element_type, typename HandleT::element_type::value_type::value_type > makeRefTo(const HandleT &iHandle, typename HandleT::element_type::value_type::const_iterator itIter)
edm::EDGetTokenT< edmNew::DetSetVector< TTCluster< T > > > clustersToken
Definition: TTStubBuilder.h:55
const_iterator end(bool update=false) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
virtual int rowsperroc() const =0
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
bool ForbidMultipleStubs
Definition: TTStubBuilder.h:56
id_type id(size_t cell) const
DetId partnerDetId(const DetId &id) const
bool isLower(const DetId &id) const
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
void setTriggerDisplacement(int aDisplacement)
In FULL-STRIP units! (hence, not implemented herein)
Definition: TTStub.h:120
bool empty() const
Definition: DetSetNew.h:90
Class to store the L1 Track Trigger stubs.
Definition: TTStub.h:22
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Definition: DetId.h:18
void setTriggerOffset(int anOffset)
In FULL-STRIP units! (hence, not implemented herein)
Definition: TTStub.h:126
NOTE: this is needed even if it seems not.
Definition: TTCluster.h:27
uint32_t stack(const DetId &id) const
const T & get() const
Definition: EventSetup.h:55
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
void addClusterRef(edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > > aTTCluster)
Definition: TTStub.h:109
iterator end()
Definition: DetSetNew.h:70
double getTriggerPosition() const
In HALF-STRIP units!
Definition: TTStub.h:130
const edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > > & getClusterRef(unsigned int hitIdentifier) const
Clusters composing the Stub.
Definition: TTStub.h:103
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:510
const_iterator begin(bool update=false) const
Plugin to load the Stub finding algorithm and produce the collection of Stubs that goes in the event ...
Definition: TTStubBuilder.h:43
edm::ESHandle< TTStubAlgorithm< T > > theStubFindingAlgoHandle
Data members.
Definition: TTStubBuilder.h:54
iterator begin()
Definition: DetSetNew.h:67
template<typename T >
void TTStubBuilder< T >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate
template<>
void TTStubBuilder< Ref_Phase2TrackerDigi_ >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
private

Implement the producer.

template<typename T >
bool TTStubBuilder< T >::SortStubBendPairs ( const std::pair< unsigned int, double > &  left,
const std::pair< unsigned int, double > &  right 
)
staticprivate

Sort routine for stub ordering.

Sorting method for stubs NOTE: this must be static!

Definition at line 105 of file TTStubBuilder.h.

106 {
107  return fabs(left.second) < fabs(right.second);
108 }
template<typename T >
bool TTStubBuilder< T >::SortStubsBend ( const TTStub< T > &  left,
const TTStub< T > &  right 
)
staticprivate

Analogous sorting routine directly from stubs.

Definition at line 112 of file TTStubBuilder.h.

References TTStub< T >::getTriggerBend(), iEvent, and TTStubBuilder< T >::produce().

113 {
114  return fabs(left.getTriggerBend()) < fabs(right.getTriggerBend());
115 }
double getTriggerBend() const
In FULL-STRIP units!
Definition: TTStub.h:136

Member Data Documentation

template<typename T >
edm::EDGetTokenT< edmNew::DetSetVector< TTCluster< T > > > TTStubBuilder< T >::clustersToken
private

Definition at line 55 of file TTStubBuilder.h.

Referenced by TTStubBuilder< T >::TTStubBuilder().

template<typename T >
bool TTStubBuilder< T >::ForbidMultipleStubs
private

Definition at line 56 of file TTStubBuilder.h.

Referenced by TTStubBuilder< T >::TTStubBuilder().

template<typename T >
edm::ESHandle< TTStubAlgorithm< T > > TTStubBuilder< T >::theStubFindingAlgoHandle
private

Data members.

Definition at line 54 of file TTStubBuilder.h.

Referenced by TTStubBuilder< T >::beginRun().