CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CSCRecoBadChannelsAnalyzer Class Reference
Inheritance diagram for CSCRecoBadChannelsAnalyzer:
edm::EDAnalyzer 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::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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

const std::string dashedLine_
 
const int dashedLineWidth_
 
const std::string myName_
 
bool readBadChannels_
 
CSCRecoConditionsrecoConditions_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
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
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

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

Definition at line 29 of file CSCRecoBadChannelsAnalyzer.cc.

Constructor & Destructor Documentation

◆ CSCRecoBadChannelsAnalyzer()

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

Definition at line 31 of file CSCRecoBadChannelsAnalyzer.cc.

32  : dashedLineWidth_(80),
34  myName_("CSCRecoBadChannelsAnalyzer"),
35  readBadChannels_(ps.getParameter<bool>("readBadChannels")),

◆ ~CSCRecoBadChannelsAnalyzer()

CSCRecoBadChannelsAnalyzer::~CSCRecoBadChannelsAnalyzer ( )
inlineoverride

Definition at line 38 of file CSCRecoBadChannelsAnalyzer.cc.

38 { delete recoConditions_; }

References recoConditions_.

Member Function Documentation

◆ analyze()

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

Implements edm::EDAnalyzer.

Definition at line 54 of file CSCRecoBadChannelsAnalyzer.cc.

54  {
55  using namespace edm::eventsetup;
56 
57  edm::LogVerbatim("CSCBadChannels") << myName() << "::analyze running...";
58  edm::LogVerbatim("CSCBadChannels") << "start " << dashedLine_;
59 
60  edm::LogVerbatim("CSCBadChannels") << "RUN# " << ev.id().run();
61  edm::LogVerbatim("CSCBadChannels") << "EVENT# " << ev.id().event();
62 
64  evsetup.get<CSCIndexerRecord>().get(theIndexer);
65 
66  edm::LogVerbatim("CSCBadChannels") << myName() << "::analyze sees indexer " << theIndexer->name()
67  << " in Event Setup";
68 
70  evsetup.get<CSCChannelMapperRecord>().get(theMapper);
71 
72  edm::LogVerbatim("CSCBadChannels") << myName() << "::analyze sees mapper " << theMapper->name() << " in Event Setup";
73 
74  edm::ESHandle<CSCGeometry> theGeometry;
75  evsetup.get<MuonGeometryRecord>().get(theGeometry);
76 
77  edm::LogVerbatim("CSCBadChannels") << " Geometry node for CSCGeom is " << &(*theGeometry);
78  edm::LogVerbatim("CSCBadChannels") << " There are " << theGeometry->dets().size() << " dets";
79  edm::LogVerbatim("CSCBadChannels") << " There are " << theGeometry->detTypes().size() << " types"
80  << "\n";
81 
82  // INITIALIZE CSCConditions
84 
85  // HERE NEED TO ITERATE OVER ALL CSCDetId
86 
87  edm::LogVerbatim("CSCBadChannels") << myName() << ": Begin iteration over geometry...";
88 
89  const CSCGeometry::LayerContainer& vecOfLayers = theGeometry->layers();
90  edm::LogVerbatim("CSCBadChannels") << "There are " << vecOfLayers.size() << " layers";
91 
92  edm::LogVerbatim("CSCBadChannels") << dashedLine_;
93 
94  int ibadchannels = 0; // COUNT OF BAD STRIP CHANNELS
95  int ibadlayers = 0; //COUNT OF LAYERS WITH BAD STRIP CHANNELS
96 
97  for (auto it = vecOfLayers.begin(); it != vecOfLayers.end(); ++it) {
98  const CSCLayer* layer = *it;
99 
100  if (layer) {
101  CSCDetId id = layer->id();
102  int nstrips = layer->geometry()->numberOfStrips();
103  edm::LogVerbatim("CSCBadChannels") << "Layer " << id << " has " << nstrips << " strips";
104 
105  // GET BAD CHANNELS FOR THIS LAYER
106 
108 
109  // SEARCH FOR BAD STRIP CHANNELS IN THIS LAYER - GEOMETRIC STRIP INPUT!!
110 
111  bool layerhasbadchannels = false;
112  for (short is = 1; is <= nstrips; ++is) {
113  if (recoConditions_->badStrip(id, is, nstrips)) {
114  ++ibadchannels;
115  layerhasbadchannels = true;
116  edm::LogVerbatim("CSCBadChannels") << id << " strip " << is << " is bad";
117  }
118  }
119 
120  for (short is = 1; is <= nstrips; ++is) {
121  if (recoConditions_->nearBadStrip(id, is, nstrips)) {
122  edm::LogVerbatim("CSCBadChannels") << id << " strip " << is << " is a neighbor of a bad strip";
123  }
124  }
125 
126  if (layerhasbadchannels)
127  ++ibadlayers;
128 
129  } else {
130  edm::LogVerbatim("CSCBadChannels") << "WEIRD ERROR: a null CSCLayer* was seen";
131  }
132  }
133 
134  edm::LogVerbatim("CSCBadChannels") << "No. of layers with bad strip channels = " << ibadlayers;
135  edm::LogVerbatim("CSCBadChannels") << "No. of bad strip channels seen = " << ibadchannels;
136 
137  edm::LogVerbatim("CSCBadChannels") << dashedLine_ << " end";
138 }

