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 Types | Private Member Functions | Private Attributes
SiStripBadFiberBuilder Class Reference

#include <SiStripBadFiberBuilder.h>

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

Public Member Functions

void algoAnalyze (const edm::Event &event, const edm::EventSetup &iSetup)
 
 SiStripBadFiberBuilder (const edm::ParameterSet &)
 
 ~SiStripBadFiberBuilder ()
 
- 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
 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 Types

typedef std::vector
< edm::ParameterSet
Parameters
 

Private Member Functions

SiStripBadStripgetNewObject ()
 

Private Attributes

Parameters BadComponentList_
 
edm::FileInPath fp_
 
SiStripBadStripobj
 
bool printdebug_
 

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 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 16 of file SiStripBadFiberBuilder.h.

Member Typedef Documentation

typedef std::vector< edm::ParameterSet > SiStripBadFiberBuilder::Parameters
private

Definition at line 34 of file SiStripBadFiberBuilder.h.

Constructor & Destructor Documentation

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

Definition at line 9 of file SiStripBadFiberBuilder.cc.

References BadComponentList_, fp_, edm::ParameterSet::getUntrackedParameter(), and printdebug_.

10 
11  fp_ = iConfig.getUntrackedParameter<edm::FileInPath>("file",edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"));
12  printdebug_ = iConfig.getUntrackedParameter<bool>("printDebug",false);
13  BadComponentList_ = iConfig.getUntrackedParameter<Parameters>("BadComponentList");
14 }
T getUntrackedParameter(std::string const &, T const &) const
vector< ParameterSet > Parameters
SiStripBadFiberBuilder::~SiStripBadFiberBuilder ( )

Definition at line 17 of file SiStripBadFiberBuilder.cc.

17  {
18 }

Member Function Documentation

void SiStripBadFiberBuilder::algoAnalyze ( const edm::Event event,
const edm::EventSetup iSetup 
)
virtual

Reimplemented from ConditionDBWriter< SiStripBadStrip >.

Definition at line 20 of file SiStripBadFiberBuilder.cc.

References BadComponentList_, SiStripBadStrip::encode(), fp_, edm::FileInPath::fullPath(), obj, printdebug_, SiStripBadStrip::put(), matplotRender::reader, DTTTrigCorrFirst::run, and contentValuesCheck::ss.

20  {
21 
22  unsigned int run=event.id().run();
23 
24  edm::LogInfo("SiStripBadFiberBuilder") << "... creating dummy SiStripBadStrip Data for Run " << run << "\n " << std::endl;
25 
26  obj = new SiStripBadStrip();
27 
29 
30  const std::vector<uint32_t> DetIds = reader.getAllDetIds();
31 
32  std::stringstream ss;
33  for(Parameters::iterator iBadComponent = BadComponentList_.begin(); iBadComponent != BadComponentList_.end(); ++iBadComponent ) {
34 
35  uint32_t BadModule_ = iBadComponent->getParameter<uint32_t>("BadModule");
36  std::vector<uint32_t> BadApvList_ = iBadComponent->getParameter<std::vector<uint32_t> >("BadApvList");
37 
38  std::vector<unsigned int> theSiStripVector;
39 
40  unsigned short firstBadStrip=0, NconsecutiveBadStrips=0;
41  unsigned int theBadStripRange;
42 
43  for(std::vector<uint32_t>::const_iterator is=BadApvList_.begin(); is!=BadApvList_.end(); ++is){
44 
45  firstBadStrip=(*is)*128;
46  NconsecutiveBadStrips=128;
47 
48  theBadStripRange = obj->encode(firstBadStrip,NconsecutiveBadStrips);
49 
50  if (printdebug_)
51  ss << "detid " << BadModule_ << " \t"
52  << " firstBadStrip " << firstBadStrip << "\t "
53  << " NconsecutiveBadStrips " << NconsecutiveBadStrips << "\t "
54  << " packed integer " << std::hex << theBadStripRange << std::dec
55  << std::endl;
56 
57  theSiStripVector.push_back(theBadStripRange);
58  }
59 
60  SiStripBadStrip::Range range(theSiStripVector.begin(),theSiStripVector.end());
61  if ( ! obj->put(BadModule_,range) )
62  edm::LogError("SiStripBadFiberBuilder")<<"[SiStripBadFiberBuilder::analyze] detid already exists"<<std::endl;
63  }
64  if (printdebug_)
65  edm::LogInfo("SiStripBadFiberBuilder") << ss.str();
66 }
std::pair< ContainerIterator, ContainerIterator > Range
std::string fullPath() const
Definition: FileInPath.cc:165
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)
SiStripBadStrip* SiStripBadFiberBuilder::getNewObject ( )
inlineprivatevirtual

Implements ConditionDBWriter< SiStripBadStrip >.

Definition at line 27 of file SiStripBadFiberBuilder.h.

References obj.

27 {return obj;}

Member Data Documentation

Parameters SiStripBadFiberBuilder::BadComponentList_
private

Definition at line 35 of file SiStripBadFiberBuilder.h.

Referenced by algoAnalyze(), and SiStripBadFiberBuilder().

edm::FileInPath SiStripBadFiberBuilder::fp_
private

Definition at line 30 of file SiStripBadFiberBuilder.h.

Referenced by algoAnalyze(), and SiStripBadFiberBuilder().

SiStripBadStrip* SiStripBadFiberBuilder::obj
private

Definition at line 32 of file SiStripBadFiberBuilder.h.

Referenced by algoAnalyze(), and getNewObject().

bool SiStripBadFiberBuilder::printdebug_
private

Definition at line 31 of file SiStripBadFiberBuilder.h.

Referenced by algoAnalyze(), and SiStripBadFiberBuilder().