17 std::stringstream selection_title{};
18 selection_title<<
"Bin size "<<
m_binWidth.value()<<
";";
19 selection_title<<
"Hit occupancy;";
21 m_pairBinOccupancy =
new TH1I(
"PairBinOccupancy", selection_title.str().c_str(), 50, 0, 50);
22 selection_title<<
"; Pair occupancy";
24 std::stringstream folderName{};
26 ATH_MSG_INFO(
"Write out histograms in "<<folderName.str());
31 return StatusCode::SUCCESS;
34 const EventContext& ctx = Gaudi::Hive::currentContext();
38 return StatusCode::FAILURE;
43 std::map<unsigned int, Layer> sectorsHits{};
45 if (it.prepRawDataVec().empty())
continue;
46 const Identifier id = it.prepRawDataVec().front()->identify();
49 hitIds.reserve(it.prepRawDataVec().size() + hitIds.size());
55 for (
auto& [sector, hitIds] : sectorsHits ) {
57 for (
Layer& lay : sortedHits) {
63 return StatusCode::SUCCESS;
68 return m_idHelperSvc->gasGapId(a) < m_idHelperSvc->gasGapId(b);
70 std::set<Identifier> unique_set{};
72 if (!unique_set.insert(
id).second)
continue;
74 layerVec.emplace_back();
75 layerVec.back().reserve(micromegaHits.size());
77 layerVec.back().push_back(
id);
79 for (
Layer& lay : layerVec) {
81 return m_idHelperSvc->mmIdHelper().channel(a) < m_idHelperSvc->mmIdHelper().channel(b);
87 if (clustInLay.size() < 2)
return;
89 const unsigned int firstCh =
m_idHelperSvc->mmIdHelper().channel(clustInLay[0]);
90 const unsigned int lastCh =
m_idHelperSvc->mmIdHelper().channel(clustInLay[clustInLay.size() -1]);
92 const unsigned int deltaCh = lastCh - firstCh;
97 const int bin_num = (
m_idHelperSvc->mmIdHelper().channel(
id) - firstCh) %nBins;
103 for (
unsigned int i = 0 ; i <
histogram.size() -1 ; ++i){
#define ATH_CHECK
Evaluate an expression and check for errors.
Handle class for reading from StoreGate.
const ServiceHandle< ITHistSvc > & histSvc() const
The standard THistSvc (for writing histograms and TTrees and more to a root file) Returns (kind of) a...
AthHistogramAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
This class holds information needed for the Moore and MoMu pattern recognition for a muon chamber.
The MuonPatternCombination class provides the means to store the output of the initial global pattern...
TH1 * m_pairVsSingleOccupancy
std::vector< Layer > LayerVec
void fillHistograms(const Layer &layers)
StatusCode initialize() override
Gaudi::Property< std::string > m_fileStream
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
std::vector< Identifier > Layer
Gaudi::Property< unsigned int > m_binWidth
LayerVec sortByLayer(std::vector< Identifier > µmegaHits) const
TH1 * m_singleBinOccupancy
StatusCode execute() override
NswOccupancyAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadHandleKey< MuonPatternCombinationCollection > m_patternCollKey
virtual bool isValid() override final
Can the handle be successfully dereferenced?
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
void stable_sort(DataModel_detail::iterator< DVL > beg, DataModel_detail::iterator< DVL > end)
Specialization of stable_sort for DataVector/List.