28 static const int MIN_IETA = 1;
29 static const int MIN_IPHI = 1;
30 static const int MAX_IETA = 85;
31 static const int MAX_IPHI = 360;
33 EcalChannelStatusEBMap() :
cond::payloadInspector::Histogram2D<
EcalChannelStatus>(
"ECAL Barrel channel status - map ",
34 "iphi", MAX_IPHI, MIN_IPHI, MAX_IPHI+MIN_IPHI,
"ieta", 2*MAX_IETA+1, -1*MAX_IETA, MAX_IETA+1) {
39 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs ){
41 for (
auto const & iov: iovs) {
45 if (!payload->barrelItems().size())
return false;
47 for(
int iphi = MIN_IPHI; iphi < MAX_IPHI+1; iphi++)
fillWithValue(iphi, 0, -1);
54 if (payload->find(rawid) == payload->end())
continue;
56 float weight = (
float)(*payload)[rawid].getEncodedStatusCode();
71 static const int IX_MIN =1;
75 static const int IY_MIN =1;
79 static const int IX_MAX =100;
83 static const int IY_MAX =100;
84 EcalChannelStatusEEMap() :
cond::payloadInspector::Histogram2D<
EcalChannelStatus>(
"ECAL Endcap channel status - map ",
85 "ix", 2.2*IX_MAX, IX_MIN, 2.2*IX_MAX+1,
"iy", IY_MAX, IY_MIN, IY_MAX+IY_MIN) {
86 Base::setSingleIov(
true );
89 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs ){
91 for (
auto const & iov: iovs) {
92 std::shared_ptr<EcalChannelStatus> payload = Base::fetchPayload( std::get<1>(iov) );
94 if (!payload->endcapItems().size())
return false;
97 for(
int ix = IX_MIN; ix < 2.2*IX_MAX+1; ix++)
98 for(
int iy = IY_MIN; iy < IY_MAX+IY_MIN; iy++)
99 fillWithValue(ix, iy, -1);
101 for(
int iz = -1; iz < 2; iz = iz + 2)
102 for(
int iy = IY_MIN; iy < IY_MAX+IY_MIN; iy++)
103 for(
int ix = IX_MIN; ix < IX_MAX+IX_MIN; ix++)
106 uint32_t rawid = myEEId.
rawId();
108 if (payload->find(rawid) == payload->end())
continue;
110 float weight = (
float)(*payload)[rawid].getEncodedStatusCode();
112 fillWithValue( ix, iy, weight);
114 fillWithValue( ix+IX_MAX+20, iy, weight);
void fillWithValue(float xvalue, float yvalue, float weight=1)
uint32_t rawId() const
get the raw id
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
payload
payload postfix for testing
static const int MIN_HASH
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
void setSingleIov(bool flag)
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
virtual bool fill(const std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs) override