CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
cms::TECClusterFilter Class Reference

#include <TECClusterFilter.h>

Inheritance diagram for cms::TECClusterFilter:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

bool filter (edm::Event &e, edm::EventSetup const &c) override
 
 TECClusterFilter (const edm::ParameterSet &ps)
 
 ~TECClusterFilter () override
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilter () override
 
- 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 ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
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, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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 & itemsToGetFrom (BranchType iType) 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

unsigned int ChargeThresholdTEC
 
std::string clusterProducer
 
unsigned int minNrOfTECClusters
 
std::vector< uint32_t > ModulesToBeExcluded
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 22 of file TECClusterFilter.h.

Constructor & Destructor Documentation

cms::TECClusterFilter::TECClusterFilter ( const edm::ParameterSet ps)

Definition at line 21 of file TECClusterFilter.cc.

References edm::ParameterSet::getParameter().

21  {
22  //
23  ModulesToBeExcluded.clear();
24  ModulesToBeExcluded = ps.getParameter< std::vector<unsigned> >("ModulesToBeExcluded");
25  edm::LogInfo("TECClusterFilter")<<"Clusters from "<<ModulesToBeExcluded.size()<<" modules will be ignored in the filter:";
26  for( std::vector<uint32_t>::const_iterator imod = ModulesToBeExcluded.begin(); imod != ModulesToBeExcluded.end(); imod++){
27  edm::LogInfo("TECClusterFilter")<< *imod;
28  }
29  //
30  ChargeThresholdTEC=ps.getParameter<int>("ChargeThresholdTEC");
31  edm::LogInfo("TECClusterFilter")<<"ChargeThresholdTEC"<<ChargeThresholdTEC;
32  minNrOfTECClusters=ps.getParameter<int>("MinNrOfTECClusters");
33  edm::LogInfo("TECClusterFilter")<<"MinNrOfTECClusters"<<minNrOfTECClusters;
34  clusterProducer = ps.getParameter<string>("ClusterProducer");
35  edm::LogInfo("TECClusterFilter")<<"ClusterProducer"<<clusterProducer;
36 
37  // also put decision in the event
38  produces <int>();
39  }
T getParameter(std::string const &) const
unsigned int ChargeThresholdTEC
std::vector< uint32_t > ModulesToBeExcluded
unsigned int minNrOfTECClusters
cms::TECClusterFilter::~TECClusterFilter ( )
inlineoverride

Definition at line 25 of file TECClusterFilter.h.

References EnergyCorrector::c, MillePedeFileConverter_cfg::e, and filter().

25 {}

Member Function Documentation

bool cms::TECClusterFilter::filter ( edm::Event e,
edm::EventSetup const &  c 
)
overridevirtual

Implements edm::EDFilter.

Definition at line 41 of file TECClusterFilter.cc.

References end, edm::Event::getByLabel(), h, edm::Event::put(), DetId::rawId(), DetId::subdetId(), and StripSubdetector::TEC.

Referenced by Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filter(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setDataAccessor(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView(), and ~TECClusterFilter().

42  {
45  bool decision=false; // default value, only accept if set true in this loop
46  unsigned int nr_clusters_above_threshold = 0;
47  for (edm::DetSetVector<SiStripCluster>::const_iterator it=h->begin();it!=h->end();it++)
48  {
49  DetId thedetId = DetId(it->detId());
50  bool exclude_this_detid = false;
51  for(vector<SiStripCluster>::const_iterator vit=(it->data).begin(); vit!=(it->data).end(); vit++)
52  {
53  for( std::vector<uint32_t>::const_iterator imod = ModulesToBeExcluded.begin(); imod != ModulesToBeExcluded.end(); imod++ )
54  { if(*imod == thedetId.rawId()) exclude_this_detid = true; } // found in exclusion list
55  if( (! exclude_this_detid ) && (thedetId.subdetId()==StripSubdetector::TEC) ) // if not excluded and if TEC module
56  { // calculate sum of amplitudes
57  unsigned int amplclus=0;
58  // int amplclus=0;
59  for(auto ia=vit->amplitudes().begin(); ia!=vit->amplitudes().end(); ia++)
60  { if ((*ia)>0) amplclus+=(*ia); } // why should this be negative?
61  if(amplclus>ChargeThresholdTEC) nr_clusters_above_threshold++;
62  }
63  }
64  }
65  if(nr_clusters_above_threshold>=minNrOfTECClusters) decision=true;
66  e.put(std::make_unique<int>(decision));
67  return decision;
68  }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
unsigned int ChargeThresholdTEC
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
std::vector< uint32_t > ModulesToBeExcluded
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
#define end
Definition: vmac.h:39
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:480
Definition: DetId.h:18
unsigned int minNrOfTECClusters
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:104

Member Data Documentation

unsigned int cms::TECClusterFilter::ChargeThresholdTEC
private

Definition at line 30 of file TECClusterFilter.h.

std::string cms::TECClusterFilter::clusterProducer
private

Definition at line 29 of file TECClusterFilter.h.

unsigned int cms::TECClusterFilter::minNrOfTECClusters
private

Definition at line 31 of file TECClusterFilter.h.

std::vector<uint32_t> cms::TECClusterFilter::ModulesToBeExcluded
private

Definition at line 32 of file TECClusterFilter.h.