CMS 3D CMS Logo

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 T , class S >
bool getCastorObject (std::istream &fInput, T *fObject, S *fCondObject)
 
template<class T , class S >
bool getCastorSingleFloatObject (std::istream &fInput, T *fObject, S *fCondObject)
 
template<class T , class S >
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 110 of file CastorDbASCIIIO.cc.

References dumpId(), and MuonErrorMatrixValues_cff::values.

Referenced by dumpObject().

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

Definition at line 157 of file CastorDbASCIIIO.cc.

References dumpId().

Referenced by dumpObject().

157  {
158  char buffer [1024];
159  sprintf (buffer, "# %15s %15s %15s %15s %8s %10s\n", "eta", "phi", "dep", "det", "value", "DetId");
160  fOutput << buffer;
161  std::vector<DetId> channels = fObject.getAllChannels ();
162  std::sort (channels.begin(), channels.end(), DetIdLess ());
163  for (std::vector<DetId>::iterator channel = channels.begin ();
164  channel != channels.end ();
165  ++channel) {
166  const float value = fObject.getValues (*channel)->getValue ();
167  dumpId (fOutput, *channel);
168  sprintf (buffer, " %8.5f %10X\n",
169  value, channel->rawId ());
170  fOutput << buffer;
171  }
172  return true;
173 }
void dumpId(std::ostream &fOutput, DetId id)
Definition: value.py:1
template<class T >
bool CastorDbASCIIIO::dumpCastorSingleIntObject ( std::ostream &  fOutput,
const T fObject 
)

Definition at line 202 of file CastorDbASCIIIO.cc.

References dumpId().

202  {
203  char buffer [1024];
204  sprintf (buffer, "# %15s %15s %15s %15s %8s %10s\n", "eta", "phi", "dep", "det", "value", "DetId");
205  fOutput << buffer;
206  std::vector<DetId> channels = fObject.getAllChannels ();
207  std::sort (channels.begin(), channels.end(), DetIdLess ());
208  for (std::vector<DetId>::iterator channel = channels.begin ();
209  channel != channels.end ();
210  ++channel) {
211  const int value = fObject.getValues (*channel)->getValue ();
212  dumpId (fOutput, *channel);
213  sprintf (buffer, " %15d %10X\n",
214  value, channel->rawId ());
215  fOutput << buffer;
216  }
217  return true;
218 }
void dumpId(std::ostream &fOutput, DetId id)
Definition: value.py:1
void CastorDbASCIIIO::dumpId ( std::ostream &  fOutput,
DetId  id 
)
bool CastorDbASCIIIO::dumpObject ( std::ostream &  fOutput,
const CastorPedestals fObject 
)

Definition at line 299 of file CastorDbASCIIIO.cc.

References dumpId(), CastorCondObjectContainer< Item >::getAllChannels(), CastorPedestal::getValues(), CastorCondObjectContainer< Item >::getValues(), CastorPedestals::isADC(), and MuonErrorMatrixValues_cff::values.

Referenced by CastorDbProducer::channelQualityCallback(), CastorDumpConditions::dumpIt(), CastorDbXml::dumpObject(), HcalDbXml::dumpObject(), CastorDbProducer::electronicsMapCallback(), CastorDbProducer::gainsCallback(), CastorDbProducer::gainWidthsCallback(), CastorDbProducer::pedestalsCallback(), CastorDbProducer::pedestalWidthsCallback(), CastorDbProducer::QIEDataCallback(), and CastorPedestalsAnalysis::~CastorPedestalsAnalysis().

299  {
300  char buffer [1024];
301  if (fObject.isADC() ) sprintf (buffer, "#U ADC << this is the unit \n");
302  else sprintf (buffer, "#U fC << this is the unit \n");
303  fOutput << buffer;
304 
305  sprintf (buffer, "# %15s %15s %15s %15s %8s %8s %8s %8s %8s %8s %8s %8s %10s\n", "eta", "phi", "dep", "det", "cap0", "cap1", "cap2", "cap3", "widthcap0", "widthcap1", "widthcap2", "widthcap3", "DetId");
306  fOutput << buffer;
307 
308  std::vector<DetId> channels = fObject.getAllChannels ();
309  std::sort (channels.begin(), channels.end(), DetIdLess ());
310  for (std::vector<DetId>::iterator channel = channels.begin ();
311  channel != channels.end ();
312  ++channel) {
313  const float* values = fObject.getValues (*channel)->getValues ();
314  if (values) {
315  dumpId (fOutput, *channel);
316  sprintf (buffer, " %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %10X\n",
317  values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], channel->rawId ());
318  fOutput << buffer;
319  }
320  }
321  return true;
322 }
std::vector< DetId > getAllChannels() const
void dumpId(std::ostream &fOutput, DetId id)
const Item * getValues(DetId fId, bool throwOnFail=true) const
bool isADC() const
const float * getValues() const
get value for all capId = 0..3
bool CastorDbASCIIIO::dumpObject ( std::ostream &  fOutput,
const CastorPedestalWidths fObject 
)

Definition at line 482 of file CastorDbASCIIIO.cc.

References dumpId(), CastorCondObjectContainer< Item >::getAllChannels(), CastorPedestalWidth::getSigma(), CastorCondObjectContainer< Item >::getValues(), and CastorPedestalWidths::isADC().

