CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CSCRecoBadChannelsAnalyzer Class Reference
Inheritance diagram for CSCRecoBadChannelsAnalyzer:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 
 CSCRecoBadChannelsAnalyzer (edm::ParameterSet const &ps)
 
const std::string & myName ()
 
bool readBadChannels () const
 did we request reading bad channel info from db? More...
 
 ~CSCRecoBadChannelsAnalyzer () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

const std::string dashedLine_
 
const int dashedLineWidth_
 
edm::ESGetToken< CSCGeometry, MuonGeometryRecordgeometryToken_
 
edm::ESGetToken< CSCIndexerBase, CSCIndexerRecordindexerToken_
 
edm::ESGetToken< CSCChannelMapperBase, CSCChannelMapperRecordmapperToken_
 
const std::string myName_
 
bool readBadChannels_
 
CSCRecoConditionsrecoConditions_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Stand-alone test of bad strip channels testing via CSCRecoConditions Tim Cox - 07-Oct-2014 - now using MessageLogger

Definition at line 30 of file CSCRecoBadChannelsAnalyzer.cc.

Constructor & Destructor Documentation

◆ CSCRecoBadChannelsAnalyzer()

CSCRecoBadChannelsAnalyzer::CSCRecoBadChannelsAnalyzer ( edm::ParameterSet const &  ps)
inlineexplicit

Definition at line 32 of file CSCRecoBadChannelsAnalyzer.cc.

33  : dashedLineWidth_(80),
35  myName_("CSCRecoBadChannelsAnalyzer"),
36  readBadChannels_(ps.getParameter<bool>("readBadChannels")),
38  indexerToken_(esConsumes<CSCIndexerBase, CSCIndexerRecord>()),
39  mapperToken_(esConsumes<CSCChannelMapperBase, CSCChannelMapperRecord>()),
40  geometryToken_(esConsumes<CSCGeometry, MuonGeometryRecord>()) {}
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > geometryToken_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::ESGetToken< CSCChannelMapperBase, CSCChannelMapperRecord > mapperToken_
edm::ESGetToken< CSCIndexerBase, CSCIndexerRecord > indexerToken_

◆ ~CSCRecoBadChannelsAnalyzer()

CSCRecoBadChannelsAnalyzer::~CSCRecoBadChannelsAnalyzer ( )
inlineoverride

Definition at line 42 of file CSCRecoBadChannelsAnalyzer.cc.

References recoConditions_.

42 { delete recoConditions_; }

Member Function Documentation

◆ analyze()

void CSCRecoBadChannelsAnalyzer::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overridevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 61 of file CSCRecoBadChannelsAnalyzer.cc.

References CSCRecoConditions::badStrip(), dashedLine_, CSCGeometry::dets(), CSCGeometry::detTypes(), makeMEIFBenchmarkPlots::ev, CSCRecoConditions::fillBadChannelWords(), geometryToken_, edm::EventSetup::getHandle(), indexerToken_, CSCRecoConditions::initializeEvent(), pixelTopology::layer, CSCGeometry::layers(), mapperToken_, myName(), CSCChannelMapperBase::name(), CSCIndexerBase::name(), CSCRecoConditions::nearBadStrip(), and recoConditions_.

