CMS 3D CMS Logo

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

#include <SiStripBadModuleByHandBuilder.h>

Inheritance diagram for SiStripBadModuleByHandBuilder:
ConditionDBWriter< SiStripBadStrip > edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 SiStripBadModuleByHandBuilder (const edm::ParameterSet &)
 
 ~SiStripBadModuleByHandBuilder ()
 
- Public Member Functions inherited from ConditionDBWriter< SiStripBadStrip >
 ConditionDBWriter (const edm::ParameterSet &iConfig)
 
virtual ~ConditionDBWriter ()
 
- 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
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

SiStripBadStripgetNewObject ()
 

Private Attributes

std::vector< uint32_t > BadModuleList_
 
edm::FileInPath fp_
 
bool printdebug_
 
SiStripDetInfoFileReaderreader
 

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 &)
 
- Protected Member Functions inherited from ConditionDBWriter< SiStripBadStrip >
void setDoStore (const bool doStore)
 When set to false the payload will not be written to the db. More...
 
void storeOnDbNow ()
 
cond::Time_t timeOfLastIOV ()
 
- 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

Definition at line 17 of file SiStripBadModuleByHandBuilder.h.

Constructor & Destructor Documentation

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

Definition at line 8 of file SiStripBadModuleByHandBuilder.cc.

References BadModuleList_, fp_, edm::FileInPath::fullPath(), edm::ParameterSet::getUntrackedParameter(), printdebug_, and reader.

9 
10  fp_ = iConfig.getUntrackedParameter<edm::FileInPath>("file",edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"));
11  BadModuleList_ = iConfig.getUntrackedParameter<std::vector<uint32_t> >("BadModuleList");
12  printdebug_ = iConfig.getUntrackedParameter<bool>("printDebug",false);
13 
15 }
T getUntrackedParameter(std::string const &, T const &) const
std::string fullPath() const
Definition: FileInPath.cc:184
SiStripBadModuleByHandBuilder::~SiStripBadModuleByHandBuilder ( )

Definition at line 18 of file SiStripBadModuleByHandBuilder.cc.

18  {
19 }

Member Function Documentation

SiStripBadStrip * SiStripBadModuleByHandBuilder::getNewObject ( )
privatevirtual

Implements ConditionDBWriter< SiStripBadStrip >.

Definition at line 21 of file SiStripBadModuleByHandBuilder.cc.

References BadModuleList_, TauDecayModes::dec, SiStripBadStrip::encode(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), MuonAssociatorByHits_cfi::obj, printdebug_, SiStripBadStrip::put(), and reader.

21  {
22 
24 
25  unsigned int firstBadStrip=0;
26  unsigned short NconsecutiveBadStrips;
27  unsigned int theBadStripRange;
28 
29  for(std::vector<uint32_t>::const_iterator it=BadModuleList_.begin(); it!=BadModuleList_.end(); ++it){
30 
31  std::vector<unsigned int> theSiStripVector;
32 
33  NconsecutiveBadStrips=reader->getNumberOfApvsAndStripLength(*it).first*128;
34  theBadStripRange = obj->encode(firstBadStrip,NconsecutiveBadStrips);
35  if (printdebug_)
36  edm::LogInfo("SiStripBadModuleByHandBuilder") << " BadModule " << *it << " \t"
37  << " firstBadStrip " << firstBadStrip << "\t "
38  << " NconsecutiveBadStrips " << NconsecutiveBadStrips << "\t "
39  << " packed integer " << std::hex << theBadStripRange << std::dec
40  << std::endl;
41 
42  theSiStripVector.push_back(theBadStripRange);
43  SiStripBadStrip::Range range(theSiStripVector.begin(),theSiStripVector.end());
44  if ( ! obj->put(*it,range) )
45  edm::LogError("SiStripBadModuleByHandBuilder")<<"[SiStripBadModuleByHandBuilder::analyze] detid already exists"<<std::endl;
46  }
47  return obj;
48 }
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
std::pair< ContainerIterator, ContainerIterator > Range
bool put(const uint32_t &detID, const InputVector &vect)
unsigned int encode(const unsigned short &first, const unsigned short &NconsecutiveBadStrips, const unsigned short &flag=0)

Member Data Documentation

std::vector<uint32_t> SiStripBadModuleByHandBuilder::BadModuleList_
private

Definition at line 32 of file SiStripBadModuleByHandBuilder.h.

Referenced by getNewObject(), and SiStripBadModuleByHandBuilder().

edm::FileInPath SiStripBadModuleByHandBuilder::fp_
private

Definition at line 30 of file SiStripBadModuleByHandBuilder.h.

Referenced by SiStripBadModuleByHandBuilder().

bool SiStripBadModuleByHandBuilder::printdebug_
private

Definition at line 31 of file SiStripBadModuleByHandBuilder.h.

Referenced by getNewObject(), and SiStripBadModuleByHandBuilder().

SiStripDetInfoFileReader* SiStripBadModuleByHandBuilder::reader
private

Definition at line 33 of file SiStripBadModuleByHandBuilder.h.

Referenced by getNewObject(), and SiStripBadModuleByHandBuilder().