482  {
483  char buffer [1024];
484  if (fObject.isADC() ) sprintf (buffer, "#U ADC << this is the unit \n");
485  else sprintf (buffer, "#U fC << this is the unit \n");
486  fOutput << buffer;
487 
488  sprintf (buffer, "# %15s %15s %15s %15s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %10s\n",
489  "eta", "phi", "dep", "det",
490  "cov_0_0", "cov_0_1", "cov_0_2", "cov_0_3", "cov_1_0", "cov_1_1", "cov_1_2", "cov_1_3", "cov_2_0", "cov_2_1", "cov_2_2", "cov_2_3", "cov_3_0", "cov_3_1", "cov_3_2", "cov_3_3",
491  "DetId");
492  fOutput << buffer;
493  std::vector<DetId> channels = fObject.getAllChannels ();
494  std::sort (channels.begin(), channels.end(), DetIdLess ());
495  for (std::vector<DetId>::iterator channel = channels.begin ();
496  channel != channels.end ();
497  ++channel) {
498  const CastorPedestalWidth* item = fObject.getValues (*channel);
499  if (item) {
500  dumpId (fOutput, *channel);
501  sprintf (buffer, " %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %10X\n",
502  item->getSigma (0,0), item->getSigma (0,1), item->getSigma (0,2), item->getSigma (0,3),
503  item->getSigma (1,0), item->getSigma (1,1), item->getSigma (1,2), item->getSigma (1,3),
504  item->getSigma (2,0), item->getSigma (2,1), item->getSigma (2,2), item->getSigma (2,3),
505  item->getSigma (3,0), item->getSigma (3,1), item->getSigma (3,2), item->getSigma (3,3), channel->rawId ());
506  fOutput << buffer;
507  }
508  }
509  return true;
510 }
std::vector< DetId > getAllChannels() const
void dumpId(std::ostream &fOutput, DetId id)
const Item * getValues(DetId fId, bool throwOnFail=true) const
float getSigma(int fCapId1, int fCapId2) const
get correlation element for capId1/2 = 0..3
bool CastorDbASCIIIO::dumpObject ( std::ostream &  fOutput,
const CastorGains fObject 
)

Definition at line 222 of file CastorDbASCIIIO.cc.

References dumpCastorObject().

222 {return dumpCastorObject (fOutput, fObject);}
bool dumpCastorObject(std::ostream &fOutput, const T &fObject)
bool CastorDbASCIIIO::dumpObject ( std::ostream &  fOutput,
const CastorGainWidths fObject 
)

Definition at line 224 of file CastorDbASCIIIO.cc.

References dumpCastorObject().

224 {return dumpCastorObject (fOutput, fObject);}
bool dumpCastorObject(std::ostream &fOutput, const T &fObject)
bool CastorDbASCIIIO::dumpObject ( std::ostream &  fOutput,
const CastorQIEData fObject 
)

Definition at line 562 of file CastorDbASCIIIO.cc.

References stringResolutionProvider_cfi::bin, dumpId(), CastorCondObjectContainer< Item >::getAllChannels(), CastorQIEData::getCoder(), CastorQIEData::getShape(), CastorQIEShape::lowEdge(), CastorQIECoder::offset(), and CastorQIECoder::slope().

562  {
563  char buffer [1024];
564  fOutput << "# QIE basic shape: SHAPE 32 x low edge values for first 32 channels" << std::endl;
565  sprintf (buffer, "SHAPE ");
566  fOutput << buffer;
567  for (unsigned bin = 0; bin < 32; bin++) {
568  sprintf (buffer, " %8.5f", fObject.getShape ().lowEdge (bin));
569  fOutput << buffer;
570  }
571  fOutput << std::endl;
572 
573  fOutput << "# QIE data" << std::endl;
574  sprintf (buffer, "# %15s %15s %15s %15s %36s %36s %36s %36s %36s %36s %36s %36s\n",
575  "eta", "phi", "dep", "det",
576  "4 x offsets cap0", "4 x offsets cap1", "4 x offsets cap2", "4 x offsets cap3",
577  "4 x slopes cap0", "4 x slopes cap1", "4 x slopes cap2", "4 x slopes cap3");
578  fOutput << buffer;
579  std::vector<DetId> channels = fObject.getAllChannels ();
580  std::sort (channels.begin(), channels.end(), DetIdLess ());
581  for (std::vector<DetId>::iterator channel = channels.begin ();
582  channel != channels.end ();
583  ++channel) {
584  const CastorQIECoder* coder = fObject.getCoder (*channel);
585  dumpId (fOutput, *channel);
586  for (unsigned capid = 0; capid < 4; capid++) {
587  for (unsigned range = 0; range < 4; range++) {
588  sprintf (buffer, " %8.5f", coder->offset (capid, range));
589  fOutput << buffer;
590  }
591  }
592  for (unsigned capid = 0; capid < 4; capid++) {
593  for (unsigned range = 0; range < 4; range++) {
594  sprintf (buffer, " %8.5f", coder->slope (capid, range));
595  fOutput << buffer;
596  }
597  }
598  fOutput << std::endl;
599  }
600  return true;
601 }
const CastorQIEShape & getShape() const
get basic shape
Definition: CastorQIEData.h:36
std::vector< DetId > getAllChannels() const
void dumpId(std::ostream &fOutput, DetId id)
bin
set the eta bin as selection string.
const CastorQIECoder * getCoder(DetId fId) const
get QIE parameters
Definition: CastorQIEData.h:38
float offset(unsigned fCapId, unsigned fRange) const
float lowEdge(unsigned fAdc) const
float slope(unsigned fCapId, unsigned fRange) const
bool CastorDbASCIIIO::dumpObject ( std::ostream &  fOutput,
const CastorCalibrationQIEData fObject 
)

Definition at line 634 of file CastorDbASCIIIO.cc.

References stringResolutionProvider_cfi::bin, dumpId(), CastorCondObjectContainer< Item >::getAllChannels(), CastorCalibrationQIEData::getCoder(), and CastorCalibrationQIECoder::minCharges().

