ATLAS Offline Software
RegionSelectionSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef RegionSelectionSvc_H
6 #define RegionSelectionSvc_H
7 
8 #include <TChain.h>
9 
10 #include <list>
11 #include <set>
12 #include <string>
13 #include <vector>
14 
16 #include "GaudiKernel/ServiceHandle.h"
17 #include "GaudiKernel/ToolHandle.h"
21 
22 namespace MuonCalib {
23  class RegionSelectorBase;
24  class MuonFixedId;
25 } // namespace MuonCalib
26 
27 // interface to enable retrieving of a pointer to the singleton //
28 
36 public:
38  RegionSelectionSvc(const std::string &name, ISvcLocator *svc_locator);
41  static const InterfaceID &interfaceID() {
42  static const InterfaceID IID_IRegionSelectionSvc("RegionSelectionSvc", 1, 0);
43  return IID_IRegionSelectionSvc;
44  }
46  virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvUnknown);
50  void Print(std::ostream &os) const;
52  bool isInRegion(const MuonCalib::MuonFixedId &id) const;
54  const std::string& GetRegionSelection() const;
56  const std::vector<MuonCalib ::NtupleStationId> &GetStationsInRegions() const;
58  int AddRegionNtuples(const std::string &infile, TChain *chain);
59  int AddRegionNtuples(const std::string &infile, TChain *chain, std::list<std::string> &dirnames);
60 
61 private:
63  Gaudi::Property<std::string> m_region_string{this, "Region", ""};
65  Gaudi::Property<bool> m_print_list_of_selected_chambers{this, "PrintList", false};
67  std::unique_ptr<MuonCalib ::RegionSelectorBase> m_master_region;
69  std::vector<MuonCalib::NtupleStationId> m_stations_in_region;
70  std::set<MuonCalib::NtupleStationId> m_unique_chambers;
72  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
74  ToolHandle<MuonCalib::IIdToFixedIdTool> m_idToFixedIdTool{this, "IdToFixedIdTool", "MuonCalib::IdToFixedIdTool"};
75 
78  bool ProcessString(const std::string &input);
82  void convert_to_tower(int station, int phi, int eta, std::vector<int> &tower) const;
83 };
84 
85 #endif
RegionSelectionSvc::initialize
StatusCode initialize()
initialize
Definition: RegionSelectionSvc.cxx:43
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
RegionSelectionSvc::convert_to_tower
void convert_to_tower(int station, int phi, int eta, std::vector< int > &tower) const
convert station, eta, phi in tower vector
run.infile
string infile
Definition: run.py:13
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
RegionSelectionSvc::m_region_string
Gaudi::Property< std::string > m_region_string
region string - job option
Definition: RegionSelectionSvc.h:63
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
RegionSelectionSvc::queryInterface
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvUnknown)
just some crazy atheta function
Definition: RegionSelectionSvc.cxx:31
RegionSelectionSvc::m_idToFixedIdTool
ToolHandle< MuonCalib::IIdToFixedIdTool > m_idToFixedIdTool
Definition: RegionSelectionSvc.h:74
RegionSelectionSvc
Definition: RegionSelectionSvc.h:35
RegionSelectionSvc::~RegionSelectionSvc
virtual ~RegionSelectionSvc()
destructor
RegionSelectionSvc::interfaceID
static const InterfaceID & interfaceID()
Definition: RegionSelectionSvc.h:41
RegionSelectionSvc::m_detMgr
const MuonGM::MuonDetectorManager * m_detMgr
Definition: RegionSelectionSvc.h:71
RegionSelectionSvc::ProcessString
bool ProcessString(const std::string &input)
process string
Definition: RegionSelectionSvc.cxx:144
NtupleStationId.h
RegionSelectionSvc::m_stations_in_region
std::vector< MuonCalib::NtupleStationId > m_stations_in_region
chambers/mutlilayers in calibraition region
Definition: RegionSelectionSvc.h:69
RegionSelectionSvc::isInRegion
bool isInRegion(const MuonCalib::MuonFixedId &id) const
return true if id is in selected region
Definition: RegionSelectionSvc.cxx:63
RegionSelectionSvc::RegionSelectionSvc
RegionSelectionSvc(const std::string &name, ISvcLocator *svc_locator)
contructor
Definition: RegionSelectionSvc.cxx:29
RegionSelectionSvc::GetStationsInRegions
const std::vector< MuonCalib ::NtupleStationId > & GetStationsInRegions() const
get stations/multilayers in region
Definition: RegionSelectionSvc.cxx:66
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthService
Definition: AthService.h:32
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition: CscCalcPed.cxx:22
RegionSelectionSvc::search_chambers_in_region
void search_chambers_in_region()
Definition: RegionSelectionSvc.cxx:106
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
RegionSelectionSvc::print_list_of_selected_chambers
void print_list_of_selected_chambers() const
print a list of selected chambers - debug function
Definition: RegionSelectionSvc.cxx:149
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
MuonCalib::MuonFixedId
Definition: MuonFixedId.h:50
RegionSelectionSvc::m_print_list_of_selected_chambers
Gaudi::Property< bool > m_print_list_of_selected_chambers
print list of selected chambers if set to true - job option
Definition: RegionSelectionSvc.h:65
RegionSelectionSvc::m_unique_chambers
std::set< MuonCalib::NtupleStationId > m_unique_chambers
Definition: RegionSelectionSvc.h:70
RegionSelectionSvc::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
search for chambers and multilayers in selected region towers in selected region
Definition: RegionSelectionSvc.h:73
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:50
AthService.h
RegionSelectionSvc::Print
void Print(std::ostream &os) const
debug print
Definition: RegionSelectionSvc.cxx:98
RegionSelectionSvc::m_master_region
std::unique_ptr< MuonCalib ::RegionSelectorBase > m_master_region
master region
Definition: RegionSelectionSvc.h:67
RegionSelectionSvc::AddRegionNtuples
int AddRegionNtuples(const std::string &infile, TChain *chain)
add region ntuples which are relevant for this region to TChain
Definition: RegionSelectionSvc.cxx:67
IMuonIdHelperSvc.h
IIdToFixedIdTool.h
RegionSelectionSvc::GetRegionSelection
const std::string & GetRegionSelection() const
get region selection
Definition: RegionSelectionSvc.cxx:65
ServiceHandle< Muon::IMuonIdHelperSvc >