CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Functions
CastorDbASCIIIO Namespace Reference

Classes

class  CastorElectronicsIdLess
 
class  DetIdLess
 

Functions

template<class T >
bool dumpCastorObject (std::ostream &fOutput, const T &fObject)
 
template<class T >
bool dumpCastorSingleFloatObject (std::ostream &fOutput, const T &fObject)
 
template<class T >
bool dumpCastorSingleIntObject (std::ostream &fOutput, const T &fObject)
 
void dumpId (std::ostream &fOutput, DetId id)
 
bool dumpObject (std::ostream &fOutput, const CastorPedestals &fObject)
 
bool dumpObject (std::ostream &fOutput, const CastorPedestalWidths &fObject)
 
bool dumpObject (std::ostream &fOutput, const CastorGains &fObject)
 
bool dumpObject (std::ostream &fOutput, const CastorGainWidths &fObject)
 
bool dumpObject (std::ostream &fOutput, const CastorQIEData &fObject)
 
bool dumpObject (std::ostream &fOutput, const CastorCalibrationQIEData &fObject)
 
bool dumpObject (std::ostream &fOutput, const CastorElectronicsMap &fObject)
 
bool dumpObject (std::ostream &fOutput, const CastorChannelQuality &fObject)
 
bool dumpObject (std::ostream &fOutput, const CastorRecoParams &fObject)
 
bool dumpObject (std::ostream &fOutput, const CastorSaturationCorrs &fObject)
 
template<class S , class T >
bool getCastorObject (std::istream &fInput, T &fObject)
 
template<class S , class T >
bool getCastorSingleFloatObject (std::istream &fInput, T &fObject)
 
template<class S , class T >
bool getCastorSingleIntObject (std::istream &fInput, T &fObject, S *fCondObject)
 
DetId getId (const std::vector< std::string > &items)
 
bool getObject (std::istream &fInput, CastorPedestals &fObject)
 
bool getObject (std::istream &fInput, CastorPedestalWidths &fObject)
 
bool getObject (std::istream &fInput, CastorGains &fObject)
 
bool getObject (std::istream &fInput, CastorGainWidths &fObject)
 
bool getObject (std::istream &fInput, CastorQIEData &fObject)
 
bool getObject (std::istream &fInput, CastorCalibrationQIEData &fObject)
 
bool getObject (std::istream &fInput, CastorElectronicsMap &fObject)
 
bool getObject (std::istream &fInput, CastorChannelQuality &fObject)
 
bool getObject (std::istream &fInput, CastorRecoParams &fObject)
 
bool getObject (std::istream &fInput, CastorSaturationCorrs &fObject)
 
std::vector< std::string > splitString (const std::string &fLine)
 

Function Documentation

template<class T >
bool CastorDbASCIIIO::dumpCastorObject ( std::ostream &  fOutput,
const T fObject 
)

Definition at line 115 of file CastorDbASCIIIO.cc.

References edmScanValgrind::buffer, dumpId(), and makeHLTPrescaleTable::values.

115  {
116  char buffer[1024];
117  sprintf(buffer,
118  "# %15s %15s %15s %15s %8s %8s %8s %8s %10s\n",
119  "eta",
120  "phi",
121  "dep",
122  "det",
123  "cap0",
124  "cap1",
125  "cap2",
126  "cap3",
127  "DetId");
128  fOutput << buffer;
129  std::vector<DetId> channels = fObject.getAllChannels();
130  //std::sort (channels.begin(), channels.end(), DetIdLess ());
131  for (std::vector<DetId>::iterator channel = channels.begin(); channel != channels.end(); ++channel) {
132  const float* values = fObject.getValues(*channel)->getValues();
133  if (values) {
134  dumpId(fOutput, *channel);
135  sprintf(
136  buffer, " %8.5f %8.5f %8.5f %8.5f %10X\n", values[0], values[1], values[2], values[3], channel->rawId());
137  fOutput << buffer;
138  }
139  }
140  return true;
141  }
void dumpId(std::ostream &fOutput, DetId id)
template<class T >
bool CastorDbASCIIIO::dumpCastorSingleFloatObject ( std::ostream &  fOutput,
const T fObject 
)

Definition at line 171 of file CastorDbASCIIIO.cc.

References edmScanValgrind::buffer, dumpId(), and relativeConstraints::value.

