Go to the documentation of this file.
8 #ifndef LITHITDATAMUON_H_
9 #define LITHITDATAMUON_H_
11 #include "../LitComparators.h"
12 #include "../LitHit.h"
47 fHits.resize(nofGroups);
49 for (
int i = 0;
i < nofGroups;
i++) {
51 fHits[
i].resize(nofStations);
53 for (
int j = 0; j < nofStations; j++) {
55 fHits[
i][j].resize(nofSubstations);
56 fMaxErr[
i][j].resize(nofSubstations);
57 for (
int k = 0; k < nofSubstations; k++) {
58 fHits[
i][j][k].reserve(1500);
75 fHits[stationGroup][station][substation].push_back(hit);
76 if (
fMaxErr[stationGroup][station][substation] < hit->
Dx) {
77 fMaxErr[stationGroup][station][substation] = hit->
Dx;
87 unsigned char stationGroup;
88 unsigned char station;
89 unsigned char substation;
91 AddHit(stationGroup, station, substation, hit);
103 GetHit(
int stationGroup,
int station,
int substation,
int hitId)
const {
104 return fHits[stationGroup][station][substation][hitId];
114 const std::vector<LitScalPixelHit*>&
115 GetHits(
int stationGroup,
int station,
int substation) {
116 return fHits[stationGroup][station][substation];
127 GetNofHits(
int stationGroup,
int station,
int substation)
const {
128 return fHits[stationGroup][station][substation].size();
139 return fMaxErr[stationGroup][station][substation];
146 for (
unsigned int i = 0;
i <
fHits.size();
i++) {
147 for (
unsigned int j = 0; j <
fHits[
i].size(); j++) {
148 for (
unsigned int k = 0; k <
fHits[
i][j].size(); k++) {
150 fHits[
i][j][k].reserve(1500);
162 for (
int i = 0;
i <
fLayout.GetNofStationGroups();
i++) {
163 for (
int j = 0; j <
fLayout.GetNofStations(
i); j++) {
164 for (
int k = 0; k <
fLayout.GetNofSubstations(
i, j); k++) {
165 std::vector<LitScalPixelHit*>& shits =
fHits[
i][j][k];
166 std::sort(shits.begin(), shits.end(), ComparePixelHitXLess());
181 std::string str =
"HitDataMuon:\n";
182 for (
int i = 0;
i <
fLayout.GetNofStationGroups();
i++) {
183 str +=
" station group " + lit::parallel::ToString<int>(
i) +
"\n";
184 for (
int j = 0; j <
fLayout.GetNofStations(
i); j++) {
185 str +=
" station " + lit::parallel::ToString<int>(j) +
"\n";
186 for (
int k = 0; k <
fLayout.GetNofSubstations(
i, j); k++) {
187 str +=
" substation " + lit::parallel::ToString<int>(k) +
": "
188 + lit::parallel::ToString<int>(
GetNofHits(
i, j, k))
189 +
" hits, " +
"max err="
190 + lit::parallel::ToString<T>(
GetMaxErr(
i, j, k)) +
"\n";
216 unsigned char& stationGroup,
217 unsigned char& station,
218 unsigned char& substation)
const {
220 for (
unsigned char i = 0;
i <
fLayout.GetNofStationGroups();
i++) {
221 for (
unsigned char j = 0; j <
fLayout.GetNofStations(
i); j++) {
235 std::vector<std::vector<std::vector<PixelHitArray>>>
fHits;
237 std::vector<std::vector<std::vector<fscal>>>
fMaxErr;
Base class for scalar pixel hits.
class lit::parallel::LitDetectorLayout _fvecalignment
fscal GetMaxErr(int stationGroup, int station, int substation) const
Return maximum hit error in [cm] for the specified substation.
void SetDetectorLayout(const LitDetectorLayoutMuon< T > &layout)
Set detector layout for which hits are arranged.
void Clear()
Clear hit arrays.
void SortHits()
Sort hits in each substation by X coordinate.
const std::vector< LitScalPixelHit * > & GetHits(int stationGroup, int station, int substation)
Return hit vector using station group, station and substation indices.
void StationByPlaneId(unsigned char planeId, unsigned char &stationGroup, unsigned char &station, unsigned char &substation) const
Calculate station group, station and substation indices using the detector plane number.
Classes for muon geometry description of CBM.
friend std::ostream & operator<<(std::ostream &strm, const LitHitDataMuon &hitData)
Operator << for convenient output to std::ostream.
unsigned char GetNofStations(unsigned char stationGroup) const
Return number of stations for specified station group.
std::vector< std::vector< std::vector< fscal > > > fMaxErr
unsigned int GetNofHits(int stationGroup, int station, int substation) const
Return number of hits for the specified substation.
std::vector< std::vector< std::vector< PixelHitArray > > > fHits
unsigned char GetNofSubstations(unsigned char stationGroup, unsigned char station) const
Return number of substations for specified station group and station.
const LitScalPixelHit * GetHit(int stationGroup, int station, int substation, int hitId) const
Return hit using station group, station and substation indices.
virtual ~LitHitDataMuon()
Destructor.
LitDetectorLayoutMuon< T > fLayout
std::string ToString() const
Return std::string representation for the class.
void AddHit(int stationGroup, int station, int substation, LitScalPixelHit *hit)
Add hit using station group, station and substation indices.
unsigned char GetNofStationGroups() const
Return number of station groups.
void AddHit(unsigned char planeId, LitScalPixelHit *hit)
Add hit using absolute detector plane (substation) index in the detector.
LitHitDataMuon()
Constructor.