Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:20

0001 /** \file
0002  *
0003  *  \author G. Bruno  - CERN, EP Division
0004  */
0005 #include "DataFormats/FEDRawData/interface/FEDNumbering.h"
0006 #include <cassert>
0007 
0008 using namespace std;
0009 
0010 namespace {
0011 
0012   constexpr std::array<bool, FEDNumbering::FEDNumbering::MAXFEDID + 1> initIn() {
0013     std::array<bool, FEDNumbering::MAXFEDID + 1> in = {{false}};
0014 
0015     int i = 0;
0016     for (i = 0; i < FEDNumbering::lastFEDId(); i++)
0017       in[i] = false;
0018     for (i = FEDNumbering::MINSiPixelFEDID; i <= FEDNumbering::MAXSiPixelFEDID; i++) {
0019       in[i] = true;
0020     }
0021     for (i = FEDNumbering::MINSiStripFEDID; i <= FEDNumbering::MAXSiStripFEDID; i++) {
0022       in[i] = true;
0023     }
0024     for (i = FEDNumbering::MINPreShowerFEDID; i <= FEDNumbering::MAXPreShowerFEDID; i++) {
0025       in[i] = true;
0026     }
0027     for (i = FEDNumbering::MINECALFEDID; i <= FEDNumbering::MAXECALFEDID; i++) {
0028       in[i] = true;
0029     }
0030     for (i = FEDNumbering::MINCASTORFEDID; i <= FEDNumbering::MAXCASTORFEDID; i++) {
0031       in[i] = true;
0032     }
0033     for (i = FEDNumbering::MINHCALFEDID; i <= FEDNumbering::MAXHCALFEDID; i++) {
0034       in[i] = true;
0035     }
0036     for (i = FEDNumbering::MINLUMISCALERSFEDID; i <= FEDNumbering::MAXLUMISCALERSFEDID; i++) {
0037       in[i] = true;
0038     }
0039     for (i = FEDNumbering::MINCSCFEDID; i <= FEDNumbering::MAXCSCFEDID; i++) {
0040       in[i] = true;
0041     }
0042     for (i = FEDNumbering::MINCSCTFFEDID; i <= FEDNumbering::MAXCSCTFFEDID; i++) {
0043       in[i] = true;
0044     }
0045     for (i = FEDNumbering::MINDTFEDID; i <= FEDNumbering::MAXDTFEDID; i++) {
0046       in[i] = true;
0047     }
0048     for (i = FEDNumbering::MINDTTFFEDID; i <= FEDNumbering::MAXDTTFFEDID; i++) {
0049       in[i] = true;
0050     }
0051     for (i = FEDNumbering::MINRPCFEDID; i <= FEDNumbering::MAXRPCFEDID; i++) {
0052       in[i] = true;
0053     }
0054     for (i = FEDNumbering::MINTriggerGTPFEDID; i <= FEDNumbering::MAXTriggerGTPFEDID; i++) {
0055       in[i] = true;
0056     }
0057     for (i = FEDNumbering::MINTriggerEGTPFEDID; i <= FEDNumbering::MAXTriggerEGTPFEDID; i++) {
0058       in[i] = true;
0059     }
0060     for (i = FEDNumbering::MINTriggerGCTFEDID; i <= FEDNumbering::MAXTriggerGCTFEDID; i++) {
0061       in[i] = true;
0062     }
0063     for (i = FEDNumbering::MINTriggerLTCFEDID; i <= FEDNumbering::MAXTriggerLTCFEDID; i++) {
0064       in[i] = true;
0065     }
0066     for (i = FEDNumbering::MINTriggerLTCmtccFEDID; i <= FEDNumbering::MAXTriggerLTCmtccFEDID; i++) {
0067       in[i] = true;
0068     }
0069     for (i = FEDNumbering::MINCSCDDUFEDID; i <= FEDNumbering::MAXCSCDDUFEDID; i++) {
0070       in[i] = true;
0071     }
0072     for (i = FEDNumbering::MINCSCContingencyFEDID; i <= FEDNumbering::MAXCSCContingencyFEDID; i++) {
0073       in[i] = true;
0074     }
0075     for (i = FEDNumbering::MINCSCTFSPFEDID; i <= FEDNumbering::MAXCSCTFSPFEDID; i++) {
0076       in[i] = true;
0077     }
0078     for (i = FEDNumbering::MINDAQeFEDFEDID; i <= FEDNumbering::MAXDAQeFEDFEDID; i++) {
0079       in[i] = true;
0080     }
0081     for (i = FEDNumbering::MINDAQmFEDFEDID; i <= FEDNumbering::MAXDAQmFEDFEDID; i++) {
0082       in[i] = true;
0083     }
0084     for (i = FEDNumbering::MINTCDSuTCAFEDID; i <= FEDNumbering::MAXTCDSuTCAFEDID; i++) {
0085       in[i] = true;
0086     }
0087     for (i = FEDNumbering::MINHCALuTCAFEDID; i <= FEDNumbering::MAXHCALuTCAFEDID; i++) {
0088       in[i] = true;
0089     }
0090     for (i = FEDNumbering::MINSiPixeluTCAFEDID; i <= FEDNumbering::MAXSiPixeluTCAFEDID; i++) {
0091       in[i] = true;
0092     }
0093     for (i = FEDNumbering::MINDTUROSFEDID; i <= FEDNumbering::MAXDTUROSFEDID; i++) {
0094       in[i] = true;
0095     }
0096     for (i = FEDNumbering::MINTriggerUpgradeFEDID; i <= FEDNumbering::MAXTriggerUpgradeFEDID; i++) {
0097       in[i] = true;
0098     }
0099     return in;
0100   }
0101 
0102   constexpr std::array<bool, FEDNumbering::MAXFEDID + 1> in_ = initIn();
0103 
0104 }  // namespace
0105 
0106 bool FEDNumbering::inRange(int i) { return in_[i]; }
0107 bool FEDNumbering::inRangeNoGT(int i) {
0108   if ((i >= MINTriggerGTPFEDID && i <= MAXTriggerGTPFEDID) || (i >= MINTriggerEGTPFEDID && i <= MAXTriggerEGTPFEDID))
0109     return false;
0110   return in_[i];
0111 }