171  {
172  char buffer[1024];
173  sprintf(buffer, "# %15s %15s %15s %15s %8s %10s\n", "eta", "phi", "dep", "det", "value", "DetId");
174  fOutput << buffer;
175  std::vector<DetId> channels = fObject.getAllChannels();
176  std::sort(channels.begin(), channels.end(), DetIdLess());
177  for (std::vector<DetId>::iterator channel = channels.begin(); channel != channels.end(); ++channel) {
178  const float value = fObject.getValues(*channel)->getValue();
179  dumpId(fOutput, *channel);
180  sprintf(buffer, " %8.5f %10X\n", value, channel->rawId());
181  fOutput << buffer;
182  }
183  return true;
184  }
void dumpId(std::ostream &fOutput, DetId id)
template<class T >
bool CastorDbASCIIIO::dumpCastorSingleIntObject ( std::ostream &  fOutput,
const T fObject 
)

Definition at line 215 of file CastorDbASCIIIO.cc.

References edmScanValgrind::buffer, dumpId(), and relativeConstraints::value.

215  {
216  char buffer[1024];
217  sprintf(buffer, "# %15s %15s %15s %15s %8s %10s\n", "eta", "phi", "dep", "det", "value", "DetId");
218  fOutput << buffer;
219  std::vector<DetId> channels = fObject.getAllChannels();
220  std::sort(channels.begin(), channels.end(), DetIdLess());
221  for (std::vector<DetId>::iterator channel = channels.begin(); channel != channels.end(); ++channel) {
222  const int value = fObject.getValues(*channel)->getValue();
223  dumpId(fOutput, *channel);
224  sprintf(buffer, " %15d %10X\n", value, channel->rawId());
225  fOutput << buffer;
226  }
227  return true;
228  }
void dumpId(std::ostream &fOutput, DetId id)
void CastorDbASCIIIO::dumpId ( std::ostream &  fOutput,
DetId  id 
)
bool CastorDbASCIIIO::dumpObject ( std::ostream &  fOutput,
const CastorPedestals fObject 
)
bool CastorDbASCIIIO::dumpObject ( std::ostream &  fOutput,
const CastorPedestalWidths fObject 
)
bool CastorDbASCIIIO::dumpObject ( std::ostream &  fOutput,
const CastorGains fObject 
)
bool CastorDbASCIIIO::dumpObject ( std::ostream &  fOutput,
const CastorGainWidths fObject 
)
bool CastorDbASCIIIO::dumpObject ( std::ostream &  fOutput,
const CastorQIEData fObject 
)
bool CastorDbASCIIIO::dumpObject ( std::ostream &  fOutput,
const CastorCalibrationQIEData fObject 
)
bool CastorDbASCIIIO::dumpObject ( std::ostream &  fOutput,
const CastorElectronicsMap fObject 
)
bool CastorDbASCIIIO::dumpObject ( std::ostream &  fOutput,
const CastorChannelQuality fObject 
)
bool CastorDbASCIIIO::dumpObject ( std::ostream &  fOutput,
const CastorRecoParams fObject 
)
bool CastorDbASCIIIO::dumpObject ( std::ostream &  fOutput,
const CastorSaturationCorrs fObject 
)
template<class S , class T >
bool CastorDbASCIIIO::getCastorObject ( std::istream &  fInput,
T fObject 
)

Definition at line 86 of file CastorDbASCIIIO.cc.

References getId(), splitString(), and AlCaHLTBitMon_QueryRunRegistry::string.

86  {
87  char buffer[1024];
88  while (fInput.getline(buffer, 1024)) {
89  if (buffer[0] == '#')
90  continue; //ignore comment
91  std::vector<std::string> items = splitString(std::string(buffer));
92  if (items.empty())
93  continue; // blank line
94  if (items.size() < 8) {
95  edm::LogWarning("Format Error") << "Bad line: " << buffer
96  << "\n line must contain 8 items: eta, phi, depth, subdet, 4x values"
97  << std::endl;
98  continue;
99  }
100  DetId id = getId(items);
101 
102  // if (fObject->exists(id) )
103  // edm::LogWarning("Redefining Channel") << "line: " << buffer << "\n attempts to redefine data. Ignored" << std::endl;
104  // else
105  // {
106  S fCondObject(id, atof(items[4].c_str()), atof(items[5].c_str()), atof(items[6].c_str()), atof(items[7].c_str()));
107  fObject.addValues(fCondObject);
108  // }
109  }
110 
111  return true;
112  }
static unsigned int getId()
std::vector< std::string > splitString(const std::string &fLine)
Definition: DetId.h:17
Log< level::Warning, false > LogWarning
template<class S , class T >
bool CastorDbASCIIIO::getCastorSingleFloatObject ( std::istream &  fInput,
T fObject 
)

Definition at line 144 of file CastorDbASCIIIO.cc.

References getId(), splitString(), and AlCaHLTBitMon_QueryRunRegistry::string.

