CMS 3D CMS Logo

ClusterChecker Class Reference

#include <RecoTracker/SpecialSeedGenerators/interface/ClusterChecker.h>

List of all members.

Public Member Functions

 ClusterChecker (edm::ParameterSet conf)
size_t tooManyClusters (const edm::Event &e)

Private Attributes

edm::InputTag clusterCollectionInputTag_
bool doACheck_
uint32_t ignoreDetsAboveNClusters_
uint32_t maxNrOfCosmicClusters_


Detailed Description

Definition at line 15 of file ClusterChecker.h.


Constructor & Destructor Documentation

ClusterChecker::ClusterChecker ( edm::ParameterSet  conf  )  [inline]

Definition at line 17 of file ClusterChecker.h.

References clusterCollectionInputTag_, doACheck_, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), ignoreDetsAboveNClusters_, and maxNrOfCosmicClusters_.

00017                                        :
00018     doACheck_(conf.getParameter<bool>("doClusterCheck"))
00019     {
00020       if (doACheck_){
00021         clusterCollectionInputTag_ = conf.getParameter<edm::InputTag>("ClusterCollectionLabel");
00022         maxNrOfCosmicClusters_ = conf.getParameter<unsigned int>("MaxNumberOfCosmicClusters");
00023         if (conf.existsAs<uint32_t>("DontCountDetsAboveNClusters")) {
00024             ignoreDetsAboveNClusters_ = conf.getParameter<uint32_t>("DontCountDetsAboveNClusters");
00025         } else {
00026             ignoreDetsAboveNClusters_ = 0;
00027         }
00028       }
00029     }
    


Member Function Documentation

size_t ClusterChecker::tooManyClusters ( const edm::Event e  )  [inline]

Definition at line 31 of file ClusterChecker.h.

References edmNew::DetSetVector< T >::begin(), clusterCollectionInputTag_, edmNew::DetSetVector< T >::dataSize(), doACheck_, edmNew::DetSetVector< T >::end(), edm::Handle< T >::failedToGet(), edm::Event::getByLabel(), ignoreDetsAboveNClusters_, iggi_31X_cfg::input, maxNrOfCosmicClusters_, siz, and edmNew::DetSetVector< T >::size().

Referenced by CosmicSeedGenerator::produce(), CtfSpecialSeedGenerator::produce(), SimpleCosmicBONSeeder::produce(), and RoadSearchSeedFinder::produce().

00031                                             {
00032     if (!doACheck_) return 0;
00033 
00034     // get special input for cosmic cluster multiplicity filter
00035     edm::Handle<edmNew::DetSetVector<SiStripCluster> > clusterDSV;
00036     e.getByLabel(clusterCollectionInputTag_, clusterDSV);
00037     unsigned int totalClusters = 0;
00038     if (!clusterDSV.failedToGet()) {
00039       const edmNew::DetSetVector<SiStripCluster> & input = *clusterDSV;
00040 
00041       if (ignoreDetsAboveNClusters_ == 0) {
00042         totalClusters = input.dataSize();
00043       } else {
00044           //loop over detectors
00045           edmNew::DetSetVector<SiStripCluster>::const_iterator DSViter=input.begin(), DSViter_end=input.end();
00046           for (; DSViter!=DSViter_end; DSViter++ ) {
00047             size_t siz = DSViter->size();
00048             if (siz > ignoreDetsAboveNClusters_) continue;
00049             totalClusters += siz; 
00050           }
00051       }
00052     }
00053     else{
00054       edm::Handle<edm::LazyGetter<SiStripCluster> > lazyGH;
00055       e.getByLabel(clusterCollectionInputTag_, lazyGH);
00056       if (!lazyGH.failedToGet()){
00057         totalClusters = lazyGH->size();
00058       }else{
00059         //say something's wrong.
00060         edm::LogError("ClusterChecker")<<"could not get any SiStrip cluster collections of type edm::DetSetVector<SiStripCluster> or edm::LazyGetter<SiStripCluster, with label: "<<clusterCollectionInputTag_;
00061         totalClusters = 999999;
00062       }
00063     }
00064     return (totalClusters > maxNrOfCosmicClusters_) ? totalClusters : 0;
00065   }


Member Data Documentation

edm::InputTag ClusterChecker::clusterCollectionInputTag_ [private]

Definition at line 69 of file ClusterChecker.h.

Referenced by ClusterChecker(), and tooManyClusters().

bool ClusterChecker::doACheck_ [private]

Definition at line 68 of file ClusterChecker.h.

Referenced by ClusterChecker(), and tooManyClusters().

uint32_t ClusterChecker::ignoreDetsAboveNClusters_ [private]

Definition at line 71 of file ClusterChecker.h.

Referenced by ClusterChecker(), and tooManyClusters().

uint32_t ClusterChecker::maxNrOfCosmicClusters_ [private]

Definition at line 70 of file ClusterChecker.h.

Referenced by ClusterChecker(), and tooManyClusters().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:16:21 2009 for CMSSW by  doxygen 1.5.4