CMS 3D CMS Logo

TkModuleGroupSelector.h
Go to the documentation of this file.
1 #ifndef Alignment_CommonAlignmentAlgorithm_TkModuleGroupSelector_h
2 #define Alignment_CommonAlignmentAlgorithm_TkModuleGroupSelector_h
3 
21 
22 #include <vector>
23 #include <map>
24 #include <list>
25 
26 class AlignableTracker;
27 class AlignableMuon;
28 class AlignableExtras;
29 
30 namespace edm {
31  class EventSetup;
32  class ParameterSet;
33 } // namespace edm
34 
36 public:
38  explicit TkModuleGroupSelector(AlignableTracker *aliTracker,
39  const edm::ParameterSet &cfg,
40  const std::vector<int> &sdets);
41 
44 
45  // Returns the number of parameters.
46  unsigned int getNumberOfParameters() const;
47 
49  unsigned int numIovs() const;
50 
52  edm::RunNumber_t firstRunOfIOV(unsigned int iovNum) const;
53 
56  int getParameterIndexFromDetId(unsigned int detId, edm::RunNumber_t run) const;
57 
58 private:
59  // Constructs the run-dependent module groups from configuration parameters.
60  void createModuleGroups(AlignableTracker *aliTracker,
61  const edm::VParameterSet &granularityConfig,
62  const std::vector<edm::RunNumber_t> &defaultRunRange,
63  edm::RunNumber_t defaultReferenceRun);
64 
65  // Method used to test the provided configuration for unknown parameters
66  void verifyParameterNames(const edm::ParameterSet &pset, unsigned int psetnr) const;
67 
68  // Method to test whether the split option has been turned on
69  const bool testSplitOption(const edm::ParameterSet &pset) const;
70 
71  // Add modules to a specific group which is also created in this function.
72  bool createGroup(unsigned int &Id, //id of the first run
73  const std::vector<edm::RunNumber_t> &range, //run range
74  const std::list<Alignable *> &selected_alis, //list of alignables for which a group is created
75  const edm::RunNumber_t refrun //reference run number
76  );
77 
78  // Fill the container which is a map between the det id and the id of the group
79  // to which the module belongs.
80  void fillDetIdMap(const unsigned int detid, const unsigned int groupid);
81 
82  // Array with run boundaries which is a combination
83  // of all defined run ranges of all specified module groups.
84  std::vector<edm::RunNumber_t> globalRunRange_;
85 
86  // For a given module group the id of the first IOV.
87  std::vector<unsigned int> firstId_;
88 
89  // Run range per module group
90  std::vector<std::vector<edm::RunNumber_t> > runRange_;
91 
92  // Mapping between module id and module group id.
93  std::map<unsigned int, unsigned int> mapDetIdGroupId_;
94 
95  // Total number of parameters.
96  unsigned int nparameters_;
97 
98  // The ids of the subdetectors for which parameters are determined.
99  std::vector<int> subdetids_;
100 
101  // Reference run per module group
102  std::vector<edm::RunNumber_t> referenceRun_;
103 };
104 
105 #endif
TkModuleGroupSelector::globalRunRange_
std::vector< edm::RunNumber_t > globalRunRange_
Definition: TkModuleGroupSelector.h:84
edm::RunNumber_t
unsigned int RunNumber_t
Definition: RunLumiEventNumber.h:14
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
TkModuleGroupSelector::~TkModuleGroupSelector
virtual ~TkModuleGroupSelector()
Destructor.
Definition: TkModuleGroupSelector.h:43
edm
HLT enums.
Definition: AlignableModifier.h:19
TkModuleGroupSelector::getParameterIndexFromDetId
int getParameterIndexFromDetId(unsigned int detId, edm::RunNumber_t run) const
Definition: TkModuleGroupSelector.cc:210
TkModuleGroupSelector::runRange_
std::vector< std::vector< edm::RunNumber_t > > runRange_
Definition: TkModuleGroupSelector.h:90
TkModuleGroupSelector::firstId_
std::vector< unsigned int > firstId_
Definition: TkModuleGroupSelector.h:87
edm::VParameterSet
std::vector< ParameterSet > VParameterSet
Definition: ParameterSet.h:34
TkModuleGroupSelector::firstRunOfIOV
edm::RunNumber_t firstRunOfIOV(unsigned int iovNum) const
First run of iov (0 if iovNum not treated).
Definition: TkModuleGroupSelector.cc:205
TkModuleGroupSelector::numIovs
unsigned int numIovs() const
Total number of IOVs.
Definition: TkModuleGroupSelector.cc:202
TkModuleGroupSelector::TkModuleGroupSelector
TkModuleGroupSelector(AlignableTracker *aliTracker, const edm::ParameterSet &cfg, const std::vector< int > &sdets)
Constructor.
Definition: TkModuleGroupSelector.cc:22
AlignableTracker
Definition: AlignableTracker.h:17
TkModuleGroupSelector::createGroup
bool createGroup(unsigned int &Id, const std::vector< edm::RunNumber_t > &range, const std::list< Alignable * > &selected_alis, const edm::RunNumber_t refrun)
Definition: TkModuleGroupSelector.cc:74
AlignableExtras
Definition: AlignableExtras.h:19
TkModuleGroupSelector::referenceRun_
std::vector< edm::RunNumber_t > referenceRun_
Definition: TkModuleGroupSelector.h:102
TkModuleGroupSelector::fillDetIdMap
void fillDetIdMap(const unsigned int detid, const unsigned int groupid)
Definition: TkModuleGroupSelector.cc:52
edm::ParameterSet
Definition: ParameterSet.h:47
ParameterSet
Definition: Functions.h:16
TkModuleGroupSelector::nparameters_
unsigned int nparameters_
Definition: TkModuleGroupSelector.h:96
AlignableMuon
Constructor of the full muon geometry.
Definition: AlignableMuon.h:38
TkModuleGroupSelector
Definition: TkModuleGroupSelector.h:35
TkModuleGroupSelector::mapDetIdGroupId_
std::map< unsigned int, unsigned int > mapDetIdGroupId_
Definition: TkModuleGroupSelector.h:93
looper.cfg
cfg
Definition: looper.py:297
TkModuleGroupSelector::createModuleGroups
void createModuleGroups(AlignableTracker *aliTracker, const edm::VParameterSet &granularityConfig, const std::vector< edm::RunNumber_t > &defaultRunRange, edm::RunNumber_t defaultReferenceRun)
Definition: TkModuleGroupSelector.cc:120
writedatasetfile.run
run
Definition: writedatasetfile.py:27
TkModuleGroupSelector::subdetids_
std::vector< int > subdetids_
Definition: TkModuleGroupSelector.h:99
Alignable.h
EventSetup
ParameterSet.h
TkModuleGroupSelector::getNumberOfParameters
unsigned int getNumberOfParameters() const
Definition: TkModuleGroupSelector.cc:199
TkModuleGroupSelector::verifyParameterNames
void verifyParameterNames(const edm::ParameterSet &pset, unsigned int psetnr) const
Definition: TkModuleGroupSelector.cc:106
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
TkModuleGroupSelector::testSplitOption
const bool testSplitOption(const edm::ParameterSet &pset) const
Definition: TkModuleGroupSelector.cc:65