Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:20:10

0001 #ifndef _RECOMET_METPRODUCER_HCALNOISEINFOPRODUCER_H_
0002 #define _RECOMET_METPRODUCER_HCALNOISEINFOPRODUCER_H_
0003 
0004 //
0005 // HcalNoiseInfoProducer.h
0006 //
0007 //   description: Definition of the producer for the HCAL noise information.
0008 //                Uses various algorithms to process digis, rechits, and calotowers
0009 //                and produce a vector of HcalNoiseRBXs.
0010 //                To minimize the time used to sort the data into HPD/RBX space, we fill
0011 //                an rbxarray of size 72, and then pick which rbxs are interesting at
0012 //                the end.
0013 //
0014 //   author: J.P. Chou, Brown
0015 //
0016 
0017 // system include files
0018 #include <memory>
0019 
0020 // user include files
0021 #include "FWCore/Utilities/interface/ESGetToken.h"
0022 #include "FWCore/Utilities/interface/EDGetToken.h"
0023 #include "FWCore/Framework/interface/Frameworkfwd.h"
0024 #include "FWCore/Framework/interface/stream/EDProducer.h"
0025 #include "FWCore/Framework/interface/Event.h"
0026 #include "FWCore/Framework/interface/MakerMacros.h"
0027 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0028 
0029 #include "RecoMET/METAlgorithms/interface/HcalNoiseAlgo.h"
0030 #include "RecoMET/METAlgorithms/interface/HcalNoiseRBXArray.h"
0031 #include "DataFormats/METReco/interface/HcalNoiseSummary.h"
0032 
0033 #include "RecoMET/METProducers/interface/HcalNoiseInfoProducer.h"
0034 #include "CalibFormats/HcalObjects/interface/HcalDbService.h"
0035 #include "CalibFormats/HcalObjects/interface/HcalDbRecord.h"
0036 #include "RecoLocalCalo/HcalRecAlgos/interface/HcalSeverityLevelComputer.h"
0037 #include "RecoLocalCalo/HcalRecAlgos/interface/HcalSeverityLevelComputerRcd.h"
0038 #include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
0039 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
0040 #include "DataFormats/CaloTowers/interface/CaloTowerCollection.h"
0041 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0042 #include "DataFormats/TrackReco/interface/Track.h"
0043 #include "DataFormats/JetReco/interface/PFJetCollection.h"
0044 
0045 #include "Geometry/CaloTopology/interface/HcalTopology.h"
0046 #include "Geometry/Records/interface/HcalRecNumberingRecord.h"
0047 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
0048 #include "Geometry/Records/interface/CaloGeometryRecord.h"
0049 
0050 namespace reco {
0051 
0052   //
0053   // class declaration
0054   //
0055 
0056   class HcalNoiseInfoProducer : public edm::stream::EDProducer<> {
0057   public:
0058     explicit HcalNoiseInfoProducer(const edm::ParameterSet&);
0059     ~HcalNoiseInfoProducer() override;
0060 
0061     static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0062 
0063   private:
0064     //
0065     // methods inherited from EDProducer
0066     // produce(...) fills an HcalNoiseRBXArray with information from various places, and then
0067     // picks which rbxs are interesting, storing them to the EDM.
0068     //
0069 
0070     void produce(edm::Event&, const edm::EventSetup&) override;
0071 
0072     //
0073     // more internal methods
0074     // fills an HcalNoiseRBXArray with various data
0075     // filldigis() depends on fillrechits() being called first
0076     //
0077     void fillrechits(edm::Event&, const edm::EventSetup&, HcalNoiseRBXArray&, HcalNoiseSummary&) const;
0078     void filldigis(edm::Event&, const edm::EventSetup&, HcalNoiseRBXArray&, HcalNoiseSummary&);
0079     void fillcalotwrs(edm::Event&, const edm::EventSetup&, HcalNoiseRBXArray&, HcalNoiseSummary&) const;
0080     void filltracks(edm::Event&, const edm::EventSetup&, HcalNoiseSummary&) const;
0081     void filljetinfo(edm::Event&, const edm::EventSetup&, HcalNoiseSummary&) const;
0082 
0083     // other helper functions
0084     void fillOtherSummaryVariables(HcalNoiseSummary& summary, const CommonHcalNoiseRBXData& data) const;
0085 
0086     //
0087     // parameters
0088     //
0089 
0090     bool fillDigis_;         // fill digi information into HcalNoiseRBXs
0091     bool fillRecHits_;       // fill rechit information into HcalNoiseRBXs and HcalNoiseSummary
0092     bool fillCaloTowers_;    // fill calotower information into HcalNoiseRBXs and HcalNoiseSummary
0093     bool fillTracks_;        // fill track information into HcalNoiseSummary
0094     bool fillLaserMonitor_;  // fill laser monitor information into HcalNoiseSummary
0095 
0096     // These provide the requirements for writing an RBX to the event
0097     int maxProblemRBXs_;  // maximum number of problematic RBXs to be written to the event record
0098 
0099     // parameters for calculating summary variables
0100     int maxCaloTowerIEta_;  // maximum caloTower ieta
0101     double maxTrackEta_;    // maximum eta of the track
0102     double minTrackPt_;     // minimum track Pt
0103     double maxNHF_;
0104     int maxjetindex_;
0105 
0106     const HcalTopology* theHcalTopology_;
0107 
0108     std::string digiCollName_;       // name of the digi collection
0109     std::string recHitCollName_;     // name of the rechit collection
0110     std::string caloTowerCollName_;  // name of the caloTower collection
0111     std::string trackCollName_;      // name of the track collection
0112     std::string jetCollName_;        // name of the jet collection
0113 
0114     edm::EDGetTokenT<HBHEDigiCollection> hbhedigi_token_;
0115     edm::EDGetTokenT<HcalCalibDigiCollection> hcalcalibdigi_token_;
0116     edm::EDGetTokenT<QIE10DigiCollection> lasermondigi_token_;
0117     edm::EDGetTokenT<HBHERecHitCollection> hbherechit_token_;
0118     edm::EDGetTokenT<CaloTowerCollection> calotower_token_;
0119     edm::EDGetTokenT<reco::TrackCollection> track_token_;
0120     edm::EDGetTokenT<reco::PFJetCollection> jet_token_;
0121     edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> hcaltopo_token_;
0122     edm::ESGetToken<HcalDbService, HcalDbRecord> service_token_;
0123     edm::ESGetToken<HcalChannelQuality, HcalChannelQualityRcd> quality_token_;
0124     edm::ESGetToken<HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd> severitycomputer_token_;
0125     edm::ESGetToken<CaloGeometry, CaloGeometryRecord> calogeometry_token_;
0126 
0127     double totalCalibCharge;   // placeholder to calculate total charge in calibration channels
0128     double totalLasmonCharge;  // placeholder to calculate total charge in laser monitor channels
0129 
0130     double minRecHitE_, minLowHitE_, minHighHitE_, minR45HitE_;  // parameters used to determine noise status
0131     HcalNoiseAlgo algo_;                                         // algorithms to determine if an RBX is noisy
0132 
0133     bool useCalibDigi_;
0134 
0135     // Variables to store info regarding HBHE calibration digis
0136     double calibdigiHBHEthreshold_;             // minimum charge calib digi in order to be counted by noise algorithm
0137     std::vector<int> calibdigiHBHEtimeslices_;  // time slices to use when computing calibration charge
0138     // Variables to store info regarding HF calibration digis
0139     double calibdigiHFthreshold_;
0140     std::vector<int> calibdigiHFtimeslices_;
0141 
0142     double TS4TS5EnergyThreshold_;
0143     std::vector<std::pair<double, double> > TS4TS5UpperCut_;
0144     std::vector<std::pair<double, double> > TS4TS5LowerCut_;
0145 
0146     uint32_t HcalAcceptSeverityLevel_;
0147     std::vector<int> HcalRecHitFlagsToBeExcluded_;
0148 
0149     std::vector<int> laserMonCBoxList_;
0150     std::vector<int> laserMonIPhiList_;
0151     std::vector<int> laserMonIEtaList_;
0152 
0153     int laserMonitorTSStart_;
0154     int laserMonitorTSEnd_;
0155     unsigned laserMonitorSamples_;
0156 
0157     std::vector<float> adc2fC;
0158     std::vector<float> adc2fCHF;
0159   };
0160 
0161 }  // namespace reco
0162 
0163 #endif