CMS 3D CMS Logo

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

#include <Work/EcalSimpleUncalibRecHitFilter/src/EcalSimpleUncalibRecHitFilter.cc>

Inheritance diagram for EcalSimpleUncalibRecHitFilter:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 EcalSimpleUncalibRecHitFilter (const edm::ParameterSet &)
 
 ~EcalSimpleUncalibRecHitFilter () 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)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- 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 ()
 

Private Member Functions

bool filter (edm::Event &, edm::EventSetup const &) override
 

Private Attributes

const edm::EDGetTokenT< EcalUncalibratedRecHitCollectionEcalUncalibRecHitToken_
 
const std::vector< int > maskedList_
 
const double minAdc_
 

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
 
- 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

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 42 of file EcalSimpleUncalibRecHitFilter.cc.

Constructor & Destructor Documentation

EcalSimpleUncalibRecHitFilter::EcalSimpleUncalibRecHitFilter ( const edm::ParameterSet iConfig)
explicit

Definition at line 62 of file EcalSimpleUncalibRecHitFilter.cc.

62  :
63  EcalUncalibRecHitToken_( consumes<EcalUncalibratedRecHitCollection>(iConfig.getParameter<edm::InputTag>("EcalUncalibRecHitCollection")) ),
64  minAdc_( iConfig.getUntrackedParameter<double>("adcCut", 12) ),
65  maskedList_( iConfig.getUntrackedParameter<std::vector<int>>("maskedChannels", std::vector<int>{}) ) // this is using the ashed index
66 {
67  // now do what ever initialization is needed
68 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
const edm::EDGetTokenT< EcalUncalibratedRecHitCollection > EcalUncalibRecHitToken_
EcalSimpleUncalibRecHitFilter::~EcalSimpleUncalibRecHitFilter ( )
override

Definition at line 71 of file EcalSimpleUncalibRecHitFilter.cc.

72 {
73  // do anything here that needs to be done at desctruction time
74  // (e.g. close files, deallocate resources etc.)
75 }

Member Function Documentation

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

Definition at line 127 of file EcalSimpleUncalibRecHitFilter.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), and DEFINE_FWK_MODULE.

127  {
129 
130  desc.add<edm::InputTag>("EcalUncalibRecHitCollection", edm::InputTag("ecalWeightUncalibRecHit","EcalUncalibRecHitsEB"));
131  desc.addUntracked<double>("adcCut", 12.);
132  desc.addUntracked<std::vector<int>>("maskedChannels", std::vector<int>{});
133 
134  descriptions.add("ecalSimpleUncalibRecHitFilter", desc);
135 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool EcalSimpleUncalibRecHitFilter::filter ( edm::Event iEvent,
edm::EventSetup const &  iSetup 
)
overrideprivatevirtual

Implements edm::EDFilter.

Definition at line 84 of file EcalSimpleUncalibRecHitFilter.cc.

References EcalUncalibRecHitToken_, spr::find(), edm::Event::getByToken(), ecalpyutils::hashedIndex(), hit::id, tablePrinter::labels, edm::EDConsumerBase::labelsForToken(), maskedList_, minAdc_, edm::ProductLabels::module, edm::ProductLabels::process, edm::ProductLabels::productInstance, and mps_fire::result.

85 {
86  using namespace edm;
87 
88  // getting very basic uncalRH
90  if (not iEvent.getByToken(EcalUncalibRecHitToken_, crudeHits))
91  {
94  LogWarning("EcalSimpleUncalibRecHitFilter") << "InputTag: label = \"" << labels.module << "\", instance = \"" << labels.productInstance << "\", process = \"" << labels.process << "\" is not available";
95  return false;
96  }
97 
98 
99  bool thereIsSignal = false;
100  // loop on crude rechits
101  for (auto hit : *crudeHits) {
102 
103  // masking noisy channels
104  auto result = std::find( maskedList_.begin(), maskedList_.end(), EBDetId(hit.id()).hashedIndex() );
105  if (result != maskedList_.end())
106  // LogWarning("EcalFilter") << "skipping uncalRecHit for channel: " << ic << " with amplitude " << ampli_ ;
107  continue;
108 
109  float ampli_ = hit.amplitude();
110 
111  // seeking channels with signal and displaced jitter
112  if (ampli_ >= minAdc_ )
113  {
114  thereIsSignal = true;
115  // LogWarning("EcalFilter") << "at evet: " << iEvent.id().event()
116  // << " and run: " << iEvent.id().run()
117  // << " there is OUT OF TIME signal at chanel: " << ic
118  // << " with amplitude " << ampli_ << " and max at: " << jitter_;
119  break;
120  }
121 
122  }
123 
124  return thereIsSignal;
125 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
const edm::EDGetTokenT< EcalUncalibratedRecHitCollection > EcalUncalibRecHitToken_
char const * process
Definition: ProductLabels.h:7
int hashedIndex(int ieta, int iphi)
Definition: EcalPyUtils.cc:42
char const * module
Definition: ProductLabels.h:5
unsigned int id
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
char const * productInstance
Definition: ProductLabels.h:6
HLT enums.

Member Data Documentation

const edm::EDGetTokenT<EcalUncalibratedRecHitCollection> EcalSimpleUncalibRecHitFilter::EcalUncalibRecHitToken_
private

Definition at line 53 of file EcalSimpleUncalibRecHitFilter.cc.

Referenced by filter().

const std::vector<int> EcalSimpleUncalibRecHitFilter::maskedList_
private

Definition at line 55 of file EcalSimpleUncalibRecHitFilter.cc.

Referenced by filter().

const double EcalSimpleUncalibRecHitFilter::minAdc_
private

Definition at line 54 of file EcalSimpleUncalibRecHitFilter.cc.

Referenced by filter().