CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

virtual bool filter (edm::Event &e, edm::EventSetup const &c)
 
 TECClusterFilter (const edm::ParameterSet &ps)
 
virtual ~TECClusterFilter ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
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 &)
 
- 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 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
virtual cms::TECClusterFilter::~TECClusterFilter ( )
inlinevirtual

Definition at line 25 of file TECClusterFilter.h.

25 {}

Member Function Documentation

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

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(), and Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView().

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  std::auto_ptr< int > output_decision( new int(decision) );
67  e.put(output_decision);
68  return decision;
69  }
unsigned int ChargeThresholdTEC
std::vector< uint32_t > ModulesToBeExcluded
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
#define end
Definition: vmac.h:37
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:420
Definition: DetId.h:18
unsigned int minNrOfTECClusters
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:108

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.