/** LitDetectorGeometry.h * @author Andrey Lebedev * @since 2009 * @version 1.0 * * Classes for geometry description for the Littrack parallel * version of the tracking. **/ #ifndef LITDETECTORGEOMETRY_H_ #define LITDETECTORGEOMETRY_H_ #include "LitTypes.h" #include "LitMaterialInfo.h" #include "LitField.h" #include "CbmLitEnums.h" const unsigned char MAX_NOF_STATION_GROUPS = 6; const unsigned char MAX_NOF_STATIONS = 4; const unsigned char MAX_NOF_SUBSTATIONS = 2; template class LitSubstation { public: T Z; LitMaterialInfo material; LitFieldSlice fieldSlice; friend std::ostream & operator<<(std::ostream &strm, const LitSubstation &substation ){ strm << "LitSubstation: " << "Z=" << substation.Z << ", material=" << substation.material; // strm << ", fieldSlice=" << substation.fieldSlice; return strm; } } _fvecalignment; typedef LitSubstation LitSubstationVec; typedef LitSubstation LitSubstationScal; template class LitStation { public: LitStation():nofSubstations(0){} void AddSubstation(const LitSubstation& substation) { substations[nofSubstations++] = substation; } unsigned char GetNofSubstations() const { return nofSubstations; } // Type of hits on the station LitHitType type; // array with substations in the station LitSubstation substations[MAX_NOF_SUBSTATIONS]; // number of substations unsigned char nofSubstations; friend std::ostream & operator<<(std::ostream &strm, const LitStation &station){ strm << "LitStation: type" << station.type << ", nofSubstations=" << station.GetNofSubstations() << std::endl; for (int i = 0; i < station.GetNofSubstations(); i++) { strm << " " << i << station.substations[i]; } return strm; } } _fvecalignment; typedef LitStation LitStationVec; typedef LitStation LitStationScal; template class LitAbsorber { public: 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; } } _fvecalignment; typedef LitAbsorber LitAbsorberVec; typedef LitAbsorber LitAbsorberScal; template class LitStationGroup { public: LitStationGroup():nofStations(0) {} virtual ~LitStationGroup() {} void AddStation(const LitStation& station) { stations[nofStations++] = station; } unsigned char GetNofStations() const { return nofStations; } // array with stations in the station group LitStation 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 LitStationGroup &stationGroup){ strm << "LitStationGroup: " << "nofStations=" << stationGroup.GetNofStations() << std::endl; for (unsigned char i = 0; i < stationGroup.GetNofStations(); i++) { strm << " " << i << stationGroup.stations[i]; } strm << " " << stationGroup.absorber; return strm; } } _fvecalignment; typedef LitStationGroup LitStationGroupVec; typedef LitStationGroup LitStationGroupScal; template class LitDetectorLayout { public: LitDetectorLayout():nofStationGroups(0){}; void AddStationGroup(const LitStationGroup& 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 LitStationGroup& GetStationGroup(unsigned char stationGroup) { return stationGroups[stationGroup]; } const LitStation& GetStation(unsigned char stationGroup, unsigned char station) { return stationGroups[stationGroup].stations[station]; } const LitSubstation& GetSubstation(unsigned char stationGroup, unsigned char station, unsigned char substation){ return stationGroups[stationGroup].stations[station].substations[substation]; } // array with station groups LitStationGroup stationGroups[MAX_NOF_STATION_GROUPS]; //number of station groups unsigned char nofStationGroups; friend std::ostream & operator<<(std::ostream &strm, const LitDetectorLayout &layout){ strm << "LitDetectorLayout: " << "nofStationGroups=" << layout.GetNofStationGroups() << std::endl; for (unsigned char i = 0; i < layout.GetNofStationGroups(); i++) { strm << i << layout.stationGroups[i]; } return strm; } } _fvecalignment; typedef LitDetectorLayout LitDetectorLayoutVec; typedef LitDetectorLayout LitDetectorLayoutScal; #endif