144  {
145  char buffer[1024];
146  while (fInput.getline(buffer, 1024)) {
147  if (buffer[0] == '#')
148  continue; //ignore comment
149  std::vector<std::string> items = splitString(std::string(buffer));
150  if (items.empty())
151  continue; // blank line
152  if (items.size() < 5) {
153  edm::LogWarning("Format Error") << "Bad line: " << buffer
154  << "\n line must contain 5 items: eta, phi, depth, subdet, value" << std::endl;
155  continue;
156  }
157  DetId id = getId(items);
158 
159  // if (fObject->exists(id) )
160  // edm::LogWarning("Redefining Channel") << "line: " << buffer << "\n attempts to redefine data. Ignored" << std::endl;
161  // else
162  // {
163  S fCondObject(id, atof(items[4].c_str()));
164  fObject.addValues(fCondObject);
165  // }
166  }
167  return true;
168  }
static unsigned int getId()
std::vector< std::string > splitString(const std::string &fLine)
Definition: DetId.h:17
Log< level::Warning, false > LogWarning
template<class S , class T >
bool CastorDbASCIIIO::getCastorSingleIntObject ( std::istream &  fInput,
T fObject,
S fCondObject 
)

Definition at line 187 of file CastorDbASCIIIO.cc.

References getId(), S(), splitString(), and AlCaHLTBitMon_QueryRunRegistry::string.

187  {
188  char buffer[1024];
189  while (fInput.getline(buffer, 1024)) {
190  if (buffer[0] == '#')
191  continue; //ignore comment
192  std::vector<std::string> items = splitString(std::string(buffer));
193  if (items.empty())
194  continue; // blank line
195  if (items.size() < 5) {
196  edm::LogWarning("Format Error") << "Bad line: " << buffer
197  << "\n line must contain 5 items: eta, phi, depth, subdet, value" << std::endl;
198  continue;
199  }
200  DetId id = getId(items);
201 
202  // if (fObject->exists(id) )
203  // edm::LogWarning("Redefining Channel") << "line: " << buffer << "\n attempts to redefine data. Ignored" << std::endl;
204  // else
205  // {
206  fCondObject = new S(id, atoi(items[4].c_str()));
207  fObject.addValues(*fCondObject);
208  delete fCondObject;
209  // }
210  }
211  return true;
212  }
static unsigned int getId()
std::vector< std::string > splitString(const std::string &fLine)
Definition: DetId.h:17
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:97
Log< level::Warning, false > LogWarning
DetId CastorDbASCIIIO::getId ( const std::vector< std::string > &  items)
bool CastorDbASCIIIO::getObject ( std::istream &  fInput,
CastorPedestals fObject 
)

Referenced by produce_impl().

bool CastorDbASCIIIO::getObject ( std::istream &  fInput,
CastorPedestalWidths fObject 
)
bool CastorDbASCIIIO::getObject ( std::istream &  fInput,
CastorGains fObject 
)
bool CastorDbASCIIIO::getObject ( std::istream &  fInput,
CastorGainWidths fObject 
)
bool CastorDbASCIIIO::getObject ( std::istream &  fInput,
CastorQIEData fObject 
)
bool CastorDbASCIIIO::getObject ( std::istream &  fInput,
CastorCalibrationQIEData fObject 
)
bool CastorDbASCIIIO::getObject ( std::istream &  fInput,
CastorElectronicsMap fObject 
)
bool CastorDbASCIIIO::getObject ( std::istream &  fInput,
CastorChannelQuality fObject 
)
bool CastorDbASCIIIO::getObject ( std::istream &  fInput,
CastorRecoParams fObject 
)
bool CastorDbASCIIIO::getObject ( std::istream &  fInput,
CastorSaturationCorrs fObject 
)
std::vector<std::string> CastorDbASCIIIO::splitString ( const std::string &  fLine)

Definition at line 48 of file CastorDbASCIIIO.cc.

References relativeConstraints::empty, mps_fire::i, B2GTnPMonitor_cfi::item, mps_fire::result, command_line::start, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by getCastorObject(), getCastorSingleFloatObject(), and getCastorSingleIntObject().

48  {
49  std::vector<std::string> result;
50  int start = 0;
51  bool empty = true;
52  for (unsigned i = 0; i <= fLine.size(); i++) {
53  if (fLine[i] == ' ' || i == fLine.size()) {
54  if (!empty) {
55  std::string item(fLine, start, i - start);
56  result.push_back(item);
57  empty = true;
58  }
59  start = i + 1;
60  } else {
61  if (empty)
62  empty = false;
63  }
64  }
65  return result;
66  }
tuple result
Definition: mps_fire.py:311