Classes | Functions
nearline Namespace Reference

Classes

class  NearlineAna
 
class  TPCHits
 

Functions

void BuildTPCChannelMap (std::string channelMapFile, std::map< int, int > &channelMap)
 

Function Documentation

void nearline::BuildTPCChannelMap ( std::string  channelMapFile,
std::map< int, int > &  channelMap 
)

Builds TPC channel map from the map txt file

Definition at line 741 of file NearlineAna_module.cc.

741  {
742 
743  /// Builds TPC channel map from the map txt file
744 
745  channelMap.clear();
746 
747  int onlineChannel;
748  int offlineChannel;
749 
750  std::string fullname;
751  cet::search_path sp("FW_SEARCH_PATH");
752  sp.find_file(channelMapFile, fullname);
753 
754  if (fullname.empty())
755  mf::LogWarning("DAQToOffline") << "Input TPC channel map file " << channelMapFile << " not found in FW_SEARCH_PATH. Using online channel numbers!" << std::endl;
756 
757  else {
758  mf::LogVerbatim("DAQToOffline") << "Build TPC Online->Offline channel Map from " << fullname;
759  std::ifstream infile(fullname);
760  while (infile.good()) {
761  infile >> onlineChannel >> offlineChannel;
762  channelMap.insert(std::make_pair(onlineChannel,offlineChannel));
763  mf::LogVerbatim("DAQToOffline") << " " << onlineChannel << " -> " << offlineChannel;
764  }
765  std::cout << "channelMap has size " << channelMap.size() << ". If this is 2048, then it's fine even if the above lines skipped a 'few' channels..." << std::endl;
766  }
767 
768 }
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
std::string string
Definition: nybbler.cc:12
string infile
QTextStream & endl(QTextStream &s)