16 : empiricalAperture45_(
""),
17 empiricalAperture56_(
""),
19 timeResolutionDiamonds45_(
""),
20 timeResolutionDiamonds56_(
"") {}
46 std::map<unsigned int, std::unique_ptr<TH2F>>
result;
49 result[it.first] =
loadObject(it.second.first, it.second.second);
55 std::map<unsigned int, std::unique_ptr<TH2F>>
result;
61 for (
unsigned int pl = 0; pl < 10; ++pl) {
63 result[plId] =
loadObject(it.second.first,
replace(it.second.second,
"<detid>", std::to_string(pl)));
68 for (
unsigned int pl = 0; pl < 6; ++pl) {
70 result[plId] =
loadObject(it.second.first,
replace(it.second.second,
"<detid>", std::to_string(pl)));
75 for (
unsigned int pl = 0; pl < 4; ++pl) {
77 result[plId] =
loadObject(it.second.first,
replace(it.second.second,
"<detid>", std::to_string(pl)));
87 TFile *f_in = TFile::Open(fip.fullPath().c_str());
89 throw cms::Exception(
"PPS") <<
"Cannot open file '" << fip.fullPath() <<
"'.";
91 TH2F *o_in = (TH2F *)f_in->Get(
object.c_str());
93 throw cms::Exception(
"PPS") <<
"Cannot load object '" <<
object <<
"' from file '" << fip.fullPath() <<
"'.";
96 o_in->SetDirectory(
nullptr);
100 return std::unique_ptr<TH2F>(o_in);
104 size_t start_pos = 0;
105 while ((start_pos = input.find(from, start_pos)) != std::string::npos) {
106 input.replace(start_pos, from.length(), to);
107 start_pos += to.length();
Detector ID class for TOTEM Si strip detectors.
PPSDirectSimulationData()
static std::string replace(std::string input, const std::string &from, const std::string &to)
std::string timeResolutionDiamonds45_
std::map< unsigned int, FileObject > efficienciesPerRP_
const std::string & getTimeResolutionDiamonds56() const
void setTimeResolutionDiamonds56(std::string s)
const std::string & getTimeResolutionDiamonds45() const
std::map< unsigned int, std::unique_ptr< TH2F > > loadEffeciencyHistogramsPerRP() const
static std::unique_ptr< TH2F > loadObject(const std::string &file, const std::string &object)
static std::string const input
std::string empiricalAperture45_
std::string timeResolutionDiamonds56_
void setEmpiricalAperture45(std::string s)
std::map< unsigned int, FileObject > & getEfficienciesPerRP()
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
~PPSDirectSimulationData()
std::map< unsigned int, std::unique_ptr< TH2F > > loadEffeciencyHistogramsPerPlane() const
const std::string & getEmpiricalAperture45() const
void setEmpiricalAperture56(std::string s)
Base class for CTPPS detector IDs.
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
void setTimeResolutionDiamonds45(std::string s)
const std::string & getEmpiricalAperture56() const
std::string empiricalAperture56_
std::map< unsigned int, FileObject > efficienciesPerPlane_
std::map< unsigned int, FileObject > & getEfficienciesPerPlane()