~vpec/maus/tof_calib_read

« back to all changes in this revision

Viewing changes to src/legacy/Interface/dataCards.cc

reverse merge from trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
** Ed McKigney - Aug 21 2002
6
6
*/
7
7
 
 
8
#include <Python.h>
 
9
 
8
10
#include "Interface/dataCards.hh"
9
11
#include "Interface/Squeak.hh"
10
12
#include "Interface/Squeal.hh"
29
31
using std::endl;
30
32
using std::vector;
31
33
 
32
 
dataCards::dataCards() : units()
 
34
dataCards::dataCards()
33
35
{
34
36
}
35
37
 
45
47
  appCode["Analysis"]        = 3;
46
48
}
47
49
 
48
 
dataCards::dataCards(const std::string& app) : units(), client(app)
 
50
dataCards::dataCards(const std::string& app) : client(app)
49
51
{
50
52
  initializeApplicationCodes();
51
53
  std::map<std::string,int>::iterator i = appCode.find(client);
55
57
  fillCards(i->second);
56
58
}
57
59
 
58
 
dataCards::dataCards(int app) : units()
 
60
dataCards::dataCards(int app)
59
61
{
60
62
  fillCards(app);
61
63
}
433
435
  std::string s;
434
436
  std::string t;
435
437
  std::string c;
436
 
  std::string units;
437
438
 
438
439
  while (in) {
439
440
    c="";
448
449
    InputDataCardsDouble::iterator i = cd.find(t);
449
450
    if ( i != cd.end()) {
450
451
      double d;
451
 
      units = "";
452
 
      is >> d >> units;
 
452
      is >> d;
453
453
      cd[t] = d;
454
 
      cd[t] *= getUnits(t, units);
455
454
      ok = 1;
456
455
    }
457
456
    if( ok == 0)
641
640
 
642
641
}
643
642
 
644
 
double dataCards::getUnits( std::string dc, std::string u )
645
 
{
646
 
  try   { return units.GetUnits(u); }
647
 
  catch(Squeal squee) { throw(Squeal(Squeal::recoverable, "Failed to evaluate units "+u+" in datacard "+dc, "dataCards::readKeys")); }
648
 
}
649
643