634  {
635  char buffer [1024];
636  fOutput << "# QIE data in calibration mode" << std::endl;
637  sprintf (buffer, "# %15s %15s %15s %15s %288s\n",
638  "eta", "phi", "dep", "det", "32 x charges");
639  fOutput << buffer;
640  std::vector<DetId> channels = fObject.getAllChannels ();
641  std::sort (channels.begin(), channels.end(), DetIdLess ());
642  for (std::vector<DetId>::iterator channel = channels.begin ();
643  channel != channels.end ();
644  ++channel) {
645  const CastorCalibrationQIECoder* coder = fObject.getCoder (*channel);
646  if (coder) {
647  dumpId (fOutput, *channel);
648  const float* lowEdge = coder->minCharges ();
649  for (unsigned bin = 0; bin < 32; bin++) {
650  sprintf (buffer, " %8.5f", lowEdge [bin]);
651  fOutput << buffer;
652  }
653  fOutput << std::endl;
654  }
655  }
656  return true;
657 }
std::vector< DetId > getAllChannels() const
const CastorCalibrationQIECoder * getCoder(DetId fId) const
get QIE parameters
void dumpId(std::ostream &fOutput, DetId id)
bin
set the eta bin as selection string.
bool CastorDbASCIIIO::dumpObject ( std::ostream &  fOutput,
const CastorElectronicsMap fObject 
)

Definition at line 727 of file CastorDbASCIIIO.cc.

References CastorElectronicsMap::allElectronicsId(), CastorElectronicsId::dccid(), runTauDisplay::eid, CastorElectronicsId::fiberChanId(), CastorElectronicsId::fiberIndex(), CastorText2DetIdConverter::getField1(), CastorText2DetIdConverter::getField2(), CastorText2DetIdConverter::getField3(), CastorText2DetIdConverter::getFlavor(), CastorText2DetIdConverter::getId(), CastorElectronicsId::htrSlot(), CastorElectronicsId::htrTopBottom(), mps_fire::i, CastorElectronicsId::isTriggerChainId(), CastorElectronicsMap::lookup(), CastorElectronicsMap::lookupTrigger(), DetId::rawId(), CastorElectronicsId::readoutVMECrateId(), CastorElectronicsId::slbChannelIndex(), CastorElectronicsId::slbSiteNumber(), and CastorElectronicsId::spigot().

727  {
728  std::vector<CastorElectronicsId> eids = fObject.allElectronicsId ();
729  char buf [1024];
730  // changes by Jared, 6.03.09/(included 25.03.09)
731  // sprintf (buf, "#%10s %6s %6s %6s %6s %6s %6s %6s %15s %15s %15s %15s",
732  sprintf (buf, "# %7s %3s %3s %3s %4s %7s %10s %14s %7s %5s %5s %6s",
733  "i", "cr", "sl", "tb", "dcc", "spigot", "fiber/slb", "fibcha/slbcha", "subdet", "ieta", "iphi", "depth");
734  fOutput << buf << std::endl;
735 
736  for (unsigned i = 0; i < eids.size (); i++) {
737  CastorElectronicsId eid = eids[i];
738  if (eid.isTriggerChainId()) {
739  DetId trigger = fObject.lookupTrigger (eid);
740  if (trigger.rawId ()) {
742  // changes by Jared, 6.03.09/(included 25.03.09)
743  // sprintf (buf, " %10X %6d %6d %6c %6d %6d %6d %6d %15s %15s %15s %15s",
744  sprintf (buf, " %7X %3d %3d %3c %4d %7d %10d %14d %7s %5s %5s %6s",
745  // i,
746  converter.getId().rawId(),
747  // changes by Jared, 6.03.09/(included 25.03.09)
748  // eid.readoutVMECrateId(), eid.htrSlot(), eid.htrTopBottom()>0?'t':'b', eid.dccid(), eid.spigot(), eid.fiberIndex(), eid.fiberChanId(),
749  eid.readoutVMECrateId(), eid.htrSlot(), eid.htrTopBottom()>0?'t':'b', eid.dccid(), eid.spigot(), eid.slbSiteNumber(), eid.slbChannelIndex(),
750  converter.getFlavor ().c_str (), converter.getField1 ().c_str (), converter.getField2 ().c_str (), converter.getField3 ().c_str ()
751  );
752  fOutput << buf << std::endl;
753  }
754  } else {
755  DetId channel = fObject.lookup (eid);
756  if (channel.rawId()) {
758  // changes by Jared, 6.03.09/(included 25.03.09)
759  // sprintf (buf, " %10X %6d %6d %6c %6d %6d %6d %6d %15s %15s %15s %15s",
760  sprintf (buf, " %7X %3d %3d %3c %4d %7d %10d %14d %7s %5s %5s %6s",
761  // i,
762  converter.getId().rawId(),
763  eid.readoutVMECrateId(), eid.htrSlot(), eid.htrTopBottom()>0?'t':'b', eid.dccid(), eid.spigot(), eid.fiberIndex(), eid.fiberChanId(),
764  converter.getFlavor ().c_str (), converter.getField1 ().c_str (), converter.getField2 ().c_str (), converter.getField3 ().c_str ()
765  );
766  fOutput << buf << std::endl;
767  }
768  }
769  }
770  return true;
771 }
const DetId lookupTrigger(CastorElectronicsId fId) const
brief lookup the trigger logical detid associated with the given electronics id
int readoutVMECrateId() const
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
const DetId lookup(CastorElectronicsId fId) const
lookup the logical detid associated with the given electronics id
bool isTriggerChainId() const
Definition: DetId.h:18
std::vector< CastorElectronicsId > allElectronicsId() const
Readout chain identification for Castor Bits for the readout chain : some names need change! [31:26] ...
int slbChannelIndex() const
bool CastorDbASCIIIO::dumpObject ( std::ostream &  fOutput,
const CastorChannelQuality fObject 
)

