/** LitDetectorGeometryMuon.h * @author Andrey Lebedev * @since 2009 * @version 1.0 * * Classes for geometry description of the 'muon' * setup of CBM. **/ #ifndef LITDETECTORGEOMETRYMUON_H_ #define LITDETECTORGEOMETRYMUON_H_ #include "../LitTypes.h" #include "../LitMaterialInfo.h" #include "../LitField.h" #include "../LitEnums.h" #include "../LitUtils.h" namespace lit { namespace parallel{ const unsigned char MAX_NOF_STATION_GROUPS = 6; const unsigned char MAX_NOF_STATIONS = 4; const unsigned char MAX_NOF_SUBSTATIONS = 2; template class LitSubstationMuon { public: LitSubstationMuon(): Z(0.), material(), fieldSlice() {} virtual ~LitSubstationMuon() {} T Z; LitMaterialInfo material; LitFieldSlice fieldSlice; friend std::ostream& operator<<(std::ostream& strm, const LitSubstationMuon& substation ) { strm << "LitSubstationMuon: " << "Z=" << substation.Z << ", material=" << substation.material; // strm << ", fieldSlice=" << substation.fieldSlice; return strm; } std::string ToStringShort() { std::string str = ToString(Z) + "\n" + material.ToStringShort(); str += fieldSlice.ToStringShort(); return str; } } _fvecalignment; typedef LitSubstationMuon LitSubstationMuonVec; typedef LitSubstationMuon LitSubstationMuonScal; template class LitStationMuon { public: LitStationMuon():type(kLITPIXELHIT), nofSubstations(0) {} virtual ~LitStationMuon() {} void AddSubstation(const LitSubstationMuon& substation) { substations[nofSubstations++] = substation; } unsigned char GetNofSubstations() const { return nofSubstations; } // Type of hits on the station LitHitType type; // array with substations in the station LitSubstationMuon substations[MAX_NOF_SUBSTATIONS]; // number of substations unsigned char nofSubstations; friend std::ostream& operator<<(std::ostream& strm, const LitStationMuon& station) { strm << "LitStationMuon: type=" << station.type << ", nofSubstations=" << (int) station.GetNofSubstations() << std::endl; for (unsigned char i = 0; i < station.GetNofSubstations(); i++) { strm << " " << (int) i << " " << station.substations[i]; } return strm; } std::string ToStringShort() { std::string str = type + " " + ToString(GetNofSubstations()) + "\n"; for (unsigned char i = 0; i < GetNofSubstations(); i++) { // str += "substation\n"; str += ToString(i) + "\n" + substations[i].ToStringShort(); } return str; } } _fvecalignment; typedef LitStationMuon LitStationMuonVec; typedef LitStationMuon LitStationMuonScal; template class LitAbsorber { public: LitAbsorber(): Z(0.), material(), fieldSliceFront(), fieldSliceBack() {} virtual ~LitAbsorber() {} T Z; LitMaterialInfo material; LitFieldSlice fieldSliceFront; LitFieldSlice fieldSliceBack; friend std::ostream& operator<<(std::ostream& strm, const LitAbsorber& absorber) { strm << "LitAbsorber: Z=" << absorber.Z << ", material=" << absorber.material; // strm << "fieldSliceFront=" << absorber.fieldSliceFront // << " fieladSliceBack=" << absorber.fieldSliceBack; return strm; } std::string ToStringShort() { std::string str = ToString(Z) + "\n" + material.ToStringShort(); str += fieldSliceFront.ToStringShort(); str += fieldSliceBack.ToStringShort(); return str; } } _fvecalignment; typedef LitAbsorber LitAbsorberVec; typedef LitAbsorber LitAbsorberScal; template class LitStationGroupMuon { public: LitStationGroupMuon(): nofStations(0), absorber() {} virtual ~LitStationGroupMuon() {} void AddStation(const LitStationMuon& station) { stations[nofStations++] = station; } unsigned char GetNofStations() const { return nofStations; } // array with stations in the station group LitStationMuon stations[MAX_NOF_STATIONS]; // number of stations in the station group unsigned char nofStations; // absorber LitAbsorber absorber; friend std::ostream& operator<<(std::ostream& strm, const LitStationGroupMuon& stationGroup) { strm << "LitStationGroupMuon: " << "nofStations=" << (int) stationGroup.GetNofStations() << std::endl; for (unsigned char i = 0; i < stationGroup.GetNofStations(); i++) { strm << " " << (int) i << " " << stationGroup.stations[i]; } strm << " " << stationGroup.absorber; return strm; } std::string ToStringShort() { std::string str = ToString(GetNofStations()) + "\n"; for (unsigned char i = 0; i < GetNofStations(); i++) { // str += "station\n"; str += ToString(i) + "\n" + stations[i].ToStringShort(); } // str += "absorber\n"; str += absorber.ToStringShort(); return str; } } _fvecalignment; typedef LitStationGroupMuon LitStationGroupMuonVec; typedef LitStationGroupMuon LitStationGroupMuonScal; template class LitDetectorLayoutMuon { public: LitDetectorLayoutMuon():nofStationGroups(0) {}; virtual ~LitDetectorLayoutMuon() {} void AddStationGroup(const LitStationGroupMuon& stationGroup) { stationGroups[nofStationGroups++] = stationGroup; } unsigned char GetNofStationGroups() const { return nofStationGroups; } unsigned char GetNofStations(unsigned char stationGroup) const { return stationGroups[stationGroup].GetNofStations(); } unsigned char GetNofSubstations(unsigned char stationGroup, unsigned char station) const { return stationGroups[stationGroup].stations[station].GetNofSubstations(); } const LitStationGroupMuon& GetStationGroup(unsigned char stationGroup) { return stationGroups[stationGroup]; } const LitStationMuon& GetStation(unsigned char stationGroup, unsigned char station) { return stationGroups[stationGroup].stations[station]; } const LitSubstationMuon& GetSubstation(unsigned char stationGroup, unsigned char station, unsigned char substation) { return stationGroups[stationGroup].stations[station].substations[substation]; } // array with station groups LitStationGroupMuon stationGroups[MAX_NOF_STATION_GROUPS]; //number of station groups unsigned char nofStationGroups; friend std::ostream& operator<<(std::ostream& strm, const LitDetectorLayoutMuon& layout) { strm << "LitDetectorLayoutMuon: " << "nofStationGroups=" << (int)layout.GetNofStationGroups() << std::endl; for (unsigned char i = 0; i < layout.GetNofStationGroups(); i++) { strm << (int) i << " " << layout.stationGroups[i]; } return strm; } std::string ToStringShort() { std::string str = ToString(GetNofStationGroups()) + "\n"; for (unsigned char i = 0; i < GetNofStationGroups(); i++) { // str += "station group\n"; str += ToString(i) + "\n" + stationGroups[i].ToStringShort(); } return str; } } _fvecalignment; typedef LitDetectorLayoutMuon LitDetectorLayoutMuonVec; typedef LitDetectorLayoutMuon LitDetectorLayoutMuonScal; } // namespace parallel } // namespace lit #endif /*LITDETECTORGEOMETRYMUON_H_*/