Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:39

0001 /**
0002   * \file InvRingCalib.h
0003   * \class InvRingCalib
0004   * \brief ECAL TB 2006 calibration with matrix inversion technique
0005   * \author 
0006   *
0007 */
0008 #ifndef __CINT__
0009 #ifndef InvRingCalib_H
0010 #define InvRingCalib_H
0011 #include "Calibration/EcalCalibAlgos/interface/VEcalCalibBlock.h"
0012 #include "FWCore/Framework/interface/EDLooper.h"
0013 #include "FWCore/Framework/interface/Event.h"
0014 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0015 #include "DataFormats/DetId/interface/DetId.h"
0016 #include "DataFormats/CaloRecHit/interface/CaloRecHit.h"
0017 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0018 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
0019 #include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
0020 #include "FWCore/Framework/interface/EventSetup.h"
0021 #include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h"
0022 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
0023 #include "Geometry/Records/interface/CaloGeometryRecord.h"
0024 
0025 #include <string>
0026 #include <vector>
0027 
0028 #include "Calibration/EcalCalibAlgos/interface/VFillMap.h"
0029 
0030 class InvRingCalib : public edm::EDLooper {
0031 public:
0032   //! ctor
0033   explicit InvRingCalib(const edm::ParameterSet &);
0034   //! dtor
0035   ~InvRingCalib() override;
0036   void beginOfJob() override;
0037   void endOfJob() override;
0038   void startingNewLoop(unsigned int) override;
0039   Status duringLoop(const edm::Event &, const edm::EventSetup &) override;
0040   Status endOfLoop(const edm::EventSetup &, unsigned int iCounter) override;
0041 
0042   //end
0043 
0044 private:
0045   //!The number of regions in EE
0046   inline int EERegionNum() const;
0047   //!Number of regions in EB
0048   int EBRegionNum() const;
0049   //!Defines the regions in the barrel
0050   void EBRegionDef();
0051   //!Defines the rins in the endcap
0052   void EERingDef(const edm::EventSetup &);
0053   //!Defines the regions in the endcap
0054   void EERegionDef();
0055   //!Prepares the EB regions;
0056   void RegPrepare();
0057   //!Gives back in which region you are:
0058   int EBRegId(const int);
0059   //!gives back in which region of the endcap you are.
0060   int EERegId(int);
0061 
0062   //!The class that fills the map!
0063   VFillMap *m_MapFiller;
0064 
0065 private:
0066   //! EcalBarrel Input Collection name
0067   const edm::InputTag m_barrelAlCa;
0068   //! EcalEndcap Input Collection name
0069   const edm::InputTag m_endcapAlCa;
0070   //! To take the electrons
0071   const edm::InputTag m_ElectronLabel;
0072   //! reconstruction window size
0073   const int m_recoWindowSidex;
0074   const int m_recoWindowSidey;
0075   //! minimum energy per crystal cut
0076   const double m_minEnergyPerCrystal;
0077   //! maximum energy per crystal cut
0078   const double m_maxEnergyPerCrystal;
0079   //! eta start of the zone of interest
0080   const int m_etaStart;
0081   //! eta end of the zone of interest
0082   const int m_etaEnd;
0083   //! eta size of the regions
0084   const int m_etaWidth;
0085   //    std::map<int,float> m_eta;
0086   //! maximum number of events per Ring
0087   const int m_maxSelectedNumPerRing;
0088   //! number of events already read per Ring
0089   std::map<int, int> m_RingNumOfHits;
0090   //! single blocks calibrators
0091   std::vector<VEcalCalibBlock *> m_IMACalibBlocks;
0092   //! minimum coefficient accepted (RAW)
0093   const double m_minCoeff;
0094   //! maximum coefficient accepted (RAW)
0095   const double m_maxCoeff;
0096   //! to exclude the blocksolver
0097   const int m_usingBlockSolver;
0098   //!position of the cell, borders, coords etc...
0099   std::map<int, GlobalPoint> m_cellPos;
0100   std::map<int, int> m_cellPhi;
0101   //!association map between coeff and ring
0102   //!coeffs for the single xtals
0103   EcalIntercalibConstantMap m_barrelMap;
0104   EcalIntercalibConstantMap m_endcapMap;
0105   //! LP sets the number of loops to do
0106   unsigned int m_loops;
0107   //! LP define the EE region to calibrate
0108   const int m_startRing;
0109   const int m_endRing;
0110   //!association map between Raw detIds and Rings
0111   std::map<int, int> m_xtalRing;
0112   //!association map between  raw detIds and Region
0113   std::map<int, int> m_xtalRegionId;
0114   //!association map between raw detIds and the number of the ring inside the region
0115   std::map<int, int> m_RinginRegion;
0116 
0117   //! geometry things used all over the file
0118   std::vector<DetId> m_barrelCells;
0119   std::vector<DetId> m_endcapCells;
0120   //!coeffs filenames
0121   const std::string m_EBcoeffFile;
0122   const std::string m_EEcoeffFile;
0123   //!endcap zone to be calibrated
0124   const int m_EEZone;
0125   //!EB regions vs. eta index
0126   std::map<int, int> m_Reg;
0127   std::string m_mapFillerType;
0128   bool isfirstcall_;
0129 
0130   //! ED token
0131   const edm::EDGetTokenT<EBRecHitCollection> m_ebRecHitToken;
0132   const edm::EDGetTokenT<EERecHitCollection> m_eeRecHitToken;
0133   const edm::EDGetTokenT<reco::GsfElectronCollection> m_gsfElectronToken;
0134   //! ES token
0135   const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> m_geometryToken;
0136 };
0137 #endif
0138 #endif