Definition at line 367 of file CastorDbASCIIIO.cc.

References dumpId(), CastorCondObjectContainer< Item >::getAllChannels(), CastorChannelStatus::getValue(), and CastorCondObjectContainer< Item >::getValues().

367  {
368  char buffer [1024];
369  sprintf (buffer, "# %15s %15s %15s %15s %15s %10s\n", "eta", "phi", "dep", "det", "value", "DetId");
370  fOutput << buffer;
371  std::vector<DetId> channels = fObject.getAllChannels ();
372  std::sort (channels.begin(), channels.end(), DetIdLess ());
373  for (std::vector<DetId>::iterator channel = channels.begin ();
374  channel != channels.end ();
375  ++channel) {
376  const int value = fObject.getValues (*channel)->getValue ();
377  dumpId (fOutput, *channel);
378  sprintf (buffer, " %15X %10X\n",
379  value, channel->rawId ());
380  fOutput << buffer;
381  }
382  return true;
383 }
std::vector< DetId > getAllChannels() const
void dumpId(std::ostream &fOutput, DetId id)
const Item * getValues(DetId fId, bool throwOnFail=true) const
uint32_t getValue() const
Definition: value.py:1
bool CastorDbASCIIIO::dumpObject ( std::ostream &  fOutput,
const CastorRecoParams fObject 
)

Definition at line 793 of file CastorDbASCIIIO.cc.

References dumpId(), CastorRecoParam::firstSample(), CastorCondObjectContainer< Item >::getAllChannels(), CastorCondObjectContainer< Item >::getValues(), and CastorRecoParam::samplesToAdd().

793  {
794  char buffer [1024];
795  sprintf (buffer, "# %15s %15s %15s %15s %18s %15s %10s\n", "eta", "phi", "dep", "det", "firstSample", "samplesToAdd", "DetId");
796  fOutput << buffer;
797  std::vector<DetId> channels = fObject.getAllChannels ();
798  std::sort (channels.begin(), channels.end(), DetIdLess ());
799  for (std::vector<DetId>::iterator channel = channels.begin();channel != channels.end();++channel) {
800  dumpId (fOutput, *channel);
801  sprintf (buffer, " %15d %15d %16X\n",
802  fObject.getValues (*channel)->firstSample(), fObject.getValues (*channel)->samplesToAdd(), channel->rawId ());
803  fOutput << buffer;
804  }
805  return true;
806 }
std::vector< DetId > getAllChannels() const
void dumpId(std::ostream &fOutput, DetId id)
const Item * getValues(DetId fId, bool throwOnFail=true) const
unsigned int samplesToAdd() const
unsigned int firstSample() const
bool CastorDbASCIIIO::dumpObject ( std::ostream &  fOutput,
const CastorSaturationCorrs fObject 
)

Definition at line 227 of file CastorDbASCIIIO.cc.

References dumpCastorSingleFloatObject().

227 {return dumpCastorSingleFloatObject (fOutput, fObject);}
bool dumpCastorSingleFloatObject(std::ostream &fOutput, const T &fObject)
template<class T , class S >
bool CastorDbASCIIIO::getCastorObject ( std::istream &  fInput,
T fObject,
S fCondObject 
)

Definition at line 82 of file CastorDbASCIIIO.cc.

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

Referenced by getObject().

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

Definition at line 131 of file CastorDbASCIIIO.cc.

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

Referenced by getObject().

131  {
132  if (!fObject) fObject = new T;
133  char buffer [1024];
134  while (fInput.getline(buffer, 1024)) {
135  if (buffer [0] == '#') continue; //ignore comment
136  std::vector <std::string> items = splitString (std::string (buffer));
137  if (items.size()==0) continue; // blank line
138  if (items.size () < 5) {
139  edm::LogWarning("Format Error") << "Bad line: " << buffer << "\n line must contain 5 items: eta, phi, depth, subdet, value" << std::endl;
140  continue;
141  }
142  DetId id = getId (items);
143 
144 // if (fObject->exists(id) )
145 // edm::LogWarning("Redefining Channel") << "line: " << buffer << "\n attempts to redefine data. Ignored" << std::endl;
146 // else
147 // {
148  fCondObject = new S(id, atof (items [4].c_str()) );
149  fObject->addValues(*fCondObject);
150  delete fCondObject;
151  // }
152  }
153  return true;
154 }
static unsigned int getId(void)
std::vector< std::string > splitString(const std::string &fLine)
Definition: DetId.h:18
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:99
long double T
template<class T , class S >
bool CastorDbASCIIIO::getCastorSingleIntObject ( std::istream &  fInput,
T fObject,
S fCondObject 
)

Definition at line 176 of file CastorDbASCIIIO.cc.

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

