Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:24:26

0001 // -*- C++ -*-
0002 //
0003 // Package:    HcalRecAlgoESProducer
0004 // Class:      HcalRecAlgoESProducer
0005 //
0006 /**\class HcalRecAlgoESProducer HcalRecAlgoESProducer.h TestSubsystem/HcalRecAlgoESProducer/src/HcalRecAlgoESProducer.cc
0007 
0008  Description: Producer for HcalSeverityLevelComputer, that delivers the severity level for HCAL cells
0009 
0010  Implementation:
0011      <Notes on implementation>
0012 */
0013 //
0014 // Original Author:  Radek Ofierzynski
0015 //         Created:  Mon Feb  9 10:59:46 CET 2009
0016 //
0017 //
0018 
0019 // system include files
0020 #include <memory>
0021 
0022 // user include files
0023 #include "FWCore/Framework/interface/ModuleFactory.h"
0024 #include "FWCore/Framework/interface/ESProducer.h"
0025 
0026 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0027 #include "RecoLocalCalo/HcalRecAlgos/interface/HcalSeverityLevelComputer.h"
0028 #include "RecoLocalCalo/HcalRecAlgos/interface/HcalSeverityLevelComputerRcd.h"
0029 
0030 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0031 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0032 
0033 //
0034 // class decleration
0035 //
0036 
0037 class HcalRecAlgoESProducer : public edm::ESProducer {
0038 public:
0039   HcalRecAlgoESProducer(const edm::ParameterSet&);
0040 
0041   ~HcalRecAlgoESProducer() override;
0042 
0043   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0044 
0045   typedef std::unique_ptr<HcalSeverityLevelComputer> ReturnType;
0046 
0047   ReturnType produce(const HcalSeverityLevelComputerRcd&);
0048 
0049 private:
0050   // ----------member data ---------------------------
0051   const edm::ParameterSet mConfig;
0052 };
0053 
0054 //
0055 // constants, enums and typedefs
0056 //
0057 
0058 //
0059 // static data member definitions
0060 //
0061 
0062 //
0063 // constructors and destructor
0064 //
0065 HcalRecAlgoESProducer::HcalRecAlgoESProducer(const edm::ParameterSet& iConfig) : mConfig(iConfig) {
0066   //the following line is needed to tell the framework what
0067   // data is being produced
0068   setWhatProduced(this);
0069 
0070   //now do what ever other initialization is needed
0071 }
0072 
0073 HcalRecAlgoESProducer::~HcalRecAlgoESProducer() {
0074   // do anything here that needs to be done at desctruction time
0075   // (e.g. close files, deallocate resources etc.)
0076 }
0077 
0078 //
0079 // member functions
0080 //
0081 
0082 // ------------ method called to produce the data  ------------
0083 HcalRecAlgoESProducer::ReturnType HcalRecAlgoESProducer::produce(const HcalSeverityLevelComputerRcd& iRecord) {
0084   using namespace edm::es;
0085   return std::make_unique<HcalSeverityLevelComputer>(mConfig);
0086 }
0087 
0088 void HcalRecAlgoESProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0089   edm::ParameterSetDescription desc;
0090   desc.add<unsigned int>("phase", 0);
0091   desc.add<std::vector<std::string>>("RecoveredRecHitBits",
0092                                      {
0093                                          "TimingAddedBit",
0094                                          "TimingSubtractedBit",
0095                                      });
0096   {
0097     edm::ParameterSetDescription vpsd1;
0098     vpsd1.add<std::vector<std::string>>("RecHitFlags",
0099                                         {
0100                                             "",
0101                                         });
0102     vpsd1.add<std::vector<std::string>>("ChannelStatus",
0103                                         {
0104                                             "",
0105                                         });
0106     vpsd1.add<int>("Level", 0);
0107     std::vector<edm::ParameterSet> temp1;
0108     temp1.reserve(8);
0109     {
0110       edm::ParameterSet temp2;
0111       temp2.addParameter<std::vector<std::string>>("RecHitFlags",
0112                                                    {
0113                                                        "",
0114                                                    });
0115       temp2.addParameter<std::vector<std::string>>("ChannelStatus",
0116                                                    {
0117                                                        "",
0118                                                    });
0119       temp2.addParameter<int>("Level", 0);
0120       temp1.push_back(temp2);
0121     }
0122     {
0123       edm::ParameterSet temp2;
0124       temp2.addParameter<std::vector<std::string>>("RecHitFlags",
0125                                                    {
0126                                                        "",
0127                                                    });
0128       temp2.addParameter<std::vector<std::string>>("ChannelStatus",
0129                                                    {
0130                                                        "HcalCellCaloTowerProb",
0131                                                    });
0132       temp2.addParameter<int>("Level", 1);
0133       temp1.push_back(temp2);
0134     }
0135     {
0136       edm::ParameterSet temp2;
0137       temp2.addParameter<std::vector<std::string>>("RecHitFlags",
0138                                                    {
0139                                                        "HSCP_R1R2",
0140                                                        "HSCP_FracLeader",
0141                                                        "HSCP_OuterEnergy",
0142                                                        "HSCP_ExpFit",
0143                                                        "ADCSaturationBit",
0144                                                        "HBHEIsolatedNoise",
0145                                                        "AddedSimHcalNoise",
0146                                                    });
0147       temp2.addParameter<std::vector<std::string>>("ChannelStatus",
0148                                                    {
0149                                                        "HcalCellExcludeFromHBHENoiseSummary",
0150                                                    });
0151       temp2.addParameter<int>("Level", 5);
0152       temp1.push_back(temp2);
0153     }
0154     {
0155       edm::ParameterSet temp2;
0156       temp2.addParameter<std::vector<std::string>>("RecHitFlags",
0157                                                    {
0158                                                        "HBHEHpdHitMultiplicity",
0159                                                        "HBHEPulseShape",
0160                                                        "HOBit",
0161                                                        "HFDigiTime",
0162                                                        "HFInTimeWindow",
0163                                                        "ZDCBit",
0164                                                        "CalibrationBit",
0165                                                        "TimingErrorBit",
0166                                                        "HBHEFlatNoise",
0167                                                        "HBHESpikeNoise",
0168                                                        "HBHETriangleNoise",
0169                                                        "HBHETS4TS5Noise",
0170                                                        "HBHENegativeNoise",
0171                                                        "HBHEOOTPU",
0172                                                    });
0173       temp2.addParameter<std::vector<std::string>>("ChannelStatus",
0174                                                    {
0175                                                        "",
0176                                                    });
0177       temp2.addParameter<int>("Level", 8);
0178       temp1.push_back(temp2);
0179     }
0180     {
0181       edm::ParameterSet temp2;
0182       temp2.addParameter<std::vector<std::string>>("RecHitFlags",
0183                                                    {
0184                                                        "HFLongShort",
0185                                                        "HFPET",
0186                                                        "HFS8S1Ratio",
0187                                                    });
0188       temp2.addParameter<std::vector<std::string>>("ChannelStatus",
0189                                                    {
0190                                                        "",
0191                                                    });
0192       temp2.addParameter<int>("Level", 11);
0193       temp1.push_back(temp2);
0194     }
0195     {
0196       edm::ParameterSet temp2;
0197       temp2.addParameter<std::vector<std::string>>("RecHitFlags",
0198                                                    {
0199                                                        "",
0200                                                    });
0201       temp2.addParameter<std::vector<std::string>>("ChannelStatus",
0202                                                    {
0203                                                        "HcalCellCaloTowerMask",
0204                                                    });
0205       temp2.addParameter<int>("Level", 12);
0206       temp1.push_back(temp2);
0207     }
0208     {
0209       edm::ParameterSet temp2;
0210       temp2.addParameter<std::vector<std::string>>("RecHitFlags",
0211                                                    {
0212                                                        "",
0213                                                    });
0214       temp2.addParameter<std::vector<std::string>>("ChannelStatus",
0215                                                    {
0216                                                        "HcalCellHot",
0217                                                    });
0218       temp2.addParameter<int>("Level", 15);
0219       temp1.push_back(temp2);
0220     }
0221     {
0222       edm::ParameterSet temp2;
0223       temp2.addParameter<std::vector<std::string>>("RecHitFlags",
0224                                                    {
0225                                                        "",
0226                                                    });
0227       temp2.addParameter<std::vector<std::string>>("ChannelStatus",
0228                                                    {
0229                                                        "HcalCellOff",
0230                                                        "HcalCellDead",
0231                                                    });
0232       temp2.addParameter<int>("Level", 20);
0233       temp1.push_back(temp2);
0234     }
0235     desc.addVPSet("SeverityLevels", vpsd1, temp1);
0236   }
0237   desc.add<std::vector<std::string>>("DropChannelStatusBits",
0238                                      {
0239                                          "HcalCellMask",
0240                                          "HcalCellOff",
0241                                          "HcalCellDead",
0242                                      });
0243   descriptions.add("hcalRecAlgos", desc);
0244 }
0245 
0246 //define this as a plug-in
0247 DEFINE_FWK_EVENTSETUP_MODULE(HcalRecAlgoESProducer);