test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripBadFiberBuilder.cc
Go to the documentation of this file.
2 
4 
5 #include <iostream>
6 #include <fstream>
7 #include <sstream>
8 
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 }
15 
16 
18 }
19 
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 }
67 
68 
T getUntrackedParameter(std::string const &, T const &) const
SiStripBadFiberBuilder(const edm::ParameterSet &)
std::vector< edm::ParameterSet > Parameters
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
void algoAnalyze(const edm::Event &event, const edm::EventSetup &iSetup)
std::pair< ContainerIterator, ContainerIterator > Range
std::string fullPath() const
Definition: FileInPath.cc:184
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)