Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:34:17

0001 #ifndef Calibration_EcalCalibAlgos_Pi0FixedMassWindowCalibration_h
0002 #define Calibration_EcalCalibAlgos_Pi0FixedMassWindowCalibration_h
0003 
0004 #include <memory>
0005 #include <string>
0006 #include <iostream>
0007 
0008 #include <vector>
0009 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0010 
0011 // Framework
0012 #include "FWCore/Framework/interface/LooperFactory.h"
0013 #include "FWCore/Framework/interface/ESProducerLooper.h"
0014 #include "FWCore/Framework/interface/Frameworkfwd.h"
0015 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0016 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0017 #include "FWCore/Framework/interface/Event.h"
0018 #include "FWCore/Framework/interface/EventSetup.h"
0019 
0020 #include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h"
0021 #include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h"
0022 
0023 #include "DataFormats/EcalRecHit/interface/EcalRecHit.h"
0024 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0025 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
0026 #include "DataFormats/EcalDetId/interface/EBDetId.h"
0027 #include "DataFormats/EcalDetId/interface/EEDetId.h"
0028 #include "DataFormats/EcalDetId/interface/ESDetId.h"
0029 #include "DataFormats/DetId/interface/DetId.h"
0030 
0031 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
0032 #include "Geometry/Records/interface/CaloGeometryRecord.h"
0033 
0034 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0035 #include "RecoEcal/EgammaClusterAlgos/interface/IslandClusterAlgo.h"
0036 #include "RecoEcal/EgammaCoreTools/interface/PositionCalc.h"
0037 #include "RecoEcal/EgammaCoreTools/interface/ClusterShapeAlgo.h"
0038 
0039 #include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h"
0040 
0041 class Pi0FixedMassWindowCalibration : public edm::ESProducerLooper {
0042 public:
0043   /// Constructor
0044   Pi0FixedMassWindowCalibration(const edm::ParameterSet& iConfig);
0045 
0046   /// Destructor
0047   ~Pi0FixedMassWindowCalibration() override;
0048 
0049   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0050 
0051   /// Dummy implementation (job done in duringLoop)
0052   virtual void produce(edm::Event&, const edm::EventSetup&){};
0053 
0054   /// Called at beginning of job
0055   void beginOfJob() override;
0056 
0057   /// Called at end of job
0058   void endOfJob() override;
0059 
0060   /// Called at beginning of loop
0061   void startingNewLoop(unsigned int iLoop) override;
0062 
0063   /// Called at end of loop
0064   Status endOfLoop(const edm::EventSetup&, unsigned int iLoop) override;
0065 
0066   /// Called at each event
0067   Status duringLoop(const edm::Event&, const edm::EventSetup&) override;
0068 
0069 private:
0070   //  static const double PDGPi0Mass;
0071 
0072   int nevent;
0073 
0074   const unsigned int theMaxLoops;
0075   const std::string ecalHitsProducer_;
0076   const std::string barrelHits_;
0077 
0078   IslandClusterAlgo::VerbosityLevel verbosity;
0079 
0080   std::string barrelHitProducer_;
0081   std::string barrelHitCollection_;
0082   std::string barrelClusterCollection_;
0083   std::string clustershapecollectionEB_;
0084   std::string barrelClusterShapeAssociation_;
0085 
0086   PositionCalc posCalculator_;  // position calculation algorithm
0087   ClusterShapeAlgo shapeAlgo_;  // cluster shape algorithm
0088   IslandClusterAlgo* island_p;
0089 
0090   // Selection algorithm parameters
0091   double selePi0PtGammaOneMin_;
0092   double selePi0PtGammaTwoMin_;
0093 
0094   double selePi0DRBelt_;
0095   double selePi0DetaBelt_;
0096 
0097   double selePi0PtPi0Min_;
0098 
0099   double selePi0S4S9GammaOneMin_;
0100   double selePi0S4S9GammaTwoMin_;
0101   double selePi0S9S25GammaOneMin_;
0102   double selePi0S9S25GammaTwoMin_;
0103 
0104   double selePi0EtBeltIsoRatioMax_;
0105 
0106   double selePi0MinvMeanFixed_;
0107   double selePi0MinvSigmaFixed_;
0108 
0109   std::vector<DetId> barrelCells;
0110 
0111   // input calibration constants
0112   double oldCalibs_barl[85][360][2];
0113   double newCalibs_barl[85][360][2];
0114   double wxtals[85][360][2];
0115   double mwxtals[85][360][2];
0116 
0117   // steering parameters
0118 
0119   edm::ParameterSet theParameterSet;
0120 
0121   // map for all RecHits from ECal:
0122   std::map<DetId, EcalRecHit>* recHitsEB_map;
0123 
0124   const EcalRecHitCollection* ecalRecHitBarrelCollection;
0125   const EcalRecHitCollection* recalibEcalRecHitCollection;
0126 
0127   const edm::EDGetTokenT<EcalRecHitCollection> recHitToken_;
0128   const edm::ESGetToken<EcalIntercalibConstants, EcalIntercalibConstantsRcd> intercalibConstantsToken_;
0129   const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> geometryToken_;
0130 
0131   bool isfirstcall_;
0132 };
0133 
0134 #endif