CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalDccWeightBuilder.h
Go to the documentation of this file.
1 /*
2  * $Id: EcalDccWeightBuilder.h,v 1.6 2009/10/09 15:55:35 pgras Exp $
3  */
4 
5 #ifndef ECALDCCWEIGHTBUILDER_CC
6 #define ECALDCCWEIGHTBUILDER_CC
7 
8 
18 
19 #include <vector>
20 #include <map>
21 #include <inttypes.h>
22 
23 // Forward declarations:
25 
29 private:
31 
32  //constructor(s) and destructor(s)
33 public:
38 
41  virtual ~EcalDccWeightBuilder(){};
42 
43  //method(s)
44 public:
45 
50  void analyze(const edm::Event& event, const edm::EventSetup& es);
51 
52 private:
53 
67  void
68  computeWeights(const EcalShapeBase& shape,
69  int binOfMax, double timePhase,
70  int iFirst0, int nWeights, int iSkip0,
71  std::vector<double>& result);
72 
73  void computeAllWeights(bool withIntercalib);
74 
75  int encodeWeight(double w);
76 
77  double decodeWeight(int W);
78 
79  void unbiasWeights(std::vector<double>& weights,
80  std::vector<int32_t>* encodedWeigths);
81 
86  double intercalib(const DetId& detId);
87 
89  void writeWeightToRootFile();
90  void writeWeightToDB();
91 
92  //converts DetId to IDs used by DB:
93  void dbId(const DetId& detId, int& fedId, int& smId, int& ruId,
94  int& xtalId) const;
95 
102  template<class T>
103  void sort(const std::vector<T>& a,
104  std::vector<int>& s,
105  bool decreasingOrder = false);
106 
107 
108  //attribute(s)
109 protected:
110 private:
116  std::vector<double> inputWeights_;
130  bool sqlMode_;
131 
133 
136  std::map<DetId, std::vector<int> > encodedWeights_;
137 
138  static const double weightScale_;
140 
141  static const int ecalDccFedIdMin = 601;
142  static const int ecalDccFedIdMax = 654;
143  static const int nDccs = ecalDccFedIdMax-ecalDccFedIdMin+1;
144 };
145 
146 #endif //ECALDCCWEIGHTBUILDER_CC not defined
std::map< DetId, std::vector< int > > encodedWeights_
double intercalib(const DetId &detId)
std::vector< double > inputWeights_
edm::ESHandle< CaloGeometry > geom_
static const double weightScale_
void dbId(const DetId &detId, int &fedId, int &smId, int &ruId, int &xtalId) const
void computeWeights(const EcalShapeBase &shape, int binOfMax, double timePhase, int iFirst0, int nWeights, int iSkip0, std::vector< double > &result)
void sort(const std::vector< T > &a, std::vector< int > &s, bool decreasingOrder=false)
EcalIntercalibConstantMap & calibMap_
tuple result
Definition: query.py:137
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
Definition: DetId.h:20
EcalIntercalibConstantMap emptyCalibMap_
void unbiasWeights(std::vector< double > &weights, std::vector< int32_t > *encodedWeigths)
EcalDccWeightBuilder(edm::ParameterSet const &ps)
double a
Definition: hdecay.h:121
void analyze(const edm::Event &event, const edm::EventSetup &es)
T w() const
static const int ecalDccFedIdMax
void computeAllWeights(bool withIntercalib)
const EcalElectronicsMapping * ecalElectronicsMap_
static const int ecalDccFedIdMin