Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 10:03:37

0001 // -*- C++ -*-
0002 //
0003 // Class:      EcalTrigPrimAnalyzer
0004 //
0005 /**\class EcalTrigPrimAnalyzer
0006 
0007  Description: rereads the result of the EcalTrigPrimProducer
0008 
0009 */
0010 //
0011 // Original Author:  Ursula Berthon
0012 //         Created:  Thu Jul 4 11:38:38 CEST 2005
0013 //
0014 //
0015 
0016 // system include files
0017 //#include "FWCore/Framework/interface/Frameworkfwd.h"
0018 #include "CommonTools/UtilAlgos/interface/TFileService.h"
0019 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0020 #include "FWCore/Framework/interface/Event.h"
0021 #include "FWCore/Framework/interface/EventSetup.h"
0022 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0023 #include "FWCore/Utilities/interface/InputTag.h"
0024 #include "FWCore/Utilities/interface/ESGetToken.h"
0025 #include "FWCore/ServiceRegistry/interface/Service.h"
0026 #include "CalibCalorimetry/EcalTPGTools/interface/EcalTPGScale.h"
0027 
0028 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
0029 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0030 
0031 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
0032 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
0033 #include "Geometry/CaloTopology/interface/EcalTrigTowerConstituentsMap.h"
0034 #include "Geometry/Records/interface/CaloGeometryRecord.h"
0035 #include "Geometry/Records/interface/IdealGeometryRecord.h"
0036 #include "Geometry/Records/interface/EcalBarrelGeometryRecord.h"
0037 #include "Geometry/Records/interface/EcalEndcapGeometryRecord.h"
0038 
0039 #include <TH1F.h>
0040 #include <TH1I.h>
0041 #include <TH2F.h>
0042 #include <TTree.h>
0043 #include <string>
0044 #include <vector>
0045 
0046 //
0047 // class declaration
0048 //
0049 
0050 class EcalTrigPrimAnalyzer : public edm::one::EDAnalyzer<edm::one::SharedResources> {
0051 public:
0052   explicit EcalTrigPrimAnalyzer(const edm::ParameterSet &);
0053   ~EcalTrigPrimAnalyzer() override = default;
0054 
0055   void analyze(const edm::Event &, const edm::EventSetup &) override;
0056 
0057 private:
0058   // for histos of nr of hits
0059   std::vector<std::string> ecal_parts_;
0060   TH1I *ecal_et_[2];
0061   TH1I *ecal_tt_[2];
0062   TH1I *ecal_fgvb_[2];
0063   TH1I *histEndc, *histBar;
0064   TH2F *hTPvsRechit_;
0065   TH1F *hTPoverRechit_;
0066   TTree *tree_;
0067 
0068   int iphi_, ieta_, tpgADC_, ttf_, fg_;
0069   float eRec_, tpgGeV_;
0070 
0071   const bool recHits_;
0072   const edm::InputTag label_;
0073   const edm::InputTag rechits_labelEB_;
0074   const edm::InputTag rechits_labelEE_;
0075   const edm::EDGetTokenT<EcalTrigPrimDigiCollection> tpToken_;
0076   const edm::EDGetTokenT<EcalRecHitCollection> ebToken_;
0077   const edm::EDGetTokenT<EcalRecHitCollection> eeToken_;
0078   edm::ESGetToken<CaloSubdetectorGeometry, EcalEndcapGeometryRecord> endcapGeomToken_;
0079   edm::ESGetToken<CaloSubdetectorGeometry, EcalBarrelGeometryRecord> barrelGeomToken_;
0080   edm::ESGetToken<EcalTrigTowerConstituentsMap, IdealGeometryRecord> eTTmapToken_;
0081   EcalTPGScale::Tokens tokens_;
0082 };