AxisSpecs

BinningType

ObjectType

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
#ifndef MESetBinningUtils_H
#define MESetBinningUtils_H

#include "DQMServices/Core/interface/DQMStore.h"
#include "Geometry/EcalMapping/interface/EcalElectronicsMapping.h"

#include <string>

class DetId;
class EcalElectronicsId;
namespace edm {
  class ParameterSet;
  class ParameterSetDescription;
}  // namespace edm

namespace ecaldqm {
  namespace binning {
    enum ObjectType {
      kEB,
      kEE,
      kEEm,
      kEEp,
      kSM,
      kEBSM,
      kEESM,
      kSMMEM,
      kEBSMMEM,
      kEESMMEM,
      kEcal,
      kMEM,
      kEBMEM,
      kEEMEM,
      kEcal2P,
      kEcal3P,
      kEE2P,
      kMEM2P,
      kChannel,
      nObjType
    };

    enum BinningType {
      kCrystal,
      kTriggerTower,
      kSuperCrystal,
      kPseudoStrip,
      kTCC,
      kDCC,
      kProjEta,
      kProjPhi,
      kRCT,
      kUser,
      kReport,
      kTrend,
      nBinType
    };

    typedef int Constants;
    static constexpr int nPresetBinnings = kRCT + 1, nEBSMEta = 85, nEBSMPhi = 20, nEESMX = 40;
    static constexpr int nEESMXRed = 30;  // for EE+-01&05&09
    static constexpr int nEESMXExt = 45;  //for EE+-02&08
    static constexpr int nEESMY = 40;
    static constexpr int nEESMYRed = 35;  // for EE+-03&07
    static constexpr int nEBEtaBins = 34, nEEEtaBins = 20, nPhiBins = 36;

    struct AxisSpecs {
      int nbins;
      float low, high;
      std::vector<float> edges;
      std::vector<std::string> labels;
      std::string title;
      AxisSpecs() : nbins(0), low(0.), high(0.), edges(0), labels(0), title("") { ; };
    };

    AxisSpecs getBinning(EcalElectronicsMapping const *, ObjectType, BinningType, bool, int, unsigned);

    int findBin1D(EcalElectronicsMapping const *, ObjectType, BinningType, DetId const &);
    int findBin1D(EcalElectronicsMapping const *, ObjectType, BinningType, EcalElectronicsId const &);
    int findBin1D(EcalElectronicsMapping const *, ObjectType, BinningType, int);

    int findBin2D(EcalElectronicsMapping const *, ObjectType, BinningType, DetId const &);
    int findBin2D(EcalElectronicsMapping const *, ObjectType, BinningType, EcalElectronicsId const &);
    int findBin2D(EcalElectronicsMapping const *, ObjectType, BinningType, int);

    unsigned findPlotIndex(EcalElectronicsMapping const *, ObjectType, DetId const &);
    unsigned findPlotIndex(EcalElectronicsMapping const *, ObjectType, EcalElectronicsId const &);
    unsigned findPlotIndex(EcalElectronicsMapping const *, ObjectType, int, BinningType _btype = kDCC);

    ObjectType getObject(ObjectType, unsigned);

    unsigned getNObjects(ObjectType);

    bool isValidIdBin(EcalElectronicsMapping const *, ObjectType, BinningType, unsigned, int);

    std::string channelName(EcalElectronicsMapping const *, uint32_t, BinningType _btype = kDCC);

    uint32_t idFromName(std::string const &);
    uint32_t idFromBin(ObjectType, BinningType, unsigned, int);

    AxisSpecs formAxis(edm::ParameterSet const &);
    void fillAxisDescriptions(edm::ParameterSetDescription &);

    ObjectType translateObjectType(std::string const &);
    BinningType translateBinningType(std::string const &);
    dqm::legacy::MonitorElement::Kind translateKind(std::string const &);

    /* Functions used only internally within binning namespace */

    // used for SM binnings
    int xlow_(int);
    int ylow_(int);

    AxisSpecs getBinningEB_(BinningType, bool, int);
    AxisSpecs getBinningEE_(BinningType, bool, int, int);
    AxisSpecs getBinningSM_(BinningType, bool, unsigned, int, EcalElectronicsMapping const *);
    AxisSpecs getBinningSMMEM_(BinningType, bool, unsigned, int);
    AxisSpecs getBinningEcal_(BinningType, bool, int);
    AxisSpecs getBinningMEM_(BinningType, bool, int, int);

    int findBinCrystal_(EcalElectronicsMapping const *, ObjectType, DetId const &, int = -1);
    int findBinCrystal_(EcalElectronicsMapping const *, ObjectType, EcalElectronicsId const &);
    int findBinTriggerTower_(EcalElectronicsMapping const *, ObjectType, DetId const &);
    int findBinPseudoStrip_(EcalElectronicsMapping const *, ObjectType, DetId const &);
    int findBinRCT_(ObjectType, DetId const &);
    int findBinSuperCrystal_(EcalElectronicsMapping const *, ObjectType, DetId const &, int = -1);
    int findBinSuperCrystal_(EcalElectronicsMapping const *, ObjectType, EcalElectronicsId const &);
  }  // namespace binning
}  // namespace ecaldqm

#endif