CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private 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)
 
size_t tooManyClusters (const edm::Event &e) const
 
 ~ClusterChecker ()
 

Static Public Member Functions

static void fillDescriptions (edm::ParameterSetDescription &description)
 

Private Member Functions

 ClusterChecker ()=delete
 

Private Attributes

edm::InputTag clusterCollectionInputTag_
 
bool doACheck_
 
unsigned int ignoreDetsAboveNClusters_
 
unsigned int maxNrOfCosmicClusters_
 
unsigned int maxNrOfPixelClusters_
 
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.

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  maxNrOfCosmicClusters_ = conf.getParameter<unsigned int>("MaxNumberOfCosmicClusters");
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 }

References clusterCollectionInputTag_, edm::ConsumesCollector::consumes(), doACheck_, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), ignoreDetsAboveNClusters_, maxNrOfCosmicClusters_, maxNrOfPixelClusters_, pixelClusterCollectionInputTag_, token_pc, and 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()

ClusterChecker::~ClusterChecker ( )

Definition at line 42 of file ClusterChecker.cc.

42 {}

◆ ClusterChecker() [3/3]

ClusterChecker::ClusterChecker ( )
privatedelete

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 32 of file ClusterChecker.cc.

32  {
33  desc.add<bool>("doClusterCheck", true);
34  desc.add<unsigned>("MaxNumberOfCosmicClusters", 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 }

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

Referenced by ClusterCheckerEDProducer::fillDescriptions().

◆ tooManyClusters()

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

Definition at line 44 of file ClusterChecker.cc.

44  {
45  if (!doACheck_)
46  return 0;
47 
48  // get special input for cosmic cluster multiplicity filter
50  e.getByToken(token_sc, clusterDSV);
52  if (!clusterDSV.failedToGet()) {
53  const edmNew::DetSetVector<SiStripCluster>& input = *clusterDSV;
54 
55  if (ignoreDetsAboveNClusters_ == 0) {
56  totals.strip = input.dataSize();
57  totals.stripdets = input.size();
58  } else {
59  //loop over detectors
60  totals.strip = 0;
61  totals.stripdets = 0;
62  edmNew::DetSetVector<SiStripCluster>::const_iterator DSViter = input.begin(), DSViter_end = input.end();
63  for (; DSViter != DSViter_end; DSViter++) {
64  size_t siz = DSViter->size();
65  if (siz > ignoreDetsAboveNClusters_)
66  continue;
67  totals.strip += siz;
68  totals.stripdets++;
69  }
70  }
71  }
72  if (totals.strip > int(maxNrOfCosmicClusters_))
73  return totals.strip;
74 
75  // get special input for pixel cluster multiplicity filter
77  e.getByToken(token_pc, pixelClusterDSV);
78  if (!pixelClusterDSV.failedToGet()) {
79  const edmNew::DetSetVector<SiPixelCluster>& input = *pixelClusterDSV;
80 
81  if (ignoreDetsAboveNClusters_ == 0) {
82  totals.pixel = input.dataSize();
83  totals.pixeldets = input.size();
84  } else {
85  //loop over detectors
86  totals.pixel = 0;
87  totals.pixeldets = 0;
88  edmNew::DetSetVector<SiPixelCluster>::const_iterator DSViter = input.begin(), DSViter_end = input.end();
89  for (; DSViter != DSViter_end; DSViter++) {
90  size_t siz = DSViter->size();
91  if (siz > ignoreDetsAboveNClusters_)
92  continue;
93  totals.pixel += siz;
94  totals.pixeldets++;
95  }
96  }
97  } else {
98  //say something's wrong.
99  edm::LogError("ClusterChecker")
100  << "could not get any SiPixel cluster collections of type edm::DetSetVector<SiPixelCluster> with label: "
102  totals.pixel = 999999;
103  }
104  if (totals.pixel > int(maxNrOfPixelClusters_))
105  return totals.pixel;
106 
107  if (!selector_(totals))
108  return totals.strip;
109  return 0;
110 }

References doACheck_, MillePedeFileConverter_cfg::e, edm::HandleBase::failedToGet(), ignoreDetsAboveNClusters_, input, maxNrOfCosmicClusters_, maxNrOfPixelClusters_, 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().

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().

◆ maxNrOfCosmicClusters_

unsigned int ClusterChecker::maxNrOfCosmicClusters_
private

Definition at line 45 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().

◆ 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().

input
static const std::string input
Definition: EdmProvDump.cc:48
ClusterChecker::token_sc
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > token_sc
Definition: ClusterChecker.h:49
ClusterChecker::ClusterChecker
ClusterChecker()=delete
edmNew::DetSetVector::size
size_type size() const
Definition: DetSetVectorNew.h:554
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89353
reco::utils::ClusterTotals
Definition: ClusterChecker.h:20
edmNew::DetSetVector::const_iterator
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
Definition: DetSetVectorNew.h:197
edm::ParameterSet::existsAs
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:171
ClusterChecker::token_pc
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > token_pc
Definition: ClusterChecker.h:50
edm::Handle
Definition: AssociativeIterator.h:50
ClusterChecker::doACheck_
bool doACheck_
Definition: ClusterChecker.h:42
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::HandleBase::failedToGet
bool failedToGet() const
Definition: HandleBase.h:72
reco::utils::ClusterTotals::pixeldets
int pixeldets
number of strip detectors with at least one cluster
Definition: ClusterChecker.h:25
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
reco::utils::ClusterTotals::pixel
int pixel
number of strip clusters
Definition: ClusterChecker.h:23
ClusterChecker::maxNrOfPixelClusters_
unsigned int maxNrOfPixelClusters_
Definition: ClusterChecker.h:46
edmNew::DetSetVector
Definition: DetSetNew.h:13
ClusterChecker::clusterCollectionInputTag_
edm::InputTag clusterCollectionInputTag_
Definition: ClusterChecker.h:43
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
ClusterChecker::maxNrOfCosmicClusters_
unsigned int maxNrOfCosmicClusters_
Definition: ClusterChecker.h:45
reco::utils::ClusterTotals::stripdets
int stripdets
number of pixel clusters
Definition: ClusterChecker.h:24
ClusterChecker::selector_
StringCutObjectSelector< reco::utils::ClusterTotals > selector_
Definition: ClusterChecker.h:47
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ClusterChecker::pixelClusterCollectionInputTag_
edm::InputTag pixelClusterCollectionInputTag_
Definition: ClusterChecker.h:44
reco::utils::ClusterTotals::strip
int strip
Definition: ClusterChecker.h:22
edm::InputTag
Definition: InputTag.h:15
ClusterChecker::ignoreDetsAboveNClusters_
unsigned int ignoreDetsAboveNClusters_
Definition: ClusterChecker.h:48
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37