176  {
177  if (!fObject) fObject = new T;
178  char buffer [1024];
179  while (fInput.getline(buffer, 1024)) {
180  if (buffer [0] == '#') continue; //ignore comment
181  std::vector <std::string> items = splitString (std::string (buffer));
182  if (items.size()==0) continue; // blank line
183  if (items.size () < 5) {
184  edm::LogWarning("Format Error") << "Bad line: " << buffer << "\n line must contain 5 items: eta, phi, depth, subdet, value" << std::endl;
185  continue;
186  }
187  DetId id = getId (items);
188 
189 // if (fObject->exists(id) )
190 // edm::LogWarning("Redefining Channel") << "line: " << buffer << "\n attempts to redefine data. Ignored" << std::endl;
191 // else
192 // {
193  fCondObject = new S(id, atoi (items [4].c_str()) );
194  fObject->addValues(*fCondObject);
195  delete fCondObject;
196  // }
197  }
198  return true;
199 }
static unsigned int getId(void)
std::vector< std::string > splitString(const std::string &fLine)
Definition: DetId.h:18
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:99
long double T
DetId CastorDbASCIIIO::getId ( const std::vector< std::string > &  items)
bool CastorDbASCIIIO::getObject ( std::istream &  fInput,
CastorPedestals fObject 
)

Definition at line 232 of file CastorDbASCIIIO.cc.

