14#ifndef CBMMUCHSEGMENTMANUAL_H
15#define CBMMUCHSEGMENTMANUAL_H 1
20#include <RtypesCore.h>
51 virtual InitStatus
Init();
86 void SetSigma(Int_t iStation, Int_t iRegion, Double_t sigmaX, Double_t sigmaY);
94 void SetPadSize(Int_t iStation, Int_t iRegion, Double_t padLx, Double_t padLy);
105 std::map<Int_t, std::vector<Double_t>>
fRadii;
106 std::map<Int_t, std::vector<Double_t>>
108 std::map<Int_t, std::vector<Double_t>>
111 std::map<Int_t, std::vector<Int_t>>
fNCols;
112 std::map<Int_t, std::vector<Int_t>>
fNRows;
201 void Print(Option_t* =
"")
const;
210 std::string::size_type pos1 = str.find_first_not_of(
' ');
211 std::string::size_type pos2 = str.find_last_not_of(
' ');
213 str.substr(pos1 == std::string::npos ? 0 : pos1, pos2 == std::string::npos ? str.length() - 1 : pos2 - pos1 + 1);
219 return str[0] ==
'#' || str.length() == 0 || str[0] ==
'\0' || str[0] ==
'\n';
224 getline(infile, str);
226 getline(infile, str);
229 std::vector<std::string>&
Split(
const std::string& s,
char delim, std::vector<std::string>& elems)
231 std::stringstream ss(s);
233 while (getline(ss, item, delim)) {
234 if (item.length() != 0) elems.push_back(item);
240 std::vector<std::string>
Split(
const std::string& s,
char delim)
242 std::vector<std::string> elems;
243 return Split(s, delim, elems);
250 std::stringstream ss(str);
251 if ((ss >> number).fail() || !(ss >> std::ws).eof())
throw std::bad_cast();
253 catch (
const std::bad_cast& exc) {
254 Fatal(
"",
"Invalid cast.\n");
void SetNRegions(Int_t iStation, Int_t nRegions)
std::vector< std::string > & Split(const std::string &s, char delim, std::vector< std::string > &elems)
void SetRegionRadius(Int_t iStation, Int_t iRegion, Double_t radius)
void Print(Option_t *="") const
Bool_t IsDummyLine(std::string &str)
Bool_t ShouldSegment(CbmMuchSectorRectangular *sector, const TString direction, Int_t &iRegion)
virtual ~CbmMuchSegmentManual()
std::map< Int_t, std::vector< Double_t > > fSecLy
void SetNStations(Int_t nStations)
Bool_t IsIncompleteSector(CbmMuchSectorRectangular *sector)
void StrToNum(std::string &str, T &number)
std::map< Int_t, std::vector< Int_t > > fNCols
std::map< Int_t, Int_t > fNChannels
void SetSigma(Int_t iStation, Int_t iRegion, Double_t sigmaX, Double_t sigmaY)
Int_t IntersectsRad(CbmMuchModuleGemRectangular *module, Double_t radius)
void SegmentSector(CbmMuchModuleGemRectangular *module, CbmMuchSectorRectangular *sector)
void SetNChannels(Int_t iStation, Int_t nChannels)
std::map< Int_t, std::vector< Int_t > > fNRows
CbmMuchSegmentManual(const CbmMuchSegmentManual &)
CbmMuchSegmentManual & operator=(const CbmMuchSegmentManual &)
std::map< Int_t, std::vector< Double_t > > fRadii
void SetPadSize(Int_t iStation, Int_t iRegion, Double_t padLx, Double_t padLy)
void OmitDummyLines(std::ifstream &infile, std::string &str)
void SegmentLayerSide(CbmMuchLayerSide *layerSide)
void SegmentModule(CbmMuchModuleGemRectangular *module, Bool_t useModuleDesign)
virtual void SetParContainers()
std::map< Int_t, std::vector< Double_t > > fSecLx
Int_t GetRegionIndex(CbmMuchSectorRectangular *sector)
Double_t GetSectorMaxSize(CbmMuchModuleGemRectangular *module, const TString side, Int_t &iRegion)
std::vector< std::string > Split(const std::string &s, char delim)
std::map< Int_t, Int_t > fNRegions
void Trim(std::string &str)
Double_t GetPadMaxSize(CbmMuchModuleGemRectangular *module, const TString side)
virtual InitStatus Init()