CMS 3D CMS Logo

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

#include <HLTPixelAsymmetryFilter.h>

Inheritance diagram for HLTPixelAsymmetryFilter:
HLTFilter edm::global::EDFilter<> edm::global::EDFilterBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTPixelAsymmetryFilter (const edm::ParameterSet &)
 
 ~HLTPixelAsymmetryFilter () override
 
- Public Member Functions inherited from HLTFilter
 HLTFilter (const edm::ParameterSet &config)
 
int module (edm::Event const &) const
 
const std::string * moduleLabel () const
 
int path (edm::Event const &) const
 
const std::string * pathName (edm::Event const &) const
 
std::pair< int, int > pmid (edm::Event const &) const
 
bool saveTags () const
 
 ~HLTFilter () override
 
- Public Member Functions inherited from edm::global::EDFilter<>
 EDFilter ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDFilterBase
 EDFilterBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilterBase () 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)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from HLTFilter
static void makeHLTFilterDescription (edm::ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from edm::global::EDFilterBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

bool hltFilter (edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
 

Private Attributes

double bmincharge_
 
double clus_thresh_
 
edm::InputTag inputTag_
 
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > inputToken_
 
double max_asym_
 
double min_asym_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDFilterBase
typedef EDFilterBase 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
 
- 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 52 of file HLTPixelAsymmetryFilter.h.

Constructor & Destructor Documentation

HLTPixelAsymmetryFilter::HLTPixelAsymmetryFilter ( const edm::ParameterSet config)
explicit

Definition at line 17 of file HLTPixelAsymmetryFilter.cc.

References bmincharge_, clus_thresh_, inputTag_, inputToken_, LogDebug, max_asym_, min_asym_, and ~HLTPixelAsymmetryFilter().

17  : HLTFilter(config),
18  inputTag_ (config.getParameter<edm::InputTag>("inputTag")),
19  min_asym_ (config.getParameter<double>("MinAsym")),
20  max_asym_ (config.getParameter<double>("MaxAsym")),
21  clus_thresh_ (config.getParameter<double>("MinCharge")),
22  bmincharge_ (config.getParameter<double>("MinBarrel"))
23 {
24  inputToken_ = consumes<edmNew::DetSetVector<SiPixelCluster> >(inputTag_);
25  LogDebug("") << "Using the " << inputTag_ << " input collection";
26  LogDebug("") << "Requesting events with a charge repartition asymmetry between " << min_asym_ << " and " << max_asym_;
27  LogDebug("") << "Mean cluster charge in the barrel should be higher than" << bmincharge_ << " electrons ";
28  LogDebug("") << "Only clusters with a charge larger than " << clus_thresh_ << " electrons will be used ";
29 }
#define LogDebug(id)
T getParameter(std::string const &) const
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > inputToken_
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
HLTPixelAsymmetryFilter::~HLTPixelAsymmetryFilter ( )
overridedefault

Referenced by HLTPixelAsymmetryFilter().

Member Function Documentation

void HLTPixelAsymmetryFilter::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 34 of file HLTPixelAsymmetryFilter.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and HLTFilter::makeHLTFilterDescription().

34  {
37  desc.add<edm::InputTag>("inputTag",edm::InputTag("hltSiPixelClusters"));
38  desc.add<double>("MinAsym",0.); // minimum asymmetry
39  desc.add<double>("MaxAsym",1.); // maximum asymmetry
40  desc.add<double>("MinCharge",4000.); // minimum charge for a cluster to be selected (in e-)
41  desc.add<double>("MinBarrel",10000.); // minimum average charge in the barrel (bpix, in e-)
42  descriptions.add("hltPixelAsymmetryFilter",desc);
43 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
Definition: HLTFilter.cc:29
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool HLTPixelAsymmetryFilter::hltFilter ( edm::Event event,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const
overrideprivatevirtual

Implements HLTFilter.

Definition at line 50 of file HLTPixelAsymmetryFilter.cc.

References accept(), trigger::TriggerFilterObjectWithRefs::addCollectionTag(), Reference_intrackfit_cff::barrel, begin, bmincharge_, clus_thresh_, DEFINE_FWK_MODULE, end, makeMuonMisalignmentScenario::endcap, PixelEndcapName::halfCylinder(), mps_fire::i, inputTag_, inputToken_, LogDebug, PixelEndcapName::mI, min_asym_, PixelEndcapName::mO, PixelEndcapName::pI, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, PixelEndcapName::pO, position, HLTFilter::saveTags(), and DetId::subdetId().

51 {
52  // All HLT filters must create and fill an HLT filter object,
53  // recording any reconstructed physics objects satisfying (or not)
54  // this HLT filter, and place it in the Event.
55 
56  // The filter object
57  if (saveTags()) filterproduct.addCollectionTag(inputTag_);
58 
59  // get hold of products from Event
61  event.getByToken(inputToken_, clusterColl);
62 
63  unsigned int clusterSize = clusterColl->dataSize();
64  LogDebug("") << "Number of clusters accepted: " << clusterSize;
65 
66  bool accept = (clusterSize >= 2); // Not necessary to go further in this case
67 
68  if (!accept) return accept;
69 
70  double asym_pix_1 = -1;
71  double asym_pix_2 = -1;
72 
73  int n_clus[3] = {0,0,0};
74  double e_clus[3] = {0.,0.,0.};
75 
76  for (edmNew::DetSetVector<SiPixelCluster>::const_iterator DSViter=clusterColl->begin(); DSViter!=clusterColl->end();DSViter++ )
77  {
80  uint32_t detid = DSViter->id();
81 
82  bool barrel = DetId(detid).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel);
83  bool endcap = DetId(detid).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap);
84 
85  int detpos = -1;
86 
87  // First we look if we are in the endcap or in the barrel PIXELS
88  // Asymmetry is computed with endcap pixels only
89 
90  if (endcap)
91  {
93 
94  if (position == PixelEndcapName::mI || position == PixelEndcapName::mO) // FPIX-
95  detpos = 0;
96 
97  if (position == PixelEndcapName::pI || position == PixelEndcapName::pO) // FPIX+
98  detpos = 2;
99  }
100 
101  if (barrel)
102  detpos = 1;
103 
104  if (detpos<0) continue;
105 
106  for(edmNew::DetSet<SiPixelCluster>::const_iterator iter=begin;iter!=end;++iter)
107  {
108  if (iter->charge()>clus_thresh_ )
109  {
110  ++n_clus[detpos];
111  e_clus[detpos]+=iter->charge();
112  }
113  }
114  } // End of cluster loop
115 
116  for (int i=0;i<3;++i)
117  {
118  if (n_clus[i])
119  e_clus[i] /= n_clus[i];
120  }
121 
122  if (e_clus[1] < bmincharge_) return false; // Reject event if the Barrel mean charge is too low
123 
124 
125  if (e_clus[0]+e_clus[2] != 0) // Compute asyms, if applicable
126  {
127  asym_pix_1 = e_clus[0]/(e_clus[0]+e_clus[2]);
128  asym_pix_2 = e_clus[2]/(e_clus[0]+e_clus[2]);
129  }
130  else // Otherwise reject event
131  {
132  return false;
133  }
134 
135  bool pkam_1 = (asym_pix_1 <= max_asym_ && asym_pix_1 >= min_asym_);
136  bool pkam_2 = (asym_pix_2 <= max_asym_ && asym_pix_2 >= min_asym_);
137 
138  if (pkam_1 || pkam_2) return accept; // Final selection
139 
140  return false;
141 }
#define LogDebug(id)
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > inputToken_
data_type const * const_iterator
Definition: DetSetNew.h:30
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
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
Definition: DetId.h:18
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
bool saveTags() const
Definition: HLTFilter.h:45
#define begin
Definition: vmac.h:32
static int position[264][3]
Definition: ReadPGInfo.cc:509
HalfCylinder halfCylinder() const

Member Data Documentation

double HLTPixelAsymmetryFilter::bmincharge_
private

Definition at line 66 of file HLTPixelAsymmetryFilter.h.

Referenced by hltFilter(), and HLTPixelAsymmetryFilter().

double HLTPixelAsymmetryFilter::clus_thresh_
private

Definition at line 65 of file HLTPixelAsymmetryFilter.h.

Referenced by hltFilter(), and HLTPixelAsymmetryFilter().

edm::InputTag HLTPixelAsymmetryFilter::inputTag_
private

Definition at line 62 of file HLTPixelAsymmetryFilter.h.

Referenced by hltFilter(), and HLTPixelAsymmetryFilter().

edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster> > HLTPixelAsymmetryFilter::inputToken_
private

Definition at line 61 of file HLTPixelAsymmetryFilter.h.

Referenced by hltFilter(), and HLTPixelAsymmetryFilter().

double HLTPixelAsymmetryFilter::max_asym_
private

Definition at line 64 of file HLTPixelAsymmetryFilter.h.

Referenced by HLTPixelAsymmetryFilter().

double HLTPixelAsymmetryFilter::min_asym_
private

Definition at line 63 of file HLTPixelAsymmetryFilter.h.

Referenced by hltFilter(), and HLTPixelAsymmetryFilter().