References CastorCondObjectContainer< Item >::addValues(), getId(), mps_monitormerge::items, CastorPedestals::setUnitADC(), splitString(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produce_impl().

232  {
233  if (!fObject) fObject = new CastorPedestals(false);
234  char buffer [1024];
235 
236  while (fInput.getline(buffer, 1024)) {
237  std::vector <std::string> items = splitString (std::string (buffer));
238  if (items.size()==0) continue; // blank line
239  else {
240  if (items[0] == "#U")
241  {
242  if (items[1] == (std::string)"ADC") fObject->setUnitADC(true);
243  else if (items[1] == (std::string)"fC") fObject->setUnitADC(false);
244  else
245  {
246  edm::LogWarning("Pedestal Unit Error") << "Unrecognized unit for pedestals. Assuming fC." << std::endl;
247  fObject->setUnitADC(false);
248  }
249  break;
250  }
251  else
252  {
253  edm::LogWarning("Pedestal Unit Missing") << "The unit for the pedestals is missing in the txt file." << std::endl;
254  return false;
255  }
256  }
257  }
258  while (fInput.getline(buffer, 1024)) {
259  if (buffer [0] == '#') continue;
260  std::vector <std::string> items = splitString (std::string (buffer));
261  if (items.size()==0) continue; // blank line
262  if (items.size () < 8) {
263  edm::LogWarning("Format Error") << "Bad line: " << buffer << "\n line must contain 8 items: eta, phi, depth, subdet, 4x values"
264  << " or 12 items: eta, phi, depth, subdet, 4x values for mean, 4x values for width"
265  << std::endl;
266  continue;
267  }
268  DetId id = getId (items);
269 
270 // if (fObject->exists(id) )
271 // edm::LogWarning("Redefining Channel") << "line: " << buffer << "\n attempts to redefine data. Ignored" << std::endl;
272 // else
273 // {
274 
275  if (items.size() < 12) // old format without widths
276  {
277  CastorPedestal* fCondObject = new CastorPedestal(id, atof (items [4].c_str()), atof (items [5].c_str()),
278  atof (items [6].c_str()), atof (items [7].c_str()),
279  0., 0., 0., 0. );
280  fObject->addValues(*fCondObject);
281  delete fCondObject;
282  }
283  else // new format with widths
284  {
285  CastorPedestal* fCondObject = new CastorPedestal(id, atof (items [4].c_str()), atof (items [5].c_str()),
286  atof (items [6].c_str()), atof (items [7].c_str()),
287  atof (items [8].c_str()), atof (items [9].c_str()),
288  atof (items [10].c_str()), atof (items [11].c_str()) );
289  fObject->addValues(*fCondObject);
290  delete fCondObject;
291  }
292 
293  // }
294  }
295  return true;
296 }
static unsigned int getId(void)
std::vector< std::string > splitString(const std::string &fLine)
void setUnitADC(bool isADC)
Definition: DetId.h:18
bool addValues(const Item &myItem)
bool CastorDbASCIIIO::getObject ( std::istream &  fInput,
CastorPedestalWidths fObject 
)

Definition at line 387 of file CastorDbASCIIIO.cc.

References CastorCondObjectContainer< Item >::addValues(), getId(), mps_monitormerge::items, CastorPedestalWidth::setSigma(), CastorPedestalWidths::setUnitADC(), splitString(), AlCaHLTBitMon_QueryRunRegistry::string, and MuonErrorMatrixValues_cff::values.

387  {
388  if (!fObject) fObject = new CastorPedestalWidths(false);
389  char buffer [1024];
390  int linecounter = 0;
391 
392  while (fInput.getline(buffer, 1024)) {
393  linecounter++;
394  std::vector <std::string> items = splitString (std::string (buffer));
395  if (items.size()==0) continue; // blank line
396  else {
397  if (items[0] == (std::string)"#U")
398  {
399  if (items[1] == (std::string)"ADC") fObject->setUnitADC(true);
400  else if (items[1] == (std::string)"fC") fObject->setUnitADC(false);
401  else
402  {
403  edm::LogWarning("Pedestal Width Unit Error") << "Unrecognized unit for pedestal widths. Assuming fC." << std::endl;
404  fObject->setUnitADC(false);
405  }
406  break;
407  }
408  else
409  {
410  edm::LogWarning("Pedestal Width Unit Missing") << "The unit for the pedestal widths is missing in the txt file." << std::endl;
411  return false;
412  }
413  }
414  }
415 
416  while (fInput.getline(buffer, 1024)) {
417  linecounter++;
418  if (buffer [0] == '#') continue; //ignore comment
419  std::vector <std::string> items = splitString (std::string (buffer));
420  if (items.size()==0) continue; // blank line
421  if (items.size () < 14) {
422  edm::LogWarning("Format Error") << "Bad line: " << buffer << "\n line number: " << linecounter << "\n line must contain 14 items: eta, phi, depth, subdet, 10x correlations"
423  << " or 20 items: eta, phi, depth, subdet, 16x correlations"
424  << std::endl;
425  continue;
426  }
427  DetId id = getId (items);
428 
429 // if (fObject->exists(id) )
430 // edm::LogWarning("Redefining Channel") << "line: " << buffer << "\n attempts to redefine data. Ignored" << std::endl;
431 // else
432 // {
433 
434  if (items.size() < 20) //old format
435  {
437  values.setSigma (0, 0, atof (items [4].c_str()));
438  values.setSigma (1, 0, atof (items [5].c_str()));
439  values.setSigma (1, 1, atof (items [6].c_str()));
440  values.setSigma (2, 0, atof (items [7].c_str()));
441  values.setSigma (2, 1, atof (items [8].c_str()));
442  values.setSigma (2, 2, atof (items [9].c_str()));
443  values.setSigma (3, 0, atof (items [10].c_str()));
444  values.setSigma (3, 1, atof (items [11].c_str()));
445  values.setSigma (3, 2, atof (items [12].c_str()));
446  values.setSigma (3, 3, atof (items [13].c_str()));
447  values.setSigma (0, 1, 0.);
448  values.setSigma (0, 2, 0.);
449  values.setSigma (0, 3, 0.);
450  values.setSigma (1, 2, 0.);
451  values.setSigma (1, 3, 0.);
452  values.setSigma (2, 3, 0.);
453  fObject->addValues(values);
454  }
455  else // new format
456  {
458  values.setSigma (0, 0, atof (items [4].c_str()) );
459  values.setSigma (0, 1, atof (items [5].c_str()) );
460  values.setSigma (0, 2, atof (items [6].c_str()) );
461  values.setSigma (0, 3, atof (items [7].c_str()) );
462  values.setSigma (1, 0, atof (items [8].c_str()) );
463  values.setSigma (1, 1, atof (items [9].c_str()) );
464  values.setSigma (1, 2, atof (items [10].c_str()) );
465  values.setSigma (1, 3, atof (items [11].c_str()) );
466  values.setSigma (2, 0, atof (items [12].c_str()) );
467  values.setSigma (2, 1, atof (items [13].c_str()) );
468  values.setSigma (2, 2, atof (items [14].c_str()) );
469  values.setSigma (2, 3, atof (items [15].c_str()) );
470  values.setSigma (3, 0, atof (items [16].c_str()) );
471  values.setSigma (3, 1, atof (items [17].c_str()) );
472  values.setSigma (3, 2, atof (items [18].c_str()) );
473  values.setSigma (3, 3, atof (items [19].c_str()) );
474  fObject->addValues(values);
475  }
476 
477  // }
478  }
479  return true;
480 }
void setUnitADC(bool isADC)
static unsigned int getId(void)
std::vector< std::string > splitString(const std::string &fLine)
Definition: DetId.h:18
bool addValues(const Item &myItem)
bool CastorDbASCIIIO::getObject ( std::istream &  fInput,
CastorGains fObject 
)

Definition at line 221 of file CastorDbASCIIIO.cc.

References getCastorObject().

221 {return getCastorObject (fInput, fObject, new CastorGain);}
bool getCastorObject(std::istream &fInput, T *fObject, S *fCondObject)
bool CastorDbASCIIIO::getObject ( std::istream &  fInput,
CastorGainWidths fObject 
)

Definition at line 223 of file CastorDbASCIIIO.cc.

References getCastorObject().

223 {return getCastorObject (fInput, fObject, new CastorGainWidth);}
bool getCastorObject(std::istream &fInput, T *fObject, S *fCondObject)
bool CastorDbASCIIIO::getObject ( std::istream &  fInput,
CastorQIEData fObject 
)

Definition at line 514 of file CastorDbASCIIIO.cc.

References CastorQIEData::addCoder(), getId(), diffTreeTool::index, mps_monitormerge::items, CastorQIECoder::setOffset(), CastorQIECoder::setSlope(), CastorQIEData::sort(), splitString(), and AlCaHLTBitMon_QueryRunRegistry::string.

514  {
515  char buffer [1024];
516  while (fInput.getline(buffer, 1024)) {
517  if (buffer [0] == '#') continue; //ignore comment
518  std::vector <std::string> items = splitString (std::string (buffer));
519  if (items.size()<1) continue;
520  if (items [0] == "SHAPE") { // basic shape
521  if (items.size () < 33) {
522  edm::LogWarning("Format Error") << "Bad line: " << buffer << "\n line must contain 33 items: SHAPE 32 x low QIE edges for first 32 bins" << std::endl;
523  continue;
524  }
525  //float lowEdges [32];
526  //int i = 32;
527  //while (--i >= 0) lowEdges [i] = atof (items [i+1].c_str ());
528  // fObject->setShape (lowEdges);
529  }
530  else { // QIE parameters
531  if (items.size () < 36) {
532  edm::LogWarning("Format Error") << "Bad line: " << buffer << "\n line must contain 36 items: eta, phi, depth, subdet, 4 capId x 4 Ranges x offsets, 4 capId x 4 Ranges x slopes" << std::endl;
533  continue;
534  }
535  DetId id = getId (items);
536  fObject->sort ();
537  // try {
538  // fObject->getCoder (id);
539  // edm::LogWarning("Redefining Channel") << "line: " << buffer << "\n attempts to redefine data. Ignored" << std::endl;
540  // }
541 // catch (cms::Exception& e) {
542  CastorQIECoder coder (id.rawId ());
543  int index = 4;
544  for (unsigned capid = 0; capid < 4; capid++) {
545  for (unsigned range = 0; range < 4; range++) {
546  coder.setOffset (capid, range, atof (items [index++].c_str ()));
547  }
548  }
549  for (unsigned capid = 0; capid < 4; capid++) {
550  for (unsigned range = 0; range < 4; range++) {
551  coder.setSlope (capid, range, atof (items [index++].c_str ()));
552  }
553  }
554  fObject->addCoder (coder);
555 // }
556  }
557  }
558  fObject->sort ();
559  return true;
560 }
static unsigned int getId(void)
std::vector< std::string > splitString(const std::string &fLine)
Definition: DetId.h:18
bool addCoder(const CastorQIECoder &fCoder)
Definition: CastorQIEData.h:43
bool CastorDbASCIIIO::getObject ( std::istream &  fInput,
CastorCalibrationQIEData fObject 
)

Definition at line 604 of file CastorDbASCIIIO.cc.

References CastorCalibrationQIEData::addCoder(), stringResolutionProvider_cfi::bin, getId(), diffTreeTool::index, mps_monitormerge::items, CastorCalibrationQIECoder::setMinCharges(), CastorCalibrationQIEData::sort(), splitString(), AlCaHLTBitMon_QueryRunRegistry::string, and MuonErrorMatrixValues_cff::values.

604  {
605  char buffer [1024];
606  while (fInput.getline(buffer, 1024)) {
607  if (buffer [0] == '#') continue; //ignore comment
608  std::vector <std::string> items = splitString (std::string (buffer));
609  if (items.size () < 36) {
610  edm::LogWarning("Format Error") << "Bad line: " << buffer << "\n line must contain 36 items: eta, phi, depth, subdet, 32 bin values" << std::endl;
611  continue;
612  }
613  DetId id = getId (items);
614  fObject->sort ();
615  // try {
616  // fObject->getCoder (id);
617  // edm::LogWarning("Redefining Channel") << "line: " << buffer << "\n attempts to redefine data. Ignored" << std::endl;
618  // }
619 // catch (cms::Exception& e) {
620  CastorCalibrationQIECoder coder (id.rawId ());
621  int index = 4;
622  float values [32];
623  for (unsigned bin = 0; bin < 32; bin++) {
624  values[bin] = atof (items [index++].c_str ());
625  }
626  coder.setMinCharges (values);
627  fObject->addCoder (coder);
628 // }
629  }
630  fObject->sort ();
631  return true;
632 }
static unsigned int getId(void)
bool addCoder(const CastorCalibrationQIECoder &fCoder)
std::vector< std::string > splitString(const std::string &fLine)
bin
set the eta bin as selection string.
Definition: DetId.h:18
bool CastorDbASCIIIO::getObject ( std::istream &  fInput,
CastorElectronicsMap fObject 
)

Definition at line 661 of file CastorDbASCIIIO.cc.

References CastorText2DetIdConverter::getId(), CastorText2DetIdConverter::isHcalCastorDetId(), mps_monitormerge::items, CastorElectronicsMap::mapEId2chId(), CastorElectronicsMap::mapEId2tId(), CastorElectronicsId::setHTR(), slb(), CastorElectronicsMap::sort(), splitString(), AlCaHLTBitMon_QueryRunRegistry::string, HcalTrigTowerDetId::Undefined, and HcalDetId::Undefined.

661  {
662  char buffer [1024];
663  while (fInput.getline(buffer, 1024)) {
664  if (buffer [0] == '#') continue; //ignore comment
665  std::vector <std::string> items = splitString (std::string (buffer));
666  if (items.size () < 12) {
667  if (items.size()==0) continue; // no warning here
668  if (items.size()<9) {
669  edm::LogError("MapFormat") << "CastorElectronicsMap-> line too short: " << buffer;
670  continue;
671  }
672  if (items[8]=="NA" || items[8]=="NT") {
673  while (items.size()<12) items.push_back(""); // don't worry here
674  } else if (items[8]=="HT") {
675  if (items.size()==11) items.push_back("");
676  else {
677  edm::LogError("MapFormat") << "CastorElectronicsMap-> Bad line: " << buffer
678  << "\n HT line must contain at least 11 items: i cr sl tb dcc spigot fiber fiberchan subdet=HT ieta iphi";
679  continue;
680  }
681  } else {
682  edm::LogError("MapFormat") << "CastorElectronicsMap-> Bad line: " << buffer
683  << "\n line must contain 12 items: i cr sl tb dcc spigot fiber fiberchan subdet ieta iphi depth";
684  continue;
685  }
686  }
687  // std::cout << "CastorElectronicsMap-> processing line: " << buffer << std::endl;
688  int crate = atoi (items [1].c_str());
689  int slot = atoi (items [2].c_str());
690  int top = 1;
691  if (items [3] == "b") top = 0;
692  int dcc = atoi (items [4].c_str());
693  int spigot = atoi (items [5].c_str());
694  CastorElectronicsId elId;
695  if (items[8] == "HT" || items[8] == "NT") {
696  int slb = atoi (items [6].c_str());
697  int slbCh = atoi (items [7].c_str());
698  elId=CastorElectronicsId(slbCh, slb, spigot, dcc,crate,slot,top);
699  } else {
700  int fiber = atoi (items [6].c_str());
701  int fiberCh = atoi (items [7].c_str());
702 
703  elId=CastorElectronicsId(fiberCh, fiber, spigot, dcc);
704  elId.setHTR (crate, slot, top);
705  }
706 
707  // first, handle undefined cases
708  if (items [8] == "NA") { // undefined channel
709  fObject->mapEId2chId (elId, DetId (HcalDetId::Undefined));
710  } else if (items [8] == "NT") { // undefined trigger channel
712  } else {
713  CastorText2DetIdConverter converter (items [8], items [9], items [10], items [11]);
714  if (converter.isHcalCastorDetId ()) {
715  fObject->mapEId2chId (elId, converter.getId ());
716  }
717  else {
718  edm::LogWarning("Format Error") << "CastorElectronicsMap-> Unknown subdetector: "
719  << items [8] << '/' << items [9] << '/' << items [10] << '/' << items [11] << std::endl;
720  }
721  }
722  }
723  fObject->sort ();
724  return true;
725 }
static const HcalDetId Undefined
Definition: HcalDetId.h:85
static int slb(const HcalTriggerPrimitiveSample &theSample)
void setHTR(int crate, int slot, int tb)
std::vector< std::string > splitString(const std::string &fLine)
bool mapEId2tId(CastorElectronicsId fElectronicsId, HcalTrigTowerDetId fTriggerId)
Definition: DetId.h:18
static const HcalTrigTowerDetId Undefined
bool mapEId2chId(CastorElectronicsId fElectronicsId, DetId fId)
Readout chain identification for Castor Bits for the readout chain : some names need change! [31:26] ...
bool CastorDbASCIIIO::getObject ( std::istream &  fInput,
CastorChannelQuality fObject 
)

Definition at line 326 of file CastorDbASCIIIO.cc.

References CastorCondObjectContainer< Item >::addValues(), CastorCondObjectContainer< Item >::exists(), getId(), mps_monitormerge::items, NULL, splitString(), and AlCaHLTBitMon_QueryRunRegistry::string.

327 {
328  if (!fObject) fObject = new CastorChannelQuality;
329  char buffer [1024];
330  while (fInput.getline(buffer, 1024)) {
331  if (buffer [0] == '#') continue; //ignore comment
332  std::vector <std::string> items = splitString (std::string (buffer));
333  if (items.size()==0) continue; // blank line
334  if (items.size () < 5) {
335  edm::LogWarning("Format Error") << "Bad line: " << buffer << "\n line must contain 5 items: eta, phi, depth, subdet, GOOD/BAD/HOT/DEAD" << std::endl;
336  continue;
337  }
338  DetId id = getId (items);
339 
340  if (fObject->exists(id) ) {
341  edm::LogWarning("Redefining Channel") << "line: " << buffer << "\n attempts to redefine data. Ignored" << std::endl;
342  continue;
343  }
344 // else
345 // {
346  uint32_t mystatus;
347  CastorChannelStatus* fCondObject = NULL;
348  if (items[4].substr(0,2)=="0x") {
349  sscanf(items[4].c_str(),"%X", &mystatus);
350  fCondObject = new CastorChannelStatus(id,mystatus);
351  }
352  else if (isalpha(items[4].c_str()[0])) {
353  fCondObject = new CastorChannelStatus(id, items[4]);
354  }
355  else {
356  sscanf(items[4].c_str(),"%u", &mystatus);
357  fCondObject = new CastorChannelStatus(id,mystatus);
358  }
359  fObject->addValues(*fCondObject);
360  delete fCondObject;
361  // }
362  }
363  return true;
364 }
static unsigned int getId(void)
#define NULL
Definition: scimark2.h:8
std::vector< std::string > splitString(const std::string &fLine)
const bool exists(DetId fId) const
Definition: DetId.h:18
bool addValues(const Item &myItem)
bool CastorDbASCIIIO::getObject ( std::istream &  fInput,
CastorRecoParams fObject 
)

Definition at line 773 of file CastorDbASCIIIO.cc.

References CastorCondObjectContainer< Item >::addValues(), getId(), mps_monitormerge::items, splitString(), and AlCaHLTBitMon_QueryRunRegistry::string.

773  {
774  if (!fObject) fObject = new CastorRecoParams();
775  char buffer [1024];
776  while (fInput.getline(buffer, 1024)) {
777  if (buffer [0] == '#') continue; //ignore comment
778  std::vector <std::string> items = splitString (std::string (buffer));
779  if (items.size()==0) continue; // blank line
780  if (items.size () < 6) {
781  edm::LogWarning("Format Error") << "Bad line: " << buffer << "\n line must contain 6 items: eta, phi, depth, subdet, firstSample, samplesToAdd" << std::endl;
782  continue;
783  }
784  DetId id = getId (items);
785 
786  CastorRecoParam* fCondObject = new CastorRecoParam(id, atoi (items [4].c_str()), atoi (items [5].c_str()) );
787  fObject->addValues(*fCondObject);
788  delete fCondObject;
789  }
790  return true;
791 }
static unsigned int getId(void)
std::vector< std::string > splitString(const std::string &fLine)
Definition: DetId.h:18
bool addValues(const Item &myItem)
bool CastorDbASCIIIO::getObject ( std::istream &  fInput,
CastorSaturationCorrs fObject 
)

Definition at line 226 of file CastorDbASCIIIO.cc.

References getCastorSingleFloatObject().

226 {return getCastorSingleFloatObject (fInput, fObject, new CastorSaturationCorr);}
bool getCastorSingleFloatObject(std::istream &fInput, T *fObject, S *fCondObject)
std::vector<std::string> CastorDbASCIIIO::splitString ( const std::string &  fLine)

Definition at line 48 of file CastorDbASCIIIO.cc.

References relativeConstraints::empty, mps_fire::i, mps_fire::result, and AlCaHLTBitMon_QueryRunRegistry::string.

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

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  }
61  else {
62  if (empty) empty = false;
63  }
64  }
65  return result;
66 }
Definition: start.py:1