References CSCRecoConditions::badStrip(), dashedLine_, CSCGeometry::dets(), CSCGeometry::detTypes(), ev, CSCRecoConditions::fillBadChannelWords(), CSCLayer::geometry(), edm::EventSetup::get(), get, CSCLayer::id(), CSCRecoConditions::initializeEvent(), CSCGeometry::layers(), myName(), CSCChannelMapperBase::name(), CSCIndexerBase::name(), CSCRecoConditions::nearBadStrip(), CSCLayerGeometry::numberOfStrips(), and recoConditions_.

◆ myName()

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

Definition at line 43 of file CSCRecoBadChannelsAnalyzer.cc.

43 { return myName_; }

References myName_.

Referenced by analyze().

◆ readBadChannels()

bool CSCRecoBadChannelsAnalyzer::readBadChannels ( ) const
inline

did we request reading bad channel info from db?

Definition at line 42 of file CSCRecoBadChannelsAnalyzer.cc.

42 { return readBadChannels_; }

References readBadChannels_.

Member Data Documentation

◆ dashedLine_

const std::string CSCRecoBadChannelsAnalyzer::dashedLine_
private

Definition at line 47 of file CSCRecoBadChannelsAnalyzer.cc.

Referenced by analyze().

◆ dashedLineWidth_

const int CSCRecoBadChannelsAnalyzer::dashedLineWidth_
private

Definition at line 46 of file CSCRecoBadChannelsAnalyzer.cc.

◆ myName_

const std::string CSCRecoBadChannelsAnalyzer::myName_
private

Definition at line 48 of file CSCRecoBadChannelsAnalyzer.cc.

Referenced by myName().

◆ readBadChannels_

bool CSCRecoBadChannelsAnalyzer::readBadChannels_
private

Definition at line 50 of file CSCRecoBadChannelsAnalyzer.cc.

Referenced by readBadChannels().

◆ recoConditions_

CSCRecoConditions* CSCRecoBadChannelsAnalyzer::recoConditions_
private

Definition at line 51 of file CSCRecoBadChannelsAnalyzer.cc.

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

CSCRecoBadChannelsAnalyzer::dashedLineWidth_
const int dashedLineWidth_
Definition: CSCRecoBadChannelsAnalyzer.cc:46
CSCRecoConditions::initializeEvent
void initializeEvent(const edm::EventSetup &es)
fetch the cond data from the database
Definition: CSCRecoConditions.cc:10
CSCLayer
Definition: CSCLayer.h:24
CSCIndexerBase::name
virtual std::string name() const
Definition: CSCIndexerBase.h:82
CSCLayer::id
CSCDetId id() const
Definition: CSCLayer.h:39
edm::ESHandle< CSCIndexerBase >
CSCLayer::geometry
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:44
CSCChannelMapperRecord
Definition: CSCChannelMapperRecord.h:6
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CSCRecoConditions::badStrip
bool badStrip(const CSCDetId &id, int geomStrip, int nstrips) const
Is the strip bad?
Definition: CSCRecoConditions.cc:138
CSCRecoBadChannelsAnalyzer::dashedLine_
const std::string dashedLine_
Definition: CSCRecoBadChannelsAnalyzer.cc:47
CSCRecoBadChannelsAnalyzer::myName_
const std::string myName_
Definition: CSCRecoBadChannelsAnalyzer.cc:48
CSCRecoBadChannelsAnalyzer::myName
const std::string & myName()
Definition: CSCRecoBadChannelsAnalyzer.cc:43
CSCRecoBadChannelsAnalyzer::readBadChannels_
bool readBadChannels_
Definition: CSCRecoBadChannelsAnalyzer.cc:50
CSCRecoConditions::nearBadStrip
bool nearBadStrip(const CSCDetId &id, int geomStrip, int nstrips) const
Is a neighbour bad?
Definition: CSCRecoConditions.cc:132
CSCGeometry::detTypes
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
Definition: CSCGeometry.cc:79
CSCDetId
Definition: CSCDetId.h:26
CSCRecoConditions::fillBadChannelWords
void fillBadChannelWords(const CSCDetId &id)
fill bad strip & bad wiregroup bitsets from conditions data
Definition: CSCRecoConditions.cc:13
CSCGeometry::dets
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: CSCGeometry.cc:83
edm::LogVerbatim
Definition: MessageLogger.h:297
get
#define get
CSCRecoBadChannelsAnalyzer::recoConditions_
CSCRecoConditions * recoConditions_
Definition: CSCRecoBadChannelsAnalyzer.cc:51
CSCRecoConditions
Definition: CSCRecoConditions.h:24
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
CSCChannelMapperBase::name
virtual std::string name() const
Definition: CSCChannelMapperBase.h:47
CSCGeometry::layers
const LayerContainer & layers() const
Return a vector of all layers.
Definition: CSCGeometry.cc:98
CSCIndexerRecord
Definition: CSCIndexerRecord.h:6
CSCLayerGeometry::numberOfStrips
int numberOfStrips() const
Definition: CSCLayerGeometry.h:66
edm::eventsetup
Definition: ES_DDDetector.cc:16
CSCGeometry::LayerContainer
std::vector< const CSCLayer * > LayerContainer
Definition: CSCGeometry.h:31
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34