Changeset 541


Ignore:
Timestamp:
Oct 3, 2011, 2:17:41 PM (13 years ago)
Author:
campagne
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • BAORadio/AmasNancay/mergeRawOnOff.cc

    r540 r541  
    6565  string outPath_;
    6666  string sourceName_;
    67   string filePattern_;
     67  string ppfFile_;
    6868} para;
    6969//-----
     
    134134    regexp(aStr.c_str(),pattern_.c_str(),&b,&e);
    135135
    136     cout << "investigate " << aStr << " to find " << pattern_
    137          << "[" <<b<<","<<e<<"]"
    138          << endl;
     136//     cout << "investigate " << aStr << " to find " << pattern_
     137//       << "[" <<b<<","<<e<<"]"
     138//       << endl;
    139139
    140140   
     
    147147  string pattern_;
    148148};
     149//-------------------------------------------------------
    149150//-------------------------------------------------------
    150151void meanOnCycles() throw(string) {
     
    153154  directoryName = para.inPath_ + "/" + para.sourceName_;
    154155
    155   listOfFiles = ListOfFileInDir(directoryName,para.filePattern_);
    156  
    157   list<string>::const_iterator iFile, iFileEnd;
     156  listOfFiles = ListOfFileInDir(directoryName,para.ppfFile_);
     157 
     158  list<string>::const_iterator iFile, iFileEnd, iSpec, iSpecEnd;
    158159  iFileEnd = listOfFiles.end();
    159160 
     
    163164    PInPersist fin(*iFile);
    164165    vector<string> vec = fin.GetNameTags();
    165     vector<string> listOfSpectra;
    166    
     166    list<string> listOfSpectra;
    167167    std::remove_copy_if(
    168168                        vec.begin(), vec.end(), back_inserter(listOfSpectra),
     
    170170                        );
    171171   
    172     for (size_t i=0; i<listOfSpectra.size(); ++i){
    173       cout << " spactra <" << listOfSpectra[i] << ">" << endl;
    174     }
     172    iSpecEnd = listOfSpectra.end();
     173    listOfSpectra.sort(stringCompare);
     174
     175    for (iSpec = listOfSpectra.begin(); iSpec !=iSpecEnd;  ++iSpec){
     176      cout << " spactra <" << *iSpec << ">" << endl;
     177    }
     178
    175179  }
    176180 
     
    189193  string outputPath = ".";
    190194  string sourceName = "Abell85";
    191   string filePattern;
     195  string ppfFile;
    192196 
    193197 
     
    211215      ka+=2;
    212216    }
    213     else if (strcmp(arg[ka],"-source")==0) {
     217    else if (strcmp(arg[ka],"-src")==0) {
    214218      sourceName=arg[ka+1];
    215219      ka+=2;
    216220    }
    217     else if (strcmp(arg[ka],"-filePattern")==0) {
    218       filePattern=arg[ka+1];
     221    else if (strcmp(arg[ka],"-ppfFile")==0) {
     222      ppfFile=arg[ka+1];
    219223      ka+=2;
    220224    }
     
    226230  para.outPath_  = outputPath;
    227231  para.sourceName_ = sourceName;
    228   para.filePattern_ = filePattern;
     232  para.ppfFile_ = ppfFile;
    229233
    230234  cout << "Dump Initial parameters ............" << endl;
     
    233237       << " outputPath = " << outputPath << "\n"
    234238       << " sourceName = " << sourceName << "\n"
    235        << " filePattern = " << filePattern << "\n"
     239       << " ppfFile = " << ppfFile << "\n"
    236240       << " debuglev = "  << debuglev  << "\n";
    237241  cout << "...................................." << endl;
     242
     243  if ( "" == ppfFile ) {
     244    cerr << "mergeRawOnOff.cc: you have forgotten ppfFile option"
     245         << endl;
     246    return 999;
     247  }
     248
    238249
    239250  try {
Note: See TracChangeset for help on using the changeset viewer.