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
CSCRecoBadChannelsAnalyzer Class Reference
Inheritance diagram for CSCRecoBadChannelsAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &e, const edm::EventSetup &c)
 
 CSCRecoBadChannelsAnalyzer (edm::ParameterSet const &ps)
 
const std::string & myName ()
 
bool readBadChannels () const
 did we request reading bad channel info from db? More...
 
virtual ~CSCRecoBadChannelsAnalyzer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
 
- Static Public Member Functions inherited from edm::EDAnalyzer
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

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 ( edm::ParameterSet const &  ps)
inlineexplicit

Definition at line 34 of file CSCRecoBadChannelsAnalyzer.cc.

35  : dashedLineWidth_( 80 ),
37  myName_( "CSCRecoBadChannelsAnalyzer" ),
38  readBadChannels_( ps.getParameter<bool>("readBadChannels") ),
39  recoConditions_( new CSCRecoConditions( ps ) ) {
40  }
virtual CSCRecoBadChannelsAnalyzer::~CSCRecoBadChannelsAnalyzer ( )
inlinevirtual

Definition at line 42 of file CSCRecoBadChannelsAnalyzer.cc.

References recoConditions_.

42 { delete recoConditions_; }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 59 of file CSCRecoBadChannelsAnalyzer.cc.

References CSCRecoConditions::badStrip(), dashedLine_, edm::EventID::event(), CSCRecoConditions::fillBadChannelWords(), CSCLayer::geometry(), edm::EventSetup::get(), CSCLayer::id(), edm::EventBase::id(), CSCRecoConditions::initializeEvent(), myName(), CSCRecoConditions::nearBadStrip(), CSCLayerGeometry::numberOfStrips(), recoConditions_, and edm::EventID::run().

60  {
61  using namespace edm::eventsetup;
62 
63  edm::LogVerbatim("CSCBadChannels") << myName() << "::analyze running..." ;
64  edm::LogVerbatim("CSCBadChannels") << "start " << dashedLine_ ;
65 
66  edm::LogVerbatim("CSCBadChannels") << "RUN# " << ev.id().run() ;
67  edm::LogVerbatim("CSCBadChannels") << "EVENT# " << ev.id().event() ;
68 
70  evsetup.get<CSCIndexerRecord>().get(theIndexer);
71 
72  edm::LogVerbatim("CSCBadChannels") << myName() << "::analyze sees indexer " << theIndexer->name() << " in Event Setup" ;
73 
75  evsetup.get<CSCChannelMapperRecord>().get(theMapper);
76 
77  edm::LogVerbatim("CSCBadChannels") << myName() << "::analyze sees mapper " << theMapper->name() << " in Event Setup" ;
78 
79  edm::ESHandle<CSCGeometry> theGeometry;
80  evsetup.get<MuonGeometryRecord>().get( theGeometry );
81 
82  edm::LogVerbatim("CSCBadChannels") << " Geometry node for CSCGeom is " << &(*theGeometry) ;
83  edm::LogVerbatim("CSCBadChannels") << " There are " << theGeometry->dets().size() << " dets" ;
84  edm::LogVerbatim("CSCBadChannels") << " There are " << theGeometry->detTypes().size() << " types" << "\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 
103  const CSCLayer* layer = *it;
104 
105  if( layer ){
106  CSCDetId id = layer->id();
107  int nstrips = layer->geometry()->numberOfStrips();
108  edm::LogVerbatim("CSCBadChannels") << "Layer " << id << " has " << nstrips << " strips" ;
109 
110  // GET BAD CHANNELS FOR THIS LAYER
111 
113 
114  // SEARCH FOR BAD STRIP CHANNELS IN THIS LAYER - GEOMETRIC STRIP INPUT!!
115 
116  bool layerhasbadchannels = false;
117  for ( short is = 1; is<=nstrips; ++is ) {
118  if ( recoConditions_->badStrip( id, is, nstrips ) ) {
119  ++ibadchannels;
120  layerhasbadchannels = true;
121  edm::LogVerbatim("CSCBadChannels") << id << " strip " << is << " is bad" ;
122  }
123  }
124 
125  for ( short is = 1; is<=nstrips; ++is ) {
126  if ( recoConditions_->nearBadStrip( id, is, nstrips ) ) {
127  edm::LogVerbatim("CSCBadChannels") << id << " strip " << is << " is a neighbor of a bad strip" ;
128  }
129  }
130 
131  if (layerhasbadchannels) ++ibadlayers;
132 
133  }
134  else {
135  edm::LogVerbatim("CSCBadChannels") << "WEIRD ERROR: a null CSCLayer* was seen" ;
136  }
137  }
138 
139  edm::LogVerbatim("CSCBadChannels") << "No. of layers with bad strip channels = " << ibadlayers ;
140  edm::LogVerbatim("CSCBadChannels") << "No. of bad strip channels seen = " << ibadchannels ;
141 
142  edm::LogVerbatim("CSCBadChannels") << dashedLine_ << " end" ;
143  }
CSCDetId id() const
Definition: CSCLayer.h:42
int numberOfStrips() const
bool ev
bool nearBadStrip(const CSCDetId &id, int geomStrip, int nstrips) const
Is a neighbour bad?
bool badStrip(const CSCDetId &id, int geomStrip, int nstrips) const
Is the strip bad?
void fillBadChannelWords(const CSCDetId &id)
fill bad strip &amp; bad wiregroup bitsets from conditions data
std::vector< const CSCLayer * > LayerContainer
Definition: CSCGeometry.h:33
void initializeEvent(const edm::EventSetup &es)
fetch the cond data from the database
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:47
const std::string& CSCRecoBadChannelsAnalyzer::myName ( void  )
inline

Definition at line 47 of file CSCRecoBadChannelsAnalyzer.cc.

References myName_.

Referenced by analyze().

47 { return myName_;}
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

const std::string CSCRecoBadChannelsAnalyzer::dashedLine_
private

Definition at line 52 of file CSCRecoBadChannelsAnalyzer.cc.

Referenced by analyze().

const int CSCRecoBadChannelsAnalyzer::dashedLineWidth_
private

Definition at line 51 of file CSCRecoBadChannelsAnalyzer.cc.

const std::string CSCRecoBadChannelsAnalyzer::myName_
private

Definition at line 53 of file CSCRecoBadChannelsAnalyzer.cc.

Referenced by myName().

bool CSCRecoBadChannelsAnalyzer::readBadChannels_
private

Definition at line 55 of file CSCRecoBadChannelsAnalyzer.cc.

Referenced by readBadChannels().

CSCRecoConditions* CSCRecoBadChannelsAnalyzer::recoConditions_
private

Definition at line 56 of file CSCRecoBadChannelsAnalyzer.cc.

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