Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:14:21

0001 #ifndef AlcaBeamSpotManager_H
0002 #define AlcaBeamSpotManager_H
0003 
0004 /** \class AlcaBeamSpotManager
0005  *  No description available.
0006  *
0007  *  \author L. Uplegger F. Yumiceva - Fermilab
0008  */
0009 
0010 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
0011 #include "FWCore/Framework/interface/ConsumesCollector.h"
0012 #include "FWCore/Framework/interface/LuminosityBlock.h"
0013 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0014 #include <map>
0015 #include <string>
0016 #include <utility>
0017 
0018 class AlcaBeamSpotManager {
0019 public:
0020   AlcaBeamSpotManager(void);
0021   AlcaBeamSpotManager(const edm::ParameterSet &, edm::ConsumesCollector &&);
0022   virtual ~AlcaBeamSpotManager(void);
0023 
0024   void reset(void);
0025   void readLumi(const edm::LuminosityBlock &);
0026   void createWeightedPayloads(void);
0027   const std::map<edm::LuminosityBlockNumber_t, std::pair<edm::Timestamp, reco::BeamSpot>> &getPayloads(void) {
0028     return beamSpotMap_;
0029   }
0030 
0031   typedef std::map<edm::LuminosityBlockNumber_t, std::pair<edm::Timestamp, reco::BeamSpot>>::iterator bsMap_iterator;
0032 
0033 private:
0034   reco::BeamSpot weight(const bsMap_iterator &begin, const bsMap_iterator &end);
0035   void weight(double &mean, double &meanError, const double &val, const double &valError);
0036   std::pair<float, float> delta(const float &x, const float &xError, const float &nextX, const float &nextXError);
0037   float deltaSig(const float &num, const float &den);
0038   std::map<edm::LuminosityBlockNumber_t, std::pair<edm::Timestamp, reco::BeamSpot>> beamSpotMap_;
0039 
0040   std::string beamSpotOutputBase_;
0041   std::string beamSpotModuleName_;
0042   std::string beamSpotLabel_;
0043   double sigmaZCut_;
0044   edm::InputTag beamSpotTag_;
0045   edm::EDGetTokenT<reco::BeamSpot> beamSpotToken_;
0046 };
0047 
0048 #endif