51 lines
1.2 KiB
C++
51 lines
1.2 KiB
C++
#include "musrErrorMessage.hh"
|
|
#include "musrRootOutput.hh"
|
|
|
|
#include <iostream>
|
|
#include <string>
|
|
#include <utility>
|
|
#include <vector>
|
|
|
|
int main()
|
|
{
|
|
musrErrorMessage errorMessages;
|
|
musrRootOutput output;
|
|
|
|
const std::vector<std::pair<std::string,int>> expectedProcessIDs = {
|
|
{"DecayWithSpin",1},
|
|
{"eIoni",2},
|
|
{"eBrem",3},
|
|
{"annihil",4},
|
|
{"LowEnCompton",5},
|
|
{"LowEnConversion",6},
|
|
{"LowEnBrem",7},
|
|
{"LowEnergyIoni",8},
|
|
{"LowEnPhotoElec",9},
|
|
{"RadioactiveDecay",10},
|
|
{"muIoni",11},
|
|
{"MuFormation",12},
|
|
{"Decay",13},
|
|
{"conv",14},
|
|
{"compt",15},
|
|
{"phot",16},
|
|
{"initialParticle",100},
|
|
};
|
|
|
|
for (const auto& [name,expectedID] : expectedProcessIDs) {
|
|
const int actualID = output.ConvertProcessToID(name);
|
|
if (actualID!=expectedID) {
|
|
std::cerr<<"process '"<<name<<"': expected "<<expectedID<<", got "<<actualID<<'\n';
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
output.SetVolumeIDMapping("log_regression_detector",42);
|
|
const int actualVolumeID = output.ConvertVolumeToID("log_regression_detector");
|
|
if (actualVolumeID!=42) {
|
|
std::cerr<<"volume mapping: expected 42, got "<<actualVolumeID<<'\n';
|
|
return 1;
|
|
}
|
|
|
|
return 0;
|
|
}
|