CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
ClusterChecker Class Reference

#include <ClusterChecker.h>

Public Member Functions

 ClusterChecker (const edm::ParameterSet &conf, edm::ConsumesCollector &iC)
 
 ClusterChecker (const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
 
 ClusterChecker ()=delete
 
size_t tooManyClusters (const edm::Event &e) const
 
 ~ClusterChecker ()
 

Static Public Member Functions

static void fillDescriptions (edm::ParameterSetDescription &description)
 

Private Attributes

edm::InputTag clusterCollectionInputTag_
 
bool doACheck_
 
unsigned int ignoreDetsAboveNClusters_
 
unsigned int maxNrOfPixelClusters_
 
unsigned int maxNrOfStripClusters_
 
edm::InputTag pixelClusterCollectionInputTag_
 
StringCutObjectSelector< reco::utils::ClusterTotalsselector_
 
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > token_pc
 
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > token_sc
 

Detailed Description

Definition at line 30 of file ClusterChecker.h.

Constructor & Destructor Documentation

◆ ClusterChecker() [1/3]

ClusterChecker::ClusterChecker ( const edm::ParameterSet conf,
edm::ConsumesCollector iC 
)

Definition at line 12 of file ClusterChecker.cc.

References clusterCollectionInputTag_, edm::ConsumesCollector::consumes(), doACheck_, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), ignoreDetsAboveNClusters_, maxNrOfPixelClusters_, maxNrOfStripClusters_, pixelClusterCollectionInputTag_, token_pc, and token_sc.

