CMS 3D CMS Logo

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

Public Member Functions

 Phase2TrackerClusterizer (const edm::ParameterSet &conf)
 
void produce (edm::Event &event, const edm::EventSetup &eventSetup) override
 
 ~Phase2TrackerClusterizer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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
 

Detailed Description

Definition at line 30 of file Phase2TrackerClusterizer.cc.

Constructor & Destructor Documentation

◆ Phase2TrackerClusterizer()

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

Definition at line 47 of file Phase2TrackerClusterizer.cc.

48  :
49 #ifdef VERIFY_PH2_TK_CLUS
50  clusterizer_(new Phase2TrackerClusterizerAlgorithm(conf.getParameter<unsigned int>("maxClusterSize"),
51  conf.getParameter<unsigned int>("maxNumberClusters"))),
52 #endif
54  produces<Phase2TrackerCluster1DCollectionNew>();
55 }

◆ ~Phase2TrackerClusterizer()

Phase2TrackerClusterizer::~Phase2TrackerClusterizer ( )
override

Definition at line 57 of file Phase2TrackerClusterizer.cc.

57 {}

Member Function Documentation

◆ produce()

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

Definition at line 63 of file Phase2TrackerClusterizer.cc.

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

References edmNew::DetSetVector< T >::FastFiller::abort(), cms::cuda::assert(), GetRecoTauVFromDQM_MC_cff::cl, bsc_activity_cfg::clusters, gather_cfg::cout, CommonMethods::cp(), options_cfi::eventSetup, get, mps_fire::i, TrackerGeometry::idToDetUnit(), createfilelist::int, eostools::move(), token_, and mitigatedMETSequence_cff::U.

Member Data Documentation

◆ token_

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

Definition at line 40 of file Phase2TrackerClusterizer.cc.

Referenced by produce().

edm::DetSetVector
Definition: DetSetVector.h:61
edmNew::DetSetVector::FastFiller::abort
void abort()
Definition: DetSetVectorNew.h:270
mps_fire.i
i
Definition: mps_fire.py:355
GeomDet
Definition: GeomDet.h:27
gather_cfg.cout
cout
Definition: gather_cfg.py:144
cms::cuda::assert
assert(be >=bs)
edm::Handle
Definition: AssociativeIterator.h:50
GetRecoTauVFromDQM_MC_cff.cl
cl
Definition: GetRecoTauVFromDQM_MC_cff.py:38
DetId
Definition: DetId.h:17
cmsdt::algo
algo
Definition: constants.h:164
PixelGeomDetUnit
Definition: PixelGeomDetUnit.h:15
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
edm::ESHandle< TrackerGeometry >
Phase2TrackerClusterizerSequentialAlgorithm
Definition: Phase2TrackerClusterizerSequentialAlgorithm.h:9
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
Phase2TrackerClusterizerAlgorithm
Definition: Phase2TrackerClusterizerAlgorithm.h:13
createfilelist.int
int
Definition: createfilelist.py:10
get
#define get
Phase2TrackerClusterizer::token_
edm::EDGetTokenT< edm::DetSetVector< Phase2TrackerDigi > > token_
Definition: Phase2TrackerClusterizer.cc:40
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
options_cfi.eventSetup
eventSetup
Definition: options_cfi.py:12
edmNew::DetSetVector::FastFiller
Definition: DetSetVectorNew.h:236
CommonMethods.cp
def cp(fromDir, toDir, listOfFiles, overwrite=False, smallList=False)
Definition: CommonMethods.py:192
edm::InputTag
Definition: InputTag.h:15
TrackerGeometry
Definition: TrackerGeometry.h:14