CMS 3D CMS Logo

Public Member Functions | Private Types | Private Member Functions | Private Attributes

SiStripBadFiberBuilder Class Reference

#include <SiStripBadFiberBuilder.h>

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

List of all members.

Public Member Functions

void algoAnalyze (const edm::Event &event, const edm::EventSetup &iSetup)
 SiStripBadFiberBuilder (const edm::ParameterSet &)
 ~SiStripBadFiberBuilder ()

Private Types

typedef std::vector
< edm::ParameterSet
Parameters

Private Member Functions

SiStripBadStripgetNewObject ()

Private Attributes

Parameters BadComponentList_
edm::FileInPath fp_
SiStripBadStripobj
bool printdebug_

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_.

                                                                             : ConditionDBWriter<SiStripBadStrip>(iConfig){

  fp_ = iConfig.getUntrackedParameter<edm::FileInPath>("file",edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"));
  printdebug_ = iConfig.getUntrackedParameter<bool>("printDebug",false);
  BadComponentList_ =  iConfig.getUntrackedParameter<Parameters>("BadComponentList");
}
SiStripBadFiberBuilder::~SiStripBadFiberBuilder ( )

Definition at line 17 of file SiStripBadFiberBuilder.cc.

                                               {
}

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(), SiStripDetInfoFileReader::getAllDetIds(), obj, printdebug_, SiStripBadStrip::put(), and CrabTask::run.

                                                                                           {
  
  unsigned int run=event.id().run();

  edm::LogInfo("SiStripBadFiberBuilder") << "... creating dummy SiStripBadStrip Data for Run " << run << "\n " << std::endl;
  
  obj = new SiStripBadStrip();

  SiStripDetInfoFileReader reader(fp_.fullPath());
  
  const std::vector<uint32_t> DetIds = reader.getAllDetIds();

  std::stringstream ss;
  for(Parameters::iterator iBadComponent = BadComponentList_.begin(); iBadComponent != BadComponentList_.end(); ++iBadComponent ) {
    
    uint32_t BadModule_ = iBadComponent->getParameter<uint32_t>("BadModule");
    std::vector<uint32_t> BadApvList_ = iBadComponent->getParameter<std::vector<uint32_t> >("BadApvList");

    std::vector<unsigned int> theSiStripVector;
    
    unsigned short firstBadStrip=0, NconsecutiveBadStrips=0;
    unsigned int theBadStripRange;
    
    for(std::vector<uint32_t>::const_iterator is=BadApvList_.begin(); is!=BadApvList_.end(); ++is){

      firstBadStrip=(*is)*128;
      NconsecutiveBadStrips=128;
      
      theBadStripRange = obj->encode(firstBadStrip,NconsecutiveBadStrips);
      
      if (printdebug_)
        ss << "detid " << BadModule_ << " \t"
           << " firstBadStrip " << firstBadStrip << "\t "
           << " NconsecutiveBadStrips " << NconsecutiveBadStrips << "\t "
           << " packed integer " << std::hex << theBadStripRange  << std::dec
           << std::endl;            
      
      theSiStripVector.push_back(theBadStripRange);
    }      
     
    SiStripBadStrip::Range range(theSiStripVector.begin(),theSiStripVector.end());
    if ( ! obj->put(BadModule_,range) )
      edm::LogError("SiStripBadFiberBuilder")<<"[SiStripBadFiberBuilder::analyze] detid already exists"<<std::endl;
  }
  if (printdebug_)
    edm::LogInfo("SiStripBadFiberBuilder") << ss.str();
}
SiStripBadStrip* SiStripBadFiberBuilder::getNewObject ( ) [inline, private, virtual]

Implements ConditionDBWriter< SiStripBadStrip >.

Definition at line 27 of file SiStripBadFiberBuilder.h.

References obj.

{return obj;}

Member Data Documentation

Definition at line 35 of file SiStripBadFiberBuilder.h.

Referenced by algoAnalyze(), and SiStripBadFiberBuilder().

Definition at line 30 of file SiStripBadFiberBuilder.h.

Referenced by algoAnalyze(), and SiStripBadFiberBuilder().

Definition at line 32 of file SiStripBadFiberBuilder.h.

Referenced by algoAnalyze(), and getNewObject().

Definition at line 31 of file SiStripBadFiberBuilder.h.

Referenced by algoAnalyze(), and SiStripBadFiberBuilder().