13  : doACheck_(conf.getParameter<bool>("doClusterCheck")),
14  selector_(conf.getParameter<bool>("doClusterCheck") && conf.existsAs<std::string>("cut")
15  ? conf.getParameter<std::string>("cut")
16  : "") {
17  if (doACheck_) {
18  clusterCollectionInputTag_ = conf.getParameter<edm::InputTag>("ClusterCollectionLabel");
19  pixelClusterCollectionInputTag_ = conf.getParameter<edm::InputTag>("PixelClusterCollectionLabel");
22  maxNrOfStripClusters_ = conf.getParameter<unsigned int>("MaxNumberOfStripClusters");
23  maxNrOfPixelClusters_ = conf.getParameter<unsigned int>("MaxNumberOfPixelClusters");
24  if (conf.existsAs<uint32_t>("DontCountDetsAboveNClusters")) {
25  ignoreDetsAboveNClusters_ = conf.getParameter<uint32_t>("DontCountDetsAboveNClusters");
26  } else {
28  }
29  }
30 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::InputTag clusterCollectionInputTag_
StringCutObjectSelector< reco::utils::ClusterTotals > selector_
unsigned int maxNrOfStripClusters_
unsigned int maxNrOfPixelClusters_
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:172
unsigned int ignoreDetsAboveNClusters_
edm::InputTag pixelClusterCollectionInputTag_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > token_pc
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > token_sc

◆ ClusterChecker() [2/3]

ClusterChecker::ClusterChecker ( const edm::ParameterSet conf,
edm::ConsumesCollector &&  iC 
)

Definition at line 10 of file ClusterChecker.cc.

10 : ClusterChecker(conf, iC) {}
ClusterChecker()=delete

◆ ClusterChecker() [3/3]

ClusterChecker::ClusterChecker ( )
delete

◆ ~ClusterChecker()

ClusterChecker::~ClusterChecker ( )

Definition at line 43 of file ClusterChecker.cc.

43 {}

Member Function Documentation

◆ fillDescriptions()

void ClusterChecker::fillDescriptions ( edm::ParameterSetDescription description)
static

Definition at line 32 of file ClusterChecker.cc.

References submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ClusterCheckerEDProducer::fillDescriptions(), and CtfSpecialSeedGenerator::fillDescriptions().

32  {
33  desc.add<bool>("doClusterCheck", true);
34  desc.add<unsigned>("MaxNumberOfStripClusters", 400000);
35  desc.add<edm::InputTag>("ClusterCollectionLabel", edm::InputTag("siStripClusters"));
36  desc.add<unsigned>("MaxNumberOfPixelClusters", 40000);
37  desc.add<edm::InputTag>("PixelClusterCollectionLabel", edm::InputTag("siPixelClusters"));
38  desc.add<std::string>("cut",
39  "strip < 400000 && pixel < 40000 && (strip < 50000 + 10*pixel) && (pixel < 5000 + 0.1*strip)");
40  desc.add<uint32_t>("DontCountDetsAboveNClusters", 0);
41 }

◆ tooManyClusters()

size_t ClusterChecker::tooManyClusters ( const edm::Event e) const

Definition at line 45 of file ClusterChecker.cc.

References doACheck_, MillePedeFileConverter_cfg::e, edm::HandleBase::failedToGet(), ignoreDetsAboveNClusters_, input, maxNrOfPixelClusters_, maxNrOfStripClusters_, reco::utils::ClusterTotals::pixel, pixelClusterCollectionInputTag_, reco::utils::ClusterTotals::pixeldets, selector_, edmNew::DetSetVector< T >::size(), reco::utils::ClusterTotals::strip, reco::utils::ClusterTotals::stripdets, token_pc, and token_sc.

Referenced by PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::analyze(), PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::find(), ClusterCheckerEDProducer::produce(), SeedGeneratorFromRegionHitsEDProducer::produce(), CosmicSeedGenerator::produce(), SimpleCosmicBONSeeder::produce(), and CtfSpecialSeedGenerator::produce().

45  {
46  if (!doACheck_)
47  return 0;
48 
49  // get special input for cosmic cluster multiplicity filter
51  e.getByToken(token_sc, clusterDSV);
53  if (!clusterDSV.failedToGet()) {
54  const edmNew::DetSetVector<SiStripCluster>& input = *clusterDSV;
55 
56  if (ignoreDetsAboveNClusters_ == 0) {
57  totals.strip = input.dataSize();
58  totals.stripdets = input.size();
59  } else {
60  //loop over detectors
61  totals.strip = 0;
62  totals.stripdets = 0;
63  edmNew::DetSetVector<SiStripCluster>::const_iterator DSViter = input.begin(), DSViter_end = input.end();
64  for (; DSViter != DSViter_end; DSViter++) {
65  size_t siz = DSViter->size();
66  if (siz > ignoreDetsAboveNClusters_)
67  continue;
68  totals.strip += siz;
69  totals.stripdets++;
70  }
71  }
72  }
73  if (totals.strip > int(maxNrOfStripClusters_))
74  return totals.strip;
75 
76  // get special input for pixel cluster multiplicity filter
78  e.getByToken(token_pc, pixelClusterDSV);
79  if (!pixelClusterDSV.failedToGet()) {
80  const edmNew::DetSetVector<SiPixelCluster>& input = *pixelClusterDSV;
81 
82  if (ignoreDetsAboveNClusters_ == 0) {
83  totals.pixel = input.dataSize();
84  totals.pixeldets = input.size();
85  } else {
86  //loop over detectors
87  totals.pixel = 0;
88  totals.pixeldets = 0;
89  edmNew::DetSetVector<SiPixelCluster>::const_iterator DSViter = input.begin(), DSViter_end = input.end();
90  for (; DSViter != DSViter_end; DSViter++) {
91  size_t siz = DSViter->size();
92  if (siz > ignoreDetsAboveNClusters_)
93  continue;
94  totals.pixel += siz;
95  totals.pixeldets++;
96  }
97  }
98  } else {
99  //say something's wrong.
100  edm::LogError("ClusterChecker")
101  << "could not get any SiPixel cluster collections of type edm::DetSetVector<SiPixelCluster> with label: "
103  totals.pixel = 999999;
104  }
105  if (totals.pixel > int(maxNrOfPixelClusters_))
106  return totals.pixel;
107 
108  if (!selector_(totals))
109  return totals.strip;
110  return 0;
111 }
int stripdets
number of pixel clusters
int pixeldets
number of strip detectors with at least one cluster
StringCutObjectSelector< reco::utils::ClusterTotals > selector_
unsigned int maxNrOfStripClusters_
unsigned int maxNrOfPixelClusters_
Log< level::Error, false > LogError
static std::string const input
Definition: EdmProvDump.cc:50
bool failedToGet() const
Definition: HandleBase.h:72
int pixel
number of strip clusters
unsigned int ignoreDetsAboveNClusters_
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
size_type size() const
edm::InputTag pixelClusterCollectionInputTag_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > token_pc
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > token_sc

Member Data Documentation

◆ clusterCollectionInputTag_

edm::InputTag ClusterChecker::clusterCollectionInputTag_
private

Definition at line 43 of file ClusterChecker.h.

Referenced by ClusterChecker().

◆ doACheck_

bool ClusterChecker::doACheck_
private

Definition at line 42 of file ClusterChecker.h.

Referenced by ClusterChecker(), and tooManyClusters().

◆ ignoreDetsAboveNClusters_

unsigned int ClusterChecker::ignoreDetsAboveNClusters_
private

Definition at line 48 of file ClusterChecker.h.

Referenced by ClusterChecker(), and tooManyClusters().

◆ maxNrOfPixelClusters_

unsigned int ClusterChecker::maxNrOfPixelClusters_
private

Definition at line 46 of file ClusterChecker.h.

Referenced by ClusterChecker(), and tooManyClusters().

◆ maxNrOfStripClusters_

unsigned int ClusterChecker::maxNrOfStripClusters_
private

Definition at line 45 of file ClusterChecker.h.

Referenced by ClusterChecker(), and tooManyClusters().

◆ pixelClusterCollectionInputTag_

edm::InputTag ClusterChecker::pixelClusterCollectionInputTag_
private

Definition at line 44 of file ClusterChecker.h.

Referenced by ClusterChecker(), and tooManyClusters().

◆ selector_

StringCutObjectSelector<reco::utils::ClusterTotals> ClusterChecker::selector_
private

Definition at line 47 of file ClusterChecker.h.

Referenced by tooManyClusters().

◆ token_pc

edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster> > ClusterChecker::token_pc
private

Definition at line 50 of file ClusterChecker.h.

Referenced by ClusterChecker(), and tooManyClusters().

◆ token_sc

edm::EDGetTokenT<edmNew::DetSetVector<SiStripCluster> > ClusterChecker::token_sc
private

Definition at line 49 of file ClusterChecker.h.

Referenced by ClusterChecker(), and tooManyClusters().