CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
Phase2TrackerClusterizer Class Reference
Inheritance diagram for Phase2TrackerClusterizer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 Phase2TrackerClusterizer (const edm::ParameterSet &conf)
 
virtual void produce (edm::Event &event, const edm::EventSetup &eventSetup) override
 
virtual ~Phase2TrackerClusterizer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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 ()
 
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, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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 & itemsToGetFromEvent () 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 Attributes

edm::EDGetTokenT< edm::DetSetVector< Phase2TrackerDigi > > token_
 

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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
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)
 

Detailed Description

Definition at line 32 of file Phase2TrackerClusterizer.cc.

Constructor & Destructor Documentation

Phase2TrackerClusterizer::Phase2TrackerClusterizer ( const edm::ParameterSet conf)
explicit

Definition at line 52 of file Phase2TrackerClusterizer.cc.

52  :
53 #ifdef VERIFY_PH2_TK_CLUS
54  clusterizer_(new Phase2TrackerClusterizerAlgorithm(conf.getParameter< unsigned int >("maxClusterSize"), conf.getParameter< unsigned int >("maxNumberClusters"))),
55 #endif
57  produces< Phase2TrackerCluster1DCollectionNew >();
58  }
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::DetSetVector< Phase2TrackerDigi > > token_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Phase2TrackerClusterizer::~Phase2TrackerClusterizer ( )
virtual

Definition at line 60 of file Phase2TrackerClusterizer.cc.

60 { }

Member Function Documentation

void Phase2TrackerClusterizer::produce ( edm::Event event,
const edm::EventSetup eventSetup 
)
overridevirtual

Definition at line 66 of file Phase2TrackerClusterizer.cc.

References edmNew::DetSetVector< T >::FastFiller::abort(), patPFMETCorrections_cff::algo, GetRecoTauVFromDQM_MC_cff::cl, fastPrimaryVertexProducer_cfi::clusters, gather_cfg::cout, DEFINE_FWK_MODULE, edm::EventSetup::get(), mps_fire::i, TrackerGeometry::idToDetUnit(), createfilelist::int, eostools::move(), token_, and mitigatedMETSequence_cff::U.

66  {
67 
68  // Get the Digis
70  event.getByToken(token_, digis);
71 
72 #ifdef VERIFY_PH2_TK_CLUS
73  // Get the geometry
75  eventSetup.get< TrackerDigiGeometryRecord >().get(geomHandle);
76  const TrackerGeometry* tkGeom(&(*geomHandle));
77  // Global container for the clusters of each modules
78  auto outputClustersOld = std::make_unique<Phase2TrackerCluster1DCollectionNew>();
79 #endif
80  auto outputClusters = std::make_unique<Phase2TrackerCluster1DCollectionNew>();
81 
82  // Go over all the modules
83  for (auto DSViter : *digis) {
84  DetId detId(DSViter.detId());
85 
86  Phase2TrackerCluster1DCollectionNew::FastFiller clusters(*outputClusters, DSViter.detId());
88  algo.clusterizeDetUnit(DSViter, clusters);
89  if (clusters.empty()) clusters.abort();
90 
91 #ifdef VERIFY_PH2_TK_CLUS
92  // Geometry
93  const GeomDetUnit* geomDetUnit(tkGeom->idToDetUnit(detId));
94  const PixelGeomDetUnit* pixDet = dynamic_cast< const PixelGeomDetUnit* >(geomDetUnit);
95  if (!pixDet) assert(0);
96 
97  // Container for the clusters that will be produced for this modules
98  Phase2TrackerCluster1DCollectionNew::FastFiller clustersOld(*outputClustersOld, DSViter.detId());
99 
100  // Setup the clusterizer algorithm for this detector (see ClusterizerAlgorithm for more details)
101  clusterizer_->setup(pixDet);
102 
103  // Pass the list of Digis to the main algorithm
104  // This function will store the clusters in the previously created container
105  clusterizer_->clusterizeDetUnit(DSViter, clustersOld);
106  if (clustersOld.empty()) clustersOld.abort();
107 
108  if (clusters.size() != clustersOld.size()) {
109  std::cout << "SIZEs " << int(detId) << ' ' << clusters.size() << ' ' << clustersOld.size() << std::endl;
110  for (auto const & cl : clusters) std::cout << cl.size() << ' ' << cl.threshold() << ' ' << cl.firstRow() << ' ' << cl.column() << std::endl;
111  std::cout << "Old " << std::endl;
112  for (auto const & cl : clustersOld) std::cout << cl.size() << ' ' << cl.threshold() << ' ' << cl.firstRow() << ' ' << cl.column() << std::endl;
113  }
114 #endif
115 
116  }
117 
118 #ifdef VERIFY_PH2_TK_CLUS
119  // std::cout << "SIZEs " << outputClusters->dataSize() << ' ' << outputClustersOld->dataSize() << std::endl;
120  assert(outputClusters->dataSize()==outputClustersOld->dataSize());
121  for (auto i=0U;i<outputClusters->dataSize(); ++i) {
122  assert(outputClusters->data()[i].size() == outputClustersOld->data()[i].size());
123  assert(outputClusters->data()[i].threshold() == outputClustersOld->data()[i].threshold());
124  assert(outputClusters->data()[i].firstRow() == outputClustersOld->data()[i].firstRow());
125  assert(outputClusters->data()[i].column() == outputClustersOld->data()[i].column());
126  }
127 #endif
128 
129  // Add the data to the output
130  outputClusters->shrink_to_fit();
131  event.put(std::move(outputClusters));
132  }
edm::EDGetTokenT< edm::DetSetVector< Phase2TrackerDigi > > token_
Definition: DetId.h:18
const T & get() const
Definition: EventSetup.h:56
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

edm::EDGetTokenT< edm::DetSetVector< Phase2TrackerDigi > > Phase2TrackerClusterizer::token_
private

Definition at line 43 of file Phase2TrackerClusterizer.cc.

Referenced by produce().