61  {
62  using namespace edm::eventsetup;
63 
64  edm::LogVerbatim("CSCBadChannels") << myName() << "::analyze running...";
65  edm::LogVerbatim("CSCBadChannels") << "start " << dashedLine_;
66 
67  edm::LogVerbatim("CSCBadChannels") << "RUN# " << ev.id().run();
68  edm::LogVerbatim("CSCBadChannels") << "EVENT# " << ev.id().event();
69 
70  edm::ESHandle<CSCIndexerBase> theIndexer = evsetup.getHandle(indexerToken_);
71 
72  edm::LogVerbatim("CSCBadChannels") << myName() << "::analyze sees indexer " << theIndexer->name()
73  << " in Event Setup";
74 
75  edm::ESHandle<CSCChannelMapperBase> theMapper = evsetup.getHandle(mapperToken_);
76 
77  edm::LogVerbatim("CSCBadChannels") << myName() << "::analyze sees mapper " << theMapper->name() << " in Event Setup";
78 
79  edm::ESHandle<CSCGeometry> theGeometry = evsetup.getHandle(geometryToken_);
80 
81  edm::LogVerbatim("CSCBadChannels") << " Geometry node for CSCGeom is " << &(*theGeometry);
82  edm::LogVerbatim("CSCBadChannels") << " There are " << theGeometry->dets().size() << " dets";
83  edm::LogVerbatim("CSCBadChannels") << " There are " << theGeometry->detTypes().size() << " types"
84  << "\n";
85 
86  // INITIALIZE CSCConditions
88 
89  // HERE NEED TO ITERATE OVER ALL CSCDetId
90 
91  edm::LogVerbatim("CSCBadChannels") << myName() << ": Begin iteration over geometry...";
92 
93  const CSCGeometry::LayerContainer& vecOfLayers = theGeometry->layers();
94  edm::LogVerbatim("CSCBadChannels") << "There are " << vecOfLayers.size() << " layers";
95 
96  edm::LogVerbatim("CSCBadChannels") << dashedLine_;
97 
98  int ibadchannels = 0; // COUNT OF BAD STRIP CHANNELS
99  int ibadlayers = 0; //COUNT OF LAYERS WITH BAD STRIP CHANNELS
100 
101  for (auto it = vecOfLayers.begin(); it != vecOfLayers.end(); ++it) {
102  const CSCLayer* layer = *it;
103 
104  if (layer) {
105  CSCDetId id = layer->id();
106  int nstrips = layer->geometry()->numberOfStrips();
107  edm::LogVerbatim("CSCBadChannels") << "Layer " << id << " has " << nstrips << " strips";
108 
109  // GET BAD CHANNELS FOR THIS LAYER
110 
112 
113  // SEARCH FOR BAD STRIP CHANNELS IN THIS LAYER - GEOMETRIC STRIP INPUT!!
114 
115  bool layerhasbadchannels = false;
116  for (short is = 1; is <= nstrips; ++is) {
117  if (recoConditions_->badStrip(id, is, nstrips)) {
118  ++ibadchannels;
119  layerhasbadchannels = true;
120  edm::LogVerbatim("CSCBadChannels") << id << " strip " << is << " is bad";
121  }
122  }
123 
124  for (short is = 1; is <= nstrips; ++is) {
125  if (recoConditions_->nearBadStrip(id, is, nstrips)) {
126  edm::LogVerbatim("CSCBadChannels") << id << " strip " << is << " is a neighbor of a bad strip";
127  }
128  }
129 
130  if (layerhasbadchannels)
131  ++ibadlayers;
132 
133  } else {
134  edm::LogVerbatim("CSCBadChannels") << "WEIRD ERROR: a null CSCLayer* was seen";
135  }
136  }
137 
138  edm::LogVerbatim("CSCBadChannels") << "No. of layers with bad strip channels = " << ibadlayers;
139  edm::LogVerbatim("CSCBadChannels") << "No. of bad strip channels seen = " << ibadchannels;
140 
141  edm::LogVerbatim("CSCBadChannels") << dashedLine_ << " end";
142 }
Log< level::Info, true > LogVerbatim
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > geometryToken_
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
bool nearBadStrip(const CSCDetId &id, int geomStrip, int nstrips) const
Is a neighbour bad?
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
Definition: CSCGeometry.cc:79
void fillBadChannelWords(const CSCDetId &id)
fill bad strip & bad wiregroup bitsets from conditions data
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: CSCGeometry.cc:83
edm::ESGetToken< CSCChannelMapperBase, CSCChannelMapperRecord > mapperToken_
bool badStrip(const CSCDetId &id, int geomStrip, int nstrips) const
Is the strip bad?
virtual std::string name() const
const LayerContainer & layers() const
Return a vector of all layers.
Definition: CSCGeometry.cc:98
std::vector< const CSCLayer * > LayerContainer
Definition: CSCGeometry.h:31
virtual std::string name() const
void initializeEvent(const edm::EventSetup &es)
fetch the cond data from the database
edm::ESGetToken< CSCIndexerBase, CSCIndexerRecord > indexerToken_

◆ myName()

const std::string& CSCRecoBadChannelsAnalyzer::myName ( void  )
inline

Definition at line 47 of file CSCRecoBadChannelsAnalyzer.cc.

References myName_.

Referenced by analyze().

47 { return myName_; }

◆ readBadChannels()

bool CSCRecoBadChannelsAnalyzer::readBadChannels ( ) const
inline

did we request reading bad channel info from db?

Definition at line 46 of file CSCRecoBadChannelsAnalyzer.cc.

References readBadChannels_.

Member Data Documentation

◆ dashedLine_

const std::string CSCRecoBadChannelsAnalyzer::dashedLine_
private

Definition at line 51 of file CSCRecoBadChannelsAnalyzer.cc.

Referenced by analyze().

◆ dashedLineWidth_

const int CSCRecoBadChannelsAnalyzer::dashedLineWidth_
private

Definition at line 50 of file CSCRecoBadChannelsAnalyzer.cc.

◆ geometryToken_

edm::ESGetToken<CSCGeometry, MuonGeometryRecord> CSCRecoBadChannelsAnalyzer::geometryToken_
private

Definition at line 58 of file CSCRecoBadChannelsAnalyzer.cc.

Referenced by analyze().

◆ indexerToken_

edm::ESGetToken<CSCIndexerBase, CSCIndexerRecord> CSCRecoBadChannelsAnalyzer::indexerToken_
private

Definition at line 56 of file CSCRecoBadChannelsAnalyzer.cc.

Referenced by analyze().

◆ mapperToken_

edm::ESGetToken<CSCChannelMapperBase, CSCChannelMapperRecord> CSCRecoBadChannelsAnalyzer::mapperToken_
private

Definition at line 57 of file CSCRecoBadChannelsAnalyzer.cc.

Referenced by analyze().

◆ myName_

const std::string CSCRecoBadChannelsAnalyzer::myName_
private

Definition at line 52 of file CSCRecoBadChannelsAnalyzer.cc.

Referenced by myName().

◆ readBadChannels_

bool CSCRecoBadChannelsAnalyzer::readBadChannels_
private

Definition at line 54 of file CSCRecoBadChannelsAnalyzer.cc.

Referenced by readBadChannels().

◆ recoConditions_

CSCRecoConditions* CSCRecoBadChannelsAnalyzer::recoConditions_
private

Definition at line 55 of file CSCRecoBadChannelsAnalyzer.cc.

Referenced by analyze(), and ~CSCRecoBadChannelsAnalyzer().