test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCBadChambersPyWrapper.cc
Go to the documentation of this file.
6 #include <sstream>
7 #include <string>
8 #include <vector>
9 
10 namespace cond {
11 
12  template<>
14  std::stringstream ss;
15  CSCIndexer indexer;
17  int numberOfChambers = object().numberOfChambers();
18 
20  std::vector<int> vContainerInts = object().container();
21  std::vector<CSCDetId> vCSCDetIds;
22  std::vector<int>::const_iterator iInt;
23  //get vector of CSCDetId:
24  for (iInt = vContainerInts.begin(); iInt != vContainerInts.end(); ++iInt){
25  vCSCDetIds.push_back(indexer.detIdFromChamberIndex(*iInt));
26  }
28  //bool isInBadChamber0 = object().isInBadChamber( const CSCDetId& id );
29 
30  //print data:
31  ss << "---Total of bad Chambers: " << numberOfChambers << std::endl;
32  ss << "--Bad chambers:" << std::endl;
33  iInt = vContainerInts.begin();
34  int index = 0;
35  for (std::vector<CSCDetId>::const_iterator iCSCDetId = vCSCDetIds.begin(); iCSCDetId != vCSCDetIds.end(); ++iCSCDetId, ++iInt){
36  ss << index++ << ". "<< "Id[" << *iInt
37  << "]-> Chamber index: " << indexer.chamberIndex( *iCSCDetId )
38  << "; Layer index: " << indexer.layerIndex( *iCSCDetId )
39  << ";"<< std::endl;
40  }
41 
42  return ss.str();
43  }
44 
45 }
IndexType chamberIndex(const CSCDetId &id) const
Definition: CSCIndexer.h:66
#define PYTHON_WRAPPER(_class, _name)
std::string summary() const
CSCDetId detIdFromChamberIndex(IndexType ici) const
Definition: CSCIndexer.cc:62
list object
Definition: dbtoconf.py:77
IndexType layerIndex(const CSCDetId &id) const
Definition: CSCIndexer.h:80