Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:50:10

0001 #ifndef UtilAlgos_AndSelector_h
0002 #define UtilAlgos_AndSelector_h
0003 #include "FWCore/Framework/interface/ConsumesCollector.h"
0004 #include "FWCore/ParameterSet/interface/ParameterSetfwd.h"
0005 #include "CommonTools/UtilAlgos/interface/ParameterAdapter.h"
0006 #include "CommonTools/Utils/interface/AndSelector.h"
0007 
0008 namespace reco {
0009   namespace modules {
0010 
0011     template <typename S1, typename S2, typename S3, typename S4, typename S5>
0012     struct ParameterAdapter<AndSelector<S1, S2, S3, S4, S5> > {
0013       static AndSelector<S1, S2, S3, S4, S5> make(const edm::ParameterSet& cfg) {
0014         return AndSelector<S1, S2, S3, S4, S5>(modules::make<S1>(cfg),
0015                                                modules::make<S2>(cfg),
0016                                                modules::make<S3>(cfg),
0017                                                modules::make<S4>(cfg),
0018                                                modules::make<S5>(cfg));
0019       }
0020       static AndSelector<S1, S2, S3, S4, S5> make(const edm::ParameterSet& cfg, edm::ConsumesCollector&& iC) {
0021         return AndSelector<S1, S2, S3, S4, S5>(modules::make<S1>(cfg, iC),
0022                                                modules::make<S2>(cfg, iC),
0023                                                modules::make<S3>(cfg, iC),
0024                                                modules::make<S4>(cfg, iC),
0025                                                modules::make<S5>(cfg, iC));
0026       }
0027       static AndSelector<S1, S2, S3, S4, S5> make(const edm::ParameterSet& cfg, edm::ConsumesCollector& iC) {
0028         return AndSelector<S1, S2, S3, S4, S5>(modules::make<S1>(cfg, iC),
0029                                                modules::make<S2>(cfg, iC),
0030                                                modules::make<S3>(cfg, iC),
0031                                                modules::make<S4>(cfg, iC),
0032                                                modules::make<S5>(cfg, iC));
0033       }
0034 
0035       static void fillPSetDescription(edm::ParameterSetDescription& desc) {
0036         modules::fillPSetDescription<S1>(desc);
0037         modules::fillPSetDescription<S2>(desc);
0038         modules::fillPSetDescription<S3>(desc);
0039         modules::fillPSetDescription<S4>(desc);
0040         modules::fillPSetDescription<S5>(desc);
0041       }
0042     };
0043 
0044     template <typename S1, typename S2, typename S3, typename S4>
0045     struct ParameterAdapter<AndSelector<S1, S2, S3, S4> > {
0046       static AndSelector<S1, S2, S3, S4> make(const edm::ParameterSet& cfg) {
0047         return AndSelector<S1, S2, S3, S4>(
0048             modules::make<S1>(cfg), modules::make<S2>(cfg), modules::make<S3>(cfg), modules::make<S4>(cfg));
0049       }
0050       static AndSelector<S1, S2, S3, S4> make(const edm::ParameterSet& cfg, edm::ConsumesCollector&& iC) {
0051         return AndSelector<S1, S2, S3, S4>(modules::make<S1>(cfg, iC),
0052                                            modules::make<S2>(cfg, iC),
0053                                            modules::make<S3>(cfg, iC),
0054                                            modules::make<S4>(cfg, iC));
0055       }
0056       static AndSelector<S1, S2, S3, S4> make(const edm::ParameterSet& cfg, edm::ConsumesCollector& iC) {
0057         return AndSelector<S1, S2, S3, S4>(modules::make<S1>(cfg, iC),
0058                                            modules::make<S2>(cfg, iC),
0059                                            modules::make<S3>(cfg, iC),
0060                                            modules::make<S4>(cfg, iC));
0061       }
0062 
0063       static void fillPSetDescription(edm::ParameterSetDescription& desc) {
0064         modules::fillPSetDescription<S1>(desc);
0065         modules::fillPSetDescription<S2>(desc);
0066         modules::fillPSetDescription<S3>(desc);
0067         modules::fillPSetDescription<S4>(desc);
0068       }
0069     };
0070 
0071     template <typename S1, typename S2, typename S3>
0072     struct ParameterAdapter<AndSelector<S1, S2, S3> > {
0073       static AndSelector<S1, S2, S3> make(const edm::ParameterSet& cfg) {
0074         return AndSelector<S1, S2, S3>(modules::make<S1>(cfg), modules::make<S2>(cfg), modules::make<S3>(cfg));
0075       }
0076       static AndSelector<S1, S2, S3> make(const edm::ParameterSet& cfg, edm::ConsumesCollector&& iC) {
0077         return AndSelector<S1, S2, S3>(
0078             modules::make<S1>(cfg, iC), modules::make<S2>(cfg, iC), modules::make<S3>(cfg, iC));
0079       }
0080       static AndSelector<S1, S2, S3> make(const edm::ParameterSet& cfg, edm::ConsumesCollector& iC) {
0081         return AndSelector<S1, S2, S3>(
0082             modules::make<S1>(cfg, iC), modules::make<S2>(cfg, iC), modules::make<S3>(cfg, iC));
0083       }
0084 
0085       static void fillPSetDescription(edm::ParameterSetDescription& desc) {
0086         modules::fillPSetDescription<S1>(desc);
0087         modules::fillPSetDescription<S2>(desc);
0088         modules::fillPSetDescription<S3>(desc);
0089       }
0090     };
0091 
0092     template <typename S1, typename S2>
0093     struct ParameterAdapter<AndSelector<S1, S2> > {
0094       static AndSelector<S1, S2> make(const edm::ParameterSet& cfg) {
0095         return AndSelector<S1, S2>(modules::make<S1>(cfg), modules::make<S2>(cfg));
0096       }
0097       static AndSelector<S1, S2> make(const edm::ParameterSet& cfg, edm::ConsumesCollector&& iC) {
0098         return AndSelector<S1, S2>(modules::make<S1>(cfg, iC), modules::make<S2>(cfg, iC));
0099       }
0100       static AndSelector<S1, S2> make(const edm::ParameterSet& cfg, edm::ConsumesCollector& iC) {
0101         return AndSelector<S1, S2>(modules::make<S1>(cfg, iC), modules::make<S2>(cfg, iC));
0102       }
0103 
0104       static void fillPSetDescription(edm::ParameterSetDescription& desc) {
0105         modules::fillPSetDescription<S1>(desc);
0106         modules::fillPSetDescription<S2>(desc);
0107       }
0108     };
0109 
0110   }  // namespace modules
0111 }  // namespace reco
0112 
0113 #endif